From 22d10351eabd55d4a11d5f89e36ddd4cc2ac4bc5 Mon Sep 17 00:00:00 2001 From: techbech Date: Thu, 5 Oct 2023 10:31:14 +0200 Subject: [PATCH] test --- .lock-waf_linux_build | 8 +- CMakeLists.txt | 10 + test/cpp/.clang-format | 2 + test/cpp/src.pb.cc | 1380 ++++++++++++++++++++++++++++++++ test/cpp/src.pb.h | 1699 ++++++++++++++++++++++++++++++++++++++++ test/src.proto | 56 ++ wscript | 35 +- 7 files changed, 3184 insertions(+), 6 deletions(-) create mode 100644 test/cpp/.clang-format create mode 100644 test/cpp/src.pb.cc create mode 100644 test/cpp/src.pb.h create mode 100644 test/src.proto diff --git a/.lock-waf_linux_build b/.lock-waf_linux_build index b102295..ce8e208 100644 --- a/.lock-waf_linux_build +++ b/.lock-waf_linux_build @@ -1,10 +1,10 @@ -argv = ['./waf', 'configure'] +argv = ['./waf', 'configure', '--with_protoc'] config_cmd = 'configure' -environ = {'SHELL': '/bin/bash', 'QT_ACCESSIBILITY': '1', 'COLORTERM': 'truecolor', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-i3:/etc/xdg', 'TERM_PROGRAM_VERSION': '1.82.2', 'XDG_CONFIG_DIRS_VSCODE_SNAP_ORIG': '/etc/xdg/xdg-i3:/etc/xdg', 'GTK_IM_MODULE': 'ibus', 'GDK_BACKEND_VSCODE_SNAP_ORIG': '', 'LANGUAGE': 'en_US:en', 'I3SOCK': '/run/user/1000/i3/ipc-socket.3565', 'GIO_MODULE_DIR_VSCODE_SNAP_ORIG': '', 'XMODIFIERS': '@im=ibus', 'DESKTOP_SESSION': 'i3', 'NO_AT_BRIDGE': '1', 'GTK_MODULES': 'gail:atk-bridge', 'XDG_SEAT': 'seat0', 'PWD': '/home/peteck/dev/protobuf', 'GSETTINGS_SCHEMA_DIR': '/home/peteck/snap/code/140/.local/share/glib-2.0/schemas', 'XDG_SESSION_DESKTOP': 'i3', 'LOGNAME': 'peteck', 'GTK_EXE_PREFIX': '/snap/code/140/usr', 'XDG_SESSION_TYPE': 'x11', 'GPG_AGENT_INFO': '/run/user/1000/gnupg/S.gpg-agent:0:1', 'SYSTEMD_EXEC_PID': '3421', 'CXX': '/usr/bin/clang++-12', 'XAUTHORITY': '/run/user/1000/gdm/Xauthority', 'VSCODE_GIT_ASKPASS_NODE': '/snap/code/140/usr/share/code/code', 'WINDOWPATH': '2', 'HOME': '/home/peteck', 'USERNAME': 'peteck', 'LANG': 'en_US.UTF-8', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'XDG_CURRENT_DESKTOP': 'i3', 'GIT_ASKPASS': '/snap/code/140/usr/share/code/resources/app/extensions/git/dist/askpass.sh', 'CHROME_DESKTOP': 'code-url-handler.desktop', 'CLUTTER_IM_MODULE': 'ibus', 'VSCODE_GIT_ASKPASS_EXTRA_ARGS': '--ms-enable-electron-run-as-node', 'GSETTINGS_SCHEMA_DIR_VSCODE_SNAP_ORIG': '', 'GTK_IM_MODULE_FILE_VSCODE_SNAP_ORIG': '', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'XDG_SESSION_CLASS': 'user', 'TERM': 'vt100', 'GTK_PATH': '/snap/code/140/usr/lib/x86_64-linux-gnu/gtk-3.0', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'USER': 'peteck', 'GTK_PATH_VSCODE_SNAP_ORIG': '', 'VSCODE_GIT_IPC_HANDLE': '/run/user/1000/vscode-git-e505250194.sock', 'DISPLAY': ':0', 'SHLVL': '2', 'LOCPATH': '/snap/code/140/usr/lib/locale', 'QT_IM_MODULE': 'ibus', 'XDG_VTNR': '2', 'GTK_EXE_PREFIX_VSCODE_SNAP_ORIG': '', 'XDG_SESSION_ID': '2', 'XDG_RUNTIME_DIR': '/run/user/1000', 'XDG_DATA_DIRS_VSCODE_SNAP_ORIG': '/usr/share/i3:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'VSCODE_GIT_ASKPASS_MAIN': '/snap/code/140/usr/share/code/resources/app/extensions/git/dist/askpass-main.js', 'XDG_DATA_DIRS': '/home/peteck/snap/code/140/.local/share:/home/peteck/snap/code/140:/snap/code/140/usr/share:/usr/share/i3:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'GDK_BACKEND': 'x11', 'PATH': '/home/peteck/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin:/home/peteck/go/bin', 'CC': '/usr/bin/clang-12', 'GDMSESSION': 'i3', 'ORIGINAL_XDG_CURRENT_DESKTOP': 'i3', 'GTK_IM_MODULE_FILE': '/home/peteck/snap/code/common/.cache/immodules/immodules.cache', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'LOCPATH_VSCODE_SNAP_ORIG': '', 'GIO_MODULE_DIR': '/home/peteck/snap/code/common/.cache/gio-modules', 'TERM_PROGRAM': 'vscode', '_': './waf'} +environ = {'SHELL': '/bin/bash', 'QT_ACCESSIBILITY': '1', 'SNAP_REVISION': '250', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-i3:/etc/xdg', 'GTK_IM_MODULE': 'ibus', 'SNAP_REAL_HOME': '/home/peteck', 'TERMINAL_EMULATOR': 'JetBrains-JediTerm', 'SNAP_USER_COMMON': '/home/peteck/snap/clion/common', 'LANGUAGE': 'en_US:en', 'I3SOCK': '/run/user/1000/i3/ipc-socket.3485', 'TERM_SESSION_ID': '9ba1524b-53d9-4f8a-8802-777061e946f6', 'SNAP_INSTANCE_KEY': '', 'XMODIFIERS': '@im=ibus', 'DESKTOP_SESSION': 'i3', 'GTK_MODULES': 'gail:atk-bridge', 'XDG_SEAT': 'seat0', 'SNAP_EUID': '1000', 'PWD': '/home/peteck/dev/protobuf', 'XDG_SESSION_DESKTOP': 'i3', 'LOGNAME': 'peteck', 'XDG_SESSION_TYPE': 'x11', 'GPG_AGENT_INFO': '/run/user/1000/gnupg/S.gpg-agent:0:1', 'SYSTEMD_EXEC_PID': '3358', 'CXX': '/usr/bin/clang++-12', 'XAUTHORITY': '/run/user/1000/gdm/Xauthority', 'SNAP_CONTEXT': 'J6-u40jA9c2_NpUWZreb8rl-L23G_E7TsI2EEcBGI0D5uS2hAOol', 'WINDOWPATH': '2', 'HOME': '/home/peteck', 'USERNAME': 'peteck', 'LANG': 'en_US.UTF-8', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'XDG_CURRENT_DESKTOP': 'i3', 'SNAP_ARCH': 'amd64', 'SNAP_INSTANCE_NAME': 'clion', 'SNAP_USER_DATA': '/home/peteck/snap/clion/250', 'SNAP_REEXEC': '', 'SNAP_UID': '1000', 'CLUTTER_IM_MODULE': 'ibus', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'XDG_SESSION_CLASS': 'user', 'TERM': 'vt100', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'USER': 'peteck', 'SNAP': '/snap/clion/250', 'SNAP_COMMON': '/var/snap/clion/common', 'SNAP_VERSION': '2023.2.2', 'DISPLAY': ':0', 'SHLVL': '2', 'SNAP_LIBRARY_PATH': '/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void', 'SNAP_COOKIE': 'J6-u40jA9c2_NpUWZreb8rl-L23G_E7TsI2EEcBGI0D5uS2hAOol', 'QT_IM_MODULE': 'ibus', 'XDG_VTNR': '2', 'XDG_SESSION_ID': '2', 'SNAP_DATA': '/var/snap/clion/250', 'XDG_RUNTIME_DIR': '/run/user/1000', 'FIG_JETBRAINS_SHELL_INTEGRATION': '1', 'SNAP_NAME': 'clion', 'XDG_DATA_DIRS': '/usr/share/i3:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'PATH': '/home/peteck/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin:/home/peteck/go/bin', 'CC': '/usr/bin/clang-12', 'GDMSESSION': 'i3', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', '_': './waf', 'OLDPWD': '/home/peteck/dev'} files = ['/home/peteck/dev/protobuf/resolve_symlinks/waf-tools/wscript', '/home/peteck/dev/protobuf/wscript'] -hash = b't\xf2\xe0\xbdT\xe5\x95\xcbN`=\x0b\x10\x80\x02\x15' +hash = b'\x83\x82\x12\xe5N\x0e\xef*\x96\xc4\x1f\xcdq/\xd5\x18' launch_dir = '/home/peteck/dev/protobuf' -options = {'colors': 'auto', 'jobs': 16, 'keep': 0, 'verbose': 0, 'zones': '', 'profile': 0, 'pdb': 0, 'whelp': 0, 'out': '', 'top': '', 'no_lock_in_run': '', 'no_lock_in_out': '', 'no_lock_in_top': '', 'prefix': '', 'bindir': None, 'libdir': None, 'progress_bar': 0, 'targets': '', 'files': '', 'destdir': '/home/peteck/dev/protobuf/protobuf_install', 'force': False, 'distcheck_args': None, 'no_resolve': False, 'skip_internal': False, 'standalone_archive': None, 'standalone_algo': 'zip', 'standalone_exclude': None, 'install_path': None, 'install_relative': None, 'install_shared_libs': None, 'install_static_libs': None, 'cxx_mkspec': None, 'cxx_debug': None, 'cxx_nodebug': None, 'cflags': None, 'cxxflags': None, 'linkflags': None, 'commonflags': None, 'android_sdk_dir': None, 'android_ndk_dir': None, 'ios_sdk_dir': None, 'ios_toolchain_dir': None, 'emscripten_path': None, 'poky_sdk_path': None, 'run_tests': None, 'run_silent': None, 'run_benchmarks': None, 'run_benchmark': None, 'print_benchmarks': None, 'print_benchmark_paths': None, 'run_cmd': None, 'result_file': None, 'result_folder': None, 'device_id': None, 'test_filter': None, 'ssh_runner': None, 'ssh_user': None, 'ssh_host': None, 'ssh_dest_dir': None, 'ssh_clean_dir': None, 'ssh_output_file': None, 'ssh_options': None, 'scp_options': None, 'with_protoc': None, 'resolve_path': None, 'git_protocol': None, 'symlinks_path': None, 'fast_resolve': None, 'lock_paths': None, 'lock_versions': None, 'waf_tools_path': None, 'waf_tools_checkout': None, 'protobuf_source_path': None, 'protobuf_source_checkout': None} +options = {'colors': 'auto', 'jobs': 16, 'keep': 0, 'verbose': 0, 'zones': '', 'profile': 0, 'pdb': 0, 'whelp': 0, 'out': '', 'top': '', 'no_lock_in_run': '', 'no_lock_in_out': '', 'no_lock_in_top': '', 'prefix': '', 'bindir': None, 'libdir': None, 'progress_bar': 0, 'targets': '', 'files': '', 'destdir': '/home/peteck/dev/protobuf/protobuf_install', 'force': False, 'distcheck_args': None, 'no_resolve': False, 'skip_internal': False, 'standalone_archive': None, 'standalone_algo': 'zip', 'standalone_exclude': None, 'install_path': None, 'install_relative': None, 'install_shared_libs': None, 'install_static_libs': None, 'cxx_mkspec': None, 'cxx_debug': None, 'cxx_nodebug': None, 'cflags': None, 'cxxflags': None, 'linkflags': None, 'commonflags': None, 'android_sdk_dir': None, 'android_ndk_dir': None, 'ios_sdk_dir': None, 'ios_toolchain_dir': None, 'emscripten_path': None, 'poky_sdk_path': None, 'run_tests': None, 'run_silent': None, 'run_benchmarks': None, 'run_benchmark': None, 'print_benchmarks': None, 'print_benchmark_paths': None, 'run_cmd': None, 'result_file': None, 'result_folder': None, 'device_id': None, 'test_filter': None, 'ssh_runner': None, 'ssh_user': None, 'ssh_host': None, 'ssh_dest_dir': None, 'ssh_clean_dir': None, 'ssh_output_file': None, 'ssh_options': None, 'scp_options': None, 'with_protoc': True, 'resolve_path': None, 'git_protocol': None, 'symlinks_path': None, 'fast_resolve': None, 'lock_paths': None, 'lock_versions': None, 'waf_tools_path': None, 'waf_tools_checkout': None, 'protobuf_source_path': None, 'protobuf_source_checkout': None} out_dir = '/home/peteck/dev/protobuf/build/linux' run_dir = '/home/peteck/dev/protobuf' top_dir = '/home/peteck/dev/protobuf' diff --git a/CMakeLists.txt b/CMakeLists.txt index 28fbb2f..0d255ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,10 @@ list(FILTER sw_protobuf_abseil_sources EXCLUDE REGEX .*absl\/.*\/.*testing.*) list(FILTER sw_protobuf_abseil_sources EXCLUDE REGEX .*absl\/.*\/.*benchmark.*) list(FILTER sw_protobuf_abseil_sources EXCLUDE REGEX .*absl\/.*\/.*mock.*) +if(APPLE) + target_link_libraries(sw_protobuf_abseil_sources "-framework CoreFoundation") +endif() + add_library(sw_protobuf_abseil STATIC ${sw_protobuf_abseil_sources}) target_include_directories(sw_protobuf_abseil PUBLIC ${STEINWURF_RESOLVE}/protobuf-source/third_party/abseil-cpp) @@ -56,3 +60,9 @@ target_link_libraries(sw_protobuf PUBLIC sw_protobuf_abseil sw_protobuf_utf8_ran target_include_directories(sw_protobuf PUBLIC ${STEINWURF_RESOLVE}/protobuf-source/src) add_library(steinwurf::protobuf ALIAS sw_protobuf) + +# Is top level project? +if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) + add_library(sw_protobuf_test STATIC test/cpp/src.pb.cc) + target_link_libraries(sw_protobuf_test PUBLIC sw_protobuf) +endif() diff --git a/test/cpp/.clang-format b/test/cpp/.clang-format new file mode 100644 index 0000000..9d15924 --- /dev/null +++ b/test/cpp/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff --git a/test/cpp/src.pb.cc b/test/cpp/src.pb.cc new file mode 100644 index 0000000..7342fda --- /dev/null +++ b/test/cpp/src.pb.cc @@ -0,0 +1,1380 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src.proto + +#include "src.pb.h" + +#include +#include "google/protobuf/io/coded_stream.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" +#include "google/protobuf/generated_message_tctable_impl.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" +PROTOBUF_PRAGMA_INIT_SEG +namespace _pb = ::google::protobuf; +namespace _pbi = ::google::protobuf::internal; +namespace _fl = ::google::protobuf::internal::field_layout; +namespace protobuf { + template +PROTOBUF_CONSTEXPR Info::Info(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.name_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.type_)*/ 0, + /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.min_)*/ {}, + /*decltype(_impl_.max_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, + } {} +struct InfoDefaultTypeInternal { + PROTOBUF_CONSTEXPR InfoDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~InfoDefaultTypeInternal() {} + union { + Info _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InfoDefaultTypeInternal _Info_default_instance_; + template +PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.info_)*/ nullptr, + /*decltype(_impl_.value_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, + } {} +struct MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~MetricDefaultTypeInternal() {} + union { + Metric _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricDefaultTypeInternal _Metric_default_instance_; + template +PROTOBUF_CONSTEXPR Metrics::Metrics(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.metric_)*/ {}, + /*decltype(_impl_.protocol_version_)*/ 0u, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct MetricsDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetricsDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~MetricsDefaultTypeInternal() {} + union { + Metrics _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsDefaultTypeInternal _Metrics_default_instance_; +} // namespace protobuf +static ::_pb::Metadata file_level_metadata_src_2eproto[3]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_src_2eproto[2]; +static constexpr const ::_pb::ServiceDescriptor** + file_level_service_descriptors_src_2eproto = nullptr; +const ::uint32_t TableStruct_src_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( + protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_.unit_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_.max_), + PROTOBUF_FIELD_OFFSET(::protobuf::Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::protobuf::Metric, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::protobuf::Metric, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::protobuf::Metric, _impl_.info_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::protobuf::Metric, _impl_.value_), + 0, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::protobuf::Metrics, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::protobuf::Metrics, _impl_.protocol_version_), + PROTOBUF_FIELD_OFFSET(::protobuf::Metrics, _impl_.metric_), +}; + +static const ::_pbi::MigrationSchema + schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + {0, -1, -1, sizeof(::protobuf::Info)}, + {21, 35, -1, sizeof(::protobuf::Metric)}, + {40, -1, -1, sizeof(::protobuf::Metrics)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::protobuf::_Info_default_instance_._instance, + &::protobuf::_Metric_default_instance_._instance, + &::protobuf::_Metrics_default_instance_._instance, +}; +const char descriptor_table_protodef_src_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + "\n\tsrc.proto\022\010protobuf\"\205\002\n\004Info\022\014\n\004name\030\001" + " \001(\t\022\023\n\013description\030\002 \001(\t\022\034\n\004type\030\003 \001(\0162" + "\016.protobuf.Type\022\034\n\004kind\030\004 \001(\0162\016.protobuf" + ".Kind\022\014\n\004unit\030\005 \001(\t\022\024\n\nuint64_min\030\006 \001(\004H" + "\000\022\023\n\tint64_min\030\007 \001(\003H\000\022\025\n\013float64_min\030\010 " + "\001(\001H\000\022\024\n\nuint64_max\030\t \001(\004H\001\022\023\n\tint64_max" + "\030\n \001(\003H\001\022\025\n\013float64_max\030\013 \001(\001H\001B\005\n\003minB\005" + "\n\003max\"\233\001\n\006Metric\022!\n\004info\030\001 \001(\0132\016.protobu" + "f.InfoH\001\210\001\001\022\026\n\014uint64_value\030\002 \001(\004H\000\022\025\n\013i" + "nt64_value\030\003 \001(\003H\000\022\027\n\rfloat64_value\030\004 \001(" + "\001H\000\022\024\n\nbool_value\030\005 \001(\010H\000B\007\n\005valueB\007\n\005_i" + "nfo\"E\n\007Metrics\022\030\n\020protocol_version\030\001 \001(\r" + "\022 \n\006metric\030\002 \003(\0132\020.protobuf.Metric*,\n\004Ki" + "nd\022\013\n\007COUNTER\020\000\022\014\n\010CONSTANT\020\001\022\t\n\005GAUGE\020\002" + "*4\n\004Type\022\n\n\006UINT64\020\000\022\t\n\005INT64\020\001\022\013\n\007FLOAT" + "64\020\002\022\010\n\004BOOL\020\003b\006proto3" +}; +static ::absl::once_flag descriptor_table_src_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_src_2eproto = { + false, + false, + 622, + descriptor_table_protodef_src_2eproto, + "src.proto", + &descriptor_table_src_2eproto_once, + nullptr, + 0, + 3, + schemas, + file_default_instances, + TableStruct_src_2eproto::offsets, + file_level_metadata_src_2eproto, + file_level_enum_descriptors_src_2eproto, + file_level_service_descriptors_src_2eproto, +}; + +// This function exists to be marked as weak. +// It can significantly speed up compilation by breaking up LLVM's SCC +// in the .pb.cc translation units. Large translation units see a +// reduction of more than 35% of walltime for optimized builds. Without +// the weak attribute all the messages in the file, including all the +// vtables and everything they use become part of the same SCC through +// a cycle like: +// GetMetadata -> descriptor table -> default instances -> +// vtables -> GetMetadata +// By adding a weak function here we break the connection from the +// individual vtables back into the descriptor table. +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_src_2eproto_getter() { + return &descriptor_table_src_2eproto; +} +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 +static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_src_2eproto(&descriptor_table_src_2eproto); +namespace protobuf { +const ::google::protobuf::EnumDescriptor* Kind_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_src_2eproto); + return file_level_enum_descriptors_src_2eproto[0]; +} +bool Kind_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} +const ::google::protobuf::EnumDescriptor* Type_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_src_2eproto); + return file_level_enum_descriptors_src_2eproto[1]; +} +bool Type_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} +// =================================================================== + +class Info::_Internal { + public: + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::protobuf::Info, _impl_._oneof_case_); +}; + +Info::Info(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:protobuf.Info) +} +Info::Info(const Info& from) : ::google::protobuf::Message() { + Info* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.name_){}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.type_){}, + decltype(_impl_.kind_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_name().empty()) { + _this->_impl_.name_.Set(from._internal_name(), _this->GetArenaForAllocation()); + } + _impl_.description_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.description_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_description().empty()) { + _this->_impl_.description_.Set(from._internal_description(), _this->GetArenaForAllocation()); + } + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_unit().empty()) { + _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.type_, &from._impl_.type_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.kind_)); + clear_has_min(); + switch (from.min_case()) { + case kUint64Min: { + _this->_internal_set_uint64_min(from._internal_uint64_min()); + break; + } + case kInt64Min: { + _this->_internal_set_int64_min(from._internal_int64_min()); + break; + } + case kFloat64Min: { + _this->_internal_set_float64_min(from._internal_float64_min()); + break; + } + case MIN_NOT_SET: { + break; + } + } + clear_has_max(); + switch (from.max_case()) { + case kUint64Max: { + _this->_internal_set_uint64_max(from._internal_uint64_max()); + break; + } + case kInt64Max: { + _this->_internal_set_int64_max(from._internal_int64_max()); + break; + } + case kFloat64Max: { + _this->_internal_set_float64_max(from._internal_float64_max()); + break; + } + case MAX_NOT_SET: { + break; + } + } + + // @@protoc_insertion_point(copy_constructor:protobuf.Info) +} +inline void Info::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.name_){}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.type_){0}, + decltype(_impl_.kind_){0}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.description_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.description_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_min(); + clear_has_max(); +} +Info::~Info() { + // @@protoc_insertion_point(destructor:protobuf.Info) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Info::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); + _impl_.description_.Destroy(); + _impl_.unit_.Destroy(); + if (has_min()) { + clear_min(); + } + if (has_max()) { + clear_max(); + } +} +void Info::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Info::clear_min() { +// @@protoc_insertion_point(one_of_clear_start:protobuf.Info) + switch (min_case()) { + case kUint64Min: { + // No need to clear + break; + } + case kInt64Min: { + // No need to clear + break; + } + case kFloat64Min: { + // No need to clear + break; + } + case MIN_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = MIN_NOT_SET; +} + +void Info::clear_max() { +// @@protoc_insertion_point(one_of_clear_start:protobuf.Info) + switch (max_case()) { + case kUint64Max: { + // No need to clear + break; + } + case kInt64Max: { + // No need to clear + break; + } + case kFloat64Max: { + // No need to clear + break; + } + case MAX_NOT_SET: { + break; + } + } + _impl_._oneof_case_[1] = MAX_NOT_SET; +} + + +PROTOBUF_NOINLINE void Info::Clear() { +// @@protoc_insertion_point(message_clear_start:protobuf.Info) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.name_.ClearToEmpty(); + _impl_.description_.ClearToEmpty(); + _impl_.unit_.ClearToEmpty(); + ::memset(&_impl_.type_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.kind_)); + clear_min(); + clear_max(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Info::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<3, 11, 0, 49, 2> Info::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 11, 56, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294965248, // skipmap + offsetof(decltype(_table_), field_entries), + 11, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_Info_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string name = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Info, _impl_.name_)}}, + // string description = 2; + {::_pbi::TcParser::FastUS1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Info, _impl_.description_)}}, + // .protobuf.Type type = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Info, _impl_.type_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Info, _impl_.type_)}}, + // .protobuf.Kind kind = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Info, _impl_.kind_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Info, _impl_.kind_)}}, + // string unit = 5; + {::_pbi::TcParser::FastUS1, + {42, 63, 0, PROTOBUF_FIELD_OFFSET(Info, _impl_.unit_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // string name = 1; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.name_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string description = 2; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.description_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .protobuf.Type type = 3; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.type_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .protobuf.Kind kind = 4; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // string unit = 5; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // uint64 uint64_min = 6; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.min_.uint64_min_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt64)}, + // int64 int64_min = 7; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.min_.int64_min_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kInt64)}, + // double float64_min = 8; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.min_.float64_min_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + // uint64 uint64_max = 9; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.max_.uint64_max_), _Internal::kOneofCaseOffset + 4, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt64)}, + // int64 int64_max = 10; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.max_.int64_max_), _Internal::kOneofCaseOffset + 4, 0, + (0 | ::_fl::kFcOneof | ::_fl::kInt64)}, + // double float64_max = 11; + {PROTOBUF_FIELD_OFFSET(Info, _impl_.max_.float64_max_), _Internal::kOneofCaseOffset + 4, 0, + (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + }}, + // no aux_entries + {{ + "\15\4\13\0\0\4\0\0\0\0\0\0\0\0\0\0" + "protobuf.Info" + "name" + "description" + "unit" + }}, +}; + +::uint8_t* Info::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:protobuf.Info) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string name = 1; + if (!this->_internal_name().empty()) { + const std::string& _s = this->_internal_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "protobuf.Info.name"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // string description = 2; + if (!this->_internal_description().empty()) { + const std::string& _s = this->_internal_description(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "protobuf.Info.description"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + + // .protobuf.Type type = 3; + if (this->_internal_type() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this->_internal_type(), target); + } + + // .protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_kind(), target); + } + + // string unit = 5; + if (!this->_internal_unit().empty()) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "protobuf.Info.unit"); + target = stream->WriteStringMaybeAliased(5, _s, target); + } + + switch (min_case()) { + case kUint64Min: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 6, this->_internal_uint64_min(), target); + break; + } + case kInt64Min: { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64ToArrayWithField<7>( + stream, this->_internal_int64_min(), target); + break; + } + case kFloat64Min: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 8, this->_internal_float64_min(), target); + break; + } + default: + break; + } + switch (max_case()) { + case kUint64Max: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 9, this->_internal_uint64_max(), target); + break; + } + case kInt64Max: { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64ToArrayWithField<10>( + stream, this->_internal_int64_max(), target); + break; + } + case kFloat64Max: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 11, this->_internal_float64_max(), target); + break; + } + default: + break; + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:protobuf.Info) + return target; +} + +::size_t Info::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:protobuf.Info) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string name = 1; + if (!this->_internal_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // string description = 2; + if (!this->_internal_description().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + // string unit = 5; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // .protobuf.Type type = 3; + if (this->_internal_type() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + } + + // .protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + switch (min_case()) { + // uint64 uint64_min = 6; + case kUint64Min: { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_uint64_min()); + break; + } + // int64 int64_min = 7; + case kInt64Min: { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_int64_min()); + break; + } + // double float64_min = 8; + case kFloat64Min: { + total_size += 9; + break; + } + case MIN_NOT_SET: { + break; + } + } + switch (max_case()) { + // uint64 uint64_max = 9; + case kUint64Max: { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_uint64_max()); + break; + } + // int64 int64_max = 10; + case kInt64Max: { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_int64_max()); + break; + } + // double float64_max = 11; + case kFloat64Max: { + total_size += 9; + break; + } + case MAX_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Info::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Info::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Info::GetClassData() const { return &_class_data_; } + + +void Info::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.Info) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); + } + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_type() != 0) { + _this->_internal_set_type(from._internal_type()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + switch (from.min_case()) { + case kUint64Min: { + _this->_internal_set_uint64_min(from._internal_uint64_min()); + break; + } + case kInt64Min: { + _this->_internal_set_int64_min(from._internal_int64_min()); + break; + } + case kFloat64Min: { + _this->_internal_set_float64_min(from._internal_float64_min()); + break; + } + case MIN_NOT_SET: { + break; + } + } + switch (from.max_case()) { + case kUint64Max: { + _this->_internal_set_uint64_max(from._internal_uint64_max()); + break; + } + case kInt64Max: { + _this->_internal_set_int64_max(from._internal_int64_max()); + break; + } + case kFloat64Max: { + _this->_internal_set_float64_max(from._internal_float64_max()); + break; + } + case MAX_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Info::CopyFrom(const Info& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:protobuf.Info) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Info::IsInitialized() const { + return true; +} + +void Info::InternalSwap(Info* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, + &other->_impl_.description_, rhs_arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Info, _impl_.kind_) + + sizeof(Info::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(Info, _impl_.type_)>( + reinterpret_cast(&_impl_.type_), + reinterpret_cast(&other->_impl_.type_)); + swap(_impl_.min_, other->_impl_.min_); + swap(_impl_.max_, other->_impl_.max_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + swap(_impl_._oneof_case_[1], other->_impl_._oneof_case_[1]); +} + +::google::protobuf::Metadata Info::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_src_2eproto_getter, &descriptor_table_src_2eproto_once, + file_level_metadata_src_2eproto[0]); +} +// =================================================================== + +class Metric::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::protobuf::Metric, _impl_._oneof_case_); + static const ::protobuf::Info& info(const Metric* msg); + static void set_has_info(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +const ::protobuf::Info& Metric::_Internal::info(const Metric* msg) { + return *msg->_impl_.info_; +} +Metric::Metric(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:protobuf.Metric) +} +Metric::Metric(const Metric& from) : ::google::protobuf::Message() { + Metric* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.info_){nullptr}, + decltype(_impl_.value_){}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.info_ = new ::protobuf::Info(*from._impl_.info_); + } + clear_has_value(); + switch (from.value_case()) { + case kUint64Value: { + _this->_internal_set_uint64_value(from._internal_uint64_value()); + break; + } + case kInt64Value: { + _this->_internal_set_int64_value(from._internal_int64_value()); + break; + } + case kFloat64Value: { + _this->_internal_set_float64_value(from._internal_float64_value()); + break; + } + case kBoolValue: { + _this->_internal_set_bool_value(from._internal_bool_value()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + + // @@protoc_insertion_point(copy_constructor:protobuf.Metric) +} +inline void Metric::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.info_){nullptr}, + decltype(_impl_.value_){}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + clear_has_value(); +} +Metric::~Metric() { + // @@protoc_insertion_point(destructor:protobuf.Metric) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Metric::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.info_; + if (has_value()) { + clear_value(); + } +} +void Metric::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Metric::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:protobuf.Metric) + switch (value_case()) { + case kUint64Value: { + // No need to clear + break; + } + case kInt64Value: { + // No need to clear + break; + } + case kFloat64Value: { + // No need to clear + break; + } + case kBoolValue: { + // No need to clear + break; + } + case VALUE_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = VALUE_NOT_SET; +} + + +PROTOBUF_NOINLINE void Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:protobuf.Metric) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.info_ != nullptr); + _impl_.info_->Clear(); + } + clear_value(); + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Metric::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 5, 1, 0, 2> Metric::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Metric, _impl_._has_bits_), + 0, // no _extensions_ + 5, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967264, // skipmap + offsetof(decltype(_table_), field_entries), + 5, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_Metric_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // optional .protobuf.Info info = 1; + {::_pbi::TcParser::FastMtS1, + {10, 0, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.info_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional .protobuf.Info info = 1; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.info_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // uint64 uint64_value = 2; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_.uint64_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt64)}, + // int64 int64_value = 3; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_.int64_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kInt64)}, + // double float64_value = 4; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_.float64_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + // bool bool_value = 5; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_.bool_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kBool)}, + }}, {{ + {::_pbi::TcParser::GetTable<::protobuf::Info>()}, + }}, {{ + }}, +}; + +::uint8_t* Metric::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:protobuf.Metric) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // optional .protobuf.Info info = 1; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::info(this), + _Internal::info(this).GetCachedSize(), target, stream); + } + + switch (value_case()) { + case kUint64Value: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 2, this->_internal_uint64_value(), target); + break; + } + case kInt64Value: { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64ToArrayWithField<3>( + stream, this->_internal_int64_value(), target); + break; + } + case kFloat64Value: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 4, this->_internal_float64_value(), target); + break; + } + case kBoolValue: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 5, this->_internal_bool_value(), target); + break; + } + default: + break; + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:protobuf.Metric) + return target; +} + +::size_t Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:protobuf.Metric) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // optional .protobuf.Info info = 1; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.info_); + } + + switch (value_case()) { + // uint64 uint64_value = 2; + case kUint64Value: { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_uint64_value()); + break; + } + // int64 int64_value = 3; + case kInt64Value: { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_int64_value()); + break; + } + // double float64_value = 4; + case kFloat64Value: { + total_size += 9; + break; + } + // bool bool_value = 5; + case kBoolValue: { + total_size += 2; + break; + } + case VALUE_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Metric::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Metric::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Metric::GetClassData() const { return &_class_data_; } + + +void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.Metric) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_mutable_info()->::protobuf::Info::MergeFrom( + from._internal_info()); + } + switch (from.value_case()) { + case kUint64Value: { + _this->_internal_set_uint64_value(from._internal_uint64_value()); + break; + } + case kInt64Value: { + _this->_internal_set_int64_value(from._internal_int64_value()); + break; + } + case kFloat64Value: { + _this->_internal_set_float64_value(from._internal_float64_value()); + break; + } + case kBoolValue: { + _this->_internal_set_bool_value(from._internal_bool_value()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Metric::CopyFrom(const Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:protobuf.Metric) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Metric::IsInitialized() const { + return true; +} + +void Metric::InternalSwap(Metric* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + swap(_impl_.info_, other->_impl_.info_); + swap(_impl_.value_, other->_impl_.value_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::google::protobuf::Metadata Metric::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_src_2eproto_getter, &descriptor_table_src_2eproto_once, + file_level_metadata_src_2eproto[1]); +} +// =================================================================== + +class Metrics::_Internal { + public: +}; + +Metrics::Metrics(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:protobuf.Metrics) +} +Metrics::Metrics(const Metrics& from) : ::google::protobuf::Message() { + Metrics* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.metric_){from._impl_.metric_}, + decltype(_impl_.protocol_version_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _this->_impl_.protocol_version_ = from._impl_.protocol_version_; + + // @@protoc_insertion_point(copy_constructor:protobuf.Metrics) +} +inline void Metrics::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.metric_){arena}, + decltype(_impl_.protocol_version_){0u}, + /*decltype(_impl_._cached_size_)*/ {}, + }; +} +Metrics::~Metrics() { + // @@protoc_insertion_point(destructor:protobuf.Metrics) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Metrics::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.metric_.~RepeatedPtrField(); +} +void Metrics::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void Metrics::Clear() { +// @@protoc_insertion_point(message_clear_start:protobuf.Metrics) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_mutable_metric()->Clear(); + _impl_.protocol_version_ = 0u; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Metrics::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 0, 2> Metrics::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_Metrics_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // repeated .protobuf.Metric metric = 2; + {::_pbi::TcParser::FastMtR1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Metrics, _impl_.metric_)}}, + // uint32 protocol_version = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metrics, _impl_.protocol_version_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Metrics, _impl_.protocol_version_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // uint32 protocol_version = 1; + {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.protocol_version_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // repeated .protobuf.Metric metric = 2; + {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.metric_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::protobuf::Metric>()}, + }}, {{ + }}, +}; + +::uint8_t* Metrics::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:protobuf.Metrics) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // uint32 protocol_version = 1; + if (this->_internal_protocol_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_protocol_version(), target); + } + + // repeated .protobuf.Metric metric = 2; + for (unsigned i = 0, + n = static_cast(this->_internal_metric_size()); i < n; i++) { + const auto& repfield = this->_internal_metric().Get(i); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:protobuf.Metrics) + return target; +} + +::size_t Metrics::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:protobuf.Metrics) + ::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 .protobuf.Metric metric = 2; + total_size += 1UL * this->_internal_metric_size(); + for (const auto& msg : this->_internal_metric()) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + // uint32 protocol_version = 1; + if (this->_internal_protocol_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_protocol_version()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Metrics::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Metrics::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Metrics::GetClassData() const { return &_class_data_; } + + +void Metrics::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.Metrics) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_mutable_metric()->MergeFrom(from._internal_metric()); + if (from._internal_protocol_version() != 0) { + _this->_internal_set_protocol_version(from._internal_protocol_version()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Metrics::CopyFrom(const Metrics& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:protobuf.Metrics) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Metrics::IsInitialized() const { + return true; +} + +void Metrics::InternalSwap(Metrics* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.metric_.InternalSwap(&other->_impl_.metric_); + swap(_impl_.protocol_version_, other->_impl_.protocol_version_); +} + +::google::protobuf::Metadata Metrics::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_src_2eproto_getter, &descriptor_table_src_2eproto_once, + file_level_metadata_src_2eproto[2]); +} +// @@protoc_insertion_point(namespace_scope) +} // namespace protobuf +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google +// @@protoc_insertion_point(global_scope) +#include "google/protobuf/port_undef.inc" diff --git a/test/cpp/src.pb.h b/test/cpp/src.pb.h new file mode 100644 index 0000000..3bc31fe --- /dev/null +++ b/test/cpp/src.pb.h @@ -0,0 +1,1699 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_src_2eproto_2epb_2eh +#define GOOGLE_PROTOBUF_INCLUDED_src_2eproto_2epb_2eh + +#include +#include +#include + +#include "google/protobuf/port_def.inc" +#if PROTOBUF_VERSION < 4024000 +#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 // PROTOBUF_VERSION + +#if 4024003 < 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 // PROTOBUF_MIN_PROTOC_VERSION +#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_tctable_decl.h" +#include "google/protobuf/generated_message_util.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) + +// Must be included last. +#include "google/protobuf/port_def.inc" + +#define PROTOBUF_INTERNAL_EXPORT_src_2eproto + +namespace google { +namespace protobuf { +namespace internal { +class AnyMetadata; +} // namespace internal +} // namespace protobuf +} // namespace google + +// Internal implementation detail -- do not use these members. +struct TableStruct_src_2eproto { + static const ::uint32_t offsets[]; +}; +extern const ::google::protobuf::internal::DescriptorTable + descriptor_table_src_2eproto; +namespace protobuf { +class Info; +struct InfoDefaultTypeInternal; +extern InfoDefaultTypeInternal _Info_default_instance_; +class Metric; +struct MetricDefaultTypeInternal; +extern MetricDefaultTypeInternal _Metric_default_instance_; +class Metrics; +struct MetricsDefaultTypeInternal; +extern MetricsDefaultTypeInternal _Metrics_default_instance_; +} // namespace protobuf +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google + +namespace protobuf { +enum Kind : int { + COUNTER = 0, + CONSTANT = 1, + GAUGE = 2, + Kind_INT_MIN_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::min(), + Kind_INT_MAX_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::max(), +}; + +bool Kind_IsValid(int value); +constexpr Kind Kind_MIN = static_cast(0); +constexpr Kind Kind_MAX = static_cast(2); +constexpr int Kind_ARRAYSIZE = 2 + 1; +const ::google::protobuf::EnumDescriptor* +Kind_descriptor(); +template +const std::string& Kind_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to Kind_Name()."); + return Kind_Name(static_cast(value)); +} +template <> +inline const std::string& Kind_Name(Kind value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool Kind_Parse(absl::string_view name, Kind* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Kind_descriptor(), name, value); +} +enum Type : int { + UINT64 = 0, + INT64 = 1, + FLOAT64 = 2, + BOOL = 3, + Type_INT_MIN_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::min(), + Type_INT_MAX_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::max(), +}; + +bool Type_IsValid(int value); +constexpr Type Type_MIN = static_cast(0); +constexpr Type Type_MAX = static_cast(3); +constexpr int Type_ARRAYSIZE = 3 + 1; +const ::google::protobuf::EnumDescriptor* +Type_descriptor(); +template +const std::string& Type_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to Type_Name()."); + return Type_Name(static_cast(value)); +} +template <> +inline const std::string& Type_Name(Type value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool Type_Parse(absl::string_view name, Type* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Type_descriptor(), name, value); +} + +// =================================================================== + + +// ------------------------------------------------------------------- + +class Info final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf.Info) */ { + public: + inline Info() : Info(nullptr) {} + ~Info() override; + template + explicit PROTOBUF_CONSTEXPR Info(::google::protobuf::internal::ConstantInitialized); + + Info(const Info& from); + Info(Info&& from) noexcept + : Info() { + *this = ::std::move(from); + } + + inline Info& operator=(const Info& from) { + CopyFrom(from); + return *this; + } + inline Info& operator=(Info&& 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; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Info& default_instance() { + return *internal_default_instance(); + } + enum MinCase { + kUint64Min = 6, + kInt64Min = 7, + kFloat64Min = 8, + MIN_NOT_SET = 0, + }; + + enum MaxCase { + kUint64Max = 9, + kInt64Max = 10, + kFloat64Max = 11, + MAX_NOT_SET = 0, + }; + + static inline const Info* internal_default_instance() { + return reinterpret_cast( + &_Info_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Info& a, Info& b) { + a.Swap(&b); + } + inline void Swap(Info* 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 { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Info* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Info* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Info& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Info& from) { + Info::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Info* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "protobuf.Info"; + } + protected: + explicit Info(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 1, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 5, + kTypeFieldNumber = 3, + kKindFieldNumber = 4, + kUint64MinFieldNumber = 6, + kInt64MinFieldNumber = 7, + kFloat64MinFieldNumber = 8, + kUint64MaxFieldNumber = 9, + kInt64MaxFieldNumber = 10, + kFloat64MaxFieldNumber = 11, + }; + // string name = 1; + void clear_name() ; + const std::string& name() const; + template + void set_name(Arg_&& arg, Args_... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* ptr); + + 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() ; + const std::string& description() const; + template + void set_description(Arg_&& arg, Args_... args); + std::string* mutable_description(); + PROTOBUF_NODISCARD std::string* release_description(); + void set_allocated_description(std::string* ptr); + + 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 unit = 5; + void clear_unit() ; + const std::string& unit() const; + template + void set_unit(Arg_&& arg, Args_... args); + std::string* mutable_unit(); + PROTOBUF_NODISCARD std::string* release_unit(); + void set_allocated_unit(std::string* ptr); + + private: + const std::string& _internal_unit() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_unit( + const std::string& value); + std::string* _internal_mutable_unit(); + + public: + // .protobuf.Type type = 3; + void clear_type() ; + ::protobuf::Type type() const; + void set_type(::protobuf::Type value); + + private: + ::protobuf::Type _internal_type() const; + void _internal_set_type(::protobuf::Type value); + + public: + // .protobuf.Kind kind = 4; + void clear_kind() ; + ::protobuf::Kind kind() const; + void set_kind(::protobuf::Kind value); + + private: + ::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::protobuf::Kind value); + + public: + // uint64 uint64_min = 6; + bool has_uint64_min() const; + void clear_uint64_min() ; + ::uint64_t uint64_min() const; + void set_uint64_min(::uint64_t value); + + private: + ::uint64_t _internal_uint64_min() const; + void _internal_set_uint64_min(::uint64_t value); + + public: + // int64 int64_min = 7; + bool has_int64_min() const; + void clear_int64_min() ; + ::int64_t int64_min() const; + void set_int64_min(::int64_t value); + + private: + ::int64_t _internal_int64_min() const; + void _internal_set_int64_min(::int64_t value); + + public: + // double float64_min = 8; + bool has_float64_min() const; + void clear_float64_min() ; + double float64_min() const; + void set_float64_min(double value); + + private: + double _internal_float64_min() const; + void _internal_set_float64_min(double value); + + public: + // uint64 uint64_max = 9; + bool has_uint64_max() const; + void clear_uint64_max() ; + ::uint64_t uint64_max() const; + void set_uint64_max(::uint64_t value); + + private: + ::uint64_t _internal_uint64_max() const; + void _internal_set_uint64_max(::uint64_t value); + + public: + // int64 int64_max = 10; + bool has_int64_max() const; + void clear_int64_max() ; + ::int64_t int64_max() const; + void set_int64_max(::int64_t value); + + private: + ::int64_t _internal_int64_max() const; + void _internal_set_int64_max(::int64_t value); + + public: + // double float64_max = 11; + bool has_float64_max() const; + void clear_float64_max() ; + double float64_max() const; + void set_float64_max(double value); + + private: + double _internal_float64_max() const; + void _internal_set_float64_max(double value); + + public: + void clear_min(); + MinCase min_case() const; + void clear_max(); + MaxCase max_case() const; + // @@protoc_insertion_point(class_scope:protobuf.Info) + private: + class _Internal; + void set_has_uint64_min(); + void set_has_int64_min(); + void set_has_float64_min(); + void set_has_uint64_max(); + void set_has_int64_max(); + void set_has_float64_max(); + + inline bool has_min() const; + inline void clear_has_min(); + + inline bool has_max() const; + inline void clear_has_max(); + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 11, 0, 49, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr unit_; + int type_; + int kind_; + union MinUnion { + constexpr MinUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::uint64_t uint64_min_; + ::int64_t int64_min_; + double float64_min_; + } min_; + union MaxUnion { + constexpr MaxUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::uint64_t uint64_max_; + ::int64_t int64_max_; + double float64_max_; + } max_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t _oneof_case_[2]; + + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_src_2eproto; +};// ------------------------------------------------------------------- + +class Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf.Metric) */ { + public: + inline Metric() : Metric(nullptr) {} + ~Metric() override; + template + explicit PROTOBUF_CONSTEXPR Metric(::google::protobuf::internal::ConstantInitialized); + + Metric(const Metric& from); + Metric(Metric&& from) noexcept + : Metric() { + *this = ::std::move(from); + } + + inline Metric& operator=(const Metric& from) { + CopyFrom(from); + return *this; + } + inline Metric& operator=(Metric&& 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; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Metric& default_instance() { + return *internal_default_instance(); + } + enum ValueCase { + kUint64Value = 2, + kInt64Value = 3, + kFloat64Value = 4, + kBoolValue = 5, + VALUE_NOT_SET = 0, + }; + + static inline const Metric* internal_default_instance() { + return reinterpret_cast( + &_Metric_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(Metric& a, Metric& b) { + a.Swap(&b); + } + inline void Swap(Metric* 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 { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Metric* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Metric& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Metric& from) { + Metric::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Metric* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "protobuf.Metric"; + } + protected: + explicit Metric(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kInfoFieldNumber = 1, + kUint64ValueFieldNumber = 2, + kInt64ValueFieldNumber = 3, + kFloat64ValueFieldNumber = 4, + kBoolValueFieldNumber = 5, + }; + // optional .protobuf.Info info = 1; + bool has_info() const; + void clear_info() ; + const ::protobuf::Info& info() const; + PROTOBUF_NODISCARD ::protobuf::Info* release_info(); + ::protobuf::Info* mutable_info(); + void set_allocated_info(::protobuf::Info* value); + void unsafe_arena_set_allocated_info(::protobuf::Info* value); + ::protobuf::Info* unsafe_arena_release_info(); + + private: + const ::protobuf::Info& _internal_info() const; + ::protobuf::Info* _internal_mutable_info(); + + public: + // uint64 uint64_value = 2; + bool has_uint64_value() const; + void clear_uint64_value() ; + ::uint64_t uint64_value() const; + void set_uint64_value(::uint64_t value); + + private: + ::uint64_t _internal_uint64_value() const; + void _internal_set_uint64_value(::uint64_t value); + + public: + // int64 int64_value = 3; + bool has_int64_value() const; + void clear_int64_value() ; + ::int64_t int64_value() const; + void set_int64_value(::int64_t value); + + private: + ::int64_t _internal_int64_value() const; + void _internal_set_int64_value(::int64_t value); + + public: + // double float64_value = 4; + bool has_float64_value() const; + void clear_float64_value() ; + double float64_value() const; + void set_float64_value(double value); + + private: + double _internal_float64_value() const; + void _internal_set_float64_value(double value); + + public: + // bool bool_value = 5; + bool has_bool_value() const; + void clear_bool_value() ; + bool bool_value() const; + void set_bool_value(bool value); + + private: + bool _internal_bool_value() const; + void _internal_set_bool_value(bool value); + + public: + void clear_value(); + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:protobuf.Metric) + private: + class _Internal; + void set_has_uint64_value(); + void set_has_int64_value(); + void set_has_float64_value(); + void set_has_bool_value(); + + inline bool has_value() const; + inline void clear_has_value(); + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 5, 1, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::protobuf::Info* info_; + union ValueUnion { + constexpr ValueUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::uint64_t uint64_value_; + ::int64_t int64_value_; + double float64_value_; + bool bool_value_; + } value_; + ::uint32_t _oneof_case_[1]; + + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_src_2eproto; +};// ------------------------------------------------------------------- + +class Metrics final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf.Metrics) */ { + public: + inline Metrics() : Metrics(nullptr) {} + ~Metrics() override; + template + explicit PROTOBUF_CONSTEXPR Metrics(::google::protobuf::internal::ConstantInitialized); + + Metrics(const Metrics& from); + Metrics(Metrics&& from) noexcept + : Metrics() { + *this = ::std::move(from); + } + + inline Metrics& operator=(const Metrics& from) { + CopyFrom(from); + return *this; + } + inline Metrics& operator=(Metrics&& 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; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Metrics& default_instance() { + return *internal_default_instance(); + } + static inline const Metrics* internal_default_instance() { + return reinterpret_cast( + &_Metrics_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(Metrics& a, Metrics& b) { + a.Swap(&b); + } + inline void Swap(Metrics* 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 { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Metrics* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Metrics* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Metrics& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Metrics& from) { + Metrics::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Metrics* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "protobuf.Metrics"; + } + protected: + explicit Metrics(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kMetricFieldNumber = 2, + kProtocolVersionFieldNumber = 1, + }; + // repeated .protobuf.Metric metric = 2; + int metric_size() const; + private: + int _internal_metric_size() const; + + public: + void clear_metric() ; + ::protobuf::Metric* mutable_metric(int index); + ::google::protobuf::RepeatedPtrField< ::protobuf::Metric >* + mutable_metric(); + private: + const ::google::protobuf::RepeatedPtrField<::protobuf::Metric>& _internal_metric() const; + ::google::protobuf::RepeatedPtrField<::protobuf::Metric>* _internal_mutable_metric(); + public: + const ::protobuf::Metric& metric(int index) const; + ::protobuf::Metric* add_metric(); + const ::google::protobuf::RepeatedPtrField< ::protobuf::Metric >& + metric() const; + // uint32 protocol_version = 1; + void clear_protocol_version() ; + ::uint32_t protocol_version() const; + void set_protocol_version(::uint32_t value); + + private: + ::uint32_t _internal_protocol_version() const; + void _internal_set_protocol_version(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:protobuf.Metrics) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, 1, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::RepeatedPtrField< ::protobuf::Metric > metric_; + ::uint32_t protocol_version_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_src_2eproto; +}; + +// =================================================================== + + + + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// Info + +// string name = 1; +inline void Info::clear_name() { + _impl_.name_.ClearToEmpty(); +} +inline const std::string& Info::name() const { + // @@protoc_insertion_point(field_get:protobuf.Info.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Info::set_name(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.name_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:protobuf.Info.name) +} +inline std::string* Info::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:protobuf.Info.name) + return _s; +} +inline const std::string& Info::_internal_name() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.name_.Get(); +} +inline void Info::_internal_set_name(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Info::_internal_mutable_name() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.name_.Mutable( GetArenaForAllocation()); +} +inline std::string* Info::release_name() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:protobuf.Info.name) + return _impl_.name_.Release(); +} +inline void Info::set_allocated_name(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.name_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:protobuf.Info.name) +} + +// string description = 2; +inline void Info::clear_description() { + _impl_.description_.ClearToEmpty(); +} +inline const std::string& Info::description() const { + // @@protoc_insertion_point(field_get:protobuf.Info.description) + return _internal_description(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Info::set_description(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:protobuf.Info.description) +} +inline std::string* Info::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:protobuf.Info.description) + return _s; +} +inline const std::string& Info::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); +} +inline void Info::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); +} +inline std::string* Info::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); +} +inline std::string* Info::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:protobuf.Info.description) + return _impl_.description_.Release(); +} +inline void Info::set_allocated_description(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.description_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.description_.IsDefault()) { + _impl_.description_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:protobuf.Info.description) +} + +// .protobuf.Type type = 3; +inline void Info::clear_type() { + _impl_.type_ = 0; +} +inline ::protobuf::Type Info::type() const { + // @@protoc_insertion_point(field_get:protobuf.Info.type) + return _internal_type(); +} +inline void Info::set_type(::protobuf::Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:protobuf.Info.type) +} +inline ::protobuf::Type Info::_internal_type() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::protobuf::Type>(_impl_.type_); +} +inline void Info::_internal_set_type(::protobuf::Type value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.type_ = value; +} + +// .protobuf.Kind kind = 4; +inline void Info::clear_kind() { + _impl_.kind_ = 0; +} +inline ::protobuf::Kind Info::kind() const { + // @@protoc_insertion_point(field_get:protobuf.Info.kind) + return _internal_kind(); +} +inline void Info::set_kind(::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:protobuf.Info.kind) +} +inline ::protobuf::Kind Info::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::protobuf::Kind>(_impl_.kind_); +} +inline void Info::_internal_set_kind(::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// string unit = 5; +inline void Info::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& Info::unit() const { + // @@protoc_insertion_point(field_get:protobuf.Info.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Info::set_unit(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:protobuf.Info.unit) +} +inline std::string* Info::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:protobuf.Info.unit) + return _s; +} +inline const std::string& Info::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Info::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Info::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Info::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:protobuf.Info.unit) + return _impl_.unit_.Release(); +} +inline void Info::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.unit_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.unit_.IsDefault()) { + _impl_.unit_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:protobuf.Info.unit) +} + +// uint64 uint64_min = 6; +inline bool Info::has_uint64_min() const { + return min_case() == kUint64Min; +} +inline void Info::set_has_uint64_min() { + _impl_._oneof_case_[0] = kUint64Min; +} +inline void Info::clear_uint64_min() { + if (min_case() == kUint64Min) { + _impl_.min_.uint64_min_ = ::uint64_t{0u}; + clear_has_min(); + } +} +inline ::uint64_t Info::uint64_min() const { + // @@protoc_insertion_point(field_get:protobuf.Info.uint64_min) + return _internal_uint64_min(); +} +inline void Info::set_uint64_min(::uint64_t value) { + _internal_set_uint64_min(value); + // @@protoc_insertion_point(field_set:protobuf.Info.uint64_min) +} +inline ::uint64_t Info::_internal_uint64_min() const { + if (min_case() == kUint64Min) { + return _impl_.min_.uint64_min_; + } + return ::uint64_t{0u}; +} +inline void Info::_internal_set_uint64_min(::uint64_t value) { + if (min_case() != kUint64Min) { + clear_min(); + set_has_uint64_min(); + } + _impl_.min_.uint64_min_ = value; +} + +// int64 int64_min = 7; +inline bool Info::has_int64_min() const { + return min_case() == kInt64Min; +} +inline void Info::set_has_int64_min() { + _impl_._oneof_case_[0] = kInt64Min; +} +inline void Info::clear_int64_min() { + if (min_case() == kInt64Min) { + _impl_.min_.int64_min_ = ::int64_t{0}; + clear_has_min(); + } +} +inline ::int64_t Info::int64_min() const { + // @@protoc_insertion_point(field_get:protobuf.Info.int64_min) + return _internal_int64_min(); +} +inline void Info::set_int64_min(::int64_t value) { + _internal_set_int64_min(value); + // @@protoc_insertion_point(field_set:protobuf.Info.int64_min) +} +inline ::int64_t Info::_internal_int64_min() const { + if (min_case() == kInt64Min) { + return _impl_.min_.int64_min_; + } + return ::int64_t{0}; +} +inline void Info::_internal_set_int64_min(::int64_t value) { + if (min_case() != kInt64Min) { + clear_min(); + set_has_int64_min(); + } + _impl_.min_.int64_min_ = value; +} + +// double float64_min = 8; +inline bool Info::has_float64_min() const { + return min_case() == kFloat64Min; +} +inline void Info::set_has_float64_min() { + _impl_._oneof_case_[0] = kFloat64Min; +} +inline void Info::clear_float64_min() { + if (min_case() == kFloat64Min) { + _impl_.min_.float64_min_ = 0; + clear_has_min(); + } +} +inline double Info::float64_min() const { + // @@protoc_insertion_point(field_get:protobuf.Info.float64_min) + return _internal_float64_min(); +} +inline void Info::set_float64_min(double value) { + _internal_set_float64_min(value); + // @@protoc_insertion_point(field_set:protobuf.Info.float64_min) +} +inline double Info::_internal_float64_min() const { + if (min_case() == kFloat64Min) { + return _impl_.min_.float64_min_; + } + return 0; +} +inline void Info::_internal_set_float64_min(double value) { + if (min_case() != kFloat64Min) { + clear_min(); + set_has_float64_min(); + } + _impl_.min_.float64_min_ = value; +} + +// uint64 uint64_max = 9; +inline bool Info::has_uint64_max() const { + return max_case() == kUint64Max; +} +inline void Info::set_has_uint64_max() { + _impl_._oneof_case_[1] = kUint64Max; +} +inline void Info::clear_uint64_max() { + if (max_case() == kUint64Max) { + _impl_.max_.uint64_max_ = ::uint64_t{0u}; + clear_has_max(); + } +} +inline ::uint64_t Info::uint64_max() const { + // @@protoc_insertion_point(field_get:protobuf.Info.uint64_max) + return _internal_uint64_max(); +} +inline void Info::set_uint64_max(::uint64_t value) { + _internal_set_uint64_max(value); + // @@protoc_insertion_point(field_set:protobuf.Info.uint64_max) +} +inline ::uint64_t Info::_internal_uint64_max() const { + if (max_case() == kUint64Max) { + return _impl_.max_.uint64_max_; + } + return ::uint64_t{0u}; +} +inline void Info::_internal_set_uint64_max(::uint64_t value) { + if (max_case() != kUint64Max) { + clear_max(); + set_has_uint64_max(); + } + _impl_.max_.uint64_max_ = value; +} + +// int64 int64_max = 10; +inline bool Info::has_int64_max() const { + return max_case() == kInt64Max; +} +inline void Info::set_has_int64_max() { + _impl_._oneof_case_[1] = kInt64Max; +} +inline void Info::clear_int64_max() { + if (max_case() == kInt64Max) { + _impl_.max_.int64_max_ = ::int64_t{0}; + clear_has_max(); + } +} +inline ::int64_t Info::int64_max() const { + // @@protoc_insertion_point(field_get:protobuf.Info.int64_max) + return _internal_int64_max(); +} +inline void Info::set_int64_max(::int64_t value) { + _internal_set_int64_max(value); + // @@protoc_insertion_point(field_set:protobuf.Info.int64_max) +} +inline ::int64_t Info::_internal_int64_max() const { + if (max_case() == kInt64Max) { + return _impl_.max_.int64_max_; + } + return ::int64_t{0}; +} +inline void Info::_internal_set_int64_max(::int64_t value) { + if (max_case() != kInt64Max) { + clear_max(); + set_has_int64_max(); + } + _impl_.max_.int64_max_ = value; +} + +// double float64_max = 11; +inline bool Info::has_float64_max() const { + return max_case() == kFloat64Max; +} +inline void Info::set_has_float64_max() { + _impl_._oneof_case_[1] = kFloat64Max; +} +inline void Info::clear_float64_max() { + if (max_case() == kFloat64Max) { + _impl_.max_.float64_max_ = 0; + clear_has_max(); + } +} +inline double Info::float64_max() const { + // @@protoc_insertion_point(field_get:protobuf.Info.float64_max) + return _internal_float64_max(); +} +inline void Info::set_float64_max(double value) { + _internal_set_float64_max(value); + // @@protoc_insertion_point(field_set:protobuf.Info.float64_max) +} +inline double Info::_internal_float64_max() const { + if (max_case() == kFloat64Max) { + return _impl_.max_.float64_max_; + } + return 0; +} +inline void Info::_internal_set_float64_max(double value) { + if (max_case() != kFloat64Max) { + clear_max(); + set_has_float64_max(); + } + _impl_.max_.float64_max_ = value; +} + +inline bool Info::has_min() const { + return min_case() != MIN_NOT_SET; +} +inline void Info::clear_has_min() { + _impl_._oneof_case_[0] = MIN_NOT_SET; +} +inline bool Info::has_max() const { + return max_case() != MAX_NOT_SET; +} +inline void Info::clear_has_max() { + _impl_._oneof_case_[1] = MAX_NOT_SET; +} +inline Info::MinCase Info::min_case() const { + return Info::MinCase(_impl_._oneof_case_[0]); +} +inline Info::MaxCase Info::max_case() const { + return Info::MaxCase(_impl_._oneof_case_[1]); +} +// ------------------------------------------------------------------- + +// Metric + +// optional .protobuf.Info info = 1; +inline bool Metric::has_info() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.info_ != nullptr); + return value; +} +inline void Metric::clear_info() { + if (_impl_.info_ != nullptr) _impl_.info_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::protobuf::Info& Metric::_internal_info() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + const ::protobuf::Info* p = _impl_.info_; + return p != nullptr ? *p : reinterpret_cast(::protobuf::_Info_default_instance_); +} +inline const ::protobuf::Info& Metric::info() const { + // @@protoc_insertion_point(field_get:protobuf.Metric.info) + return _internal_info(); +} +inline void Metric::unsafe_arena_set_allocated_info(::protobuf::Info* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.info_); + } + _impl_.info_ = reinterpret_cast<::protobuf::Info*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.Metric.info) +} +inline ::protobuf::Info* Metric::release_info() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::protobuf::Info* released = _impl_.info_; + _impl_.info_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::protobuf::Info* Metric::unsafe_arena_release_info() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:protobuf.Metric.info) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::protobuf::Info* temp = _impl_.info_; + _impl_.info_ = nullptr; + return temp; +} +inline ::protobuf::Info* Metric::_internal_mutable_info() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.info_ == nullptr) { + auto* p = CreateMaybeMessage<::protobuf::Info>(GetArenaForAllocation()); + _impl_.info_ = reinterpret_cast<::protobuf::Info*>(p); + } + return _impl_.info_; +} +inline ::protobuf::Info* Metric::mutable_info() { + ::protobuf::Info* _msg = _internal_mutable_info(); + // @@protoc_insertion_point(field_mutable:protobuf.Metric.info) + return _msg; +} +inline void Metric::set_allocated_info(::protobuf::Info* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::protobuf::Info*>(_impl_.info_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::protobuf::Info*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.info_ = reinterpret_cast<::protobuf::Info*>(value); + // @@protoc_insertion_point(field_set_allocated:protobuf.Metric.info) +} + +// uint64 uint64_value = 2; +inline bool Metric::has_uint64_value() const { + return value_case() == kUint64Value; +} +inline void Metric::set_has_uint64_value() { + _impl_._oneof_case_[0] = kUint64Value; +} +inline void Metric::clear_uint64_value() { + if (value_case() == kUint64Value) { + _impl_.value_.uint64_value_ = ::uint64_t{0u}; + clear_has_value(); + } +} +inline ::uint64_t Metric::uint64_value() const { + // @@protoc_insertion_point(field_get:protobuf.Metric.uint64_value) + return _internal_uint64_value(); +} +inline void Metric::set_uint64_value(::uint64_t value) { + _internal_set_uint64_value(value); + // @@protoc_insertion_point(field_set:protobuf.Metric.uint64_value) +} +inline ::uint64_t Metric::_internal_uint64_value() const { + if (value_case() == kUint64Value) { + return _impl_.value_.uint64_value_; + } + return ::uint64_t{0u}; +} +inline void Metric::_internal_set_uint64_value(::uint64_t value) { + if (value_case() != kUint64Value) { + clear_value(); + set_has_uint64_value(); + } + _impl_.value_.uint64_value_ = value; +} + +// int64 int64_value = 3; +inline bool Metric::has_int64_value() const { + return value_case() == kInt64Value; +} +inline void Metric::set_has_int64_value() { + _impl_._oneof_case_[0] = kInt64Value; +} +inline void Metric::clear_int64_value() { + if (value_case() == kInt64Value) { + _impl_.value_.int64_value_ = ::int64_t{0}; + clear_has_value(); + } +} +inline ::int64_t Metric::int64_value() const { + // @@protoc_insertion_point(field_get:protobuf.Metric.int64_value) + return _internal_int64_value(); +} +inline void Metric::set_int64_value(::int64_t value) { + _internal_set_int64_value(value); + // @@protoc_insertion_point(field_set:protobuf.Metric.int64_value) +} +inline ::int64_t Metric::_internal_int64_value() const { + if (value_case() == kInt64Value) { + return _impl_.value_.int64_value_; + } + return ::int64_t{0}; +} +inline void Metric::_internal_set_int64_value(::int64_t value) { + if (value_case() != kInt64Value) { + clear_value(); + set_has_int64_value(); + } + _impl_.value_.int64_value_ = value; +} + +// double float64_value = 4; +inline bool Metric::has_float64_value() const { + return value_case() == kFloat64Value; +} +inline void Metric::set_has_float64_value() { + _impl_._oneof_case_[0] = kFloat64Value; +} +inline void Metric::clear_float64_value() { + if (value_case() == kFloat64Value) { + _impl_.value_.float64_value_ = 0; + clear_has_value(); + } +} +inline double Metric::float64_value() const { + // @@protoc_insertion_point(field_get:protobuf.Metric.float64_value) + return _internal_float64_value(); +} +inline void Metric::set_float64_value(double value) { + _internal_set_float64_value(value); + // @@protoc_insertion_point(field_set:protobuf.Metric.float64_value) +} +inline double Metric::_internal_float64_value() const { + if (value_case() == kFloat64Value) { + return _impl_.value_.float64_value_; + } + return 0; +} +inline void Metric::_internal_set_float64_value(double value) { + if (value_case() != kFloat64Value) { + clear_value(); + set_has_float64_value(); + } + _impl_.value_.float64_value_ = value; +} + +// bool bool_value = 5; +inline bool Metric::has_bool_value() const { + return value_case() == kBoolValue; +} +inline void Metric::set_has_bool_value() { + _impl_._oneof_case_[0] = kBoolValue; +} +inline void Metric::clear_bool_value() { + if (value_case() == kBoolValue) { + _impl_.value_.bool_value_ = false; + clear_has_value(); + } +} +inline bool Metric::bool_value() const { + // @@protoc_insertion_point(field_get:protobuf.Metric.bool_value) + return _internal_bool_value(); +} +inline void Metric::set_bool_value(bool value) { + _internal_set_bool_value(value); + // @@protoc_insertion_point(field_set:protobuf.Metric.bool_value) +} +inline bool Metric::_internal_bool_value() const { + if (value_case() == kBoolValue) { + return _impl_.value_.bool_value_; + } + return false; +} +inline void Metric::_internal_set_bool_value(bool value) { + if (value_case() != kBoolValue) { + clear_value(); + set_has_bool_value(); + } + _impl_.value_.bool_value_ = value; +} + +inline bool Metric::has_value() const { + return value_case() != VALUE_NOT_SET; +} +inline void Metric::clear_has_value() { + _impl_._oneof_case_[0] = VALUE_NOT_SET; +} +inline Metric::ValueCase Metric::value_case() const { + return Metric::ValueCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Metrics + +// uint32 protocol_version = 1; +inline void Metrics::clear_protocol_version() { + _impl_.protocol_version_ = 0u; +} +inline ::uint32_t Metrics::protocol_version() const { + // @@protoc_insertion_point(field_get:protobuf.Metrics.protocol_version) + return _internal_protocol_version(); +} +inline void Metrics::set_protocol_version(::uint32_t value) { + _internal_set_protocol_version(value); + // @@protoc_insertion_point(field_set:protobuf.Metrics.protocol_version) +} +inline ::uint32_t Metrics::_internal_protocol_version() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.protocol_version_; +} +inline void Metrics::_internal_set_protocol_version(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.protocol_version_ = value; +} + +// repeated .protobuf.Metric metric = 2; +inline int Metrics::_internal_metric_size() const { + return _internal_metric().size(); +} +inline int Metrics::metric_size() const { + return _internal_metric_size(); +} +inline void Metrics::clear_metric() { + _internal_mutable_metric()->Clear(); +} +inline ::protobuf::Metric* Metrics::mutable_metric(int index) { + // @@protoc_insertion_point(field_mutable:protobuf.Metrics.metric) + return _internal_mutable_metric()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::protobuf::Metric >* +Metrics::mutable_metric() { + // @@protoc_insertion_point(field_mutable_list:protobuf.Metrics.metric) + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + return _internal_mutable_metric(); +} +inline const ::protobuf::Metric& Metrics::metric(int index) const { + // @@protoc_insertion_point(field_get:protobuf.Metrics.metric) + return _internal_metric().Get(index); +} +inline ::protobuf::Metric* Metrics::add_metric() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::protobuf::Metric* _add = _internal_mutable_metric()->Add(); + // @@protoc_insertion_point(field_add:protobuf.Metrics.metric) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField< ::protobuf::Metric >& +Metrics::metric() const { + // @@protoc_insertion_point(field_list:protobuf.Metrics.metric) + return _internal_metric(); +} +inline const ::google::protobuf::RepeatedPtrField<::protobuf::Metric>& +Metrics::_internal_metric() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.metric_; +} +inline ::google::protobuf::RepeatedPtrField<::protobuf::Metric>* +Metrics::_internal_mutable_metric() { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return &_impl_.metric_; +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) +} // namespace protobuf + + +namespace google { +namespace protobuf { + +template <> +struct is_proto_enum<::protobuf::Kind> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::protobuf::Kind>() { + return ::protobuf::Kind_descriptor(); +} +template <> +struct is_proto_enum<::protobuf::Type> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::protobuf::Type>() { + return ::protobuf::Type_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#include "google/protobuf/port_undef.inc" + +#endif // GOOGLE_PROTOBUF_INCLUDED_src_2eproto_2epb_2eh diff --git a/test/src.proto b/test/src.proto new file mode 100644 index 0000000..e2ecefc --- /dev/null +++ b/test/src.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package protobuf; + +enum Kind +{ + COUNTER = 0; + CONSTANT = 1; + GAUGE = 2; +} + +enum Type +{ + UINT64 = 0; + INT64 = 1; + FLOAT64 = 2; + BOOL = 3; +} + +message Info +{ + string name = 1; + string description = 2; + Type type = 3; + Kind kind = 4; + string unit = 5; + oneof min + { + uint64 uint64_min = 6; + int64 int64_min = 7; + double float64_min = 8; + } + oneof max + { + uint64 uint64_max = 9; + int64 int64_max = 10; + double float64_max = 11; + } +} + +message Metric +{ + optional Info info = 1; + oneof value + { + uint64 uint64_value = 2; + int64 int64_value = 3; + double float64_value = 4; + bool bool_value = 5; + } +} + +message Metrics +{ + uint32 protocol_version = 1; + repeated Metric metric = 2; +} diff --git a/wscript b/wscript index b82918a..d3bb739 100644 --- a/wscript +++ b/wscript @@ -1,6 +1,9 @@ #! /usr/bin/env python # encoding: utf-8 +import os +import shutil + APPNAME = "protobuf" VERSION = "2.0.2" @@ -73,10 +76,18 @@ def build(bld): cxxflags=cxxflags, ) + if bld.is_toplevel(): + bld.program( + features="cxx test", + source=bld.path.ant_glob("test/cpp/*:w7.cc"), + includes=["test/cpp/"], + target="protobuf_tests", + use=["protobuf"], + ) + if bld.get_tool_option("with_protoc"): _protoc(bld, cxxflags) - def _protoc(bld, cxxflags): # Path to the source repo protobuf_source = bld.dependency_node("protobuf-source") @@ -157,4 +168,24 @@ def _utf8_range(bld, cxxflags): export_includes=includes, cxxflags=cxxflags, use=["absl"], - ) \ No newline at end of file + ) + +def protogen(ctx): + # check if protec is available + protoc_location = "build_current/protoc" + if not os.path.isfile(protoc_location): + ctx.fatal("protoc not found. Make sure to configure waf with `--with_protoc` to include protoc in build.") + return + try: + shutil.rmtree("test/cpp") + except: + pass + os.mkdir("test/cpp") + + ctx.exec_command( + f"./{protoc_location} --cpp_out ./test/cpp --proto_path ./test test/*.proto" + ) + + ctx.exec_command( + "echo 'DisableFormat: true\nSortIncludes: false' > ./test/cpp/.clang-format" + )