From 40417bebf129a07e2c8214a2f1a9d6a240b59d6c Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 17 Dec 2024 15:24:50 +0100 Subject: [PATCH 01/68] work --- examples/metrics_simple.cpp | 4 +- lock_version_resolve.json | 37 + protobuf/metrics.proto | 156 +- src/abacus/delegate.hpp | 169 - src/abacus/detail/to_protobuf.cpp | 93 - src/abacus/detail/to_protobuf.hpp | 24 - src/abacus/metric_info2.hpp | 46 + src/abacus/metrics.cpp | 36 - src/abacus/metrics.hpp | 61 +- src/abacus/metrics2.hpp | 100 + src/abacus/protobuf/metrics.pb.cc | 4593 +++++++++++++++++++++---- src/abacus/protobuf/metrics.pb.h | 5240 ++++++++++++++++++++++++----- src/abacus/to_protobuf.cpp | 32 - src/abacus/to_protobuf.hpp | 31 - test/src/test_metric.cpp | 4 - test/src/test_metrics.cpp | 4 +- test/src/test_metrics2.cpp | 10 + test/src/test_to_json.cpp | 2 +- test/src/test_to_protobuf.cpp | 93 - test/src/test_view.cpp | 2 +- waf | 14 +- wscript | 4 +- 22 files changed, 8684 insertions(+), 2071 deletions(-) create mode 100644 lock_version_resolve.json delete mode 100644 src/abacus/delegate.hpp delete mode 100644 src/abacus/detail/to_protobuf.cpp delete mode 100644 src/abacus/detail/to_protobuf.hpp create mode 100644 src/abacus/metric_info2.hpp create mode 100644 src/abacus/metrics2.hpp delete mode 100644 src/abacus/to_protobuf.cpp delete mode 100644 src/abacus/to_protobuf.hpp create mode 100644 test/src/test_metrics2.cpp delete mode 100644 test/src/test_to_protobuf.cpp diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 0163a52a..91db41af 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -36,8 +36,8 @@ int main() abacus::metrics car(infos); - car.initialize_constant("fuel_consumption", (double)22.3); - car.initialize_constant("wheels", (uint64_t)4); + car.initialize_constant("fuel_consumption", 22.3); + car.initialize_constant("wheels", 4); auto days_until_maintenance = car.initialize_metric("days_until_maintenance"); auto registered = diff --git a/lock_version_resolve.json b/lock_version_resolve.json new file mode 100644 index 00000000..cc3e23c9 --- /dev/null +++ b/lock_version_resolve.json @@ -0,0 +1,37 @@ +{ + "bourne": { + "commit_id": "97a913859ef89817f97ab5fb59d82989319cd33f", + "resolver_info": "10.0.1", + "sha1": "9c4ea9c707dda31fbd3e0c7b326ab97263e06ca3" + }, + "endian": { + "commit_id": "4fedffac0c05181bcdf70c4d1e1f47794e7bd967", + "resolver_info": "13.0.0", + "sha1": "de39fa280dabb242134e095a1473495341165b70" + }, + "gtest": { + "commit_id": "da24468d2c5deb601d0f67196abe83d78a00f972", + "resolver_info": "5.0.0", + "sha1": "11e35e3559b3844fbe2fa6f045854cd2dcdf0f86" + }, + "gtest-source": { + "commit_id": "e2239ee6043f73722e7aa812a459f54a28552929", + "resolver_info": "release-1.11.0", + "sha1": "ca969a1500e88a09de1cbfb8d8d3307a7773abfd" + }, + "protobuf": { + "commit_id": "1e7b3114dd9ed4fcfe5f0969033235d7295004c7", + "resolver_info": "2.0.12", + "sha1": "1cbce41d76e6829eb713e60eb7c3f46a1a350a32" + }, + "protobuf-source": { + "commit_id": "ee1355459c9ce7ffe264bc40cfdc7b7623d37e99", + "resolver_info": "v24.3", + "sha1": "d174e67f0c9d5baa3b731bdccab4471c272bbb82" + }, + "waf-tools": { + "commit_id": "6379b83992885dcb148e2c8bf3677f315d623e8f", + "resolver_info": "5.4.0", + "sha1": "9dd4ab1d52c916572f45237d4e7450abc7c19a14" + } +} \ No newline at end of file diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 3d60ce95..3290dd8c 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -2,56 +2,120 @@ syntax = "proto3"; package abacus.protobuf; option go_package = "abacus/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; +// Specifies the kind of metric +enum Kind { + COUNTER = 0; // Counter metric + CONSTANT = 1; // Constant metric + GAUGE = 2; // Gauge metric +} + +// Specifies the endianness for multi-byte values +enum Endianness { + LITTLE = 0; // Little-endian byte order + BIG = 1; // Big-endian byte order +} + +// A unified metric container supporting multiple types +message Metric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + uint32 value_offset = 2; // Offset into packed memory for the value + uint32 valid_offset = 3; // Offset into packed memory for validity + + oneof type { + UInt64Type uint64_type = 4; // Unsigned 64-bit metric + Int64Type int64_type = 5; // Signed 64-bit metric + UInt32Type uint32_type = 6; // Unsigned 32-bit metric + Int32Type int32_type = 7; // Signed 32-bit metric + Float64Type float64_type = 8; // 64-bit floating-point metric + Float32Type float32_type = 9;// 32-bit floating-point metric + BoolType bool_type = 10; // Boolean metric + EnumType enum_type = 11; // Enumerated metric } } -message Metric -{ - optional Info info = 1; - oneof value - { - uint64 uint64_value = 2; - int64 int64_value = 3; - double float64_value = 4; - bool bool_value = 5; +// Metadata for unsigned 64-bit metrics +message UInt64Type { + string unit = 1; // Unit of measurement + uint64 min = 2; // Minimum allowable value + uint64 max = 3; // Maximum allowable value +} + +// Metadata for signed 64-bit metrics +message Int64Type { + string unit = 1; // Unit of measurement + int64 min = 2; // Minimum allowable value + int64 max = 3; // Maximum allowable value +} + +// Metadata for unsigned 32-bit metrics +message UInt32Type { + string unit = 1; // Unit of measurement + uint32 min = 2; // Minimum allowable value + uint32 max = 3; // Maximum allowable value +} + +// Metadata for signed 32-bit metrics +message Int32Type { + string unit = 1; // Unit of measurement + int32 min = 2; // Minimum allowable value + int32 max = 3; // Maximum allowable value +} + +// Metadata for 64-bit floating-point metrics +message Float64Type { + string unit = 1; // Unit of measurement + double min = 2; // Minimum allowable value + double max = 3; // Maximum allowable value +} + +// Metadata for 32-bit floating-point metrics +message Float32Type { + string unit = 1; // Unit of measurement + float min = 2; // Minimum allowable value + float max = 3; // Maximum allowable value +} + +// Metadata for boolean metrics +message BoolType { + string unit = 1; // Unit of measurement +} + +message EnumInfo { + string name = 1; // Enum name + optional string description = 2; // Enum description +} + +// Metadata for enumerated metrics +message EnumType { + map enum_map = 1; // Mapping from packed index to enum info +} + +// Metadata collection for all metrics +message MetricsMetadata { + uint32 protocol_version = 1; // Protocol version for compatibility + Endianness endianness = 2; // Endianness of packed memory + uint32 sync_value = 3; // Synchronization value + map metrics = 4; // Mapping from metric name to metadata +} + +// Value container for a single metric +message MetricValue { + bool valid = 1; // Validity of the metric + oneof value { + uint64 uint64_value = 2; // Unsigned 64-bit value + int64 int64_value = 3; // Signed 64-bit value + uint32 uint32_value = 4; // Unsigned 32-bit value + int32 int32_value = 5; // Signed 32-bit value + float float32_value = 6; // 32-bit floating-point value + double float64_value = 7; // 64-bit floating-point value + bool bool_value = 8; // Boolean value + uint32 enum_value = 9; // Enumerated value index } } -message Metrics -{ - uint32 protocol_version = 1; - repeated Metric metric = 2; +// Value container for all metrics +message MetricValues { + uint32 sync_value = 1; // Synchronization value + repeated MetricValue values = 2; // List of metric values } diff --git a/src/abacus/delegate.hpp b/src/abacus/delegate.hpp deleted file mode 100644 index 0d4891b5..00000000 --- a/src/abacus/delegate.hpp +++ /dev/null @@ -1,169 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -/// Main delegate template -template )> -class delegate; - -/// Specialization for function types -/// -/// The delegate class stores an invocable object (e.g. a function, -/// member function, lambda). -/// -/// The following examples show how to use the delegate class. -/// -/// Invoke a lambda: -/// -/// auto f = [](int x) { return x * x; }; -/// delegate d(f); -/// d(2); // 4 -/// -/// Invoke a member function: -/// -/// struct foo { -/// int square(int x) { return x * x; } -/// }; -/// foo f; -/// delegate d(&f, &foo::square); -/// d(2); // 4 -/// -/// Invoke a function: -/// -/// int square(int x) { return x * x; } -/// delegate d(square); -/// d(2); // 4 -/// -template -class delegate -{ -public: - /// Default Constructor - delegate() = default; - - /// Construct a delegate from the callable object F. Typically a lambda or - /// functor. The enable_if is needed to avoid interfering with the - /// implicitly declared copy constructor. - template , delegate>::value>> - delegate(F&& f) - { - static_assert(sizeof(std::decay_t) <= MaxBytes, - "Delegate closure F is too big"); - - static_assert(alignof(std::decay_t) <= Alignment, - "Delegate closure F has stricter alignment"); - - static_assert(std::is_trivially_copyable>::value, - "Delegate closure F not trivially copyable!"); - - static_assert(std::is_trivially_destructible>::value, - "Delegate closure F not trivially destructible!"); - - // We do not have to clean-up (i.e. call any destructors since F is - // trivially destructible) - new (&m_storage) std::decay_t{std::forward(f)}; - - // Initialize the function pointer - the non-capturing lambda will decay - // to the function pointer type - m_invoke = [](const void* ptr, Args... args) -> R - { - return (*reinterpret_cast*>(ptr))( - std::forward(args)...); - }; - } - - /// Construct a delegate from a point to function argument - delegate(R (*const func)(Args...)) : - delegate([func](Args... args) -> R - { return func(std::forward(args)...); }) - { - assert(func != nullptr && "Delegate function pointer is null"); - } - - /// Construct a delegate to a member fuction in class C - /// @param c Pointer to object of type C - /// @param func Pointer to member function - template - delegate(std::decay_t* const c, R (C::*const func)(Args...)) : - delegate([c, func](Args... args) -> R - { return (c->*func)(std::forward(args)...); }) - { - assert(c != nullptr && "Delegate object pointer is null"); - assert(func != nullptr && "Delegate member function pointer is null"); - } - - /// Construct a delegate to a const member fuction in class C - /// @param c Pointer to const object of type C - /// @param func Pointer to const member function - template - delegate(const std::decay_t* const c, - R (C::*const func)(Args...) const) : - delegate([c, func](Args... args) -> R - { return (c->*func)(std::forward(args)...); }) - { - assert(c != nullptr && "Delegate object pointer is null"); - assert(func != nullptr && "Delegate member function pointer is null"); - } - - /// Construct a delegate from an exiting invoke function and constructed - /// function object - delegate(R (*invoke)(const void*, Args...), - std::array storage) : - m_invoke(invoke), - m_storage(storage) - { - } - - /// Call operator for invoking the delegate - auto operator()(Args... args) const -> R - { - assert(m_invoke); - return m_invoke(&m_storage, std::forward(args)...); - } - - /// Operator bool to check for validity - explicit operator bool() const noexcept - { - return m_invoke != nullptr; - } - - /// Call operator for invoking the delegate - auto call(Args... args) const -> R - { - assert(m_invoke); - return m_invoke(&m_storage, std::forward(args)...); - } - - /// @return The invoke pointer to function - auto invoke() const -> R (*)(const void*, Args...) - { - return m_invoke; - } - - /// @return The storage array - auto storage() const -> std::array - { - return m_storage; - } - -private: - /// The function pointer used to invoke the c - R (*m_invoke)(const void*, Args...){nullptr}; - - /// Storage for the closure object - alignas(Alignment) std::array m_storage; -}; - -} -} diff --git a/src/abacus/detail/to_protobuf.cpp b/src/abacus/detail/to_protobuf.cpp deleted file mode 100644 index 7d9be393..00000000 --- a/src/abacus/detail/to_protobuf.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#include "to_protobuf.hpp" - -#include "../to_string.hpp" -#include "../version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -namespace detail -{ -auto to_protobuf(const view& view) -> metrics_message -{ - auto metrics = metrics_message(); - uint64_t uint_value = 0U; - int64_t int_value = 0; - bool bool_value = false; - double float_value = 0.0; - metrics.set_protocol_version(view.protocol_version()); - - for (std::size_t i = 0; i < view.count(); ++i) - { - - auto metric = metrics.add_metric(); - auto info = metric->mutable_info(); - info->set_kind(static_cast(view.kind(i))); - info->set_type(static_cast(view.type(i))); - info->set_name(view.name(i)); - info->set_description(view.description(i)); - if (!view.unit(i).empty()) - { - info->set_unit(view.unit(i)); - } - - bool is_bounds_set = (view.max(i).m_uint != view.min(i).m_uint); - - // If metric is not initialized we set it to null - if ((view.is_initialized(i))) - { - switch (view.type(i)) - { - case abacus::type::uint64: - view.value(i, uint_value); - metric->set_uint64_value(uint_value); - if (is_bounds_set) - { - info->set_uint64_max(view.max(i).m_uint); - info->set_uint64_min(view.min(i).m_uint); - } - break; - case abacus::type::int64: - view.value(i, int_value); - metric->set_int64_value(int_value); - if (is_bounds_set) - { - info->set_int64_max(view.max(i).m_int); - info->set_int64_min(view.min(i).m_int); - } - break; - case abacus::type::boolean: - view.value(i, bool_value); - metric->set_bool_value(bool_value); - if (is_bounds_set) - { - info->set_uint64_max(view.max(i).m_uint); - info->set_uint64_min(view.min(i).m_uint); - } - break; - case abacus::type::float64: - view.value(i, float_value); - metric->set_float64_value(float_value); - if (is_bounds_set) - { - info->set_float64_max(view.max(i).m_double); - info->set_float64_min(view.min(i).m_double); - } - break; - default: - assert(false); - break; - } - } - } - return metrics; -} -} -} -} diff --git a/src/abacus/detail/to_protobuf.hpp b/src/abacus/detail/to_protobuf.hpp deleted file mode 100644 index 22bda1df..00000000 --- a/src/abacus/detail/to_protobuf.hpp +++ /dev/null @@ -1,24 +0,0 @@ - -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include "../protobuf/metrics.pb.h" -#include "../view.hpp" - -#include "../version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -using metrics_message = abacus::protobuf::Metrics; -namespace detail -{ -auto to_protobuf(const view& view) -> metrics_message; -} -} -} diff --git a/src/abacus/metric_info2.hpp b/src/abacus/metric_info2.hpp new file mode 100644 index 00000000..5b0da8ce --- /dev/null +++ b/src/abacus/metric_info2.hpp @@ -0,0 +1,46 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "type.hpp" +#include "unit.hpp" + +#include + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +/// Object used to describe a metric. Used in the metrics() constructor. +struct metric_info +{ + /// Name of the metric + std::string name; + + /// Description of the metric + std::string description; + + /// Type of the metric. A metric_type enum. + abacus::type type; + + /// enum describing the flags of a metric. + abacus::kind kind; + + /// The unit of the metric + abacus::unit unit = abacus::unit{""}; + + /// The minimum value of the metric + abacus::min min = abacus::min{uint64_t{0U}}; + + /// The maximum value of the metric + abacus::max max = abacus::max{uint64_t{0U}}; +}; +} +} diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 06a617f8..92023455 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -321,42 +321,6 @@ auto metrics::kind(std::size_t index) const -> abacus::kind return m_info[index].kind; } -void metrics::initialize_constant(const std::string& name, uint64_t value) const -{ - assert(m_meta_data != nullptr); - auto index = metrics::index(name); - assert(kind(index) == abacus::kind::constant); - assert(is_uint64(index)); - *static_cast(initialize(index)) = value; -} - -void metrics::initialize_constant(const std::string& name, int64_t value) const -{ - assert(m_meta_data != nullptr); - auto index = metrics::index(name); - assert(kind(index) == abacus::kind::constant); - assert(is_int64(index)); - *static_cast(initialize(index)) = value; -} - -void metrics::initialize_constant(const std::string& name, double value) const -{ - assert(m_meta_data != nullptr); - auto index = metrics::index(name); - assert(kind(index) == abacus::kind::constant); - assert(is_float64(index)); - *static_cast(initialize(index)) = value; -} - -void metrics::initialize_constant(const std::string& name, bool value) const -{ - assert(m_meta_data != nullptr); - auto index = metrics::index(name); - assert(kind(index) == abacus::kind::constant); - assert(is_boolean(index)); - *static_cast(initialize(index)) = value; -} - void metrics::value(std::size_t index, uint64_t& value) const { assert(m_meta_data != nullptr); diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 9f8bb480..34392ecc 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -10,7 +10,6 @@ #include #include -#include "delegate.hpp" #include "detail/value_size_info.hpp" #include "metric.hpp" #include "type.hpp" @@ -200,55 +199,17 @@ class metrics /// @param value The value of the constant. A uint64_t value. /// @param name The name of the metric. This is used for a check to ensure /// that the name matches the one at the given index. - void initialize_constant(const std::string& name, uint64_t value) const; - - /// Initialize a constant int64_t metric at the given index. - /// - /// A constant metric that is initialized with a value and never reset. - /// The value is written into memory at the time of initialization and - /// cannot be altered within the same runtime-environment. - /// - /// The indices of the metrics do not - /// match the ones in the info, so use index() to get the correct - /// index. Please do not hard-code this, as this may break with changes to - /// yours or our code. - /// - /// @param value The value of the constant. A int64_t value. - /// @param name The name of the metric. This is used for a check to ensure - /// that the name matches the one at the given index. - void initialize_constant(const std::string& name, int64_t value) const; - - /// Initialize a constant double metric at the given index. - /// - /// A constant metric that is initialized with a value and never reset. - /// The value is written into memory at the time of initialization and - /// cannot be altered within the same runtime-environment. - /// - /// The indices of the metrics do not - /// match the ones in the info, so use index() to get the correct - /// index. Please do not hard-code this, as this may break with changes to - /// yours or our code. - /// - /// @param value The value of the constant. A double value. - /// @param name The name of the metric. This is used for a check to ensure - /// that the name matches the one at the given index. - void initialize_constant(const std::string& name, double value) const; - - /// Initialize a constant bool metric at the given index. - /// - /// A constant metric that is initialized with a value and never reset. - /// The value is written into memory at the time of initialization and - /// cannot be altered within the same runtime-environment. - /// - /// The indices of the metrics do not - /// match the ones in the info, so use index() to get the correct - /// index. Please do not hard-code this, as this may break with changes to - /// yours or our code. - /// - /// @param value The value of the constant. A bool value. - /// @param name The name of the metric. This is used for a check to ensure - /// that the name matches the one at the given index. - void initialize_constant(const std::string& name, bool value) const; + template + void + initialize_constant(const std::string& name, + typename metric::value_type value) const + { + assert(m_meta_data != nullptr); + auto index = metrics::index(name); + assert(kind(index) == abacus::kind::constant); + *static_cast::value_type*>( + initialize(index)) = value; + } /// Copy the value of the uint64_t metric into a passed reference. This is /// used to extract the values during runtime. diff --git a/src/abacus/metrics2.hpp b/src/abacus/metrics2.hpp new file mode 100644 index 00000000..8cb0ba4e --- /dev/null +++ b/src/abacus/metrics2.hpp @@ -0,0 +1,100 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include + +#include "detail/value_size_info.hpp" +#include "metric.hpp" +#include "type.hpp" +#include "version.hpp" + +#include "protobuf/metrics.pb.h" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// This class is used for creating descriptive counters that are contiguous in +/// memory, to allow for fast access and arithmetic operations. +class metrics2 +{ + +public: + /// Default constructor + /// No metrics will be contained within this object. + metrics2(); + + /// Constructor + /// @param info The info of the metrics in a pointer. + /// @param count The number of infos. + metrics2(const protobuf::MetricsMetadata metadata) : m_metadata(metadata) + { + m_value_data = new uint8_t[value_bytes()]; + } + + /// Move assignment + auto operator=(metrics2&& other) noexcept -> metrics2&; + + /// Destructor + ~metrics2(); + + /// @return the pointer to the value data of the metrics. + auto value_data() const -> const uint8_t*; + + /// @return the size of the value data of the metrics. + auto value_bytes() const -> std::size_t; + + /// @return the meta data of the metrics. + auto metadata() const -> const protobuf::MetricsMetadata&; + + template + auto initialize_metric(const std::string& name) const -> metric + { + using value_type = typename metric::value_type; + auto offset = m_metadata.metrics().at(name).value_offset(); + + value_type* value_ptr = (value_type*)initialize(offset); + + return metric{value_ptr}; + } + + template + void + initialize_constant(const std::string& name, + typename metric::value_type value) const + { + using value_type = typename metric::value_type; + auto offset = m_metadata.metrics().at(name).value_offset(); + assert(m_metadata.metrics().at(name).kind(index) == + abacus::kind::constant); + *static_cast(initialize(offset)) = value; + } + + void reset_metrics(); + void reset_metric(const std::string& name); + +private: + auto initialize(std::size_t offset) const -> void*; + + /// No copy + metrics2(metrics2&) = delete; + + /// No copy assignment + metrics2& operator=(metrics2&) = delete; + +private: + /// The info of the metrics separated by byte-sizes + protobuf::MetricsMetadata m_metadata; + + /// The raw memory for the value data + uint8_t* m_value_data = nullptr; +}; +} +} diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index a406a6d4..faa8b546 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -23,176 +23,599 @@ namespace _fl = ::google::protobuf::internal::field_layout; namespace abacus { namespace protobuf { template -PROTOBUF_CONSTEXPR Info::Info(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) : _impl_{ - /*decltype(_impl_.name_)*/ { + /*decltype(_impl_.description_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.description_)*/ { + /*decltype(_impl_.value_offset_)*/ 0u, + /*decltype(_impl_.valid_offset_)*/ 0u, + /*decltype(_impl_.type_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*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 UInt64Type::UInt64Type(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.min_)*/ ::uint64_t{0u}, + /*decltype(_impl_.max_)*/ ::uint64_t{0u}, + /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct UInt64TypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR UInt64TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~UInt64TypeDefaultTypeInternal() {} + union { + UInt64Type _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UInt64TypeDefaultTypeInternal _UInt64Type_default_instance_; + template +PROTOBUF_CONSTEXPR Int64Type::Int64Type(::_pbi::ConstantInitialized) + : _impl_{ /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.type_)*/ 0, + /*decltype(_impl_.min_)*/ ::int64_t{0}, + /*decltype(_impl_.max_)*/ ::int64_t{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() {} +struct Int64TypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR Int64TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Int64TypeDefaultTypeInternal() {} union { - Info _instance; + Int64Type _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InfoDefaultTypeInternal _Info_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Int64TypeDefaultTypeInternal _Int64Type_default_instance_; template -PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR UInt32Type::UInt32Type(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.min_)*/ 0u, + /*decltype(_impl_.max_)*/ 0u, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct UInt32TypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR UInt32TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~UInt32TypeDefaultTypeInternal() {} + union { + UInt32Type _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UInt32TypeDefaultTypeInternal _UInt32Type_default_instance_; + template +PROTOBUF_CONSTEXPR Int32Type::Int32Type(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.min_)*/ 0, + /*decltype(_impl_.max_)*/ 0, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct Int32TypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR Int32TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Int32TypeDefaultTypeInternal() {} + union { + Int32Type _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Int32TypeDefaultTypeInternal _Int32Type_default_instance_; + template +PROTOBUF_CONSTEXPR Float64Type::Float64Type(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.min_)*/ 0, + /*decltype(_impl_.max_)*/ 0, + /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct Float64TypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR Float64TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Float64TypeDefaultTypeInternal() {} + union { + Float64Type _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Float64TypeDefaultTypeInternal _Float64Type_default_instance_; + template +PROTOBUF_CONSTEXPR Float32Type::Float32Type(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.min_)*/ 0, + /*decltype(_impl_.max_)*/ 0, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct Float32TypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR Float32TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Float32TypeDefaultTypeInternal() {} + union { + Float32Type _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Float32TypeDefaultTypeInternal _Float32Type_default_instance_; + template +PROTOBUF_CONSTEXPR BoolType::BoolType(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct BoolTypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR BoolTypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~BoolTypeDefaultTypeInternal() {} + union { + BoolType _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BoolTypeDefaultTypeInternal _BoolType_default_instance_; + template +PROTOBUF_CONSTEXPR EnumInfo::EnumInfo(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, - /*decltype(_impl_.info_)*/ nullptr, + /*decltype(_impl_.name_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.severity_)*/ 0u, + } {} +struct EnumInfoDefaultTypeInternal { + PROTOBUF_CONSTEXPR EnumInfoDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~EnumInfoDefaultTypeInternal() {} + union { + EnumInfo _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumInfoDefaultTypeInternal _EnumInfo_default_instance_; + template +PROTOBUF_CONSTEXPR EnumType_EnumMapEntry_DoNotUse::EnumType_EnumMapEntry_DoNotUse(::_pbi::ConstantInitialized) {} +struct EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal() {} + union { + EnumType_EnumMapEntry_DoNotUse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal _EnumType_EnumMapEntry_DoNotUse_default_instance_; + template +PROTOBUF_CONSTEXPR EnumType::EnumType(::_pbi::ConstantInitialized) + : _impl_{ + /* decltype(_impl_.enum_map_) */ {}, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct EnumTypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR EnumTypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~EnumTypeDefaultTypeInternal() {} + union { + EnumType _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumTypeDefaultTypeInternal _EnumType_default_instance_; + template +PROTOBUF_CONSTEXPR MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse(::_pbi::ConstantInitialized) {} +struct MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal() {} + union { + MetricsMetadata_MetricsEntry_DoNotUse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal _MetricsMetadata_MetricsEntry_DoNotUse_default_instance_; + template +PROTOBUF_CONSTEXPR MetricsMetadata::MetricsMetadata(::_pbi::ConstantInitialized) + : _impl_{ + /* decltype(_impl_.metrics_) */ {}, + /*decltype(_impl_.protocol_version_)*/ 0u, + /*decltype(_impl_.endianness_)*/ 0, + /*decltype(_impl_.sync_value_)*/ 0u, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct MetricsMetadataDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetricsMetadataDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~MetricsMetadataDefaultTypeInternal() {} + union { + MetricsMetadata _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; + template +PROTOBUF_CONSTEXPR MetricValue::MetricValue(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.valid_)*/ false, /*decltype(_impl_.value_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, } {} -struct MetricDefaultTypeInternal { - PROTOBUF_CONSTEXPR MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MetricDefaultTypeInternal() {} +struct MetricValueDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetricValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~MetricValueDefaultTypeInternal() {} union { - Metric _instance; + MetricValue _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricDefaultTypeInternal _Metric_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricValueDefaultTypeInternal _MetricValue_default_instance_; template -PROTOBUF_CONSTEXPR Metrics::Metrics(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR MetricValues::MetricValues(::_pbi::ConstantInitialized) : _impl_{ - /*decltype(_impl_.metric_)*/ {}, - /*decltype(_impl_.protocol_version_)*/ 0u, + /*decltype(_impl_.values_)*/ {}, + /*decltype(_impl_.sync_value_)*/ 0u, /*decltype(_impl_._cached_size_)*/ {}, } {} -struct MetricsDefaultTypeInternal { - PROTOBUF_CONSTEXPR MetricsDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MetricsDefaultTypeInternal() {} +struct MetricValuesDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetricValuesDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~MetricValuesDefaultTypeInternal() {} union { - Metrics _instance; + MetricValues _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsDefaultTypeInternal _Metrics_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricValuesDefaultTypeInternal _MetricValues_default_instance_; } // namespace protobuf } // namespace abacus -static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]; +static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[15]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[2]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( protodesc_cold) = { ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::abacus::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(::abacus::protobuf::Info, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.value_offset_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.valid_offset_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_.min_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_.max_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _internal_metadata_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.type_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _impl_.max_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _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(::abacus::protobuf::Int64Type, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _impl_.max_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _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(::abacus::protobuf::UInt32Type, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _impl_.max_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _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(::abacus::protobuf::Int32Type, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _impl_.max_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _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(::abacus::protobuf::Float64Type, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _impl_.max_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _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(::abacus::protobuf::Float32Type, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _impl_.max_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolType, _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(::abacus::protobuf::BoolType, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolType, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _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(::abacus::protobuf::EnumInfo, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _impl_.severity_), + ~0u, + 0, + 1, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, _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(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType, _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(::abacus::protobuf::EnumType, _impl_.enum_map_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, _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(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _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(::abacus::protobuf::Metric, _impl_.info_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.protocol_version_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.endianness_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.sync_value_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.metrics_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_.valid_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.value_), - 0, - ~0u, - ~0u, - ~0u, - ~0u, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_.value_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metrics, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValues, _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(::abacus::protobuf::Metrics, _impl_.protocol_version_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metrics, _impl_.metric_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValues, _impl_.sync_value_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValues, _impl_.values_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::abacus::protobuf::Info)}, - {21, 35, -1, sizeof(::abacus::protobuf::Metric)}, - {40, -1, -1, sizeof(::abacus::protobuf::Metrics)}, + {0, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {20, -1, -1, sizeof(::abacus::protobuf::UInt64Type)}, + {32, -1, -1, sizeof(::abacus::protobuf::Int64Type)}, + {44, -1, -1, sizeof(::abacus::protobuf::UInt32Type)}, + {56, -1, -1, sizeof(::abacus::protobuf::Int32Type)}, + {68, -1, -1, sizeof(::abacus::protobuf::Float64Type)}, + {80, -1, -1, sizeof(::abacus::protobuf::Float32Type)}, + {92, -1, -1, sizeof(::abacus::protobuf::BoolType)}, + {102, 113, -1, sizeof(::abacus::protobuf::EnumInfo)}, + {116, 126, -1, sizeof(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse)}, + {128, -1, -1, sizeof(::abacus::protobuf::EnumType)}, + {137, 147, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {149, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {161, -1, -1, sizeof(::abacus::protobuf::MetricValue)}, + {179, -1, -1, sizeof(::abacus::protobuf::MetricValues)}, }; static const ::_pb::Message* const file_default_instances[] = { - &::abacus::protobuf::_Info_default_instance_._instance, &::abacus::protobuf::_Metric_default_instance_._instance, - &::abacus::protobuf::_Metrics_default_instance_._instance, + &::abacus::protobuf::_UInt64Type_default_instance_._instance, + &::abacus::protobuf::_Int64Type_default_instance_._instance, + &::abacus::protobuf::_UInt32Type_default_instance_._instance, + &::abacus::protobuf::_Int32Type_default_instance_._instance, + &::abacus::protobuf::_Float64Type_default_instance_._instance, + &::abacus::protobuf::_Float32Type_default_instance_._instance, + &::abacus::protobuf::_BoolType_default_instance_._instance, + &::abacus::protobuf::_EnumInfo_default_instance_._instance, + &::abacus::protobuf::_EnumType_EnumMapEntry_DoNotUse_default_instance_._instance, + &::abacus::protobuf::_EnumType_default_instance_._instance, + &::abacus::protobuf::_MetricsMetadata_MetricsEntry_DoNotUse_default_instance_._instance, + &::abacus::protobuf::_MetricsMetadata_default_instance_._instance, + &::abacus::protobuf::_MetricValue_default_instance_._instance, + &::abacus::protobuf::_MetricValues_default_instance_._instance, }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." - "protobuf\"\223\002\n\004Info\022\014\n\004name\030\001 \001(\t\022\023\n\013descr" - "iption\030\002 \001(\t\022#\n\004type\030\003 \001(\0162\025.abacus.prot" - "obuf.Type\022#\n\004kind\030\004 \001(\0162\025.abacus.protobu" - "f.Kind\022\014\n\004unit\030\005 \001(\t\022\024\n\nuint64_min\030\006 \001(\004" - "H\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_ma" - "x\030\n \001(\003H\001\022\025\n\013float64_max\030\013 \001(\001H\001B\005\n\003minB" - "\005\n\003max\"\242\001\n\006Metric\022(\n\004info\030\001 \001(\0132\025.abacus" - ".protobuf.InfoH\001\210\001\001\022\026\n\014uint64_value\030\002 \001(" - "\004H\000\022\025\n\013int64_value\030\003 \001(\003H\000\022\027\n\rfloat64_va" - "lue\030\004 \001(\001H\000\022\024\n\nbool_value\030\005 \001(\010H\000B\007\n\005val" - "ueB\007\n\005_info\"L\n\007Metrics\022\030\n\020protocol_versi" - "on\030\001 \001(\r\022\'\n\006metric\030\002 \003(\0132\027.abacus.protob" - "uf.Metric*,\n\004Kind\022\013\n\007COUNTER\020\000\022\014\n\010CONSTA" - "NT\020\001\022\t\n\005GAUGE\020\002*4\n\004Type\022\n\n\006UINT64\020\000\022\t\n\005I" - "NT64\020\001\022\013\n\007FLOAT64\020\002\022\010\n\004BOOL\020\003B\021Z\017abacus/" - "protobufb\006proto3" + "protobuf\"\351\003\n\006Metric\022\023\n\013description\030\001 \001(\t" + "\022\024\n\014value_offset\030\002 \001(\r\022\024\n\014valid_offset\030\003" + " \001(\r\0222\n\013uint64_type\030\004 \001(\0132\033.abacus.proto" + "buf.UInt64TypeH\000\0220\n\nint64_type\030\005 \001(\0132\032.a" + "bacus.protobuf.Int64TypeH\000\0222\n\013uint32_typ" + "e\030\006 \001(\0132\033.abacus.protobuf.UInt32TypeH\000\0220" + "\n\nint32_type\030\007 \001(\0132\032.abacus.protobuf.Int" + "32TypeH\000\0224\n\014float64_type\030\010 \001(\0132\034.abacus." + "protobuf.Float64TypeH\000\0224\n\014float32_type\030\t" + " \001(\0132\034.abacus.protobuf.Float32TypeH\000\022.\n\t" + "bool_type\030\n \001(\0132\031.abacus.protobuf.BoolTy" + "peH\000\022.\n\tenum_type\030\013 \001(\0132\031.abacus.protobu" + "f.EnumTypeH\000B\006\n\004type\"Y\n\nUInt64Type\022\014\n\004un" + "it\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf" + ".Kind\022\013\n\003min\030\003 \001(\004\022\013\n\003max\030\004 \001(\004\"X\n\tInt64" + "Type\022\014\n\004unit\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacu" + "s.protobuf.Kind\022\013\n\003min\030\003 \001(\003\022\013\n\003max\030\004 \001(" + "\003\"Y\n\nUInt32Type\022\014\n\004unit\030\001 \001(\t\022#\n\004kind\030\002 " + "\001(\0162\025.abacus.protobuf.Kind\022\013\n\003min\030\003 \001(\r\022" + "\013\n\003max\030\004 \001(\r\"X\n\tInt32Type\022\014\n\004unit\030\001 \001(\t\022" + "#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\013\n\003" + "min\030\003 \001(\005\022\013\n\003max\030\004 \001(\005\"Z\n\013Float64Type\022\014\n" + "\004unit\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.proto" + "buf.Kind\022\013\n\003min\030\003 \001(\001\022\013\n\003max\030\004 \001(\001\"Z\n\013Fl" + "oat32Type\022\014\n\004unit\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025." + "abacus.protobuf.Kind\022\013\n\003min\030\003 \001(\002\022\013\n\003max" + "\030\004 \001(\002\"=\n\010BoolType\022\014\n\004unit\030\001 \001(\t\022#\n\004kind" + "\030\002 \001(\0162\025.abacus.protobuf.Kind\"f\n\010EnumInf" + "o\022\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001" + "\001\022\025\n\010severity\030\003 \001(\rH\001\210\001\001B\016\n\014_description" + "B\013\n\t_severity\"\217\001\n\010EnumType\0228\n\010enum_map\030\001" + " \003(\0132&.abacus.protobuf.EnumType.EnumMapE" + "ntry\032I\n\014EnumMapEntry\022\013\n\003key\030\001 \001(\r\022(\n\005val" + "ue\030\002 \001(\0132\031.abacus.protobuf.EnumInfo:\0028\001\"" + "\371\001\n\017MetricsMetadata\022\030\n\020protocol_version\030" + "\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.abacus.proto" + "buf.Endianness\022\022\n\nsync_value\030\003 \001(\r\022>\n\007me" + "trics\030\004 \003(\0132-.abacus.protobuf.MetricsMet" + "adata.MetricsEntry\032G\n\014MetricsEntry\022\013\n\003ke" + "y\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacus.protobuf" + ".Metric:\0028\001\"\341\001\n\013MetricValue\022\r\n\005valid\030\001 \001" + "(\010\022\026\n\014uint64_value\030\002 \001(\004H\000\022\025\n\013int64_valu" + "e\030\003 \001(\003H\000\022\026\n\014uint32_value\030\004 \001(\rH\000\022\025\n\013int" + "32_value\030\005 \001(\005H\000\022\027\n\rfloat32_value\030\006 \001(\002H" + "\000\022\027\n\rfloat64_value\030\007 \001(\001H\000\022\024\n\nbool_value" + "\030\010 \001(\010H\000\022\024\n\nenum_value\030\t \001(\rH\000B\007\n\005value\"" + "P\n\014MetricValues\022\022\n\nsync_value\030\001 \001(\r\022,\n\006v" + "alues\030\002 \003(\0132\034.abacus.protobuf.MetricValu" + "e*,\n\004Kind\022\013\n\007COUNTER\020\000\022\014\n\010CONSTANT\020\001\022\t\n\005" + "GAUGE\020\002*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007\n\003BIG" + "\020\001B\021Z\017abacus/protobufb\006proto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 696, + 2069, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, nullptr, 0, - 3, + 15, schemas, file_default_instances, TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets, @@ -234,16 +657,14 @@ bool Kind_IsValid(int value) { return false; } } -const ::google::protobuf::EnumDescriptor* Type_descriptor() { +const ::google::protobuf::EnumDescriptor* Endianness_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto); return file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; } -bool Type_IsValid(int value) { +bool Endianness_IsValid(int value) { switch (value) { case 0: case 1: - case 2: - case 3: return true; default: return false; @@ -251,40 +672,182 @@ bool Type_IsValid(int value) { } // =================================================================== -class Info::_Internal { +class Metric::_Internal { public: static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Info, _impl_._oneof_case_); + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::UInt64Type& uint64_type(const Metric* msg); + static const ::abacus::protobuf::Int64Type& int64_type(const Metric* msg); + static const ::abacus::protobuf::UInt32Type& uint32_type(const Metric* msg); + static const ::abacus::protobuf::Int32Type& int32_type(const Metric* msg); + static const ::abacus::protobuf::Float64Type& float64_type(const Metric* msg); + static const ::abacus::protobuf::Float32Type& float32_type(const Metric* msg); + static const ::abacus::protobuf::BoolType& bool_type(const Metric* msg); + static const ::abacus::protobuf::EnumType& enum_type(const Metric* msg); }; -Info::Info(::google::protobuf::Arena* arena) +const ::abacus::protobuf::UInt64Type& Metric::_Internal::uint64_type(const Metric* msg) { + return *msg->_impl_.type_.uint64_type_; +} +const ::abacus::protobuf::Int64Type& Metric::_Internal::int64_type(const Metric* msg) { + return *msg->_impl_.type_.int64_type_; +} +const ::abacus::protobuf::UInt32Type& Metric::_Internal::uint32_type(const Metric* msg) { + return *msg->_impl_.type_.uint32_type_; +} +const ::abacus::protobuf::Int32Type& Metric::_Internal::int32_type(const Metric* msg) { + return *msg->_impl_.type_.int32_type_; +} +const ::abacus::protobuf::Float64Type& Metric::_Internal::float64_type(const Metric* msg) { + return *msg->_impl_.type_.float64_type_; +} +const ::abacus::protobuf::Float32Type& Metric::_Internal::float32_type(const Metric* msg) { + return *msg->_impl_.type_.float32_type_; +} +const ::abacus::protobuf::BoolType& Metric::_Internal::bool_type(const Metric* msg) { + return *msg->_impl_.type_.bool_type_; +} +const ::abacus::protobuf::EnumType& Metric::_Internal::enum_type(const Metric* msg) { + return *msg->_impl_.type_.enum_type_; +} +void Metric::set_allocated_uint64_type(::abacus::protobuf::UInt64Type* uint64_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (uint64_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(uint64_type); + if (message_arena != submessage_arena) { + uint64_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, uint64_type, submessage_arena); + } + set_has_uint64_type(); + _impl_.type_.uint64_type_ = uint64_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.uint64_type) +} +void Metric::set_allocated_int64_type(::abacus::protobuf::Int64Type* int64_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (int64_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(int64_type); + if (message_arena != submessage_arena) { + int64_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, int64_type, submessage_arena); + } + set_has_int64_type(); + _impl_.type_.int64_type_ = int64_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.int64_type) +} +void Metric::set_allocated_uint32_type(::abacus::protobuf::UInt32Type* uint32_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (uint32_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(uint32_type); + if (message_arena != submessage_arena) { + uint32_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, uint32_type, submessage_arena); + } + set_has_uint32_type(); + _impl_.type_.uint32_type_ = uint32_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.uint32_type) +} +void Metric::set_allocated_int32_type(::abacus::protobuf::Int32Type* int32_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (int32_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(int32_type); + if (message_arena != submessage_arena) { + int32_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, int32_type, submessage_arena); + } + set_has_int32_type(); + _impl_.type_.int32_type_ = int32_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.int32_type) +} +void Metric::set_allocated_float64_type(::abacus::protobuf::Float64Type* float64_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (float64_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(float64_type); + if (message_arena != submessage_arena) { + float64_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, float64_type, submessage_arena); + } + set_has_float64_type(); + _impl_.type_.float64_type_ = float64_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.float64_type) +} +void Metric::set_allocated_float32_type(::abacus::protobuf::Float32Type* float32_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (float32_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(float32_type); + if (message_arena != submessage_arena) { + float32_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, float32_type, submessage_arena); + } + set_has_float32_type(); + _impl_.type_.float32_type_ = float32_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.float32_type) +} +void Metric::set_allocated_bool_type(::abacus::protobuf::BoolType* bool_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (bool_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(bool_type); + if (message_arena != submessage_arena) { + bool_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, bool_type, submessage_arena); + } + set_has_bool_type(); + _impl_.type_.bool_type_ = bool_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.bool_type) +} +void Metric::set_allocated_enum_type(::abacus::protobuf::EnumType* enum_type) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (enum_type) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(enum_type); + if (message_arena != submessage_arena) { + enum_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, enum_type, submessage_arena); + } + set_has_enum_type(); + _impl_.type_.enum_type_ = enum_type; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.enum_type) +} +Metric::Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Info) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Metric) } -Info::Info(const Info& from) : ::google::protobuf::Message() { - Info* const _this = this; +Metric::Metric(const Metric& from) : ::google::protobuf::Message() { + Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.name_){}, decltype(_impl_.description_){}, - decltype(_impl_.unit_){}, + decltype(_impl_.value_offset_){}, + decltype(_impl_.valid_offset_){}, 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()); @@ -292,167 +855,164 @@ Info::Info(const Info& from) : ::google::protobuf::Message() { 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()); + ::memcpy(&_impl_.value_offset_, &from._impl_.value_offset_, + static_cast<::size_t>(reinterpret_cast(&_impl_.valid_offset_) - + reinterpret_cast(&_impl_.value_offset_)) + sizeof(_impl_.valid_offset_)); + clear_has_type(); + switch (from.type_case()) { + case kUint64Type: { + _this->_internal_mutable_uint64_type()->::abacus::protobuf::UInt64Type::MergeFrom( + from._internal_uint64_type()); break; } - case kInt64Min: { - _this->_internal_set_int64_min(from._internal_int64_min()); + case kInt64Type: { + _this->_internal_mutable_int64_type()->::abacus::protobuf::Int64Type::MergeFrom( + from._internal_int64_type()); break; } - case kFloat64Min: { - _this->_internal_set_float64_min(from._internal_float64_min()); + case kUint32Type: { + _this->_internal_mutable_uint32_type()->::abacus::protobuf::UInt32Type::MergeFrom( + from._internal_uint32_type()); break; } - case MIN_NOT_SET: { + case kInt32Type: { + _this->_internal_mutable_int32_type()->::abacus::protobuf::Int32Type::MergeFrom( + from._internal_int32_type()); break; } - } - clear_has_max(); - switch (from.max_case()) { - case kUint64Max: { - _this->_internal_set_uint64_max(from._internal_uint64_max()); + case kFloat64Type: { + _this->_internal_mutable_float64_type()->::abacus::protobuf::Float64Type::MergeFrom( + from._internal_float64_type()); + break; + } + case kFloat32Type: { + _this->_internal_mutable_float32_type()->::abacus::protobuf::Float32Type::MergeFrom( + from._internal_float32_type()); break; } - case kInt64Max: { - _this->_internal_set_int64_max(from._internal_int64_max()); + case kBoolType: { + _this->_internal_mutable_bool_type()->::abacus::protobuf::BoolType::MergeFrom( + from._internal_bool_type()); break; } - case kFloat64Max: { - _this->_internal_set_float64_max(from._internal_float64_max()); + case kEnumType: { + _this->_internal_mutable_enum_type()->::abacus::protobuf::EnumType::MergeFrom( + from._internal_enum_type()); break; } - case MAX_NOT_SET: { + case TYPE_NOT_SET: { break; } } - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Info) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Metric) } -inline void Info::SharedCtor(::_pb::Arena* arena) { +inline void Metric::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_.value_offset_){0u}, + decltype(_impl_.valid_offset_){0u}, + decltype(_impl_.type_){}, /*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(); + clear_has_type(); } -Info::~Info() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Info) +Metric::~Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Info::SharedDtor() { +inline void Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.name_.Destroy(); _impl_.description_.Destroy(); - _impl_.unit_.Destroy(); - if (has_min()) { - clear_min(); - } - if (has_max()) { - clear_max(); + if (has_type()) { + clear_type(); } } -void Info::SetCachedSize(int size) const { +void Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Info::clear_min() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Info) - switch (min_case()) { - case kUint64Min: { - // No need to clear +void Metric::clear_type() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Metric) + switch (type_case()) { + case kUint64Type: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint64_type_; + } break; } - case kInt64Min: { - // No need to clear + case kInt64Type: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int64_type_; + } break; } - case kFloat64Min: { - // No need to clear + case kUint32Type: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint32_type_; + } break; } - case MIN_NOT_SET: { + case kInt32Type: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int32_type_; + } break; } - } - _impl_._oneof_case_[0] = MIN_NOT_SET; -} - -void Info::clear_max() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Info) - switch (max_case()) { - case kUint64Max: { - // No need to clear + case kFloat64Type: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float64_type_; + } break; } - case kInt64Max: { - // No need to clear + case kFloat32Type: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float32_type_; + } break; } - case kFloat64Max: { - // No need to clear + case kBoolType: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.bool_type_; + } + break; + } + case kEnumType: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.enum_type_; + } break; } - case MAX_NOT_SET: { + case TYPE_NOT_SET: { break; } } - _impl_._oneof_case_[1] = MAX_NOT_SET; + _impl_._oneof_case_[0] = TYPE_NOT_SET; } -PROTOBUF_NOINLINE void Info::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Info) +PROTOBUF_NOINLINE void Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Metric) ::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(); + ::memset(&_impl_.value_offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.valid_offset_) - + reinterpret_cast(&_impl_.value_offset_)) + sizeof(_impl_.valid_offset_)); + clear_type(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Info::_InternalParse( +const char* Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -460,412 +1020,3083 @@ const char* Info::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 11, 0, 56, 2> Info::_table_ = { +const ::_pbi::TcParseTable<2, 11, 8, 50, 2> Metric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 11, 56, // max_field_number, fast_idx_mask + 11, 24, // 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, + 8, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_Metric_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; + // string description = 1; {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(Info, _impl_.description_)}}, - // .abacus.protobuf.Type type = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Info, _impl_.type_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Info, _impl_.type_)}}, - // .abacus.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, {}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.description_)}}, + // uint32 value_offset = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.value_offset_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_offset_)}}, + // uint32 valid_offset = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.valid_offset_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.valid_offset_)}}, }}, {{ 65535, 65535 }}, {{ - // string name = 1; - {PROTOBUF_FIELD_OFFSET(Info, _impl_.name_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.description_), 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)}, - // .abacus.protobuf.Type type = 3; - {PROTOBUF_FIELD_OFFSET(Info, _impl_.type_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // .abacus.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 - {{ - "\24\4\13\0\0\4\0\0\0\0\0\0\0\0\0\0" - "abacus.protobuf.Info" - "name" + // uint32 value_offset = 2; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_offset_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // uint32 valid_offset = 3; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.valid_offset_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // .abacus.protobuf.UInt64Type uint64_type = 4; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_type_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Int64Type int64_type = 5; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int64_type_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.UInt32Type uint32_type = 6; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint32_type_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Int32Type int32_type = 7; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int32_type_), _Internal::kOneofCaseOffset + 0, 3, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Float64Type float64_type = 8; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float64_type_), _Internal::kOneofCaseOffset + 0, 4, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Float32Type float32_type = 9; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float32_type_), _Internal::kOneofCaseOffset + 0, 5, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.BoolType bool_type = 10; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.bool_type_), _Internal::kOneofCaseOffset + 0, 6, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.EnumType enum_type = 11; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.enum_type_), _Internal::kOneofCaseOffset + 0, 7, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt64Type>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Int64Type>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt32Type>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Int32Type>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Float64Type>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Float32Type>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::BoolType>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::EnumType>()}, + }}, {{ + "\26\13\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "abacus.protobuf.Metric" "description" - "unit" }}, }; -::uint8_t* Info::_InternalSerialize( +::uint8_t* Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Info) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Metric) ::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(); + // string description = 1; + 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, "abacus.protobuf.Info.name"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Metric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } - // string description = 2; + // uint32 value_offset = 2; + if (this->_internal_value_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 2, this->_internal_value_offset(), target); + } + + // uint32 valid_offset = 3; + if (this->_internal_valid_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this->_internal_valid_offset(), target); + } + + switch (type_case()) { + case kUint64Type: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::uint64_type(this), + _Internal::uint64_type(this).GetCachedSize(), target, stream); + break; + } + case kInt64Type: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::int64_type(this), + _Internal::int64_type(this).GetCachedSize(), target, stream); + break; + } + case kUint32Type: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::uint32_type(this), + _Internal::uint32_type(this).GetCachedSize(), target, stream); + break; + } + case kInt32Type: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::int32_type(this), + _Internal::int32_type(this).GetCachedSize(), target, stream); + break; + } + case kFloat64Type: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::float64_type(this), + _Internal::float64_type(this).GetCachedSize(), target, stream); + break; + } + case kFloat32Type: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(9, _Internal::float32_type(this), + _Internal::float32_type(this).GetCachedSize(), target, stream); + break; + } + case kBoolType: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(10, _Internal::bool_type(this), + _Internal::bool_type(this).GetCachedSize(), target, stream); + break; + } + case kEnumType: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(11, _Internal::enum_type(this), + _Internal::enum_type(this).GetCachedSize(), target, stream); + 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:abacus.protobuf.Metric) + return target; +} + +::size_t Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.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; + + // string description = 1; 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, "abacus.protobuf.Info.description"); - target = stream->WriteStringMaybeAliased(2, _s, target); + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + // uint32 value_offset = 2; + if (this->_internal_value_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_value_offset()); + } + + // uint32 valid_offset = 3; + if (this->_internal_valid_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_valid_offset()); + } + + switch (type_case()) { + // .abacus.protobuf.UInt64Type uint64_type = 4; + case kUint64Type: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.uint64_type_); + break; + } + // .abacus.protobuf.Int64Type int64_type = 5; + case kInt64Type: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.int64_type_); + break; + } + // .abacus.protobuf.UInt32Type uint32_type = 6; + case kUint32Type: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.uint32_type_); + break; + } + // .abacus.protobuf.Int32Type int32_type = 7; + case kInt32Type: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.int32_type_); + break; + } + // .abacus.protobuf.Float64Type float64_type = 8; + case kFloat64Type: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.float64_type_); + break; + } + // .abacus.protobuf.Float32Type float32_type = 9; + case kFloat32Type: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.float32_type_); + break; + } + // .abacus.protobuf.BoolType bool_type = 10; + case kBoolType: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.bool_type_); + break; + } + // .abacus.protobuf.EnumType enum_type = 11; + case kEnumType: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.enum_type_); + break; + } + case TYPE_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:abacus.protobuf.Metric) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); + } + if (from._internal_value_offset() != 0) { + _this->_internal_set_value_offset(from._internal_value_offset()); + } + if (from._internal_valid_offset() != 0) { + _this->_internal_set_valid_offset(from._internal_valid_offset()); } + switch (from.type_case()) { + case kUint64Type: { + _this->_internal_mutable_uint64_type()->::abacus::protobuf::UInt64Type::MergeFrom( + from._internal_uint64_type()); + break; + } + case kInt64Type: { + _this->_internal_mutable_int64_type()->::abacus::protobuf::Int64Type::MergeFrom( + from._internal_int64_type()); + break; + } + case kUint32Type: { + _this->_internal_mutable_uint32_type()->::abacus::protobuf::UInt32Type::MergeFrom( + from._internal_uint32_type()); + break; + } + case kInt32Type: { + _this->_internal_mutable_int32_type()->::abacus::protobuf::Int32Type::MergeFrom( + from._internal_int32_type()); + break; + } + case kFloat64Type: { + _this->_internal_mutable_float64_type()->::abacus::protobuf::Float64Type::MergeFrom( + from._internal_float64_type()); + break; + } + case kFloat32Type: { + _this->_internal_mutable_float32_type()->::abacus::protobuf::Float32Type::MergeFrom( + from._internal_float32_type()); + break; + } + case kBoolType: { + _this->_internal_mutable_bool_type()->::abacus::protobuf::BoolType::MergeFrom( + from._internal_bool_type()); + break; + } + case kEnumType: { + _this->_internal_mutable_enum_type()->::abacus::protobuf::EnumType::MergeFrom( + from._internal_enum_type()); + break; + } + case TYPE_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:abacus.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; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, + &other->_impl_.description_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Metric, _impl_.valid_offset_) + + sizeof(Metric::_impl_.valid_offset_) + - PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_offset_)>( + reinterpret_cast(&_impl_.value_offset_), + reinterpret_cast(&other->_impl_.value_offset_)); + swap(_impl_.type_, other->_impl_.type_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::google::protobuf::Metadata Metric::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); +} +// =================================================================== + +class UInt64Type::_Internal { + public: +}; + +UInt64Type::UInt64Type(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt64Type) +} +UInt64Type::UInt64Type(const UInt64Type& from) : ::google::protobuf::Message() { + UInt64Type* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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_.min_, &from._impl_.min_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Type) +} +inline void UInt64Type::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.min_){::uint64_t{0u}}, + decltype(_impl_.max_){::uint64_t{0u}}, + decltype(_impl_.kind_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +UInt64Type::~UInt64Type() { + // @@protoc_insertion_point(destructor:abacus.protobuf.UInt64Type) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void UInt64Type::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.unit_.Destroy(); +} +void UInt64Type::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void UInt64Type::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt64Type) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.unit_.ClearToEmpty(); + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* UInt64Type::_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<2, 4, 0, 39, 2> UInt64Type::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_UInt64Type_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // uint64 max = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Type, _impl_.max_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.max_)}}, + // string unit = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.unit_)}}, + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Type, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.kind_)}}, + // uint64 min = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Type, _impl_.min_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.min_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string unit = 1; + {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // uint64 min = 3; + {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.min_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, + // uint64 max = 4; + {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.max_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, + }}, + // no aux_entries + {{ + "\32\4\0\0\0\0\0\0" + "abacus.protobuf.UInt64Type" + "unit" + }}, +}; + +::uint8_t* UInt64Type::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt64Type) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string unit = 1; + 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, "abacus.protobuf.UInt64Type.unit"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + + // uint64 min = 3; + if (this->_internal_min() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 3, this->_internal_min(), target); + } + + // uint64 max = 4; + if (this->_internal_max() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 4, this->_internal_max(), target); + } + + 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:abacus.protobuf.UInt64Type) + return target; +} + +::size_t UInt64Type::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.UInt64Type) + ::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 unit = 1; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // uint64 min = 3; + if (this->_internal_min() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_min()); + } + + // uint64 max = 4; + if (this->_internal_max() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_max()); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData UInt64Type::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + UInt64Type::MergeImpl +}; +const ::google::protobuf::Message::ClassData*UInt64Type::GetClassData() const { return &_class_data_; } + + +void UInt64Type::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:abacus.protobuf.UInt64Type) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_min() != 0) { + _this->_internal_set_min(from._internal_min()); + } + if (from._internal_max() != 0) { + _this->_internal_set_max(from._internal_max()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void UInt64Type::CopyFrom(const UInt64Type& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.UInt64Type) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool UInt64Type::IsInitialized() const { + return true; +} + +void UInt64Type::InternalSwap(UInt64Type* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.kind_) + + sizeof(UInt64Type::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.min_)>( + reinterpret_cast(&_impl_.min_), + reinterpret_cast(&other->_impl_.min_)); +} + +::google::protobuf::Metadata UInt64Type::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); +} +// =================================================================== + +class Int64Type::_Internal { + public: +}; + +Int64Type::Int64Type(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Int64Type) +} +Int64Type::Int64Type(const Int64Type& from) : ::google::protobuf::Message() { + Int64Type* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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_.min_, &from._impl_.min_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int64Type) +} +inline void Int64Type::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.min_){::int64_t{0}}, + decltype(_impl_.max_){::int64_t{0}}, + decltype(_impl_.kind_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +Int64Type::~Int64Type() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Int64Type) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Int64Type::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.unit_.Destroy(); +} +void Int64Type::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void Int64Type::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int64Type) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.unit_.ClearToEmpty(); + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Int64Type::_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<2, 4, 0, 38, 2> Int64Type::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_Int64Type_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // int64 max = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Type, _impl_.max_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.max_)}}, + // string unit = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.unit_)}}, + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Type, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.kind_)}}, + // int64 min = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Type, _impl_.min_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.min_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string unit = 1; + {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // int64 min = 3; + {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.min_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kInt64)}, + // int64 max = 4; + {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.max_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kInt64)}, + }}, + // no aux_entries + {{ + "\31\4\0\0\0\0\0\0" + "abacus.protobuf.Int64Type" + "unit" + }}, +}; + +::uint8_t* Int64Type::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Int64Type) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string unit = 1; + 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, "abacus.protobuf.Int64Type.unit"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + + // int64 min = 3; + if (this->_internal_min() != 0) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64ToArrayWithField<3>( + stream, this->_internal_min(), target); + } + + // int64 max = 4; + if (this->_internal_max() != 0) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64ToArrayWithField<4>( + stream, this->_internal_max(), target); + } + + 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:abacus.protobuf.Int64Type) + return target; +} + +::size_t Int64Type::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Int64Type) + ::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 unit = 1; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // int64 min = 3; + if (this->_internal_min() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_min()); + } + + // int64 max = 4; + if (this->_internal_max() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_max()); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Int64Type::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Int64Type::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Int64Type::GetClassData() const { return &_class_data_; } + + +void Int64Type::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:abacus.protobuf.Int64Type) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_min() != 0) { + _this->_internal_set_min(from._internal_min()); + } + if (from._internal_max() != 0) { + _this->_internal_set_max(from._internal_max()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Int64Type::CopyFrom(const Int64Type& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Int64Type) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Int64Type::IsInitialized() const { + return true; +} + +void Int64Type::InternalSwap(Int64Type* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.kind_) + + sizeof(Int64Type::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.min_)>( + reinterpret_cast(&_impl_.min_), + reinterpret_cast(&other->_impl_.min_)); +} + +::google::protobuf::Metadata Int64Type::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); +} +// =================================================================== + +class UInt32Type::_Internal { + public: +}; + +UInt32Type::UInt32Type(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt32Type) +} +UInt32Type::UInt32Type(const UInt32Type& from) : ::google::protobuf::Message() { + UInt32Type* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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_.kind_, &from._impl_.kind_, + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt32Type) +} +inline void UInt32Type::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){0}, + decltype(_impl_.min_){0u}, + decltype(_impl_.max_){0u}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +UInt32Type::~UInt32Type() { + // @@protoc_insertion_point(destructor:abacus.protobuf.UInt32Type) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void UInt32Type::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.unit_.Destroy(); +} +void UInt32Type::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void UInt32Type::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt32Type) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.unit_.ClearToEmpty(); + ::memset(&_impl_.kind_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* UInt32Type::_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<2, 4, 0, 39, 2> UInt32Type::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_UInt32Type_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // uint32 max = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Type, _impl_.max_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.max_)}}, + // string unit = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.unit_)}}, + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Type, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.kind_)}}, + // uint32 min = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Type, _impl_.min_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.min_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string unit = 1; + {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // uint32 min = 3; + {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.min_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // uint32 max = 4; + {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.max_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + "\32\4\0\0\0\0\0\0" + "abacus.protobuf.UInt32Type" + "unit" + }}, +}; + +::uint8_t* UInt32Type::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt32Type) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string unit = 1; + 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, "abacus.protobuf.UInt32Type.unit"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + + // uint32 min = 3; + if (this->_internal_min() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this->_internal_min(), target); + } + + // uint32 max = 4; + if (this->_internal_max() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 4, this->_internal_max(), target); + } + + 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:abacus.protobuf.UInt32Type) + return target; +} + +::size_t UInt32Type::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.UInt32Type) + ::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 unit = 1; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + // uint32 min = 3; + if (this->_internal_min() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_min()); + } + + // uint32 max = 4; + if (this->_internal_max() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_max()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData UInt32Type::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + UInt32Type::MergeImpl +}; +const ::google::protobuf::Message::ClassData*UInt32Type::GetClassData() const { return &_class_data_; } + + +void UInt32Type::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:abacus.protobuf.UInt32Type) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + if (from._internal_min() != 0) { + _this->_internal_set_min(from._internal_min()); + } + if (from._internal_max() != 0) { + _this->_internal_set_max(from._internal_max()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void UInt32Type::CopyFrom(const UInt32Type& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.UInt32Type) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool UInt32Type::IsInitialized() const { + return true; +} + +void UInt32Type::InternalSwap(UInt32Type* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.max_) + + sizeof(UInt32Type::_impl_.max_) + - PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.kind_)>( + reinterpret_cast(&_impl_.kind_), + reinterpret_cast(&other->_impl_.kind_)); +} + +::google::protobuf::Metadata UInt32Type::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]); +} +// =================================================================== + +class Int32Type::_Internal { + public: +}; + +Int32Type::Int32Type(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Int32Type) +} +Int32Type::Int32Type(const Int32Type& from) : ::google::protobuf::Message() { + Int32Type* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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_.kind_, &from._impl_.kind_, + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int32Type) +} +inline void Int32Type::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){0}, + decltype(_impl_.min_){0}, + decltype(_impl_.max_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +Int32Type::~Int32Type() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Int32Type) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Int32Type::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.unit_.Destroy(); +} +void Int32Type::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void Int32Type::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int32Type) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.unit_.ClearToEmpty(); + ::memset(&_impl_.kind_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Int32Type::_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<2, 4, 0, 38, 2> Int32Type::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_Int32Type_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // int32 max = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Type, _impl_.max_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.max_)}}, + // string unit = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.unit_)}}, + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Type, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.kind_)}}, + // int32 min = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Type, _impl_.min_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.min_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string unit = 1; + {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // int32 min = 3; + {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.min_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, + // int32 max = 4; + {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.max_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, + }}, + // no aux_entries + {{ + "\31\4\0\0\0\0\0\0" + "abacus.protobuf.Int32Type" + "unit" + }}, +}; + +::uint8_t* Int32Type::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Int32Type) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string unit = 1; + 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, "abacus.protobuf.Int32Type.unit"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + + // int32 min = 3; + if (this->_internal_min() != 0) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<3>( + stream, this->_internal_min(), target); + } + + // int32 max = 4; + if (this->_internal_max() != 0) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<4>( + stream, this->_internal_max(), target); + } + + 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:abacus.protobuf.Int32Type) + return target; +} + +::size_t Int32Type::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Int32Type) + ::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 unit = 1; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + // int32 min = 3; + if (this->_internal_min() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_min()); + } + + // int32 max = 4; + if (this->_internal_max() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_max()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Int32Type::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Int32Type::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Int32Type::GetClassData() const { return &_class_data_; } + + +void Int32Type::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:abacus.protobuf.Int32Type) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + if (from._internal_min() != 0) { + _this->_internal_set_min(from._internal_min()); + } + if (from._internal_max() != 0) { + _this->_internal_set_max(from._internal_max()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Int32Type::CopyFrom(const Int32Type& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Int32Type) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Int32Type::IsInitialized() const { + return true; +} + +void Int32Type::InternalSwap(Int32Type* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.max_) + + sizeof(Int32Type::_impl_.max_) + - PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.kind_)>( + reinterpret_cast(&_impl_.kind_), + reinterpret_cast(&other->_impl_.kind_)); +} + +::google::protobuf::Metadata Int32Type::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[4]); +} +// =================================================================== + +class Float64Type::_Internal { + public: +}; + +Float64Type::Float64Type(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Float64Type) +} +Float64Type::Float64Type(const Float64Type& from) : ::google::protobuf::Message() { + Float64Type* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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_.min_, &from._impl_.min_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float64Type) +} +inline void Float64Type::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.min_){0}, + decltype(_impl_.max_){0}, + decltype(_impl_.kind_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +Float64Type::~Float64Type() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Float64Type) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Float64Type::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.unit_.Destroy(); +} +void Float64Type::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void Float64Type::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float64Type) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.unit_.ClearToEmpty(); + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Float64Type::_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<2, 4, 0, 40, 2> Float64Type::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_Float64Type_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // double max = 4; + {::_pbi::TcParser::FastF64S1, + {33, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.max_)}}, + // string unit = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.unit_)}}, + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Type, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.kind_)}}, + // double min = 3; + {::_pbi::TcParser::FastF64S1, + {25, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.min_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string unit = 1; + {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // double min = 3; + {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.min_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kDouble)}, + // double max = 4; + {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.max_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kDouble)}, + }}, + // no aux_entries + {{ + "\33\4\0\0\0\0\0\0" + "abacus.protobuf.Float64Type" + "unit" + }}, +}; + +::uint8_t* Float64Type::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Float64Type) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string unit = 1; + 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, "abacus.protobuf.Float64Type.unit"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + + // double min = 3; + static_assert(sizeof(::uint64_t) == sizeof(double), + "Code assumes ::uint64_t and double are the same size."); + double tmp_min = this->_internal_min(); + ::uint64_t raw_min; + memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); + if (raw_min != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 3, this->_internal_min(), target); + } + + // double max = 4; + static_assert(sizeof(::uint64_t) == sizeof(double), + "Code assumes ::uint64_t and double are the same size."); + double tmp_max = this->_internal_max(); + ::uint64_t raw_max; + memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); + if (raw_max != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 4, this->_internal_max(), target); + } + + 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:abacus.protobuf.Float64Type) + return target; +} + +::size_t Float64Type::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Float64Type) + ::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 unit = 1; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // double min = 3; + static_assert(sizeof(::uint64_t) == sizeof(double), + "Code assumes ::uint64_t and double are the same size."); + double tmp_min = this->_internal_min(); + ::uint64_t raw_min; + memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); + if (raw_min != 0) { + total_size += 9; + } + + // double max = 4; + static_assert(sizeof(::uint64_t) == sizeof(double), + "Code assumes ::uint64_t and double are the same size."); + double tmp_max = this->_internal_max(); + ::uint64_t raw_max; + memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); + if (raw_max != 0) { + total_size += 9; + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Float64Type::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Float64Type::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Float64Type::GetClassData() const { return &_class_data_; } + + +void Float64Type::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:abacus.protobuf.Float64Type) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + static_assert(sizeof(::uint64_t) == sizeof(double), + "Code assumes ::uint64_t and double are the same size."); + double tmp_min = from._internal_min(); + ::uint64_t raw_min; + memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); + if (raw_min != 0) { + _this->_internal_set_min(from._internal_min()); + } + static_assert(sizeof(::uint64_t) == sizeof(double), + "Code assumes ::uint64_t and double are the same size."); + double tmp_max = from._internal_max(); + ::uint64_t raw_max; + memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); + if (raw_max != 0) { + _this->_internal_set_max(from._internal_max()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Float64Type::CopyFrom(const Float64Type& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Float64Type) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Float64Type::IsInitialized() const { + return true; +} + +void Float64Type::InternalSwap(Float64Type* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.kind_) + + sizeof(Float64Type::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.min_)>( + reinterpret_cast(&_impl_.min_), + reinterpret_cast(&other->_impl_.min_)); +} + +::google::protobuf::Metadata Float64Type::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[5]); +} +// =================================================================== + +class Float32Type::_Internal { + public: +}; + +Float32Type::Float32Type(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Float32Type) +} +Float32Type::Float32Type(const Float32Type& from) : ::google::protobuf::Message() { + Float32Type* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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_.kind_, &from._impl_.kind_, + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float32Type) +} +inline void Float32Type::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){0}, + decltype(_impl_.min_){0}, + decltype(_impl_.max_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +Float32Type::~Float32Type() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Float32Type) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Float32Type::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.unit_.Destroy(); +} +void Float32Type::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void Float32Type::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float32Type) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.unit_.ClearToEmpty(); + ::memset(&_impl_.kind_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Float32Type::_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<2, 4, 0, 40, 2> Float32Type::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_Float32Type_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // float max = 4; + {::_pbi::TcParser::FastF32S1, + {37, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.max_)}}, + // string unit = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.unit_)}}, + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Type, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.kind_)}}, + // float min = 3; + {::_pbi::TcParser::FastF32S1, + {29, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.min_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string unit = 1; + {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // float min = 3; + {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.min_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + // float max = 4; + {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.max_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + }}, + // no aux_entries + {{ + "\33\4\0\0\0\0\0\0" + "abacus.protobuf.Float32Type" + "unit" + }}, +}; + +::uint8_t* Float32Type::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Float32Type) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string unit = 1; + 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, "abacus.protobuf.Float32Type.unit"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + + // float min = 3; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_min = this->_internal_min(); + ::uint32_t raw_min; + memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); + if (raw_min != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFloatToArray( + 3, this->_internal_min(), target); + } + + // float max = 4; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_max = this->_internal_max(); + ::uint32_t raw_max; + memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); + if (raw_max != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFloatToArray( + 4, this->_internal_max(), target); + } + + 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:abacus.protobuf.Float32Type) + return target; +} + +::size_t Float32Type::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Float32Type) + ::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 unit = 1; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + // float min = 3; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_min = this->_internal_min(); + ::uint32_t raw_min; + memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); + if (raw_min != 0) { + total_size += 5; + } + + // float max = 4; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_max = this->_internal_max(); + ::uint32_t raw_max; + memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); + if (raw_max != 0) { + total_size += 5; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Float32Type::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Float32Type::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Float32Type::GetClassData() const { return &_class_data_; } + + +void Float32Type::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:abacus.protobuf.Float32Type) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_min = from._internal_min(); + ::uint32_t raw_min; + memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); + if (raw_min != 0) { + _this->_internal_set_min(from._internal_min()); + } + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_max = from._internal_max(); + ::uint32_t raw_max; + memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); + if (raw_max != 0) { + _this->_internal_set_max(from._internal_max()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Float32Type::CopyFrom(const Float32Type& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Float32Type) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Float32Type::IsInitialized() const { + return true; +} + +void Float32Type::InternalSwap(Float32Type* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.max_) + + sizeof(Float32Type::_impl_.max_) + - PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.kind_)>( + reinterpret_cast(&_impl_.kind_), + reinterpret_cast(&other->_impl_.kind_)); +} + +::google::protobuf::Metadata Float32Type::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[6]); +} +// =================================================================== + +class BoolType::_Internal { + public: +}; + +BoolType::BoolType(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.BoolType) +} +BoolType::BoolType(const BoolType& from) : ::google::protobuf::Message() { + BoolType* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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()); + } + _this->_impl_.kind_ = from._impl_.kind_; + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.BoolType) +} +inline void BoolType::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.unit_){}, + decltype(_impl_.kind_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +BoolType::~BoolType() { + // @@protoc_insertion_point(destructor:abacus.protobuf.BoolType) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void BoolType::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.unit_.Destroy(); +} +void BoolType::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void BoolType::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.BoolType) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.unit_.ClearToEmpty(); + _impl_.kind_ = 0; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* BoolType::_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, 0, 37, 2> BoolType::_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 + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_BoolType_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(BoolType, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(BoolType, _impl_.kind_)}}, + // string unit = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(BoolType, _impl_.unit_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string unit = 1; + {PROTOBUF_FIELD_OFFSET(BoolType, _impl_.unit_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(BoolType, _impl_.kind_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + }}, + // no aux_entries + {{ + "\30\4\0\0\0\0\0\0" + "abacus.protobuf.BoolType" + "unit" + }}, +}; + +::uint8_t* BoolType::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.BoolType) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string unit = 1; + 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, "abacus.protobuf.BoolType.unit"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + + 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:abacus.protobuf.BoolType) + return target; +} + +::size_t BoolType::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.BoolType) + ::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 unit = 1; + if (!this->_internal_unit().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData BoolType::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + BoolType::MergeImpl +}; +const ::google::protobuf::Message::ClassData*BoolType::GetClassData() const { return &_class_data_; } + + +void BoolType::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:abacus.protobuf.BoolType) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_unit().empty()) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void BoolType::CopyFrom(const BoolType& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.BoolType) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool BoolType::IsInitialized() const { + return true; +} + +void BoolType::InternalSwap(BoolType* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + swap(_impl_.kind_, other->_impl_.kind_); +} + +::google::protobuf::Metadata BoolType::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); +} +// =================================================================== + +class EnumInfo::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_._has_bits_); + static void set_has_description(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_severity(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +EnumInfo::EnumInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.EnumInfo) +} +EnumInfo::EnumInfo(const EnumInfo& from) : ::google::protobuf::Message() { + EnumInfo* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.name_){}, + decltype(_impl_.description_){}, + decltype(_impl_.severity_){}, + }; + _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._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.description_.Set(from._internal_description(), _this->GetArenaForAllocation()); + } + _this->_impl_.severity_ = from._impl_.severity_; + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.EnumInfo) +} +inline void EnumInfo::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.name_){}, + decltype(_impl_.description_){}, + decltype(_impl_.severity_){0u}, + }; + _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 +} +EnumInfo::~EnumInfo() { + // @@protoc_insertion_point(destructor:abacus.protobuf.EnumInfo) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void EnumInfo::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); + _impl_.description_.Destroy(); +} +void EnumInfo::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void EnumInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.EnumInfo) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.name_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.description_.ClearNonDefaultToEmpty(); + } + _impl_.severity_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* EnumInfo::_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<2, 3, 0, 48, 2> EnumInfo::_table_ = { + { + PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_._has_bits_), + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967288, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_EnumInfo_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string name = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.name_)}}, + // optional string description = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.description_)}}, + // optional uint32 severity = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(EnumInfo, _impl_.severity_), 1>(), + {24, 1, 0, PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.severity_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string name = 1; + {PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.name_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional string description = 2; + {PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.description_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional uint32 severity = 3; + {PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.severity_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + "\30\4\13\0\0\0\0\0" + "abacus.protobuf.EnumInfo" + "name" + "description" + }}, +}; + +::uint8_t* EnumInfo::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.EnumInfo) + ::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, "abacus.protobuf.EnumInfo.name"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + cached_has_bits = _impl_._has_bits_[0]; + // optional string description = 2; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_description(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.EnumInfo.description"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + + // optional uint32 severity = 3; + if (cached_has_bits & 0x00000002u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this->_internal_severity(), target); + } + + 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:abacus.protobuf.EnumInfo) + return target; +} + +::size_t EnumInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.EnumInfo) + ::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()); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional string description = 2; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + // optional uint32 severity = 3; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_severity()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData EnumInfo::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + EnumInfo::MergeImpl +}; +const ::google::protobuf::Message::ClassData*EnumInfo::GetClassData() const { return &_class_data_; } + + +void EnumInfo::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:abacus.protobuf.EnumInfo) + 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()); + } + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_description(from._internal_description()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.severity_ = from._impl_.severity_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void EnumInfo::CopyFrom(const EnumInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.EnumInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool EnumInfo::IsInitialized() const { + return true; +} + +void EnumInfo::InternalSwap(EnumInfo* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, + &other->_impl_.description_, rhs_arena); + swap(_impl_.severity_, other->_impl_.severity_); +} + +::google::protobuf::Metadata EnumInfo::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[8]); +} +// =================================================================== + +EnumType_EnumMapEntry_DoNotUse::EnumType_EnumMapEntry_DoNotUse() {} +EnumType_EnumMapEntry_DoNotUse::EnumType_EnumMapEntry_DoNotUse(::google::protobuf::Arena* arena) + : SuperType(arena) {} +void EnumType_EnumMapEntry_DoNotUse::MergeFrom(const EnumType_EnumMapEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata EnumType_EnumMapEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[9]); +} +// =================================================================== + +class EnumType::_Internal { + public: +}; + +EnumType::EnumType(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.EnumType) +} +EnumType::EnumType(const EnumType& from) : ::google::protobuf::Message() { + EnumType* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + /* decltype(_impl_.enum_map_) */ {}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _this->_impl_.enum_map_.MergeFrom(from._impl_.enum_map_); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.EnumType) +} +inline void EnumType::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + /* decltype(_impl_.enum_map_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, + /*decltype(_impl_._cached_size_)*/ {}, + }; +} +EnumType::~EnumType() { + // @@protoc_insertion_point(destructor:abacus.protobuf.EnumType) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void EnumType::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.enum_map_.~MapField(); +} +void EnumType::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void EnumType::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.EnumType) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.enum_map_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* EnumType::_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, 1, 2, 0, 2> EnumType::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_EnumType_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // map enum_map = 1; + {PROTOBUF_FIELD_OFFSET(EnumType, _impl_.enum_map_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, + }}, {{ + {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, + {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::EnumInfo>}, + }}, {{ + }}, +}; + +::uint8_t* EnumType::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.EnumType) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // map enum_map = 1; + if (!_internal_enum_map().empty()) { + using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>; + using WireHelper = EnumType_EnumMapEntry_DoNotUse::Funcs; + const auto& field = _internal_enum_map(); + + if (stream->IsSerializationDeterministic() && field.size() > 1) { + for (const auto& entry : ::google::protobuf::internal::MapSorterFlat(field)) { + target = WireHelper::InternalSerialize( + 1, entry.first, entry.second, target, stream); + } + } else { + for (const auto& entry : field) { + target = WireHelper::InternalSerialize( + 1, entry.first, entry.second, 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:abacus.protobuf.EnumType) + return target; +} + +::size_t EnumType::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.EnumType) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // map enum_map = 1; + total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_enum_map_size()); + for (const auto& entry : _internal_enum_map()) { + total_size += EnumType_EnumMapEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData EnumType::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + EnumType::MergeImpl +}; +const ::google::protobuf::Message::ClassData*EnumType::GetClassData() const { return &_class_data_; } + + +void EnumType::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:abacus.protobuf.EnumType) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.enum_map_.MergeFrom(from._impl_.enum_map_); + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void EnumType::CopyFrom(const EnumType& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.EnumType) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool EnumType::IsInitialized() const { + return true; +} + +void EnumType::InternalSwap(EnumType* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.enum_map_.InternalSwap(&other->_impl_.enum_map_); +} + +::google::protobuf::Metadata EnumType::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[10]); +} +// =================================================================== + +MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse() {} +MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse(::google::protobuf::Arena* arena) + : SuperType(arena) {} +void MetricsMetadata_MetricsEntry_DoNotUse::MergeFrom(const MetricsMetadata_MetricsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata MetricsMetadata_MetricsEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[11]); +} +// =================================================================== + +class MetricsMetadata::_Internal { + public: +}; + +MetricsMetadata::MetricsMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.MetricsMetadata) +} +MetricsMetadata::MetricsMetadata(const MetricsMetadata& from) : ::google::protobuf::Message() { + MetricsMetadata* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + /* decltype(_impl_.metrics_) */ {}, + decltype(_impl_.protocol_version_){}, + decltype(_impl_.endianness_){}, + decltype(_impl_.sync_value_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_); + ::memcpy(&_impl_.protocol_version_, &from._impl_.protocol_version_, + static_cast<::size_t>(reinterpret_cast(&_impl_.sync_value_) - + reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.sync_value_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.MetricsMetadata) +} +inline void MetricsMetadata::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + /* decltype(_impl_.metrics_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, + decltype(_impl_.protocol_version_){0u}, + decltype(_impl_.endianness_){0}, + decltype(_impl_.sync_value_){0u}, + /*decltype(_impl_._cached_size_)*/ {}, + }; +} +MetricsMetadata::~MetricsMetadata() { + // @@protoc_insertion_point(destructor:abacus.protobuf.MetricsMetadata) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void MetricsMetadata::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.metrics_.~MapField(); +} +void MetricsMetadata::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void MetricsMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.MetricsMetadata) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.metrics_.Clear(); + ::memset(&_impl_.protocol_version_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.sync_value_) - + reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.sync_value_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* MetricsMetadata::_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<2, 4, 2, 47, 2> MetricsMetadata::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_MetricsMetadata_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // uint32 protocol_version = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.protocol_version_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_)}}, + // .abacus.protobuf.Endianness endianness = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.endianness_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_)}}, + // uint32 sync_value = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.sync_value_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // uint32 protocol_version = 1; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // .abacus.protobuf.Endianness endianness = 2; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // uint32 sync_value = 3; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // map metrics = 4; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.metrics_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, + }}, {{ + {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, + {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Metric>}, + }}, {{ + "\37\0\0\0\7\0\0\0" + "abacus.protobuf.MetricsMetadata" + "metrics" + }}, +}; + +::uint8_t* MetricsMetadata::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.MetricsMetadata) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; - // .abacus.protobuf.Type type = 3; - if (this->_internal_type() != 0) { + // uint32 protocol_version = 1; + if (this->_internal_protocol_version() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 3, this->_internal_type(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_protocol_version(), target); } - // .abacus.protobuf.Kind kind = 4; - if (this->_internal_kind() != 0) { + // .abacus.protobuf.Endianness endianness = 2; + if (this->_internal_endianness() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_kind(), target); + 2, this->_internal_endianness(), 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, "abacus.protobuf.Info.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + // uint32 sync_value = 3; + if (this->_internal_sync_value() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this->_internal_sync_value(), 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; + // map metrics = 4; + if (!_internal_metrics().empty()) { + using MapType = ::google::protobuf::Map; + using WireHelper = MetricsMetadata_MetricsEntry_DoNotUse::Funcs; + const auto& field = _internal_metrics(); + + if (stream->IsSerializationDeterministic() && field.size() > 1) { + for (const auto& entry : ::google::protobuf::internal::MapSorterPtr(field)) { + target = WireHelper::InternalSerialize( + 4, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.MetricsMetadata.metrics"); + } + } else { + for (const auto& entry : field) { + target = WireHelper::InternalSerialize( + 4, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.MetricsMetadata.metrics"); + } } - 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:abacus.protobuf.Info) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.MetricsMetadata) return target; } -::size_t Info::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Info) +::size_t MetricsMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.MetricsMetadata) ::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()); + // map metrics = 4; + total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_metrics_size()); + for (const auto& entry : _internal_metrics()) { + total_size += MetricsMetadata_MetricsEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); } - - // string unit = 5; - if (!this->_internal_unit().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); + // uint32 protocol_version = 1; + if (this->_internal_protocol_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_protocol_version()); } - // .abacus.protobuf.Type type = 3; - if (this->_internal_type() != 0) { + // .abacus.protobuf.Endianness endianness = 2; + if (this->_internal_endianness() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_endianness()); } - // .abacus.protobuf.Kind kind = 4; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + // uint32 sync_value = 3; + if (this->_internal_sync_value() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_sync_value()); } - 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_ = { +const ::google::protobuf::Message::ClassData MetricsMetadata::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - Info::MergeImpl + MetricsMetadata::MergeImpl }; -const ::google::protobuf::Message::ClassData*Info::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*MetricsMetadata::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:abacus.protobuf.Info) +void MetricsMetadata::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:abacus.protobuf.MetricsMetadata) 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()); + _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_); + if (from._internal_protocol_version() != 0) { + _this->_internal_set_protocol_version(from._internal_protocol_version()); } - 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; - } + if (from._internal_endianness() != 0) { + _this->_internal_set_endianness(from._internal_endianness()); } - 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; - } + if (from._internal_sync_value() != 0) { + _this->_internal_set_sync_value(from._internal_sync_value()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void Info::CopyFrom(const Info& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Info) +void MetricsMetadata::CopyFrom(const MetricsMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.MetricsMetadata) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool Info::IsInitialized() const { +PROTOBUF_NOINLINE bool MetricsMetadata::IsInitialized() const { return true; } -void Info::InternalSwap(Info* other) { +void MetricsMetadata::InternalSwap(MetricsMetadata* 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); + _impl_.metrics_.InternalSwap(&other->_impl_.metrics_); ::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]); + PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_) + + sizeof(MetricsMetadata::_impl_.sync_value_) + - PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_)>( + reinterpret_cast(&_impl_.protocol_version_), + reinterpret_cast(&other->_impl_.protocol_version_)); } -::google::protobuf::Metadata Info::GetMetadata() const { +::google::protobuf::Metadata MetricsMetadata::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); } // =================================================================== -class Metric::_Internal { +class MetricValue::_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(::abacus::protobuf::Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Info& info(const Metric* msg); - static void set_has_info(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_._oneof_case_); }; -const ::abacus::protobuf::Info& Metric::_Internal::info(const Metric* msg) { - return *msg->_impl_.info_; -} -Metric::Metric(::google::protobuf::Arena* arena) +MetricValue::MetricValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Metric) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.MetricValue) } -Metric::Metric(const Metric& from) : ::google::protobuf::Message() { - Metric* const _this = this; +MetricValue::MetricValue(const MetricValue& from) : ::google::protobuf::Message() { + MetricValue* 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_.valid_){}, decltype(_impl_.value_){}, + /*decltype(_impl_._cached_size_)*/ {}, /*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 ::abacus::protobuf::Info(*from._impl_.info_); - } + _this->_impl_.valid_ = from._impl_.valid_; clear_has_value(); switch (from.value_case()) { case kUint64Value: { @@ -876,6 +4107,18 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { _this->_internal_set_int64_value(from._internal_int64_value()); break; } + case kUint32Value: { + _this->_internal_set_uint32_value(from._internal_uint32_value()); + break; + } + case kInt32Value: { + _this->_internal_set_int32_value(from._internal_int32_value()); + break; + } + case kFloat32Value: { + _this->_internal_set_float32_value(from._internal_float32_value()); + break; + } case kFloat64Value: { _this->_internal_set_float64_value(from._internal_float64_value()); break; @@ -884,42 +4127,44 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { _this->_internal_set_bool_value(from._internal_bool_value()); break; } + case kEnumValue: { + _this->_internal_set_enum_value(from._internal_enum_value()); + break; + } case VALUE_NOT_SET: { break; } } - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Metric) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.MetricValue) } -inline void Metric::SharedCtor(::_pb::Arena* arena) { +inline void MetricValue::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){}, - /*decltype(_impl_._cached_size_)*/ {}, - decltype(_impl_.info_){nullptr}, + decltype(_impl_.valid_){false}, decltype(_impl_.value_){}, + /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, }; clear_has_value(); } -Metric::~Metric() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Metric) +MetricValue::~MetricValue() { + // @@protoc_insertion_point(destructor:abacus.protobuf.MetricValue) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Metric::SharedDtor() { +inline void MetricValue::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.info_; if (has_value()) { clear_value(); } } -void Metric::SetCachedSize(int size) const { +void MetricValue::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Metric::clear_value() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Metric) +void MetricValue::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.MetricValue) switch (value_case()) { case kUint64Value: { // No need to clear @@ -929,6 +4174,18 @@ void Metric::clear_value() { // No need to clear break; } + case kUint32Value: { + // No need to clear + break; + } + case kInt32Value: { + // No need to clear + break; + } + case kFloat32Value: { + // No need to clear + break; + } case kFloat64Value: { // No need to clear break; @@ -937,6 +4194,10 @@ void Metric::clear_value() { // No need to clear break; } + case kEnumValue: { + // No need to clear + break; + } case VALUE_NOT_SET: { break; } @@ -945,23 +4206,18 @@ void Metric::clear_value() { } -PROTOBUF_NOINLINE void Metric::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Metric) +PROTOBUF_NOINLINE void MetricValue::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.MetricValue) ::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(); - } + _impl_.valid_ = false; clear_value(); - _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Metric::_InternalParse( +const char* MetricValue::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -969,60 +4225,71 @@ const char* Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 5, 1, 0, 2> Metric::_table_ = { +const ::_pbi::TcParseTable<0, 9, 0, 0, 2> MetricValue::_table_ = { { - PROTOBUF_FIELD_OFFSET(Metric, _impl_._has_bits_), + 0, // no _has_bits_ 0, // no _extensions_ - 5, 0, // max_field_number, fast_idx_mask + 9, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294966784, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_Metric_default_instance_._instance, + 9, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_MetricValue_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional .abacus.protobuf.Info info = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.info_)}}, + // bool valid = 1; + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.valid_)}}, }}, {{ 65535, 65535 }}, {{ - // optional .abacus.protobuf.Info info = 1; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.info_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // bool valid = 1; + {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.valid_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, // uint64 uint64_value = 2; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_.uint64_value_), _Internal::kOneofCaseOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(MetricValue, _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, + {PROTOBUF_FIELD_OFFSET(MetricValue, _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, + // uint32 uint32_value = 4; + {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.uint32_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, + // int32 int32_value = 5; + {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.int32_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kInt32)}, + // float float32_value = 6; + {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.float32_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kFloat)}, + // double float64_value = 7; + {PROTOBUF_FIELD_OFFSET(MetricValue, _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, + // bool bool_value = 8; + {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.bool_value_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kBool)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Info>()}, - }}, {{ + // uint32 enum_value = 9; + {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.enum_value_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ }}, }; -::uint8_t* Metric::_InternalSerialize( +::uint8_t* MetricValue::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Metric) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.MetricValue) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - // optional .abacus.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); + // bool valid = 1; + if (this->_internal_valid() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 1, this->_internal_valid(), target); } switch (value_case()) { @@ -1038,16 +4305,40 @@ ::uint8_t* Metric::_InternalSerialize( stream, this->_internal_int64_value(), target); break; } + case kUint32Value: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 4, this->_internal_uint32_value(), target); + break; + } + case kInt32Value: { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<5>( + stream, this->_internal_int32_value(), target); + break; + } + case kFloat32Value: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFloatToArray( + 6, this->_internal_float32_value(), target); + break; + } case kFloat64Value: { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 4, this->_internal_float64_value(), target); + 7, this->_internal_float64_value(), target); break; } case kBoolValue: { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( - 5, this->_internal_bool_value(), target); + 8, this->_internal_bool_value(), target); + break; + } + case kEnumValue: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 9, this->_internal_enum_value(), target); break; } default: @@ -1058,24 +4349,21 @@ ::uint8_t* Metric::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Metric) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.MetricValue) return target; } -::size_t Metric::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Metric) +::size_t MetricValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.MetricValue) ::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 .abacus.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_); + // bool valid = 1; + if (this->_internal_valid() != 0) { + total_size += 2; } switch (value_case()) { @@ -1091,16 +4379,39 @@ ::size_t Metric::ByteSizeLong() const { this->_internal_int64_value()); break; } - // double float64_value = 4; + // uint32 uint32_value = 4; + case kUint32Value: { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_uint32_value()); + break; + } + // int32 int32_value = 5; + case kInt32Value: { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_int32_value()); + break; + } + // float float32_value = 6; + case kFloat32Value: { + total_size += 5; + break; + } + // double float64_value = 7; case kFloat64Value: { total_size += 9; break; } - // bool bool_value = 5; + // bool bool_value = 8; case kBoolValue: { total_size += 2; break; } + // uint32 enum_value = 9; + case kEnumValue: { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_enum_value()); + break; + } case VALUE_NOT_SET: { break; } @@ -1108,24 +4419,23 @@ ::size_t Metric::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData Metric::_class_data_ = { +const ::google::protobuf::Message::ClassData MetricValue::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - Metric::MergeImpl + MetricValue::MergeImpl }; -const ::google::protobuf::Message::ClassData*Metric::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*MetricValue::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:abacus.protobuf.Metric) +void MetricValue::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:abacus.protobuf.MetricValue) 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()->::abacus::protobuf::Info::MergeFrom( - from._internal_info()); + if (from._internal_valid() != 0) { + _this->_internal_set_valid(from._internal_valid()); } switch (from.value_case()) { case kUint64Value: { @@ -1136,6 +4446,18 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot _this->_internal_set_int64_value(from._internal_int64_value()); break; } + case kUint32Value: { + _this->_internal_set_uint32_value(from._internal_uint32_value()); + break; + } + case kInt32Value: { + _this->_internal_set_int32_value(from._internal_int32_value()); + break; + } + case kFloat32Value: { + _this->_internal_set_float32_value(from._internal_float32_value()); + break; + } case kFloat64Value: { _this->_internal_set_float64_value(from._internal_float64_value()); break; @@ -1144,6 +4466,10 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot _this->_internal_set_bool_value(from._internal_bool_value()); break; } + case kEnumValue: { + _this->_internal_set_enum_value(from._internal_enum_value()); + break; + } case VALUE_NOT_SET: { break; } @@ -1151,89 +4477,88 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void Metric::CopyFrom(const Metric& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Metric) +void MetricValue::CopyFrom(const MetricValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.MetricValue) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool Metric::IsInitialized() const { +PROTOBUF_NOINLINE bool MetricValue::IsInitialized() const { return true; } -void Metric::InternalSwap(Metric* other) { +void MetricValue::InternalSwap(MetricValue* 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_.valid_, other->_impl_.valid_); swap(_impl_.value_, other->_impl_.value_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } -::google::protobuf::Metadata Metric::GetMetadata() const { +::google::protobuf::Metadata MetricValue::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); } // =================================================================== -class Metrics::_Internal { +class MetricValues::_Internal { public: }; -Metrics::Metrics(::google::protobuf::Arena* arena) +MetricValues::MetricValues(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Metrics) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.MetricValues) } -Metrics::Metrics(const Metrics& from) : ::google::protobuf::Message() { - Metrics* const _this = this; +MetricValues::MetricValues(const MetricValues& from) : ::google::protobuf::Message() { + MetricValues* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.metric_){from._impl_.metric_}, - decltype(_impl_.protocol_version_){}, + decltype(_impl_.values_){from._impl_.values_}, + decltype(_impl_.sync_value_){}, /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _this->_impl_.protocol_version_ = from._impl_.protocol_version_; + _this->_impl_.sync_value_ = from._impl_.sync_value_; - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Metrics) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.MetricValues) } -inline void Metrics::SharedCtor(::_pb::Arena* arena) { +inline void MetricValues::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.metric_){arena}, - decltype(_impl_.protocol_version_){0u}, + decltype(_impl_.values_){arena}, + decltype(_impl_.sync_value_){0u}, /*decltype(_impl_._cached_size_)*/ {}, }; } -Metrics::~Metrics() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Metrics) +MetricValues::~MetricValues() { + // @@protoc_insertion_point(destructor:abacus.protobuf.MetricValues) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Metrics::SharedDtor() { +inline void MetricValues::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.metric_.~RepeatedPtrField(); + _impl_.values_.~RepeatedPtrField(); } -void Metrics::SetCachedSize(int size) const { +void MetricValues::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void Metrics::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Metrics) +PROTOBUF_NOINLINE void MetricValues::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.MetricValues) ::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_mutable_values()->Clear(); + _impl_.sync_value_ = 0u; _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Metrics::_InternalParse( +const char* MetricValues::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -1241,7 +4566,7 @@ const char* Metrics::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> Metrics::_table_ = { +const ::_pbi::TcParseTable<1, 2, 1, 0, 2> MetricValues::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ @@ -1252,48 +4577,48 @@ const ::_pbi::TcParseTable<1, 2, 1, 0, 2> Metrics::_table_ = { 2, // num_field_entries 1, // num_aux_entries offsetof(decltype(_table_), aux_entries), - &_Metrics_default_instance_._instance, + &_MetricValues_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // repeated .abacus.protobuf.Metric metric = 2; + // repeated .abacus.protobuf.MetricValue values = 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_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.values_)}}, + // uint32 sync_value = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricValues, _impl_.sync_value_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.sync_value_)}}, }}, {{ 65535, 65535 }}, {{ - // uint32 protocol_version = 1; - {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.protocol_version_), 0, 0, + // uint32 sync_value = 1; + {PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.sync_value_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // repeated .abacus.protobuf.Metric metric = 2; - {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.metric_), 0, 0, + // repeated .abacus.protobuf.MetricValue values = 2; + {PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.values_), 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::MetricValue>()}, }}, {{ }}, }; -::uint8_t* Metrics::_InternalSerialize( +::uint8_t* MetricValues::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Metrics) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.MetricValues) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // uint32 protocol_version = 1; - if (this->_internal_protocol_version() != 0) { + // uint32 sync_value = 1; + if (this->_internal_sync_value() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 1, this->_internal_protocol_version(), target); + 1, this->_internal_sync_value(), target); } - // repeated .abacus.protobuf.Metric metric = 2; + // repeated .abacus.protobuf.MetricValue values = 2; for (unsigned i = 0, - n = static_cast(this->_internal_metric_size()); i < n; i++) { - const auto& repfield = this->_internal_metric().Get(i); + n = static_cast(this->_internal_values_size()); i < n; i++) { + const auto& repfield = this->_internal_values().Get(i); target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); } @@ -1303,77 +4628,77 @@ ::uint8_t* Metrics::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Metrics) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.MetricValues) return target; } -::size_t Metrics::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Metrics) +::size_t MetricValues::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.MetricValues) ::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 .abacus.protobuf.Metric metric = 2; - total_size += 1UL * this->_internal_metric_size(); - for (const auto& msg : this->_internal_metric()) { + // repeated .abacus.protobuf.MetricValue values = 2; + total_size += 1UL * this->_internal_values_size(); + for (const auto& msg : this->_internal_values()) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } - // uint32 protocol_version = 1; - if (this->_internal_protocol_version() != 0) { + // uint32 sync_value = 1; + if (this->_internal_sync_value() != 0) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_protocol_version()); + this->_internal_sync_value()); } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData Metrics::_class_data_ = { +const ::google::protobuf::Message::ClassData MetricValues::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - Metrics::MergeImpl + MetricValues::MergeImpl }; -const ::google::protobuf::Message::ClassData*Metrics::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*MetricValues::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:abacus.protobuf.Metrics) +void MetricValues::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:abacus.protobuf.MetricValues) 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_mutable_values()->MergeFrom(from._internal_values()); + if (from._internal_sync_value() != 0) { + _this->_internal_set_sync_value(from._internal_sync_value()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void Metrics::CopyFrom(const Metrics& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Metrics) +void MetricValues::CopyFrom(const MetricValues& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.MetricValues) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool Metrics::IsInitialized() const { +PROTOBUF_NOINLINE bool MetricValues::IsInitialized() const { return true; } -void Metrics::InternalSwap(Metrics* other) { +void MetricValues::InternalSwap(MetricValues* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.metric_.InternalSwap(&other->_impl_.metric_); - swap(_impl_.protocol_version_, other->_impl_.protocol_version_); + _impl_.values_.InternalSwap(&other->_impl_.values_); + swap(_impl_.sync_value_, other->_impl_.sync_value_); } -::google::protobuf::Metadata Metrics::GetMetadata() const { +::google::protobuf::Metadata MetricValues::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]); } // @@protoc_insertion_point(namespace_scope) } // namespace protobuf diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index e7e8a092..32843427 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -31,6 +31,9 @@ #include "google/protobuf/message.h" #include "google/protobuf/repeated_field.h" // IWYU pragma: export #include "google/protobuf/extension_set.h" // IWYU pragma: export +#include "google/protobuf/map.h" // IWYU pragma: export +#include "google/protobuf/map_entry.h" +#include "google/protobuf/map_field_inl.h" #include "google/protobuf/generated_enum_reflection.h" #include "google/protobuf/unknown_field_set.h" // @@protoc_insertion_point(includes) @@ -56,15 +59,51 @@ extern const ::google::protobuf::internal::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto; namespace abacus { namespace protobuf { -class Info; -struct InfoDefaultTypeInternal; -extern InfoDefaultTypeInternal _Info_default_instance_; +class BoolType; +struct BoolTypeDefaultTypeInternal; +extern BoolTypeDefaultTypeInternal _BoolType_default_instance_; +class EnumInfo; +struct EnumInfoDefaultTypeInternal; +extern EnumInfoDefaultTypeInternal _EnumInfo_default_instance_; +class EnumType; +struct EnumTypeDefaultTypeInternal; +extern EnumTypeDefaultTypeInternal _EnumType_default_instance_; +class EnumType_EnumMapEntry_DoNotUse; +struct EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal; +extern EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal _EnumType_EnumMapEntry_DoNotUse_default_instance_; +class Float32Type; +struct Float32TypeDefaultTypeInternal; +extern Float32TypeDefaultTypeInternal _Float32Type_default_instance_; +class Float64Type; +struct Float64TypeDefaultTypeInternal; +extern Float64TypeDefaultTypeInternal _Float64Type_default_instance_; +class Int32Type; +struct Int32TypeDefaultTypeInternal; +extern Int32TypeDefaultTypeInternal _Int32Type_default_instance_; +class Int64Type; +struct Int64TypeDefaultTypeInternal; +extern Int64TypeDefaultTypeInternal _Int64Type_default_instance_; class Metric; struct MetricDefaultTypeInternal; extern MetricDefaultTypeInternal _Metric_default_instance_; -class Metrics; -struct MetricsDefaultTypeInternal; -extern MetricsDefaultTypeInternal _Metrics_default_instance_; +class MetricValue; +struct MetricValueDefaultTypeInternal; +extern MetricValueDefaultTypeInternal _MetricValue_default_instance_; +class MetricValues; +struct MetricValuesDefaultTypeInternal; +extern MetricValuesDefaultTypeInternal _MetricValues_default_instance_; +class MetricsMetadata; +struct MetricsMetadataDefaultTypeInternal; +extern MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; +class MetricsMetadata_MetricsEntry_DoNotUse; +struct MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal; +extern MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal _MetricsMetadata_MetricsEntry_DoNotUse_default_instance_; +class UInt32Type; +struct UInt32TypeDefaultTypeInternal; +extern UInt32TypeDefaultTypeInternal _UInt32Type_default_instance_; +class UInt64Type; +struct UInt64TypeDefaultTypeInternal; +extern UInt64TypeDefaultTypeInternal _UInt64Type_default_instance_; } // namespace protobuf } // namespace abacus namespace google { @@ -107,39 +146,37 @@ 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_ = +enum Endianness : int { + LITTLE = 0, + BIG = 1, + Endianness_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::int32_t>::min(), - Type_INT_MAX_SENTINEL_DO_NOT_USE_ = + Endianness_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; +bool Endianness_IsValid(int value); +constexpr Endianness Endianness_MIN = static_cast(0); +constexpr Endianness Endianness_MAX = static_cast(1); +constexpr int Endianness_ARRAYSIZE = 1 + 1; const ::google::protobuf::EnumDescriptor* -Type_descriptor(); +Endianness_descriptor(); template -const std::string& Type_Name(T value) { - static_assert(std::is_same::value || +const std::string& Endianness_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)); + "Incorrect type passed to Endianness_Name()."); + return Endianness_Name(static_cast(value)); } template <> -inline const std::string& Type_Name(Type value) { - return ::google::protobuf::internal::NameOfDenseEnum( +inline const std::string& Endianness_Name(Endianness 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); +inline bool Endianness_Parse(absl::string_view name, Endianness* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Endianness_descriptor(), name, value); } // =================================================================== @@ -147,25 +184,25 @@ inline bool Type_Parse(absl::string_view name, Type* value) { // ------------------------------------------------------------------- -class Info final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Info) */ { +class Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Metric) */ { public: - inline Info() : Info(nullptr) {} - ~Info() override; + inline Metric() : Metric(nullptr) {} + ~Metric() override; template - explicit PROTOBUF_CONSTEXPR Info(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Metric(::google::protobuf::internal::ConstantInitialized); - Info(const Info& from); - Info(Info&& from) noexcept - : Info() { + Metric(const Metric& from); + Metric(Metric&& from) noexcept + : Metric() { *this = ::std::move(from); } - inline Info& operator=(const Info& from) { + inline Metric& operator=(const Metric& from) { CopyFrom(from); return *this; } - inline Info& operator=(Info&& from) noexcept { + inline Metric& operator=(Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -195,34 +232,32 @@ class Info final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Info& default_instance() { + static const Metric& 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, + enum TypeCase { + kUint64Type = 4, + kInt64Type = 5, + kUint32Type = 6, + kInt32Type = 7, + kFloat64Type = 8, + kFloat32Type = 9, + kBoolType = 10, + kEnumType = 11, + TYPE_NOT_SET = 0, }; - static inline const Info* internal_default_instance() { - return reinterpret_cast( - &_Info_default_instance_); + static inline const Metric* internal_default_instance() { + return reinterpret_cast( + &_Metric_default_instance_); } static constexpr int kIndexInFileMessages = 0; - friend void swap(Info& a, Info& b) { + friend void swap(Metric& a, Metric& b) { a.Swap(&b); } - inline void Swap(Info* other) { + inline void Swap(Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -235,7 +270,7 @@ class Info final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Info* other) { + void UnsafeArenaSwap(Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -243,14 +278,14 @@ class Info final : // implements Message ---------------------------------------------- - Info* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Info& from); + void CopyFrom(const Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Info& from) { - Info::MergeImpl(*this, from); + void MergeFrom( const Metric& from) { + Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -268,15 +303,15 @@ class Info final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Info* other); + void InternalSwap(Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Info"; + return "abacus.protobuf.Metric"; } protected: - explicit Info(::google::protobuf::Arena* arena); + explicit Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -289,35 +324,19 @@ class Info final : // 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, + kDescriptionFieldNumber = 1, + kValueOffsetFieldNumber = 2, + kValidOffsetFieldNumber = 3, + kUint64TypeFieldNumber = 4, + kInt64TypeFieldNumber = 5, + kUint32TypeFieldNumber = 6, + kInt32TypeFieldNumber = 7, + kFloat64TypeFieldNumber = 8, + kFloat32TypeFieldNumber = 9, + kBoolTypeFieldNumber = 10, + kEnumTypeFieldNumber = 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; + // string description = 1; void clear_description() ; const std::string& description() const; template @@ -333,155 +352,218 @@ class Info final : 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); + // uint32 value_offset = 2; + void clear_value_offset() ; + ::uint32_t value_offset() const; + void set_value_offset(::uint32_t value); private: - const std::string& _internal_unit() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_unit( - const std::string& value); - std::string* _internal_mutable_unit(); + ::uint32_t _internal_value_offset() const; + void _internal_set_value_offset(::uint32_t value); public: - // .abacus.protobuf.Type type = 3; - void clear_type() ; - ::abacus::protobuf::Type type() const; - void set_type(::abacus::protobuf::Type value); + // uint32 valid_offset = 3; + void clear_valid_offset() ; + ::uint32_t valid_offset() const; + void set_valid_offset(::uint32_t value); private: - ::abacus::protobuf::Type _internal_type() const; - void _internal_set_type(::abacus::protobuf::Type value); + ::uint32_t _internal_valid_offset() const; + void _internal_set_valid_offset(::uint32_t value); public: - // .abacus.protobuf.Kind kind = 4; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); + // .abacus.protobuf.UInt64Type uint64_type = 4; + bool has_uint64_type() const; + private: + bool _internal_has_uint64_type() const; + + public: + void clear_uint64_type() ; + const ::abacus::protobuf::UInt64Type& uint64_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::UInt64Type* release_uint64_type(); + ::abacus::protobuf::UInt64Type* mutable_uint64_type(); + void set_allocated_uint64_type(::abacus::protobuf::UInt64Type* value); + void unsafe_arena_set_allocated_uint64_type(::abacus::protobuf::UInt64Type* value); + ::abacus::protobuf::UInt64Type* unsafe_arena_release_uint64_type(); private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); + const ::abacus::protobuf::UInt64Type& _internal_uint64_type() const; + ::abacus::protobuf::UInt64Type* _internal_mutable_uint64_type(); 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); + // .abacus.protobuf.Int64Type int64_type = 5; + bool has_int64_type() const; + private: + bool _internal_has_int64_type() const; + + public: + void clear_int64_type() ; + const ::abacus::protobuf::Int64Type& int64_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Int64Type* release_int64_type(); + ::abacus::protobuf::Int64Type* mutable_int64_type(); + void set_allocated_int64_type(::abacus::protobuf::Int64Type* value); + void unsafe_arena_set_allocated_int64_type(::abacus::protobuf::Int64Type* value); + ::abacus::protobuf::Int64Type* unsafe_arena_release_int64_type(); + + private: + const ::abacus::protobuf::Int64Type& _internal_int64_type() const; + ::abacus::protobuf::Int64Type* _internal_mutable_int64_type(); + + public: + // .abacus.protobuf.UInt32Type uint32_type = 6; + bool has_uint32_type() const; + private: + bool _internal_has_uint32_type() const; + public: + void clear_uint32_type() ; + const ::abacus::protobuf::UInt32Type& uint32_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::UInt32Type* release_uint32_type(); + ::abacus::protobuf::UInt32Type* mutable_uint32_type(); + void set_allocated_uint32_type(::abacus::protobuf::UInt32Type* value); + void unsafe_arena_set_allocated_uint32_type(::abacus::protobuf::UInt32Type* value); + ::abacus::protobuf::UInt32Type* unsafe_arena_release_uint32_type(); + + private: + const ::abacus::protobuf::UInt32Type& _internal_uint32_type() const; + ::abacus::protobuf::UInt32Type* _internal_mutable_uint32_type(); + + public: + // .abacus.protobuf.Int32Type int32_type = 7; + bool has_int32_type() const; private: - ::uint64_t _internal_uint64_min() const; - void _internal_set_uint64_min(::uint64_t value); + bool _internal_has_int32_type() const; 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); + void clear_int32_type() ; + const ::abacus::protobuf::Int32Type& int32_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Int32Type* release_int32_type(); + ::abacus::protobuf::Int32Type* mutable_int32_type(); + void set_allocated_int32_type(::abacus::protobuf::Int32Type* value); + void unsafe_arena_set_allocated_int32_type(::abacus::protobuf::Int32Type* value); + ::abacus::protobuf::Int32Type* unsafe_arena_release_int32_type(); + + private: + const ::abacus::protobuf::Int32Type& _internal_int32_type() const; + ::abacus::protobuf::Int32Type* _internal_mutable_int32_type(); + public: + // .abacus.protobuf.Float64Type float64_type = 8; + bool has_float64_type() const; private: - ::int64_t _internal_int64_min() const; - void _internal_set_int64_min(::int64_t value); + bool _internal_has_float64_type() const; public: - // double float64_min = 8; - bool has_float64_min() const; - void clear_float64_min() ; - double float64_min() const; - void set_float64_min(double value); + void clear_float64_type() ; + const ::abacus::protobuf::Float64Type& float64_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Float64Type* release_float64_type(); + ::abacus::protobuf::Float64Type* mutable_float64_type(); + void set_allocated_float64_type(::abacus::protobuf::Float64Type* value); + void unsafe_arena_set_allocated_float64_type(::abacus::protobuf::Float64Type* value); + ::abacus::protobuf::Float64Type* unsafe_arena_release_float64_type(); private: - double _internal_float64_min() const; - void _internal_set_float64_min(double value); + const ::abacus::protobuf::Float64Type& _internal_float64_type() const; + ::abacus::protobuf::Float64Type* _internal_mutable_float64_type(); 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); + // .abacus.protobuf.Float32Type float32_type = 9; + bool has_float32_type() const; + private: + bool _internal_has_float32_type() const; + + public: + void clear_float32_type() ; + const ::abacus::protobuf::Float32Type& float32_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Float32Type* release_float32_type(); + ::abacus::protobuf::Float32Type* mutable_float32_type(); + void set_allocated_float32_type(::abacus::protobuf::Float32Type* value); + void unsafe_arena_set_allocated_float32_type(::abacus::protobuf::Float32Type* value); + ::abacus::protobuf::Float32Type* unsafe_arena_release_float32_type(); + + private: + const ::abacus::protobuf::Float32Type& _internal_float32_type() const; + ::abacus::protobuf::Float32Type* _internal_mutable_float32_type(); + public: + // .abacus.protobuf.BoolType bool_type = 10; + bool has_bool_type() const; private: - ::uint64_t _internal_uint64_max() const; - void _internal_set_uint64_max(::uint64_t value); + bool _internal_has_bool_type() const; 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); + void clear_bool_type() ; + const ::abacus::protobuf::BoolType& bool_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::BoolType* release_bool_type(); + ::abacus::protobuf::BoolType* mutable_bool_type(); + void set_allocated_bool_type(::abacus::protobuf::BoolType* value); + void unsafe_arena_set_allocated_bool_type(::abacus::protobuf::BoolType* value); + ::abacus::protobuf::BoolType* unsafe_arena_release_bool_type(); + + private: + const ::abacus::protobuf::BoolType& _internal_bool_type() const; + ::abacus::protobuf::BoolType* _internal_mutable_bool_type(); + public: + // .abacus.protobuf.EnumType enum_type = 11; + bool has_enum_type() const; private: - ::int64_t _internal_int64_max() const; - void _internal_set_int64_max(::int64_t value); + bool _internal_has_enum_type() const; public: - // double float64_max = 11; - bool has_float64_max() const; - void clear_float64_max() ; - double float64_max() const; - void set_float64_max(double value); + void clear_enum_type() ; + const ::abacus::protobuf::EnumType& enum_type() const; + PROTOBUF_NODISCARD ::abacus::protobuf::EnumType* release_enum_type(); + ::abacus::protobuf::EnumType* mutable_enum_type(); + void set_allocated_enum_type(::abacus::protobuf::EnumType* value); + void unsafe_arena_set_allocated_enum_type(::abacus::protobuf::EnumType* value); + ::abacus::protobuf::EnumType* unsafe_arena_release_enum_type(); private: - double _internal_float64_max() const; - void _internal_set_float64_max(double value); + const ::abacus::protobuf::EnumType& _internal_enum_type() const; + ::abacus::protobuf::EnumType* _internal_mutable_enum_type(); public: - void clear_min(); - MinCase min_case() const; - void clear_max(); - MaxCase max_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Info) + void clear_type(); + TypeCase type_case() const; + // @@protoc_insertion_point(class_scope:abacus.protobuf.Metric) 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(); + void set_has_uint64_type(); + void set_has_int64_type(); + void set_has_uint32_type(); + void set_has_int32_type(); + void set_has_float64_type(); + void set_has_float32_type(); + void set_has_bool_type(); + void set_has_enum_type(); + + inline bool has_type() const; + inline void clear_has_type(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 11, 0, 56, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 11, 8, 50, 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_{} {} + ::uint32_t value_offset_; + ::uint32_t valid_offset_; + union TypeUnion { + constexpr TypeUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; - ::uint64_t uint64_max_; - ::int64_t int64_max_; - double float64_max_; - } max_; + ::abacus::protobuf::UInt64Type* uint64_type_; + ::abacus::protobuf::Int64Type* int64_type_; + ::abacus::protobuf::UInt32Type* uint32_type_; + ::abacus::protobuf::Int32Type* int32_type_; + ::abacus::protobuf::Float64Type* float64_type_; + ::abacus::protobuf::Float32Type* float32_type_; + ::abacus::protobuf::BoolType* bool_type_; + ::abacus::protobuf::EnumType* enum_type_; + } type_; mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::uint32_t _oneof_case_[2]; + ::uint32_t _oneof_case_[1]; PROTOBUF_TSAN_DECLARE_MEMBER }; @@ -489,25 +571,25 @@ class Info final : friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Metric) */ { +class UInt64Type final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt64Type) */ { public: - inline Metric() : Metric(nullptr) {} - ~Metric() override; + inline UInt64Type() : UInt64Type(nullptr) {} + ~UInt64Type() override; template - explicit PROTOBUF_CONSTEXPR Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UInt64Type(::google::protobuf::internal::ConstantInitialized); - Metric(const Metric& from); - Metric(Metric&& from) noexcept - : Metric() { + UInt64Type(const UInt64Type& from); + UInt64Type(UInt64Type&& from) noexcept + : UInt64Type() { *this = ::std::move(from); } - inline Metric& operator=(const Metric& from) { + inline UInt64Type& operator=(const UInt64Type& from) { CopyFrom(from); return *this; } - inline Metric& operator=(Metric&& from) noexcept { + inline UInt64Type& operator=(UInt64Type&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -537,28 +619,20 @@ class Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Metric& default_instance() { + static const UInt64Type& 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 inline const UInt64Type* internal_default_instance() { + return reinterpret_cast( + &_UInt64Type_default_instance_); } static constexpr int kIndexInFileMessages = 1; - friend void swap(Metric& a, Metric& b) { + friend void swap(UInt64Type& a, UInt64Type& b) { a.Swap(&b); } - inline void Swap(Metric* other) { + inline void Swap(UInt64Type* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -571,7 +645,7 @@ class Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Metric* other) { + void UnsafeArenaSwap(UInt64Type* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -579,14 +653,14 @@ class Metric final : // implements Message ---------------------------------------------- - Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + UInt64Type* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Metric& from); + void CopyFrom(const UInt64Type& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Metric& from) { - Metric::MergeImpl(*this, from); + void MergeFrom( const UInt64Type& from) { + UInt64Type::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -604,15 +678,15 @@ class Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Metric* other); + void InternalSwap(UInt64Type* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Metric"; + return "abacus.protobuf.UInt64Type"; } protected: - explicit Metric(::google::protobuf::Arena* arena); + explicit UInt64Type(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -625,128 +699,97 @@ class Metric final : // accessors ------------------------------------------------------- enum : int { - kInfoFieldNumber = 1, - kUint64ValueFieldNumber = 2, - kInt64ValueFieldNumber = 3, - kFloat64ValueFieldNumber = 4, - kBoolValueFieldNumber = 5, + kUnitFieldNumber = 1, + kMinFieldNumber = 3, + kMaxFieldNumber = 4, + kKindFieldNumber = 2, }; - // optional .abacus.protobuf.Info info = 1; - bool has_info() const; - void clear_info() ; - const ::abacus::protobuf::Info& info() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Info* release_info(); - ::abacus::protobuf::Info* mutable_info(); - void set_allocated_info(::abacus::protobuf::Info* value); - void unsafe_arena_set_allocated_info(::abacus::protobuf::Info* value); - ::abacus::protobuf::Info* unsafe_arena_release_info(); - - private: - const ::abacus::protobuf::Info& _internal_info() const; - ::abacus::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); + // string unit = 1; + 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: - ::uint64_t _internal_uint64_value() const; - void _internal_set_uint64_value(::uint64_t value); + const std::string& _internal_unit() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_unit( + const std::string& value); + std::string* _internal_mutable_unit(); 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); + // uint64 min = 3; + void clear_min() ; + ::uint64_t min() const; + void set_min(::uint64_t value); private: - ::int64_t _internal_int64_value() const; - void _internal_set_int64_value(::int64_t value); + ::uint64_t _internal_min() const; + void _internal_set_min(::uint64_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); + // uint64 max = 4; + void clear_max() ; + ::uint64_t max() const; + void set_max(::uint64_t value); private: - double _internal_float64_value() const; - void _internal_set_float64_value(double value); + ::uint64_t _internal_max() const; + void _internal_set_max(::uint64_t 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); + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - bool _internal_bool_value() const; - void _internal_set_bool_value(bool value); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - void clear_value(); - ValueCase value_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt64Type) 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_; + static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 39, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint64_t min_; + ::uint64_t max_; + int kind_; mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::abacus::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_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Metrics final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Metrics) */ { +class Int64Type final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int64Type) */ { public: - inline Metrics() : Metrics(nullptr) {} - ~Metrics() override; + inline Int64Type() : Int64Type(nullptr) {} + ~Int64Type() override; template - explicit PROTOBUF_CONSTEXPR Metrics(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Int64Type(::google::protobuf::internal::ConstantInitialized); - Metrics(const Metrics& from); - Metrics(Metrics&& from) noexcept - : Metrics() { + Int64Type(const Int64Type& from); + Int64Type(Int64Type&& from) noexcept + : Int64Type() { *this = ::std::move(from); } - inline Metrics& operator=(const Metrics& from) { + inline Int64Type& operator=(const Int64Type& from) { CopyFrom(from); return *this; } - inline Metrics& operator=(Metrics&& from) noexcept { + inline Int64Type& operator=(Int64Type&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -776,20 +819,20 @@ class Metrics final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Metrics& default_instance() { + static const Int64Type& default_instance() { return *internal_default_instance(); } - static inline const Metrics* internal_default_instance() { - return reinterpret_cast( - &_Metrics_default_instance_); + static inline const Int64Type* internal_default_instance() { + return reinterpret_cast( + &_Int64Type_default_instance_); } static constexpr int kIndexInFileMessages = 2; - friend void swap(Metrics& a, Metrics& b) { + friend void swap(Int64Type& a, Int64Type& b) { a.Swap(&b); } - inline void Swap(Metrics* other) { + inline void Swap(Int64Type* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -802,7 +845,7 @@ class Metrics final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Metrics* other) { + void UnsafeArenaSwap(Int64Type* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -810,14 +853,14 @@ class Metrics final : // implements Message ---------------------------------------------- - Metrics* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Int64Type* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Metrics& from); + void CopyFrom(const Int64Type& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Metrics& from) { - Metrics::MergeImpl(*this, from); + void MergeFrom( const Int64Type& from) { + Int64Type::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -835,15 +878,15 @@ class Metrics final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Metrics* other); + void InternalSwap(Int64Type* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Metrics"; + return "abacus.protobuf.Int64Type"; } protected: - explicit Metrics(::google::protobuf::Arena* arena); + explicit Int64Type(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -856,57 +899,2143 @@ class Metrics final : // accessors ------------------------------------------------------- enum : int { - kMetricFieldNumber = 2, - kProtocolVersionFieldNumber = 1, + kUnitFieldNumber = 1, + kMinFieldNumber = 3, + kMaxFieldNumber = 4, + kKindFieldNumber = 2, }; - // repeated .abacus.protobuf.Metric metric = 2; - int metric_size() const; + // string unit = 1; + 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: - int _internal_metric_size() const; + const std::string& _internal_unit() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_unit( + const std::string& value); + std::string* _internal_mutable_unit(); public: - void clear_metric() ; - ::abacus::protobuf::Metric* mutable_metric(int index); - ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::Metric >* - mutable_metric(); + // int64 min = 3; + void clear_min() ; + ::int64_t min() const; + void set_min(::int64_t value); + private: - const ::google::protobuf::RepeatedPtrField<::abacus::protobuf::Metric>& _internal_metric() const; - ::google::protobuf::RepeatedPtrField<::abacus::protobuf::Metric>* _internal_mutable_metric(); + ::int64_t _internal_min() const; + void _internal_set_min(::int64_t value); + public: - const ::abacus::protobuf::Metric& metric(int index) const; - ::abacus::protobuf::Metric* add_metric(); - const ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::Metric >& - metric() const; - // uint32 protocol_version = 1; - void clear_protocol_version() ; - ::uint32_t protocol_version() const; - void set_protocol_version(::uint32_t value); + // int64 max = 4; + void clear_max() ; + ::int64_t max() const; + void set_max(::int64_t value); private: - ::uint32_t _internal_protocol_version() const; - void _internal_set_protocol_version(::uint32_t value); + ::int64_t _internal_max() const; + void _internal_set_max(::int64_t value); + + public: + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Metrics) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Int64Type) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, 1, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 38, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::Metric > metric_; - ::uint32_t protocol_version_; + ::google::protobuf::internal::ArenaStringPtr unit_; + ::int64_t min_; + ::int64_t max_; + int kind_; mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -}; - -// =================================================================== +};// ------------------------------------------------------------------- + +class UInt32Type final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt32Type) */ { + public: + inline UInt32Type() : UInt32Type(nullptr) {} + ~UInt32Type() override; + template + explicit PROTOBUF_CONSTEXPR UInt32Type(::google::protobuf::internal::ConstantInitialized); + + UInt32Type(const UInt32Type& from); + UInt32Type(UInt32Type&& from) noexcept + : UInt32Type() { + *this = ::std::move(from); + } + + inline UInt32Type& operator=(const UInt32Type& from) { + CopyFrom(from); + return *this; + } + inline UInt32Type& operator=(UInt32Type&& 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 UInt32Type& default_instance() { + return *internal_default_instance(); + } + static inline const UInt32Type* internal_default_instance() { + return reinterpret_cast( + &_UInt32Type_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(UInt32Type& a, UInt32Type& b) { + a.Swap(&b); + } + inline void Swap(UInt32Type* 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(UInt32Type* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + UInt32Type* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const UInt32Type& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const UInt32Type& from) { + UInt32Type::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(UInt32Type* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.UInt32Type"; + } + protected: + explicit UInt32Type(::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 { + kUnitFieldNumber = 1, + kKindFieldNumber = 2, + kMinFieldNumber = 3, + kMaxFieldNumber = 4, + }; + // string unit = 1; + 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: + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // uint32 min = 3; + void clear_min() ; + ::uint32_t min() const; + void set_min(::uint32_t value); + + private: + ::uint32_t _internal_min() const; + void _internal_set_min(::uint32_t value); + + public: + // uint32 max = 4; + void clear_max() ; + ::uint32_t max() const; + void set_max(::uint32_t value); + + private: + ::uint32_t _internal_max() const; + void _internal_set_max(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt32Type) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 39, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr unit_; + int kind_; + ::uint32_t min_; + ::uint32_t max_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class Int32Type final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int32Type) */ { + public: + inline Int32Type() : Int32Type(nullptr) {} + ~Int32Type() override; + template + explicit PROTOBUF_CONSTEXPR Int32Type(::google::protobuf::internal::ConstantInitialized); + + Int32Type(const Int32Type& from); + Int32Type(Int32Type&& from) noexcept + : Int32Type() { + *this = ::std::move(from); + } + + inline Int32Type& operator=(const Int32Type& from) { + CopyFrom(from); + return *this; + } + inline Int32Type& operator=(Int32Type&& 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 Int32Type& default_instance() { + return *internal_default_instance(); + } + static inline const Int32Type* internal_default_instance() { + return reinterpret_cast( + &_Int32Type_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(Int32Type& a, Int32Type& b) { + a.Swap(&b); + } + inline void Swap(Int32Type* 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(Int32Type* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Int32Type* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Int32Type& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Int32Type& from) { + Int32Type::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(Int32Type* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.Int32Type"; + } + protected: + explicit Int32Type(::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 { + kUnitFieldNumber = 1, + kKindFieldNumber = 2, + kMinFieldNumber = 3, + kMaxFieldNumber = 4, + }; + // string unit = 1; + 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: + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // int32 min = 3; + void clear_min() ; + ::int32_t min() const; + void set_min(::int32_t value); + + private: + ::int32_t _internal_min() const; + void _internal_set_min(::int32_t value); + + public: + // int32 max = 4; + void clear_max() ; + ::int32_t max() const; + void set_max(::int32_t value); + + private: + ::int32_t _internal_max() const; + void _internal_set_max(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.Int32Type) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 38, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr unit_; + int kind_; + ::int32_t min_; + ::int32_t max_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class Float64Type final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float64Type) */ { + public: + inline Float64Type() : Float64Type(nullptr) {} + ~Float64Type() override; + template + explicit PROTOBUF_CONSTEXPR Float64Type(::google::protobuf::internal::ConstantInitialized); + + Float64Type(const Float64Type& from); + Float64Type(Float64Type&& from) noexcept + : Float64Type() { + *this = ::std::move(from); + } + + inline Float64Type& operator=(const Float64Type& from) { + CopyFrom(from); + return *this; + } + inline Float64Type& operator=(Float64Type&& 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 Float64Type& default_instance() { + return *internal_default_instance(); + } + static inline const Float64Type* internal_default_instance() { + return reinterpret_cast( + &_Float64Type_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(Float64Type& a, Float64Type& b) { + a.Swap(&b); + } + inline void Swap(Float64Type* 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(Float64Type* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Float64Type* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Float64Type& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Float64Type& from) { + Float64Type::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(Float64Type* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.Float64Type"; + } + protected: + explicit Float64Type(::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 { + kUnitFieldNumber = 1, + kMinFieldNumber = 3, + kMaxFieldNumber = 4, + kKindFieldNumber = 2, + }; + // string unit = 1; + 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: + // double min = 3; + void clear_min() ; + double min() const; + void set_min(double value); + + private: + double _internal_min() const; + void _internal_set_min(double value); + + public: + // double max = 4; + void clear_max() ; + double max() const; + void set_max(double value); + + private: + double _internal_max() const; + void _internal_set_max(double value); + + public: + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.Float64Type) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 40, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr unit_; + double min_; + double max_; + int kind_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class Float32Type final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float32Type) */ { + public: + inline Float32Type() : Float32Type(nullptr) {} + ~Float32Type() override; + template + explicit PROTOBUF_CONSTEXPR Float32Type(::google::protobuf::internal::ConstantInitialized); + + Float32Type(const Float32Type& from); + Float32Type(Float32Type&& from) noexcept + : Float32Type() { + *this = ::std::move(from); + } + + inline Float32Type& operator=(const Float32Type& from) { + CopyFrom(from); + return *this; + } + inline Float32Type& operator=(Float32Type&& 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 Float32Type& default_instance() { + return *internal_default_instance(); + } + static inline const Float32Type* internal_default_instance() { + return reinterpret_cast( + &_Float32Type_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(Float32Type& a, Float32Type& b) { + a.Swap(&b); + } + inline void Swap(Float32Type* 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(Float32Type* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Float32Type* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Float32Type& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Float32Type& from) { + Float32Type::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(Float32Type* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.Float32Type"; + } + protected: + explicit Float32Type(::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 { + kUnitFieldNumber = 1, + kKindFieldNumber = 2, + kMinFieldNumber = 3, + kMaxFieldNumber = 4, + }; + // string unit = 1; + 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: + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // float min = 3; + void clear_min() ; + float min() const; + void set_min(float value); + + private: + float _internal_min() const; + void _internal_set_min(float value); + + public: + // float max = 4; + void clear_max() ; + float max() const; + void set_max(float value); + + private: + float _internal_max() const; + void _internal_set_max(float value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.Float32Type) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 40, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr unit_; + int kind_; + float min_; + float max_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class BoolType final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.BoolType) */ { + public: + inline BoolType() : BoolType(nullptr) {} + ~BoolType() override; + template + explicit PROTOBUF_CONSTEXPR BoolType(::google::protobuf::internal::ConstantInitialized); + + BoolType(const BoolType& from); + BoolType(BoolType&& from) noexcept + : BoolType() { + *this = ::std::move(from); + } + + inline BoolType& operator=(const BoolType& from) { + CopyFrom(from); + return *this; + } + inline BoolType& operator=(BoolType&& 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 BoolType& default_instance() { + return *internal_default_instance(); + } + static inline const BoolType* internal_default_instance() { + return reinterpret_cast( + &_BoolType_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(BoolType& a, BoolType& b) { + a.Swap(&b); + } + inline void Swap(BoolType* 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(BoolType* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + BoolType* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const BoolType& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const BoolType& from) { + BoolType::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(BoolType* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.BoolType"; + } + protected: + explicit BoolType(::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 { + kUnitFieldNumber = 1, + kKindFieldNumber = 2, + }; + // string unit = 1; + 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: + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.BoolType) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 37, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr unit_; + int kind_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class EnumInfo final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.EnumInfo) */ { + public: + inline EnumInfo() : EnumInfo(nullptr) {} + ~EnumInfo() override; + template + explicit PROTOBUF_CONSTEXPR EnumInfo(::google::protobuf::internal::ConstantInitialized); + + EnumInfo(const EnumInfo& from); + EnumInfo(EnumInfo&& from) noexcept + : EnumInfo() { + *this = ::std::move(from); + } + + inline EnumInfo& operator=(const EnumInfo& from) { + CopyFrom(from); + return *this; + } + inline EnumInfo& operator=(EnumInfo&& 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 EnumInfo& default_instance() { + return *internal_default_instance(); + } + static inline const EnumInfo* internal_default_instance() { + return reinterpret_cast( + &_EnumInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + friend void swap(EnumInfo& a, EnumInfo& b) { + a.Swap(&b); + } + inline void Swap(EnumInfo* 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(EnumInfo* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + EnumInfo* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const EnumInfo& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const EnumInfo& from) { + EnumInfo::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(EnumInfo* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.EnumInfo"; + } + protected: + explicit EnumInfo(::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, + kSeverityFieldNumber = 3, + }; + // 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: + // optional string description = 2; + bool has_description() const; + 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: + // optional uint32 severity = 3; + bool has_severity() const; + void clear_severity() ; + ::uint32_t severity() const; + void set_severity(::uint32_t value); + + private: + ::uint32_t _internal_severity() const; + void _internal_set_severity(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.EnumInfo) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 3, 0, 48, 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_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::uint32_t severity_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class EnumType_EnumMapEntry_DoNotUse final : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + EnumType_EnumMapEntry_DoNotUse(); + template + explicit PROTOBUF_CONSTEXPR EnumType_EnumMapEntry_DoNotUse( + ::google::protobuf::internal::ConstantInitialized); + explicit EnumType_EnumMapEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const EnumType_EnumMapEntry_DoNotUse& other); + static const EnumType_EnumMapEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_EnumType_EnumMapEntry_DoNotUse_default_instance_); } + static bool ValidateKey(void*) { return true; } + static bool ValidateValue(void*) { return true; } + using ::google::protobuf::Message::MergeFrom; + ::google::protobuf::Metadata GetMetadata() const final; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class EnumType final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.EnumType) */ { + public: + inline EnumType() : EnumType(nullptr) {} + ~EnumType() override; + template + explicit PROTOBUF_CONSTEXPR EnumType(::google::protobuf::internal::ConstantInitialized); + + EnumType(const EnumType& from); + EnumType(EnumType&& from) noexcept + : EnumType() { + *this = ::std::move(from); + } + + inline EnumType& operator=(const EnumType& from) { + CopyFrom(from); + return *this; + } + inline EnumType& operator=(EnumType&& 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 EnumType& default_instance() { + return *internal_default_instance(); + } + static inline const EnumType* internal_default_instance() { + return reinterpret_cast( + &_EnumType_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + friend void swap(EnumType& a, EnumType& b) { + a.Swap(&b); + } + inline void Swap(EnumType* 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(EnumType* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + EnumType* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const EnumType& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const EnumType& from) { + EnumType::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(EnumType* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.EnumType"; + } + protected: + explicit EnumType(::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 { + kEnumMapFieldNumber = 1, + }; + // map enum_map = 1; + int enum_map_size() const; + private: + int _internal_enum_map_size() const; + + public: + void clear_enum_map() ; + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& enum_map() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* mutable_enum_map(); + + private: + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& _internal_enum_map() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* _internal_mutable_enum_map(); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.EnumType) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, 2, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::MapField + enum_map_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class MetricsMetadata_MetricsEntry_DoNotUse final : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + MetricsMetadata_MetricsEntry_DoNotUse(); + template + explicit PROTOBUF_CONSTEXPR MetricsMetadata_MetricsEntry_DoNotUse( + ::google::protobuf::internal::ConstantInitialized); + explicit MetricsMetadata_MetricsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const MetricsMetadata_MetricsEntry_DoNotUse& other); + static const MetricsMetadata_MetricsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_MetricsMetadata_MetricsEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::google::protobuf::internal::WireFormatLite::PARSE, "abacus.protobuf.MetricsMetadata.MetricsEntry.key"); + } + static bool ValidateValue(void*) { return true; } + using ::google::protobuf::Message::MergeFrom; + ::google::protobuf::Metadata GetMetadata() const final; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class MetricsMetadata final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.MetricsMetadata) */ { + public: + inline MetricsMetadata() : MetricsMetadata(nullptr) {} + ~MetricsMetadata() override; + template + explicit PROTOBUF_CONSTEXPR MetricsMetadata(::google::protobuf::internal::ConstantInitialized); + + MetricsMetadata(const MetricsMetadata& from); + MetricsMetadata(MetricsMetadata&& from) noexcept + : MetricsMetadata() { + *this = ::std::move(from); + } + + inline MetricsMetadata& operator=(const MetricsMetadata& from) { + CopyFrom(from); + return *this; + } + inline MetricsMetadata& operator=(MetricsMetadata&& 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 MetricsMetadata& default_instance() { + return *internal_default_instance(); + } + static inline const MetricsMetadata* internal_default_instance() { + return reinterpret_cast( + &_MetricsMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + friend void swap(MetricsMetadata& a, MetricsMetadata& b) { + a.Swap(&b); + } + inline void Swap(MetricsMetadata* 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(MetricsMetadata* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + MetricsMetadata* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const MetricsMetadata& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const MetricsMetadata& from) { + MetricsMetadata::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(MetricsMetadata* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.MetricsMetadata"; + } + protected: + explicit MetricsMetadata(::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 { + kMetricsFieldNumber = 4, + kProtocolVersionFieldNumber = 1, + kEndiannessFieldNumber = 2, + kSyncValueFieldNumber = 3, + }; + // map metrics = 4; + int metrics_size() const; + private: + int _internal_metrics_size() const; + + public: + void clear_metrics() ; + const ::google::protobuf::Map& metrics() const; + ::google::protobuf::Map* mutable_metrics(); + + private: + const ::google::protobuf::Map& _internal_metrics() const; + ::google::protobuf::Map* _internal_mutable_metrics(); + + public: + // 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: + // .abacus.protobuf.Endianness endianness = 2; + void clear_endianness() ; + ::abacus::protobuf::Endianness endianness() const; + void set_endianness(::abacus::protobuf::Endianness value); + + private: + ::abacus::protobuf::Endianness _internal_endianness() const; + void _internal_set_endianness(::abacus::protobuf::Endianness value); + + public: + // uint32 sync_value = 3; + void clear_sync_value() ; + ::uint32_t sync_value() const; + void set_sync_value(::uint32_t value); + + private: + ::uint32_t _internal_sync_value() const; + void _internal_set_sync_value(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.MetricsMetadata) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, 2, 47, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::MapField + metrics_; + ::uint32_t protocol_version_; + int endianness_; + ::uint32_t sync_value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class MetricValue final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.MetricValue) */ { + public: + inline MetricValue() : MetricValue(nullptr) {} + ~MetricValue() override; + template + explicit PROTOBUF_CONSTEXPR MetricValue(::google::protobuf::internal::ConstantInitialized); + + MetricValue(const MetricValue& from); + MetricValue(MetricValue&& from) noexcept + : MetricValue() { + *this = ::std::move(from); + } + + inline MetricValue& operator=(const MetricValue& from) { + CopyFrom(from); + return *this; + } + inline MetricValue& operator=(MetricValue&& 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 MetricValue& default_instance() { + return *internal_default_instance(); + } + enum ValueCase { + kUint64Value = 2, + kInt64Value = 3, + kUint32Value = 4, + kInt32Value = 5, + kFloat32Value = 6, + kFloat64Value = 7, + kBoolValue = 8, + kEnumValue = 9, + VALUE_NOT_SET = 0, + }; + + static inline const MetricValue* internal_default_instance() { + return reinterpret_cast( + &_MetricValue_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + friend void swap(MetricValue& a, MetricValue& b) { + a.Swap(&b); + } + inline void Swap(MetricValue* 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(MetricValue* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + MetricValue* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const MetricValue& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const MetricValue& from) { + MetricValue::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(MetricValue* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.MetricValue"; + } + protected: + explicit MetricValue(::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 { + kValidFieldNumber = 1, + kUint64ValueFieldNumber = 2, + kInt64ValueFieldNumber = 3, + kUint32ValueFieldNumber = 4, + kInt32ValueFieldNumber = 5, + kFloat32ValueFieldNumber = 6, + kFloat64ValueFieldNumber = 7, + kBoolValueFieldNumber = 8, + kEnumValueFieldNumber = 9, + }; + // bool valid = 1; + void clear_valid() ; + bool valid() const; + void set_valid(bool value); + + private: + bool _internal_valid() const; + void _internal_set_valid(bool value); + + 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: + // uint32 uint32_value = 4; + bool has_uint32_value() const; + void clear_uint32_value() ; + ::uint32_t uint32_value() const; + void set_uint32_value(::uint32_t value); + + private: + ::uint32_t _internal_uint32_value() const; + void _internal_set_uint32_value(::uint32_t value); + + public: + // int32 int32_value = 5; + bool has_int32_value() const; + void clear_int32_value() ; + ::int32_t int32_value() const; + void set_int32_value(::int32_t value); + + private: + ::int32_t _internal_int32_value() const; + void _internal_set_int32_value(::int32_t value); + + public: + // float float32_value = 6; + bool has_float32_value() const; + void clear_float32_value() ; + float float32_value() const; + void set_float32_value(float value); + + private: + float _internal_float32_value() const; + void _internal_set_float32_value(float value); + + public: + // double float64_value = 7; + 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 = 8; + 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: + // uint32 enum_value = 9; + bool has_enum_value() const; + void clear_enum_value() ; + ::uint32_t enum_value() const; + void set_enum_value(::uint32_t value); + + private: + ::uint32_t _internal_enum_value() const; + void _internal_set_enum_value(::uint32_t value); + + public: + void clear_value(); + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:abacus.protobuf.MetricValue) + private: + class _Internal; + void set_has_uint64_value(); + void set_has_int64_value(); + void set_has_uint32_value(); + void set_has_int32_value(); + void set_has_float32_value(); + void set_has_float64_value(); + void set_has_bool_value(); + void set_has_enum_value(); + + inline bool has_value() const; + inline void clear_has_value(); + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 9, 0, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool valid_; + union ValueUnion { + constexpr ValueUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::uint64_t uint64_value_; + ::int64_t int64_value_; + ::uint32_t uint32_value_; + ::int32_t int32_value_; + float float32_value_; + double float64_value_; + bool bool_value_; + ::uint32_t enum_value_; + } value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t _oneof_case_[1]; + + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class MetricValues final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.MetricValues) */ { + public: + inline MetricValues() : MetricValues(nullptr) {} + ~MetricValues() override; + template + explicit PROTOBUF_CONSTEXPR MetricValues(::google::protobuf::internal::ConstantInitialized); + + MetricValues(const MetricValues& from); + MetricValues(MetricValues&& from) noexcept + : MetricValues() { + *this = ::std::move(from); + } + + inline MetricValues& operator=(const MetricValues& from) { + CopyFrom(from); + return *this; + } + inline MetricValues& operator=(MetricValues&& 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 MetricValues& default_instance() { + return *internal_default_instance(); + } + static inline const MetricValues* internal_default_instance() { + return reinterpret_cast( + &_MetricValues_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + friend void swap(MetricValues& a, MetricValues& b) { + a.Swap(&b); + } + inline void Swap(MetricValues* 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(MetricValues* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + MetricValues* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const MetricValues& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const MetricValues& from) { + MetricValues::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(MetricValues* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.MetricValues"; + } + protected: + explicit MetricValues(::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 { + kValuesFieldNumber = 2, + kSyncValueFieldNumber = 1, + }; + // repeated .abacus.protobuf.MetricValue values = 2; + int values_size() const; + private: + int _internal_values_size() const; + + public: + void clear_values() ; + ::abacus::protobuf::MetricValue* mutable_values(int index); + ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >* + mutable_values(); + private: + const ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>& _internal_values() const; + ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>* _internal_mutable_values(); + public: + const ::abacus::protobuf::MetricValue& values(int index) const; + ::abacus::protobuf::MetricValue* add_values(); + const ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >& + values() const; + // uint32 sync_value = 1; + void clear_sync_value() ; + ::uint32_t sync_value() const; + void set_sync_value(::uint32_t value); + + private: + ::uint32_t _internal_sync_value() const; + void _internal_set_sync_value(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.MetricValues) + 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< ::abacus::protobuf::MetricValue > values_; + ::uint32_t sync_value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +}; + +// =================================================================== @@ -914,55 +3043,1558 @@ class Metrics final : // =================================================================== -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// Metric + +// string description = 1; +inline void Metric::clear_description() { + _impl_.description_.ClearToEmpty(); +} +inline const std::string& Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.description) + return _internal_description(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Metric::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:abacus.protobuf.Metric.description) +} +inline std::string* Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.description) + return _s; +} +inline const std::string& Metric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); +} +inline void Metric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); +} +inline std::string* Metric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); +} +inline std::string* Metric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.description) + return _impl_.description_.Release(); +} +inline void Metric::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:abacus.protobuf.Metric.description) +} + +// uint32 value_offset = 2; +inline void Metric::clear_value_offset() { + _impl_.value_offset_ = 0u; +} +inline ::uint32_t Metric::value_offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.value_offset) + return _internal_value_offset(); +} +inline void Metric::set_value_offset(::uint32_t value) { + _internal_set_value_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.value_offset) +} +inline ::uint32_t Metric::_internal_value_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.value_offset_; +} +inline void Metric::_internal_set_value_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.value_offset_ = value; +} + +// uint32 valid_offset = 3; +inline void Metric::clear_valid_offset() { + _impl_.valid_offset_ = 0u; +} +inline ::uint32_t Metric::valid_offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.valid_offset) + return _internal_valid_offset(); +} +inline void Metric::set_valid_offset(::uint32_t value) { + _internal_set_valid_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.valid_offset) +} +inline ::uint32_t Metric::_internal_valid_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.valid_offset_; +} +inline void Metric::_internal_set_valid_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.valid_offset_ = value; +} + +// .abacus.protobuf.UInt64Type uint64_type = 4; +inline bool Metric::has_uint64_type() const { + return type_case() == kUint64Type; +} +inline bool Metric::_internal_has_uint64_type() const { + return type_case() == kUint64Type; +} +inline void Metric::set_has_uint64_type() { + _impl_._oneof_case_[0] = kUint64Type; +} +inline void Metric::clear_uint64_type() { + if (type_case() == kUint64Type) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint64_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::UInt64Type* Metric::release_uint64_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.uint64_type) + if (type_case() == kUint64Type) { + clear_has_type(); + ::abacus::protobuf::UInt64Type* temp = _impl_.type_.uint64_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.uint64_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::UInt64Type& Metric::_internal_uint64_type() const { + return type_case() == kUint64Type + ? *_impl_.type_.uint64_type_ + : reinterpret_cast<::abacus::protobuf::UInt64Type&>(::abacus::protobuf::_UInt64Type_default_instance_); +} +inline const ::abacus::protobuf::UInt64Type& Metric::uint64_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.uint64_type) + return _internal_uint64_type(); +} +inline ::abacus::protobuf::UInt64Type* Metric::unsafe_arena_release_uint64_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.uint64_type) + if (type_case() == kUint64Type) { + clear_has_type(); + ::abacus::protobuf::UInt64Type* temp = _impl_.type_.uint64_type_; + _impl_.type_.uint64_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_uint64_type(::abacus::protobuf::UInt64Type* uint64_type) { + clear_type(); + if (uint64_type) { + set_has_uint64_type(); + _impl_.type_.uint64_type_ = uint64_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.uint64_type) +} +inline ::abacus::protobuf::UInt64Type* Metric::_internal_mutable_uint64_type() { + if (type_case() != kUint64Type) { + clear_type(); + set_has_uint64_type(); + _impl_.type_.uint64_type_ = CreateMaybeMessage< ::abacus::protobuf::UInt64Type >(GetArenaForAllocation()); + } + return _impl_.type_.uint64_type_; +} +inline ::abacus::protobuf::UInt64Type* Metric::mutable_uint64_type() { + ::abacus::protobuf::UInt64Type* _msg = _internal_mutable_uint64_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.uint64_type) + return _msg; +} + +// .abacus.protobuf.Int64Type int64_type = 5; +inline bool Metric::has_int64_type() const { + return type_case() == kInt64Type; +} +inline bool Metric::_internal_has_int64_type() const { + return type_case() == kInt64Type; +} +inline void Metric::set_has_int64_type() { + _impl_._oneof_case_[0] = kInt64Type; +} +inline void Metric::clear_int64_type() { + if (type_case() == kInt64Type) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int64_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::Int64Type* Metric::release_int64_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.int64_type) + if (type_case() == kInt64Type) { + clear_has_type(); + ::abacus::protobuf::Int64Type* temp = _impl_.type_.int64_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.int64_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Int64Type& Metric::_internal_int64_type() const { + return type_case() == kInt64Type + ? *_impl_.type_.int64_type_ + : reinterpret_cast<::abacus::protobuf::Int64Type&>(::abacus::protobuf::_Int64Type_default_instance_); +} +inline const ::abacus::protobuf::Int64Type& Metric::int64_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.int64_type) + return _internal_int64_type(); +} +inline ::abacus::protobuf::Int64Type* Metric::unsafe_arena_release_int64_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.int64_type) + if (type_case() == kInt64Type) { + clear_has_type(); + ::abacus::protobuf::Int64Type* temp = _impl_.type_.int64_type_; + _impl_.type_.int64_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_int64_type(::abacus::protobuf::Int64Type* int64_type) { + clear_type(); + if (int64_type) { + set_has_int64_type(); + _impl_.type_.int64_type_ = int64_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.int64_type) +} +inline ::abacus::protobuf::Int64Type* Metric::_internal_mutable_int64_type() { + if (type_case() != kInt64Type) { + clear_type(); + set_has_int64_type(); + _impl_.type_.int64_type_ = CreateMaybeMessage< ::abacus::protobuf::Int64Type >(GetArenaForAllocation()); + } + return _impl_.type_.int64_type_; +} +inline ::abacus::protobuf::Int64Type* Metric::mutable_int64_type() { + ::abacus::protobuf::Int64Type* _msg = _internal_mutable_int64_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.int64_type) + return _msg; +} + +// .abacus.protobuf.UInt32Type uint32_type = 6; +inline bool Metric::has_uint32_type() const { + return type_case() == kUint32Type; +} +inline bool Metric::_internal_has_uint32_type() const { + return type_case() == kUint32Type; +} +inline void Metric::set_has_uint32_type() { + _impl_._oneof_case_[0] = kUint32Type; +} +inline void Metric::clear_uint32_type() { + if (type_case() == kUint32Type) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint32_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::UInt32Type* Metric::release_uint32_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.uint32_type) + if (type_case() == kUint32Type) { + clear_has_type(); + ::abacus::protobuf::UInt32Type* temp = _impl_.type_.uint32_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.uint32_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::UInt32Type& Metric::_internal_uint32_type() const { + return type_case() == kUint32Type + ? *_impl_.type_.uint32_type_ + : reinterpret_cast<::abacus::protobuf::UInt32Type&>(::abacus::protobuf::_UInt32Type_default_instance_); +} +inline const ::abacus::protobuf::UInt32Type& Metric::uint32_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.uint32_type) + return _internal_uint32_type(); +} +inline ::abacus::protobuf::UInt32Type* Metric::unsafe_arena_release_uint32_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.uint32_type) + if (type_case() == kUint32Type) { + clear_has_type(); + ::abacus::protobuf::UInt32Type* temp = _impl_.type_.uint32_type_; + _impl_.type_.uint32_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_uint32_type(::abacus::protobuf::UInt32Type* uint32_type) { + clear_type(); + if (uint32_type) { + set_has_uint32_type(); + _impl_.type_.uint32_type_ = uint32_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.uint32_type) +} +inline ::abacus::protobuf::UInt32Type* Metric::_internal_mutable_uint32_type() { + if (type_case() != kUint32Type) { + clear_type(); + set_has_uint32_type(); + _impl_.type_.uint32_type_ = CreateMaybeMessage< ::abacus::protobuf::UInt32Type >(GetArenaForAllocation()); + } + return _impl_.type_.uint32_type_; +} +inline ::abacus::protobuf::UInt32Type* Metric::mutable_uint32_type() { + ::abacus::protobuf::UInt32Type* _msg = _internal_mutable_uint32_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.uint32_type) + return _msg; +} + +// .abacus.protobuf.Int32Type int32_type = 7; +inline bool Metric::has_int32_type() const { + return type_case() == kInt32Type; +} +inline bool Metric::_internal_has_int32_type() const { + return type_case() == kInt32Type; +} +inline void Metric::set_has_int32_type() { + _impl_._oneof_case_[0] = kInt32Type; +} +inline void Metric::clear_int32_type() { + if (type_case() == kInt32Type) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int32_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::Int32Type* Metric::release_int32_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.int32_type) + if (type_case() == kInt32Type) { + clear_has_type(); + ::abacus::protobuf::Int32Type* temp = _impl_.type_.int32_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.int32_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Int32Type& Metric::_internal_int32_type() const { + return type_case() == kInt32Type + ? *_impl_.type_.int32_type_ + : reinterpret_cast<::abacus::protobuf::Int32Type&>(::abacus::protobuf::_Int32Type_default_instance_); +} +inline const ::abacus::protobuf::Int32Type& Metric::int32_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.int32_type) + return _internal_int32_type(); +} +inline ::abacus::protobuf::Int32Type* Metric::unsafe_arena_release_int32_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.int32_type) + if (type_case() == kInt32Type) { + clear_has_type(); + ::abacus::protobuf::Int32Type* temp = _impl_.type_.int32_type_; + _impl_.type_.int32_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_int32_type(::abacus::protobuf::Int32Type* int32_type) { + clear_type(); + if (int32_type) { + set_has_int32_type(); + _impl_.type_.int32_type_ = int32_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.int32_type) +} +inline ::abacus::protobuf::Int32Type* Metric::_internal_mutable_int32_type() { + if (type_case() != kInt32Type) { + clear_type(); + set_has_int32_type(); + _impl_.type_.int32_type_ = CreateMaybeMessage< ::abacus::protobuf::Int32Type >(GetArenaForAllocation()); + } + return _impl_.type_.int32_type_; +} +inline ::abacus::protobuf::Int32Type* Metric::mutable_int32_type() { + ::abacus::protobuf::Int32Type* _msg = _internal_mutable_int32_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.int32_type) + return _msg; +} + +// .abacus.protobuf.Float64Type float64_type = 8; +inline bool Metric::has_float64_type() const { + return type_case() == kFloat64Type; +} +inline bool Metric::_internal_has_float64_type() const { + return type_case() == kFloat64Type; +} +inline void Metric::set_has_float64_type() { + _impl_._oneof_case_[0] = kFloat64Type; +} +inline void Metric::clear_float64_type() { + if (type_case() == kFloat64Type) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float64_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::Float64Type* Metric::release_float64_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.float64_type) + if (type_case() == kFloat64Type) { + clear_has_type(); + ::abacus::protobuf::Float64Type* temp = _impl_.type_.float64_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.float64_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Float64Type& Metric::_internal_float64_type() const { + return type_case() == kFloat64Type + ? *_impl_.type_.float64_type_ + : reinterpret_cast<::abacus::protobuf::Float64Type&>(::abacus::protobuf::_Float64Type_default_instance_); +} +inline const ::abacus::protobuf::Float64Type& Metric::float64_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.float64_type) + return _internal_float64_type(); +} +inline ::abacus::protobuf::Float64Type* Metric::unsafe_arena_release_float64_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.float64_type) + if (type_case() == kFloat64Type) { + clear_has_type(); + ::abacus::protobuf::Float64Type* temp = _impl_.type_.float64_type_; + _impl_.type_.float64_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_float64_type(::abacus::protobuf::Float64Type* float64_type) { + clear_type(); + if (float64_type) { + set_has_float64_type(); + _impl_.type_.float64_type_ = float64_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.float64_type) +} +inline ::abacus::protobuf::Float64Type* Metric::_internal_mutable_float64_type() { + if (type_case() != kFloat64Type) { + clear_type(); + set_has_float64_type(); + _impl_.type_.float64_type_ = CreateMaybeMessage< ::abacus::protobuf::Float64Type >(GetArenaForAllocation()); + } + return _impl_.type_.float64_type_; +} +inline ::abacus::protobuf::Float64Type* Metric::mutable_float64_type() { + ::abacus::protobuf::Float64Type* _msg = _internal_mutable_float64_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.float64_type) + return _msg; +} + +// .abacus.protobuf.Float32Type float32_type = 9; +inline bool Metric::has_float32_type() const { + return type_case() == kFloat32Type; +} +inline bool Metric::_internal_has_float32_type() const { + return type_case() == kFloat32Type; +} +inline void Metric::set_has_float32_type() { + _impl_._oneof_case_[0] = kFloat32Type; +} +inline void Metric::clear_float32_type() { + if (type_case() == kFloat32Type) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float32_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::Float32Type* Metric::release_float32_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.float32_type) + if (type_case() == kFloat32Type) { + clear_has_type(); + ::abacus::protobuf::Float32Type* temp = _impl_.type_.float32_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.float32_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Float32Type& Metric::_internal_float32_type() const { + return type_case() == kFloat32Type + ? *_impl_.type_.float32_type_ + : reinterpret_cast<::abacus::protobuf::Float32Type&>(::abacus::protobuf::_Float32Type_default_instance_); +} +inline const ::abacus::protobuf::Float32Type& Metric::float32_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.float32_type) + return _internal_float32_type(); +} +inline ::abacus::protobuf::Float32Type* Metric::unsafe_arena_release_float32_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.float32_type) + if (type_case() == kFloat32Type) { + clear_has_type(); + ::abacus::protobuf::Float32Type* temp = _impl_.type_.float32_type_; + _impl_.type_.float32_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_float32_type(::abacus::protobuf::Float32Type* float32_type) { + clear_type(); + if (float32_type) { + set_has_float32_type(); + _impl_.type_.float32_type_ = float32_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.float32_type) +} +inline ::abacus::protobuf::Float32Type* Metric::_internal_mutable_float32_type() { + if (type_case() != kFloat32Type) { + clear_type(); + set_has_float32_type(); + _impl_.type_.float32_type_ = CreateMaybeMessage< ::abacus::protobuf::Float32Type >(GetArenaForAllocation()); + } + return _impl_.type_.float32_type_; +} +inline ::abacus::protobuf::Float32Type* Metric::mutable_float32_type() { + ::abacus::protobuf::Float32Type* _msg = _internal_mutable_float32_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.float32_type) + return _msg; +} + +// .abacus.protobuf.BoolType bool_type = 10; +inline bool Metric::has_bool_type() const { + return type_case() == kBoolType; +} +inline bool Metric::_internal_has_bool_type() const { + return type_case() == kBoolType; +} +inline void Metric::set_has_bool_type() { + _impl_._oneof_case_[0] = kBoolType; +} +inline void Metric::clear_bool_type() { + if (type_case() == kBoolType) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.bool_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::BoolType* Metric::release_bool_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.bool_type) + if (type_case() == kBoolType) { + clear_has_type(); + ::abacus::protobuf::BoolType* temp = _impl_.type_.bool_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.bool_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::BoolType& Metric::_internal_bool_type() const { + return type_case() == kBoolType + ? *_impl_.type_.bool_type_ + : reinterpret_cast<::abacus::protobuf::BoolType&>(::abacus::protobuf::_BoolType_default_instance_); +} +inline const ::abacus::protobuf::BoolType& Metric::bool_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.bool_type) + return _internal_bool_type(); +} +inline ::abacus::protobuf::BoolType* Metric::unsafe_arena_release_bool_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.bool_type) + if (type_case() == kBoolType) { + clear_has_type(); + ::abacus::protobuf::BoolType* temp = _impl_.type_.bool_type_; + _impl_.type_.bool_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_bool_type(::abacus::protobuf::BoolType* bool_type) { + clear_type(); + if (bool_type) { + set_has_bool_type(); + _impl_.type_.bool_type_ = bool_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.bool_type) +} +inline ::abacus::protobuf::BoolType* Metric::_internal_mutable_bool_type() { + if (type_case() != kBoolType) { + clear_type(); + set_has_bool_type(); + _impl_.type_.bool_type_ = CreateMaybeMessage< ::abacus::protobuf::BoolType >(GetArenaForAllocation()); + } + return _impl_.type_.bool_type_; +} +inline ::abacus::protobuf::BoolType* Metric::mutable_bool_type() { + ::abacus::protobuf::BoolType* _msg = _internal_mutable_bool_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.bool_type) + return _msg; +} + +// .abacus.protobuf.EnumType enum_type = 11; +inline bool Metric::has_enum_type() const { + return type_case() == kEnumType; +} +inline bool Metric::_internal_has_enum_type() const { + return type_case() == kEnumType; +} +inline void Metric::set_has_enum_type() { + _impl_._oneof_case_[0] = kEnumType; +} +inline void Metric::clear_enum_type() { + if (type_case() == kEnumType) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.enum_type_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::EnumType* Metric::release_enum_type() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.enum_type) + if (type_case() == kEnumType) { + clear_has_type(); + ::abacus::protobuf::EnumType* temp = _impl_.type_.enum_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.enum_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::EnumType& Metric::_internal_enum_type() const { + return type_case() == kEnumType + ? *_impl_.type_.enum_type_ + : reinterpret_cast<::abacus::protobuf::EnumType&>(::abacus::protobuf::_EnumType_default_instance_); +} +inline const ::abacus::protobuf::EnumType& Metric::enum_type() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.enum_type) + return _internal_enum_type(); +} +inline ::abacus::protobuf::EnumType* Metric::unsafe_arena_release_enum_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.enum_type) + if (type_case() == kEnumType) { + clear_has_type(); + ::abacus::protobuf::EnumType* temp = _impl_.type_.enum_type_; + _impl_.type_.enum_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_enum_type(::abacus::protobuf::EnumType* enum_type) { + clear_type(); + if (enum_type) { + set_has_enum_type(); + _impl_.type_.enum_type_ = enum_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.enum_type) +} +inline ::abacus::protobuf::EnumType* Metric::_internal_mutable_enum_type() { + if (type_case() != kEnumType) { + clear_type(); + set_has_enum_type(); + _impl_.type_.enum_type_ = CreateMaybeMessage< ::abacus::protobuf::EnumType >(GetArenaForAllocation()); + } + return _impl_.type_.enum_type_; +} +inline ::abacus::protobuf::EnumType* Metric::mutable_enum_type() { + ::abacus::protobuf::EnumType* _msg = _internal_mutable_enum_type(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.enum_type) + return _msg; +} + +inline bool Metric::has_type() const { + return type_case() != TYPE_NOT_SET; +} +inline void Metric::clear_has_type() { + _impl_._oneof_case_[0] = TYPE_NOT_SET; +} +inline Metric::TypeCase Metric::type_case() const { + return Metric::TypeCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// UInt64Type + +// string unit = 1; +inline void UInt64Type::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& UInt64Type::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void UInt64Type::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:abacus.protobuf.UInt64Type.unit) +} +inline std::string* UInt64Type::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Type.unit) + return _s; +} +inline const std::string& UInt64Type::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void UInt64Type::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* UInt64Type::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* UInt64Type::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Type.unit) + return _impl_.unit_.Release(); +} +inline void UInt64Type::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:abacus.protobuf.UInt64Type.unit) +} + +// .abacus.protobuf.Kind kind = 2; +inline void UInt64Type::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind UInt64Type::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.kind) + return _internal_kind(); +} +inline void UInt64Type::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Type.kind) +} +inline ::abacus::protobuf::Kind UInt64Type::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void UInt64Type::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// uint64 min = 3; +inline void UInt64Type::clear_min() { + _impl_.min_ = ::uint64_t{0u}; +} +inline ::uint64_t UInt64Type::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.min) + return _internal_min(); +} +inline void UInt64Type::set_min(::uint64_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Type.min) +} +inline ::uint64_t UInt64Type::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void UInt64Type::_internal_set_min(::uint64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.min_ = value; +} + +// uint64 max = 4; +inline void UInt64Type::clear_max() { + _impl_.max_ = ::uint64_t{0u}; +} +inline ::uint64_t UInt64Type::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.max) + return _internal_max(); +} +inline void UInt64Type::set_max(::uint64_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Type.max) +} +inline ::uint64_t UInt64Type::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void UInt64Type::_internal_set_max(::uint64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.max_ = value; +} + +// ------------------------------------------------------------------- + +// Int64Type + +// string unit = 1; +inline void Int64Type::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& Int64Type::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Int64Type::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:abacus.protobuf.Int64Type.unit) +} +inline std::string* Int64Type::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Type.unit) + return _s; +} +inline const std::string& Int64Type::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Int64Type::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Int64Type::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Int64Type::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Type.unit) + return _impl_.unit_.Release(); +} +inline void Int64Type::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:abacus.protobuf.Int64Type.unit) +} + +// .abacus.protobuf.Kind kind = 2; +inline void Int64Type::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind Int64Type::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.kind) + return _internal_kind(); +} +inline void Int64Type::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Type.kind) +} +inline ::abacus::protobuf::Kind Int64Type::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void Int64Type::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// int64 min = 3; +inline void Int64Type::clear_min() { + _impl_.min_ = ::int64_t{0}; +} +inline ::int64_t Int64Type::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.min) + return _internal_min(); +} +inline void Int64Type::set_min(::int64_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Type.min) +} +inline ::int64_t Int64Type::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void Int64Type::_internal_set_min(::int64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.min_ = value; +} + +// int64 max = 4; +inline void Int64Type::clear_max() { + _impl_.max_ = ::int64_t{0}; +} +inline ::int64_t Int64Type::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.max) + return _internal_max(); +} +inline void Int64Type::set_max(::int64_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Type.max) +} +inline ::int64_t Int64Type::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void Int64Type::_internal_set_max(::int64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.max_ = value; +} + +// ------------------------------------------------------------------- + +// UInt32Type + +// string unit = 1; +inline void UInt32Type::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& UInt32Type::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void UInt32Type::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:abacus.protobuf.UInt32Type.unit) +} +inline std::string* UInt32Type::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Type.unit) + return _s; +} +inline const std::string& UInt32Type::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void UInt32Type::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* UInt32Type::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* UInt32Type::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Type.unit) + return _impl_.unit_.Release(); +} +inline void UInt32Type::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:abacus.protobuf.UInt32Type.unit) +} + +// .abacus.protobuf.Kind kind = 2; +inline void UInt32Type::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind UInt32Type::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.kind) + return _internal_kind(); +} +inline void UInt32Type::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Type.kind) +} +inline ::abacus::protobuf::Kind UInt32Type::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void UInt32Type::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// uint32 min = 3; +inline void UInt32Type::clear_min() { + _impl_.min_ = 0u; +} +inline ::uint32_t UInt32Type::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.min) + return _internal_min(); +} +inline void UInt32Type::set_min(::uint32_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Type.min) +} +inline ::uint32_t UInt32Type::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void UInt32Type::_internal_set_min(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.min_ = value; +} + +// uint32 max = 4; +inline void UInt32Type::clear_max() { + _impl_.max_ = 0u; +} +inline ::uint32_t UInt32Type::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.max) + return _internal_max(); +} +inline void UInt32Type::set_max(::uint32_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Type.max) +} +inline ::uint32_t UInt32Type::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void UInt32Type::_internal_set_max(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.max_ = value; +} + +// ------------------------------------------------------------------- + +// Int32Type + +// string unit = 1; +inline void Int32Type::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& Int32Type::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Int32Type::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:abacus.protobuf.Int32Type.unit) +} +inline std::string* Int32Type::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Type.unit) + return _s; +} +inline const std::string& Int32Type::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Int32Type::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Int32Type::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Int32Type::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Type.unit) + return _impl_.unit_.Release(); +} +inline void Int32Type::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:abacus.protobuf.Int32Type.unit) +} + +// .abacus.protobuf.Kind kind = 2; +inline void Int32Type::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind Int32Type::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.kind) + return _internal_kind(); +} +inline void Int32Type::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Type.kind) +} +inline ::abacus::protobuf::Kind Int32Type::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void Int32Type::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// int32 min = 3; +inline void Int32Type::clear_min() { + _impl_.min_ = 0; +} +inline ::int32_t Int32Type::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.min) + return _internal_min(); +} +inline void Int32Type::set_min(::int32_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Type.min) +} +inline ::int32_t Int32Type::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void Int32Type::_internal_set_min(::int32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.min_ = value; +} + +// int32 max = 4; +inline void Int32Type::clear_max() { + _impl_.max_ = 0; +} +inline ::int32_t Int32Type::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.max) + return _internal_max(); +} +inline void Int32Type::set_max(::int32_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Type.max) +} +inline ::int32_t Int32Type::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void Int32Type::_internal_set_max(::int32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.max_ = value; +} + +// ------------------------------------------------------------------- + +// Float64Type + +// string unit = 1; +inline void Float64Type::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& Float64Type::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Float64Type::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:abacus.protobuf.Float64Type.unit) +} +inline std::string* Float64Type::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Type.unit) + return _s; +} +inline const std::string& Float64Type::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Float64Type::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Float64Type::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Float64Type::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Type.unit) + return _impl_.unit_.Release(); +} +inline void Float64Type::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:abacus.protobuf.Float64Type.unit) +} + +// .abacus.protobuf.Kind kind = 2; +inline void Float64Type::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind Float64Type::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.kind) + return _internal_kind(); +} +inline void Float64Type::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Type.kind) +} +inline ::abacus::protobuf::Kind Float64Type::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void Float64Type::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// double min = 3; +inline void Float64Type::clear_min() { + _impl_.min_ = 0; +} +inline double Float64Type::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.min) + return _internal_min(); +} +inline void Float64Type::set_min(double value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Type.min) +} +inline double Float64Type::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void Float64Type::_internal_set_min(double value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.min_ = value; +} + +// double max = 4; +inline void Float64Type::clear_max() { + _impl_.max_ = 0; +} +inline double Float64Type::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.max) + return _internal_max(); +} +inline void Float64Type::set_max(double value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Type.max) +} +inline double Float64Type::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void Float64Type::_internal_set_max(double value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.max_ = value; +} + +// ------------------------------------------------------------------- + +// Float32Type + +// string unit = 1; +inline void Float32Type::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& Float32Type::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Float32Type::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:abacus.protobuf.Float32Type.unit) +} +inline std::string* Float32Type::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Type.unit) + return _s; +} +inline const std::string& Float32Type::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Float32Type::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Float32Type::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Float32Type::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Type.unit) + return _impl_.unit_.Release(); +} +inline void Float32Type::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:abacus.protobuf.Float32Type.unit) +} + +// .abacus.protobuf.Kind kind = 2; +inline void Float32Type::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind Float32Type::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.kind) + return _internal_kind(); +} +inline void Float32Type::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Type.kind) +} +inline ::abacus::protobuf::Kind Float32Type::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void Float32Type::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// float min = 3; +inline void Float32Type::clear_min() { + _impl_.min_ = 0; +} +inline float Float32Type::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.min) + return _internal_min(); +} +inline void Float32Type::set_min(float value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Type.min) +} +inline float Float32Type::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void Float32Type::_internal_set_min(float value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.min_ = value; +} + +// float max = 4; +inline void Float32Type::clear_max() { + _impl_.max_ = 0; +} +inline float Float32Type::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.max) + return _internal_max(); +} +inline void Float32Type::set_max(float value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Type.max) +} +inline float Float32Type::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void Float32Type::_internal_set_max(float value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.max_ = value; +} + +// ------------------------------------------------------------------- + +// BoolType + +// string unit = 1; +inline void BoolType::clear_unit() { + _impl_.unit_.ClearToEmpty(); +} +inline const std::string& BoolType::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolType.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void BoolType::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:abacus.protobuf.BoolType.unit) +} +inline std::string* BoolType::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolType.unit) + return _s; +} +inline const std::string& BoolType::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void BoolType::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* BoolType::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* BoolType::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.BoolType.unit) + return _impl_.unit_.Release(); +} +inline void BoolType::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:abacus.protobuf.BoolType.unit) +} + +// .abacus.protobuf.Kind kind = 2; +inline void BoolType::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind BoolType::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolType.kind) + return _internal_kind(); +} +inline void BoolType::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolType.kind) +} +inline ::abacus::protobuf::Kind BoolType::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void BoolType::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + // ------------------------------------------------------------------- -// Info +// EnumInfo // string name = 1; -inline void Info::clear_name() { +inline void EnumInfo::clear_name() { _impl_.name_.ClearToEmpty(); } -inline const std::string& Info::name() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.name) +inline const std::string& EnumInfo::name() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.EnumInfo.name) return _internal_name(); } template -inline PROTOBUF_ALWAYS_INLINE void Info::set_name(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void EnumInfo::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:abacus.protobuf.Info.name) + // @@protoc_insertion_point(field_set:abacus.protobuf.EnumInfo.name) } -inline std::string* Info::mutable_name() { +inline std::string* EnumInfo::mutable_name() { std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Info.name) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumInfo.name) return _s; } -inline const std::string& Info::_internal_name() const { +inline const std::string& EnumInfo::_internal_name() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.name_.Get(); } -inline void Info::_internal_set_name(const std::string& value) { +inline void EnumInfo::_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() { +inline std::string* EnumInfo::_internal_mutable_name() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; return _impl_.name_.Mutable( GetArenaForAllocation()); } -inline std::string* Info::release_name() { +inline std::string* EnumInfo::release_name() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Info.name) + // @@protoc_insertion_point(field_release:abacus.protobuf.EnumInfo.name) return _impl_.name_.Release(); } -inline void Info::set_allocated_name(std::string* value) { +inline void EnumInfo::set_allocated_name(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_.name_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -970,581 +4602,466 @@ inline void Info::set_allocated_name(std::string* value) { _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Info.name) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.EnumInfo.name) } -// string description = 2; -inline void Info::clear_description() { +// optional string description = 2; +inline bool EnumInfo::has_description() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void EnumInfo::clear_description() { _impl_.description_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& Info::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.description) +inline const std::string& EnumInfo::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.EnumInfo.description) return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void Info::set_description(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void EnumInfo::set_description(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.description) + // @@protoc_insertion_point(field_set:abacus.protobuf.EnumInfo.description) } -inline std::string* Info::mutable_description() { +inline std::string* EnumInfo::mutable_description() { std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Info.description) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumInfo.description) return _s; } -inline const std::string& Info::_internal_description() const { +inline const std::string& EnumInfo::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.description_.Get(); } -inline void Info::_internal_set_description(const std::string& value) { +inline void EnumInfo::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* Info::_internal_mutable_description() { +inline std::string* EnumInfo::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* Info::release_description() { +inline std::string* EnumInfo::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Info.description) - return _impl_.description_.Release(); + // @@protoc_insertion_point(field_release:abacus.protobuf.EnumInfo.description) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.description_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.description_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline void Info::set_allocated_description(std::string* value) { +inline void EnumInfo::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } _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:abacus.protobuf.Info.description) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.EnumInfo.description) } -// .abacus.protobuf.Type type = 3; -inline void Info::clear_type() { - _impl_.type_ = 0; +// optional uint32 severity = 3; +inline bool EnumInfo::has_severity() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline ::abacus::protobuf::Type Info::type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.type) - return _internal_type(); +inline void EnumInfo::clear_severity() { + _impl_.severity_ = 0u; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline void Info::set_type(::abacus::protobuf::Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.type) +inline ::uint32_t EnumInfo::severity() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.EnumInfo.severity) + return _internal_severity(); } -inline ::abacus::protobuf::Type Info::_internal_type() const { +inline void EnumInfo::set_severity(::uint32_t value) { + _internal_set_severity(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.EnumInfo.severity) +} +inline ::uint32_t EnumInfo::_internal_severity() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Type>(_impl_.type_); + return _impl_.severity_; } -inline void Info::_internal_set_type(::abacus::protobuf::Type value) { +inline void EnumInfo::_internal_set_severity(::uint32_t value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.type_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.severity_ = value; } -// .abacus.protobuf.Kind kind = 4; -inline void Info::clear_kind() { - _impl_.kind_ = 0; +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// EnumType + +// map enum_map = 1; +inline int EnumType::_internal_enum_map_size() const { + return _internal_enum_map().size(); } -inline ::abacus::protobuf::Kind Info::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.kind) - return _internal_kind(); +inline int EnumType::enum_map_size() const { + return _internal_enum_map_size(); } -inline void Info::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.kind) +inline void EnumType::clear_enum_map() { + _impl_.enum_map_.Clear(); } -inline ::abacus::protobuf::Kind Info::_internal_kind() const { +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& EnumType::_internal_enum_map() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); + return _impl_.enum_map_.GetMap(); +} +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& EnumType::enum_map() const { + // @@protoc_insertion_point(field_map:abacus.protobuf.EnumType.enum_map) + return _internal_enum_map(); } -inline void Info::_internal_set_kind(::abacus::protobuf::Kind value) { +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* EnumType::_internal_mutable_enum_map() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; + return _impl_.enum_map_.MutableMap(); } - -// string unit = 5; -inline void Info::clear_unit() { - _impl_.unit_.ClearToEmpty(); +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* EnumType::mutable_enum_map() { + // @@protoc_insertion_point(field_mutable_map:abacus.protobuf.EnumType.enum_map) + return _internal_mutable_enum_map(); } -inline const std::string& Info::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.unit) - return _internal_unit(); + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// MetricsMetadata + +// uint32 protocol_version = 1; +inline void MetricsMetadata::clear_protocol_version() { + _impl_.protocol_version_ = 0u; } -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:abacus.protobuf.Info.unit) +inline ::uint32_t MetricsMetadata::protocol_version() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricsMetadata.protocol_version) + return _internal_protocol_version(); } -inline std::string* Info::mutable_unit() { - std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Info.unit) - return _s; +inline void MetricsMetadata::set_protocol_version(::uint32_t value) { + _internal_set_protocol_version(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricsMetadata.protocol_version) } -inline const std::string& Info::_internal_unit() const { +inline ::uint32_t MetricsMetadata::_internal_protocol_version() 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()); + return _impl_.protocol_version_; } -inline std::string* Info::_internal_mutable_unit() { +inline void MetricsMetadata::_internal_set_protocol_version(::uint32_t value) { 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:abacus.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:abacus.protobuf.Info.unit) + _impl_.protocol_version_ = value; } -// 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(); - } +// .abacus.protobuf.Endianness endianness = 2; +inline void MetricsMetadata::clear_endianness() { + _impl_.endianness_ = 0; } -inline ::uint64_t Info::uint64_min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.uint64_min) - return _internal_uint64_min(); +inline ::abacus::protobuf::Endianness MetricsMetadata::endianness() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricsMetadata.endianness) + return _internal_endianness(); } -inline void Info::set_uint64_min(::uint64_t value) { - _internal_set_uint64_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.uint64_min) +inline void MetricsMetadata::set_endianness(::abacus::protobuf::Endianness value) { + _internal_set_endianness(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricsMetadata.endianness) } -inline ::uint64_t Info::_internal_uint64_min() const { - if (min_case() == kUint64Min) { - return _impl_.min_.uint64_min_; - } - return ::uint64_t{0u}; +inline ::abacus::protobuf::Endianness MetricsMetadata::_internal_endianness() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Endianness>(_impl_.endianness_); } -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; +inline void MetricsMetadata::_internal_set_endianness(::abacus::protobuf::Endianness value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.endianness_ = 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(); - } +// uint32 sync_value = 3; +inline void MetricsMetadata::clear_sync_value() { + _impl_.sync_value_ = 0u; } -inline ::int64_t Info::int64_min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.int64_min) - return _internal_int64_min(); +inline ::uint32_t MetricsMetadata::sync_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricsMetadata.sync_value) + return _internal_sync_value(); } -inline void Info::set_int64_min(::int64_t value) { - _internal_set_int64_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.int64_min) +inline void MetricsMetadata::set_sync_value(::uint32_t value) { + _internal_set_sync_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricsMetadata.sync_value) } -inline ::int64_t Info::_internal_int64_min() const { - if (min_case() == kInt64Min) { - return _impl_.min_.int64_min_; - } - return ::int64_t{0}; +inline ::uint32_t MetricsMetadata::_internal_sync_value() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.sync_value_; } -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; +inline void MetricsMetadata::_internal_set_sync_value(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.sync_value_ = value; } -// double float64_min = 8; -inline bool Info::has_float64_min() const { - return min_case() == kFloat64Min; +// map metrics = 4; +inline int MetricsMetadata::_internal_metrics_size() const { + return _internal_metrics().size(); } -inline void Info::set_has_float64_min() { - _impl_._oneof_case_[0] = kFloat64Min; +inline int MetricsMetadata::metrics_size() const { + return _internal_metrics_size(); } -inline void Info::clear_float64_min() { - if (min_case() == kFloat64Min) { - _impl_.min_.float64_min_ = 0; - clear_has_min(); - } +inline void MetricsMetadata::clear_metrics() { + _impl_.metrics_.Clear(); } -inline double Info::float64_min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.float64_min) - return _internal_float64_min(); +inline const ::google::protobuf::Map& MetricsMetadata::_internal_metrics() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.metrics_.GetMap(); } -inline void Info::set_float64_min(double value) { - _internal_set_float64_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.float64_min) +inline const ::google::protobuf::Map& MetricsMetadata::metrics() const { + // @@protoc_insertion_point(field_map:abacus.protobuf.MetricsMetadata.metrics) + return _internal_metrics(); } -inline double Info::_internal_float64_min() const { - if (min_case() == kFloat64Min) { - return _impl_.min_.float64_min_; - } - return 0; +inline ::google::protobuf::Map* MetricsMetadata::_internal_mutable_metrics() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + return _impl_.metrics_.MutableMap(); } -inline void Info::_internal_set_float64_min(double value) { - if (min_case() != kFloat64Min) { - clear_min(); - set_has_float64_min(); - } - _impl_.min_.float64_min_ = value; +inline ::google::protobuf::Map* MetricsMetadata::mutable_metrics() { + // @@protoc_insertion_point(field_mutable_map:abacus.protobuf.MetricsMetadata.metrics) + return _internal_mutable_metrics(); } -// 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(); - } +// ------------------------------------------------------------------- + +// MetricValue + +// bool valid = 1; +inline void MetricValue::clear_valid() { + _impl_.valid_ = false; } -inline ::uint64_t Info::uint64_max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.uint64_max) - return _internal_uint64_max(); +inline bool MetricValue::valid() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.valid) + return _internal_valid(); } -inline void Info::set_uint64_max(::uint64_t value) { - _internal_set_uint64_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.uint64_max) +inline void MetricValue::set_valid(bool value) { + _internal_set_valid(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.valid) } -inline ::uint64_t Info::_internal_uint64_max() const { - if (max_case() == kUint64Max) { - return _impl_.max_.uint64_max_; - } - return ::uint64_t{0u}; +inline bool MetricValue::_internal_valid() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.valid_; } -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; +inline void MetricValue::_internal_set_valid(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.valid_ = value; } -// int64 int64_max = 10; -inline bool Info::has_int64_max() const { - return max_case() == kInt64Max; +// uint64 uint64_value = 2; +inline bool MetricValue::has_uint64_value() const { + return value_case() == kUint64Value; } -inline void Info::set_has_int64_max() { - _impl_._oneof_case_[1] = kInt64Max; +inline void MetricValue::set_has_uint64_value() { + _impl_._oneof_case_[0] = kUint64Value; } -inline void Info::clear_int64_max() { - if (max_case() == kInt64Max) { - _impl_.max_.int64_max_ = ::int64_t{0}; - clear_has_max(); +inline void MetricValue::clear_uint64_value() { + if (value_case() == kUint64Value) { + _impl_.value_.uint64_value_ = ::uint64_t{0u}; + clear_has_value(); } } -inline ::int64_t Info::int64_max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.int64_max) - return _internal_int64_max(); +inline ::uint64_t MetricValue::uint64_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.uint64_value) + return _internal_uint64_value(); } -inline void Info::set_int64_max(::int64_t value) { - _internal_set_int64_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.int64_max) +inline void MetricValue::set_uint64_value(::uint64_t value) { + _internal_set_uint64_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.uint64_value) } -inline ::int64_t Info::_internal_int64_max() const { - if (max_case() == kInt64Max) { - return _impl_.max_.int64_max_; +inline ::uint64_t MetricValue::_internal_uint64_value() const { + if (value_case() == kUint64Value) { + return _impl_.value_.uint64_value_; } - return ::int64_t{0}; + return ::uint64_t{0u}; } -inline void Info::_internal_set_int64_max(::int64_t value) { - if (max_case() != kInt64Max) { - clear_max(); - set_has_int64_max(); +inline void MetricValue::_internal_set_uint64_value(::uint64_t value) { + if (value_case() != kUint64Value) { + clear_value(); + set_has_uint64_value(); } - _impl_.max_.int64_max_ = value; + _impl_.value_.uint64_value_ = value; } -// double float64_max = 11; -inline bool Info::has_float64_max() const { - return max_case() == kFloat64Max; +// int64 int64_value = 3; +inline bool MetricValue::has_int64_value() const { + return value_case() == kInt64Value; } -inline void Info::set_has_float64_max() { - _impl_._oneof_case_[1] = kFloat64Max; +inline void MetricValue::set_has_int64_value() { + _impl_._oneof_case_[0] = kInt64Value; } -inline void Info::clear_float64_max() { - if (max_case() == kFloat64Max) { - _impl_.max_.float64_max_ = 0; - clear_has_max(); +inline void MetricValue::clear_int64_value() { + if (value_case() == kInt64Value) { + _impl_.value_.int64_value_ = ::int64_t{0}; + clear_has_value(); } } -inline double Info::float64_max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Info.float64_max) - return _internal_float64_max(); +inline ::int64_t MetricValue::int64_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.int64_value) + return _internal_int64_value(); } -inline void Info::set_float64_max(double value) { - _internal_set_float64_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Info.float64_max) +inline void MetricValue::set_int64_value(::int64_t value) { + _internal_set_int64_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.int64_value) } -inline double Info::_internal_float64_max() const { - if (max_case() == kFloat64Max) { - return _impl_.max_.float64_max_; +inline ::int64_t MetricValue::_internal_int64_value() const { + if (value_case() == kInt64Value) { + return _impl_.value_.int64_value_; } - return 0; + return ::int64_t{0}; } -inline void Info::_internal_set_float64_max(double value) { - if (max_case() != kFloat64Max) { - clear_max(); - set_has_float64_max(); +inline void MetricValue::_internal_set_int64_value(::int64_t value) { + if (value_case() != kInt64Value) { + clear_value(); + set_has_int64_value(); } - _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]); + _impl_.value_.int64_value_ = value; } -// ------------------------------------------------------------------- - -// Metric -// optional .abacus.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 ::abacus::protobuf::Info& Metric::_internal_info() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::abacus::protobuf::Info* p = _impl_.info_; - return p != nullptr ? *p : reinterpret_cast(::abacus::protobuf::_Info_default_instance_); +// uint32 uint32_value = 4; +inline bool MetricValue::has_uint32_value() const { + return value_case() == kUint32Value; } -inline const ::abacus::protobuf::Info& Metric::info() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.info) - return _internal_info(); +inline void MetricValue::set_has_uint32_value() { + _impl_._oneof_case_[0] = kUint32Value; } -inline void Metric::unsafe_arena_set_allocated_info(::abacus::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<::abacus::protobuf::Info*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; +inline void MetricValue::clear_uint32_value() { + if (value_case() == kUint32Value) { + _impl_.value_.uint32_value_ = 0u; + clear_has_value(); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.info) } -inline ::abacus::protobuf::Info* Metric::release_info() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::abacus::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 ::uint32_t MetricValue::uint32_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.uint32_value) + return _internal_uint32_value(); } -inline ::abacus::protobuf::Info* Metric::unsafe_arena_release_info() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.info) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::abacus::protobuf::Info* temp = _impl_.info_; - _impl_.info_ = nullptr; - return temp; +inline void MetricValue::set_uint32_value(::uint32_t value) { + _internal_set_uint32_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.uint32_value) } -inline ::abacus::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<::abacus::protobuf::Info>(GetArenaForAllocation()); - _impl_.info_ = reinterpret_cast<::abacus::protobuf::Info*>(p); +inline ::uint32_t MetricValue::_internal_uint32_value() const { + if (value_case() == kUint32Value) { + return _impl_.value_.uint32_value_; } - return _impl_.info_; -} -inline ::abacus::protobuf::Info* Metric::mutable_info() { - ::abacus::protobuf::Info* _msg = _internal_mutable_info(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.info) - return _msg; + return 0u; } -inline void Metric::set_allocated_info(::abacus::protobuf::Info* value) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::abacus::protobuf::Info*>(_impl_.info_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::abacus::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; +inline void MetricValue::_internal_set_uint32_value(::uint32_t value) { + if (value_case() != kUint32Value) { + clear_value(); + set_has_uint32_value(); } - - _impl_.info_ = reinterpret_cast<::abacus::protobuf::Info*>(value); - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.info) + _impl_.value_.uint32_value_ = value; } -// uint64 uint64_value = 2; -inline bool Metric::has_uint64_value() const { - return value_case() == kUint64Value; +// int32 int32_value = 5; +inline bool MetricValue::has_int32_value() const { + return value_case() == kInt32Value; } -inline void Metric::set_has_uint64_value() { - _impl_._oneof_case_[0] = kUint64Value; +inline void MetricValue::set_has_int32_value() { + _impl_._oneof_case_[0] = kInt32Value; } -inline void Metric::clear_uint64_value() { - if (value_case() == kUint64Value) { - _impl_.value_.uint64_value_ = ::uint64_t{0u}; +inline void MetricValue::clear_int32_value() { + if (value_case() == kInt32Value) { + _impl_.value_.int32_value_ = 0; clear_has_value(); } } -inline ::uint64_t Metric::uint64_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.uint64_value) - return _internal_uint64_value(); +inline ::int32_t MetricValue::int32_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.int32_value) + return _internal_int32_value(); } -inline void Metric::set_uint64_value(::uint64_t value) { - _internal_set_uint64_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.uint64_value) +inline void MetricValue::set_int32_value(::int32_t value) { + _internal_set_int32_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.int32_value) } -inline ::uint64_t Metric::_internal_uint64_value() const { - if (value_case() == kUint64Value) { - return _impl_.value_.uint64_value_; +inline ::int32_t MetricValue::_internal_int32_value() const { + if (value_case() == kInt32Value) { + return _impl_.value_.int32_value_; } - return ::uint64_t{0u}; + return 0; } -inline void Metric::_internal_set_uint64_value(::uint64_t value) { - if (value_case() != kUint64Value) { +inline void MetricValue::_internal_set_int32_value(::int32_t value) { + if (value_case() != kInt32Value) { clear_value(); - set_has_uint64_value(); + set_has_int32_value(); } - _impl_.value_.uint64_value_ = value; + _impl_.value_.int32_value_ = value; } -// int64 int64_value = 3; -inline bool Metric::has_int64_value() const { - return value_case() == kInt64Value; +// float float32_value = 6; +inline bool MetricValue::has_float32_value() const { + return value_case() == kFloat32Value; } -inline void Metric::set_has_int64_value() { - _impl_._oneof_case_[0] = kInt64Value; +inline void MetricValue::set_has_float32_value() { + _impl_._oneof_case_[0] = kFloat32Value; } -inline void Metric::clear_int64_value() { - if (value_case() == kInt64Value) { - _impl_.value_.int64_value_ = ::int64_t{0}; +inline void MetricValue::clear_float32_value() { + if (value_case() == kFloat32Value) { + _impl_.value_.float32_value_ = 0; clear_has_value(); } } -inline ::int64_t Metric::int64_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.int64_value) - return _internal_int64_value(); +inline float MetricValue::float32_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.float32_value) + return _internal_float32_value(); } -inline void Metric::set_int64_value(::int64_t value) { - _internal_set_int64_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.int64_value) +inline void MetricValue::set_float32_value(float value) { + _internal_set_float32_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.float32_value) } -inline ::int64_t Metric::_internal_int64_value() const { - if (value_case() == kInt64Value) { - return _impl_.value_.int64_value_; +inline float MetricValue::_internal_float32_value() const { + if (value_case() == kFloat32Value) { + return _impl_.value_.float32_value_; } - return ::int64_t{0}; + return 0; } -inline void Metric::_internal_set_int64_value(::int64_t value) { - if (value_case() != kInt64Value) { +inline void MetricValue::_internal_set_float32_value(float value) { + if (value_case() != kFloat32Value) { clear_value(); - set_has_int64_value(); + set_has_float32_value(); } - _impl_.value_.int64_value_ = value; + _impl_.value_.float32_value_ = value; } -// double float64_value = 4; -inline bool Metric::has_float64_value() const { +// double float64_value = 7; +inline bool MetricValue::has_float64_value() const { return value_case() == kFloat64Value; } -inline void Metric::set_has_float64_value() { +inline void MetricValue::set_has_float64_value() { _impl_._oneof_case_[0] = kFloat64Value; } -inline void Metric::clear_float64_value() { +inline void MetricValue::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:abacus.protobuf.Metric.float64_value) +inline double MetricValue::float64_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.float64_value) return _internal_float64_value(); } -inline void Metric::set_float64_value(double value) { +inline void MetricValue::set_float64_value(double value) { _internal_set_float64_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.float64_value) + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.float64_value) } -inline double Metric::_internal_float64_value() const { +inline double MetricValue::_internal_float64_value() const { if (value_case() == kFloat64Value) { return _impl_.value_.float64_value_; } return 0; } -inline void Metric::_internal_set_float64_value(double value) { +inline void MetricValue::_internal_set_float64_value(double value) { if (value_case() != kFloat64Value) { clear_value(); set_has_float64_value(); @@ -1552,34 +5069,34 @@ inline void Metric::_internal_set_float64_value(double value) { _impl_.value_.float64_value_ = value; } -// bool bool_value = 5; -inline bool Metric::has_bool_value() const { +// bool bool_value = 8; +inline bool MetricValue::has_bool_value() const { return value_case() == kBoolValue; } -inline void Metric::set_has_bool_value() { +inline void MetricValue::set_has_bool_value() { _impl_._oneof_case_[0] = kBoolValue; } -inline void Metric::clear_bool_value() { +inline void MetricValue::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:abacus.protobuf.Metric.bool_value) +inline bool MetricValue::bool_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.bool_value) return _internal_bool_value(); } -inline void Metric::set_bool_value(bool value) { +inline void MetricValue::set_bool_value(bool value) { _internal_set_bool_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.bool_value) + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.bool_value) } -inline bool Metric::_internal_bool_value() const { +inline bool MetricValue::_internal_bool_value() const { if (value_case() == kBoolValue) { return _impl_.value_.bool_value_; } return false; } -inline void Metric::_internal_set_bool_value(bool value) { +inline void MetricValue::_internal_set_bool_value(bool value) { if (value_case() != kBoolValue) { clear_value(); set_has_bool_value(); @@ -1587,85 +5104,120 @@ inline void Metric::_internal_set_bool_value(bool value) { _impl_.value_.bool_value_ = value; } -inline bool Metric::has_value() const { +// uint32 enum_value = 9; +inline bool MetricValue::has_enum_value() const { + return value_case() == kEnumValue; +} +inline void MetricValue::set_has_enum_value() { + _impl_._oneof_case_[0] = kEnumValue; +} +inline void MetricValue::clear_enum_value() { + if (value_case() == kEnumValue) { + _impl_.value_.enum_value_ = 0u; + clear_has_value(); + } +} +inline ::uint32_t MetricValue::enum_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.enum_value) + return _internal_enum_value(); +} +inline void MetricValue::set_enum_value(::uint32_t value) { + _internal_set_enum_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.enum_value) +} +inline ::uint32_t MetricValue::_internal_enum_value() const { + if (value_case() == kEnumValue) { + return _impl_.value_.enum_value_; + } + return 0u; +} +inline void MetricValue::_internal_set_enum_value(::uint32_t value) { + if (value_case() != kEnumValue) { + clear_value(); + set_has_enum_value(); + } + _impl_.value_.enum_value_ = value; +} + +inline bool MetricValue::has_value() const { return value_case() != VALUE_NOT_SET; } -inline void Metric::clear_has_value() { +inline void MetricValue::clear_has_value() { _impl_._oneof_case_[0] = VALUE_NOT_SET; } -inline Metric::ValueCase Metric::value_case() const { - return Metric::ValueCase(_impl_._oneof_case_[0]); +inline MetricValue::ValueCase MetricValue::value_case() const { + return MetricValue::ValueCase(_impl_._oneof_case_[0]); } // ------------------------------------------------------------------- -// Metrics +// MetricValues -// uint32 protocol_version = 1; -inline void Metrics::clear_protocol_version() { - _impl_.protocol_version_ = 0u; +// uint32 sync_value = 1; +inline void MetricValues::clear_sync_value() { + _impl_.sync_value_ = 0u; } -inline ::uint32_t Metrics::protocol_version() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metrics.protocol_version) - return _internal_protocol_version(); +inline ::uint32_t MetricValues::sync_value() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValues.sync_value) + return _internal_sync_value(); } -inline void Metrics::set_protocol_version(::uint32_t value) { - _internal_set_protocol_version(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metrics.protocol_version) +inline void MetricValues::set_sync_value(::uint32_t value) { + _internal_set_sync_value(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValues.sync_value) } -inline ::uint32_t Metrics::_internal_protocol_version() const { +inline ::uint32_t MetricValues::_internal_sync_value() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.protocol_version_; + return _impl_.sync_value_; } -inline void Metrics::_internal_set_protocol_version(::uint32_t value) { +inline void MetricValues::_internal_set_sync_value(::uint32_t value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.protocol_version_ = value; + _impl_.sync_value_ = value; } -// repeated .abacus.protobuf.Metric metric = 2; -inline int Metrics::_internal_metric_size() const { - return _internal_metric().size(); +// repeated .abacus.protobuf.MetricValue values = 2; +inline int MetricValues::_internal_values_size() const { + return _internal_values().size(); } -inline int Metrics::metric_size() const { - return _internal_metric_size(); +inline int MetricValues::values_size() const { + return _internal_values_size(); } -inline void Metrics::clear_metric() { - _internal_mutable_metric()->Clear(); +inline void MetricValues::clear_values() { + _internal_mutable_values()->Clear(); } -inline ::abacus::protobuf::Metric* Metrics::mutable_metric(int index) { - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metrics.metric) - return _internal_mutable_metric()->Mutable(index); +inline ::abacus::protobuf::MetricValue* MetricValues::mutable_values(int index) { + // @@protoc_insertion_point(field_mutable:abacus.protobuf.MetricValues.values) + return _internal_mutable_values()->Mutable(index); } -inline ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::Metric >* -Metrics::mutable_metric() { - // @@protoc_insertion_point(field_mutable_list:abacus.protobuf.Metrics.metric) +inline ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >* +MetricValues::mutable_values() { + // @@protoc_insertion_point(field_mutable_list:abacus.protobuf.MetricValues.values) PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_metric(); + return _internal_mutable_values(); } -inline const ::abacus::protobuf::Metric& Metrics::metric(int index) const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metrics.metric) - return _internal_metric().Get(index); +inline const ::abacus::protobuf::MetricValue& MetricValues::values(int index) const { + // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValues.values) + return _internal_values().Get(index); } -inline ::abacus::protobuf::Metric* Metrics::add_metric() { +inline ::abacus::protobuf::MetricValue* MetricValues::add_values() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::abacus::protobuf::Metric* _add = _internal_mutable_metric()->Add(); - // @@protoc_insertion_point(field_add:abacus.protobuf.Metrics.metric) + ::abacus::protobuf::MetricValue* _add = _internal_mutable_values()->Add(); + // @@protoc_insertion_point(field_add:abacus.protobuf.MetricValues.values) return _add; } -inline const ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::Metric >& -Metrics::metric() const { - // @@protoc_insertion_point(field_list:abacus.protobuf.Metrics.metric) - return _internal_metric(); +inline const ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >& +MetricValues::values() const { + // @@protoc_insertion_point(field_list:abacus.protobuf.MetricValues.values) + return _internal_values(); } -inline const ::google::protobuf::RepeatedPtrField<::abacus::protobuf::Metric>& -Metrics::_internal_metric() const { +inline const ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>& +MetricValues::_internal_values() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.metric_; + return _impl_.values_; } -inline ::google::protobuf::RepeatedPtrField<::abacus::protobuf::Metric>* -Metrics::_internal_mutable_metric() { +inline ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>* +MetricValues::_internal_mutable_values() { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.metric_; + return &_impl_.values_; } #ifdef __GNUC__ @@ -1687,10 +5239,10 @@ inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Kind>() { return ::abacus::protobuf::Kind_descriptor(); } template <> -struct is_proto_enum<::abacus::protobuf::Type> : std::true_type {}; +struct is_proto_enum<::abacus::protobuf::Endianness> : std::true_type {}; template <> -inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Type>() { - return ::abacus::protobuf::Type_descriptor(); +inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Endianness>() { + return ::abacus::protobuf::Endianness_descriptor(); } } // namespace protobuf diff --git a/src/abacus/to_protobuf.cpp b/src/abacus/to_protobuf.cpp deleted file mode 100644 index af3c933b..00000000 --- a/src/abacus/to_protobuf.cpp +++ /dev/null @@ -1,32 +0,0 @@ - - -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#include "detail/to_protobuf.hpp" -#include "protobuf/metrics.pb.h" -#include "to_protobuf.hpp" -#include "view.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -auto to_protobuf(const view& view) -> metrics_message -{ - return detail::to_protobuf(view); -} - -auto to_protobuf(const uint8_t* meta_data, const uint8_t* value_data) - -> metrics_message -{ - view v; - v.set_meta_data(meta_data); - v.set_value_data(value_data); - return to_protobuf(v); -} -} -} diff --git a/src/abacus/to_protobuf.hpp b/src/abacus/to_protobuf.hpp deleted file mode 100644 index 731d1184..00000000 --- a/src/abacus/to_protobuf.hpp +++ /dev/null @@ -1,31 +0,0 @@ - -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include - -#include "protobuf/metrics.pb.h" -#include "version.hpp" -#include "view.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -using metrics_message = abacus::protobuf::Metrics; -/// @return a protobuf of a metrics views data. -/// @param meta_data The meta data of the metrics view. -/// @param value_data The value data of the metrics view. -auto to_protobuf(const uint8_t* meta_data, const uint8_t* value_data) - -> metrics_message; - -/// @return a protobuf of single views data. -/// @param view A view with access to metrics-data. -auto to_protobuf(const view& view) -> metrics_message; -} -} diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index f01eed60..4fb7ef05 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -3,10 +3,6 @@ // // Distributed under the "BSD License". See the accompanying LICENSE.rst file. -// Pragma needed to be able to compile code, that divides by literal zero with -// MSVC -#pragma fenv_access(on) - #include #include #include diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 7b63f5ab..cd29cb99 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -82,11 +82,11 @@ TEST(test_metrics, default_constructor) EXPECT_TRUE(metrics.is_initialized(4)); EXPECT_FALSE(metrics.is_initialized(5)); - metrics.initialize_constant(name4, true); + metrics.initialize_constant(name4, true); EXPECT_TRUE(metrics.is_initialized(5)); EXPECT_FALSE(metrics.is_initialized(3)); - metrics.initialize_constant(name5, 42.42); + metrics.initialize_constant(name5, 42.42); EXPECT_TRUE(metrics.is_initialized(3)); EXPECT_EQ(metrics.name(0), name1); diff --git a/test/src/test_metrics2.cpp b/test/src/test_metrics2.cpp new file mode 100644 index 00000000..cf4617c1 --- /dev/null +++ b/test/src/test_metrics2.cpp @@ -0,0 +1,10 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst +// file. + +#include +#include + +// #include diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 1e35714f..e6312dc5 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -66,7 +66,7 @@ TEST(test_to_json, api) auto m0 = metrics.initialize_metric(name0); auto m1 = metrics.initialize_metric(name1); - metrics.initialize_constant(name2, true); + metrics.initialize_constant(name2, true); m0 = 42; m1 = -42; diff --git a/test/src/test_to_protobuf.cpp b/test/src/test_to_protobuf.cpp deleted file mode 100644 index 26cd5e92..00000000 --- a/test/src/test_to_protobuf.cpp +++ /dev/null @@ -1,93 +0,0 @@ - -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst -// file. - -#include -#include - -#include -#include -#include -#include - -TEST(test_to_protobuf, api) -{ - std::string name0 = "metric0"; - std::string name1 = "metric1"; - std::string name2 = "metric2"; - - abacus::metric_info infos[3] = { - abacus::metric_info{name0, "An unsigned integer metric", - abacus::type::uint64, abacus::kind::counter, - abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, - abacus::max{uint64_t{100U}}}, - abacus::metric_info{name1, "A signed integer metric", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"USD"}, abacus::min{int64_t{-100}}, - abacus::max{int64_t{100}}}, - abacus::metric_info{name2, "A boolean constant", abacus::type::boolean, - abacus::kind::constant}}; - - abacus::metrics metrics(infos); - - auto m0 = metrics.initialize_metric(name0); - auto m1 = metrics.initialize_metric(name1); - metrics.initialize_constant(name2, true); - - m0 = 42; - m1 = -42; - - abacus::view view; - view.set_meta_data(metrics.meta_data()); - view.set_value_data(metrics.value_data()); - - auto protobuf = abacus::to_protobuf(view); - auto expected = abacus::metrics_message(); - expected.set_protocol_version(1); - - auto metric0 = expected.add_metric(); - auto info0 = metric0->mutable_info(); - info0->set_name(name0); - info0->set_description(infos[0].description); - info0->set_kind(static_cast(infos[0].kind)); - info0->set_type(static_cast(infos[0].type)); - info0->set_unit(infos[0].unit.value); - metric0->set_uint64_value(m0.value()); - info0->set_uint64_max(infos[0].max.m_uint); - info0->set_uint64_min(infos[0].min.m_uint); - - auto metric1 = expected.add_metric(); - auto info1 = metric1->mutable_info(); - info1->set_name(name1); - info1->set_description(infos[1].description); - info1->set_kind(static_cast(infos[1].kind)); - info1->set_type(static_cast(infos[1].type)); - info1->set_unit(infos[1].unit.value); - metric1->set_int64_value(m1.value()); - info1->set_int64_max(infos[1].max.m_int); - info1->set_int64_min(infos[1].min.m_int); - - auto metric2 = expected.add_metric(); - auto info2 = metric2->mutable_info(); - info2->set_name(name2); - info2->set_description(infos[2].description); - info2->set_kind(static_cast(infos[2].kind)); - info2->set_type(static_cast(infos[2].type)); - info2->set_unit(infos[2].unit.value); - metric2->set_bool_value(true); - - std::string expected_output; - auto msg1 = - google::protobuf::util::MessageToJsonString(expected, &expected_output); - EXPECT_TRUE(msg1.ok()); - - std::string protobuf_json; - auto msg2 = - google::protobuf::util::MessageToJsonString(protobuf, &protobuf_json); - EXPECT_TRUE(msg1.ok()); - - EXPECT_EQ(expected_output, protobuf_json); -} diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 64f222cf..1b82a384 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -33,7 +33,7 @@ TEST(test_view, api) metrics.initialize_metric(name1); - metrics.initialize_constant(name2, 3.14); + metrics.initialize_constant(name2, 3.14); std::vector meta_data(metrics.meta_bytes()); std::vector value_data(metrics.value_bytes()); diff --git a/waf b/waf index 7cda1a07..fe99483f 100755 --- a/waf +++ b/waf @@ -32,13 +32,13 @@ POSSIBILITY OF SUCH DAMAGE. import os, sys, inspect -VERSION="2.0.22" -REVISION="68b67e5087596dd4ba879e230f042c46" -GIT="3f8bb163290eb8fbfc3b26d61dd04aa5a6a29d4a" +VERSION="2.0.26" +REVISION="8bd7c4962475e4a1e52d4264baf2f294" +GIT="ad7b733fc60852f77eff200b79e8b6f9562494d2" INSTALL='' -C1='#>' -C2='#5' -C3='#2' +C1='#,' +C2='#+' +C3='#(' cwd = os.getcwd() join = os.path.join @@ -168,5 +168,5 @@ if __name__ == '__main__': Scripting.waf_entry_point(cwd, VERSION, wafdir) #==> -#BZh91AY&SY)õ“#2ïqÿÿüÆPÿÿÿÿÿÿÿÿÿÿÿwˆ©Ã);´,0ÁÝ°mèby\<äE•@#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2÷ÝØ‹jc35cm›Ø7fÍhÕ­RØ™ÝrÊm3[fU›_XzÒ—™ë;§"nûÞäûÝß}ÊÛmνۭzéK¬ÑÐwó¼ù{¾ÛqQ“©vËtyì¶ÔT£ª=æ·9‡¼¸7·«Íhõ݆]{Ýiæé¦íîàW½÷¾ïG7gËÔíï—¯žïSׯ­Ö¼$Ýì觉•÷ï|{(Ù6K›¼õñv´ÑÝí÷ßzx ‚ÍéÉᄌ#2#2@ô `#2ø#5kÉ€6}V‚¼#2—vû¸•ïtáÓ¹´ã¯g§NÞ÷€èMÙZÎQ&K·wv#2öÀ¯G¡Í™zuÐ6ÄšÐ×£€P"TÛ¨!)@#2#2z#22”„Q"·»´Ñí IG>¾û½ôúÒúî6ùö}ͽ²úïxzójÔ”Þí==] #5in˜Vì6î¬úy®Ž^Üè Ýßbò«G}ìô5³Ã»Œö=ªv{·‹Jï}ÝÑ·Û»}E|bÌÖ·µ\>}ïO7ÙéÚÍçsÈÞÞí®ö£Ó½÷Ï#·«ŸA•;µí½tï`†5ìØ=«UÜ×vwnÃvnï{ºÆÇo¸ö×tÝ…/e1‘µ’ž÷9J^íç”Àõ P:`#5UìhIT¡Èq  .æá%{5Þõîö£ÞÁÛ-ÜjR6ã#5÷•¾ùëÌöè2z#2#5C¡³dÚ(¾,Pnû‰;#2χoÐíÛ½#2ñ–ùÝõÏ_MvÝﯩ^øèúå×]ÁM#2T§ÝÁÞÝ>÷{cÚ;Áé$Û=û˽Ý>Å»gUŽáÝ»>çyí·n× µ­'Ýï-L_w}Nð÷Ž»;W[¸­ŸyÓÛÔÜßaÛã‘vÆa¹l©v­×i÷™ÚcÕæÞ¥ÙÝÜmn6ÍØ‘÷}Û×o¼½¡||lfUÛì5Ìï“7ßg¼ï®í{¦^ê÷©õ"ÞX°âczeö½·K‚O­#>tu-:º%¶½®Ý£w'vf<ê #2næžcîçÚ÷Üz­°ï{+† è#2l`Ú‚FÍZj#v9q£DÈ*‰× œPï±Jó–z…o8çeÍiÑy«Þ†rlÅ*±"ªóp÷°©wªô³Ñк.³{tuÕz@#2w·m¤#2¦C¬ÛÛ—£ïw8ï»W¯sv[î5³pÙÚC[í«½ÏyÝg;³âîϳ+æÞ©7ÛÏçˆ[f¨5h2Ñ@ôÑCʯnM·©_vŽûé°vã¨o`n´Ï,êz½²G^ݬözwßk¤}ßrЂJmígvÀ©SK«mÛ-½ÛmêÛNçMÀ:î½mÂí§YYôÏVµ} Nßs7|€é§yžÙi’Íôì…žÓâîîÝ2VŽ¨:(Ó¹ª#>»Zálï:7ÛyBm½ºGu»5À^ðw›JÐÁî¡œ‹¯yoÎû}#2=³ =$#2 zysjØ #2C‰¸÷¬;Þï_q+eÎÜ#2…:#2kÕ™ATÙ¹ëµ\îÖ.À,çtño#³›ÝÕä5–Aªõ¸ÞtÝÕr·v´à-jUH7vp­.κK»›Ý‡6Ùn»ºêÜ{”·w»ÍIãxyï=}Þï—a¼ùyÝŽ—kÌ|ô2ªmcM/\%/oƒBÇÞÛ¶Ö国jç±9XèëÑžÅí»Y'MŽÝöáëâêçͶ•Þ6(k¾·{Ã×Æ×ÃM#2#2@#2†€@4Sò#2šš2SÍ#><¡å#5OPÓ@MbFdÉ©ú JhA#2hÐ0§¦¦Sõ4ÔýSÐL€È#5#2#2#2#2#2#2#2#2$"˜€F#2š›MF‚zx©?I¦‰å=OÔ¢#5=G¨ÓÑ#2#2#5#2#2#2#2#2#2z¥$DÒb#5§“M êOL4ÐõA£Ôd#5@4#2#2ÓA #2#2#2#2#2#2#2$„  #2 i DÍM0Lšbi©ê0§¦§ª4=CC@h#2 €#2#2I¨ˆ #2 `„Èb™Oi¡êzƒjbzP#2#2€#2#2#2#2/ÿ¢'ñíª»]üˆ×2h®î®kšån\¶¹­®iÝ®oãÛUv¿‘mUú–Õ]íM2¢#I²dÞöÕ]u16¶Æ²Q’€EJ€Š@Í T¢‚’#>#2'¹b¨g×÷ýßgÚÚßv1|¯–XXÄSàWbT<‘0bRU#>±OŒ=—T•N ¹ššº{ÂVJRñr‘¹‚n]<Æ1|^õ|æ&WR”Wü‡»bܾk,œ§*£  ¯xÀ#2‘ C’”¢¸À B€XUçÎ$$Nq„0Öyw×’ÂròÓ˜ÃÔ^11jªžï8‰ÅÆ.q/R­E'Ä”U]SL¼c+OˆW4]Z+x»eQŠu“÷Uv¢bª]ë Ö bEýSª!ÏòQèA*ÁÓ*Ú”ÜêVÕM¶¬[Lµ«3XÕ¶Z«ckUB( LœXh‚”‘Y#>Òj¢½-V¼Õ¦µ¼–Ö“L¢(ØU¦#>%*… ‚È]䥱X©—[U5»Î¯-ª¼¹jjÚÖ­÷­µµµ3&H#PÒšl %&)6¦bfT$4` )F”Sm&ÆX´RLØÅŠ 1£%´ÔjƒBÚ3Id¤H#5$ˆI#>“ M¥4#2mKbÊ›Fˆ¤Ù-¢(JYiH¤©mH`P²Ò•Æ2Œ©š1i"ÑX­DhÒl°Â(HÙ%,’–’c,¦ØÔÓdKimlÚ«F™‰,fd™"Q`d²jͶšmjf“Xf–šØËRÖ)²%¤É ˜É°)H³m0±±RhÐi‘¢¤LmQf‘¬RP’h´fX¨¤©„f•Jb(Ø„!A"$°„e¤dFIÒ&B#>Ë6f„‰"e(’0ÊA¥KI–#Ff$@ÒY²k&Æ,L5"Ë$d²‘¤ÚSH&Ä”™e4ÈÉ¡¤¤É0T”iˆ±“i$”‹bÄQ3"m&,›#>c%D›̆EˆÉŒÓLÂÄ[IP (‘Q°‘ØK&ŤƉ µ%QIMD$ŠhÒe#02É)Âe ”“bÆ$ÔY›#>À‘¤ÔÂ$˜„Bm)d@$‹±$YfQH³$¢lY™"MDÊK21J3dL*šbHF”¤6mRA¦šÔQ¢•™RFÅ”R‘M$ÄR"0Ù¥#5“!$´ÉRŒ Å¢¤Í#hÒE4ÑQ–Ô Q%”L™3Š£M&D°M)$‰LÑ¢3 šÍ-Œ¡IA°F&”‚AE™ÌŠLÆ™S"Àƒ!–RL©™³-”Ö3LˆRÅH$ÛA4†B‘i3c¨S#5³ci#Q¥† RRI²EF#5&ÒÍ%f‘©š,b‰(ÄDË&d‘TŒ¬R³C5ˆŒ *$¤Û52i™!Œ±…M#>’XØÙ©R™2Jh²LLJCdRFKHÓi#>*ŒeH„EebÊƦ´RIh‚Lh5¢JÚ4š"E#51°&1F …FšdM Ó1˜14„ÒT´b,i™bdA)²R˜²‚Se±šP–³f¢¨¶K“Y(ÒjHÈl–6‘šÚ1¬b‘6„IH†63 #,¤±¨“a¤J%ˆ"´¥‘„hÛ`Ó#5 3)2¥ˆƒ,›"2˜$R”¦“JcjBi31%µ¥¶Ú0L¡53FS#Ë“""´”ª,Ñf),ÆP•,ÚlØ‹™X[+#>)±J"f‘¤&šºÒýeo"¦öZ×b(##fmcck©2”¦a¨¥CFŒ²²4hØØFÉ5Y…X“2™3Td‹Jh S"Ùf&f™l–±F%%-FÔRŒšdR©–fTl,j)ŒÖ2dË3&ÐTl«HÑY²„VÉ–ER©d©…6lf35lh²"¶M2²%L²›Y*Ëe)M3Xl“CÍ#>FÔj4JËVC%-Dj“m±cXjŒDbÚ’Ú6JÄlUETšÉEj-‹E¤ÒQmŠi1,–5¢ÅŠ-&ØÖ£be£m€ÖJM 5©h#2i„”RhÑŒ…¦bJ¥RF’Ñ¢6˜‘¶5I6Ñ«jkm–5 „Êf¥¬š$Ù$"RÒ66"-µ*ͱŠSiTÙeR––©’L¶Ól6DÒ•f¦™´BÚ&™¢•–,)Œb¤Û+"¶¡¦4$LÔY"CcDX°I¦`b$H†²&# È5£je¢†KQY&š6Lš(²16X¤Se hÙYd)AfbhRhÙ¦`c0(´Zd„ÈÓ,©Y1Dd5¤‚)¦I2T…š)0I¢i‰"e&ÐXƒID†ÈA“5š$¦E1¤²Ê°•˜#F“a)cBTšˆ¨ÈAŠ3-F(Ù”’Q4`4Ì%¥-Œ’i…dÑÔ›%„a…’,¨0Q’¨¡ ¢˜f$ÑbÌ¥L¤¦Ì¬È©*ÅdSE’*0ƤVQ³ZLÑ#5”¤Øi–6É)IV6Œ„f™‚M˜š#&¤Ô™BÅYM1²HReP”ÊÆ°Z„ÔÒY IšJÆÈ i¦Œ•™VJ„Fšf e,&$„#>)AÉb©¤Z(ÑY¤Ù(b&"m$$¢ØJŠE«•¡¤Â’M#>E’ÙFÍ1MFÅj#>Í6,†eX¨É%,¤¤²DE‹Q´clZŠÑ&Š MQ ±Aš’¨Ô0É#5BHÕ)Ch”µÒše¢#jd–ŒTXDbm6Û+ U%£[&‹%ˆ¦e‘XÙHfKISe%3j±´ÃEL–Å5FÉ,ÌT`Ù-0¦,ÒÔdÖ+m%ŠMI¥5J‰cU*h‹X+J"‰´‘†6T!#>I`Z6+%b¤Ñ%‰6Ì©#>±µ$)†SXjÌ „Tl¥³-1ÛY#Y4›J`¤)¦JÆÆ›"Š5Œ¡jJŲ”–6LbŒF4•JV¦2i-,´Z*±%kØÊQY-R …ZŠÖ5%)ЙÈ̌ƚ‘”53d™¶ERXÖÉifÕ%hMYÆ¢ I‹V)•M5hÚ66Ú6¶¤Ìe–j•‰µŠÅšTm¢6›*)M¬£LTLd2T hÑb(’ÐRmPÍbÌ©#m’¶,šÒ“#>Ñ¢ØÍ1¨ÉF¢«TÚÖ)*Q¨`!£FÆšIVaŒ“mbÛ™«hƵ–’¦†ZÙK&Úš›d’Ú“MXš2Š#26’h¦ X†M³RjA™›,ÔE#2TF$“)&D³©"e!dÖŠfФ¿æóÿ$ÿu_åmR²¨Ý2ÿ‰µ­è›cÿ‹þ:³ó’ອ<«–/ðñú¸Úò“ÉSÀ‡ˆ åìóËÈL½ÝwãÿO(~û'Òæþ‡/JƒF“g×8ÛøýØÞ9¿ÔÿRÒƘ5#pd‡æ¾#5TÚ?¡ñ*G _áùg"4˜4Ph\dÁÖ%Ä‚NBH†Û܃ó~_ºðýì¤gü÷å×ø£Âñþ«m¦¼2c=V⥄ŒEòsL?ѱmΚUƒbö®¿N##>ç:†6 Õž™ìâŧlNnÞúµûØnŽ%Øm݇<–"ö+vÍš“ÝÆðÌ"”™i‘ªyåçÁv7§zk¢}Ö¹ääÑ×dï;¤&$õËמ•z—‹rÎw6_Æuçáu™Í\‚M‡ÃµÌ›oƒÉš3)Û.e’#>dY$HÅ ³¥®ÄdÂÆ1óŠŠ°#²6¡—Źi½+¦É#2Æ#5¬¹Cóa4à9ÖªžÛüÔ¡þŠåòzWÏës4F‹>N;f¼š6žL¹QY¶iàÓ²!¶› 뺚0˔ђJCº†¨d7E0oN0mxÎœG„‘†õ(ÊÑÛѨ8šë•ÞwcrŽ•Ë™(ÉtºIæGÏ}¿5¯W®×øwñnòø®·Å]´÷ºí‘¯R¹ÒÆÞ[×~5lÙ: µbÁ]¨¥ZM?+ ÜéèYø?=$mö`ÆOñÀžèuehò╳P©=v¿¹Wªm_·õ»_3ó/‚6(ØÏ:ú`',Ð1Õùha³–Ø/Ôd¨Ý,uBÒY÷Ô®Íî_pýœ˜á_gOÑÏfìökÎõâZ¯ nÚñül³Ô}ÙN#“«U­¼I, òE¦#5„eJfž_ålšÐS<ó:óÚóµB»èCÑ”ÁN-J}Þ=Ÿn=No‰ƒg‹ÛÁ® †½õ%$EQ¶@¤'/ƪ#†d»S½8&uj#>M#>óLYQNÄ-¦àùPUéCËBËL±e2ZT#>)b#ŠÏL_Üý1Sª¹d]š¥•T#5'øä¨q’B$Úy"¾æP¯´SO—Xy݉Ý{wžb×ÔÞ1oN˜Oîdf#â¼îÒÅ‘Ž‡Æ‚âéZbbõ|XŽJ#>DËNŒ¶ñC@¤mƒÓ€Æg¾"YÎí_§Éü<¢×+´TT~»^›…“hÞ›W5®mü§êw©Q§ßu&ײ¹I•ßãúì;3DPâ’®¡)š²P+z_ìyµé¬†1IšŠOvàM¸#2 ÔiF#5¯]€Q›g{4È÷´¹ì®dÕs\´j£F½wço^¯"âì¥Y5 ÚíÍ‹F¿s6¯Ïž(÷»ƒáÝùÝq‰_ #5’C Fs¢õÄ´#­U Û”lm2Uö›î¯$cPAzšQH¤SÝzrÅyéA²L6˜6EQ Ž1¸‰Wd#>È0lŠ?“6ˆsèPjˆÆ&Õ­š3ðI1SXÓñº~.ܬÊQŠ@;*€ÙóBÝê…¦Jë®8h‰’mÍø¼Zó«“—L¶ûOO#>4^LžÚ<Ývª)”1IuV”õikÆ­doçv©å¡JoåYNNYzwÙ`ãl%¢ù]t_¾¼oƒ–’Ñœ/ ˆd´(þ1FŽí‹lZakíJY¥Â„ڨ좧ԅqsaH¬XRW®¥(ˆò®C](ÂtªYÉ#>2o:â«øéaïxþßá£~4PcêõW01¦¼$n±aÄ›õÅ*+G“AÃG³^ß//*ÅRdÌ(Ì)OÏî7®×Üó¾Îõ<Ò]Ë«˜™Îà&ÿ‚Œ/T7ÓÑÀÆ9€WæîZù;ºÙ5‰š(ª¦’j–";58´¦Õ ý÷G×Ϥû¥íR=¦~}jgßëo÷?Ƴ#26“k]ÎÕõˆiç».fM±i»# !¦‰cøZ}¯,ÙÁÆsÄG“à°Ùùç9\?mnùœygl¸:*|¥öÎÒì…KÂ4‚–Q)6øVÎ難ΩԧJ¯:ûœœ(œš?¥Sª|yß<|+ƒ©œ)œ+­•×€ïçZ⟷W%óN¨Yœñ'–³™>ßs¤~zqšÐ2@/&ƒôïfrC*Â3àÈR›#5¾|µÇ<-ƒ#>Œ­Ùl,>ö€ÖÕf‘t¹l÷VëuÅêd¯#GáiÓ<³¦ZP—Å:RâzË’Ÿãu%zü¹Õí|­Ü­¡[Á¼‘œ2á…mÏ#5hôÛÞUO¹R4?ªc²=vÃ~]n07¨UZŒ½Ë2”<*ܵ²¡Í(I—(e¨]§ë¾8íMqT®ÚøÛEDæwéÞç#Î¥*…ñ:ÜUyLý©ö÷9{Dg)×k¢2½ ztÂ,#5E5M{êaæÊàémT_ƒ:íØ) P~G,ä†0#+‰ÈG¯³#>yµ×Ž5ƒbÔ¡ÁaÑNÞ“Â&~i×—ÞÛkªJD›«ðåV°ÔhWmnâªR¬v=wo>¼°MZÅB„&סqaàÊAôf‰k5g •‡¬Œlo}9«Ö6qÃ¥­Wÿ’ÈrÈÓÛ›h'Üíîd]öªûµù{n²rÑCjáfY}ãoËB‹i6RÄí¢EVH"èQ@4ÀÛº#>L´hû.W“JµT¥U#ÿ J2,#2Ïÿ ®oßøºØœë½¸÷"*/Íúc=­}ÍE}Ì¿MxÇŽúnÛô:ëÄd‚ˆÙóöæ)óe;ÏYî¼Eû´~ôú*»a¨ñ»úZd=”[ýlÀ£8gÎÏŸ6ž8—×¼£jU=+êf©„|¨â·‚ªÝR„›#S£ddŒ3A⪚ˆ@ÏÇ›A¹÷^¯2$0¼Þ^0#QëUk=.˜_³VâŠÇ#>0“u.¤PýŽãߥiR /J•~¯|€‡×š;še¨õ±»##l„?R®ð%æS}ý†,Ò_ӡï¯Cùa´*?€w»¶ä°dGÓc°ã&Þþè­²9H}Pë4äyk8YÛ#ç!:ˆA›ï…Lînò>zdã¶Îšùã’`w0(ÞŠEE6hÈÎ}Ú\_]PÅàUe c‹#IÛW~j±#>T¹ã ,DÆ¥‘y¡œ"%"P2§–ñ¡r„³~½qÞ™ø2åÊ}T­Ç‹µÔâU&<ß„Bm{ÙmÞ±{×eœí2r±ž&Ÿ7ÂH·XPµé*¸Ž)è/}*öwFi¸PÚhg¾O-ÞIqwÈ„õàü2y³«/ÕÇ7}l/"PQI+E|gÞõ¡‘\L3/•‹XŒAhC²÷½tWšDMkן¨çfÇ¿¹ÓäÀÃÙúM^*éQ‡»u`έ^˜P¼JÛ«S#>ö¡J‚(>I*¨¥Ô׎5ŒÌDQQe2˜0ôüÒ‚Û{ª©FnfJT|3×¹ˆðÔ/Æ®ì£Á£›ê¼:3¬ïfHeñ¡ m¶¯ÛU’<øÊغ=¼qÇzTVp×GX3>ºwx¹q~IÚÍB‘µƒÖ¡Àd¿SFÌ¥HˆÅã@SŠìóÄåʳ¢q³ýMhîáPÐmÔŒ¶x0¥ÉE$ÕR‡#R‚„d(¯œñÓPs”ˆ0iИ‚@éÃ/Ïy*¥2Ï¥üKon»`„H.&#j~”ÿ,‹ƒ–®Ïí·ûÄÝŽ‰ÀíÊãîõÕŽð½ÌðÔÖsxQŽ'©ùµ#>i{ùÇûa§ÖJnRÑñª=MÓéwÓ×YÆ5 HŠÄÑRáÁ¬E£]3±àOÿÂôî¹Ýç\ïÇ2ÙAx^ñM¢gV+ìÅk´;=b’1ÝÛ(ñ1*`¢¶sÅRRÍqýÅŸå¡Ë¢¨@ÜÚì…2,Sì/[Ò¼Ù b§u×ÑÛ¦š¯ikUéaôSÓºŒ'*!óÊíÃAe’I§N£|9tâ^ï¹<ÎøÚ‹M6ã«ø¸Aºb’A‘T)Ã’íÑMk^Eß#>㜙‰²¬"ÿXÑ’è…ص7Lµ­°_Õ’6ÁOc_»-ñw[ÖF#çìŸS]†-îWGß{é¶~`êÝ.UMfPŠ©¥† [¹ý¥)°ïI¶•ðC×¾wg5…#•¶\$ëné,iµ>­þ~Úé×{8„~¥‹—{rë^û¼¿‰Ï{VÆ„Í(µº MBÑéÄ$ß²"Ž´Œ7OÆéIÀµLÁó(mjNK¹4J\u:¿O¨ìïWG§ª¦µ&AÈåñgÙ|:ª];י̞?ÛwT£˜^E^¶ž’¦¤®ÂÉ°ú¤¢8.Ë\Ô›]2/‡|8{ýr3å Ó¯©AÈá!·Ó2Ÿ‚ƒD^nøܵî×5½ä>Äà›}|g³Y±å_´íŠ0ã×D¶0ÝžV=ýãæj8z(½,m¦ó-·ð±yq€ñ¬^÷ö¸Á­Ò¾xö_¥Ò‹}+µ GW*vࡈ/$†$n–M™M„¥H´Å×Ùw½ZvfˆzÙö¹LïVfèÝ+²ýþM5y‚ã{’Ù¦xy Ù@isoã>èm2L‹goñrÁîi6uå‹%kxÁCzæåëûþÜ3Z;ŸoF,EŸÉ×K{Rª¢tÆ4°’ÒÇIbc»ýÔT ð¬<ÕðrçO ÉÔJˆqºg4?ÙšžzÑiþªzßìƾ\u«Tôvf#ü{ïÝÉnyæ÷\ñÉ8L„¿œv_W_§žØ´C ­œ§€hþH)êà/ö©ü&ÿ¨ÖÍô÷`Q•Ÿ[?T¶¾»cµ팴½ÇW."DÊ]ÒýîÜ¥¶¥»jT0j×6Š»j'”¨ýúÓ÷;ÞE]wqƒ ìÒ‹M›eU WÊ­H±E_CÆ?£a<2+ö¸WŸ–"Ù?S ˜‰IŒØÍRW>4{ðúhü÷¯¿#2_Z;^#òªÏD¥$b‰ä;^®¬½+D£mouDzvŒ©Ll‡w; Ù4 ÙöPÎHf³œ:Æ`×-ávÆFœšµ~–Úåu3M%-e(Jdñgör×wÑš¼)(C§Ö"—e¤tîZ÷ÛçhÚn6†ÊÂzÇøPÛ"‡%ïdX(–*–”bS2CŠYbÎ*ßR¸ÿrì–ý#>? ‡©QÞ£z63ļœËÅŠ¨àV›ä~˜iÉn{sQ¡ò´"(Á[Liù˜kÑÉö;6ˆ»H×J€gøp(øf):öø±…Œ.¹Çúë2“B…_â­Ç¤Oð2]bÐî‹2—ô°—¦­Û6’++wkIÁE>¶hã72aÛÉ<ö‚ãbŸÇÛ­üœÃÚˆGNæ–cˆj²>_ŒÏ8 $.âÔ9÷/Xvã];jn7‹®jÑ*ˆ[Ãû< ÑžÛü"Y®ÐÎ"© ¥ã‚‚çK:渳½Ðž´¦“àÀÑžaÔo”¡c:TÃ|*½zõ/n·BKgñó>¡cˆE»K¤BÒõ©iªôé¬ÍR€×¼9##5«S y?;Šþ §NÐ}³™œCØ[fPnH#5 p`¹#>’sµ@qsÎ ‹Ñ‹×æâ×7YK ˇ ÓÕ=.˜ÇãáÆËeaÜÆo5K3Û'2ØÃÆ®täRçg" %`Áj_,ô&L’ʉpÜòÎìIiÚ×_qó7¢³|¼4e¯‰g,ö¸Ï¿ßäº0¯#5ØV^c9S$;ƒŒ×V#55–í5zƒÌ©¼Fü­82£Òûž8¦ [í®VS$ÝÑ“,ŠKfÎÌ€½Bƒ5#>ð«b¨*T‚\p¼ž*<|[o^½µÙܬõ¡uú¬s´>MôÂ,زäöÒQ¤È©òº÷åà'†­–¬º2m|p¥ƒ˜±só¾¤YÂþOéÛe†¸ËÝoÊçáÕÒÇÓ•ûêA–¾A*~ÝM¿oæO×gA¿Ä¯ù@=ºÓUèûeÿíC­ÿ‹þìê»±`ÖX87 °28w¿'9)(#xhLÄ};¢Î2;fÝO÷Ð&ò7ÂK×éœöø•ÙY®—(#5¢êèx£c¥l®/òÉænß'ø­½ÂÉV¸)¼ámË횣òœÉøöœgæ|oÌÇÜ¡„0‚#í KÿÊŽÿNvTꎉ?ò †þ”°6Åw4æ DäÔrVäXݵZÂ!=žˆA¥AHù(Ñ¿µ·ø3R»Û·;f¹ù{ç×¹Eäê±²!Úãs×p‚ÓKl‘ CkQø#>[Ð"Qݼ¬{‰õê[œ¯êpØú+þŒä8ð÷#2ß{Æ[/ú.ËðïÏÄFfÐœR»Â>û0ËóÔGýà-J‘¿DvtYËÞÿ nȹÀ%”"ùMÌ…ržý.ÏëÝ5…;N´z}œì6cÚs26Ñá@>‘aUñ0;¯µ#>Žûñ·€D#2#>ßò„@/°ÙÜÐ(‡OËýX€°S\È›ÿ›ëá­€n/DTåPG‡2¯wª¸D{Šuþ%}Tgacx´Ì`kÆÇ ür•#5”À {…whü„ËuZ‰UoóZÇX Zw~ñ›òÍGb! À#2ˆ¤ˆ–6½­k—û9úÿ£!ùïéùÙÂÑûô:}ø¯ì››6fUVfe%T¨Ð–¡j÷“ÈóÆâç¦<Â(î/N•ØZÑTÿ«·N7–Ü[ú²öé§Y"Œ÷QÀ$5{?÷Ë'¢'ð:é‚vëüMâa)‡r#%#5Ï#>¡™AB3Sè},²0#2Âçî°îá¦kKÉÂjÒKµh:gÓé¨_.°ætíˆÎ üÚo%Ï·”Úï‘ü^{¥¤ ²Ì°D’B˜#"¹Zh§Ç6ÜßÖ}µ9×ÑÞééêI?2üH]I¢!´¢AaQsÃyF;ê)}FÄ/uÃOè¥}`Û™&4…Ç]*·úŒkRj¼cb‰SÇñÿÎù€˜Xú=„€.zÙ`¥ b!ÏËð™:XÛžÓü“·»ùoú¿›MúrÝ».ŸÙûTþ|Ð>¦ ìXŠºÄShÖ)#$c]gËß\íoUË5≮&•™bÄíwR‚Ý”Db¢ïë¾ÊBIÛ|´ýë¿EϘ)’ýïÊ(¬/G+²5ò9#2#5~: ãTkˆŽü’ ^È${§ûñsÆfØ9ÍókÚ>Ÿ‹Ñ‡ lÈwC}¾Œ7=ËQêÍÎPþ7&R5‡KŒ¿MñGÕtNŸÀìýz@þ!ÔR”~N³mƒ™ã³äå¾ýØuÊá” G,¸ó¨¤,õu?<Åúô¹É$#5kÐY]+€ˆ¸[<šÎϷz—\QCˆ¡Á¯"«æã/UÍæS€ÉZ Ö–Æi›àýFCñvšðK2n”E %#>}˨q…·zŒ)y°œã‚mãaÓ/.‰VòCº:IÙMûžpw½Xò,ÑÕÌâpàn6 Råwëu¶Óì•¿ `c” Lr8Y£Zh¿¡ëÂL^2`4§úœú|S»ðÿÞ?‹fç]§„¹UJá¶HLÔÈwp} ø²Y9î\ R4•æöîS‚f/ìž!×~~#½|TA#>kµáÄMdצ‹*°ÝWã n xæ#2<“JšÞzHmª†h~!Ë^§·^üÂç ;d|ÂwÌLï‹Ûýiž„†#5·Ì‡káÓS´’˜I7¤éQ ·ëíâ¶úaý'ÇÂbz‚ù* lO¤©$ÝVóþËØö›7Ã#ôo.Ç÷ÿ†å¡D9¹NLÓß[#8IüwãóVÔ #>þ0Ð%—t„!.¼,ü;+öêa³ØæIaËʲ/—\h4m™îÀÃ驳;‡×æ<ðpûf7ÓQ å6›=á%·ÇäŠ$BFšòãª$„~£AbŸ:ªá’•ßŽ<\8ôŸÍOóÖ°<‰ÑŸٜؔv퀱ZJÜîü"Ê|;O»|SA¬4øëñÁº×¶[Hå[#5º“œv€Æÿ:;H¬.æ…©„zí¿Ò¾^ÝônÒwa6ÄgáMI½Õ#5¡Å‡¨•Ãïwk:¾rýÿÌæy\òp›ìéq¾£º}½÷ŒE÷‹$4ù*""–¡!e©7ÔývS-Ô¥$v^߉„ð6QÞ·ÚFC‘ã •Ý|5½¿™§ƒÓ“'Õg€Y¤pjØ_­Tæ¾zôÚ­ê,|Oïý|ù×ËÛЮ%H~á@>nvFGBNX2K$ wˆÔµþñîÕ'¤ètK´z7å#5B˜×ÝU*°"ë%YIÿg»Ò±‰7êi¾iÐqïZk¾-‚—ŠÍÛeÓ˜òÆåÏŸ–FGñòÜnq¨îJª#>i%n¥pFF£1#>5Uô†÷êú3Ï1ñ¥áÓÓùsÌÔzéí³|2¥õûæQUùlkòë½Èã®´O>fšdŒ³—*¿Û °í˜ÂÉšºJM`ª#>‚JòζÊg2Ë^~©žAˆRæEJA.õâعáÞû+¯­ìàá`TÛ•ÐHÄ)žJ!z‹Ðy]{Û­†J…?'Ý~?@¾¼Õn^xÁ ´/#2…„ˆÐ_­„À’ m…wÀ¾\0ƒá³MGí9¢ H@AA=Á£k…Wa>§éÔdLé#5ˆòþwç²Ã^#5‚ísã¬WXŠL“P²#7ˆL ø?ÂqÑžxÛbaA•ºvDÔ (}ç_†4Ô–¦”LȈÅöÝ`z[<¾?,w¤)pC( S¬‰R˜ìËC‹îS#>‰–]Üã¾me¡JˆŠBŒG2Ì(®.‚„Y(Bñm6H‰LëãÝåÓew¼q¦>Îû쵆 åù f­4§õf ׯ[ïyé#5…ã!PE€ÄU„Øe@ñ^g¦Úp®>&ü4¤h®ýhï6áo#5wåñõþæŽ`“‘C»RBDˆ1ã­˜ §”Sw½t#5 çþ.x(¶›œìÁ€Gãzè©”ñ©µñ«²'¹À£V{YSj×B9½°jK k9ÌŸ´T‚85=†à@€i5–¿—C;9[É ˆH? #g8•eoLL!{·êhÅgjè¤3\Ü0€mY@(e@'LZD8£#5Ò¨ÃEµ0X ûÖÕi$µNT·ZÑåC®PðZaib„Î]µŽÊµŠ4ÜÖØqÌ#>°™‚BÞ«#50Ï&3ÞQ–R™ÅC”*ì[2¢‘Ž©3 pÂçq,‹ˆŠk RAÕDeª÷#í#>BT.ZIÈ¥1v4QÂ¥¤€óY©¢¢‚„i,÷g&œî#>ÖÉh„L¢3´9³›#2õ'"òUq¹ö ÕdߢV”±êšQR[ @±Úý§gØàÖ\¨?W—^Öûb;£$B6™#5ãÎjQÁêLꆄÙyu­ÃÑ#5PlQ m!(Ä94ù¨ ‘Ä“«YŠ+ÁNÇyƒN˜rDrlD h¹Ùꦷ[#>„¡æeçzcãóÌ KšM…#7(2\s£Üøøa,u^w=˜Ý¢)HHâ•ŽÎãѧÜ#¯R¶6õhãqg · ¯¯M¾ž«Û y%ëÞî€Ê÷r:7UžqVY6ú²‹Ÿ<ÔvΡwæͽÑúœ˜OžæqLC ©SG„±Î‘#2uøzvˆ2³©3~<ªÀB_(Vi…ÔƒìSÔíPN½ï««ÑþG¦ÞÏ2óx¸«S‡S“KÐrvÖ“^#5Î='s¨À}pHzïAZcÌadž,-â/4R÷¤ª °±!HA´ÚmŒÉ%©‘H!•ÀõÎã1€Ó͹h&”µþÆo'Á8Œ»øÙ¦oîÞ+\¯¶j—º:Gzûfø‰ˆˆ•’1)(±UD`Õ1\)ŒcM…ªÆ4d_)ç‚Ŷa¥BâR ‹M!€#2Ú#>Ü£ƒ¥‹{† 3#>ϣÿIª¼¸Ã)šlÓŠ¶ÃDˆ’6Œí±pnrôrI¦îœXe/&ˆWöúÝï6~Lˆ;kEêúĪUª_gRAB~,1˜vÁ€t!ê.Pã1¶=³e»gc7|4Šš×œUÄ¥-;¢ךrÃ#> *…2-ù¯2uAO5XIr-ØÑ|srÅ#5*[{¢S L»¤)Dˆ}‡Õ?>½âò…–##”K th…¼}ÿ +éå V–Ð=ñ„Å1QÎ2•÷?0©6»n·Ô<ب\É#2ílH“éDE±ø[ ìŠ  ?V‹b`,\íD@‰òM¯³Hç¾û‘ ÛPà?MËÁH«c0Z3n7þT#5X ZN0=Ê™°1{zN¬Ó«9Nrµ†þtyàÍ­#5Ú˜¦Èé˜JÞ(C’õ%Ö…hÛékD×NÄG9ÏÝ#>ÇÒM!¦¡i¶±X£@âÖ#ü1) x\P–‹ºt¼¦ð"Ã"È#5æê\*1"'·?±dؽþ•;×EGîؾ}7ê7ÒPÙ$¦ ¤¼WM^˜µ}Jó߶ÜÁØÙJ5Ôi£-{%Ý«D¤‹‘C) i&¨aÃ%Ý9©u¤Þ¦ S‡PŠ4Š5XØÛˆŠ#2¡#5xÔÛk_déôÔå¶8†#5°ñûôq˜|XÃ-­ €¹ªÕ@âã­º‹ vbÃIÍ…jwÙCUÆÆiBOq€µÖ¨4,÷?V%äà‚"#2•ÇøS¯´6í¾ÛKùm7½^À0#>íÆK¯í$¶TÈ8'”gâÙèOÛLiAß‚oÝ`?ŸãßJ¸bé@nøÖሄ$L Þ]ú5“{sH :mv ©RÝþ¹Pûÿg ¢>¿-ÚC¸XÊÞQÉÁš{˜8§tBëàà€’˱öÊm7P!fGÇ*[E2xóÄî‘%‹œO;°‹1ÆíFc–ÆIpy¹0aôì=W<<UK–Ö§DÈ>°…–®µA´xh—pØ:ÚÆc=˜¸;ñyß–,#5³ǨD*''Õkuƒ¾ íx²‡0š´ L©â$ß&Yµû âvËàØÔ „Œ§ö¿t˜¬¾gQµ/^écÉõ~óÛ›Q/‰;™­Æ;ù.øÞÑ!´yŽËÍ8-;£FðG•ç1O¥2Û9æÐ 3 /ûVùAµnúڢؔ43¥²k†4}»(¤«ÄÑŠ³Š`¶”¤ÆÙ*ê˜÷CˆD#2 ÃfržÓ)$”7ÕôéoêªÒTýE„' S‡…Â}ÜkMk˜ëŒ0ÒYe¥X¬„Ä"bP%Éí–/T7=ÈÛNæpìh^¯rä–M¹f¹<Š¶X– ˜ÈëÚÖ¹9‰í?ÉnºÜË iJk@:2;·x­Êf3yÑ6Ë”1K$…¥;¥ˆ#d´÷ŸpÌ:y(*P\B¦˜_æ_°5¤ZMP´`ÄNÚ•É„Òí?Ù6)4SeÃ)ÄFê ‡ßÑ~¹>EëDè‹Ÿãùd¶8uD$(E€±È„jך¬ÝPS £M on”Öæ É¡•0+#5©qY% ‹2]h°†„à:ÈØ6²R(ÇH¢Ž y’*eC7ìº5"e‚J(ÖZãANP0¹HMYHÜ ;0Û$¥"ÕDc¥-+GBŒ&Á™"f7E%Ž!•¶ŽY˜eUìhA´Þ21H5–-²$›1 Zh$¼êQ?OWÖþzƒ6Ì4&÷n/â(¶Äsƒã4„™UE ÖÉ0­êÝÖh7#5ZéÎ$ ›(Ì\í&´d¹N0Ú¯KV Û'®·"c¤lòÓÜ~"!yñ ã全‰ÓnÙ‰Û˜Yš\ðäb¸¤‚¿7.EÂ<ó‘LÀu~dúVÌ™F§îç’y¾(ß±¡U çªÛH#5ÆE,ºËB)*ÂXÍ2„4Yîªo¨l¬#>=œ÷]k`ö“7Ýåïƒ)ƒ†9#5Í"6=ìur#Û·J6ýg å .Á‚IÛ½Ë#5tÄ(ò;¼ìÅ<8žÆJXR,b)ÓpÃpäZ¥þk—ƒ²ÃÄk¼ÞM‡Lµ?Ï/fÅ ”ì9G”ó½ŒJ|Óé)âäœpKG/¸ï’Žz¢ˆJúÉ;2¶çe³Fº}N#>&1õ¸ŽðéÏ+ñÝïcfÐ@‘Šís Sž¯Ì¿Vø£¥é˜þ|ûyRL˜àÆžd0˜'gÅ9³"íÄ„Y`ð›¦ýåûYm¬iIsb-XZ 8ÃeÉ[5‰Ì§R/|çâVf©Ó±˜©û_){¶óÛûwáo)þ mC=í ¹Ú7[m¶Wñ ¤H-ÇpÄÂÌÄW³l|>½k™ ÝÞjn¥7ÄÂŒ"`hgô]¶åÉ•JHŒQB³U QC¯Z·†²æšüÈ7 ÃݵÌ80ëlÌ¥¨…+N2)`¯bXÆÿáA½ŸiÊ¥=Ø” Ž¶žœ}›|ö#5žÛ/ý3%ÔÉÀ#%^sò‚Ü2g¶ú8㥵þ?½Óþ圗X¼uª,Š¬`ò«ÅÓ‹Ïm5˜ôåì°Ü‡q¯…óKî&…O=óϳÒK¼|yfã©n¹¨ÐÇž_Éq|‰@ª½î©¿ú…#2×94Z¤D‘da$a–æ­tØ\Û¥hÖå¶é€š¤CÌ,ÄB0Æ2:Ul‡ªÁPDo¨[H»-˜6#5c}?u‡ŸqwÌÚÔ2fge¼,ôî Õài4ýÕÿpð›d6¬§¿ê#>=ƒ8ä.¨ýGõv˜åî_àÐƦ8J‰“›ºªÁóŸ9ò íÚ#>øªB€,ËPw±^È^lñÚ”9bÝ#õûihrû9Ð|±ÁÅ~,z_?VôuÃó)vCÁC†°;nùÒUŒ‹ŸPéSßéÜ>ñË„Çßù[nÎÇkz[|v5#>½¸;ã/Ú'ÕÁL#2òžÍ¼Ì”ÅF„ózqvÅv±å®düþ¬½WvaãpËhÞÑô…ŽµXyþÍkàT"#5A@þtÌ|©äsnc”†ÿûËÜßEõ°Ï¢•xžÝŽÆb Cîb,˜ý3½§Aý_àÕziAý{ƒèdç¥ùü>Ÿ’Tßdûù:Óxó¾X䧀'âˆq¨[Ã#2úŠPLËÀöǧ­þ·žµù߉@º<Ë¥ê.Ò3󌀞~x.ïNÿ?íåYwF^\ãév}w¾Ð2ñ¬3¬œ`‰5÷¾5“÷ÐF¯.çï ÕÆ#¿&ÛÉ­²Œ£NEMT)PC¼®ƒýs|©è¾Œqéêá•Øœ¥xî@A¥ðÃ,œmV³F™=þ?œ5ªýÏÞ¤Š žçŽþ óyÂý~rˆò_ù?.¬ùºÛG°ü#2þï‹0þgŽãÔËñ…PïPÁ±Ø‹æsþ¨_,ü\FÍ;º·èñÊêü>Uæ#>.Ë;›æ@À9±#5#5Î{˜´1rßq(TýD·¤¶Hæz\di¸cýÚ_µoa×¢š×ÚxSö”X’ÒxˆZx¦Ý5ïMØÃrË犇Fg)*¥. q)æÄ9&‘(>+¸ê}Ú/ç4_@ê‹÷=L×y¾àD°ƒvβxѸÛGíÕ»mùÛôýÞÃS€IÊ‚”AŒ92žl÷0¿ª°•µDsT"£VŒOª¯J#>¢Ç½9H̱1¡‘ÌÂæa+q‡Ø'¸@(&ŠFló8kÑ67Þk |g§‡k6œL#5 ¿Çø¯l8ÚÉ7œˆa'ûçxƒ¯W¶5œ4¶â;¯Ø=çÕˆ¬~o)á:Q±ü¾¢Mc²âˆÉ*š¦q³bÀ?¿™tw+íxXö‚~FÄÉxrˆA_7»?å5ù6ð¶èð‹üOÙ£!`[ñ„¸¼üÇJšaÚ‘²Uð{½ÜÆlùYýîê©Ûe>ʘçÛE¶Pè/.øª#>Ú†„RED^a¢¼q*ÄÛcp#ÊkXq¶no:.ç­¢lTÝ%ŘÝÞcsy¡yÕ)ÂËXjs;³`/U@ó#ríÏÍúÿÉùëþ“ùßøÆÑÿýAÿŽRG#jþ¼ýù"€uSGWþ@2¾êµe'/áËôzçÎ#2”ª„BP*SíöÜý•Ço'Ž‘Ü~ü£øú¿Sùµ>oÒ×åÐì‡ÙÖï÷7¥‘EB‹b3ÔêÐE3jK&‰1›*X”_žã14i±WðW£¶íEËw:æˆA´‘åúÝ¢[JüúÎëz>³†ìwÿÀäÜC-æÜõ›“#5¿¥þ>9n)¨º4•¾, A#>–9~n¾ß›Ûήjæ‚.mÝv»FD)%EH']н‰¯Ï§/·§§õllýÍ\¢Í#5¡)á;xuš’*B¿™õÙÔzï“ôVSJÚ¨ag=&`È (ŒPŸàa L‹‡‹Þ#5þJYýdš%‘‚?6®_iZü_ÂêöQ´Þ¥] Â",X { #2±™‘’’¨¡=ÈÃù<´Ô~ÁÂó;hn£m6#ŒE³Q<ÓT TqR¨•ðgݳ1$qóÓhÖ *@þòªf༂¸È%ÿíʤ¬°^Õ‡ßeýóú©ü±bùàú÷´ºŽ¸Â[0ÒV¤Þjê^ÝÿÓ>χÆP¿à¯Ìþ‘X7L|Çyepz8zy׉#2yEê¡B‘C«¥EÛõë×òFÐÜ@P‘”z„Áp;¹Êmšx•|éëô*îý=LÞ(äêµÊü>êæòx#àû¥B†#>0ÀþË“N“M°Làeêמ0eÆ\ yKþ€b×£‚¾ª†,gÓ½IŠ…‡1NâºQ½“ò¡?Kiî´VíÔšL0U""zR#2 RW#>­‚“—J‰Ïg»õO›XûÿoŸæúÍwêý#5ü!îðú>¤WÛÔ¾^dΞÃÑhrÚ}š:˜ÊßÒ5ÌUÞš&–xô§þµÓê¾2éqúãå#WÌ núÖlÁm9ó…ãž­önW‡ãŸz‰ô•dÝ{¿L\ƒ €äAÂ`‘€uíë]7 ©YÏ•‹rç2¸ùtLHöß?l”}ÓÙÙÓ½0BƸ;ãÑgãˆ]Ì»N—,fïîéð†é6ªF×6C«ùó¥¼+¡‡#5½HÝ]ôjÉÀª1œ4wØàYü ¥ûSQ15ã#2ú¾dfñE¥/ëÄ«Kz5¿¥ÀZ#5À€z?ÁRfN0`Ä3Ðgz e>.ü<Á|·uµ1C«c~\ñÍÛœçuï£þ.Ù¦©A…çuû½Ê8ôÉ÷㞎Uñ‚€ªùX8e”¡xèaÛãÒ½oÆV©ø#>~ü‡™]ŠZRbFóô¿´`lrŠUΈrÇKå½ßp±yµF"²58°\`¨¬nŠ‘®_½ Çòðã¤×jÙß[#>|/¾÷r+KO¬üÞ8×Ißtüªõ4³5FêaÍEU4V`ÚˆP$à¤æ§­³Ð¿—ÁD„øÙQTáþQ׸¼‡©&>]ðCÒp}!é8’d¾?§Oãa¦ß‘¿űW&$&>!"ms„Ê”’4@€QäL¼•TDKóÿ/‰ðCè&,þ¤¸mÜÌ£`ÞIõÃçO;LVã¿ÂŠâ4ÊјŠÂCcëÒiëòB}2f¶/ëñŸ‡—c@¦*9”ð4²ÂÀbGüšX %çd C¾Ubw.Ír#5,ˆ#5U‘ësÕÎ|·¾„×O¿©ç.£¦´Ôóµ¼Yça)Ô4¼7>=ó¥ýüº¶ô#ã£KGœ=è“JíK…°¤¶ )ZB_½;â^£‰L\D"HÁu+îÇàižiÛµô7p$<Š#L Ä`E2þŽÌ::»þ?«úþŸ¦ãê1ÝÍ×TßO?´éõS=I—ËòÙexpóø«ëlç赂½vé|³J[]çrå®ÎÇzÙ^îÿäÞ³úxn¾Û [§»ñwìöü2æß`…¯+Ó5øáÕW¶¿î?nÆ©pò7rôq“{ï…u¸17ìÏÏ¡Èv;tWàV”ßÞE£­Ú¿.èÿg‡·_w¦ÍùMÁÁÞltWO½Ço ˜¨é»<ú_N©èçñ×Mžã€ñ½†î !ùÓ×ýø"ÀŽB—€Ò|-üÂ!{4;§Ÿ””ö˜‹/æ;Ó~?ãxä¦É içn–LG’ëe#5×s­”òï‹iÇí{ìÙs'M:ôùß61…µìD¾Sa£¯×«ð]Ë«ççú'lc#55m_#Æ©©ZöhÖ¾ƒLyÞþX o[Nôs¡çJµÒ²¥þñ¶-^©h‹¢E£—æÑð6 ÷ßm»'u±‰­êÞb˜Ñúü2²•òèíaòÆÁ‚]eš´p‰s‹›#2oƒÌ‹œîµsOìö¹ïQ£™cÇLÃÓˆ;-ño凓Aݬ›¥Ž÷yˆ—³×à õ_‡u'¿“e»f–‡Cƒ•“»JÆC.4´îõÙŽUqIãê“Ó¾JÅ(~Þ*…†ŸòºÃnïݩЈƺ¹éÔýñíü^eJïÈñLJÒ`ÏÍçé^ïÈiðyüãÜìØsä4m¾“ˆÌÉÜ)¬gdFÛco¶QUõW~[+îÑãÕ}:_ߨ[VÂÙ³½~Qé_F>ˆé áá+oŸv¤–Kª?8ÀÓð›ÔVˆ^Œi—è×7#>¨Ûñ¾=ÑÑ)oo`éÊŸ‡É;üÛmŠ9~¥)_}SŽ+ô|›õpËúœ…í°ßöv'—÷û¾(ÏC¯·íÔÚö8Æ>—Ÿ¸+º×uÞ‹ûq훣³à¼t~Ot'6V ½šÇ/‡¯÷pÑ#>™ÖƒïЊð!È®!GfoÇ_Á€êa³L—Ú¶“_|è¦/ÅÝ.{³_Š+ò™l±óÍ}ч½ºò¾t¥¹#2§”0k<²³üžö†ÿÉ¢äƒÆ99”{¼ x@[Ï㜵]ðoýµ³·é´tnÑ‚|Çï#æùÏá?Òí=ú6uYDS0á^ÇÿV_¦Ë-·÷püÿxEÎV¹Ý:$»›&—o•¿oæÔÔý~¿í‘?A®^ôBFFWô{0[ ý'ÝÛ‹Wñ|EH¤¶2(o#2Ìhä€S#51ëæò4 ‡ÛñˆUŠ-#2)E¦)#2çÌaס޿ZÇ¢_oÓ³¥AÕ/Ãì ú¼E}=c?šŸ‹ßoEüú«âù½½Ùø ~Qc3kñvŽû±ôÏSõߘߧÖÝùqˆ"¶ÙÕ³e«³oÕ²þI© ·R'7æ_A£«²Çáͤy<=óíìûõÜ0úûþñÆ8Ž±çßËähP¹nM³ì™ž]÷Ã÷ØÏÓ«uˆƒûWé§ê¹&ÿóšÄÑÐ?Ïêû~ì)ÕnŸÁ\Ü4Ž'&­ßw²øÔk=)Þ;ÿn;f®Ópé‡ÕåùWÑøøéOŒ}Ú…“ö¼{Ä´(üÂ~n#g#2=ãðÄÊ}‰bw'Ç”9U¢}|O`:OÙ!­Ÿ³{L>àŠ¡#2jû"'‹×f!<¨ÓD H"n#5üS3 ìóÓ·õ÷õw¯vÞŽŸÛ#Ϻ?!b¿kqv ù¬ïä­£™ÿª{ëd¿IñNÚy'¨*£¤âýß³cRE“Â÷ªŒtœª‹],¦µ±‰yŠZ˜þÉò¼ÝãÏ]Ÿz‹éó×jº5 àßÚæÇî>òžèºs…FÓj»j¦¯`¥-*Aඵ-n$þ_[Æœw$«ž7$%ªx%¹Ó©C=C÷‹°8'#2,'–5œ^"®M|+Þñ§áxùÈô7–×_sìø^™BBRwB‰{Ÿ<*±B5`g 4 n`Æç+J°sõñ¤Qó1¢¼oC!€xÓÄ|ÚAcòh¯Kþ±¿ŸXw_ºÑaǤA=š;á·JÙÚºÊUó5Kù§ÓXIÒ“9ïS¬A Qí„›þIö:ù 1Ezt[õY§ŸGm²¾º«ý×a‡i¹ËôþF•#—k¶çQ§sJe¸|É“3ûËß-ìØn=o‹§àùø‡S0Øà˜r®ß#>Gôyö6ÆSÉÞ_Û¹w:Š^Wîæô³þLþ] ºîkýyáØb©$ݵôöâ‡ÓU'c!´žèÄ=Õ±ÖÌyHÊðœº>×VÏV8IÔñ}ðÕì¨Ñë†ñ¾¨ —­ì!Ò¤’¼ØŒv·lÒ£ø{Ù*”æÈbG‹Ó¾üCª öIO(ù~_Pð½|’Ž`öóËn#5A´¾;#2É[»ÃVš«ýŸßûáò=µ~õ‘ÿÃüâÔfeÌ©cv²Á¨9G…?]F5¨4iTlTŽÔ¢¥nØ€Ðæ7#>ªÒƒÀ¢¢,té»Si6×£Ó8kMjDöàÆ †°°ŽÅ-ŽÀ¦°Aȱ¬a¦ILA«"hhn„)"–4±[VWŒc€ì'‰÷àÊæu±q¼‘$fɪ“n¬9]ÛPääØ.HHÛÚ- ìÅhá“i֤¯K\‘xµÊƒÐŸOŸÄÄ”ì"Vå9‘xDPŠ»ñ\§kå3Îk2Öx³_è–†j9+¨¶õêlÀ¢èâ(…â¥AD¶… &½üß?³¿ù1õ¼MÁ' ªy'^f. ̾“,DJfó} I½AŒƒbÂ¥*‰26Bµ‰¶4Û0´’U$vª $dW:NÁ¡3œmùóù¼Øܳ4ë÷¦‹ûÄÿ$»#5÷²7óvcKàÉÂѦ}æË4Ë Îv«wW_—>}öú½ï>›6W›¾ºõýÞnÑ/HõªÙèû=yÃ`;_sáÓϯà(¼Sîüÿ·ÛŸF?nr?³Ñ îñlwÛ~f“¹ÝÞu•lªÉ®:ì­ÿöG1¿‡·dt¸wØ-(Ã:w ª="I—}…×Ô~Aèíø~ßµ¿v^Ï48~+Ü€’ óaÇ“€M&ÅSwÅÁÀV㯿`ýΡv¯¦˜sóu÷j‡f…ûàôðù{-«Ã`IJý÷ÿ'#œ®r½•õs`L0ôR÷ö¼&8©o|µ½ÿ›Ãg«gî·_6«¹‰§åDÝ•Ÿ|ÿ6Ÿ4ŲY0¿|sÌ®¿ÄCð>ÏÙWOôÙjþ5Mý!ÝpÙý6Ý?íU<#è÷WœðÆ&Œáx˜­ÈUÕ¢Em(²Ö1K\ò°TkwG ý]o­yç6ñŽsY”²lˆlcQNh°1CbGV#5j•=9k¦è‘ÊW6í‡u.Üó¯"Œd§I7šÞkÅš#>F5Ûa*R(*`¥i„˜0£FÌ&ÄáÚÞf×M’šÆ1Ò6F£HÆ%ZaN)Ój-!ñiÜtu,¥µÌà’‡#5ó8d ¢[Z((Ó_½Öuk#2a—ÓU×lÞ멦*S$Y¢Q‰ÄH÷`cð¨IGù¢Í,I´WDä F‚(3š*ˆÂ®´ÊŒp#®²R1Œlž`Ås£ðJ®x3±8+« I$’£˜‚RȲXzJ/S•TÉz Êzˆ‡|q“¾È0ùNþwVßA¸ÔŠŠÅíæ#>c¯ÇöCâú£Èü#:ªaÀòþ*}™¢°øŸôZ®¾¿”{tséŠ …\œžA‚A=¡ëÖÉ´æQJ‘\.õÍÜñ Bx{ëë–yăò`ÉÖ¿’¤ËuÙƒ‡_?£z ri$’A@ ›ý‹œÁÜwÊ™>¿¤óö=ùÉD»4Æ kÊCþûÈAåø6ÅhG³³¡jrÞn¯;’Ø6ÑËuÛu]Îy$Ú$%÷ŠukÑË_Uë‘€wn\Â#`››«ªVûÿŽÑ*¥Ù(V²ª+ü•m£–RŒŽ#r#>Ä5#2þË° û²šo"{h¤XÊŠ¤(%•”1DdjÛçöKø|™~¿ËoÅÖ>ÏôÛR«ŸC¦¿/—ïeõàÈž¥ˆˆB$Œñ¤¡:µ={éaëLÈŠ9Že_²ŠÐ+î4:¼i KC„¥Á©1¼:ç9…44j›è‹›¨,]0̱„D'© cË]öQVƒ!XA‘…‘G’0Îjƒ48"™˜e¡AÔ`ÄÊ‹Q`|\Ñ5Å¥â^›šú¤ÈtÞ#1äp(Z2ûè¬1s¿NCkcsqV5Jù˜fˆÖ¬D"}‹S"%›·86AUƒ„Œ‹«àr9PtG5h|j¢³nC¬!™[‘ŽDɧÓ"f#5H#>J2lXdL1aˆ6KDåFÍ‹D;iS¤7C„ÆÚN¶‡]²Á°d;Su`.C(¶eÛJ˜£)ýoö2d9#¾ a­eæŠU†[‘HHÛ<\2y.šQxŸ,ƒÑjåøÚ åÇË(™³‚MC¢(€Pf„>5÷|Õ!ìôJP¡A»²ýúùŸnï#2êñ‡~H`ÏÆô¢wþ]Î… ƒ"8˜Ã¢%ëŒOÓuñ0Â#>áˆô‡…ê#>…såÚh:þ\M˜g)'§†Ñ‰ŸŸØ õŒxO-šyµzréNOH= §k‚Ñ™êÐjä"#,,‚6űaiUSòÒªˆ4ãó»Å¹Ò"5#¤\\axqiFšD©ÓîŸ#5,Y%Ó©Å HÈ‘#u0‡ƒ¿+­ééú憰•û4å;ø¸Ëñ†¶pñ&ö¦ VÉ’·ª`&âìz„W¹âôhÀÐ’Ñtò-h‚ œEN†ÜÌs0©ÕàÕÒª´U…N{y/–Nšíwtm¾p¦T¨J 5«l$2ŸVÿæµçîë¿o¯Ì:_7(Ÿ]ïëÒ.ËWxÉ>lG¯÷ø£NÚ0!‚*e Ò‡9UX&ìpùÍŸlš -+A‘¸·Tc£´ò1Úá2æn˜Ä£t)"€ ˆ+ü²ƒŽ1´Ðÿ/bÖ<\Ó 0dh}äu·}ª£);º.̃ûr–R7á t266v1Ç•TR5ÚqѸä!Û íÔ¥KMÇd#5¡Æ³¶ó< qQ4qKœKÌZ8& eG6!dÞ’™P.A¤kL7ãJÇÀá×F ãÆif¨h±ë@Uƒå»¡¾í##>¶Jš3¸%¢ŽÕFHp,7q¦¥ªÉÇRj ì]d“!GI#50]*Í$¶.µcIŒâ#5ƒÝ]š „O†âDDí{45#58±¦uT2ÆdŒdmv:C„È·¸»b°5:P"“,‘Œ#)’¾r«7k¯•õç×÷/Wý^<–µþÿ#2;ž™÷‰š#>çéëx='ÓùꎵPE`£ªv#2Ût#>"ù+×32ê"ÔcûdÓk.HŒm¨Ú¿°U9[í1J“:ÞªC¢5@¶Ò,—\±Œ”æªx·•w†[n7ù&Šˆ:”/ Þqß}¨Û“rEJºRÜcìmV‰0‹xH›cÖ«’v9ôz]g,´¦fJ5îómâ‹ß>s·lfÁØ’b£$M¶67dØ…2PægŠAbÅ>ªÀ µNñœ&¨Ï… ø” Ù3ŸØn|Ìà-Oá1g!»ð;ó(Œ¿Û§3“‚#®e#µ&â͵âlмïhBDÄrÊ8;K‡r†u!—c`ÁX/‹ù+âƒn8Û×#2&I<î4ÆÎGdb¾Ð«äÜyÝ‚ÕÎç}1Âàâ0d·ä¶Á1w5ÃÂeFÒ”[žql›vÖº®TGç$ ÖãCpD('‚Ž™Å/+.6èuä(Ûj;»»¨+&óÉXîœlsylî›|wE.ظÈV~Tņà@mµ­ê6ø®¢µc´"tb›¶®Ž3™93³eL¡¥‘\b<àvi—N›19ÆbÉÃ"°Ë0NrcZ6Œßg$œãdŠB\ÜÖŠíwl #>Ó¨cÇ.Ûldå¤É6µ&†Dm<ÍŽc/³Ür±±>]#56-úÆ|·fÝ¥ÍÝ¿úŠYƒ"¿è ì”2ðxíŸÛ|OžÕ2ïšxP t¤Qs¶bEv>ÊD›Î¢=_P˜!!2L ¼ùº(³úú¶é *ÛæL²a2d¯h܇%7/ב²O?êne¥Ý;¹–+#>÷Ä'¶¢‚WŒm¡Êk§º’Íq@ÇF ¨§¥a·¶¶ðþß~9=XÕáH„sú×»"YfóËQšÍ;°UpÞp t½yz,ÔJ†5[ÒïÖõáM ÆŽS·nÛOæ0˜Á%ö'òÙóÛuªížÄÍGÉTúW”p¬çŠR æ³wíªà~iîÇñ)=ÿãç¨^ᔊo÷Ž¸‡n™™Ùé‹é(¥Nte‘oïÀq–!@‹²g$®•]:—åò(íò~G»õ¤<{6ÉuUìŽëcž\ryýß`uÿÓ_ÐjØ*¤Èt¿Ix¹éê‹õn!8PQ+Ü_¿Ûý0ÆM0}ÿºmr ºC6+?©TÌëûãÒ:M¯íw;’¤€ì#2²{¼øF'Ü¡ Œ#2µø^èý´­Q·>wÑ\=«{`|gͱٮðσ-Þˆ þ§úLkI.T™†7ø#5þ´Äð¾r#>‡Óvóriµ@û(æ çAÊKÜ0›FBë¡Œ01Ú2ϧËãù¬Ûå®ßv^•ó#>e—€²”"2̶NPÈ0VdE#2OÅåA\qñbr;³±rߣ Ó<̨…èWGœ¤Œ<ÜòYÈãâ@ÖÿL™úõPlˆ|ö>õT‚åWìÖ68m§¦2uËPž`–Ÿ6…/<‘P“EQ´Á*Ãú¦.»MDÌ"¯¡®˜ƒ^#5£"Û„¢(9¹*!#`1M«.ÄhY Çcrlq@â‘|aÖU.ðéj}qa|Uåy˜u0ë c¸›­õ±˜¡ü”‰¡ôŸÜH×\ªÌ£{=Ë»Mx’…K«ïNhw ,óˆU-‚å“n©“¢_åé/‰&c t+õº‰öo‡o5†ÂÒˆÏ#2Aãµ—GµíSÙÕ¶·d)X…“ï,÷ Mꎶ ÒO£ÉËWCõ<ªY̽eÌ ÐR)“0Z&ÏÍ »^Ɉ€–…˜xUàÞš¦URôsëò¾Hk4ã§Nè}Fû<ç0ôZ>Kß#>¾;hH»D Ò$³âð™,ÖÞÙ#>—]"‹ö9L`ä½ñ·á;É­é½á/(NôWm«Þ‚ÍÊ<™Å…¿H#waГ0ìeôƒü©ÆÅ~}k¿S®_ÊÉá«æ (nõgôðoñ#†(|_ïeÄùGyǤßPEL"†ššyv©HÖ}×s|´d÷¦¶²O]ÊëAI¡[>b )èv]D ßâNÌbW·,Ù¼ºüZƒ^÷„“7lÒBÁ§§¦4õÉèå„ÓŠ*ÕÂyjK0wª`ŒÂÖ¸]½ñÓÑ5/ûñÞò¨aPBÂó‚GÊ'3€Nÿ'à72|`ÎôøÖÞ8u¦Êh[lôçfM7ðÆT¦$sœ()4‹ &=T[3›*Æ¿l9õÀðÍHZaÑhJô×ìÄG¹úpù®Ýhé^‹îÔ®öd籓 °x¢±Ñf¯ó•3–Á÷µ[OÛ‹^üÅH[B¿GˆÝ£˜(Ì”PÔÞgÆ›yOFÚdmD|œYãYhE–T½ÅžvÝŽ"B(´ ,oye¨€øÂùyhá‘ôowŒ›¢ýæ(\§¸tZ”ĶÞrzº¾LVµÅ¨kÍ ØÁþÇbµ‡n`·iîºhsû2ø• zóäïöç>z5—}ö%?ƈfý‰ÐZt«hm!Žôññ;og¶±—ÏÇ3OáÅm×*êñ{&6„˜Hcc1>£{ZS_ƒ„šÔ׎>ÆRÆ‹¾#5h¿ß€E§â<Üœ¿G›·¢0’ESÀ­dâê,¥¯?3ôíGÁšOÔqþôã}Ô%Ò`êßwšyîðˆwú,"ÑJ‚ròié#Ëñ©Îã—'´Q.ÍW8úßËYkFÔh„ÀŠˆd’oŽïHÇÎô~Öë6ü<„ä%SA.Ö¶Ú°FIßø(`ê%XÈÄæ-|HST<·Æ×í{he»éZ#2Hu)ÒQ.#0„<²ª‘뾺o°Îb×:¦YÕÌ-{xOWQ»kø í¬Ù:uŠ"^YšY2—~°þd=?»œ™íczÈ"ÓeE}‹€ŒRlø~)Î6Q¯‚ÃnlnÐé-ý¼¼­2¸|ÙŽŽ–2U-QÚ¤æÊè{¢žR †ž +]ºÁúØ]öœ«#2Ä‚ \¼È(C£âN|°—w}ºØÕ³àN@TIÕ§•J½"~盼ˢe-E‰WNpSä¬ÜKÍ@ïÇCWçH|©ïr¶C«ßæòЄT“T~ªâ¼d¢2çi¼4#l(g¶Á'¹ƒˆ$áp©NHéeò¹à}-nCÔ¡åC%‘¸È±f\l££ÉšÍ\Ó}+¡®”ØXïŒÀ‰®¯[u%™³ÑèS<'KÛÛk$û;ûûû(u#2p"*.%µÕ–âUt÷ó£¤3à†®|bíóÇ^jªE·LŽÅ<$Ž’ìºxß[G hÓª¯WÆi3OsVÚS­¡öÊÖ×öm¬;¥’ÖtSŸƒÃæ÷étŸn®Oe«9ç.|àyô2¬-¤!tµrïPï3Þ;™%åÂÑs6ˆÈm)¤DDe5Å «TjápŒ3F*—»Ã%JÏ>¿õ«\‰/,ù©¤8ÕáàGÕ¿a×et8Ãø‚öwƒF­q«„“ŠÖ ÐJg‘ eNy§‡¾J=f6¼èõsiòß©.ÙÞåÚ5šgŽ."[qå¶sêwy9΄Ü>åÇvvµÙ|]s‘¶úz7Þ¡Üx:œ®«†Ÿf®Eö›”a¶Ù'Ù°ŽKz~/GÒï»­èauºFèb‡zl`ì ¦hìÍfƒÇsxDà…¤îBÅjdЂ qQÁò@ÂX–KÕ§kj¿CO3‰x-áÊt–Úáèž ·ò,Î/¡EABÃÖÏüó‰Ï¬Ddµ‹Kkk>ÈáYšÖ=›ù¯cž›ú¹ÖŒÁÝ´'óÄÂŒ=³1Aˆ]¨ÇÐDÄÄ®ø[sòÄ;ÙSSƒ³ú)ÁîR9‚)Äâù;÷œN;©”ª¾™Ób_Š;kl0ûMX3ÎͺإKiü ‚)‡fL2DvEÞÛy²êxKrMªŠŠàvr¦ö~`ëF©½¾¤’m±Ñùüñpcr5¶ÑÌ Euœ%…À•#2X4¨È¤²ØçjE!%¨¿R””OŸ§©­‹|4²xwï#Ñ·¤´†ZÛÈxñUX¦ñU‡šxß8ïÖ³m­ˆÚQN(PxJ´®_è¦dJã“{|lC—ybRokqúa{Øltä?ïQÏ=oÍZðAÈéNεFzg«B|ß[›EkŠ´ÞM»üŽò4"xOÕ‚|›Õ‡íÉloö;—bÎ’`Åö{;2uAc:öY®sBSó &„T¹òEvvwq&•³äÍÖ¾Eã[<:Á›j˜Ï2Пn˜æ#2òƒåz½ˆÄ<Ÿ#2ßñÆOý`¼ùo"haÑäúRÔöÁ' kž)r=/'ú­j®€^~Ca½¹¢_I,}}±s㊺.%ùBÊX¦0LOBˆn¨{¨E[Qù|ëR)°ó}÷³éÁmÇNêÙ02;F‡hˆ§Ž ‹|¹ðÞõ £ÿOe©+7®RÁiÑdxážÑ9¹Õ­¼Ù²xIqÂçIx˜gæ¬-šå›C†ï‚ÅN¦Ça¢Ðæœ ãL²oM&õâi ´9]Žž6­_Wç•Yš¥ŒŠJîxâ8Xãëõ×~sý[·±FçÄw~5Ç»¿ÙÎçñUpÁGDÈç›UÐ1ny:åº;_[ësä—¡µÛÆß]‚í™ã”K$„öÎ0ØpÍþ ,Ä·2!`¯ž0su-£FI“©ª)!•£šyi² QÇ]„Ü·EV6Ô1idɲœÍE¢bÑ|­ ù[#>¨ô*\,m/º£¯…¾©Î`· JžRJe?uªyUã¨0‡æ‹ö¿òãÝ·áéž’Ïôx골•ð§X'ÒõvgŽÙó»Åúä>ÜcmÞGç½ÑºËkGÜ]HG_U~A×ÊÉÕ;]–†f¾ÅŸ".ˆÍšºùîëµQ×Uãí»fZ0¿[GC°™ø±SnØT¼Ff£EPñ0q»Ð¸Ã÷íѧ â<ëTfÞ!çk-Œ2/ê•œ¼[g#KhÃ7`>d´© íÙ³0ñA¥fûq.þζŒ4Þ"ëb#>ÍWa›ÝžlÏ:æ?`ÞçÜôTò¨ô5Þ_¢Þ¾-ÚaîÏf*ê“©¡)<ÁœTØöe mMk‹O\]¹g(ée]´ã|è™/zØCˆu€:"¢µix´Yn$=Ó¥üY ýë8¸TÎêpU›û›}m8BR€£h# .ƒ#>+¨6m$Fèøa¼²û²yæé'zˆ·¿‡âúÏ{:Æz-²XTmxÛË3>vø=º<\âxìü¨Åã*ûËy[âyš¡üþ~>³ŒoôìhÚ±Á’~Ó.G¨¶åø‚é¦Õ#5œBÕ«²WÓ#2û]Vr-¡èðË,i¥ie•4/_阶‚AàPŽkÒû1Ujڱʼr¹Ú#5#56/„QÛ¾N´Ø«´X¼IÃ+Ʊ LçŠÕÊšèi#5Û¥GJ”«Ü `ðÀ©Õ ĉj]|¢€fFƒƒÌ-4—­éy“Xn¬"F|X[¾ùAûŸ6_‡]Ók®Õæ]®®…µE¹#>wì¼@Pë] sÝEX“Mä5­GDL†“Qý;µUÉVÀµ–;] Ð_&Š? ñ‚"aÚÖuÑ€¼¬Ç\á| ‹HlÑ'Ù'ÆüjVÆEú15[(ú.#ËÀm°æá—"_UG~(#5G/:éÍeè«âqƒÍõ¼4`.ÃUwØéXÙXLgÛøu*k¾Ü(ë´âuoëfÂdLíîPäÃ~®«eìxÈŒÊÓn—>5PoeÞéýÏ60ã´¬g¡â®»­ÖFpÐI9çtã)°Üý7Šá&: ¯*îf¾â–eK©7JŽ[î{mX¶•Z»•ÎÜlÈæÑÕ‰Áûã:]éÍNÊ ÉïÒYÏkm½øÀÍf,ÆþxõY0pñµÐ'_³SD¡ßz²kÑbe¿vùHÞ.dšËŽÃÃ#5:úLìUéÇ=+ç¼oóè½¥Ì5ñ)|ñMÊ÷õ¸öׯ2iaÝö~dBùÜqžÇ|mõ|çy×U6唘æGÓ#5#5׊/‰óøXpÄÙ&2kí!홸Ù¢ÜkzG'«^ŽA"°#‹]x|$íøÆÕ-f®\„åƒ#2µ¥++'!#må\­bõ¶-š¬zýx•Æõ ¡3zˆ‘æ#³ºÏ /­˜8ì躳zÖ ¡ŸG0Žw;—FÃ#>ª¬ååzÜëé¶Aß®'.\ZU‹TH†‚ÛÓHê*]V¼Z«Ú ÏÚRê«—Kû´`ýã[RØ:ú?nFÜ1rÕÌtL,²‚,#¬‘Ù7Î Z1V~<«#>é¦/¤áÎU˜U @‰¦6b°lýì¦åØ2-ã+ìÖâYHŒ$ÂdtƒÅÏ«Ëú¼_SgêV»/ÃÏ_U~»ó©èSjÌ¡Pö0u8t9Zu^é -i·•Ú-Ú îZ¯ÅâV»ÇMòxûŽ.•r}Ú8ÁøË åÏ â4-q”!— -„1Ũì™ÂÜ™ów¨g)w&0nÍ#5´Ìñ²¸í²;&Ó&³ÕFÉD MÒƒ: wF–ßÒoØ´ÛWÎô´4-}Æ!ôÓ¤kaÍ¢@Øáƒh¿±¯Õ(Þ#5ó¬#Œ¥ –Ã#5XËV‹77 ¸Ý]KGj÷èä€eéÉm™6#¯Šì{ĨøLš1ãíÏÆÍòyF½.—3j®7ì˜Plñ–mF?¾J”¼\@È=m`7í#>}ïn}TXx|fcŽ ÁóŸœÚ]bé×Ü£f+&ƒ¨ºÐ÷‰Ý,E1íˆ#5M€5%gžòÕXê•Ü´ÃU%•¤2MTÖUJ(ˆç§C…%´0o~K–C{0`¢¡Bº×³ÞoòߟT{„™VF=*ôÈ*oeRÀµì·(ô…¾:ÄCÁ ï~Ú¸JÁ#>?¾‘kƹK¤ŽfyŠÐˆGp-¡ÌE÷9 Ci‚‚Å;x|ß–ÖÒ¨ÂîœÏåòãTÈ/\úeWhÅÇc±‹Óã1ÄMÍW­«hÎ+³ñß…ücñÅoŽµ¼^hr!nãëñï2ÍY,Äúý‘‰{ç½RpáÚæ={{q6ã¬tã·›ó¶5&g^’Ü~O…üNå¥ýº<0ŠF·¨%šhÒísœÊ»p›_9#2Î^«ÑÑ4jQ3…⯌E¢†Í©YÍ_.ik‹®Ê8NÖ§ C1|);kÈiˆ¤²aŸŽÌ‡Y°ˆàüÜÝS…%°×:­êà§Ñ@¢èÒsz¾“Ÿ„¢6—(3™-e$1Gz¡X©Û„©D9.Mv_5õV¯¶ÑµKæ-/xšR«xw]”X{‹V.‚[¥t褷,yöUâ83Èïìd¼iÃ76=”…##5…MPÐœ.‚¦gZçÆ+ië{^ýNé!!qIvÏfòsÓs“yð|=G® Æåe{Gk9ò"÷ŠŸ]© I4ÖIš* ·50|#2ØHŠŠeÎU#2A—„ Ï#ö(hºÙ£Ü%IMÈòY¨”t0h¦˜O™ËKÞ_Ý{êh}ÔÝm®ùóëšåõ˜Xôr®ÏX)1å;œ—Á^,è±rx~®Æ¬¦¿(i F's,µ½bP#5<]qÜb—tÄF™;SEÑld‹Í×Eö‘a-§'Yy\w¬n³QÔüò½„+/)“Ǫ°®ymÀò3p(€m±eØ94b ÍòS!M¯lPI‹ü„l‚úÆj9öªC·]®ÔO È9OŒ¦G£§:Gt. u<(@"@ÔòìÝ\·ÊiÐS㚧5%‰A‰º}•{ú)Î"»Õïspç>›î“sš…'©ÍM3h¼.ßÜŸx“ôû—À{´hˆÖ#2ƒ1KwÀ]5Tä¾Gc‚ÛDÍ×mÝùãæÌ}z#2 Z˜,#5#>¡×yƒ¨Q¦1ÄVÅ°²ƒ=Ð2:ºe«Øk1†Vꨔ¿y.ÃGOð÷êvˆ £Q¥¯úNÈh…u„²ÜìT¡ ÉX]ÏÙ®ˆ•Cw&`7œdµ; ãâäÏ©NJëÜ–I8o˜Áœ ¬õ‚½¡©ßAçiŠ&Y]2yçeìgPD£v-¹ÓòÎ#>Ъ\–:¬²Aïv—#>ÆÊF!ìýwÕÔ7 Æ=>+/ºä" 'bMõÖª8‘½–@ƒEÂ:/†qˆ!€Ã*:GÙ UÄQZN¶Ôµ¢ñŠé[à(ÿ_À¼/¶n•le*#>mÒõ†ÇÚüä#5ƒ‚´ÕOt¤÷™/¯Á×ÄfÖ„VMµq?rµ÷ò".}or‘H%Å¢B–.!æß‘XV,›û]‚|;´zeð±³–†`3+¹Ì–sNçD€ðqÚ<÷¸˜c_òag DŒ0ÔÑI,Hm›5Â6´‡-ež6ºÃK´9DúkˆRnkL ]¨7zR0Ï3ßîi—ol¥£ÚÑá$ñU[_>z4ÐZGVÿ#5§ªÛ{=M×Qiç7Ê*ö¾o±õyô¯gÖ<áuj|¢ÆpB"MZ0ÁÀ)ýƒˆÕÂÃÅLkX%y×6pmÖWÙþ…×-”#”»­ÖÛ˜†¹§³ZL©_•Î™ÝààÀté[Ä9§|bò\˜<ð`0("ÿ®§È K [Kˆ@%×Ng@a>ó~´8GB?mˆ‘!vDcžOÙ‡bˆG cÛ+ýÜ^AˆäÎÅU#>i*e-ˆ/.ÆÁë¥Ùg±ó•ŽšóL¡Â·&Q}÷}Ìbøv»Äº†Cö! U C¦‡Äí}k`Ú¢Û85sRÖÌ:ÐF„†´Ý³ç…HdîÁÔà–òrïÖò)d"ú½éŽí*5F&ˆ&a¸k¿ÑÕƒA.(%0ŽAR‚Ò÷"|ƒœ†G!¹QDå˜âL,,9znÄ_DhÙÖ-¥:¸­#6j1 f,þr 0ÊøEóz‰Çt9»!œÖ]‘t¯(â%Y“Nwó|åýØp축A-&Î@·ñ²¾ý83jûï|¹ÍyI Ô‘¼r‰›<×¹}+•Î2릚‰ÉIŽ­Vf¹FŸi­‹WP(´[¦çE¤óe6åLŒFÐ7šØ¾s‰îbê7]×Û~¦Îüi¡^oÎ66™òò£Š#>P°™¥îd§Üü\®Ö]`ö Ø4cZO¢Jô–”½P×MÍ¢ãj{ÈmôÌ‚T}uõê¾Íµí:ÙsÎ!`çÖªóí9…•h x8ÁU9>ÈÎvD:7Ä;ÌÏÈ…-Ség4{ «mGe/*o´Åò¦‚7ø„‚#2P›%›¢èchºÃªE•ìdðœî·K“]œ&FzÒíeCì¾"Ù*ht°säbDÅ@{8Ôfèe%†È¦šX½—Öä`í²Öˆ¦LÒµåÑEeV…ñehN,õz†À˜ã!ß 0ûaßLþ†¬iA-³ìû\±›g…#>«ÉÃúΊ#5&nDݘÛxëwÄž²ñoô%¬ôÑr×pûË:l À²y;MÇÍß–¸“|s²ˆI]‰éV"ÚhÛÍíj§˜øw­Ú¬#~Ä+Óõ•¿¦ÜŽ‹ã@§oDgrât›Œ„y¼Â#>Mµ½%?ª2þw$O´>?NÜ1dß °Üà -Ëç|%Vœ]š8(A8Mkã€J;d¨S†µŽãZSfµ _ å!æü"‘)#5»c$G‹`Á싸8=Ïæ¤÷iÍÓ.{YÅj få!Ž‘‹fú;|#2Öÿf$4ÿ„wó®W]íÍô¤qð˜N[ã-uB?ù}qŸ¯Ó†§³m òçãEõç†^øo¹¡Bí²M“œð ýC,2dŠ)†.™™QÌ縪r›¦KP„Q_tÄ u ×y"£(;·iƒ÷yCÆuù±òÿ;nΛÀP=ÿ‡#> ëèße,Œ“>¥AD!;#2C 4‘‘{"ª+OK\x«ãòBœ—¨xø÷¨x šAö[;£Õ7¼hA‘M̧¢VúUO2¤¬ ²Ij»=ó{÷{¦ô ýº7l3bé÷j÷ÉòŽñ¿XÌäÊÖ‹´‡‡!B€B7ƒãçúryßà½+my³ÖË­uüŒÛ(N®’˜éÈR)¹i`(f¶@Õ—h¶>¹•bÝÎù⤞#Ê$h¯ÑýY¶w;ÌiÞg&aêÿ*Œ4úÅËb@Ù‰'K°O®`–¤hhÒÄg§9ýC¾II-˜õ3Ü5®ä¼-EbI¯QãÕêv’­têfAH ºZ:4¥š_#D’ÎŽ´N5›çþ‰kP$È~¾*$ÔŸOÜR™yço“Œ^¨Â Áiðü>×o_XÙ¤Ë(߇»”Ô@x™sùýw×û4ñDü\ýŸ|ù¥-+ãçæU@LGÕí`ïýÉ÷~>;Ó¹ºƒ£±ö;ˆèã:°ºÇ;i@À€ðè|5Ú´Ú(hÏd/JDgðò£cíÒ¬—£at2_ä:@áÇû¥y¡þ€ˆ[ERH¢$ö»fßÁ¢ˆ”’6%²h±`B©%C#5þ½óµJ}ñ—e '™,bA9¡¾Ü©âOïý4òhiø8KrųêÁŸžýûQ4?¶8l}$ÒÆþf¢j Ê‹QJjõUµü”¼øv¯¦°Ï7Å'|¤”e#>õÇ tÕ á³ÛP×Æøg.ËGñlñX6ãC6¬c)+ra:öÜœ•Ä#2op¿W,Â>ТbÔ òÝ ßa"†¸44!r8¦4Óf÷üÀ>ÚÝÅEñpgP;bÊ=â—|íA½=’ûb+kî}’óÞè#ˆTxTYrᫀ熽]ÖCˆ[ø#tÁ¹†ãû˜]ú|쟗évçBÕ=w·c«HÝ5# 6¤†ž”¦ÅÚÒþ–q)ºwcö ¹á™3êÀõCÿ[¡þÒe±·´Eî‚ü^xã­u®ŽŠÎ }OžNŸP†}‘¹scûTCK©ÉØýÕÐÆ>£±´CÔÃtÐJVüýï°›ü{C«ê®U¥Ul¸‹#5{ƒ±Ýõ¯åÙðÿ`•s<­7e‰agVN•ÑÖûž‰{xEÆÂ…Úí¬î‹E#2æzfM˜¹Ø¬ú¹Ãì-2†ñ#5!øíÐ÷y5M„P/T4çZ¶‚‚ðFP~XzùO‰$G£©˜i49Yû 5/žÖ½6#†I¯ÝXTMLžÛï.R1rê÷JÚt&äVæP£Z(*,ŠióS´3Š~3ç‡T1#>ˆpµ#2k×ýÖÚ@™/d-¹V±´¦3&E~/—mWãzÐ5EI@h•s‰sT#>Œø0Õ)4`/Žµ‡\дž,¤†¥Ô“&"âd4/3Ö"#2oŽ…WH{ƲôE„]Þtê ™@7@¼}67]ÜçbÂ\‡l‰=Õ‹N¹ {¬ÚœGá;lU¦=”UÎê—²)ZúVˆ`"S‡Î§,û[Š¨}zyã3ìÝ*gõH8°‰qq/rGÑcXK{9Í3à·Æþ é$7Çw²µnvBŸc¬” $X¬ªìÚ¨²€)‡$¨ƒ2Â#5Æ,%æzwÚ»N5Ð8¡Rú›nýqó´¯+Õö\°åÔ#5&ߟÀ¥Gu'æÖèÞGþ_™Õ9ûq„Š(wí0ïÑ“íǔɠî±s.q°†ÀàÁÖsp'_2Ïz½Ï$2«/'‘~(_—®øwä,‹hˆÝÎüpŽ=?ÏÓ#²=ÝwÙUµÓ:µ‚‡÷Õ$õJ”²1Àªš—ënw;ÆmƒDQ¹Gµóoz~z5Œ»¡aØŠïs™ k¯ÕY0)Ù×ÓÛÜ.JõA•Ú…ÄŽÆ£Ón¾½Ѷ÷ÞÌl½W Ç#5kÇÙ2†³8ƒÉî#54ƒÊÖµ©m‡å@É2Hö ÑLe±ñ!blM4>`±§á4XÖ'nܬƒ´#5¡ šå9‘GœSù»ôÓŽ8f?HºNÉö0Yn^‡…æ9DTè6Çs0÷[°WºØÔwÃ]»v#5uMÍš3Ȧ ¡#<„NÆw¼„"2‘ b,Ô+(Žlî``0ŠÙÇMß3¶MÁ…òr^õ{ñæ¦ÉRÓFou:½¿¹Z“EöQ#>B0I"•• PT¡/#>&{ÐD7¶q¨šÕÝTÆ"6* b2™éuð¾Œâðš:ž?l¡À‘0Ê‚JLãm½ƒðþÏå~¸Ç4ø 7¼™´{ð†Â;¦†© «&§eP‚Úh”vWN²Ã»ôå7}#2y¹ ïÝV)f´éE´#/Yp»(°ë<’#2¦žÔ½‰äÈZ]¼˜õ¢/^Û®¿=yö)5ª!p-Wuši(ò|œÖÄÅ_íÉQ xÖJÛ#5Wñîøh>Ù=„ÆOxõÒTâN*9=‹ÚãÐÃýTD#5*~dS2›œµPB!¨%ð{»f+BqßéU‡Y:zŽ(ïëü, Éôö(n¤ËsÆ×õy¿eçåîž>oè}§ˆ:ÅôÎh`ór!ÛÔ*&צˆâé-a,ˆîlÕÃLÑ/‹¨ø†¸Fÿ?ohˆ#HÐç pâÊ 2W—ß;˜•ä9`1²¢"´)ÙX/X*Lh¹–j§o_]¹BÇ[ì¦T4‹Q›¶2±óÂw€SSÑÊq±ðÎ^x ¦œ60…Žb,8ͺ+\G/XŠ?[À(AB„L% 0Ѐæü;k!Óm ›'Gbß‘U{gØÐy´vÑ93#>[çàsÎ6ËSvUíâ&’wOѧŸ}Ñm’RÜçá¿ñðÛ3lÝØJ)5ü%)KLé#>êiøµ< Wgµï7á:‡âxo@'É rådüS}ã Ñ7)h´o‰ œÄáÞ¶2šÒÜëñZ½0í¾<ó½0'OVÿêfÙætæy(ôòm|É¥R¦úäREeöì!i¾\祕éÚLgEYä—Ê»ó²ö·Äîg0܇GͼcÇt‚OÃϦ‚<ŽO܃µ4Ætw}f„ñÍB14*9j9wFN]ÐÛqA•‚×ÒoaŸìzøžªXÙ‰×0v%¾Åúuµ#™í"¶¤ìÐÉN3mdqRC[ `òãÖãŒ(á+"#2u¼c©{•Q„8¡@˜AN’ôp€¥å"¢ªug¬=ùJü-Ú@Ûf§@Îé ­ÍyÓxóÀ<"(^år†Å mÔ]㦢b7#>ŒŠ^S+F©÷:‚N-±ŽY?Ur4‰ò‰¸Ü–IèF†|`Ú´ŠÍÂ5BŽlms‡ nG¨gkn% q½õO(Œç$gÊsÛØ>wцóãÄ~T%µ×Ï·¦5=;~ÚfIÊ<¯×ípdzôqß¡üÒJ:9ž–>§h/ÖˉŸiÊ ç¾säFëûñâùFYg%–h5IQhŠ b+ÉÎ0Õ½ÃÊ=ééýœÀ'qûC›sã›ÁÏrv5‡­þË'¿’!¥!ðÄ¢“2œÅ¸<¾ýµñìØ7²·™Þ‹‡c£@´‚€P„Ì8›ºo,Ë…(¥Î'iïø•N{Åð߯G:äüîR±nY•u¤R¤da22"Cˆ»”#|I!§´ì…À5Æä(áÙÂë¨^~ööñ"dNÏÙiwÙýMÐÇžuj#5Â,÷oGRäqgÚK6ËDƒT¨mJ&!jé3#2T) ˆéQ7 µ>É„JºîRG’)‚‡–ì 0)•9á—^rs•˜)ÓFy$€#5ùdÓ‚öÛðY:ia¼KTå¥Ö¼"ëhù¸jOWqGÑ“0éˆ6éûñσp”WSðÔe=\À! Lñ)øÃ,“qÍs×Ãjd×¾^ÅðQµ§‰÷÷!Ç5G¼Óǽ#5­Ýž½ 1ßÂ|?“žï°Ø ÞÂB|W‡ã{÷g1¬ç×ãk*à&²„ª¨S¸ÐúNàD†o!Gd«x&ÉÚ¦‚Øì†Â£ƒiZkÛ›‰˜~Ÿ0ªmÆR#2¼›¯gãB2¢æ3Ϙè1€XAu“eè/EÝ›8p‹©`Às«Å” Dìvjëë¨%tTVäÏ…CÊ-·luªÅù«“dGJRcÊŸ#>üõSrÚžùÛ5¨øfs±ÏñóãªØyý¾áx†!JTY±Ï#>Ì¡ÜpeãULoÔÅ#>žäÌè̪›Éëpb“XºS€ÒrzÌöftžstÛ#;xšv>K#5ÑòS°‰ŸVç;Ra°ûiŒñm%Pâ@ceîÂdά—d"R×Ûc†ŽÞS÷Œ-°§A§>/d»é[9ߪI·ÕF·I#2GH ~9Í/2AŠÁÂÏ^È¡¯¨a’#5£,!1róm˜D+× 9&3Z$ÜÄÚ5LuÚÝ7é2’rÂZÏ»”ÓÍ&Z,pw)(c6iE¤ˆÓc#>m:÷kôÜWÓ:c »ðk“<±ÀÌæáÀYå}«õ#>N=@1AŠ‹¯@c"~Üæñ‰j8UÝø½hßޮ̟܋]„7èäl¾j6Ħ5ÜÂ]nö¸,êÈÄG56x@Ý#>i*¦^ŒßbÛf—´iYúãýú'saÞ¸&ÝÕé§Ê]œC"rI‡úýÞ#ÐÿmÈ57©*êH°¤²4ܪVw)sš»tS¶é¯7¼“·nY-– ±¢‰L%*°?ÐþŸïÿ1ñ®aäUU,÷¥#2mýßSÏ5ZÑŒ{j¡ý¸0þÿ1U¤`%t:Ù'èõzk,á3ôÐUSèÐ÷Ä>ôH“³ÙÌõå9t?'Ÿ /ý|¤‹îÇÈHˆ W¯~·ðÕô«ÒÔËø[{ïàõ#¿î>_ÌC?ÑO#2åùMŸÓø}vÇ”õì½=Û®ºh¼˜ójdð 9m)°+éíÝÌ@&¹UÎ^jqãp¨ð:k(4åA„ûbPžílvÀK]-ÕEÁ“tj$zN6!®Ùa7®ÏÏËÜêÇsÏG1ÝïÚÄúx[ÜDNpÄùþ¯ê¹:§8RsjJ)à&Þß-8{ͬ¾Ï]“Ð019#>€°‡|¨TîýEù£“»7CÀé¿Š¢›f"9c9#>¼XGÎÜ×Äm}ÏÌʾÓì~³úuÌßÍ,7ÀAÞˇEÄÁëîšdo¤ñL½'‡u¯q¸^¥ÏjL8>û£ B£·+äw @´".óúÑ»F›ß«£×€Åhra#Od:QÑ®WŠÁæWGŒŸáô?–fô>"Ž«•»¡êÇ.èÃÑú¬=œéuy’Ö1®!¹"BNÄ"Ì#ÒÞoJ;G¡“Ö?v­ïôÀ´ì#>„(l#2z{­ˆgïŸû>¯øèÿŸúþ¿êÿ“ýÿ'ýKþoø¿óÍÿ×ÿ·Ï¯ù¿Ñþÿÿ›>\?_¯¿ÿWü?óGogýÏõ?Ýýâÿoí»§ÿ'üŸóÿîÿ?ý?õÿ©¿ÓÑþŸWù¿êþ¿ó×£ûŸÿ³þŸøÿÖßèôÿ·ýßçÿ³ýßåý˜ÿÝò‹ý8ÿ‡ùzç«ýïíÿ®ÿõy?×ÿÇþ¼Gû×ÿ§ýßð~ð³ý¿×OgýšÙßíþ¿ëÝâÿ·Çýß×/ËýЈ#2›ü¿àÿ{þR ÿ#2?äC'²Äw/íVÿðŠ bÔ¿ý‰¼`èèùÃö+ÿysŠ_þéûeÍs.Ü?#2o¡N¦jDÿÔÿ›Ts#24D(v@ÉÖ!f‘Š‰ºxÄro½±C¶¦©p#2‘ ô-ºçÞáz¦xÂRhÝKÿj;A[&´E7–2"¤€\nR:(Ý)²R(9”” pej4&ƒ»•…ý.A„l!ˆ6ˆ»7M’ƒvÜær[š•žª‘`ŒKy%%ÁL·æ¥/š A%„!8ôD3Š¿ûP¶‡úãùÈ·þ·ýK¤ÿwëôÿ²®Ïú¬ß³ß`hæ¤à¤*!0*¥ÅCŒôÁÌìÐþ#>¾5ÿ4Å@ÇÒ¶\!a¾¿å¸¿ï­Sÿ¢*~ž¤¦¦n bñ'UÜ䉙5Ò‘àDsˆï‹›_b`3Ý>Áúy/.-ÿ¬þØB¹1T^¶•»“,îDBƒµÔ ÓôŠ)ÊúÙzk9­jÈGhŠBV«Iê7›TöƒÎ"ëîƒlΣY-Þ?ìpÎH 6m¹(?¾Hº~}IÓOáCÈc/á€yðA÷œÄ Â-™A°c()L• nð¢ è'v4áŒëS›hŒõí@hÈ)#>L&S^¼3eÔÞë·Ò®í'§§^÷•Ç\e_Þ“…äŠ^ûûaî;êÓt®©gø›7ª˜9ìxpá°©Èó½f)¡ ¤c´aR“Ój±ë68Qf)ÛžµÂã}ÃùLù:ÚÏ’¼mJ%¡7‰Ä¸&"$‘³¶ÆLîk –Šö»ôèÂ#5±ìÛï$¼u+]Ôˆç#2ÈC0àR-¸¥ ‚XªUÎÐ5"5oi ‡#>r&â¹R,óñ*Ü,[yEàŒT‘C•6í4îÆÙGá¤ÓÜŽ£›Ž\$)H©ÂËZCª/uì€Nc©|w¾ÑœNÔ7íšD‰³ÎB'¥^—r> á"J›æáŽÞ2#Á –?ÑÐÎ ]ÃVø÷z@ñ›Û·ÏÉèbÄÜ­;uäxŠÂE"Â_œÓµ2ƒ¥‘8 x1C½* €d¤‹ oe¹­’µ[àë*Ékb­rÚ¹¶JµÊ®–Õêȼ믱çw¯ZíËmö’Á¤Ñ‚¼F.ŠM•˜.W"o‡½}©y¾'9¨L"f+Ë®š…õÑRƒÀ%ò BÚ΢G6\¡£žH{çÊÓæa&‰#>håí+χ7wbñ nh‘bÐM†%|8[È…ÚúT(gqKßÕĵ>¨Ö<*y<Wg9_ å˜"›°ò‰Ô‚0U%QJH‹"Æ#2ȇz7`ï‚oÝÆ­Þc=÷*:ËƧ^ó Á³¬³"ó<´P³à@È¥X¹ÝÉ£BcÕUÁªÛmFd’F[ÓI)-|jä˜æ#+Ùõ:ptîàd/Þb+"€ïP¤Dfˆ,…"ŠEª×v1D2âMªz”d;Y,C›0ðÁEÄdÃNwf\·„ÎùÛ3–¶öwïðÿ¾™d®Që¦æØ(ôÓ~?>;'YR£"‡­FPÅYÙT¦à)"¦Pxvî]p×?=Õé‡ý^oe®ý^(pJœùtXÙêbÌk‡×]ô–”,º‚RKDÐ cÿ”}>­øáÑN[(x}l9#>ËÂÎñéÄ’½cl#âPãBv‰€löóŒK¦î#5³qçcï¸üá€éR"-0¡d–„D `燮†Ž¸2‰Y"È)TÄåéÏ¿\É#2> 9ûw^ë¡è*@ò$¢äjs¦Cwæ.Zt¨Ô'´íᣠÐBŽ½qí õËui^k–ç/³·Ù’€ÑSeXü; ½ ¢>„]]ßnõzò—[ºK•Ô¸g¯/7žs˲µÝÒ‘D\´–Âóºæ;Q©ï}8Êñϯ|cåæ+%f¼ÚÂsƒžß"ï9uð™ !Â+þU9RP‡ ÈP3£hO'Ñš$”xžKdM6×lP2 ‘O{Dî¸`vnðøúiᚇŒŠDßå#5¯I׃‘ÞZÍEDA`´¦Œ×¹3Ù¡©ÝÛÜ_M h`³owp–nÍý>ñ÷#5´nýtÅÔÁU¯1§¹ªI&p=¬iŒbèŸ `›@ü¼žð–Fo,ñ$Ÿé arT à4×L'">ùðj+µ×³=#5¥~¯O dó£cD¼Ð6Hq &#>E³±¯[jNî°£±Ç6õä,5·¯PŸbN㤮ŸÃ»AŠÚqsiSx^È¥«½bo @ˆ]iž\å#5mxó 0Ûöüg“ ª†\™öet|ÍøeCP$Â@‡Øi¦g²#5½3ìߊb·KägR‰H"#2דuf¨I”Š „N²…„1NØšd÷ü1ãŠá­^+;¹dëÅ$nGŒ‘²{on ßÖ—#5³XÔÒÊyÚâ’¼naÔ¹iˆ·‹¦Åˆ/†A˜ÒƒÐúp7ŸtÛ{#¶™ÙÜT[§·$@ëñ{°(Aäøý\Û)ãTê‹Åëúa9hû,ö4Ží*‚矅ÏsqCöbK`¢ðCJ *­#ˆ¡hg®×°àÚ4ˆ]Rü#5PÞThæÜQÅ7Myo îAƒæ³Vƒ.†Í§taôèé×S}iZ[N»O:9Uüô1É.UB;'žÕj¦Dñ‡‰j{%³¡5Gª–äô·+`ï#>:q…äµù0¾ wÄÇ Ùg((2UE‚è2(³ƒ%,H]]œÁKÅzà´„y<’d¢"D*h¢ÂŇUW¸á!G³î¥Î›oµt™F´x½õzÒ¯¤ÖŽƒ+¹l«ßç\fûrƒcO†¹Õs®«^^Ø9o|â÷Þ\mǾquýŽÇØöGZf)¬l³™ÐÛǘïeE†fü #2O’E±‰uv»\;nû(^d÷€èYRjhNÇš>,f†å2Š­™9÷c™Ë#¥˜9ðnQa»þ6}÷*@àTL˜t9ƒ.$ôit- DÝ»zÎßt¯&€#ˆì°)w}¹bZ]ìkÄ,»r#5 w •Èòò ƒ´JI#5†!CK fq;wnpB>”RÕ;­À»²†$=#59¢E‹,™ÔœhÝ(âŠ3k€7‹•H7ƒtÐRïðÿ•‡°È訅{{Ðê#2b†^Ø5D`ƪç™ëÊèH{rH7>F[g/D‰ÈƒGw‡¶Ä)ûß`¬ëÛ6#29”ÏÉ÷ïÛ¿¨ÅòÚèÃK¡¬‚‡9¨ˆH¸å«b–ó*$€eˆ)B1]¶4·"ZŒbå³±‘ï;ðØ=DÚ•AJ¢Î#5”£÷¡UXÐ0áGmÐT ÂEüy`ì‡îéÒaåÄûORvßO7å´ØCÇSCw“ya½W%®ª’WÊjÛ6&hHf¤Ó{µˆcMû¸Ú@ىߡϴ8FÐ$xt®îöžÒ!2ÌÞ_P9‘NŸÔCŸQ„ ‰À(éIPÝñ(rÒI]‘^è2Eãœî:Ä¥ºÊYPιKÊÔGqÒBY…¡²#>1ŠwdèYØm-ñ»»W- ¢h©-µÇju»$~éäçËsÅ#2´|*òC¢#2¡·*¶ZxTðY­=¶p|*½C¶› œV*©NÙG#>UÞbˆí¢ès 8ÝþrŠçu؆9ú8×i‚Eà«çTx€ÝÆÄЮ­#&Ä•sŒà´¥ýÏ¡iNðÍÞU#H<×b˜ýÿxþ†”öYïÌ-ॕÚ‚ÐÄZz¯N$ ÁãÈáè™@$‘I•s%9ÃæÓ—f<öÆj^Ý7mÈP Ýþ!»$OdùvíÿàïØPÿGøî}ÿׇ¬zêdÙ·h(Ñøj ÆçVN¤ñÅìªúO»Ïøn¡ÕðØÒäûlÞWáÓ‡è©ì,…#2âøYu=”úõã‹„9’Æ/ÛØ(*íÆ¡²ï‘n˜»Ù#5ü²ÖöŽ±]ã÷ #2f—d|¦Ì=8§ê¤¨s0ìhð¼{~:Â>tÇLÄŸQs ó§µFÕíOéT’Ç(ÊW¬ÿ\^ü³ï¹šhæYËuùà÷k»+ä¨gB>¸Éj¤Ë¢g¸ÙP @`E«7kA@9ŠûÉgý*çÑü¹ú®å·?v¸®JâØ„ óÿßGVuaJ‚¢IÿAõ2[R+« uå_ÙÛk/ž¥™7á€üÉ9yp¿±–Õ–7:%‡òŒÿ¿Ñ0è5ÙØ”’ÿsÃ:u/sçèç¼ð-[„Ÿþs kÙnräB}cÿ®DÿÁ#>ïçžþʼü#2ííóÐD+I#>Íÿ‹ÿ¿òõþoü÷¿ótÿæ¿ø«b¢?×ÿEaþwÛfêWî®0èòÿ£“Ÿì«çf¯-gžýÝÛ©®ý´½ÛµXùÈS¶Ý.v<íld÷òã”ó轧鯜´­Õ”ñÛ¨O _Lùû>ü·wmËöáÙV3ð=ž¢OŠ¬H*üE#2‚ ²öçVò…¦z\ÌP y^æ+#2ˆË”-à´ŠeHSô·¾4È àk¦EŒ…#2MhÄ4º§Gðýš"·ÃÊħÔBNöœVÏÌ[{o!eÝ“ToGð‹#5ë:öëÐGßíC`ã=•D*UsµèýÿÇN¹öæçTòÇ6Ò@ cÿ‘Î#>-#5Vd0Ò7?$?X½=½ÞnŽïÉ*b%†g%ý×Lž]âêgTr~ô+Ÿ#5Ö0 éÑ¥Ú#2%íß-º¨Å¦³Ï§jÏ®8ñÚ¬¯ªß3‚H9k¥¨AãÃ:½¢È€Ct\>0ü"'Ò0„pò­6éˆX‡7—Ån£~}¾÷vƒ©R V·#>½íñÛŽÒ\T˜ÏþÝFå¢I”àZMîÄ˧¦árU_ÓÃuM’Q”!ô¹ŸóÈü'ý$…Ñž¹H‹Pë(ùðãöÔ•>tGèWeÒV+9üß”=[î}¥6ýGM+í7Tl¤f«±‚„€Dì° þ0ɹÁÏs)â3s˜A"!g@Àº ó»‡IËñ/’d®Òc¬»‰ÿKÊÿDUIDOÌ<éßaôÄöCßB.^áÛÓoæNSŒo„2¾Ç#5/SBš|i¢ Œ‹¤Oé9qêùgù-ÎUW‰ØõÆu±áY´{õA¡i¤÷85”¿œRn·Ù·´aö#5"ÿO5¾Oà%ψÏB`‡8DÓ rD÷ìê;#2@)Àª¼XÄtžgŽÑÙݳÔöuoþB™SÔÝÅT¸‘#2®uÎñ°yèÔîú¾@äLõÀŽÀ@ÖY7¹š?¢ÿOËöíøŸ¤Ì“ùS×ç³1V•ÌÅB·4!ˆAÖ6/ooÉs®§“æõ”äå× {nü–_HvðëáêóMÖí×»jli¦±ê)°ÞG¡œú½hÕgÆ?#˜‡¥Å|þöxPVð<£ï_ÀP‘Ú?‹ÿWKÑßLj‡ÊæŠøssÓÛ[cê'öÈ÷®/Š<°´9=ªbà Q4èÒ>/&þdÝÐy @#2?E¨‰ç¿[#27zïDÇýhƒ¯µÖÚ¥z½{¢×žq…¼Uzë¢BK |e%ã-_~s×ç£,\úùHx}9ìÌèa?’{¸êj©ËÕc&dƒèëˆ@òÛêÄ'·xÚ"­Ã·géõùÒ§¡_¸ßîóù7ð=žßŒÀ@HIP\÷ï#5fÂ#¦å×”1ƒQ÷êPfд ?ÌRÙý~­»´H|£RÑçç÷ ߯ooBA"Èž#2]À ? 3OÍžVÐÈårñ oÏ‹»8Å¥ªëm¤`n*°ã~5œÛWò)¿¼Õ쎲ðl C¢q(­d\¥ÑSm=_'Ň? xŽÞn~½zoO’L‰a/Ô¼ÜCש*¢}mÁ†‡ñ8'3sw,ÌPú}ÏqGÆl˜y*ÙÒËŒgäIùo.Òþë³(l)wÑÕŽ¼0ÈYi 3~}hXX#2J AD„‹¹Ê¬U“ñ¿)a€)˜¬hûõ²Äí›Ûï«®¿ ÝTâ÷íz€FÙHγïw¾øÎQÎâ@†ú9i=5½Š(¾\_ºˆéζÏo/Õö÷NGBÁÆA€ž‘¢·ÜcÙË®ùÅæÊiÆž/=\;½DD¬,YŠŸ¯~ìÍ?ÃM¼˜ÐÀÙáÿ~x¹ø\zq¿‡”{³îòÄ>ÚÚ{˜Å̀ʆ"Úü'”…$è#2+‡.½(>#2JŸö?À9£ä÷Ri¶]¡êîçÛÙú–8]Çó§gNÞÐîèÇ.>GŸŠ§ sT"}paU3ú,,Mý€¢_Öòÿ•Öì3žÜœ·åÐáüŒƒ»váp»D*yzžÈá+—¨™*mÅX»a˜ÇÒ†cü ng=öÚú ÁUºç"˜”:uç÷Ý®õbˆÞžK}Nª…kCŒ ¼ð}Ó00îîŠÞöÍn>=eäWýÍã]ð>®}¿‡V¨¦Ï P ÷sQYeo|3Ÿ^g…úO<ÿ²ç‡‡ò}(§ã•?/:ϯÑ8#>w@íþ.ôRµ»5NäS7xÍlÏ><ºü;ôôy^ù}ŸÇ ÏÈŽî5ìááÇ´AètöW.V_#2¡sÜ„#2Lß,ÝŽh#2;›÷€ÿbŠüØ·ókøC?;½`ï„ü4)IŸCê@>%sÏ…#2´|/«„¤Š†ÞøØÿ±Ã9ºnL”WUã°`g ê_d!Ä:러_ßýŸ©e¦¢;—…îˆ\¼BBü]È%à¼Jêw[ô4õ%R–ÖLyŸɸIyŽ’)Jj9ò`ÂQ˜k"åzŠ¦%Ì I°£š,¾!ö…((¡PèL*3(#5Ýã:#ç”c•ÃfŽˆb~>o=]í•À®Â©ê.‚K{®²ëàXðßXkÓÉ×eVǦ#>ß'üìö#>3{3¦³âò<ø#7Yæï ™ê?)³Â„ˆ{ŽT.¼â xè°*»‹á-œ´ÿ¹á2·K+‹ÓVb2±<=;H‘3û¶¸ÞÈëÝð‚o¨srꛢ.½]‹Ÿå½Kíï©ã=(<º+pšý °Š/•ÆË.‰t„“CìAc^©õ¹g÷ÍÇÏn”O>ª>XxjÄsLî-6Ò9´´"ÑŒ{bÈUîÞ;åÅ1)a …0«ªoNGwgFcÏ'¾¸3ëzÎÆŠÎN}b‹=\˜ßõøVcŠ/ÑN%Å¿¤Qß­qâ³®÷:§ýf1F|AûcjYòR}UcH¹€ìS‘G¸í4^Ë^uüXc`Êý3&Ð÷^Òœ Ä„ª.÷†Ý]±L)$’L%š³jéVµ^ÁÐTuA_¥œ©Ñ¥€ÜýpÎ}`&À¨ql~õpÆ}ôq4Up¡÷ÃêWB´D¥Ën‰ÕAŒ‹Õ¦WÝ£ÏJ#ÔZ'Î^™­mŸžÛ‡1`a2Œ”:g­ßïjÐé«·Ç)é—ØæK‚Ì[¦]ë*ké‰ßP¾[þj#5ßäØÈéÎm×ñMSÓŸéo#52ŠNiäP’üOZñN(]nkRý´oËÚûê4–Ìæ{|aኄõ´¾(‡¥ ÷É÷Äæ}ïÌS¨üfcq7oZ.GI~¨UM;6Ïé¶æÎÏÙÙ("ælCÓ¾"ø;{SÓ}ªzV¤¦ê‘' ðOѯ-Eâí×WÏ[çS¢ØïN°áBt(ŽÒN邏yëÙ5£:›¸§-(Œ•ZwNè§=!Е¹>Lþ¦Ø‹Îpî€Y)9>ãÇøÔýi}þÏFÏÊc„jLĦt{LV¼Ìÿ-1Ǻßi2¥ÞQ‰xúp”üV¼ÌÔF9%‡=V51â!@‡5sûf<ŠÛ˜(r£'ðë*Êú{µRF¤^¿T‘ìò²ÊäŒKn®"‘1„Z_—múâ¸-‘#>»ÕO^å…à¨ñÚ#໨Mæ+F T²{åðYËྪ'ï†7K…@®—mæaBFâþÎ~ËŽ A‰T¤·ÒñË>ý6KÒT£kãŠz7|=rsfæŠê!·—µíଠ‰lTœdH~/ɹ£a¥OÛö¶sJÀ¡³‹ÅÊÒ·ôéêÖ[»55¢„ù2±Àè"®óòìûàç(T uúêø-¨>ZºÛžVjñ9·Z¾ÿd§'gÑiØ“¶J—NU#Ü¡,ÃÀR&¾Ž]ò}ÐnÿJª=ê¬ßž<É›LýðIÕD|œ¬Q]føa¾mÉ6òéÔÉÃ"Ðzœe EøÑÑá³™ÖsŒXs]Eí1³}ëGPWë¼£“k…çmjPÿuÜM!ú†×OJ¿+Èhx:^"¡ø3bå‰FÃÈqõ] S†§ãéêö=kˆJšë_ó|R¿§àã7Ñ0N}ÙgÆñ?F`óÎhtPãÆç¬ÉíïŽ#Â)0U•û¿,1íÇ–·¨㻂BH #>G†e£4œ0€p&~0A-àÁòÀÜ•’½bWӲ̧£ ßí½ß°a”Ô¾.û¿çïq §eðŽáªj8t^ßn‹æ£}N'Ù“ã;üæ!:çvºç:À¬åžN˜øSÊѪ}Œ9!¯Æþi'܇׽rHäž¿áÙFƒÚ’RS!—aú=XdNuAMÛ )_D)îÍ$ÉðÖù´ž± ¢oX÷þ&N”¥Fº—vÖõÒ¸\Gj¡mQî³Úc—#5±ÝÀci.G….rrQú—0â§'c-ab…äÀÀ<,ê_!UaùUOz” ³Ï5¢`gî x¡‡»Õx]5Å×Ç0ÆšÃÕ?w¶ƒ+§…]³ÙâCsÅ6ƒQ¨Š®~Þ÷Û#5œk¼þÓjËvo°ƒéåÉB=§5×ãŠ5Á¬ž¯v¯ӱߓŒ_’CÊ)¶˜º¡’‹/ŒŽR#>¼«ìôwß¡€è­˜ [UMëÊÍýÔ—ˆtO¾¶°¹Gº'\Æ(êŠ;çÜŸ#5*v”T&¬Yº<ê<¼øàÙ<´í¹’.«‹Ó$M¢AwÅ\è Èh³¸ánÒ¡\ŠÇµ<ÎO$\GŠÞçwözõÉ1¸fm(ÐÔžÖ‘ëg²l ŠÄ—V#™ ‰˜gœã?Ò)•CÕ“ég¯¾¼aÝêSiòaêeæJ'j<êÂfnEö³ ôIâå4d-“څ࢓#2جRÒmòégAu"Á•mï·‚”1”W™G`Ê¥†eÜïFA@Ra©Kæ2ó)#dö»›3F€5ÌMÝAÃ@q¸AˆIó}ˆ‚fÈóV´6dk€· 9åÄ#UÄ/Z‚.!­«(©”;*—MD#2"åDDEå«û7_¿¸OhŠ#5þã}Ó#>{|ñº»sû½8:«þ§žgdØêNÐZ‚â+xOøgï‚M¼¶ÞW›ÎÇȦDË#åSôÔÒN2–Ýí'ån©%ï?\6l²›@¨~aíôY…ªáû‰÷ç»Å+S°~ë;e²çE¾Aí¿Wó+ÿA¼xô€žBáõŽ„×Þ#Ö2nÞ¼¹7â‚])ú¶¾óÝ\ú†îÅsîû?'Í^OaI ˤ^æ#Ÿ§0à¯Õ¨xäùη€ë³‚ÓD¢Sï]Ò˜Pþ°©HúÓ§ï'ô|#>Í"q¤Áy:¡¾‡£v-¿=éc(ÛÂœºtûÏYû´0I$%LY[EÔûxHèÿ#5óÿPï\ùlÓÌô’ €°=ò¢ÄEá;ˆ#>ªLŠ¡ý&¶d¶=yškïçù»yÞ*·‡ÙöGð 70}ÿ‘´º¥Ep ø[ú‰=y>U’¥('ðÀàGøÅyÚ¢Cç.%… )æa}Ï»Þõg|ëàWñúMéÓ·¿‡yêé]±ý°ÏC×¹ý£ÎTbE¶M'9èr|æýk“ð5ùüÊí¡‹ lˆôþ×]gOVÃÙºí[TŒJä`MÒ°4À˜'«³(:Bþ‰è#á„?>#5ؼŸžAÄU{#2á©P»›ˆz†Wª†r¡HÎ;%£ÅÍÄ)AÐLÆc´[#>å$§ATY•ÞS;* à!ù?wÅe¯žÚŒ9Ä. @ #2X{™rØ•Þßž¥!êðÈë#o]è(ƒŠXrp–¦3(ð Ø¡J {‹PEâu®È_j¯À§Ì£‰å·&tÕüã|‚Ò‚õ@&†HsI “«Œ¬`Æ­°Fî\Û\˜0Âɼ LÖSa`‹£>·Õo‘#5rìNËøíÉ#2s,'{ç™5¿ç¹`©7l{X>y¢sïw87à'+º×Ëw”VSþX|«ðŒÒwè0Wn%m#’ÅuóQD¼#>.ß»E©d¶ÒkЪlR§gZ““[qæµãç¤Õ´Ú)F4åUsš‰Å3õý|YA¤}ë9{ÞÔü7#5ÄÓ6Ë+‰¯/“Ñæ6¼3 §qÃcÉ\%OÌûäˆcªˆ®Ä‡ÝÈê …&¾ªÔå©\’Ç`i>Û¤:D©¨ÿHL„ÇG¥™Xo$ñ[ËìÀÈb¼‡ïû6Ê(J“ w>¨çoMqyµ›k¿‘ëN«#5¤};¸M´#5ª@l…€ö±@rØøèèð7#2ýS#>›ƒjDpÇË¥áÕPÓéMôœÇµ´ÙÀuîã¸;pG²E¼þyðÔT¯#•ð‹gcõEò"r‡nÚ;·ße—³p6 ŽsקT>ÎyC¢ýOñÔ¢hœ¼ë÷æÝè#5RTü{*WÏÖÿ£ë£Ø…¦•@'¶‰žµ¬Ë‡Ðs½s¾¦n ""B˜¡áz·ªQÝ>¸V`WŒ‡!rWÛ0ˆ#2D(v(Õƒãîx#>+üüF8¸XR<;™ÙU ãüÌ<®X0«IÃúýñ?çã!tŽÇ;±9Z~˜8z’_L%¿ôÿ“4!:˜E{Nkå‹"—_?ÂvfË:o¸~[ΧîÔÕÌ㣵±e÷õYÆŽÑœ×È»ºBÆWîÉ|]3‡ò©úþ´Ö:×½¤¨”0¼ Ò߇¡Ó×”У\/IÞϹtJ ˜=„i×h¥}¤[#2IÈ‹ƒíYÒâ0š‘b’D%[-m‡wÁ í.•¡6üpPe¶>)η™l6,¥4éœ!LeC´&8 þ^§ž¹bÎÿÉçÃuõÃy994Ú›½}]Î>a”XiË 3M(\ù€ó†GÝzÂe¸Y÷T£–GH8×Õß#ÞòÍ9íDÌ›}n=–›F Ûç+K…”éæ¸Îñû0wFí¹ÀÎhp<ƒY¬oP’»ÎºfWNÜü×E«”èÒÎ(Hʹ—׿ëëWé­ çü† “–×ïÈ=ŸÛ±u¯øHÌ0|ÑA±þõ´öA§¨#5+ÜÎ:WL÷5îž±%€.’ì]Fn“¦3×EÑI5‹K¤ÎUßt8ØIÃÞØ¢’V+oLü>zB2{ýþRUbºMöý#š/¿Ío>ž7$™«²ê‹žÙŽóÙý1Æ›é~[ó çŒWnržˆÒWm™œ3eˆ$4 ûÆR¤BÁJg™z¼D,Yˆ ‰c>ñªØ•Ýs~‰¶MãÇA¡vì¹PÔÑï"?Z“·aQª•Í7 ûödeJ#XPÅ «3,íe̳8‡”—®%CŒ5uH)@%\‡“¶ÿÜøCYÝÎ¼³Ú:Ÿ¦ˆC˜xžóí°Â¶2¬8e`2!ØqOo{ÙïÓð4ª>+z‹'ª ²šö#>[JÞ ¬?¯Æ–.,³ò¬ÈÃâ>ŒùŸï¹~énZô>i?É*mós#8"† á÷y@ÎŽ6/Ã=ß|ÚÒZvÀ›K‡%Ló!Òëhåùjâ\L‹xP­7;L¤C½¹ÊXÔχÔû1ÁáÆᓨæBbáë&EêvÏ~özÏ õ½ŒóÁ¨’:“ìÔ-|(ŠB/ø®B__qaΘ÷ÙüÐ`FÉzbæÓ#5rÞ½œ‚Y÷Þr&Òµ4=>ªiŸäú#]–Õ¢,ñŽÜÐ º;œDñÒ/˜¼5ƳÙfÙº±aˆÆ$X¬k¦Û…²ÿ“Õ§ªÉ_EÈ9@¹Ñ{›@ó—ê€W(9ûœÒPçª,FŒÜ$/ziجy«?RÐ%H‚S†¤Cù†—½.HzéÜžO4µYª¨3±,Cƒ¤Bƒ¿\ãÂA6svµbc»qGÝ#2/)¼áè÷xxí1%°UŒ‰ú_£Ä„7Ökóß/®Mìð™TXª¿]&€ ]¬.é§pòIùzü[·äyÁ@\²çºWäBwp±€ú{LI¾ê»ü;œHüjDÜI$û]t†±èHah¦ë8#2ñÑà•×€[2 2«X0Mb=FuÇæ.–„FQ@î@\áÜö¸<âÜ™#= ªÏ`FÚl×¼&ÉÉöC#5ôÖ@,#2°å¯'ø¼s΂p8‡ r¥mx‘©·¯‰©ôíd¯xsÝÝxà³î#6Ëh‡Œ’ñK µjî¿~;´pÂOÆ`ñÃÔál¢’ARÁsíïj’$ƒanFšª¼gðÕäòœPìè5†Ï4Løqý«¾=nø>ú¡}ü¼y?Ÿ{Ÿ’PG<á“Ý~ ;Ô€H&Ô#5hì¶ËŽ‚8Õk*&`8„[w~yj6MswmÇ´ñ+‘ƒ«xð 7¬;Üc(hAMù‰"Ùå¦á Z ¡°Y9ã+n!Öس®ÊivÛÖ˜P#5[÷˜\>6Ó+ðÓ¹¤±gˆ“šÌÌ¢VK#>f¢TH`üÄÆ#2*²Q"¢*ä[)¹ïƒè)ƒ©“zfcv£»Tà?>µ\rž°¶.}·ßñ¸ñš=´K,õdô‰£Û#5{ûrúgÓ0‰LŒF{…7#5¡€y×NÙÐ.Âñ)5ïkü0Ž‰ÏB(‘Ó•ÍF#Xo:ÄcÑ&¶©Wìºuç˜Æhœv³'îÙk@XlqƒÈ€É>Pz÷÷T®Úcn§÷Û8›”ÑÌW“:wûQ´äì`l.é‘ÍÃ_%¥Í—3‹Ùü¤–ù Z19a „O²ÃsÐù_¸–êéQ#5èSoJÏÏWß#5~Ëí™ÜÎ ¹­ sµ[ÆU¨<ÎîA.#5ù›Ä7jv7Ë’PH¦Ö‘pÕ1 £¹¹êÝ,©^©©åœ@^ãǧÖúMS€##5JŠ\Lê€æt³Á…nÀ#ªi ¢W‰¼ßÕËë¹æ¨u£RåÎr´ÅÁ 9-ER–è¢ÐwêÑ:lˆk„57f±À‡Ó­T_š Œ±’ˆ ú2Ô t÷:ÎÁ[´#2´«€6F’pBÝÖ†¥¶6: "¦ú§u¶|ý°Úi¼ #yú#>âÖ´(¡bˆHc[ú„WåwÜ”¨¦ÞÁ㶀¼U­ ¨8ÞhlßàÊTv¨,a™ÜÁ¾#5ïS‘#5Ý5 Š¶keœì—¼†RÖ%cƒ}Âh(Ù>£—}”iÙúñó3^äÆ;´ž¹g:#ɨòiòAhév"ä@|o#>½—sgrW1ÔÐu\„S$‰MŠÎ.M£GG›¿è'6/-éÑ#5Y÷γ—7Ô‚Hm³îÁîÉ܃œ3€ðÌÞŒK‹K¨+y¼qu¥é¦Aj þü1Î#©i9¸opp(¨…ºÖð#5‘Q«…rÖ1ÓË(cnbÄÈ°ux@"<ÁZåD¤FÒÛÐ#5PÀ¡¥j#4³Æ,œ$ò×Rj(ÑÒÊ0U«ºL4â­:ÈáêÍ.ˆ­ñÙ Î;*§ó¦09NqÝ™æߤ:\½RŽ ·Ù€Ö#°øÖpc²Àds#9˜vÑoü©©OlŸ&Ð0ºá­‰~>XDB»Dt _T×v€Ð VÄÚ£!7‡º¶¹THù;Ä#½õÒÌR8jÃOÊŽ‚ŽàߢfÑñß¾xîÏÊQ¿^7å±™æ…âíQ”‡5_WQ6+¤!L7´¾ýHÂ5׮וê/`³/qèt½26ÞäÇY'Ëló;×2ƒ‹KsÒñÜÅåEãîõ÷ùœ!H­W!¨f0ÇƃGq#>@ãªùé/VUuÏsÊ.X)×ü¾Ýœßo¿Ú=þqð}zÆDmAž9?è‚ýAÊy¬ùÁmQõëTNy4ªÿB×dtq>VièÒv|NLü!¹ýÊ P^ø¯Æ²^œ.Å‘ÒªÙB3—‡2s#5ÌüÑjj›Ïò`~ŸËõˆèÇÀü=¸]lдòàOÉeÉåsœ#5uŽäà#ý;ןxY¡Ú³8ŸQ”ë¿6~Ö½~;»œ€uórý#âÒ!ú|£Ì\z%ˆË(~ð.Þ00>#pü´7™mt³Áž‚‚ÄB>á¡'Üpë¢#2†”µ ŽxǽˆÒF7ÑÎõkUgkîýÑÓåûCîøâ÷göqƒe#2{Éh¢dzæ̨’§fº—ænݹþÖo¯ÏþÐ=#Ö;Õ–ŸãÛÓô‡ñýºhIýÈXPþÕ X Ïø>0P Úl­gým`É ÒÿŸ*©*©þB]K z¿Ï²¿!ÜÂGp¼Â;‘±(²…ÃTêb,#2ÑÿM¡ 0:†í…»ýÌþ¢Þ½7>>6>Ø]¹ã¡a·ü'+¦Ëpÿ­P(ý›˜(æ8 ºw# ðìñ8Šš šŽô¸‰Ú2îþ+Ë¥LNß>äc¡· Aaã‰BªÉŸøLbŽØ•ãìR‡CqºlÀ–º#2½Aÿ Îê©Ü^i]j=Ãà¦ôîó½HwvOÀ!GÙôû\¨ýÿá¬þÚ,ÒüÆÍß½ŽßzÝ~“B‘G#ÈùÑêˆÔ­Š¶*—Uö‡ªÜŸq=j–ZGF¹sùnýšld9€Í>vÛ†çGæÉU26(jHA;ÎÏ=ÍÌÓÜ?:ôÍ œOÏßàï=~XµÔä”èCÈ'Žä~åTY¼rÓö<47[!‡‡9>à~ìè ^“þKòY³J[,žÞ==Cd¥_¦#’\@²€JÀ5”++Èí×Ãü_؃Ûô|%·—µƒ[k lÕÊ€”Q³ìæÔ9v€ðÚ ÷kD@þgiºÛ¡ö&!ûÞîÐPh4…;!m˜Ÿd ×o?!«tKçKP}¥kðÓ¸“¸÷`®&W!zõ#5ƒ\iæ>t7×ë=Ÿå.þÃŽÍTZ3 ³¥ÄêÆþXIµ#wõ`´#2Såô`o:pÕ)]çª08wlLx¨¬Qv áŠ!™ºÔ?»<ŠÇƒ*CÙܽ­ž¡þFIŸ*Uq¹h| ôú|¸ôaØ÷§yÖ5âuø6ðÞ´”“Cpí¹ToíC‡‘­£øÐt6¾u‚Ñ–Aº–ÈÆN X,€¤K¸I§À/p]ï%¥(À…’¿Þ[6BSÖ¼6#É/C¯k˜å;5ظpM¦ŽIÂ!ƒƒ¾pÄl0…_#2ý?±ˆÇ¿¿ú&¼?LT™ý°OX‰d“þ…Šä¿®¾:PV!|n“ó~PÅÉWú®—„¨#2ª°–ݾþœ¶M¨5a_Úï)EÚ€hÛoþÐ>®ØOé#2X lµ¼Æ@P#>’uÖ)iš¾¸;ã“ý Ø`Ç“K—S)¹bË‹BÙìÆU8Q/û´xbƒûuAõ#5X>ª£Pi¥èc¨cúÒvµxX¬ž˜ÃaŸúÌvLIm†=P%Y$7ün\û+Ï¢v–¤¥aƒæú=t#2ë*¾#5â w½QJ"x#2Ñ>Ųª1Ð|}Â2n"-–Í¢q¬ÜÍVROÊöiµ†]~D:‚ –(6‡m'_£?{ÃM¡"tÎqxþŒÏÈ¿åòe§ëàÞŠ~£qAˆùâhs2“ÖY§·BÚK¿cUê “â4ŸIÇ©Øêˆiú?ÌZËn üï@)K~±ê§‰PITÂ%@K¯K—÷›Ü`î{Ê.€v”áÿpÕãeT]»OòŸ† m?Æå­üv°4ýˆ¶§â÷c”²ã¤@›c|bÝ’K!UU;¥$’,ê²KÏŸ»räVìcø‚›ø»q¸yð2â)Ÿ Ùëç¤d@á˜v`8äe#5ÇC¬ÍtƒÁáëÓVaÜ–m få¡%Ì5E6ÏÓà~€Ç_O¿Ú9ŒBþV|W„q÷ŸqÀB߉þ¸I—„4v¬  ü¡þ¿#5ž÷ä?´ôïQe‰?™“ö‚²êDàºÍˆ|µ¨%çéQ‹×™úŒlŸ^J¯PA°ðÿ㦃õ?€%g'ë#>´‚K†Óž{bÏárìþ»üßÈûhúàuO¬ð³&]ø°^<Ìð˜‚Ú0Ž½¥!´„z/\m#5æ‹õlð €p±cü†q9_®C¥~½›6«ÆŒµA"$`ÑFo9Ç]ÈsšÐ?ò–±¢ñiˆ!äš#5¿ˆ.ýáüˆ‘r8¹¼J>¯Hdš#5u2`ª>á Çþ·D7~åìð h¡¦EzûTÞpO»žj½£3©ÞñèÜš­úYžP#>Тb‰ëÉ<ÃXª³÷ôýMô@#5üØŸ¡.ñ%ÊÈqyß•ìJTÀÖø°û3Š¼‹Þ¶BK‡#",Ý#>i „ØÔ*" 2„Y–¥4f¦pff_T[7NŒO.²O/¬Ÿ·ÄÇà›ÆýÕp&Ûxµo±­¿7¾×U}ŸZ–¶y%¦àž#5¬ÒYë+Ñòêwž¯¯±ø}Þë|–ìÇë:¯ûàá^]vÚÿ¼àÌÒPò¦ð«l•Ðóƒö:õ5tˆÆyåÞd¤¿?_¯p6 ðòùÓò#ñüçO.AØÈ-ò;½vÛU "!ϲ¥“P„怌QH#n6²È¹}#‹o÷¤˜ 4™° Æhð“ @šS¾¢Ù¡UÞ¬³X0IA#2ä)l ¤Ú>dÉ:åÛc94,•½ÅÂI$ÛÀñò»Ç’urÊJk;tL¯|Ì¡Â…"u§¼éØÛ=”ߎYOqÛä|c«qëŠJ#>Søoß«¬_#B°|Òàeê|rSxž Íþµ‹68˜{J4rºup¥0wòyrfQ²S4ff(m0Ûß’ºwnìäÔ¦å©ss "ŒƒI#2¾Ãïüõ®ð/oÞcï,Â#55úŸ˜úu¾Î‡ÔÆç/ÏúLò1¿¾"zü<T?¿÷§*hX[~ö1m—Ø¿!u÷mÈÿ±°ý7â¶.%Gâ$+ç9üslw|J¦ŠZ¨HBC\)›·èš²ÝiµÄ-šˆpˆ{³d²¡x 1)@úRΔ¨™GÔoÏ©¥æW~ƒGÞÎWÓ‘`s²ÆH&‹ö¤ë‡¶ x ñˆ¡Å¸„=²b”-?¼È[‡®B‰ŠN¢(7 €gZç×Þ¶Š¢Ü?> <îv#2ÝÌ7eÀ/’ìYöЂÑD¿z'²Çaƒïȹg žÈ>ϽÙÇÑ'ÉÇPþ 96xØ[,!Õãój˜7ÆA,B AüçZCìh<¿[™ÕÁó9䃟($"Æ4ä—ì~ã¼÷7U9ÅÜÆöOÖƒ»w’~cˆ‡Dò#2ˆ§y#2h"F®7¾}è L¦IFÃø‡¢Á‚ zøõöW‡›Äô‡7ƒF±êöuoV¡œyÓÊxó)´•?·0õ­#5­:ºâD‘YdR2>Gp™ûBÎÊÿë €x 'ÀÈ w£[ž)Íóüt4_‹Ë¨#5BÔÜz@ì‚ißA£Ò/±â‹fÒŸÔ}Љ^ïà~?×òeзÖ?æ£ó…øÀ$CíûÊû×äü¤Þzkæ*¨A±®,¢{ƒôé‰íÓsó¿Ò’|->_‰Xݳ° ’Ð"›!ðS5ÌBC݈É$“äqTöÅ÷‚pþD*Åd ¢¶€,Ýéø+ùÒ)'ÝÜ#>wG·x[cn±ð„-?)éüní|Õ#Ö¦¾::F²­Òíle©ïñâæ>Hd\ÒÚT…ÉËA<€+Ñ÷ûx£cpdR¹Wä=Õ%`pš‡O¨4ãßX„ìÚÇĪý‘ž'ZFI>Ú¡€q^×ayÔnp)Ó& â,=e¨sè;üŽ‰ÔædQØÑnêƒËJCí2U‘ ÕZˆ*>RQÀɹgݸ›USJ'®‰‰™®•ŽÎƵ#>BSìö}Òˆ‡š¨ŒdEQ*BÎ:½yóvÚ”a˜µÖ-ÈÛG¢-Ž,%Ï°®´àûy{Sw_S™Ì"¯!ýgž³q®b•JÁ®{™××ãáÜ!뉑#2|qì|j'¤ÕôšÕ›à"<ºrÁ±}*¾fómÈySOçKjæõ#2§2›UJ/sÕñúŸÚ=Oð?ü3Y£_°mn་ûC„KcK†ðÓ×”Œd5j‘`*,Ÿ™»ö‹ýÓþë#2þ“49'ó¢*’…âh‚†ÀËo#5(ƒ€i‚¬îÚðÅÀö*4©Dîb?G§«ÚýjûÞOꣵLq9 f”ý÷¬>¹¹Ù*Öú;êªÚ¤rŠ¹‚ù&'‚AÜÊIì¾ô?nä÷‡è‰O#5Çe47íʼnd ¤ì ÎÔh,ÁŠD#ìý¿ý«Ãƒ”bBA·ió¤©"'HY´öüô)~ËW‹ C6>Î*ÄX»4¨š‘©ŒÑcD¦RˆÉ7Ÿ/=m|–.QªöW#>ék©#5LiVk-»¯<ˉ"–!l)` L_ï–g¤;Cáú~_«iˆ‡¨zA–~¹ï=Að}ÜKªPPq_EÕ4ù3@ýä€K^“æ"–sw©èŒ6w$r#5#2ð0wß»P)³HAýàl‚l;б!š©Â)"0(€ÔHdFÎ œªCCë†û©D@¾”sRÂÖbzT¼ê”uyu;¸¤$£Ñ‘~³–'uÚz Èp%¿È‹HÒõô)]¸'oý“ð¢’s®PYÞr™Žº”#2ÎiE¤°/¿Gø…q'_X;œôg¢{«ÂÝ–ü-¹ÌmÔ‹¼È9#5› i#> ÃÓÖwHö9ïÉFç¿ô–O€]òŸŒR>1¿ u ¹¶_šzOz\ÅOÀþËß‚ìêïü=þÚÀ_´­¯å“ÏO߯üËü*T[tÝïo»éõ­î|ªW¿¬–?Y ºBH''â-#>´´óÓ&© ÑaBÖ/‰GȲJ²I#õ9ï`ü·Éºœ<ü5©#>âàb®¡€½ì¸%á$( ×ETü‡³ìçE/Ú@™ï#>{èéšGbˆé–NH_NÿbõÆ@„ˆíÊA02¡I®„GÀ#>Þ¿éýˆv•%¤g#2íß²=AÜx¡’Lvôíë‰KÆŠ<HB;’~ˆz‚½ žÞ¯§ÁSß×ý°‘ç.4§˜Y»æâ JÐ9ÀæhPwÄ‘ŒPRYÜÏR@A- Jú‹°Ì©ÛÛ­ŠdZCSc™!÷˜Ëýèå_Ù!Ã¥k·éýV Õ]-™þ’@#5h:bÛÓõ ü4À~¬¨#2ìÅBY#5Hÿ~\ÿ7èLô™0w’Ÿëú—æ:“ÌÁéÄ3CQBB@rRªÑT{ÇxÆp ÈNXS•’ýÛ* ‹õŒ+õ'ÄNÕÇ¢VV0\##â4¥‡Þ“ٺe@€p°Æs'/PÕuk_l¤$Z¿­".°äãNÚ˜íäãàùvin¯µHMÓr­"”°Y.. OÒ#2°Xò3<Î4Eì;4O@¨Ÿ«ð 7ý±”oŸ|2N¼¼ü‘ì åŸ%|CñzÃ!RÛ8¯‡ÛøY0 S$4Õ]îãÙÞuf§jæûøz÷r¡ÚÁÍì‹¿¥N«I%àUh?mp#°6uy†û½·8XM÷ ²HtàrAǤºˆ¢¬;ÌÆAeÿ\Ìöå¿Q_ˆCÚU‚RZ(9 §ï!ÍäH<§µSèóCøy=pOCz}p{(ƒ«ËžCÜ®r(sF/Œdϔդ(È4$’ÌwùTñÓ…¡Å㹪CP«žJ#5ÜpàUBP„ Íåȸ³}­#2á/°œ'ó†bÁþ<•+$_=Ægä!ñâñW¢x‚÷xGIH#5F+ÅíáÍàá%bLâ"\¨uHfD°Ã–Å…ë¯\÷âîyíQ'uýU¹üùPsYÓ8æßFÆ}xw#>­mÖ¨r©TŸË&èæŠìŸ*¢Ò–'½C`-Ù};„q*:‚Ôa÷àúü cø<¼;¿È£K›Ï§£»‰ÈÆOµ:êR¯3+Ü;Sò¶sVJ ÄèÕ‡Ìé°£ŒÚoK¹æH¿!Aåuç—d:;‘;`‚;’á™ù´ãi¨z-ÉB{èü™PÛæ[.@öN 6CžðCÔÌ/ÖÝÕiš7×Óàp h8T6¡üÄTÞÇšvÛ#ÐÔA«ÀFÐE,1@(g;×o ô>˜Oxzž‚^} ªzÃÇ'‘w#"A*³*¨–‘læž=¼Î|çGÇqÜjŒ"ï('iaGî‡í?7 øU ’“ÖúèQœõg^|Õ2‡óò<Æ/¨}T` }iÐF“¹Á[û¡+Hw¡#>‰!!vúÝBO;·v8™ðŠõ§ßèåóûûÏwºJüÌËñÔ,þaâä›Ãé1ž¹p·û ‹•µ^…AÉß.0=°ê`•Hå 9=¤Ë#2Áfß#>Ä Ætì‡_,øzßÔžõ~m\©ùêT>eœ¶°X"pä"Oâçäß|§oÈýTÎj·¹ü‹5'¯î’BªŠdm²Õœe‹€±h"¯ÔéÖËá\µrϘnjöyH¼1!Ãj—§8#2ÔI$@]H+.ÊÊjРÚ;0:Ô‡5oRàL@p¸<ýÈá )A¦ $éÃh±äàÐHY Úª”?„~&#>½ÓxD'[0wà†ô?„VLùE‘c‘äì|C´ ª/‚o^¤ëz¼/À°v‰’‚¾DÁ·¤í9¼:õÍ ¨<>¯×Ã{öê6ObíGAʱxBr‹è:ê¹,à›•S$ƒÿ>†Dý÷èÞV¡à‡…71xÕN!BYÈÁa°nn7æb€ù…D„ÐÊ>pÔ#5Œ M‚¾3ô‡ßù/å}¨}²Ïè»Óà Š#2UáE“H%QRêP+h[((’Þ|\›Ä2¶Î'ŒGðçí³’²#›é‚äg!ÎÉÏØ{%vÚÃî½³O—ç°üáƒAö Ä3èö%’ÌžSà}¡Ÿ0挡aúc ªüþ;¾Q’¡»ÊŽZr)^q#>‚•àûp¿Êv“Œ‡£9‡*ø{ à#…÷ÿ#5»Ï‡ûM#5™ÐubK%~ZìÕåÞuÛ~]"–?Xâ!$‰‡åŠq`kû“õib­2 6À?¯üB†j”œæYáZz|iÚé‡) ]ŽV†lýúÀÛOQ(0M…±TÛd$!z¤„c, @MI ¶2NWø“ûñcÞÏ«ÑP”ÐwSÙûØh‘öý`äŸõìåIûÚýg*¨ùÑ®M[…%}T §çáÅ`›‡ÞqõN“ªŽ¯²×“ðjˆâ#2dA›¿7£_Ê4I9ºkô§?è‚ jÈÖpñZ@Ñ#2ü¥áË-ŸT%s«êáõ£½P ýÚ®L…ÿ~0ü_$[žƒ.þ?>§)yʯí?l§3À©Fª „I#2UÞÊMªI1k'Þ|šõkÞe•Lét.‰e’Vø|Rµé`´b½·2l?##>Š/²hyÒ‰§ÑQ'EHsó*(#>  ,p,‡mY#5r¤Á@vü–Ýüpì67+¬KxvhhQà$7°w·©ÑÕëz,B mRfy5gÜ B¶ˆ@’ƒsÖ{ÀésܼЉXUå¾ü ¬ÃsËòã¹ü¿'cØgÝö¥Ôôþ¡>܉à‡õ„?ÙòøÏÜQb?þ ÷üŸ¯ ãd?°.Å5u¢ˆPä\‹-×Ò¸þÔ»Gy?×z¨£Fùñ°®ßäÍ,D˜5`P”D×53yκf['”§yæÛ¶’ËF¬˜eRÙá“"’Á™§ã1…oÐêKÃMµ1P‹(QX&åÊj%ÊUK0þò,¯é÷§3Gz¥0á5Ÿ@N#>¦¶c¯aj1ÿ\4"ÕûÕòd|¤Æ—¹êÁO¬ç\XÏY½Ìækµ ©±‰o]zu#>¨2…*fp‰>F­,.†ÇÚÕÎf7"~ˆ- ™˜¸kpÂ@o2ì¸f`º^Qà#>‡èüiÃÆ?/ÛõXÛ3aȈ!ìÊùx¦ÕèìîTî ÒÛ#2¿ôÏ(TŒü¹Ì„sR ~È ¾3ö+ QÌ’t:÷NV‚ÿa§ù™œÛíý. ¼ß!ñx¬ùÄ-Æ£³\Ó¯^Îx˜BÀþeA¨¤´Y-…°Y#>ª=pÇ„o:ÚÖ¶ŽˆÔ_q •½·úté€r¥ö=0¶3t•Ü\#2¥µF9•E¾9¹¸­ùZG  ÞÚÌd M1"ÂϤâG”sšÙü˜ýÁÝêB6:íövêýz£S9oƒÐï¸=#2±%F$†ÈÈþ¬†CÎP-Á‘Þß,bößiôÙõÐÇ?棜4€:ãxV v|ÄìàE1#5 £Q’$çÚb÷T‚ʽ^G¢{½Ql“×­½0#>OcP=l÷(d% s'ˆñZ|çH¦oŒÁWùÙ4ɇF›SŽ|°ÄšJYs“6‹¤ŽT;›I›)Œ9*2æSPS~&¡">ÃÀ¬FÙ˜r *©aAüÇÇa Éà‰Îz€x`Ÿ#2#„¨ß7¦žY>/ö,?Ü J |ŽôÓ㥦?ßþßK´iöªK/G¿€ÈBÔõ@>0tþSiôðF@’ý¼ëx`Áù·”_v³ž?W¡ø]¨§çñGË4€3D\&V¢bS¨ÙÂ#¿—pÖ3ƒÝ¨E¥µÊ ­êæÃÀ9ì3ñL|ØÕRÛMã˜;aI-þB»g Ó¬ÂÁädÕV õq¾ß`1êì:@ íÉÑ0½eæ2ÀBA =ŽÅ#2ˆˆÁQG>º·ö £û’áÍò=8RÁ¡£nq³f×8B¹u¸¢ñâ9’€ƒ:RÚ¢¬ %œ¸½Ô{~U¹D=îóЙcótü ¹ iyQ@Òê}oâè›'õ7óI%GË”LRåwâ)ÉõþÂú9…°W6W°^!#2meÊøº8hºš†o«Læ°‚¡ÎÃ…ñsX$Ñœõe±¿µ=ŸÛ^ÍBÇÈ]|~¦³(RtÆè.ˆÌÉ-w&¤>ÕM²h¿íÚ©Û ¤¿KÆçX÷2í j^S%ÜÈÌ¢% (È[F¶ÕjQ½ïpÙbÑõŒT ÑÅÓ´À_¦ÍT@º0œiœtÎzÑ$ößõ)ùq¿s&#ßd½«¥pÖ©‚¨™®âHP(.’¢P¡Ü©=#>r‹FfÍ<3†Â劀KM;j€›¶B9·Ùf•ûó5Y]¢”„œv6‡êq3±ÁFŒwí©<ï4ç&ò“}¬,lȹPÞ£mTF“&и‡ºª[¢:ñßžr,Á—ˆs0ܦ…ÙÜáÛu‰ò@þ“§ñ¾f:Î,Û\¼µt›“×)ðnîߥ-)*Q‰¢¦hÐZùººdŒ@Rr­g’r×®ûj½•»Üï™)…QžV°Gy”-ªƒÖn˜PEa¡ÎûÕé[a¿N×Áàh;-&ç¯új#5 €P—ïûü¾Ñõ~y|vqGA‘ˆ¨³=½Äç±coŽÂCœÐÖ®mŠ®Ø]ˆË?ß ¬dGd.ºqrÍÞ{ÕYÑc4œ–“kf¡ÐU/è¦eÁò콧Øú6U A©9¯„¼Pƒ¥;•ë¨TgÊU™w¨ºãyò·d¿Ë®¾#>}–ºs—Þ7žß+rI¿w¡¡h¾H|gãóÚKèø*HqÏÕuÓÓÃÍ„«~Ö¿]Œ@ŒJ)ä(–‡TîxiÜðÇ&¼ž{ì =6Õ‘Ü”“ (òõ¨èz‡äϯpŸgw÷»‘Ÿ¥à|éøðµÁ° r7äóÇlEâ^ê/UÆñj6îWúùi»Î &»2çའe˜¥¦=ª°ùeAë+NªÐÙôiF:°þf€>÷‹‰²#5+¤MKéÈR/Í ßŸ#ŒÞlÊ'chS#2¦Î?ÿX§÷¦šýš^î0äч«ÒôÏU64"4zú MBRQ.Þ2[Ú:?‡Jß!a·ý‘®£|jä¡.”¹—óRlš½‡n‡Ýƒ¨Û$P&Bø_»¿Ç7Ãaè•)BíÙŠš„È6i]Ù²«Ü˜~Ç þî–`­¬áÒìñó¯^Å<yv#9IÛžÙ@Õ®&ԃДĢ$Úås´Ù9Ìqób.”æe¨”Vd:íÏch–3—oTF{f[#5NÀOc0ÆÁ@€Ëb,ã))Û0«H±aO¶pM»¶0É»2Pm¡‘%BnÒ‚ÎÂÉ6ŽãRF…R-#{s°¾¬/2çé/^®ª ŽÙ [&´™&C­ÖªÓ^Æo_{ÅýÜPþ J&ÌŸ¿¼ÜýúØ¿ªÌ7ÂÅy¾Â HÚÇùýßôGÔú'ãùý}ÿéÿ#>Óžð„ žßàúÓ•ù¶¹7.KÏóƘ~¨¢÷dzÓùýý§=´ÖEdBAdD?AˆÉùþšîq¤BEL™AÒX6·ïoô‡ñKŸêÿ(úÏõÿWò>¡¸‡ø„Ø4ö%àåÿ62-쪪°ÿyí`]†LÃú3º®Ä³Œœµ§ÈÙ¸tCn£ù@ÓxÍÛÇ™Á7<5â#>.þ×#qDi¤$¤HÅŒæw§ôò.ØT=úÎcĦ¨áäi­Š¸ÉäÁ Üêuͤ#2¸6×£«u®ê¼Åñ‡œ†O=Œ@Ø»‘hðz¬ždäÿ'÷äK§æU^¯rqÈ*.<ßú¦áÜz#2/bBzêí;¹`o#2îÓ}X ïÅpiFŽ„ÄöªÕ2%4#5fz‚ÌÈjelÏð›çô€½"1NÛµ»-ÈÜ°–`y¥Èyz#5q{ŸÇ£° B5Ÿ«±†ØL¯J¬õŸ‡¹+ðü-å_Ì…Í#5#2°²¦I¢Y”GÀúâ¬CÏõ“!¤ :´5ÛE¾2ŠeµŒLNÿ#" á—³®~÷">ýÈcëߦðX&±›KÞ‘Ý‹•ÆŽßpÏ”R¨DÕN-Hë4üø;‡ 0Á‡1†ƒPÖ#bhF# .£Pf–€‹Ãì8˜÷˜;F•ßMØAÇÖÄ ÌE`Uˆ^ÔZSi}ãÁ:–ÆËçÅÞgD‚={žœ#óú¸Y—U•„ZCDìç{m9‹Ã§­ÿq>ÙÍÄž„(Tª 'Ù·ÕæÛt~RByø¹šÉع}¿eî–áí?®2‹øjˆÔ8ýQünðöÔYž‹;·¨2#24âU ‰¯;°ýCiè=‚± h…U³P2Ä$iD³$LcDoý9Ú4Ò¡©´Çç"»´­bƒB€ÃÇ;&ö'£&Ùgà Tÿ±ý6âþ#÷eXG#2‚J+š–«÷m^y¯M^)‘¤°~¿öÿÃ#>àˆDHÄ‘‘VEô¥V‚T²·´’™5ºÙV-$QÄÔlmBFÙŠŽ@¶Ÿ#ôÿœ¼Q÷qõPø*‡ÌÒI©¤Cæ£kmÙƒ—3P±¹äŽ5ù¹æ EŒ|wg >7·ØÖ$"Ú¿¾¹H:RCÎU0•©×ϼãoóͽɑ€ŸãÞCÉPåû<‡ËÈèºQXˆŽ×Ý!ÜÇ{å8ÃùgÏ©‘€ò;q$èl´»8âa¢#2ïr(Øä9 ,b&ñÏ•:Ÿ(DqF¥Snž¥£Õï_BúxZ¶¤p…¨2ÃY©BHÕÐWb¬ļ™àÔ¹^îL KVQ&ÐÑ!ƒÓ‰K¹cŒRJöoZ9t£C‚jw+Ø|<ùœÃ;p*¨ð-E\B%”6hcôqÔ°Íï„o'’ä ŽXlƒÑ)»A½4u 8kR©.ü€£Lš„XÊT"1RÍOXÃrmÉ‘"Ú̓æ1ˆ1Èwƒ`éå^Ýñ_©Ô‡=üe—ÄKÄf²S°-Æ96·vÛ M½F°ñ†ˆ’[uEl@¯^¢¤æ #5ˆ‹…íÛxävžy;I,ÇËJ±iéë79åb÷80¤ì,´kýâ©äk×Æ=×ÀÀk•“©£Ñ×n)aUkõá™×j)¼Îë&D0aù‹!ƒ#”$cÝøUënlG¹.Xîxµ"@Ò½>Ê$]PÛ$Žä8I­–׶|xÔ7 I‡˜ª1¥ˆ–L„§f(¦Gfõ^Ó§SÈ<ÛקIó¡ÛϯÉÛ&ÉæôóÏ-Ûçª<)#¦0­âu|õÎzÞ¸ñÂ$m·–,ÔÂÉ!¶u³ ¾/9¢7c‰Ék–êÛ›À¯Ll››G#2ºraê屨›ÉbÃͼgF›y]m;¦ÇKÔy#2q(y°¢OXž Œ9ƒž]„=ŽVÏšÐv|Ãi ãƒÚj¦ÂdM‘ùeuV#Ð;ddÃÊ#&üí‹Bm‰ {fpa¶Ô TÞWy7—à8•#5ÿgõÚš,xüÿNǼèMAîèöe3Ä=æ‰sP矧!#2 dåɉ›g¯^ÐæŠÄŵèYλ¸W…˜Ú³#5héÅð0ž¨j;0ÄE^l)LlxL­…xS"=aO¢ZAâv‚~]ðëÔßÒîVƘìíŠRO#Í^]á>^)ƒGàÞpæCs~à™¡gˆ1(¯…ÊA„è…ÀÆq3šÓ©²Ä)k°zÐyÀ°Mà&IeÁ»œvÜ™ëõn´B*™ Ëi³¤&‘§Ô"' ï\¹PãÙäã#>©¶K6‡n¢CrY²j¬©GÆM#>!ÉÖ‰rʹš‡Ñ7¯Ð$ÐMÏN…–#Â…@`/yà˜ø^I-dÉñuÜ^1†mR²†â‰Ñ'nË@äzÃs9j80Òßg¤êOd¦¤(£`“G›"‚õë‘Ërv¦±Í)äv×¾u+}ÍQ ïø|#ðÆÔ~µ“Ñ‹ÛÞÂ<†‡Q¨ÁØ,Tyøyn›“2á½ÕmĹnÈQò‚«­Ø;ü¬¹õ!FÔ”¸âˆ » Œ G¦ï}T‚r`D NçÄá Ô¢q6DêêÐœJ7x¸J’])¶A•½IÀBLÞˆ¶Ø¤$`تllÞÉmBÜÀ¸"¥ˆw§°«¦†i8XÀð÷™3IJ0¨hhX›yìJÜéG‡Nh–6*Íγg³\¶gѬ\æ•B#2Á”À9¡#5>‚1sÌ w) ÅD4ÜSaTbq‰–i„¡ïœ ìêFòÄóï ²0«x)\˜–(¼Kqp n0‰QRAa‚Š#>†C(87“IC9ù’µeÕEbJB˜r7—)‡ײ=Ç{F!¡éñèÀÞš™­é¹[4Hñ ÷F×9Œ<j]“ddj P”ˆÈÂCi $åô5Þ>å×Õ}Rï|ùtÇZKc¹Ù΄B½}ýêf DCµy™qæfL¹™™–6Ìk*̳2IV;fvÑ_ž°RC’ÝíEM¥r”R0ŒPP"Á‡}R‹/ fÆYxÊE#5&ý=[óš²¼Ùà.ä\#2Çð¹=wìËss‚ÀÊ¥ºyWïtsLéB;ŽÛv€Ø¢[=ÜMj(žú²#5vg/7¤6UG„ëtóx–€kr É=ªY”>Al¹ ²&†¢›eÌ+;š¦Ù>ÐÄì"œÎg2cC'MѺÀŠYè·§·‰Û¬”&Ð|† v};…%ÜbÎ H tP“K,Z*1bò,ç¬ÃßÜ|yÞˆg\»‚á25gÍÊÔ±îV§Ÿ7ƒz5˜…«6uI6U¨Â„J–%Œ,iVJ¦Re,¢Ìë#C%MˆªÙ,W^OXk&œ’1ÆXJv­Õ?â$#2¨NsnäT’J2@Òp-âCw{¨îŠ¦w§Œ@®‡‡#5GÂÃŽãYA4ïpÃPÐæ)$ðÁkA¹³ÀpŽÂÜzPÄd¢„0àl#5SãÐÒF–}œüæ2Ùj¼µ½Uo­ˆ¤=ðÖH#2ßÏ°ÍöeZ#2ÅtšÂ1ÍìL„Œ½ÏŽzl–VK„’™ÌK‘¯ª€jBžá*WapXï18§œ<¬ÕËL>S½œÊãÛâFäc*!ÈÙÞGÁ›5‡ãÍów˜1Š§Ï|µu¨Z“?N"ržlâª%>A9EÆ áá¥1‡B²ètØ„6-¨1H‡;>Ü–†–ñ­Dò¤ÞŽõ·“[CŽƒMòdK›-”§-:x/y ‘ïÙ8»dk/ºí´ÀODYÚ÷)í¬b!#>[‡n& aØ+xš¾{bòîzÏÒBEøÇ$DÂaÁüNƒ)Ó”ÙÍÉ­ƒ@m´X„€DȆŽ½lslyeË‘e‹#1°>k†œ]ŠQ¹HM#>4¢ˆ½!.ФᨛMŽËUÒ&¾hð†Þ(º”$Œ¥@Q £Çäu4„Ç2`›¬_…±d³’@9mƒÅÀׯ£¼B‚J ¹F*4µ‚\;=›i¬'ˆnÇR‚N¢%……9D£—fW¨wk]~ÀçF2žöC¼ÍC1 ’ ·Ú#5m:1œck”Ãz ÆÅïóÃXÅ1ä%À3˜;÷b÷_yDžGJ¤ÊÑI³bŒžÜ*T=;½F'ï#>Æ4XID„L`j#5‘¤#>_%ÙLó(ÙO¸s¾©@å…#5ü›¸ÅϤn8Û€é2|“7qǪ̃[z¥UfQÞÝìLõ 3拤EtÑØXÄ_BkHÁŽªÒÉ!#>6ŒØ›CéT.X‡CI¤ë:ä]²úòjBÌ@fžœ‹8@DO&6Ó—ì}~²4[Æ&H™€ìy—Іn2ØbÄLB$©Aa9÷°0@àna°Üf“T–QaEÆ*Ø%HšQö¢œJJð9v”PÁÇ*›hÆE’#>Œ’œ'ASV=¹NÎ`çwYrP0#kQÔ¸29a‘†Õ`r8ÌE!Ì´Öµz†—(Ûå³'TaA¼ƒ"Ø)¸ÛÕ>¨`Ÿ5”:3OTã´#5TAèkŽ);¾5^‘À-¸ì2»ŒÀ#Åh}2”²XÚ&›5LÅ&ø[Ïâ;Ä"= !í;qìÅg`nÑKÀ6#5çet)¡ûý’[C»JØ·V€¯qÌR÷¯Ä=þÿ’MÉßØbr1™a[çë¨Fcœ‡%ïðe+eq'€C Yæ'¬0ôw!ØQ˜¤`AÐÁQsMq¸©(,—8í é`ko¾æ¶`ö^L¹Ðõ 6T¿(z»>ΟýØÍ-­ùnhÑp³9ÚP’·ìú}w#yYñA¶*ðÂ#>‡I¶µ0$Ø"%:ùAÜè½Ð4È;™Òüµ«—Z“7¤1¤41—Â0!˜=á†è®b€Ú@I¸²¬’m&ÓÔB¶å¹À@‰nˆ0ƒŸ—9Dù…ÇWÿç‰mz€É|‘E>;Šómd(0*BÁ•#@ |¾³’züWuÎ@¤x¸³ƒ‚½>â=ßöÿâ™f×ÿ¾pèZŠÉnéýÍ÷êékE%‚ü—ÖÝ¿Cô­_²Ö5šl–±­¦¥­·JŸ£©ï.ÒIE³6L£8Cú ¡(ððöúÈ{I@Ô8í’ ¾}ÔþBæA/RŒN¾Ì^ÿ„$ÍÅœå¾>¶¾þýÑýÓi$ÌËfÚdÕ&lˆš#)”iîê$ÍüI«­J”¦E³o»Ssàd#5ÎR‚)½T¢˜ú='²«•Bá¡#2Ò¶—Ø`0É#>#ïÞ¬ ¬mð¯~y¹‚êCÎsºÍ.°#58®Ë—íìâò#2² ]ó$„„”µðV“Õ#5» ÿù€þ¹ ݪB#5@)QBn¥LÞ’IÑÌê°:^'”÷d­?Ó’MmU¿¼êžH,QˆÄª)G¤¢–‹«è‘”6?œ“»öŠÍ ·Ç<^W$­çä­Öô=:j-|ªß5¯—ËtmXÕ±D)QD¤Òˆ¬E3&šY–¯×ëö²*_.¨¢4²ÌÄ FçÙ>å5ø$X# ePÀl †æˆ'"¨=:üÁ¬}@‰ò¤7‘#2ƒ!ØkØ܉D7Úÿ#5a%4*\Ýóãó䆽Šo!$JZ)4¹„ZÆ7A.¨±FãQZi#R¦d7*ÄUl1‘¡F6¤  ÌQ)Ê°â ¦p—,àÐú[".@ÝÜ|g¬‰ðJ½Ml÷ãî³öq5L’N'>‚Šyç0TäÎñòÅC,Ÿ®à‚QMCÃÞ%ŠÂH HÖ)y™ÚÂ/áOÂÖ4þ"S2.cA ¸àjÞšïd#5O8%2w¯¶)\Žµær…8ÑŒ.ý}€Ž;„;“‡nבí°ˆ nÐrpˆ>ÔP#2R@7ëæézú’Ol·J8Ù,¹L£Î_l*ÚkéUu#>OˆZZ³;Öe@Ë­@`ÖaM#“ `,LD+芰ä@!ÀÈfÁIÅaþ%¤S7?°šô"ô×¢¯.®“1oWs+ÓÓVáz›ÔÜ×bXÝÝ ’ðëõ|×(¯ï<óW‹œ“ÜŽêæå’²»´^×%ót¢PŽhÁl C £©Hùså$ƒP'"¤‘# ¥„¯ïœÄdDTŠ¨¨(Š°(#2íËÐ$€f=î0~#5È–pÇ´=¯˜x åýÿ‚ÿ/GŸç'w!—;ê sPq–B;ý˜Øt5í<Ïúsé¯{LX1/b“D‰o™å›…õ~d×L­„9wŸ“/=ü|¼Ï¾·Üò=[žY3è„‘*£-¾ıús4Ýýôñm#2rbªšAT¨ P‘'qÍÃ!1Œˆ‘ ¯Õ™ÔiC•ŸõÅÔÓS¨{@;~:õ‰oHÀ”ª‘Õ«5•çª¾Âþ9á­<un`¦^&K$Ù€¡ Fo® J:E0gš¶OD*HŠÌBP†–ÐÓ>လLŠiaI°G0'è` b#‘ ¼ oË©¸¯–—žì¢øCûF°¿¼4E¹ô>WóýÃËÇSKSĉhó#5™Å"´Q½Ì²yŒ•øiÔ¶WJù^¿®|áö§ÞÃ÷’ý‡lž £Ä#>a>ÖñVp‡ÛIpó[½Lñãi!,ôòh~°ÙÑC×ðƒÂr=øêÁyV¶:y_Ñ«!@ßçžñõqËÒr·ô`~“äHxU!Q•Q€Ä‘°î]·1±©¿g¼kÏ7mWK[êAz÷ ù’…$)Ÿ±’ ûQZ3XÛQ¶Ù6Ô[$ÍXÒM”IQŠÅe¦Ú±4¶KI5±Zfµ‘•1€ B ,`+"§´üý:¾¾ù2ÚÝ=÷ùžñÁB:=Å @P°°z|/柆f¹Öáœo×XbbáòÅ6ÒÒ ¨ÀX±Iñ4«HÌ€ˆm1¬ ††Ç\Y‰ku¢4a×22¡Ë¬Â™ JzÀOÙDOÒs²E5ÈüP÷UE´R fŠfKQhÅf[æÛ-Ò,#S–°åµlc–Qú]£÷b‘TÆ¢5¬@ÓŶÍvô&‘+¥|ªnhp µ#>pL0±!ä,¨^«#2B¥¡L•z¼'Ÿº"ñTO! ¢H("‘ÛÕ(A- ’v$=Z€tç½3±Â‰hj»^p ÄÝí(d|:ˆ ƒÒ£ hHA‰._Ýd†©'§Ä½´è„Ý¥ˆ@J•àíÕ0e!P C>#2yËXßoßçÓo©«Eb-4SieŠ¾¬ÕÊÆ$ª+W6æ×5¹LØR¦QlÌŠ“[îæI£A¿qí¿_}n½mî«àšÑ CBOmTý«–€cSr‡5댈¬ ,€»WââúDäƒÜkÀçØü<òÞý8Ü[Zi£¤´†F\"pû.¨èXO€öy×¯Ó ž@ú.Àd@ Û#2à'¨>¸FéiõH|û_òüÿ‡ù_³þ÷nú"z>Ïeus¢ôQ‰ÖESÜe)’Q~»<±F*AÅ1U•D0“½ÒÛx+~?‡ZË>oÖÍM×Rºj+#>">ʪ†GÎp8Ö-ŒqÏ%¨6õá­ÄÁ—ý–ÉÓ®xs?ÜpÔžªEyj ¦a…1™C_û>G¤`xÊTÙ5ŸŸ=#2õš¦öÞ)Ð2Uá%àãÞ†½mT#5iÑWã3ô¯ä¦çÐø;"n¨é¤™œþÒ¥ûLèÏ.6“¢aÙœ£!&£z]±’rîþžlç¯Àíü´y‡"€áêEÀ¤í'ZPeÖiŠÓ£øgA”?Œr€™Ø’Fµôº½ÝÍÄ?:Ÿ;AGƒ‘‚xÞ–#5A\7—F”\hwŽËT ñƒÈ˜?„²@¤aö¼r"£î>ºtó™C1=“Ê#ß»ñk¯²¼ôâAŸºCcÓLÀü7zËÑŒ»?¢æñ†>/øÁAÝÝÚ5;$Y9MàzsÃq †ˆYƒ¼ê…(›i¦GYüŽ yq÷]ãFút›ãbr"hêá ¤o#5±¦#*‡¹Ã‘¬–Xœ†|Wø“wf³¬âí!’ô!Á²“)Ì@_t˜¬qqÌÆÄ â„±‰cëïêül˜¬Z¤­•5µúwkœ $D<ýÃÑG Ãä è臺”ôÅq·çe0æõHS¸VÝÿÅüÔBxÔI/3ú;ø‡Ù^ü®¯‚¹Ý×iÄì”ýj£íî;€òçˆÈ¾`UQ*TdŒDîõþÖˆàLÅ ¢±PŽ°Ç—Œžo—¿NîÝQ5C]Š bö¼ß¤ƒŽ²BñÄàˆÂzÉF-îºB¢±P)‚Å6x—ƒ¯ä»†xæaÃomMxè!Ô,/Pg-1£M4ÓM4Óf(÷73àü=à÷ܺ¢š¶XÆE¨¹"1x#2Á€J'Ó«©w†U#>{×èe bxí[rŒÓt›Â‡Y†e P¹EPíÝü]i [Y±EÀ«ßŽWÝ#2FJ–ÁÊ?‹ÓžÏŠg2›!`¹Á^äÊ'Ö½g¿™¿^º‚p­ó•ÅíóˆÞózÕíZ^'Øì&¹žµûZoToº¯ … 9ƒÊµÑáèã«n:ï]×^8íõÏ+‡8ãŠ1ßVc¢ËÜ}šFÝm’¡@—(ïÃíž:ŽBvÔ󛣭¾ ÐôrŽcÃa—n±Ø]»óÇ¿RØnyÇ2@ôÐr&ô–ÁÁ}!nv³·&ÙÚƒM«‡ 3†ùììî#>vl`Ýúű©·|übÔíF&š(+ëvPé§ùcÆÖ³#5jx"Ø4L)‚> Š0ƒˆ­îfm¦Q}›«¨Á|©†¦Ç›Ýo>ÜpÃYb`ŽËbjr°nð­Æý|:\Ï¿4xx´ç7èP ‚8P°$žå#2.AFÖAÝ wõ…#¿#>žóE –RÅ b;tab[@¤ZåK .öb1Q†½Z^jX…‰w&G€Å_¨/ðDBy€ì~Œñz#2å‹èz³Ö>lŒ±tð¶`u—o! Å_•Œù|°g#5†Ÿr‡çNH•—ùŽFËĆÆjº;1ôyÈÖÚõnÜ6‹ŸÝÊÛú¼({LP—ë„YÃÕÌ1Ô6èzíCUÔyî~Ï«àw#2ãl›Ýû7C6«í|3¹±,\ÞÅÍH]¿pM{;Úл“\î‡-Ü«êv`C<¬„†ÓžCa›s“rÄÆîsêÙ,ì›tí:õ<ŠRƒ&ç%:ò"ÕSMˆ˜|û^~v»|‚¡Pí:Œi1®…»’ Ÿ~kÓ^Ö›Á¢0DVk­C[U7T6ûnó Ïw»‘œž¤P£×Ã{“ VQi›A`Eƒ1Ä'© q6ÎÍ—¦úóÈv{²k·‚ªn#> Rƒ*@žn–$6Áš²$#5 @Á#>%\¢–E†l–×M͔ӻ]Mœ Ý,Z×:šÒíöuã7\-jŒ…‰#5‘Š #V#>Œ¥mc€âh‚ƒˆ‹#>ˆ»»[¹‘.cdY6.û²™³LÓ1ä!ˆŽˆìÜ(˜8$ˆ@ÔÛ%2„ÛL£mh×Ñ¿™~#2ð1~!EP…FHi@ù,YÇ®ÁTéâ:¯YStϹ{ÐŒï=0L* ¶F†ÄZ•ºÝ@6‚¾Ï.Þ2Z „.tØ›WÙuÛÈk½®]æóO\¥dMˆgJ Q² ÷è‰à T"œ'è.Cæ°{Þôñw+¬šù Š»ô$BÝS)D¨­ìs«Á¦K4ü‰4dlí­œeìmÍh¦"Ž#>aÄ‘ÊAcý®lNª·g(¦Ê A”êJ%wýÕ꧊&“h²YLe¨ûòã’FÇOÑ#5ö†”AtŠög5ãçäû±ñBM#Ï-4Gy¨Ap#>Ÿnuž#2ÀT„6)e0¾U¬õYÊ*¸¯)Äú³°ïááÌ÷ó!æ Az)>œŠíØûbÀ±•H@"KtðÏ#5wZ5]šêó+¼ë;HQ%X­J”Œ`Ôi¢FäH 4¬ºRÖͲmf©ªZVÝÚ髉±­Ú“fk*Yikb*,)Jƒcàk*4 ‚¦Ñ¶bÅg.ª£j+I0d–?!xV˜{ì0˜‰ˆ_®‹úpÊkÀÞI Žþ×—¯¢0µµN”ÙñYõ7UY6;a¾œù…yûÝ‚þÎÝh9„$Xm,„€.*y‘Õú\lÍz–äËKL§ Ûk#2é׌cG9Îqç==PŠ Œ‚0`À„RE,t#>äjߌ|²°bxJ#âòµ—˜sKCÖ1·[VS(dQ#>¡Põ¡‚s¢»ÚLâÔC´Ò›Æé›n^¤Û&õJ`­§®à犄$KnÐàXÞÙ›ëDV43{l+V|’lÃHAá”Ú*¸+B‡?0×È}OÓJ|-¼ÖUêåàòË°ªöÇ´ã%¦(¢g®ß^92%Ù" ‘`õ¢„a¸ÒSÌô:1ŒÙçWI\êbª™®ô%ÊßN‡.‚¨µ›í-ßY“‚´hL$ùˆ}ÜŸÐÓv§9ÞNc³ë#2À51ä0wLŒ‚§t XGùÉõG`«ùFЖ㛰ÂZAI¨)º–Rç‰Ãl<êMJžÕ³x¼k#5y©NÅ65(úö†wN‘‘úÐ!h\ApNZnàsUåŸ=ô…MÖ?—^Xe¬òd…c&3êmB² Ç e˜ãÊ3Ä’IÔ½¸Ž]NÛ‹MÙõ?C^^ï¶j#2GtvDZÜ6—<f ®¡!hl5á©Vê‚6¶‘p.¾Í) ŠF'PƒBèd#>AHpD#5ÂY¨ŒƒÐ€¡®ÊÓ¡.rð¨#>,2= Y"q‹›Ý•äøñ¢ ³<Ô …¬^dz#2å '`ŠÔÝ¥h ¦Àò`µ¨#>±âi¡8Û!ÖÀd(„oYEu0ÐÓDÃyZÑ'ª-Œ+dBMÊ#>$…YF£ tÃrÖxî·dyþŽ“¦˜ãËÁe¥žu>iëÁ!Á ý'jx©S©×KÞ£K-fºo(áZ_ƒ[8lcM(˜—@)œj4³Á­›ŽtjUÇEïîÈ—-ªF»î‚ h—Ò=aº+­ “pÞÁ¤–mžEœ ‚D;"—Ä8ååjï~‘ |]FD7dy(–ß×r{ñ.gÞ\È»»u]ìRŒuá¹Ìû¦èÏD¤8QÊâZÁ²«’Ù®#º°HEÀˆaŠß^¾5âzw NœrJ œ;!aˬ\{«ÃêêF£—.¦Ä©;–?K³­ý$ ^í¡žC†è7dd"@Zžë¯.®©64FÙKyÕÕ+ïx®“çê°³ÀXÊ*©(Vª•TÅk*îg:Ioísz÷û<ö÷ÙÌ“&e[æmvm·Îªi¾­Wyôž3l>eT;à¢È¥j-UE¹?$”^Ø„Þ1D1¦Xú)[±å­´&D“#5#5&6ÖðÌ3êÚœ/’@y‹i²B6Æ‹îúhÃ#2ˆž6˜ÿ÷ÓÞMEÈ8e<|#57ΣCàä©—ÔIÚék|F}ŽÈHê ˆâ‹í1$ É¡vÁ,¡KÑBÏ“ß@ÓWÛË9hŒàYuY›O@þf$|]Í0é©Ä—æóÝ¢p0m4ºê²‘°È¦ÓÉÐ*r¬dLSIý›1õ§iƒ+aƒd#ªµÀû|6xæÎTøi‘KÈ»éÜ̧DË“<ù-š‚‰¦f­cm¨2£µË¢M«‘ äÈÔ„ë ‡ Eƒˆª+e¥RÒmz÷‚4#5™›ä3Õ¿9ÁD‡ÂZt#Y §ƒd#@šf÷J!•¼)Ù0XôCr6³Æ\â€_(ˆðíQ£cT½Œ9¥ÝÜ›êˆEgü>qt…˜Pj%ËÂY«RWîbšô^zGxíÍG¬¢Ïw|Kfå|NéþæÖ.H Þ½n¦•[Ç’ ¨xÚbóglí«àã ´3²9ÜHJFb,mbÅþßÖ•9$×è‰v´µÓaÙ¤vÈ#>B_DÚ¾V·–êS»’榶]‚à„B4@ê<µÅ0øç;¨š¨(ÎbÚÐü¬jJJYÉ{7O©rÍ9;9’^Ùƒ5w7C¬ÔåÕõ³&ïBè“#QY9:õ9hh&Ü!f»Ø¿Ü%£âŠ(Hpx? gÕ£¿xBå*€”4†éƒš A"dÚgu‡%Vh)˜øg fú\U8Ðm|e´’V¦¸ßÓŽaB$‘Ù&pü92`r„ÊŠR¢4E·m)±‘G‡¢#5þe¼Ð*v¯sS(¥pùVÂíÅA9W#“±`Mä{#5MuË}ué(;^U™ùáÕeÕþünì9"gylåÆ×kÑjâfkÍçm_c=(ÈÆ-hªÛží=î¹"ƪ(à'd ¹]4‘±¶²PîSæÓB{šÞ(²KóÓ\|9ˆãòÕÔ}Ö•Eæ• ?° œè¨ÍͱÔÃļóG0ÚÂ9·‘/‹|6!µK˜w[U·gpD Ó-²0¾m™Ë»’ѾŽ¯F6Énd{ ù’Ò È”8œíÜtH|Ç`õ³ö'ŠÞÜD‡gÝÐã·¦¶d}Ýä©#20€S4#>#> IsÀáóz{I„^ó]£xÎݨఋ&Ð8B‰`¦ÀÁñ E‰Ï *Ld>ßf¤Þ¨A‡3SRÁ“‚‚ñ.”Æ”]KÄÊõUR®)‹F …•b6"òÖ`°?­™  Ë#2C#2”ó¨,(Ö”31KpÀY ‘É`º&S#>6êp¸¿h@ ÍB¶È¸æ-!ïÁ§½éÎák9r+¯Ù ÌÚ/M0ظ!½q‰#ífð„™˜Èk/ªèg÷[j¼ÿ™Åê㣓dÏҗ†÷5Ú¬h°1;üÜ]Ëâxª#ƒð¸L´V¥œä}õsPÊSƒœÉfeÅebܦ<Ëìâ` #2`ôhò`#>=µ<á?k?mvºIJ›ŒÛ–Û—:ó­Þ.«ˆ,#5¨ÕµÝÕnT€ÔQ*#>ƒQBE#>"JÍŠ5nmnW6Õªéi]4#5, ŽãéÔ{½2êD/(¦®^¨í“¸ßo\ªF˜#2|£38·‰'@Õ®a¦s]ÕÊç¨ù6RQNÒ $&‘ƒHЈŒ¦L”Í-LÓ& š“LREQi’6£~ÙÖL%m"¥*&•2Á’š(˜QVI“I¯~·)5¤Å’Q4ÊÙfdÆf™’3"¨ÛJM…ôwQTl–E4bFb“$2Y‘CÓjè„ÊFÅ b±*(¢¤ÊaR¤Á«#hD™5¦)¬T†R‰I’™MBR•ˆ@ÓA¦VIAÆE‚,ÓGqNô›ÍÞêœG”¿`ÎÌÌB`ù6ø°LƒàüÙZª¾Œa×îyÙ4–kà Ô+#>n1èü™ælCô”Áá£WªBY+9¾é‹é3@»yn\0ÌêwÜ»ª.³¯)Áµ1b†ŒoIaü’óʱˆÍs:»“»ˆ—zÚ*HH~Z<ÞT˜£y¼(®|2¸xZq¢\±À@‘PÅÐÂέ…î…}¬]»"M1wCoÑÆkH.jtphŒòÔ-iˆQéU #iHD4-”ST¹qÕ„Xä\°ÄÁDžY3®(¡©ëIû¯]ª}FNø lkn¶Z‰š q›#>‘‚D‚k¦ƒšæ9Ó9Eˆàɨ¬•„ÈY¸Ì!g(gÏÈI ÍHŠÖ¹ØdÅb»îmIßá›S%Ýú¹DÉÙê/ÌHðúüPߤÀ·1\ÈAº#5¥’6e¥0-eƒe°f”ˆ35#5¦õ¦‹MÖít­Ýñ7®_2ƒd±‰Bz ÈBFD Ó³Y+ŒFÌÚdŒUTQ‘=¼vïîòíí3_¶³`,2L Ö»&pvù³³ÙŸCÔÍ7›œa‡Çq+I “!8´ÚÒ,i\üw`¿×\¸7Î^Ç€¨aÙòúD csùñ¤}Í\KÏ翵>ž ø¤<ç«;jt9Ñ*J•Ò-ÛLš)G® 04k’Wð#5¬Ži_窱%Å3íÓ/FåŠDK8=ÄB!»#‹m…ìÑuƒ=ä>ÓášËaÝ„i"CÄ€-¨’$ÍmrKý½ßuÂGá2ü_ú0ï›ùÀó×´QÔB)x2ÿoáwwëÁJˆêúïskÃ\#5Éã%„ËFrøÃêíýW¬Mš19µR9û>Áîf˜6–4Ó+™m8v§#OPƒg×íuj#5qꂞاŒ}­äç‹0'HyÃ)¾†ØYº« ëeÖó®PÓŠ#>Úo´Áß« Óì˜sZsy ÙlI?[ÆWÑ­ò`µº L¡}$Ž¶Ôuß•ñ˜Ë–ýˆ—Ó,éÃƬ¡Ø;æšwEæÍy%ÓCA›^Fy++‡á1#>•P¥÷>;S–𒕧´âNȭξ­cq–ê¿s¡¯eW¦öeí¬“cºvšÖ"0R¦Èbu+wY°¡ÕŠÝ^§X™´6Eõ)Ó¡¶ð0½ø8/xeº’*ëz>ÇÈï@òÏ#>'Õ×6² û:öÖzørònÏ>€#5Ô‡W˜Í[ìÕÔO}{¼N!ÛÝcê÷zF7 ËîúëïúλIØ¢H‹ïM¥.Ro#2E蛓‚8„†Êù´xáPÿ;2ý” ñO¨:ó¼ùÔ±ôU^Õ-S€<Ý9¢½Š{1d,D`j‚ÈÊäƒZƒñ¯ó§_•9q0vøý^ÛJ©$"TšüÙ˜|™,ÿŒn›ˆ›dIä>¦ˆèÈÖ0®5©ãf[ ÌàÖ›cfI¦(=aU úÖ8Q“©]8dÔWŒºnŠöȾƳ#5ñ¬sˆÙ£zSR«2ÆéÖgf¦L¹f9ÆFèÁfÍ¢¦ZuŠŽ)aE–”‹ üüôÎ+ìsK1E¢³›šÍfšqµ¥×SZŠU–,1c0¶Ô]=vÉ5^1¬4®Y5^8\9ÕË®'8öî91ULéñ:ª©x—Ä’*Ä92ÑÏâ{»B´C7âòjÆ`gá¯v„À„ÅÒ+$j©WÁ‰Sj¦jZdpH´Á¥(´Á*©Îj®šŒD hIÛ¾‘2]zâêlGü&ðäl;Þyçã!­ß(ºÌ[ ;=¨ˤéOrðfç+%Þf58„¨HÛE‘¸ëº®†¤M#¡#2Ý¥*ËR•èiva-$¾èäÅö¸Û]pPš“DDÐpÚ“Š#Œ[gƒg¨ L\¿a•¡òͤÒvvvÙõºÙ‡&³ª?*ž6u´ÆÇ#5 ǃ²jØW³œÆGÖò10q<—fŸ4¦IðkéŠÜß8Ýe7 \pjrsË'œ–ës4û¿±«6Û#2ž–ÛK=Ñ—YÄ5 b4ܳP³áɬ@ºµ¯õ¥o’„ËÜ¿êѼ´ð®Á#3%Ì>ÐÇ‹ºNÎØ›ÅDš‡ktZŽS§S8†0Lô°*}a§±M#5vIºá5•éÕ=N_n°²B⑉—=«Øã˜uVúg ö“™xâßÑœKKéñËÕAu9¸/4D@ìhë#•yxÄ™eÆô[ѳw¶k3“8½®µm½È¤gN&t§t;lmräTeþÕ¶l¡y®3\û·ÛcyžLM×-¼¼p8ûB+‡I:Ox“ aöY­FªsÛñAÛBhÔæ3åÅpf‘¨îñ½ÜÅ5Š\sÖ÷Ëçœf§«²½ê0ï~jš.öÇÜÜÎr6; ^ª0Pù~jcgÙ¥ß 0¼M;©'mÓLêƈHë{ÍÌaG¥Ex&hÊl3&F#>lÕ#>4›Ã¶ä›”"F‹‚ÁJ!S†“s~hb‚Gv´¥]Ck¡82%­WÆH&ÄVpÒ¥ÕAA”}F#>0¢á¨qL}·u6Ô)¼ƒ»ÔdcqÀf•Cø¬*¥ T3K#>‡‘C:|U„oå¬Lݤ°Trü‘ʾ9åÍ:aÝÇ™k(”gÍ““–ÓF=ªúÑRn¸Þp‡¾¦ yx[2˜x¡‰Ñ/&œ’èL(K§7Š­$ì‰i„i™›¤3†vçÂzxŽ-è×PÊb„Rm™uR^ïYè€&Dɹâ â!ðCe8’6"IÉ—‚Û•]9K‡qåC±ü¶ƒ”Räíµ9,Z”׬›U`9l„3b@Ì$Æ&ØmãRØ^âCSs¨R(›ÌòÛ +KÛyÅXjÒœÄöQ)‡d+j½(‚ïX’Þ‡††Ss ¢SÃ0¼]¿YÆ/FYq7Ò‚xÏt¹i—…ÒÌ'L¦œNÓ9—´˜w½ŸÔ©!Fžy4*^8·lS wËf”,¶U®ŒÖvÊÖULÅ##5=´åìû;mºsE ¹ÆÒ¸VÕ™Ñ4–hÐLÉâ–A¬&y¢q’QÄê[ZXek ©‹MRNPsó¼VÕnbqá\#5klºƒé3^“Ž9àå%…eOt¡¸7™ê0Gøü JŒd© ƒ8ôÈŠOø̸G! ¶úùNu¾$cm%„â•ïˆ‹Å8mP~¬`X˜© PØÉÆÑ;¾g9u”y+ª¤Ý´KŽ\! 좢"ÄV1#5ì&D˲ñ0—1 #>¡%sƒuTàòÙw•$«™)ÿzŒª¸Œ š)Tº‡¥&&¦fPÈd¦x§³µÌ§#h • M‰sÎ懜嗉l8hœøélÑ77Žd©æÇu¬SRÁ·ÎÍ3zfHèkC{¸ÜÖZÖ¨ð­TÃö§);µ#âUx©ª•éôÇiFu<ÓuÜSˆYƒÄâr]Ôéæiå½n¶™š$õ¢&N]÷ØÎV+wå[Ó»åpTÏÆeí‰Ú#5튵VŠÅ”ĵhL4h®\1ªË^yU[O°3Nð5»$¤cßmk\êºÜ6[5—ˆõ]ÒdÛ&‘“Žgd™º‰ËµŠèÙêfõPéÀ¥BxÔÀ&£CeÍe×SÌÍð=²¹.Ü.W2fGΪ›E"^¯4a’L[§x¼E@ô2‚(—º+¹ÊR¦+.1³&Y2÷JÊCƒ ¸¥í1!³§sÀÌí½¦ÓBæ¡»$;ªÎgyOˆc^oL^ïa8v££§,µU¬ºE£Ù#5ÙG·ÆaãÁ®4wõ@Ô¤q…² 6ë9l¤šnjáj„ÎjMÊ›l[@pt\”z„JpR¬0“¯!†I#2ÓáçKRô`h;AaÓ•J„Sœ‚¢MK6ïeH1h©±V€ìq…G)¬ßMFL4IÄ‚I—µNã¹–Èöð±1)ˆD! ¡KSkÂB¸D¢ç&lºÂ<³†Í,5ÑBª™¦#Ù@ƒ–w9ˆ!ø5·÷u›QÁV·Ú®—݃"^hW‡®yeó3aÔWŠBQ9 tì‚sÉ©7™žD–á®”Ð.0u´£M¦`4u# Ô‘ôÌ(çyfoSÏë:Ü+¶P¨Q€öÙ¹+Naa¦c7RÌäŽ&Vi1mÒ>5ûÊt`@¯Ê‰˜®¬1‹}Ö·®»¬ZhoZ"á;J?TÁQkƒm¹L€æ‡yÆò2„åÛ 4C6CƒÌ¢i×ngm^ðè¢{>ê#5Ä<ò„êœ"x ;Íó£e2Ù:$ºád´ µµ@¡ž(j™ª”Ó!†qah&pJÏuDbÛK«8`F#)2°8ÔÍSƒ0™Z¢efn ÖêL¹uŠbƒ 4dD#5•J„Àá%%¸Gkµ"áÝ™ì­t£ µØ’Îm3WfaÔHÝDpÙZ%Ãä—Ê”$˜B#>At‰E0œóE惂ŠC J8!É’Ò-à®NpÅnžy*``ëRsCW‹8¦7CdPe%3Dš jÀÊNi„®UÉ›ÄÙ3n*H>.P.]§=¶ÝúvÖwá½wìøQÜʺ¢T'\sb‡ƒ#5Z-1² š®3‚aTBìeq±œ=Fxæ\»#2zà*¤!²Lc#5˜6Q¼‘j‡¬í‘,îÜ¥¾ÍËÂM*vFŒ¼@'8ÌÊæG§áG“ËSãönuÄä×2H!¸·¬g;3~/‰ÒÙlpNZÖˆÆ(†F†pXÔ’5ï$­Ý¤³FÒÍi²îµ‰VL#>ÙÄ^u&³rgÙÎmi˜¢w\[ô´¢c#2ð\-Q÷ÎDغÂ=#5p»ÃŠ Y(.®ƒ¸-Ѭª‡*‡b5€Ó3šƒôÔÂC4ãRE¶Â´ÁÕ#2NMÞ0±‹Â,zÜÎêÃhÈ#'¢\ì!ð[‘„Ž L[”; 8V›'a<üÌ7™=ZÝ.K7}ʉX«^ñt`Éš¨Æƒ#$Œb ƒ%…Djµ â iZRš9î)©"ò›!AVc   ñØLÒLºäèwGX‰£”dË#«*ŠaMdáÊöûs±Ciº¸Åfåf³t išoý¼²‘3AQ¦Dv” ÚŒ—ݨ`‡d©\ëiYê8€¥$%9`èd@C©6œ#>Ô³<Ö#5#°©¨5Ôb†–6©À¡UK„rŒ°TUNÚIk‘î½m¡·UpÚÝd ‚éa64#&œŠq‘wÔÕØÚU=9»;9V0SR¦Ë3U Á`園À 2™mÐ͸Ӕ±c7<·%µÓ1a±Š2ΆÉ;¡1¹RŠ˜n”ÑHu†«`(ŠŒBÈjáÐáF8ïå¸Ä’íå@ÂÝÒÉš3Œ—´7Œ!°È‚IƤµQĉ„â™!°Ñ˜†ÔjPdêÈlgGBƒ¢S2f¥4‹£ ×@°9F9ɪl™BLñ#.\]Mí–²&F£E˜À̺K»aÁ¢êdfÓ &©HáGMM$ˆBƺ›i&ºr*µrGrî¸ÝÜQs ¦'#2š¸—"Ì%‹b4ïPlÛ;‰#2y-‘ÖïVöµïÝJ•bŒ”Ñ“5£ûE#2¤VJ?nòþbH¤ #2ð‚¦ˆòfw€Ò§MŠ#2rS64rP(ÿº‘‹Ñæ¾~Ç5DÝáUøw&Ü#5±† µ5©ƒç*—™öî2 Æ ;"ˆ‰º§Á§ ¹þ"p1Œ E[ª”±j¼ÍyW˜€©+ßÔ@H¢à[s¶à§D¹D¾e¬wLAîg;•¶À™ P™ü¾9~~FØ#ÐϹö½Sqò&í éI&ÔGTéh^Ú76}¥c&{ô>9ÍNٔʼîYË‹Kw®R™­ÆMÞźÊ(»aÖrûmpâ…Xq¤o—m û,ö±èÉ‚ dCñg³•#‹´FPg-T¾µ‰Í†šÁ©’Q“KA ‡PÂ7aÄêG3<;ƒ6iȺ¹É5¤í&Ü=D€uÇ!’xq,½Îé@Ô¨á w•ÊD‰ ðC’‡ûìíaD¡¦‰R$ª‰QÅðŠÈ‚ B6`BBÆhCd^>ˆ&¶êÌ"ÞvkAÎ#Qµ6±[KišÖm6ûV¾†]¾©!8.AÍ#>„!4¤[YÚÅ5u±ÑP‰FFC,µT|>`lr‚Aˆ!æ!@§ZwÉ$G‡gÏšø>A@T8üÜUƒlJ‡è‚J…wjìÅW]Ù››®›«®l ~ØY cô5L$Ò5ðw¡Qçþ©à=„º(ÒÿØ¿Ý „¦;ŃÄÏÙ€€Ì¦}¤:Çä@9Îpí ÁœÈµj(‡„¸‰’ŽDCé!ó†e?€Í#2â~žœ Îð}sheÌ>Òf\?Iþ“4º‰ü„ìs; Ê7bbÅM=§ûþ¿©ÍÕº¡|„|³ ñ»£0Ú…Ù%4¦²i·’âm‚óºJïw—A#>\MÁ*îÂôµC­ fÿ o@ÆÅ‘"i‰E‹zV‚áGˆåf#F˜Ž"àÁf؈-@êôqךš@'2‚EjƒÖØôŸ™‚€¿å ëÁ™‰ö_×ë —,^\3Aè{¡”o$±‘3QÞ|lNøŠh’i(Ö*cF£kEh“F¢&EAšfm#T$R)7ýü/–N0¦À‘}¢}CËæqèÒ´AðDR»”é»·ÉrLƒ%ê.Ž§‡Æ‘MÆÏŠ…¾+^Œ*FL¨)>8¢Õ6®(MR#>*¨Pumµ4nã¢Q4cˆ IZ %`äUÕ¬ ††©G""m ÜßØN•’z_=ïGÆΦ©¨AHL°w=”ZO šÿ¨=† ö>TâîÌöW…j¦—ì°­˜ü4•»‚e_™ ÷>¾<bS!ÜYxR"³ÄòëÔ®#5amu‘¼h…È5“+p-ÁÆó}ÌH;þsš"´˜ÒÇZH²Ùðíc—¦µr®•_;oRôÛÐ#2ÓX‹²cÌ¥,€Ø¦ŠÁ7V—-fˆF,`5þÁÆR&lcƒ8®åB+K£Rô¾8Œþ#µ-ö±¤°XÕðî·Õ¸l¥WAÏ3" §w3Ê—~9O?Z×ZD™ŒJqÑHŒ=h[#j³Š;H@†å 6ÚÍP8cÉœEN)Ž‹¦“Ë$AÄSbYýÓ0]Ò3lï;1lùŸÖPÜÔž‡«ÜTÁFVID´…YKÅÒº·Œ[4õ„$0&F…Á‰ ÈȪ¡`+k%EñEù¬ø ¤tUQ‚ÄGS¢fJ»Ê]‘P‘€jüýEUª¯ž DaÓÔõuW#5ÛÊþU èÓ¹x«6Ö4…XIŸª"¢ÙúZ«–]ð«2˜Ì¹)™#2ÓÝ8ª –Ђ‚u üÍŠBbîQ#2ïHZv–Z_TÅÈ´±‰yûÊSNH¦§gÁËï6¾#2‡NºlcÃ^ÜQÛ2±¼Ü®1ŒmôÄ×JF¹A1#5t¡tsš3Á3hnoÉɺL‚ê™åÅ°Š¿í ’p‡C™mVÄ&E»1p#>ÞJCê¢ÁKŒqµ´ˆ¶§-`‰Í.WŒ}(×(÷8Àœ3³ŒŽ›>x¸6Þ"m)¬ƒ´$™™Ãe9¶ø=ƒÜrv†Ùק%pß;*EÀµ;B3Rp¢Çóé8fØ/¯'mrØ4w #5‡™‹•‰Å Ôí8qU[ƒåotÑÍŒÆ.áz…aÏ|¦ P}$ã-X&#„Ixy)IC±Ë^,˜Ìf†Š&ÈF“ VJ¶-“ek5“£‹«‚H× ‡lQІûTjHÍ9¥.Ap¤Ò6â‘s²ˆläÐ4``X.±ˆYʼn7W@Ê)f @aкÐ!Èn5#>¥„""„LŒ\j¶Ól%áà aÁ L ñª·å±±*HsÉçD0š¤ˆ-[šl DÙ°-´´Þ#2¥"+ÅPÏn`3÷}z#é*‘·ïÞõwÞÚõiÅ"‹ÊQŸ‚¥Ôc}ľX 7=DøgCb¾zyv\CEÉŽö¦ö¯ÂŠ¨¹ýæ#5#2QéûN#ÎŽv…#>KºikÍ1F/ί*é¿j0À“tO>]KÆâ‰ô°…¹ŽÌŒÖ@É#Æs$'©ŠnÚ¼kô›j+bƨ­ˆªÔm­56“km{›ZZƒ#"BGØùƒšêPÌêתŒ½U‹ÑóT®\µñ¯¬­Wfæ†u²Û¯®«‰£|sxE.©Ì-ŸKüAŽs]°^ÎÆë §ˆ7R˜GM—hÂIbE#5±‹í§#5gˆ•²™y2­TÌ:Ê•.)e¬Êu¬½æÛI²†Ò#>Ñ#>bxj\ò.1i¥j”DÐÈmˆi`dMc"6‹¶]36­Û†¢ÆŒ)1…#J#5¼Š›—y'2fŠÂ.#>t¡–³ÃÓ“U™ÅÆ o^vä’Q+Ó’“<Ó†¤Ý72^,€!$*ËeàÎúÓÌaò< ‹EA ¡,ywXÚlCFØ‹Xz“mù›7B6Zv§\rӰïÄí›kˆ»¸Û>U¡j©1}WYÈ 31:­ú Ê77¸vDæYεÚt´½j¨i¾9åöÈǹÂk”šÜæ¾cZr”ÎNºÏÝÝq:øUšd“Rµ•Ò)Ý«‹À‡#>¤5ÛDŠ„„>4®^Í„Ù60arpQ™ªøšüZrk˜ Xd‰V•+kM©ZY´J“‘ŠÅF‘6å솢æëàó‹«Fªì¶U-Í»6ŒDr‚Ó½e½sM}ì¼¹T]—…îTŠ¥¥!ÔaN+!†ƒ‰@ÂdKYK‘µ¨‘dJŠ¤ø…†Ê‘"E‘Ê#‘¸.ê7#>Ú Ù5ˆÉ&XJ ,(-¹;1OëiŽs³¿8=S×tê"­kÏÌ\ä®îª»AÝÖ.ÝÔ%E‹»«ÒNzòñ¬e’¦HÜ!²1ÜÊØ2&Æ…ÒÍ75t*ën¶éÝ»&ñ\µëµÉ–§›®ó*òlLi[©[†ÅvZ6%KÌíýgÆ÷؉8RŠm5 ajDÑd`@Ó-JHYMe±¶5¦ÌS5ÔµÒ¬´Ù5¥™²ÛgËo›Íäf£jƒŠ™EmhJŠ©¥&Ù‘%öï?KòZ9hº¨ý1«›bVÐp¥Ë w0NØk‰¨:‚„L_3¤´C1J"R¨#ÝÁb‡/ª#Àˆ{Ý`öç‰í!]:Gö0¢PÅ£¿– )˜fkò7}™§–È'r6é„ q9ƒä( ¾`Ÿ fX NʵƒW0ìÑé¯,l#5-Àº#2ÕÛ!£ñ³²$ÒJ›$ñj´ßIÇ4ÅSÕäwå³Â7aì#5ã‹IF)â?søÙ;î—¥Jª¢# ¥E. RÁù¨@­#5‚)†T£NÄ‘ ´»N)á0󷥂]K#5¤ÈÃ3Ÿßؽ¶‚/òN„ )úbk7Ä#>X6•¥SkP3€$­+…¹(ÎDÀÅòà‰€Êcßo®ö–TÊTH\oç¯wù^|zösɇsÄyèg¨Y« œ7vØv7ˆFNˆ?LŸ>ÜÝ…ãf‹ÑN•ÚÉ.8Þª[ÚÿK×¢a¦m€i®¶‰ˆ(øEWÛI{â嬕z “ö²hl†èIÎ÷ƒ^Lû”.(Ž :aÂë&ã-]Jq­j.­h@[ÅOòSrHIV ƒÂg¤Ž^íªXH,IÛ✚𵄅ÅYÌ3SQ£ËH-¬ñØ 3 ¾M9ø¨}¦¯àb¨–µšÚkRš­~møý¿Sî~cííÝ#x ' åi~¸Šëã2¾ÿ£áûÚb9\§k”’#2„ðÉAaã²b´[HîþÏΨÛI4¼ít²‰išm•D2i$ÜÖ·K=ûn¤SX…²LmƒvíZå,Õ6ŒÉKi6Q±©K"še’¥2R´Å,ÛDe*3ð®ØSme3#>›C(ÓmkT¶Ù¢*õÝÚ»¨¬“Ԯ멵 };]¶ë^Ýv4TÄPFDHÌÍjÊ2Ô¦µ%l¦£(¤*¾vªío“¦ `©›ß»dÍ‘E¶2[mT‰%ý³£TÖ5µ¼]T˜›E“-¥$š–ØÙ^¼ò¼)±6›Mš&i‘U¥¬(ÛilÚMîãm­+c´xÕÑY²Þuvó¹%mI´É¡\T×VZ’¼YkÇ2Å4É#[BQ¶ð»´Éf­¨É´S")€Ë×/Viˉé¾T•Ù>RÀ¸­,)œêÈù›º½]šp&¦•[Æ7Bz\S2I„Péõj‹PZ9Löúú/±"!ö¤ö9KJbö ZSI(é0•­2ŒŒ!#" Š˜†[©C1XJ|;¦jZm,Í5£m¹TÀ9YG³†ÖI䀤QE‰bDL¢ QD å0V—™vŠmn[_.êÞRÕÒÕR Qd@‘Tjq‚+e"¦cØ‚†”ØT×{@d¤#2u"ÔPÔ•¶[66b–™LJ´Š‹JMRšµSlÔÊÕIm†”ÑJ”Ûâ·(a€‰2ÔVUi(%FšRB#5¦ÙJiRf†™Œ£##5[(¦ÆÉ’K#BƤյ)T)²¥)’Ô–¢’©-$kJ!µ³i¡d(II‹&Ra)’i’ÒÍY¶#TEY6¢–&[I’E›kRÍdÉ£JI©JÕ,ÖÔ–­¯}µWvÕefÖ›IfÖ’,•{Ë[]56kjRÚ²[mbD D,@ ÀA#2¦#>2)l[J[µm¤MZ•‘_(ocR-Ë‚;xÒÍÑà7ß“ôt9oµ½úÂB0Ê°T+‹ãs.9¼wë5ß|ûw“‰XŒˆ#!"Á"?’$°‚MIäú¸“úžÝM'¢ò-I¼Œ"¢…Þþ–ÀIŒ\`§¦”¤©0zO˜R‡H#xžõ-Q$#óáǦ÷3|Ës;̓öáUq7r拦.ž¸r(öÂC|ža Qvãçëäšñt׎äm*ílÐf_rÈÏRèªoÀ䥴”7Ê¡,µik]Ÿ41Þ÷îÌ4nŸß gÓ•¹ã‹Ù×(t(a!^`…Q¦(É!È 6­«8*©ˆ3c\#DjKô€yŒ~b>ôLþÉüÀ#¾FòP}&í®mG\Ù7E:º‚•´P¿_«Á¸ k×Çd‡&gJ?™cãV.šûèÁ‰¤û2à—AEAc„1Ò&¡ÁÇÂVú~Ä©ôqJâ‰û˜¤Ò¨kKà8nSÝR†;éíf\L;AFã-ÇKgVGbFˆòö+2槃CÛÞib Š¬ø”}þÈÓîÇY¾¬bLœ½YÐõ]M1¥*ƨ¥>ª¯ÍPµpU†µìë¬uþ*õΖt; ú÷™‰~nÙÔ;qFh`áÂe¨%f“Ü0Ë=Š²UyØAã-øñ­”c„q0ß5šÁ2©21µ5#5 Ë(x‡VÊï"ÁV¯Ýòú^þ¶Þݧ#2XÔ€!˸#2#2V*£UF#5·Ï*î»nCÔáìëo£V«½¢¸–5‹aO`AH‘JÈÝ)t^g=×ß‚Ý•W”WF=óÊü¹ž´,ŠÀˆ 'enr0£Ï ±0Òࢤª#5„á§5ÒeÙç¾mR”ÒÛwkZ†¿9£Æ¢SôtÝ¿â ‰ìÐ9—N>—dz½v9ÛÖîΞöǦ»wùR˜22ÇÁ6MPë"9fݾ—±mR÷MÅV#5RM$ƒ 3?Åþt[®ZtB¬SÚED”Å–*â?±¼µ)›C Ò´ˆå-¯–­îV[%"°KK*¤– ¦LmrÈÀFa„Y~F¡XFÚF4ˆjHõÄE¯¯P•d:8¹Òôk(ô"Î#>® }4 ‹ i(„ÍwT,l{µAäBH 7ƒRpäÓ·kÞï¸êb¬B¬^ZÔ´A¡$´AZ€n#2Ò(FñTÆø„#ˆÙïÆ.Óª¶‹Ý£]rÄH[9óƒö}a’ Öv3ìÝ«‹ðúúOHtOÙ³m3¨A6‰õ_á‚Óð¿ƒ8ßÖç$çL¼•·ŸU#5-y¼Ž97$± z§h_ Q‰¡²I4n ãÐS[&”P²fhß!¼MûR™2Œo¼˜KHzIYS*#%g»ü©›Ðød+)…·±_bÃr&ejPŽj/ Ý#2£{,Õ^èVÞ¬\“ës½Õi5¯²á7H»¤+Ø1LKÁÊ#x5T+ƒë¢Ì¥´¯£«`.§î6ŒÕ—f;¦#5Ä'TI×$Z,$ýkbÓ41ù°»gا hâu‰Jéd-µ¯³òäÈ0A!#5&hhZ,¡ˆµNŒªŒ«*ÊìaÛ˜ŠÈhnP#>9ŒdÊh÷Ìá„ÊQ#5ö®u<4×ƶWGYQc´@Ú€Û— B¡§¦-¬&M¿è:£‘ká æf±UÄÐPÕµÕ©¸PgŸ²É&0®>ºœè™¢ÔÔ™8dãJãP:&3‡8ñš.>7-céí¶ËŸ2 ª1°õò„áP¢©z²¥uãa€Ñ€ËT^PÄÖnG¾Öüî¾Ðú•P˜#5#2Ài `º^aodáV)È49%.”M1ë@eF ª#55jÜ–ÿNy9Æžü^ò9ÉeQ­…›È†eÊAðY‚à=l&f#2 P±„Œ#ÔN4DÁ§zÑes›'bk³Æ|ém7 íÒÅ÷ߦ3"XÑ8[&eÍèæÆ×LQe*x`ŒhiðÀd#5šl$|f5C†áÀÎÜþx‘¸d€‚Û ÔK·MÎne—0$‘$$8\Ûj.9‹#5´"[Ùz!®Ï)¹4œLæøñcDz¶WmTKê èS¸xœ%D 525‡tð¢N<ÕXŠ¾ª)W^ž²ú vž#5ØÚfìÖ‘î’™SW­FW{èÀms‘ÄŒƒ ÙM5#>¨‘‹‚PXP”%4…[W]=®ê)‰5e¬¹FD–“!Öå™3Ó‚Â(p.öã(û#5óá±Ib¬F´gЋm÷µn"™EÜ=#5å#2)­ÊNŒ#>Naº–ßOµåËc3ym×}ÙÛeRøÞ]ðrTåÇ«NzîÆœq»°µ6²BI‰­6‡¬;© ºõï¹±1¼Ü)TUU#5XµÕ¡e°Šœ*“]$Ù˜*©Œ›ÑRê´økŠ‰’HFYm +Dq¨ØÐ#…Ç™mÉf—<ó­‰ã­?›X™dclp I%$ƒdfqÅÉ(ºU4ÝÂÖ“Z)Œrªrs^A g2É‹=Ã@õ£iOdòŽÇŽ»^$µ#5Ú(‡ Šð܉öo˜Ï\h±ññ¿qíÓ§.}}õ¯Drvÿ”ÓÊT*B’$ øñÝ«ƒßɳºëC7hĉ°ÜEï0al0ÊeÚ#aõU™Âgv—ѧÒinôêJ56¦ßXÅb©ªYJ©ê•T¨Ã;qŽà“,#]šïÓ#a.4Wõ¹[fG' ;Òï!,Õä2¥w$Ø9ÒÉ2N®>¯i¤ÌIP$#51ŒÃã‚_¯Ô;ƒæ¹ïä¯[Þ)É@Nýxe!]àøa™¿ÆÉñÓX˜`11!#2b>Œ™%ÊLm~Î…–À5*Éš¦#>²0üF#5's³Ãª´BaO£;ñ(×€náÅ#>qTÁ•RH±@‚ˆ]H'/7wO“IS>µËLŒÊÆ(ƒ"rõ溯V¦´tÆ™±”íh­iÝÚ¯…Úוë©êënknÍl™ä¼gvÈs—/g”+ÇNu-HKG7LLžÝ0¼j“jóšíç“Qƒ+‚t¤ CM€ûuöNÆô™´D:ÅWæ.§t]Ú=&cï÷ïæ:"œÄQ€¹yjkbOGcÔzI 2¥!¹#>¶ú”X¾Û²Ÿo­ÍEÔÔmpºT÷óϨ›_–]çn ·Ö®,Íšlñµ»õz®Å¯›®ñ`¤‹qu%Í1NÊ¿{YêÑ£&µY‹¯ð¥ IIÒé’Æl7bÙ¶Ù5½Û4ѬHQkWLÊλuSe#4­5×N»E&§t$rLÆî»R6Š¢­-¿·5¬E6´m´U«ãJ5kÒ½7©£j¯¹¢¢ÚË5¿‰ü¯x±«IµYªm¶Ù+eé:.™­ñ.I—#2‚*e‹C&µ÷ç6%5)ïÆ–L°c®ÔZ9 ‚nÉ"¨¶´Q¼ËtÛdªjKN#xΘ låÁ#5 ¬ïÆL’ Ühh¢YÚñ¸^s¬ =#5eÃc ´Ñª‹†%-¦¡>}œœù3™ÏSd „$}üPIaÁäp48»¯UÍ1…¦1-/DM ó„ · JRóMu¥(C‚²L%2¹”R}áyS?\ l[à*Ûv·æf5ñˆ\ˆ¨¼FÒ\§1Èi—&,Šfô6p:yzèÈCu7ì÷wr鹵ͦ–îí*¹vcskšM£•n[;m¶ÝmA°uøòŸè6B†Bgì“C˼&æó‚ê3rÍÈùT9V˜ê…Šà+Ù`¨E@ˆ@ĈäYQ·®ß4î9ýQ÷‡$Û‘]Y´E$]!+³x‹"á#>’€B‚+ÄC#\ÁÐÎ'xjŸŸMÀq4Ì,~Oøá@À‹¼4ƒ°\ - ª):þ9»d(ؤ**‹GøÄÔ‰üX.9+Gã•wövõÿ‘5]ÁòÓÑ9f“ yœÇ±Q– ¢(H£@_»¸E@>}Ý›·~/zËÑ{Tlð$*9æpqüÙžÔû6œ³çoÇûoDuúÇéµõ ‘Ä¢Y5®)€sÝÏ›~v„ï¾,=#ÅÐ3À{©ç#>ðQV‡4û¼¾ò:B€¨¨:¡eŸ81#>èW;ßœNþè>îã=Û¯š[šKÉì}9‡`&D!¸'d$“¡¸øš¢›|ý#2t<•û}AëózgŠä~ÿX‘’@dF¾Émiݵʭ®•­¢ÖÉ\D¨"¤Š.§ŒŘ"ŠTVD$B ¹)MCÀðÅúW‹ÃxŠ=­- ™«lB]J&UnÜk2$(·¦ý‰®a­:Ï•±îSSOÕùÞ½WV,†"O¼z$›ÓÖžô£°9¼· 5@çw"²þ xô|¡ÒI"H•#>‚œÂ#D#2z­ÜZ)Ö^ôÅåz‘T0ÂR+–—¡D‡wÕ«ä|ó ¼R¨Ä½cÙåá¿tGbÁÁ/Cœ²Å÷›`§0ÏÔSh§Yì,¨aIIäßå;m¤p»‡ˆ (;FÀÍ­ŠøiPJl‚*BapÇÊœ?l#ÿQR@+ÈÕX²#>‘ˆƒ#>A*hoæ5óÞà~a/ð¨b¨²UJm„]*§õÙ–3 M÷þw–vCQCáÖøyÛ^9„çV/ÙíáëvÞí\µâž×sW5Æ©o'ɵ$˜VHa–…Ñ hÿh—·ö.SnªÀ¤"!M®€çŠ#2QpÇyà-ÃW\^&QV,«h;gLæé´6»`ipÀ̉°YH(É‘gI3Ymq,bÀ#«KIô€Í1 28¤ÄÇH64‹j³y@ÑÓÄØƲ²V…R5 ©ˆÞ7ɹSÎÖá­^ë–¯ŠÕmP)#5Ù%1HD]4¸KMÙ)Æ(0†"EÝ,ÍÍi`L0 º0¤²n×¥x©6¯6÷[^*ñp¤Û6ÕÓ¢˜Cj†ŒÂJL¨‹m`ÌeiVXˆá#>Á‚Âd´¸p` T©h[ j…±i—qsu:o1h$ÕƒÐÖغ½3[€¶4bÞNîÎì%͹´ZåÍ´[+º,m¢¹nWÁ^1$Xb« Kl¢¤·fDHªÐÛ41ša¹Ò‹£6µ6u„ Æ­;D°f0™££;wÿCXðÓ$$i¾AÃZ±1£Ã Þ3ºDíËá·$0eŽ17F H-kj>CØx5MÓËXÛ9‚DhcQâÖó ŸòâŸÄ?dü°h…˜IQ!ÈQ| ’(‘ŒÝÿ< Z®]ÝËÍljji/:í+^mŒÈ…FÞ:î· tÛ¥›T™bÅËUº–ƶŠjçIm’Ò¦˜˜"$…„€(mâªÀ%©RADGôN#æñ†@S‘aÞ©©!c!u‘ÿOÌüþ²ÀmûðHªYÁç÷WÇά{ÇRQc÷/¿Ôf¹!¡êÕ @P$B‚F’L46„G ‡$LD Ð%ùèK"e V8#5%ßøétŽ ìA€VD*ñTº‚E"'¢ë¬ñVOŒ¤{€éäm¹†ˆ:Àú㽃õÇ(…ãzªˆH’*üÕX)¤KŨ5#5#`ƒ‡H)%oOR•,­s\ÖôÚú–×–dEÉjÍì®l…ª=¦±b #2Ø4&Q±™‰ø2´ƒçk_#>j5£=»mëy»ÅY‰I&ÛEV’in[¥ðøõé´¶À6Ò#5°’#>¢‰ŒŽ,á¦ÎªÚÇïåÔi¦ˆ³"ÖÌeîQüúÊ|m¨…*é….IŸÀ Q$2‚Da2“0ldˤŠ ;±Q€+Û§ŸX“K¾OÏ …#2ÙT/™fldݵd ˜!Ufd‡ö;ƒ(q™hËÑÁaÍlREÙºŸ>REÁ ËåÝ©éóàb£Ù¸^ÍuüÇç‘y5TœQ¬éåóøõ=ÚîŠÕÛT'¢ÅBÑ»,dÔ8›#ÄÌÎ"C†¥‚ž9ug]‰õÅí‚•#5~Å•#27UÖO@}GÛÕ“«™h CgœwÞ=ðì%‡‘^ȶš%IT ˆ°iiJj±Z#5¦½åvÆš¬Ò¿$Õ×K½¥uA™©HEi…ÞGqÄÀ«¿È¸dÀ4Ù&Q@ø5+^¯©]cíðÚ@lŸFÌÈf¤Ë7k{#5®†š#5Å2NÙ¨û}1ì2o®œžO×#¨¤/Y#Ú‚Q–ý‚é]rDeYÊçø³¡–Kö$gB2ëÖκxLc “j)©ÁRiÅÃþo#5ËÌg8¨«ËÌH8TpxBA„:6ÖjŠ¸êBY7\$‰‚VRÖ»f„CD³º‚ ÐÓô›–±YÙJ‰Â;(Í–"#5öƇ ØP*hä>‘8ú@@ô§Ÿ±ïî‚#2Dîd’IHB_¹åú3×8(xE#2Þˆ&†÷SSA ÍÍ~r€‡7©ÓÍ u(hñMÍ ãD)8a)©£³tà Qi ¶dþ_›xˆoï68Iv9(üfIË^\@Á¶æ±Œ;‡huEý{ 4-#»mWžaÒ×!$‡ï:b1”«E :pG&ú8¡ÈÒ¨#2¤…b?ƒ*I±FÌ6CF!’T"‚ (@Û!).TÎöRŒª”? þ‡Ž:¿·¼Ý½I’"k4#5„F,f郧>õm“8éÿA #2?÷ð_õYfcJižêq¡„š:&×Áe¿9ƒ½;ØlxF}H«&ËÀßž›ŸQF¶kKùVNÞrŸZz#2CÚümV®¹î2PûWêúƒÛ$#2e3´ å0ôAR0]bE¨ÅR”’…©4”Li”³Lŵ6¬µ3 D¤Ì%ƒ0×çÊí‰$)›”©&i6–~«Và™¤V¦fª*VcX£BÈT”-@•³J)²UKVYfMimMYš¨Ëim•ÑbE-FÊ(ŲÖR“fÍk4JÍSTjÚXB4´‰Zlµïªù_¹ý[ù;zE>ºaýªÒ^œp›å²Õ!UW#2@tŸð%‚5$E§5Zµ‹]JÖ¹­Ù¼®*ÅY?|H”¹ƒÖ=éÚyöòÐS’€èݨ…J„Š5#>1IÔ¿üͽ¿‹f5z·Ãm_a?9xZ„?ATdWåÆ‚2 ‘U-ôƒ]·ïÉ„ˆ:4“B¨Â‚LÅL(ÀÐ~£ã0?“Aû&Ð4‰"ˆ„GñæwX^\xÛ‰E[Å…÷ªƒéÂ!íõ'ƒ¢tH‚uA #2h€Ô>hâ! j|S©«'ð°3âü#>S)Em¢%B¢þ5Kr(•a¥ºDb*Tø)•AHbà ÚñV3A„ÞCt~Þ;h3þ¹Í“£¢ù³x¤› W%#2^XR`C9©vv:À&Hø¢Ï:–×,uÄŽs¨•zíñ#>˜ã¦YVØlçº÷ß"É–•f ܯX597qžƒ–tÂî×1xf¢»u Ä ~ùÀÌI€²àÅKÉ…##-Ô}¸·¸ú")Õb@Dñ†‘žãÕ“$‚î!Ä©bˆSÌ<eÒU¬ÌÇ„ ´hêÎw4/P”M'>¤¸t·~DÔÊÈ<ˆÅlt[Ì[l$2Vî0›f#>Î^%zQZú*øeu&bÒ[CK^ i´‘±4¸˜5‹œ>y‹Q\`B+Xˆ­ #5#5A¸0i¬[÷žF5–¢Š,ÜX;/ÓÍä}½çFϦ#÷Xø!øþ“˜†ZV6¹À”khÙùóúàÜûäúúмaó2Ú„Ó܃„¹ÒÿkV #2úÃDŒšH†±lcÃÇI’I$À¡C¢4… "7Ûôé»~7ÚÓížÙ8ÑRq”*¥UÞæ•×zT¶dÐÜSD!‰è …r©aÂC“|ß_uLš¤(Gˆ Æ#5F¢Œƒ+Æ¢R*Sáòð4Ç]«]£+çEËcR †PXÈÀX¢±¡;Ú1¾ôÍ`bþF»Ó‰B„íVðI’{¿ÛÌM+£X€~.õVÖÆ«HD ‚F3SÊË–°RŒ8•cʤ#M0Äì ”‹/—»Ûö`цnŠ3Ÿ,L t¡HÐôø ŽXfj¢20ŽHÆÜ{xÒ+M•†4’ˆ`‚6™'S@mâ(Æ0MnÓÝqo8=’ñ 5³%çRbìH[ìð¥,#><}m’ÄŠ ¤)Y®ÔˆBRz%°ΡHŠâ#>c¬h‘£*¤‰•/¾#2dRéõ‰#2s䣶ÆHò¨ðõÞ~ý.yæ^””Âb…8ë0Ž3¦óxÐÚäËŠD›PhŽ #0è\Æ‘I@÷(ˆhÝÛ±Ù8bTH”g¢ \i¸¹²V(h´ý„ D:MLJ•‘„*$:.læUÈBŠHRPØíÕf•®•tµå¦ˆP…0$(z˜6b"«Þ)ê#2J3³ÃÑKÒ\eWAØñô™wv íwÇÂz#>O*«6)Œ d™A2j¤‰VÃkYT<­ |õ§ŽQ@Ç3P;6ûÂØ7¶%ˆ¥:ÐLkP@W`9‡Ø€x( Øîß5ÑPêÍÔ²R¯Ñû#>ww‹êÁÝÕHs‡#¢ ú÷Æõ½tpÕxI„dÙ5TJHÆJX”«ÆäÝ/òÉ{îûÄîUa:!)!H7TÏS(d–V%€²Ú*+_W•æzÞôJ\ñÒo.S%!wžyCo¥ÒEz]ÝØÛ-¨ º3ƒT>Î6QdP÷µÄˆ†¨R#>"gAŒ»µ ÓLé¢ÓRìædÕ¢6(ͼ²Ç%CZl¡º2Fا4œët“.ÞÎÊ0‚ì‘rE=þïPw´%½¨a†;hT`æ¼`¸ÅÝ%}àÂ…“6TøÔ0*—0þ\MãÐÛm·ˆm,Ë•,®c‰KiÅšÒ~ü»Ó¦¢åúušFÄ€.$$| bX|ÄX|F¤` UmƒêVÄûmœRÂz¡ÝlðÛiNýÐc@$ÓîQ–nÌPaÞ™U‰ådÓ\;„²3f°tºÁ¬¹p¤!–0£1’Dc?Søæ:#> ŒœÊv•£<ðçz]#5#2»ƒB;ïNQ3¡ÞHnkh}*"àWÍ6ÌH˜›Ù S˜2³bK >jDé)bSø³§UbÓÛ:³Jáë]VÂN%Ö+.¨m¤cÓðu¬g®¼ÓÆR ‚GÊ#>˘ ãõ:†H3§l¸¬„#>uÝ5»@mi.©¶þ4ñ`$Oÿo ˜ÚK8ˆ¼#>#>%‰ÈºZŇB¬‰Y@ l Û-×SKµão6íœ ª,XŒ r›%#> œK`#>ÜG‰AéÚ™=ä#2³¹(a#2ßËÛ;~ôz#‡Aôêe»#2z@¬½ù|5ß›Èë=ÃnÖ"{#5sî÷9‡8ª„‚,„ sz´u‰ÛɆ‘þ8+@ ’­V%ƒFö¶#2ÁÎxàØ~˜þÊwww³‚ðäxé™5âyÞ†q7!Úü}®»LòOXlI:¦¥H…0)¡¤¤õÕ^ˆFÁB ‰¶“ñ]㦮¼ï&óµÚ2Z›Y-µIZ(ÛK3uÔî+R`1 #>ˆ–'€ËˆPüߧØ{ä(-‘þx oá[$0]Â-7„#>žž6<¹ÎmªÞÓçóŸ^õ¯ ´šˆñXm€Ï°•«©!°­cÃR Mô„ÈÔPö?oXSnïm묬nè¸ZeÃ1¬hê1!¦,‘"1#5¶*¤b[$R@¦E,¶¤(dÕ0@7V(Â6Ìz`c»©V²CM!¼jRäñšg½¤zò®¼¨1†1^”\âȆÎ\±iCUå1bUƒÓÖ(¶8(Û̇.6ú2j/ÃOm¶ñ ŒÛ#a¨#>0’6²Zp*)ÃX%ý­«@#5­½ lå`:Ý»DÝͲ9PòPy± Û ¾í#’Œ#.à£N#2{ /#ùÈñªT;Î¥3ô]€@MR£+u‘±Àª€pXÇ’ž¼Ë#5²¨þðq Ì'Ó鶤æw¶_ÍŸÓý„^¦·úg:Bõâ&Í_õòdÓÌ”LÙLmv< ;;•÷P”zfßW¸´Q­ù·ØÚó+,–QF²VÉ2ѱi5lh ÕòLo±•`A÷UÕKbÂÒJA•AHEÅ@üþ õ¬X,9”?§ÀûuÆǪ唢çÖÕ0eÀúCžô#2Eu÷ÚÍXÊl=E)Ë°êêCÛ9çÇ,±ÑD Séi>rv4}#>…µ¹ÌC:–mí6ÕQéŒB¯LÿmµV'j¿™ø¬‹iYy½Óáa©=k[êf·L$›Ù%ˆP½®,ŃÕñá¯péžžó¤éÇY󘕀Î&Àu€­)}¬ùº‰J€lHØÌ ê;uy⓶…Ç£œ ",Œc»<çÛ·@æ1`X£=•›È^„û&a26#5`qš¤v70YpÁ+\ËÏ ÌÑL´Hy_¡Kç.öú¶Å¹ô6H_ÁçŽæûÛvü¥ìyhîCßèbÖöž7{˜AmTÆ’g—Î[[ôàþN*UQáArÏç,¬ðç" t#5¼z†ðqŠú·ï#><Ðø`§X\#5ü_‡ÝpøEóaï8ÃåôÓA¶›ÅM#5,!ŠéKYS¡‚yXÈ…òó Mæ†Ù÷®ø²Ðg:kWžH8VXºÅ5¡›{Á‰´¾Ø+1©«·?Y„qEwÔ¢ÙGån¯¾€×ô,haŠù¼½½K·ËDë¢ /"Î<Ñ?!*e³o4ƒ#2aÂ#5;:Âb%¸B„ü‘RÚQ#5Ïü6Óaž0½Ýã´/nr|é™Nk\*ç'¾UŒÍ¥æÓÜ@F –ÖÁ6°„„B‰-‚ˆÈW<–LÕØ«#>€¤DP·¨¥ Ž~Ú#>C8røí{ö”bݼ¶CeCè­èà†ay´bOùþ’Þw-’ÙH6P€±i®ÚÂêˆÀÁJ•¢,”eˆ¨±$ ³êÏ:»Üuꮵ·fÛ[˜ ÞÌBK; R­!ðaƒéIdEnȤÈec:ÇcK×CÑË#Ðwð¹×ŸaáíN±õµ±z#5ˆ²'Tˆœÿ7÷pÎãØŸÕ>W#>¤4s­ºIM©€òæ›ôrß××».…e\CÙ‰‡°‡œ{c±yŸÂ~Qü\|8퇨5ÄSâ/¬¶UyV•.ÆÚÇÀôÁNñpn=²ñ84Óé¼\òoŽ! …”"G‹E`ÆŠ$$ΓkÉ„fƒ7qíhg3£y†¦Lâ`({56ä¢L²n6±˜4Sw#ÈIj¶"ýaÙ£‘¯’= ÐªúÚ°‘6Ûj×Ô=»#>®Èx#Pž"öt6P–SËÛóo Fp t¼#ÐÓâ$M#5N^#Ž°ù=´ª’)7K.Ejžôï0œ©;[®;jëšîÜ×[¬Õ4ÛJV¹«wnÕu&É-­škUÕlh¹•Ýx¼Íåݲ·–ªùfÊ5J›`€£"#2÷YÐôÃPÕSwiB]~©JÓ^²”Æ¡›§+u3šË‘Xa ‘Ã_#>‹’með`e&ÃÃ:Ÿ6“æÍã[ãî´ #$%«ÛˆX3Œý;¥Ü:Œ…÷ô¥×„¡%RV”¾cRÑ5×üÚŠÓí‘ѕƃ]÷R63”š† ua?fòò}CÄð#5YØÄŠY )AŒŒÐ1Ÿwëâ_¼_8"ºS=ïWKr' Ê28h£•é_$8gno à®L¬„+ÏÙóu‡ÂsùW ã¼}h£UžÂç}íøñBÆAv"¢~¡^’kUôt¢Éì† a&8'Køx¼1ò¤âô¯°këåwþM6-TF å 7´ë¥ÆÐ~Ü´ÍtÁpé1º¯!£ŒHýMpúÏpíãÂBðxk§»8\ò¨P|Ýòcõgü?µ¿€Z?…,NeF¸9µæÁ”ŒKŽw©D<`Ÿ7%ªB„Þ£¦ZÕÕ»9(ª"6­±0¼d!ùebX>Ì«Õ¶fa­~[¡ëP¸Bä·“A°¡±npmزÄ)†õÄ_9:8rÛXTH↷?耦±ØaѺ–ô>°Ú(Z‹{Ú9ùžÄ¹èYiÎR9'SS±Àt&‹j9`v¯‰^Ô¨µè:êU1#>¬Y+¼žkÝXŸŽŠ«á&fàÈêvë€á#Ç— ß¡&›OÆÐk’"`p˜lÈÍÕš\¯À‰F/xaèÓ}XØ&‘Á‹ÛAÅ@Â|Ý‘&$­†…ñ„ÕŸTa„NÀôa7„ºê(ïÔÒ7C̺îÀ²R`QŸ0Ú‹.òé$Ì/°~ÛPçˆ?± "FÄÏGD‹ýÍë9ë?~¹“ÛÁ“4"ª#2måð5Dû2?æ˜PŽÊfzO3§–@æj~6‰ 6#>Wpí#5U׎/™Å3_³`Li"†ŸÒ´Õ¹îâ¥v,g8þ'Ý!–bÂ7 äÐ1Ìu¯ndÞûDEÖ+’í°[ÌQx`Ë1JŠÉ^ù¦%›”6±3×` 7ùoÍÀÖ#>s"uÔôðTòÞkø´Péϳ²Õ†>ÈÇ3^XìŸX|DÙóp¡kýÝJôöqŸº} IùĈÄB’#>•åEBÉê:QÔž}Jf ëþ#2Šƒ–ÞÂãšdT$–¤¢´NÈ ‡¢Õj*ÕÖ+EbÚ¨¨Õ¢ÚKhÖKlZÒÚ©m¯m\´Ìj®*.ö&RäåÍLǯÕùjÓ¶\®À²Æ2 #fE†1eH*1‘‘JÅŒˆ‘8„#>Tˆ>G#Å· ·òÃ3ä¦ò#2 ƒ 3€yž£9'|çpšêˆdû@¤AÎÇò²F{·¨‘Ø2}áà µEõ°ƒE?+­ë¬\@ê/n#2¾“:Îí<¬I9êƒ÷Ö9Aòç±³9êY©‚åç™Æ¡ß©LŒWG~[ŽÀz¶HA(‰œPý~)ôbp<ã×oÓò(HÃqë_ÜŠœ#5ô#À Ü\CÀ)+Äo§Žià]¿ìÖŽ )üìPvŽŸ¦—HZó2ûò¾–é Ø2Úq#>Åãݱkí$)¥Men*(ñ 3îm¶Õ˜¨ÍNS7àÎÁöÜÇ(fH„”e­ÚQoٵ뮘% ƒo_ÍÌtíävžù#2±„?æácWP™™2ù‹‡Æ#>ƒˆ¥f1)ínI zƒlú¿+Ÿ\Š äÂjë槯K“™#5&v0‰%ͨ*.·¥ÄL qˆF/­œn$iÛh#> 6…‰B‰àP÷¡uÂ#5*ˆÅvs$çn‰H·DŠ‚¶Q€¶#>7”o6ƒ ÿ#Žý;-}ó3.#5À"uAŽ# Þ‘’É U š*µB 8îÏÏðòmð£ßŠôöp?žéÏ3 ÌFB‚¥çuݾ>Ö”ÆM­ðVÆ·ä_Š|ôÞa{åÌQÖè‡í×ÐÃíß›Úy/¦2é–œ¬µK‹EXÏ‚9O SBC!S*‘È”Û93É°FQ#5b…+ r#5Ìåç=7dX´#2Ì_C÷ØË–  Š#>ª7±æð¤Ï>ÍôÖµì®í?»æîúB÷Ü:#>â$/ϤßË¡Š¢ÜŸ$º›½»ˆª^C»àcÆmz™ü•K}—è˜@Ë–ØÅQÖ¢nqi˾!¶´ÍŒ#>Ò+lC#2ý,9Mó5¶-´añAÁÍ\Y³rîÜ|;®»´Ù¦ìň Ç7v!ŠÖó½7›Îu½+Ãƺ²Á#5fdZ@4Ù#5J©KK ÌTbÒm*f$†”ÚlfYcÌÊLÉ­”¬½wo.Úäå]ÝË•;²ƒjŒJ48ldhªÉHÉ6êZ…1¼ë­ðõÞ޸ͅ4Ó46U¥sl«a0EM‚d@ZFæÅë ƒ H¶Ê*¢1GqJ–#$i1¨ÁÒpjÕ¡HÑež¬Æ1·Z†ÝÓ²a­EZln459úê­c  o#6ÕºÁ)ËCIëÛQ¼›M¥àMÈŦŠU ªÐßLMSn8<í>^yÞK¯Vóv¬U…izÚJ(È×ÍÝ“kà·'¶½½]§,tÒ¨mÖH8 £®Ý:jÌÆ‘m´XÊL%ÚTZÍ“j4(ÃÃÊ݆ŒC¤.1Æ4Äç8Í…#5ÝŽ¸ò•©HVQÜMq&ƒs1™ëµ±°Ô†H/“Q†™öØ—;ŠÎ+L Åј4w‘#>>6(›,Þ£S!à'NUUé›bjÆĘûÝؤ[ÝÏHc˜'ÎÚ™¥4¡¹ìò†—í´aŽ'Êij G#5Y¹µ´`ée*+S¬Ô=q@6Ít‘4Œ›#5€oYdÕ˜]·Ù@LEG¦d«¨d*ÂÌ•Kè5Îô„.#5Ú‚  ¿9}Ç3H¿#Œè6õwR2ÀÈÒ]Kªv9/ØþžHÞ~¾Ÿ´g&SL#[ÃB3²gyê°¾ö.yªïtléá†Ël]3£p˜IC…]«fÙ¯£Ç°…”46½äCuÆ•h+BÁÖhk"Bu¤ªmVo‰¥Êz§¹ ‰MÍë$4$îr«! z6U†•#5\"ªH튒ƒðõ4qœ@pQGÊÎ&Y¥ekwß·Ãweï´st¾‘@L½°áXÄSéÅbÒ/LÆgàeÀ¡¦&0|Dœ*VácT•VíŒoBn³ ð«Ž%ó„j8D8‹©bâ]‰•#>H ¨¨Ä†•!6’@.X¥·#>nFn P%_W«‰å)<ºò×›1iSYeQšI•&º"¢Ò&Û‚×öÁ î›öž>_!g—œŽ0ú™K)(TæD@ºê}?[T+¨ÖKjŸÅÀš3_®›±øq½<ÃÝ#5ߺ(‡íœPÑúb Y…#>â\u~Ÿ³ï\o†-œß;ìêÚl~N~£‰·»÷Î6’·è}ûž.Øîí‚ÊŒª‰ówëGUÎ%Ž<ò9ÉT¦,+µÓØ᪮eÌÑ!ŠYkr7§«¤ë¶ÛöQ*œ—¡QMÒš*%Ñ5UN’’:3*eÉL –†£ËNbìñèLWV;AZV÷7tn(ÌD$–‡daÌ׊ÌVÑ»/:®ÚßcnaÓŒî8ÑÃBƒFbhË­ÚN“Uœœ#5ª°(ª‹ek3$’óa¸V­´¡6D®ª¼„åçC€ï6½b1¨•uï ÊVÛRðªZd‡†I•\(à‚Îß}nCp`ßì0X›…â\aöœCDŽ#>7@bi7ŸŒ¥¯Ë-Ä4/DѹÂQ#>òè54–¡é¶m\ßÙGðˆeÍFé_J¢È‰¢R%—RÆÖ e„‘!¹ß#>Àa¾ËŸŸ5#ôi”.¸{lŸ»O»µãÀâÆÎ`¡ä´·#5¸Å1VŽ¬õ5ßê÷‡°0bÀ±ûæo©½Aõ!óüýCì}ÑTmä6âkɵÕ}Ñ¿om¤‘@8 C(±‹H¸A°`¶‚ ½²ª½ÄyÀ2A$$.$Qʬ‘²FÒ«Éæ·Ž›&ñWºÞ&%ªð[WJÕæ§KkÇ®ê,mb×r髵oŠ¼mã³2êôµðË%‹H´ŒT©\£Ží»º¬ZÓZkÒÕxÖòmi76%Eܶ(E„’Ђ€`‡Å-Á‹#>eGã³WàÓu…õºØW!j–_Âíb¼nV/GÚ0[Bñ@Š!#>T`*0…#>ÓX#5Z³ß$0¸ª-Õ¤ œXÙa¨ÞþZó‹CWˆNk]¯m¯&h °/K¢KPžùÃl±6H-@:]«*êÞË[m©MM“iî.ªdSeh*Q3M-£lZ-3*-F¨­™´4cL¶“RZedĪX¢5e- SoÁÖíM•¬Õëµ\,î¤HQRSðÓ2@òÐÐ?ȨÈW—|õ­¯UäMª+ $‰ ¥—è;7_ß>ÿMÏ_Ÿ]1æ·¯gÂÍÇÓœr½äÄ=Spn…|ÃÄF“° ÎÑÉ_ºëíï¯V­´±µoÆÆÅ4Ú#5µ%L¶£V¾•Êúw®¡e±VÅ*¾ÆÖÜ-¬—ëuu£Jõ¢¢¶wv]v×vŠkmÊ*6Ö¢’Û–æåW*î®ÔØݵjkY^»vk5#"JE¦uŸ÷HfœÎYȃe˜‡â}×h¢ûáD€CQ¢j€‚1$ÄäCRÈB²ü“ŽNJ:öhƒÖÖ¿C-Ûå†-ºèBÀ¸%.Þµ-½(J𘆠¼ˆT̺xFt<[ÆCe±gã>Š>ÜJ~âpŸÉ_'µ‚‰ñÉÈÁÇ5ZY¬#>ô¢¢0u¢C*"Âzf›$!ó=ƒ9ˆ¡ï‘?Ö×^"͸Á½«^Lf7?,q±Œew2M6ÈLB1 SŠÁ›SMÑÁ&˜fHó‡rm¾’Øq©Gk¼`ÜRy?Væøöúý7Ôc[é+GP˜ÔC¡““­Ÿ•oâf& q†*Õ ±äA­äŸ‰]K±²ú;Þ7B˜²^l/0A›äsŒ"\öäÚÓ²ŸKKk@ü§†i­3‡ae¶ÑÚå-‹ÔË Âw0`ᒒɆ‘71Œn÷9M`«ürvЬX2/pñˆHeúµ#>Â|¦„µwYh#>;TÙ8ÙlýXØ?oök*C“bÛ‹†ÅLáZUIÉ.‰Í¯#Z(ô¨Ÿ! ¡î#5CDqçˆ,,ƒƒhÛF©6ß5>êµtýô«®·n¢%DþÆö‘sÅ'Šé“XíkÉ=FÙ*ÛhÚ¹jÔ‘×Ò*€OϾ^GÏó30yzãÍÉ~ŽÀ(‚דõ6D eÙgJTFNd~˜—µ_áonõj½¤m^M²[f*{v6-¶(²[WJ·Š¼šÚ¯¸Þì!DVˆ® _*AÁ#UKrˆ`Ø÷Öfu’‡ä ®ŠRÜók[éŠÖÙ’c%j×Ò£Íc|½ô•^wW,)î»Å]²"M¥snòuÝ×ÖÙëž.òmxŒ"À’"@TA!È@ÍåÒýy™'¯by¼$K»¯]mn¦ò#2k-f¥h”à†ÁV#>!ê·3F *I0¬FŠ…Ä,*À–­4$#E‘ƒD F†%A¹DB€ž¢"#£#2i3-ãU‡òDfUK„°h]Ùá=!ºÙÝÊË!i"ÁŒAH¤5ápö’‚€·'öøzt¾’¡zëxÂŽ‡¥%Ñ÷Ÿ† z ím#>§>ó€Þ!*Åc>lÉ›tÐÈn8Üá} Õ²PçÆe¸–£‡#5~\³ã¢YÙØ”@:1D@#2‘PDð-!1*Þ­_e¯U[{mM­z_ÑÐó|P¾iôŽùØÚJhþJ5µŸ›–ßîýaè…³ Äv÷@Ò7>Ö5Ãɤàn§_ì$#2Q™ÖMX(kTQK*˜wÕ1d4˜YѶÕW˜ÑCö8#2Í¥rΆpzÎZÊs6xã:þ ëÇ']€u?ºÕ¨­UsI$ÓXp߇ ÑõPŽ\go ß ¨.–@_lSL†¢¨7ˆDLJ±i‡µÆ|ôxšÜÓH(6ô†Øõ‘¶·™Ù.X/Ƭh+HîËE$BbÖ#>€á‰¤ ÚÎ#>(节ªõ ñ — 2H‚´„2z­da¢P©bÅ9¦K“`¹`Ì}˜¶ " #>™A?0D|7R½=fÿèðù»ßò@¬ßÆJÖ ‰¨E{ÏÈ¡êŸÆ÷µS#2R‚9¨ãkšÍƒz|Þùm© «À0xDEzæÚºQ«º©n®ìf¯½®Ð!kŠ¡w¼¸ùA „ˆ•” "€™x#2’'–Zu~Û>‹¯ |¼H;u]ÕqÛ["™´;+]˜ü¡rî1@YgSør“äÅ‘dÆ£wæçurèË–®Q×w‹ÈlJQ—›­"Vl²&’FÂT©jOÒC\–@Œš’Ó12¶¿§Ö¤Íhlb+…‹†à#2þ0tÌÝjg•=6¥Ü¡îŠ’4ç>ã»Å5p?Ò›'¬ò#>…0XŽeDæŠ<¾îücÐå ÊxˆííÇÑžý_ÙO©+#ö 0SäKÞý=µú/´¼¡S-¡y3Bö«¤ìûš2fbŽl¬e¬D›h]Þî •šzfºj;¶³t˜AèŠ~6‹YÚ£a0ìÞ•)^ 2Þ¢PµÎŠH)ŒU¥ÒIk6ȤQpºúµ£«KŽ6q^û ¸=…TžÁúI{…û{Çve?†)¼º¥N>(’¤ðÁvØe4ù¡vKa‘‰#5@1ÖH­A(,”§cvÚ÷îÔW•ÙŽ¹%¬öµé±lLä2–HDdì6–2À¡#5ºÁ´“ikq#>•š••ªƒ¯X…±¡m¨1fÆb·–T4Щƒ#5ĹhQ%¤X#2¶÷¤ b˜UÊ“|fñ|,ÛZôÛ[y-Š[PØ„ëÇVì²]”m¶Ï#5Rñ™½ÈBõXÒƒóqg19~3¥C¸;*­2 “.š" ³I&©%04`LŒ»fCÒn;%|òÝãúHÌ™BLìA“*©Ì#5‹YIîÞY áC €¤”ÌÔ‹rÅ#>aVTs#y/#>¹Š¦êl¬'HfâÀi F@E-ˆç-˜x[³a¸I™ÈÆ&Ø0ûøG#5äèuÚ3÷f Ø«¸µ“!¼"—#>Ñr'áD'ï'_"˜('+#5 {ŠÇ#¿c¬ü–Áº"XT@”ˆ(V®›µ­$ R-!T t!%ÓKد/];˜Çñû7ƒý°Õù ¨uEE„Œa$D w)aQYKH*ŒH4J…PjˆTW¬"‚pŠ¡œÚÄi_~)šWoV—lÖÜ­¬#PZi$’#2vK;˜‘ˆ­ MEäíCœ>ˆfž¤ëq…Š}#>Â(‰µ˜=>·õ!_Rã‚’iF÷T7’R‰‹h„¦ÕºN3ˆiùJ¾¦FÑÈÈϨvEŒX„H6ÔAI\µsjÝÖ`(ñv]K&HÖH(BIb®´c0hQãcmÉ!+Ì#>Ö Zm6/ñX2,¥°MŽ\Z¦rwmµ¡š$´½¥Í¥e -iFž&ó©zžT;k¦ë#5ò }ÁMGÈ¥ôlÔ7šáö—Š‘4…A?n€ýqÜÇ=õz(õUÀR&(ïŠÝ7|•8ûj”dLD$Q@‘T ŠŠKPÓA´QJ}ò¤PHy„P*#2¡#>ƒâ(ó1'Bæ”Ø;ßË#2qo¼zEc¨%Ï·¥b“íôÿDéŽ59 œz¼„ÿŸŠÆ™ä>)ú‚S&Š#5!`©Mv¿q¡ú¢+ Á»ãÀEÔúÐÐ?ÉõÇ~~öÇö?ãß÷¢f`ð‹_QÛ0FÚ_žîžñ8Ç9ù™ãxÌËì=>ù&‡áÙ¢ªC6f¥‡ÝüV(«~WQ¨/.9‡ãNØzþˆ>äÅ1øˆ²Íë~¶„-ïÝ3ÕÐœ#>ÌÀÚ°û¢Ï¯Ö£GXo@46#5ài´ã”1„}2E*©.¨S.1waØ䀂„0XTD5Ám—•…“2‹ÁŠ¶)&l!EtŒˆÒ¯íž †E“šAÙŸT¾·[Ÿ#5ŽiÝÞ%‰™bIÅE^ŸYlÑ[˱\LŸ#>–ìíO4¾Îõ§›fÀ.'ÉcèyÆ”ã„Ü|K™“}ÊØOu!¬]}, âͱ»Ç9øq°S”#5ÀÓ5Öñ¿§i]ˆxÞuw^Y(îþŸXw.k#–Î`‚0DiivfT–¦ñ#rf_L†y±}ÓƒÕ¬8÷N¬“ glõPŸÊbå±ãù¤“2îªuOã‘âh‚ëæ¸Ó²#«pš&iÁQB™,‰)lY "GÜà3`ddD&½ÂÌ#2Ô‚fC‰.qW_³Ì{pÞ…qW¶·(*½o~Ó/e^>bòÄL…*ТèÔ#>Po3*¨9t³·»·†ºf­?È]ì„Wr,àë-n¯~n0Õú†ÞgVõƒÔR%“zh‡v³¤CÛÅÄ,ï‘Fš¥Ö/äôW©ƒ³X{SBÐU ÝÊÿsÛır‘y7f·¹TÉÕZdšqÒãÙÕ#s­GVÜ[z¢øž®›h{G<ÿ’å ÙË„¤VÑ>>Ê}°#>f EbŠZRD`̇Àîln¬Sº×†AN†ƒ­ýG[#5‰¾ýWûÕ×ùuÇeexÕl=e—iŽc£¹TþÆc¹#>;QL±Y1‘ýûÕ˜½ ü(žö¬Ò‚„E‡hÀª”ˆÆ«èkŸIÈÔ’¶I&·­Wòú¦-ñAŸ¡›soÕx¼sÓƵxîëmÊõ6L£Ieh#Ÿ+Rp䀲ɹ]$‘kyÃðų8Ñ™&?{}FŸ²}-7 ®66žq²#2Û[’°Û”†Þ°‹$[m ö;¹£™Å†˜Í>•i35m–"¡F,¡¢±Tn©ˆ†FŸÑm#DGQî.Pæƹö2ÊÛ1‰ôÚFŠ†üáDÙœŒ€•\®YlU’WÒR×;yoF¼i2„MÍ¡ÚÛÈ…âÅs­XžÑ òGQŽ”Þ‚ÀUë^¶€b†l3ˆªÚg#>€ ™1.IAwT$RÙJÄ7£(~»}qEiÛÅT´Ïg„aÒÃ@B‡‘¡äìXxOk߯H¾@ˆm ô„K Êèc;(ò$™ž˜3l×#y г“p±DsbâðZs(§¯·©ô×ô׈å8ª¡22~†C·ÚX!É…êUJÚIlŽÿN#5i<ðÑT¡i©îB{×ðOCôj“**I&ϧ»`Æäa…"^€”Óö€pÏ ¥›P„Ð Ý—xDDüØP#5¾°Œ†bÿo—å#>óU=å@\‚÷íûÁÃ$D>ò$€˜€„"©äæ‘~ñ{’ÿ\5E?¨VwÌ‚(’ H€HUPðà^öˆ;€IÍÇ«"¤{«ÄùW¬õ¦C35¤öe•›ƒÍï‚Hy°#«ÖHìG¿/˜ø§„¸€}G°âÃP¶àôDÈí¾e¸Šˆè{N¾¡qäoË¢<¾‹‡ï7 ÔcÄ<@êââ*Ðòº·Öc\À ÄF°Ë»š;`†C“&ŒYôMDdÞPHHœPÞÓÒ# eJ=£;¥BI 骾\¡\út9á3íêUCÝÒNó€&J:YùòÅ°f¨Ds8yqÎC,Æß0DÉ#2´€î2âO›Á(€¥â€È€ ‰ã%R!B#>DŠf}#5,ÔßPµŒ¼1~¶¼„š\ŒAØ?zf/Ð;3Du$¥¡ 5÷Œ•„úp‡8Anˆ:,Åƾ}¼þC2²’/J~Ò˜ÑzAFÚ¶g”-M-R‘Ú<·îô¦Jˆ4ƒ*HŽŒAl‹¨ðæ ½RîSã‹ ™#2ïîó¨ ƒ ßý£©§;Í’ãeSB'’¿eúìɬÌûY”ùîS‡›Óø!¸Í kÖEúî—ÈÌ…;!¿²æÖ›F¬‡œRí½¸|Œ7 Ú¤7ä~[q>4eÛ܇i÷^/:Òmi¼½ Ï6üÅLb{¹ø[ûŸì×û»H ³=t‡¼Äå-Ó4Z®ècõ÷á#>'8>Éç‰`aéea'Pi×à›GŽƒÃ °4Q L^c.«]p§Ë ^“‘Ê¡!ò·ô}œ+‚Žz#o#5¬>¾ŽgÏýyßÓò/EQT…?}6a%CESJ¥|òë˜îN»õŽé½c*©Ç ¬ë…îtö4Šýï´q‹êèh¢ë$QnI¦ÜŸ£ªÈà÷¦©–²ûªÖ±e(Ö¡»ßa¼³0µH D88D4¯χꦃNÁeé¥80–]§²Í…‹1]}‡Ûé]ÿ¶#e $žCEºEÛ üâô„b~NéIÇ[Tï]Ú&ÄÔÔ£ãFþͯ×#5‚@&¹íRE]² jÙÁ#5pô¢HÆ6~¼º$§#5Ù~·ŒMˆPê|Ré–”¡ê=yè:Q -@#5<œÙ§-ËeçÎýí]kJZXT‹LÖŠ´ÖVÅ$)‰B "##2‚wpÝdUh2DH1À¢ÒÅË¿ÓàlQM@tßæ~DÔ¢(9`{*Qi@YWî?[èÞ½'ñ¿'‡™#2›FeRDQ˜ 4PJmQ˜„˜Ñ”b#M*FJ&…&M›&Š"Æ*CóÉË‹îÏ A“fOT:öEùX£nº]½™ã°÷[åÍΗ±žy¹¶5/s7F@Í(©F’ù·Ý-žš e@)#2qö@ ûŒØ]*ý\=j¹üOà'²ÑL9lQ ß›M=NµûN{v \oÃæpIR2¾ÎI¶7Núsi „§âù??IèîŒ2d@ʶd0= Lm·¦q3ÒáxÃ`-®šMUNB7X1+ÚÌ‹$|v\¸±6Í]פîª]ÄÑWØ0d„ÔÏCžL.è¾Ò^Uóà#>¾ƒäqú) YFÝ#2ÓHœnj@Dh¯õ<`©1ckF±i-¥6ñW%RF¨‰U!$”¨0ÆÍ|ÝÏ0ú¸ä#>æHñ~ŠMnm%©¹…figÂYF®R h¹E#>BdöÀÞ\ Þ5·q8Û$nDúµ£.c.¤&‹™¦ˆ¿¾Êa|ø©ÂÎðyˉ´qAyfx&à!BJŽD3Êrz£U%üÇ\mpY7£résFST…SV®HF%¡ ˆñjU±O"¬H"m¶×®-›0©[8Ž!¡6…ZŒºW!fjƒ)MµUQE[jä•và 6R"´/[o$ˆ‘"7O-£a½e…`’-²Š#>IAœxðõµV^êíã·±e»tÚ*‘FäHT+ƒ’µ+amn!´Üj’¡²¼Å*£#5P´Æǃxb°iQ†#5ƒ@ÇÓ%ÔÐ7™,ÈæåÇ1¨ãÐî÷Mì!«½³5½îâȶÊf;±âÐÃVÀltjmë-³2dšKÓ4ú‘vuKMZU¬fû[Tc0ÝMãn=´Q¨6êÉbç)JÁ^"Ç[f4²#-1’[1(X–™…”¡±¨ÔFâÃfŸLñéa$'ݼ½x 2qçv–b5&ÂQAµÕŠºÒ|ak 2¸†h½CZÁâ†8a–¡Ñ#E6‚V¶¢Éâî Òcšq*4Ê-Ž˜6IÞ’êêå17JRÓ)†Fzw¤Œ£¬”ŽôpùÄÃ@À=J0R2è•àV¸ŽÈÃ,"H蜰%«IƨÀÓLA4¨·B™¢¢»CQ#>%ÍŒ›z‘¥C-‰Ö%ÖÍÄPDÕ%#2ÄÎ=bŠ|åâB$Œ3¢ÆaQ»Ù¤Œ¦VÕi¡,A@D¦í&qV¤¦#>¹Ö¡‘“"Lª†["M4Ï•´W¦Ñkšå™¯^vÕãI’#2Ë#>4•Ó"NÄbƒ¦ê!*Tûeº—Iƒ2*ùH ÛňkµVZÔB).0(Œ%”B¢¡¥–8áfñJ6òE¨(.úZ3#>#2¢C›µÐ‰ºTHéFö#H}¨cqc4ñ3Ù†¯I¢™°°(0zŒC!ÈÑŽ“E(AZ@f³æQ4«£Ó˜ÜÝ!ÐÀ™ˆ¦¼­jÈ Q![çÐÃ#26Ä“3•…ËÈE>Ù·‰aBÒtŠƒé¤T´§½†Ëmv€ctFFâ*¤#'¹!°ñ¦ž™6f9=þ‰5ÔÎVV(ˆi²Ë`¦DM1¥Ú‚ŠÐ22"ž1lÇJ$2"`Í*R®#>*I0عc% šKA±Bb\ÀcJ¤0H¤#5 °¨Ý[#5 bÚ¤¹baÒ1bÜÀ€² %‰¡3@ Ò?‘5H¡HñüNAÒZB¡!*‰®bÝáÜ7woù;˦-FJÝë«¥¿y×ÕÈï]å¼îK ŠŽü+ãož¾½¤ Ú¢Ûb…©³i›,™5ožæ³”–QÅ )OÚ8^4ÏZpß45TêXÅ‘$!°«g‚;åz?W>Ü †PT PÀ$DD$XŸ›Hº@.xä ì?$ w¡ê¥'l:í®‚`&ÊR…ò’«@¢O¶ûz¾±¶¤µi+¬Ó5–Z5iýP$ È"øé{/ "ñ©APˆwOc×Hæ<¦™üûîD0Ò °W!PŠˆÏÆãÆ€î:š¿Sm ªE gŽà¶4Äa)dƒ…”ŠEçT#>ñG#’6&É"NDV½µ·•åm»^](9ܼ×D ‡­Ha‘X ØP¦6‡hÔ95q°z‘ æEZl#L!=­$~ѱœ1 òi äã öÖ=¹™QC†A ãrT5º°…ê.N ¤Ì—5êþŸ`#ûd=‰›)±‰vw’ƸK·n_m›¨q¿g®&"Î&ÂN3žÉLÔ›IYA ­†m!ö†á%TXiòg†QÑQúiôB8¤Ë#Çl_hÄp•õ%lu>ý}%{Áž'#>1‡Þ N$#5ÑûtP€°Aòè('Iù#5z*™p^#>"g ;Æ—;æêIZu@­Ž æ& Z#5-Oówñ|uj ó•çr-T1%Ê.UìÞ‹$[!ïÛŒçMx•>®ýÞ þãë)Ð3Û¾ïéGé<ûó¤PåÆÛÑô;˜ wìªz¸zí8ÓãZ™ öh;Tˆ‰¥G0Ói"õ¬#>¨Å‹&3P>ËÀÍ#>2‹#5‚> E\9ÑNû0†•9{_@—Ú‹ˆ6F®âÅæì¸Õv¾|òÎDáJTW'…‚‡„¹VõUG‹®z”dûOpƒ4ÇaEdríd‹cZ‹L¢T•¨Å+ËíO=fnšÈsµoD†N¸sʧ9§\:ˆpR½™§ƒ¬1#>÷|’I†q©‡}"ÔHXƒº)’»ƒ~ë–šy=°¨"`6i)œm¿q¶ç{¤Œ’IȘЛFœ£×…31)ÏM Ù°Û7à‹v›cT|‚Ú\oŠB6Ûl܉½†Ÿ̘4m63™Xr6™­Å9¦ƒ•ÚI“ ,d]´R­À÷LÝwr]]»uk^sšå#5¤,DC>i YiÃ3#>`d2À̸…¥Ë#5-.#5ÌxG­³ÖD#2þŸoê(!½TÎßj\Ì*pgSzph Iûñ,kLGRFÐK¶¢Â~†³ÈßçHœŽ°LÜ­„XÔlm«íMoqû=Öô»¸¬ßjíUÐÖ1smt»¶âÒö_¼ór*4[{K\«I[ìµ®ÄÛ•ÝÛjýüÚá[Åhª*Š£‘\µ»ºé[n–©#5b®m¤Õ¹T›r¹mnVÞír,jɵ(ÕÊñguEÉnh‡#½.\»$Ç*õI²Ì߬.ÐaÌñŸL°0úÈ9ñM6òz¼ ú=±U!#2‡?zØÀ°óˆo"ÜÒ¨„PÊ#>(k#2õ)A•(|?Í̈.Áå×UWfóæúÍxØy5EESí€t~@Róª¹þe÷#27Å"i²üó÷RKH˜GãM}ó‡wg-ºI¤®î£u(A#5¤ E€-¦^ˆŒi#>&†"FÒP’71' ¤ÀŸm"`—QŠÆ(h6#dDÂÚ¶£m¢ÛkcjM­»[#>’Y$R"AÍÀ‘,ܨRd%ÛÜ:Åã+×0$d¶HÑ[lš¶+Yü+ñ߯­l7#5GP€?Ø(ÿè þ¨‡«®ƒ²ÝjÆkçØ'H̉>ÈD#5ÇÌ´©{ZPvqéRòQt#2ïÉ™ Ÿ ïSý‚DDI$Ta½+!Þ‘0‡C¦E~J:Pô=ûlÛ#2C®$€²#>eŸB R£þd‘B@‹m6Òl“dÕ‰†‚Æ-,‘šÆ’£f†Ô”Z‰•ˆ6É)4±lÍPÔµXª*ØÛj6Ú˜ÕšÑ%R‹™Sh‚’,‚0‘„¿ye¸§ÝH‹uÁ¬ÈŒ"Á¸ñ ªäoÏ)†,X‹D)ÅÌYF*Ûi…¡C¥po­2’ Fì˜(!u8•Kh«­²(Ì¡é 0Pc¬M‰¸Ûi’#5¥Iàã-¡Z$AB¨l-4^Í’SÚ£­r¤Ù¶éÍW\·[¦šU]fµ³j¹mm¡P‚-wR4_%D$IDI*%‹#2Ÿ—øs°a0‚Уm¨2¢ïÃÛ^%O]tÔÝÝ;³‰Ö—è+±½-ÕéÊmo®¥jmSImáŠmj›C¼XE .úhŠ³C׃XZŒþkÚM¼Õ‡? ¦}U¥½ÙHHU$æ½U"È,0¶›}ºB‹>iÝâá@S#>hï°ý֘õ,#>Ÿ}²ð›ïÅL#5È&1´evv¥‡4ЖÐÀѹ7Î’¢#5Òdþ¹¹}¦é°!dÌ.^ÂÛ¢`‘H᜾û`@›ê…Â?¿‡+?$êO<• ݹ}tºNæºQ¹ÕÝÞ/!¯']uu¼²êl)äÙNÝ›qŒã¹mÒQÝÛtR_¬ê*Åky"ˆˆ·+W5k–’ª‹FÖµÓm¹j×eªçn¶é·]Ô±dÌÓì=½M¯@[,©#>Bcß.yîÖ¤õ{?§–#>VFjgH¾#5»3,š¤-”}ŸÃ]«MXéÔ ï/•B7û•D Ä%¸ˆEÔþ?ØYž¿nØ”*yÙÙ´¥.Wöñ¨®±ÇUï5wm&í¾ñUýêóö½c]!žt’®sÛÒmró&!1 Œæ¥c:ûÆuBXävÀ³¿ç©ÍëÄòDá/¶‹G²[,ÝTy„Í·Ã5™vÐØl˜*‚›#(m·;Víj·#>ÑÄFs1Y<*@ò(NÆ‹ý¸'ŸGgã$qn#>ÅZ†ZvÝ“—öåcœåÈDQú $A¤#2ØŒĸ¦Ö{*RåuÉTO·½Ú6G¢K8–9EÅGšßÃ=¡ÊR)€uXëÏ‹ž²Ö01¬^ÎgŸÀeƒ¶iºï‡{àÉ£Z3Šfæåö8sQ˜ÄÖÊœà4šŠN··sÝå¾#5çË|êVžžâožij“b¹DWXfBfà#“žÙ¬Ùi HâpåÛiï³Û&å÷Ýú¹L|~ß Û´ðÚ­>ʈ…Õ #5—æUÕS! ‘ñUµÓ¨’{% Ý6¦/·>éÉ~ˆÒéºk“wRr qÚc0ze˜=É›©ÍÐÙŸ_Œ÷â¢;mJR­ÑH™vk'/ÀöÕØ$&¢D´>½inM˜¥ŠYJ)댱EJ‡é \ãJrƒ#5.éý¿ÉnBQÊn)ªÜ•Ø÷;k„Σṵf¾å<¥¨kÚZÇr¡gýG`Õ¬µ¸v÷Áo¨ÜTN½êí²Ay.NW¾¥6»mf%…«‰y~rAå‰ZnÇ×,wçZCùmð¼72æŽ:„8Œô=ĶãrŠ!,ßcÊJ—…´àÚG¿g{¼K2MçEbô¨^W7/²cMžÑPŸ™>]»öí¬pé!š“°h¦*7®w¢ØÏGÃäää7åcƒzšA#5‚ouÇ•×'šÏæÚÚrS³ÕÅ¿Të³}ià6¼a›&AÒfb6߈¹çMŒ½†dJо=ûï)¸wdj!šݼa1ädŒìÕÆb~Þ$—8šm¶6Iž#2ŸSÔðUVjë[šz¯N4£Ø!XšDèÜÖRLâ zGFÔÌS¡²Ðy!©?[ðwäZäèß6v3ª³\2µy½ñ6!ƒlGKÒV]]›guëàÆ„uâp¤%p¾º©¼xÖùËN¢ö—¥¬K6Öñ•¯7ÑPyfs)ÒÞ#5ø£É±SË™ëòö®6Âèãs¼'i¨ H¢yx¹¦ãŠi5§Ä»»ÒVýó^X®ãb…*Rî¼ t%AÓK {IÅÌÙŽ8EãOöŠ1ûJWVðÑ.ª=Óo,ê^ë·ðžo$âíZ;¾Úʯϗª56þ3ÚuIõîêË:Æ ÄN$Î3úgàŒ¦òï-»¾+dкß|’RÛÎfG~ÑH‰íïO^ÞÝg)UÇw•´ª˜^Qê,ÀÜæ§×²kn5¯+ÛÊsɬs¾±¶×ÙUìéºÄî‰ÝM^Ï Ö—wið÷H‘w|©æÞíÝáÜÌÁÚæj›ˆ£9âß;ç%ìäeøÞÝU§Ü‚sKž1HwàžTÂužéß_ØÌBõG…ê‚L½˜vcÝAvÖò®~éÉÝÑc•™}qí1~Þì{½‡ÑãÈ7ó¶,ãDˆ·³cÐ3‹¹G+±„ ÈKÛ­8£,g ‘RD±9¼‹=ægMÍrêZ0˘¥îœ#5«Œ0Ö;®Å´”Å#5ÐÄó†sáXq¼+·™}ó9–*r©‘¼$Äåî§hvÍí7áLÉ`¾Šp4ïvÉY3Yç1†oX‚3Ê“`|q‰>%±C18¯VeÏh;òÅ»h¤¾tA/°<Õ·5e¶ÅÆÅÛYdíÉ/b#TvÐÐÚÐÓ`'Þh¸'¤Íèǯ®½ 1 6°b+4;1è¼`ß² cM‹‘®hAõë½eÒ&èWjŠª70”ß1&i“Ÿ3ŸM#òúøTOT‹`–h¬± XTìÀ:æÓ#>Q¹ÝðíÝšAù ÜC'4rxëOy%Iåù•X›æ{»hÄV¡Ø6mræ,ãt@”Ìßµ»oQw³šBO‰âN‚Ý8Þ#5°†(ÐÈìó§@П¹P§‘3; \/vÈ!f$pQʬ"(±ŠÂ*U#2rt뢹QHàk§:ïáÇ,·éc;#¿¡½è.Ù 4#2DæŽ|Ldoç*N½ØNÓe4T:d¡`Ä#>¨#>(¤ ž™k™ëŽ<4L¬‹*Ф[Ì«x›°aÍç#5§=h±ú*¯HA$S(="…C(Þ;@±eÁñïÙï;½ŸL^N›ã‹|>-ÏS¾`ž_P6ÛøÕå Zx5š£„WÈ”ÎA…|©S8Dà}ôñðe±hM¡àÝu[…s¸Ù££yt°ü!'o9öžmåÁgiê{!GBŽbùyÐtŸÙT¯~d.C×hæ¡èrŠS8JbªjiÈãœE*~ûõ‰§¶ [lûOxø®‘Ä=­v궡 ÃxÌœcÜ6Qv½þ\=ˆ€­àæŸë¾épxÓ_dÌírñÛ;HJ‡šÂfbZH£?¼ÙÈ…Ú7¾€ñ;£ ŸØž]ÁÍ5™têiéoMZµÎ%zù¡"`Sã:wuO¿sÇbšÖ‹NÚ21D“:r;zv”¶±iú}¦b+OWÝOdP2O;ñ,Jí³fM(‡¬Îªhªß¼¹›sN™¢[Ž/bð"ÙJƆo¹ÚÈ¡è±ñGs¨ ´çhÁwÊðûè¶uݸ,ozânùpäD#5qK,6bK ÔbC€ŒD±VG*¤À¾ú`À¤ÍKc}‚_·lÎêÚøö*Žå(s°¿‡–ØϼìLvnÆL‡—½¹ân7øÇnó‹Uy»›N9Ç‹tŽ ½>¬KzÄK¶p¢ÍgÎ1*DyK¿¨îäôpÒƒ›˜KÍäˆXÛÆIÆ“ˆ÷‡\¦xø‰z^î= z§KzZÚµb£Y+T^“•@lîæp¨X‰ ’!½d33i¥6Gð,–d4SAT*ñ!’cpâ¢ÁÜ0Š"r~E¯ÐeŠ€ña㘅«n–ÏöÄÜ={'ƒ Žá:fï_:r.QdhÑ£K—m†å/xPý²èÌù¹>#5ƒ…Ñ뱶46³¾u’ûÓ]@1SÒYqÎ3DQ¥Tð~][¤ŒrXˆŒ8êØû•ÇçØÖÑÓ1gº•i6ÎçS¼CÐb$ÏxÔ "2T³Á ©Í5k™A³EÒÊ\pò¦t)$¸„i51Jœi’fs’n»Ø#5°äl¶C¬ Œx\캸õ˜3Lˆ­ÃÇÖOšcž}6¶·ßÕdt²+ÁAõ5¯‘Nk}i@§dA#5àŠÌÃÌÈ¥Å<‹yƒÂÄÜc¯—tÇÈï²lGŸ¼yJ9-ì1úœ1XŒ,uÊU‹Ù;›àtPë÷zT¯}uþfy­j¬îþKëÒMÄKíNÏ/€{ÖÅ°u!Ÿdù%å ST«Cå×ü¬š÷øV7›Û;(ìëò!×Ê™©DõDäÍÃǤ¹ž®~öÔSH‘¤oËÝ£%¼Q·5;ª¿k3—~ÕÈAâ@`#5¤‰/ö.Ï«ÛÆù7Î"Â. ¬a!¢9“ª¦aŒÂÀfXà˜Íˆ”l¶F&â1§A’v“•q»n¼îéƳצå|½*zéh[ÓxÛÇ‹<ìx–c6¢¬Ö}qDD‘Jˆ£rT¦£#2詶f?¥Ä£ŒÍ.>Ü38˜TEßöà må*ÆXšÝ†}+zû­z­¹-¥N‚”¼scÆÁ¥Šº(2Dk—ÎÌu¸A¦Øí®o Ü«º*0ƒD4ÿ@èÚÅ6Z®ÂŒ\L‚ûæ•O‡»6tÖœhÄ*ÌGÃXêᔳ^ŒxÍ#>BÕ£2DÆa!IÂǀÊCJ ˆÁWËof‚™dzÖÑÕæÜÃŒ±d"D°L‰*Úg›‹l`ÛÇ) (š&ÓicRE,%ÝEcbi¦4C«LLxÛr¸Šà±B´†4”¹RÖsçyŒêœ¸ùÜŠˆˆSj±îšë:ò¸'r]èè1¦4LS"æÛ}USF™´#5, ™ÉŒ)l²ÂÙˆ#aRÙ8*#> m,HÆ–Áj7†$Ù/2àÅ3R·X›€QŽÆ6ëØËÎ¥4ÊÑÛŽv²ÍîFjh£MÔU¬zmkZ¦A¸Lk.<“µ†µcÔès‹œÕ²·Ã&ÛHLQ%\TÖª,Ó4EV*x\#&›j#5Y²m°É3¤µõßÔ眛´h`,+!™Êw‰_^H‘Ãë&´¿›Û¶òu×MÖNrdÆ=ä1¸«¬bÕÎÔBÕ@haÑÆÝd!•"^Ck*œêæVúCJÉ’•¬$»ÖÇŒn.¥3¬#57`7ºAcŒë”ãÝ*­vBq·‰Ç8J@‚qIi§-ë¨ã׎T™Ã#rØï&Fhxûóï]4õ¤ØÔâ+Ë#†â Ts–¥ÝoHÒi›: •Ž5„[FàeUAR…Xd7š4†“M¡‰¨A\\Z6óqmäÊ@,¶WoNvµ°›—O2­CdT¨£]^ÈÍPQ-›cÄÒƒU²ƒH0É"Œ0Ê5C7fÜ2·týOŒÕJ![;¢ÓŸ×.Gùç$¥¶‘ˆMË B#>MÔÕOÕ‘¦*ç#5Võ%ÅD°ð£JdÓM$$iäÂ%E‚ë‚n‚‘^×}±C-‚R±@ª¦™AeÜ­…,e%P¶,¶Ð9 †a„¤Ñ9¦rbžZ•Ç—›j‚™¹É­ð5F±V>S}ñQ¼Ój-îѳN™Áœf#5–œ/*ªÞT –!C›…— !®Ê@èᘅD£VßõÝ©ý½è£ØŠÔ}kÌÇ’tf#2Ê>¨F"ÆÜÈ­ŒhMêE†:Ý”¶“qsÖj$G»¸5€ù,2&I”Ðñ¤‘Íáé·‹ fR˜l„8°»$šÕ•¡ŽS<¢²d¼ƒÁ eàKª)¦'ƒ¸HÈqëK6té¨WS"c·.1T,Ï5`®fV&·xÑ3’¦³B"0]¡ˆÁšj=>4¡œaXÀÛ#4“Kn›³FŠ\ŠX¬ë¬Ä5–rb F°I‰Éo3$CR;É0*ˆ¸ï8û¤žzéUN·¨žEäý~œðókSïqŒ“&5Áh逳Øùý®+U(AcAdE#5ÙU±½\{5Ù›óò#5ý‰só$ŒŒ£Û¶-JJˆÕLÔ”×K¯Ò­¯Ëe%x>æ»n·+†!Ö¶Óë6…/C·ŒôZ¥F„·Þb Ö‡o¸Ýï)½§”ñ˜ÍÏ<®X“†{½e*ûØSÔškP¨~z­••‹.œã 軂I>g¼+2!Û>¤Oîbmù<ÊéOªŠ¢#óm˜@4d™|ƒ0ä†T„9Ëü<=#2û¸Ì ýiF>#Ë××ÙUžžfd©N[zäî9¹Òh3p´ÃOÓö{¯õbsÉÁƈٕR¸<³gÇŒÞçžÜäCZoDŒm#5H1É#m„_½ÝÐNNíÙ³wsáôWÃ~Idçf‹)¤R©£ I0Û 6a”$˜«h"¨Û›nj{‚×5U;õÉ·Éãý |Nã¼/¨™Š|bܱ~Û‡Íß<ݼüf‚ë]w4æâ#>ýaÔŠˆfmúy‘œšb À) Xü‚:Èxùñ½øe®ÒÌrôШ'£êÖI„ )Ô¸ÌP¬ׯS©ƒGæ4±ªä­ö+‡!·ì"‰ý¸èÖŠ†܇(Ûe% ¤’œê¶4lö~s”0ƒù‘¼Ï±æ$ ˜a‰¬&î9õ>ƒ0ê8…CÄ{¸x¡wT¹HhÄQ¹Ç\>=¡œ*©‚C¼áŽ8çà}ß^ª(}»Žo?À½Tjš8ZS̼…}ÕkN&—)½ÊÄÎùØD˜mùÀö¨=qBCTd¶ÁXµ1©5ª4}+VºVljP¢5F6±Œû—jæUKRòêÐÕ#Þ–m„ÿ§«7ë#5îÎ##"É#5¤(d…—Û˜¶d±E”Á÷ÕÓÚ\‚8J•;#>-C[†‘¬y&®†j±ŠŸ'GC¥E+Ô‘ÊLD”ªˆƒL¦˜ŒÚrY©²@´2ÉØ4f#„¤“ I‰„“ôIlZ„²ªP¨F˜fûÆfŒe5Ù·´¯)7‹š$& q¡»õÀ器(à]½W¦‹³º†PM‚+B…H œm”Ú”¨c©áFí óÍï=´¡ð—ƒ"à{ <"Ijod4 Â„^7R¬FíÃhÛäÖì)!‰\µÄñvcJBþY „:"Ïá{žÚyIM»¡O»!V®‡\¬Ùì!À±D=&„uˤ!1ú d=baMÕ$ØÅHÚÛEŒ!Û[µ¤*›"A PXH°9“9ïìb°UVh#2ï‰#2†'³jè#5?NÝ:®á<@#5µ†A#>ôCT)wbd´ÒÇ¥lHˆ÷LÉ,§¹üosIèÈò!XÃñ€s=}C×8ÏÜ•¶PÙ—¡ì"B2ú1ó‰ødLae¯®­›êõ @–7‡`ùùF±ôX°Í¹`¸]c±´H¦eH-7QÎÁD·Þ$®ð©ôúƒ9ù`AO×Ïn_J¡õN®®e]ĈpÜ/j½ïùöìO¹‰ëý7Ç1Yúyöã*Š7ß­š™*¨¥K6×®¡~g…ÓAOdú‹ÛO0ëlˆ€È8*Y^5¦N]òde–ƒ˜¶vŸ°7h¯¯Q¥Ö|ÎKyº?FTÖ‡ÕEó1i‘ãÔ®#5R£%°®,¹Îõ^›5È46ˆJ Óp„ˆÏ-×Ø»W¥»N Ë[B/ÃÞ|lÄìõ·˜rƒ½Jwl§†&Þ Ñ9ögžd§¬ù©Š;0e:AâHH`Eó9lzã»>®²y[¯ÆMOo×'ô¦ð7ªjqæj?aëi.t{±¢Ï’IUG²¨£ÜiÞO²fÅ=†#5‡,#>câ`êYèw½Eö ‚PhÏHf{»„ô@«,®Q¹¿J±çˆÐqâe&â- _·ê˜‚mŽYÍÁ1P±33O—±Æ#2Q-å$7âýÓûâ6•†l’PY{_ÛzÚæ_v–)±)¨ gtNáÎÏ—tñÆw™[á„ác{‹¦.OA¬}½ø¾©”A’†$t'Aé˜î¶|¿é=®?6sœ´“äù¸gŸœl׎œÑB«¦‹ d†ëvTÑG{ÃÉ#2xžŒñs_ƒ¡À0õȃ¬òv+Mß9òiê§Ûé/æ#>ëö=ß+×ìú6 bÿ²r±Jé0Kê¦÷ï±×Q™Ýé+ÕD¬B=Pê#5YX‡Ýû<œÔ¨Z§Tï§"Bïy³UoWS8«¢†R¥k[”jè+¸ËˆÄ´…y»\§Ý@«Ôn!Òd^°­4ó6N,«™#¶k…ŒgS<'eFÅ)gr´Ã0Àq@hB!B@2,S\‰$3µ˜D18‚#>&?i»%°˜£7a_æd& p4,¡zÒ`Î:]‹¹7£}*6&˜ó#57 •ÕB¼9!Ìp»–dœš©T0Öbmò¡y FîÃPŒÙyªÙÇ€5¡Á‡w-#2à&ç0#5­æCÖnAŸ¿8a“6Š´‰ @ùŒ—„aKÝ@Á÷õCÕê<2ƒ~ö(Ú6 •ÂiCR »¥®`bŽi#5óVš¾m‚mΈ°ECJF–Y#5Š#5O3ò˜n’@.„*+©1†ºrFÒaVmñ#>ðÛ–³C}S@’ä,Y!®Cn4ÚnH6Ï^çPÔqV”@4&FVtˆ^ØR#>Ωfíh§¯D3 IŒb®Þyï¿=w88¡uÖ¥Z}#>1çMdaCÙ#5ÆUÛ¡Jtè`’±!˜õ—:m·9‡l霭;hP¥­?·›‘Ê6G÷PJLº­õÚW#2öØãe“Càäò‘Ÿ9¸v“‘»ÜE2"Ã97€š@³1-$TL NI‡…Ùgl_Óý¡9[mÄKgU3+¬nL¦g]€L°à’õÖÝÅ&8Y'Ûõø:)ƒ œ8/*ì• ÖÄ¥e@ƈ锅ul†[^îas84QĈÒB`Ðõ©[#>d@Î)Iz°“„=hÓ«„έ»£(é<´­Œö]aš•¥)u4Îh¹”÷WRy`°=9œè-ѦñÊÜrt´² £ˆ¬I }žK`dÌWbX)¡nž¥ŒI¦äÙ¢Ç2Ää‚Ä@jใád¬¼—mÆφá‡*N9DÁšæ ƒåYÓS"PÖP|ÆD¹‡äÄ¡j´²¡¨|¨Y)í²0ÚÎ.YÂz ‰®p £c’q#5Æ@ï3—c9—Ä—#2Ï°‘E»km©‚0øbÉiUˆN‘Žs"Tb3-)+|îÓi­aÂUh™s¬zíÃdɽ=¶òV‡ˆ[.Jˆå‘ƒ.f±ÉiØ¥EòãAªëb$w6‡ ^’¹f¡ò<6ÛÎnÔÉPÎv¡ k±rõ¨óŠl‰¨²new}6]lø…¶Ó§–²âRb µ.›ûz’-“_“¾,MQ*Ýæ„8 ÜxXœíÇy¼ J ïÆLA¬Ò¶*‡ÝãB3Ñ‚8–tÔ§1õ$Žs*È‘Ég é-š00¹â§,šE§ÖdhF­{Ôm56øâšÅWÔ<ºq4«©á…rÊ›Éf5Ì·ç#öYÔÌ™Hž“§v¡asÖ#>[* ŽúaC^ž´åt²«Q­sÓ88ˆ"{yQ†s75™hY ’¥G@:BÝ|ùÖ­…Ü׉:u²ñ®0×7cM>mâ_v¸bä+³ù;â¼W|åH¹ôrk©¤b±(ØÚwf(mÓ6NC‘¡·3Ï`ËS¶…ªÔ;R§es¶MÔhÖ]̶tÇlCPuÍJÈ0™Ã8²IÁ%ïKã«sê°²Šb„åÑ>©Âwädà¼Vçs‚fŒFË8)ÆÆYRÛV(i®» í6`+á(–!q€"—/ Ë\tËS¢5¾1 jÚé£Iåc„´‘uÊA!&ío]šÎ³Z§“è[ý3®ÁÑkc.^1¾ØGÓ@e¥0¶?>ÅÇc.iÛ–,q§Å*ëË83Mƒ‡fš–&c¼BÑtÉ0÷kŠl›i×­˜0K¥‚ŠG#5nt.æm#„IúçËÛe̸:lŠ\†µë‰¦“áë“Ž«oK¸I`„€·϶Ž(Úv©ŸdέËZ¹5;•ŸvÛbÛh}˜”ø˶‘2í­žIg•²Ê5_17dãu|>Mk¬[ÇÆ·šóYÙó%¶\³›”ËlÉÛ•†bp×oUZ{!“N6DXñÖj>[bƒ«Q0Qˆ€ÛK¬v)ÀÍ#>²·C(v&²i=Ñ-—8t p`<ûymŒ#5–<ÝSwvì°°†³‡'"ê”3BÒ1·Hi–pNf¦#5áœ&8Mi˜’4‘ µ uïËC†œÈß9F†E6£#2Ëm[ÕesBcɾu˜·”É__C§;ˆ½qÛ•‘˼1Áj"ÞKz3#§&IË?H¾®y¢[©ç´´²e²BŽó]»g-ÚÉÚå®YØqzª+8ê^M…‹jz¡)³íÞöõâ/‡øó,8q{e Ðì»ê Ö`Å4íÊæõ,¸:X%„#5:d, © $)4&µ!Ö`lf悲R*ÁDtFîeÒ5¤][•tÑÊL HIIA¨…²r{´ÄÍýÒG#5²H ÛQB${ØfHàÆû@†8Ä1·’69”²kâ»vÎ:ëM]]Ô_h›&²Ój6#5AÈÌ«qÌ@´@{‰@»œÔå $G"æÃpÛK-”nR#5‚Å$ ®ÆC{†„š’J¨Q³>Ã%£QƒBá3†‚9„Œm¹)“¸È4ň£¨èÜfÂb™.¯lB€ÖY“E’ q7#5XâfeŠ¨”Œœw[¤(nÜÌ+@ÀÉ…FKer„PÙL\â…Lªã¢Ù vƒ`™±ˆl27`Á½’ "3”ƒEl(ª#>u6f4šmœ#>DÓg@ÒTã·uY!°´Š®¶phg"è„Äa‚êM*åõÑHÆÚ{uÕÝ:ÛF= cÖ¦a#>Ñ]#5D,µ#2Üda`1¤K„‹er QX’Ä—„í%N:8ìtc£˜•%£hf’€ªWeZû0àç\uï#qÕÀÅÔ‹€Pœã*h¡ÐÆ;ci¦B!u;DO88Ž8edDF›M(Ò†LÔ†CCEE‘H ˆ"ìH<ŸMûñ>f}­¬tFª”QQå(ª #-áœÞꉲpÓ·0úK¼—>ªÆÔg|øíÝkjPœ-–ãq¬[÷3\6]-:ÊÓClÓ#ñô_¡6 ïÔ9ýÞDI#2"ùRŠÂ !: øEA DA< þˆÈ+ÛÙü'·…°#>ÛÈò;½·´È¿…‹7â—âìéÔÉrz½²²ï&gÐß+i[ÊÿPøŒ7 XSr§ô±qé«ßjQtL[G2;®Šà­6Ô~¤˜K0daù©ƒ8©3hfý]¤i`Ûƒ6%³¯ñ"ªéõøv#>»MÕrUSíµ\Œds—rŠõT$Š#2v/UNÑáí¬ÃSAEB;'î˜è<ûf @¿~}káfâÝ8•T_…\e r¤N<îPYÈL"«‘~ŠQ-ç­#5yè¼­"ùÈšdÉß“µÛF!µÌ°ë»|r~†´®¤C€ˆœã jqOØ0lp©²žZªµº#>ó‘¤ûbKOGÑ]¿e xzœ¦BD;³%S3o(e»*Øܪ¾à=Õí˜"$#2}ôeË“óJgV\dL«3¥õÝIøÁD, ûbû!Ã'(t>m2^ ‚ÉB i eµÏ­z¯;M3·DîΗ[I‡mÅÝæpCyÇ­jå"12ˆiÖES´1´¨‡„MÆÀQÝ”†I(ÛÉ+yÞÝ-æîÓm&drÂ2ºÔnD¡2\0+´”¥Ì®ØT2×2S#2I`«®Ü¤ÚmÒÓ6ò—n·k¥æ%› Af …†©ŠÕ–“5XÑŠ¿ƒ:m’PƒItÖæsw5yÝÆz‡ iÍKÂ4[Š‚é±@àäå Ñr’VÜ¡BF:>ÿ'Î}^žÐO’gÖz®Dõ¡ªm»ˆ…!õ#>=±Tè Ø 9‘‡Y^§(gèÄÉ4ã+VÝ#5ýZh©”Ad$xîbÓ1ëZÄC²Â""È%vH˜† +ÃÞã@ßk#2¦K.Øl…I¿”J×Øe:ή,Š; ×Ádg«O'›N¤<éáä¸z›c6Ô‘ú¢ÊIïÒEüÏöΣA_qY%Ø bµ‹8– –ì°Â§å&§i©½—-š“å£QªàÈ\P¨^b>n%¹Ã3é8]7±u˜‰¨[°d`@ãŠ=Í#2Uma#>}háZ#>ëÛ<k½$ DEóïÈD7T®k+­¾1£ 9DÉÏ?gN´ÍÔ2ظMuwãødÚl¬Y¬DIìJ>f³†Ï!¯CJ2gJçÔ!`}é@«ŸS%ÖѨĵ¿M¶Å¶ìkQ%YVÚRÑI­*ɱ¦_md¶“V´–·ŠÜ«kÚ#>0‚6bˆK ܉!QÐKÜÅŠŠ$Š#5’ ¦#†*"¡"nU¸'œQ€ ßòÓ×¥Tˆ4©aëþû䂇½T_I¸¿N•Ë¨ÜÀé·[œŽF@bED‹"À#>#qáœòÌ=ºvÏpP_Î,¸rÉ£5OÞV)dDŒ #2YRA@›}ß¿å–*z9Wœå^›é*»pu†ñth¼g-€9û‡’ñ;RïšîeOˆüÊ1Q$¹slS&kd'd0S!?o6hÙÂ+ŒŠ#2s#C Tm$Ú+3 ²:UZ(!R„M¦X2ÇQj¤nÉ HˆD¢ƒ$°´–&¡X“l†EÂÛ¥õ­&*Í7M]µ¹kƤµÄÆÁZyºµsU¤Ø„@aV0¨´@d­@í7òÝ„s`‚Í#5+06*;ðd§£DJ\Záƒ2ÌC[izûÐ@Óä{žÃÙÔôK IŠ±ðîüßfaf_uL«m#>Qž”eì¡ùN”1[î3tv÷±ïöhc¡¸ç¾\E‚@1@!‡^­ù¦²ßB½¢Ï’¢Íô1î`q.‰²(ëP¤%Eå’ ÓK`ja¦cŽ"4FÉ”Ÿ¤tœoÀ03{Ó\reAš A’Pî'!1#)_Ëðë£æI=¬ »BŸnw«žC¬¢Zñ•o4Uî×Gs£±±AÀ«MÛé¶Í;½¦éãÉC}¤feŽ?Ûºâî?$+Ú2ñÎÎ –Ò`ø#m(óòp'ÔuŒC䊬F#>-6µ™jfÊûW먶٩UºòÍoMp´¢–¹¤ÛÈò»$#>©MÑ)„°Ó~ˆœxŽ1ó㬳᯵>ÓÔ¯z¿.â\XŠ6ò¹y$H™ªÆ”Úf¥’²Ì…¦1´J”,Õµ‹Ym Q#RÙFÛRjý6ŠÕÆs]Š¦³k­ôo¦ú[_iùØõÇ*º²3E6ñÙäyuÎ>‰«˜«¢â|à}D58{;»TÓÒ,L·õ]¸¡º# (3ê#dº|Ñ_>}a‘Q;·)RÞ\(Pƒ !ðAðâ|®€9 0Š„‚/P…¬B €ÀŠ—7tìq’4Ž7ÏDÖçÙ=JVFäæ’†^–ÚZ^ ‚"€—‹ççM´W¿SÓ`´NÚ&¨tcÎâIPn<SÜÊ#5¹HÆ›²•Ë¹i¾tTÙA«wß Ø׃ÐÜ‘8dÇðð+ vgÖka„2‘™²&„Dà¶Ò¼`>Ó¿lÇm 6 ¸B­8:hIPb –ÙÈŠ1#5yOD®BHMMˆÖˆÖ°æIy×[ÞšÞ¤Êm‰#>+!€‚Ì­Œ·–Ɉ[Ô8 ¦ÄÌ60¶Ÿ«=°“æ{ FD"0„·ˆ^ôà»jƒä30ùV ç*5°ãó+Z, Õ5Êj2a›ñ!ÁÆ^¤LÂ!¾H„j}7µÊı Àwøû^`Ù,ªùÑg—b” ļ~¤?¹Š `QGöÈÅ`F#2¬$S(! žš‚WÈ"žÞãXy¬_-3¡á~“„×D+}RÄä¨" HÀˆÀ‡rÀÙE@ £Î=×KQé᪇ÓiÈ€­½x9{Žà0ÁVÅ@î†E¦G¸ FqY¢™BŸ‡¨OÏÁ#5úe D¥„%…¤Ë.–yõ½Ûòûr$>”Ι}iM|zZÉÛQ…8 ?–yk“ ‰©TŽ·ê°¶xü<{­=ª±5Sʈ\•–ô{²|ƒ4Þ<:Ɉþr˜v’¢'Tý;‘¶8e‰Îh#2#ˆÝ`}d8éñ²dÙ÷[ç?†¼lt^àì¿âPØ´)=`ànõ@x~ÍG|P, Ö áM›,Oû"Œëç@‘’(ÌK¨±F&]×dŒIΗNÀÇ¥Y%T…!¡ÅË›bLÝ)#&¸Hl™E4†¢Š6%ênæ¹`¯1Y*îícjñ®k»´б]ÝxÛÏ+™6Y¢±`å^5lÉ·ïëvµÛrHÈCЪ~òE7‰#2S–»þßyëò”PQUâWŸÊǨÁ{3Þd•š¦Øiì¾ SÖê¾ï௽o­RVÉZ–³‚0K¢¤öqàD϶@$$bÁ2)cI²„Q„‘Îfø'¬ôÇèÊÓVeMnB¼²û7äÀzVn—եݳ±¶X¹;”|dHï à9 m:(¹æŽY‰"éä{}:¢eð¢£^uúo{ˆ#2ÔQ•EAå*>ò~ÛQ…&"öÁ¹ ê¥!B^Â#¡…¸~„:ÃéñãôÈR¡ˆ#5¥oÏdÞôE7ŠÀÝ #5ï‚™#>©ðV (H¯Z#2Ò#2º/ÁQMµ%S»w§-TÛRiF¢2É*-M6J)¨"Ÿb«ý*°LœàåϨœi= éi/‘¹×–2-odÆH™‚$⢠ÿÓ ‘QèU¡X¯¬À`•)õ#2H°ùZ̲ú÷m»Ê|þ0Q®ùÀšlCõm¯K#5¿C#5a•éÍ,æâcÄ´M@þ gV¸ÝÌcm¤9ù¨VˆdýP‰2G(tµ–´ÉÀ/™˜ð>Dp1æ‚n#2]sÖµ‚)ð¼Ít~u‡ Š =)¸.=#>(}#>{r¿à#>Aè#5`³/©ÎíÔFÑlRšiRb“4³6R‹c1±£bµ&Û#>hÐ_œ«–¾â×%†Åh¶’¦XY¢B:úüg;Û(ËD$#>ªhJ¦õƒ¡W@úBæñ„XÂ(¯º¥Çdª©­ï—_“®Ü¢ø›·”l€–C‹¹SÖùÏ»šÍy¯„ÄWvTˆ¯ö$PBÀ2#>1­©B¨Ð•f˵HÆ Â|¤£ÌãŽÎ¦ß6wím*­† ‡ë2ô\ü`|ˆRš‹x£ £ùÜ.}‘1¦AtÞ:ß%ºÍ&¦ŠT·¬ØWm;²×wex×›Ê×TÚ,šÞ•rT[ÍÝfnÌÊ®¹»j*çj -‘fÕåÝ4M®î®î¶“eIS"Sc[ÎêÞa¢ÀŠÂD•:« #>DA¶£·‘7“Za¦õåÄZ¥4¶SRe•zV»[ή¼ó­W‹J2™U,T¥¯;¹n×vè²ÆV˦ºJå®Üö¼¾KÚz™Ñ0 £Dh¼@U¡ë„m#>¸!Ÿ¼kƪ´¡ueUI¸}eïFBÙª bU $)å’¡¬þ{Òe-£4RÏÌ“,b#>(\½ò`Æšë­#29L;0Ç nçPè?©Ã&çš’‰ GÁwò¹#5ÔK‡¶]„:1ïöjžÜ'„ˆ·BO=¾wI¼ž†ÚÎ,#5GÀ-ÕÆÇ›zn%Ä…»µãžO—èDèfB§vL5U*qt¾£:ż8[Þð4Æš+øûM,=rì0û6òDA‘`1"Ž+”R39¬gs2–L_a§ “ S‡ó¾D 1ƒ¡2d43m ±³E¶ÂõúwqèÙm[Þýfû¶’_鈮€–!¡Cy¯à#U}}²V]×U'¶üt!÷&ÁÈ.@ ó¡C )jÎô±›ýá_ª«Ìã®Ñ;%£h¥G|6Úªv¾F¡œ(€}v5èušß¬Ú#5äé‘{³õéæÂn¬“¹ ŸÃB¶«½¥»ãWSF B‘=Ñûµ(œY<à¦éÀºÓ¬u$˜*)øÜGpÌiÉÙŒŸƒáŽ@ÑÕ„B#5™€Bˆí†GE±Ž^”/[ø¢x¢c’6Ü„Mrƒ#Q4¦èÒWMWm¸Ú˜H!¤ÆÂ8äd‚$’V«®"A¢!L)AM`¡K`ˆYEBL‘#2¡¡R‰R šHÍ}~F2éüT­|ÕˆŽûR¡íÂÐ Û¾³,úðLÌZf‚`õÔzÌqk3áê^´•ñ¬É†-6SÊÈQ ˆ†h:ÈÔ¦Wƒ7ú~4nhñJ×€Œ(H[-%kE‘LUoh-e×q[ÌÍÑ´€ï`橼°tïs;ɹºßð J%ˆãw1ã8­)Ue»›À|½ŽýåPnágÕ~VåÄCÖ&PtªFàÉrÔDVvTÑí¯ð®7ì³(ˆwÕÂÈ¡ÔÄ#5±(dþÅ‘FÊȹ’…Ò¨Ž+²¶úú¸oxøåvñOqQß²…@ØÈÆàÖƧ5…m)xœL}eóne¼Ý%Öª®ÖˆFˆ"w4§ÀA{ïMž0cp-E‘IL¢ñEÌì2=àûŒ§QŸeóÍAKPwûnk|ª#2f<5e|²Ð\çË¢ÛyùŽd(ö˜Ç¡'„™©}âöÇE½„1`™Š?b!°|O¿×%ˆ:l‡ÃÌt?Í#5èÏ*ýo‡ãóÛ?Kè 4ÛhŸ†#2ÍAIøb!hAÊæ‰Vú²ê¡¥è-í¥PrîÙ*„™»Ê„(­Þw'|0R jÖ )…æy§³\çÌé®»pÔ×ÛˆÒÒ¦šX33ƒ!U¥#53L™¶´h¢1|ÝüÒÛoŸíoõE‹&Õ%ŒQ"#ž»±¥$5§ã±NyŸ¼ïArEÊr#>çðLÂÆ…°¯j’ " T‰Sxdn˜;Ûªcj m™„1èG fM‚z$±TTŠE…™jãà~ˆÿb©ª QQÆ=!9NBPÝ¡mÑžì„€wg£R[ã"QŒù©¡E˜SYˆ8ˆÛ,vyó½•À #2§x×ÑÇŽô¸é¼ ¹¬(ö‹;˜p·5S»Ö#5*dù~Õ&PÐŽíå?—|ýȪ¦`àÒeÈ8PÛÉvǦp¢øðŒ^e[WŸÆÄPQ`ºë$0€zš*ŠH 4×Ùpíþ¬ew„«VÞ·í?»-îé³K®.Øa²Ô´¤Øµ1ŽºÞ’`#5íJš’!¿µ‘¯~ëûø÷ÞXØÕÔà$qÆ#5–RTÁŒ0ÙýÑE2«:]‹:væ`cáÁÆÂx6€ÔªNL·^:^ ¡il¶0Bê‰`å£[Rå:H›08uòž>#>ÎĘ·@g5ÀåPf⣬7xYƒXŒa¶¶ž´Ð“1ô£ç,ØY.ä‚pPa3B†ßWžï [!Ò“¶i•u¶t2DuÄŽTCÍîÂ]Â’ •r¼|Å_²ر P"‚yˆÌÂ$¢¸í¼K #2}:´n¦G·÷ÜhäcÓ`±Ó5³(V#> zóD*ÇÎWÌpyoØÐ €t3„Œ‚m½á.9¼àÄBÃD|Å$‚¾“P7í³eC$HÁF2ñHsx”f„d$ðù>ïºbX™œ1qþñ7l¬˜ ô€ñmÉ~PÜî“#2D`¡&=7XPâÅ59jo-çÙ[¶¾¶ÒZ¹¹dÖ¬¥‘¼n&Ѳ…°kckM4͵£Y6ŒÊ‚&e„H0”) ó ® ‰¬è~!£ôµ’c©º*Þ@°DBBÑ‘xM‰v¥ E`|ºþ¡@>üt¯wv-U€Ô*D£äÂÒ’’OÊÜößïý“CR m¶*péŸ'÷çQó-þÿGÄ»ý‡wCCŽ„&OõDªû;º;IÌœã3.c§3$›Ù²oFñOÈÚ.Ú;á¹9d±›à¿ÇClù ΞèéÎXä]˜7ÖÂvµ7Ô¶ÎvFpšï$×@9º¢°ÞjX¥Bf‡1©‡X²æ M/(ý^5ão3I¥Éh©ZDñ„M™$G4ºÅnRä9¶åç*‚‚ *h•.Š‹(e&TGŽõÙãBuÄãfòà\F ­°ÈàÁ¶–† 0‹äÍ5E²‚sªåUÝ#5œ2C&ìD6éšÙ“Z«aÇz†@H|ZH$~ˆ&î“jÖMÑðÔàšW)´*$ƒ¤W|NËñkÓk¤ßuncbÑòUsX­§6ôÛoe½Ûkz˜öW-©4Z#>µðÊ×-«ÝêfrÐWP¬®à!KÔˆƒ5¬œ `N5W*ÁBiMÑ- )Iš‚ ôPP¿Ü\ åÕA˜2Õ$ 9—v#5,SÜÒlð¹cÄp]º(«`B‰pKëððÒF ׸…N;Yµ­[¤dgµ¥£üÜ‚ÁäA=¿å7²þWeçAºH²#8Žb•ßúþé^Sîj_n¯jŒ”î‚("ÈðHâØ6Ç@²°ú©Úýƒ¸€† &èO?ÞÚÿ\“òsßÌmÞ,ó¹h?ŸÎÿö¾¿•Ú}‹ôú!óa§ð å¥:¬ñgȇUòGï\|t)ïö9>0ŸAöOQd»Ýðùù‡xDgÁ9—øXž^a«ÓûDU@ÿù”!Ä@ACøv€è“ù“ ÕX*¢ACV~Ó#áª)_ðH7Z(„´=‹”+¨ŽÝ«ûÞÑ-¿HeT˜Ÿá˜ˆé:”“Š#eÅR÷ZÎJíâqTE3‚o·UÂã,æ#5L;äq®Ó§m3 ÊÊÇòs–&ðÖÂX߇„hœTIäÂÆ–õ¨H/5]Ìú > ?Â$¦»ÅŠ/>5e×ÉÅ—'†ˆ¢E”¬ûxlG>é kzp§Žm¾¿#>ÈèSÑF˜þº!Ù<~ã_lµV1©ÍÒpwñ㎧ü é1öGñŸÃ§éþ+‚ŸÿâîH§#>>²` +#BZh91AY&SYI3ð#(ñËÿÿÿüTÿÿÿÿÿÿÿÿÿÿÿmàlã(¦2áÍ8ç¬(bƒ|=Þ³ìîòl#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(ÞíßmëÃR´dÕ¤…mj¥)EQ¶f±'Ë5„Ö•fÑ´é›îw4L{<ö^ϧz5½¶ç^íֽ̭»‘fßm#,Y<úÞúÙÊG§¥vŽ{2U^žë·[î}á¾ì#+öö¯vÚbÃÛšè{g½íÙÞÞïx¤#+ñ÷ÃÃGÎÎÉæ»Ô=Þ}÷ÐùzÝîðõõ¯¼w`:Ö·Y÷¼ûçËïƒG6ÌIµ§Þ{ãŸl«Û›ÝÒ˜ßp¼Æ÷¹çV#(#(#(h#(#(y± F#(£ £Þ#(}¼Á趭Ý8tîl”í¨ç:\lš#(ä€èÐí:<žK¢€#(=tº#(팂º#(=Ø¡{õ—€#(#, w°T•#(#(#(Ð@êB$VÌ@IGŸx»Ý«GÈ7}Dö»m¨ïww#+·v·]U[)X]†‘¶ÖˆVÙWK/}¾¶ùßEººç°žo±r«N{Ù;ÆçNÞzÛ·½·½½í]µ6hë»K{»qš÷wz¾»·íÏx×{OoKìôæû¸>{nÅï1·ÝÞ1—¯­oí³FÚÔº÷z]»gC®#(ŠŠ V™°1zαݺӄ—=Þë¹î;ܘ]Üå5ZW¦ã †©»7¶JŽóÍÁåÉ@*M MR%Žƒ¨w7¼d¤»yëΨíƒ{ž»Á¢÷{½öÓËî'·Ðõ@#(Øûºå°ÚÚ×®»ZžÙ|0#(Ó ÕæfÀ5vûÞñã@VöÎÔ¾ÜØwKº¾šöÁ»Þà¯xéòäÊyc¯N€R»Ðö­ÚŒk´>Ùì¶êÇ}ä›ßfç]\îÝqÛ›gNçm·6;w}wš|ûÞf˜›z·Þºñ×wZºÝÆ[¾ƒÝT¶}‡Ûã›îc²Y²“ªå‡mcÞà#,øõo§‘ìïvÜ0:駛{ݵ{ïxÙ½oŽ²Óu«}-»¹›äÍ÷ÛÏ.1gwVÚÆK_±1ïð¬—o,s-Z÷dÏK¶cZåЮç&Y¼,À#(¹ÖÉ{›vó{ÞUf}‡{aªW‡ABƒ@ö0£¶#(ª(T6#+Vö®74³`Õ6èÅw;›ºÃ£Ò»ëê\ôqŒû-ÝØìÚ÷mæïsƒÞ´•*ꮚ»œÃv]çµê4 »¹jÆÞîŽÞ#(#(×MÚÄ#(­Pë6Ï µo;îÛÐîúÎc×>#(TôY½¹]êöª»XÍÑ×N¶º’z^Ýî1Û²êöuGϳQ=˹½î¹µmz¬x/;H}ßnñÕëjÓf×WÅ»}ž³bžo·¼ÌòÛ*Ðz¶ õ­{w½‘’Ömw§»ƒvºÀ¬Ø-nÓÛÞ±Çuog®®¯u=}ï½å ”ŸtÊàJTë´÷w^Ûwíu;oEw:d­×»¶éÜ/{©ëK4ÏU^©½Ù×­W•÷€ôÓ¹îwiv*Ÿvcv¼¶ór¯'w=½)]#(:é@=‡¹×AV'+#+Gu•íà»··§kÞ¼k˜ÝÊ­ ªš«Þ7{ÃÓ îï =¡åîç]Û£½Ê#(äxx‡¹Üðúíw{À½hzh#(#+u@hmÏb«Ý„äö=ã0÷YkuiM{áUëÞ­šm^×i—½îÐ=Üë± TŠt]ÙÅi%)]×I™·`:LéœÔÍž‡Qkoèèõï¼×ÝÞ׶6V÷Ÿ}òFÎï{>[ 25«ëîx\³o´U%½í½¶·oî÷mÌåX6îìZnÇ+jŽo½ïð¹}åv­»Ç˜èrÕÓâ_.ìxi¢#(€&€†€#(š#(˜i¦†@&€Iè#SO( €dhõõOSÔÓÔˆdš 4&™4  Ñ'”Â=SÉ2dÒ6Ô&Ú€G¢0#(#( #(Ñ¡‰£!H$D A¦Òh4=&SeFz)£#ÓPôQå#(#( #(#(#(#(#(#(IꔑLš#(Ôjm2F zž ô€#(iš=L# #(#(#(#(#(#(44È$ €#(€4Ð ¢i2ž& ¦#TÄÐ=@õS@#(ÔÔh#(#(šˆ‚#(@2$òž§‰4ôeM)åS#! #( #(ê#(#(#(å¿þÉûUMÆþ&ÜP¹hÆåsE³»•±ª-¢ÒoØÚªíüMª¯ÙíUw¶’›0ÉJdDh{íUuÄ&µS%yµT‰" V1D**$€ÀÌÁõ30ìý§íÇçûcöMB*îÞU=SخͲa2Ÿ£0“oƒ4íÞ«%‘]6L—ˆÕ‹—… iSÌÊ·º¸&ª]Xñtc‰uS 6Q?„öT?ȾKj‰Æq‡E#(;E^#,ð‚¬€ "@iDn Š€I'cDŠ‚‹ÕRCbû^̹¬<¨Çw¼V#,uEÝUÃÕÞ,šˆŠ1‹R±ŒSDV*Šª‰Æ1+NŸ]\½cÃ*‹w©—8×]k{—.³Z·”- #(Ü444ªs‹Ëï(¢+Ђ UŠ‘€ˆ@ÕSU¬jÌÕkZ±m¤­ŠÖÆ­VMÔj"ˆ™8°Ñ) #(‚„"!x‚%HˆØ€)ŸDT¢(Ô’jRH(ŠP F IºÅL»j©­Þ]^mUyrÔ¶Ú¶­ö*Û[jfLÀŒ”fjFi²€”`‘IZS2¡b ”£J)¶“c**„É3QEŠ (‚Q’Ôi¨Õ…´fÉd¤H#,‚Ñ !dÆJ´) ™hÔ±¡¦,©´hŠM’Ñj"„¥–šA&Í´A!#,#,ZCFÈ°Lc(Ê™£’-´‰#,M’a„P‘f%IM¤˜Â"Ê[šl‰V[[*« ª4ÆŠXÌÉ2D¢$À’É«*³M ML©+ ÒÒÛjZÉHÈ–“$‚c$l%@Æ”‹6ÓŠ’™*DÆЈ4b’”MŒÁ ›0ŒÒ¢ ©LFˆB"Hˆ…¤dFIÒ&B K 3BD‘Ì¥FHJjZfX6Šf$@¡,Š#,Y5“cCb‰„TŠI¤Œ–R4›JiØ’“"’”Iˆ#&†™“$ƒRQ¤’ˆ±¶IF‰1b(™‘6™@˜S4%ES!•“¦™ …ˆ¶“PBJdF¨$–M‹Im%Š"’6KD$ŠQ³¤ÓDÄEˆÊC%!L¡2‚Z“QfTX6 ¤ÔÂ$˜„BVRÌ@$‹l@IY”R,É(›3"Äbe¢’ÌŒRŒÙʦ˜’¥)†ËE@jH4ÓBÑŒhÑJÉbHزŠBR)¤˜‚jDF4Ñ€ØÙ1"Md©FPbÑ´™¤mB¦š6L¶ X Ie’Œˆ¤ˆ¢‹&“"X&”’D¤±¢3 ›M+B“ƒ`ŒM)‚¦E&DRdÌ 24…ILXdD†XLPEI2¦eTÆ‹e5‰¦D)XbÙ¶DY)£61B“ …i‰6„Š‹1I’M’(¬cJÌÖi™¢Æ(’ŒDL´Âd‘¨¤eb–††mˆŒ 5Rmš™4Ì‚ÆlE!SA‚É,llÔ©L™&˜²dbbR#I-#M¤(¨¢1”e Y•+ÆÔRdÚ(’#(R´I¢fÑ Ôi$Šc`LbŒ#,‹4Êm ¦c0bi ¤Ô¶14Ì©‘¦ÉJbÊBSfÑšP–³fÄ›d-’Àe+%MI %FÒÍ­´bDª"L†63 1–RXÔI°Ò%DAÔ¥‘£mƒL4$̤̙DA–M‘L)Di4¦0†ŠBi3"$4Mµ¦ÕXÁ2„ÔÍLŒK,RL2"+A©J RÍb’Ìe–fhVlØ#,‹LÖËF62Sb2”DÍ#HM5u¥úJÞD%Lö»m®ˆ ŒÆ,fÑF65±ª“)M3#QJ†ˆÄ³i hÑQ°’j6²##+¬Ii”É•£$ZS@eL‹dA˜™še²&Ö(Ĥ¥¨ÚŠB±“L‚jm’ÌÊ…@e)¬©“!,Ì•“eZF‹fÊ[&YJ¥’¦Ù±˜ÌÕ±¢ÈŠÙ4ÊÈ•2Êmd«-”¥,ÊÄ[dšÓФmEbĬ±%d2R´F©-¶,mUF$-‹ZMX²[¨µFªMd£Z‹cQ´šJ*¢šLK%h±¢¤Ñ£kÔlL´UFÀVJK#+F TŠÈ#(Ó (¤$Ñc LÄ”©IFˆ¬ÄŒm¤‹±ÛZš¶ËÃ!2™©­“D›#$„JZFÆÁmJ³lb”ÚU5,ªRÒÃZ™m¦Ù"YJÅf¦“h…´6M™¦²Å†˜Äl›f²)#+´[,Æ„‚‰š‹$HFbÁ&™‚b$H†²&#$ÈÖ©”JŠ5EdšhÙ2h¢ÈÀÙb‘M”¢¤EeD¥LÄФѳLÀĈZ-2BdišTÚLQŒšÈRAÓ$*B&ˆ“š&˜’³+ˆ-%FÈA™šŠ4ILŠcIe”#+a5˜#F“0”¬%I ¨ŠŒ„£2Ôb™I%±Ó(ÚSlI&˜VM‹I²XFY"Ê‚#,2m#,ŠC1&‹e*e%6efbÉclTŒT±dE jFÔjšÒfˆ¨hÔ¥&ÃLl±ªR’¶1 HÈ@™™‚M14B’jMI”,jÊi’C"e°”ËbØ5D‰©¤²“*JÆÈ i¦ŠJÌŠÖeŒˆÓCLÄ ¥„Ä” Ù£(",jšE¢5šM’„±1²BA¨¬[ QQ¨£c3ZL)$±¥1dÔ‘˜¦ˆ#b5f›C2’ 1²RÊL–HˆÕ ,U¢´I¢‚STh,PA&¤ª5L3!¨IR”-¥¨ÔPF”Ó,…hÉÓ$´`Š¢Äj#i­²°ÅQRmÒd¤‹$Q̲+ ) É£$•6R²&m¶ˆµf*dª4Ö6I-1²É´X˜³KQ“X­´–)5&“TÔJ™µ›4ʨJÒ’)%²Fd%6TСHI–£Q’ÅI¢LF$Û3ÚÅd…0¦Z³ h!)lͳ$SZÉɤÖS!M2V6K6EV)BÔ•‹e4–6Lb‚#KJV¦2i-,´Z6¬I­c[J+%ªD¶¨­ci(±@¦„ȦFdjDbPÔÍ’fÚ5IbÛ%¥•i+BU1lj ±QD˜Ûh¦U4ÖÑ´j-´[ZLÆQ1 eR±6ÑX³JŠ±M•¦±l£LT4ÆB$©@Ñ¢ÄQ&,i6¨f±fT‘­’¶,•e&£FØÍ1¨ÉEµªU¬R&T*&$¢1PÀ"CF4“m0ÆI¶±m‹LÕ´cZËISC-l¥“mMM²ImI¦¬ME‹HÉ¢š”FÄL›f¤Ôƒ)›,ÔE#(j#I”“"‘Q’)JB6É­ͨ´ÇÜþïû_¾ÿãç¥x#›üì®=°ËÍP°_S·­Óù™Ïüò]>¿®M—¡âZk¼_Ð@õ#,R´¢hOv–ç^ßê_$þH³ª£?̉„X,³á8Ûö;±¼s~Çìué·¦Sw»¦Û£fDþ×þ×2ÊgË"‚ûë;‰Q`D Ä¸Éƒ­(ð‘.$lIÈAÉÆPq8}MŸàªGûŸä ÿéýV´ÆI(R×+ˆ½”;ƒV£ÛkD/ÎVQ?Ïjs•¡S¢ÔHDívùÝ8ÙÙЮpc+#+ežœ!ÜÍØ´ËbsK¾Y»}ÒÊ‘E#+8¡·'%ˆÁé[ºràºÂµXÂ23iº–¼¥á‘6c½5Ñ>Ã\òtš:ìyÝ!1'®^¼ô«Ô¼mË9ÜÙ~ï>û¬Îjäl>®dªø>v÷oeõz÷ó{+˜¹UʶY‹|žxº†(‡;¤Hµ° [m ŠÆù–‘›ÓtÑ ×ÅÒ)(Ìã6Abâ¨árã•úì°ÿ #(¤âá#+ñ)‰X)ÚRMØXÁm¥…ö;\¼n—̶äQŠOÇú]xöy3Áäõrè&õMˆ¢˜aM²ÛEëïÂS?Û8€Íχ1°1¤Øžj¤Îø%?*ñAþ¨Ã¹ NèZB†"M+ä{ÿÏÏfæÓkînÙ6–QÂ+ßÆŒ!‰ÑÖêsv¥Õ" Žjê‹éM´”(ð¦k–ºY E\Û¯NÄ›íÝ|³Å£hѫ߸·Â¨T|´ôIH Ä7JEˆÂE””ŠŸê²‚S†Ò™JŸO–¢±G^¹„O&\¨¬Û4ðiÙÆÛCh_ ©£L¹MIHwPÕ ‚Æè¤N0mxNœG„‘†õ(ÊÑÛÐÞ âk®WyÝÊ:W.d¢’éÒH¹Ìšúþk^¯]¯âß¼»ËâÝoŠºZ{ÝvÈש\é^Æ[ËzïÆ­›%t*R¥´Á]¨¥ZM?3†q:z >×ç¤-¾ÌÉþXOd:²°oËŠQT" #Š‡úH`ìÀQ7bj‹"Â(ØÏ:ú4ÈNZP1·å¡†Î[býFJŽÁ6Ù÷scLü"ž}j¾‘óÛò«:Ï¿Ãôwâå£Ò׫^w¯uj¼1»kÇï²ÏËÈû5‡$rve³W”œÝY·u q|Q1Ò½·Gh†ec¦8zmyÚMLUE=L¦#,rj#,Sïòíûqëtì¾F#+ž/w¸&øT”‘FÐ…!9tªˆá#,¬] ØÊí'έAE¶CDö³)³É…qÔ?d wݲ•™bÊHRuiP<(¥ˆŽ+=1kôb§Töl=øßòwRÏÙzï4åÒlÉö2…}½.ßGéÈ"lrKÂÑæÞ1oK¥;ø,3&)y×_w½’Å‘Ž‡Æ‰q#+ô­1(ÕóDl`à ¨%îç»xó×NÇ@åÛ—}îïwR&yT¥ºÞµlu©Zø×óvÔÉ­#,jJ-sÆðY+ÆÕÍk¥R~϶¬dX>-2BF+»ÃõØuÍCÉ#,º#(¦jÉ@¬Ué¶ä0Â!ŒRD¦¢“ãݹ]îíT¡”4LYßt‰¢rºÊRœ¡J¢DI)…$I¡3~ÉœÄ0²šU“P½î®lmüà P‰£QO]±F¾ZÄd¤X*3í‰lsUBÔ¤Hb¤«ço©y#ƒIo¼è‘@vOmè!ïÅyéRÝ)bÁ*b‰L”ÒC–µ%·TF$Qü3s“–e}#, DcjÖÍ÷ ˆ Â)kCø;mÙBj1I·Ûîž®ê¾GÝjÞBÓ%vq²ðÑL¥‚2SvÖ¼êäåÓ-¾³Å—Û놭îp¢döÑÉÓj¡¦PÅ%ÕZSÕ¥¯µ‘¿Ú§–…)¿•e99eéßeƒH¨SE#,lÃQ f­$ˆ’’õœï0d´*~ø£GsDbá‹L-}©Kºˆ0¾¿]¿*»æù¹årËé[Ÿ¸’r`ittªYÉ#,k#,ˆÓcNH_¾Î_žÿ#,]jsÎl膶ªÛš(ªîi–ì”";µ¶”Ú²?uÐz¶ïÛË£6x+FUròÎ;´ñK£ù4Ý€³r;céÓ5ìË…˜ñ¥ÉnCMÃÝaõ³,Ù¹ÆsÄG“à°ü-{Kç½ô ¤‹§Ãº÷ÍDMžærC.é)7øVÏÍÑëªu)ҫ·‡¾®riDäÑ÷¥+ß_wÏÙ`‘6ȘgM³õúì-w|K¯³W%óN¨Yœñ'}g2}žÎ¥ÏÇN3B’.îíü8‚©˜¥aðBæÃEïŸ-qÓ æ‰HSS£U¢‡Þv€qè„Ôc{ªÙì-n¸¼™³Èß¾‘ãxZtÃ<é‡N·ðq³ æ²ä§ø]I^¿u{Fnr¶r‘)wFa[s¿Z=&®Ôy>J‘¡üó‘ë¶ð öp¼ i›±–’½Rtð«tkeCšP“.Y–‚èü´ú±ŽÔÐgJí¯´TNG~îr<êR,Za|WyÈö¾÷=ß#+o“ëKá[¥íÁ§}2^Ï•’Š`ŒuŠjšø}6iøµ;>+‘?ªxµçÖ¶†ÄCˆ{–rC•Ää½s”ô5®¼M`¸¨°‘NÞ“Â"WÑ1ùe÷¶Úê’‘ÝÛñéÃÂ[gƒ‡¢éäŠ6Ú|Ÿ_v ‡2æMgŠSgÓ­MS#,Î+Z¤Qtßš½!Óaw:ZÕpo÷ál‡,=¹±‚Ÿk‰·¸ÅݵO·Q?/]ÖN‡3­4Ëïyà§ØÍ›”žœè0ª4þÑífE8I!ézí={Q¿ Ž»>.–I=4£ ¦¢>Þ¾ë˜Qtî¢Ê{nm‹T6)uç‹šç„àË—í7Kq5áÓ7æ„™Ù ·?5ƒÏ#(ÿ'øꑉÝþÑ$ÉqèᮌNèŠqÓM] -ñ#+®=D.šZwsti¯t(wÅ}™[Ù¦mþ“Âë#,¡½h<¹fÑKª"5‘l¿'ö5ÜÌzM𪴶-µÈ©>wˆÉ³ïöä_žÜù/Á7^ P~ú¯6‘û¾ŠU½*<.ÁdÓk,Á]ö-ßÓ°aóÉóñiæÓŠ5ónѶÂH¾ŠúY«„|hà·‚ªÝR„´6FÉÎÉPˆbƒÁU5/Ÿ#,!&ŒÆi+ÙL»2jRñ•áÑnÉcØ^)Ê@ÿeDMŽTa&¶‹—R,ý©¸øiFFÚVDì©Qæý;à:ˆ}Y£½¡fZ[°dU•¶B7J»¢ædÌîáú†,Ò_¶‡·¹9ýµ`ðý$ƒ÷xõ1#;mfȈojŸlg¡éÇÚ‡Z§#ocIj–À‘Œi÷Gk&³£–Úy".¤Ì¬Üê—ܨ¥#(ÔB”B*¡JŠþ}(ÈÍ<´¸¾Ú¡‹ÀªË@"1ŠF“®ýMZTÒƒª§º»ÖƉßɹ_<·Àý#+pÑbýVy*ƒ)ÓËË=LÓm~V eöp0¡–ë0í¸î˜ó~ µæCe·zÅì[]–7—Ÿ'Uˆ¯)§æâA/q‡YR¶Ú*UqSÐ=½Ýø>õ:¡¶gFÖ0}U]Ú_A+7ŒáæÈUô]%üѲ#ì|Åv’åÌéá±\8”‰í?…ÒÑQª;Š$všw<\¸¾ùÖÏnÝrà)ôõ¾Y·Ÿ×ŸY&>j˜´Wg¦\«:'?ÑÖŽîMØHËgƒ#,\²”<꘯sÅ–v5\aRÚùÏ*r‘#+:3)!kF €à¬È¤ÈúLõÛtCà#+LˆSÅîH@8„Ò‰ò7ô†7®ìryÜ·Ûô‚xG¬4É=0õ:wXgeš¤û3EÌÏ-°þº2ð©Jór–QèÜ9>w}=UœcZˆ¬Mõ½~’¡Ü5þþ‚ôî¹Ýç\ÃïÇ0ÙA‹^ðM¢gX¯žvߊk6qå̱¯YT\',ÒcŠ¤:¤*!šãûË=çÇC–#,EP¹µÙ#,dX4§Ô\&¹X±@•Eé¢$@Ájô°Œú)éÛF“,O±¯-%Ȫ°ïï©ÇJ1œØ»|šÆ8m¾M!IÏO]¬2©†IKUÅ–¨$¥MÑ3J—2‘§×öÄpüÖôÂj^þfkõ2Æ­„B‹mQSDÏj*>˘j±YÊŸ+Ù£ËÍýŠåÐƯëç?DÔ! Æ(C²ñ#Â=ê“o= æbã„õu(U1ô°|!nçó©B&ØFWÅ3ߺn®j#,G+8IÓné˜bÊô¬2×îã¸i¡­÷;ú±swŠ›¶ÏHv/^Sžô>±H4&jD.ZnȪIö=:B)àÍW\FXOÈéIÕWZhw:†Ø bDä±»‹D‹Ÿ›GWèðZŽÎê¼<¹ð`òJ䃽ç{‘áçjœyÅH„pžÅ1öKáÕRôw¯#™<~‚`iG0¼Š½m=ELj Iv–M§Ù5ÁvÑÍ+74™ÝÏ»»Ï-[é‘3æŽ(}ŠG _\(7e?(ˆ½cKTþ/á®k{È}ú¸ÏeÁf§|ïú.PI…Ö®êÐ݆¨sÂ=¥8u3¨§N{‡s8ƒë';gJYó®%¼WÎ3‘×r"Uc"cN’™ÄÊ̽ïj®ºmÙˆpp«1–‹RªªU¹·Ñ?:¨©‚#ërÑêþVJx2¤CN¿Ÿ™% ¨­8Dæ9Ó²ë×EW¹“lS­#,´íŠ0ã×B¬ÔAè±ïá¬|MGB‹Ñb`Þe£õý³Çf¸b÷¿±³Z¥|ôö_¥Ò‹}(íCÂãBXÛ‚‚åJ—’FÓ7ÊL¡˜”©Ú¡Åq§„²šÐ|~*‘IÉÓšCËur#íNªóÆ÷%² LÂêò²€Òæß¾}a´É‰líã^A=Í&μ±d­o(`¯\ܽ_âûpp|hî|Y´³²©ŸÇÙ­¹Jªˆé3¥„Þv:KŸí Ò _}aàšú9s©¼Hº‰Q7B¬œÐûükvjyëE§úH]Ž®ŽºÄ d± m2(ä(ª™æ™xc»J·É8L™xâCO¶+óóÂ߃d:#,ÝÊ”Eþ)åÀ^21íR#ù&ÿ¨Í›éíÀ£-=éøboñá¯\†¶Ê?)Î(8¦ÅRþ4–þüâvT¨`Õ®M¬ÝµÊ”¨ýºÒmX6Þùy†3߸VlqÖ£QËÚQ±6˜ØÆ×»¤#,ÃÝÀNìŠý.çÝlŸ“ ˜‰±k¡†2ð5w+’º•!áãú1NC¨ðןÖ[úÓú”#(ïP}ÿ§×æ|‰0òü¸‘škÍ`ô.P¨@rÑ´À'ù¹ÿžíNQ’žÕϽ­løvo÷õì·²pøò_ ÚŸ§ÃdæÛ'cMÅíhZ¢ª(Ï”ôY2HBó_Àð‘ÜÒGÒÄŒ&ürº«M{C˜¨#k{ª#ϬeJcd;¿;œժìêꄆk0yìf#+rަÕfî~eg+©ši)k)BS'‹?ž“øÞá°¶áØt4gO¶bÕ-#—r׺ß;FfãPÙ@¸OXþ¨m‘²ðÿ”3Û™îíÊhD¦ðŠ!Å,±go¡\²ì–üÂ#,?!‡­QÞ³z63ļœËÅŠ¨â°û~7é#+2[žÜhÐù`­‹&4ûXlÕÉö;_»Ïß9[ú85Ú:gµýâÄ…Aj=úŠN½~ DÆ&–Ä€Brq(Å‹þ•¸ñŸÔȵYð½ W¡½ONجQʬ«wkEÁDþ–F¬ â#,@p+ ˜(¬ åËŒ¶ìàŽ^ÔB:;šYŽa¸¼ñý<àpH.]Å´9ö¯8vç]]µ7Å×J´gJ¢ðþ¯¿4g¶þø–»C8‡tàéo#ƒ«ƒ­>é»Ì‡Æ‘\@4÷xá8’ûš$c›Ëlª(#+ÓûñÔ‰!7 „$¶xÿ>§Ð,q·itˆW—ô¿tâ½:5‘ù*P0ó¿Ý-ÞÜ &tÂìýL9iu“Ô÷¹@d狳Þ±1XÓ;ïÄÊF÷Ên’ØP„›¦Ù„p¡U)» $¨AÙÇùÞO+švÆ©€™¨„ÂI´î¾…Å‚ç|söfqÓÓ6Û3˜£ßª"£ÒVË&èñ…§›–§yðï‘Œ_ÇËö‡$a´C¥Ýø¢¨3ÜwÞÌŽí7:L¶–ÝœŠ#Ç#†±Ë‹Àq‚ÛõøÀÇ›{N•zŸÚënÒñŒ¥†²áÊpu(¤!g™àHˆxAÁŒ(Þj’…{`æZöxӵΜŠ\ìñ¤D¬0aõO ô&L’ʉpÜïÉV•¼;<|âÌäðý-æ¡žf3«RIý¼Zk»&£Ûâ»df©4þ:®lҲߥCÞ ñTà#~˜ª‚):0#,Q€ÄΕ4a5He‘ILÔXh¡ò¥z’µUBM#,Lž·^'Ï%<†/Vx5ßeÊÏZ_®É½øÂmóÆd #͹¦Ïm#,"”™>g^ü¢<ð׶՗FM³—#,X1i‹0s^ˆXE¼œÎéÝe‡3°C®Õ\»ùô±õe~êe…ü A@" 'ïÔÙûÿB~Ø{:#+þ%ÂíÖš¯?º_þ‚u?ó?ð8c’dEƒƒpºƒ#‡{îç%%ÜÞ1(ÿÃ%2;fÝOøh‰Áï#,xyϳçÓm€ˆ‹¨Êí9Þ(àH1Ô¶×ùäó Š›Šù/§Ý½ßîc#,Ýuª*èE+G nøq±·3:ò<4×t)SÙ²A D`}ô øQßç•9GD‚÷ †þ<$!&³”±Š„‡þ¿_#+”éÙ‰*÷iýÄi'¾ÙŽfÞƒRÝ`Ð)3MN©#+:¤=0h ¼uä'€ X#+·Òþj:kQËKãr|áÕ9›Fi)W]ÿ„“â Ž§‹%Z9}aƒ]S¢ˆÞ©0"ÓÄ3nnqÍhJvôñÖ°K½z>Ü5a;饊òß5çQŸ®¹GM[¢ûmBðç©ÑΘÚWÚA_Iì£wíì»1>t0‚^X#,¥Ïä Ôàüƒn3uZÍòé=‘ɃÀÝ]7ó]Eåš%1'#•F|K¦U/ÿ7ÓðµÔî3Af•nhʳÒVzi%¯XÄIƒ·Œ9¹l`nˆÐÁHã´¶ýøéïxá¯=…¡E"Câ¢bºóĉ'å¤`r24Ô©…«HáÃk¥x„À1?ê!ØÆ÷®ñ¦J–Ø-"*†ÍGÔE¹J;·šÇ¸Ÿ^‹s•ýNŸEÍœ€‡/'´À)ñô³Kh‘n·Qä÷5ù½žíGÁÕìÚ3ošØTmyú꾎ís?L~ÑXÛ]Ó¾Zp7¾‡‰®vAÁH?A6B€È[Ü ™Ó{>DÈÄ#+E¢­üö±Ô M?ð»ûHDßžŠ,3Ƨ*þƒôñõÇ%æç.—8(ÀÌÌJªƒé‘ü™,œö.ˆ©Jò{Mþ]8&hÒÿñ¬ÞÙÌ¡èLáMÏ"t›\™êªÃ}ÆÞÏ2&a$šxb›œßKåVeñ<ºzmo=€¦È²ãñ2Èâ[ÓúžëÁ#(ì I,¸Íã¥D8ÁBÔÁµ=˜‘äèדéË©²Üöw=B[£"«I7JÞ·Øö›80ÈÅ=K±ý¿¾å¡D9¹NLÓߦÈÎ.ü~*Ú_Ʋî2ƒ³s#+^oþ^‹kÊ<Í4Ÿƒà›òM”ŽdÜvb›S€úÎb·•¼L^Z‰aÊl4ö0{ÂJoÇH€…FšòŽM âAÄGè4BÔ¼EUb ;’•ßŽ<\²='ô)ùÖ°<ÉÑñ)³8íÛc ´•¹Þ£„9Oç˜jõÌžôÆ(6À”ùÿ©ø`ákŒ¶‘Ê`q·PsÎ:Õ#+²,´þTfEaw4(uDZóâ[<â>>Ú:ã8ìœ#Ž16¢~8±®óݼXFAó7pÉjÀª¤¡d—ß|ò(*¹äá7ÙÒã|/Gtû|7ŒE÷‹%¢þÚÛ!$T$1Ö8PýU–[äÊHí¹½û¿+ øjXÚúŸd.#!vµi>ó‘ßK`®ÐUœ5Ü : ¬ØQg-SÀ¼¢#(#(p¦ç¢·ÃAOßñsý‹Ò[ÆÓ3ÝÔW‰gœ?•@*9Ç"¡% ã0ÄØ>ùi|±oõ{zsN23"¾µúa¨S÷UJ¬º2U”žQéÖçoÒi¾iÄ{֚eâ³7l—Nw™f‹Ï­”z?#+†÷ŽÔª¦SÃu•À˜¨Ô©‹ŒÎ‚<9‹ÇÄ™<(¯Í·M³úäîS‡6Êwi¸¢£_â ’OL„zo›"_ ²ÐøK Äeœ¾Íêåþ8Úì/¸µSŽ!Þœ~`xJü2ûZÊ»¯Ž)”³€½0âl‰™‡`b[ÁçÄxš3_×ÆùËíIÀíðñ±Le`ttG—“—høÌX¸çªóS¸è(v}ë韀 Ó`ßl¾ÿËLXîr+ÚFS& †»›ùGÝ’tTsÃ' ß#,ä#ìÕW¤¶œ‘¤  žáiUØN¡å|X™ÒQÛú_ž«#+x6bìsî±\AbjL“P²"­Ó=Ïî›8hÇ;ñ°ó#+ºÓ!?kÖŽ>ÌØø3pX“Ó`eíAz.™|¾.XîHRà†D©ÔD©Lv2ÑÛERBîS2ˉL,»¹Ç|ÚËB• OJ˜ØÛË m(0¹\tÁ˜3ï퉸xLÛ_XûÇ£ç×Sëw9~H=¦”þÌÀÃ!šõ÷íŽ÷¦°ÜQNˆÄ*°Š°›Œ©<=y5ÎõÇÄß;#EykFýÕݦÂü=?Wõ(» I¼¥Ù¡!"D-<ôP1;õnŠmø—1šú¿“ºýÊ,Ž¶âf `™ïŽH8xúm¢¦>3ʯ•]Èžá'­íem¬™‘5'L”ÐÖºQ*q,(Ž"G0C7Í°Ü#+ ¨|µýÙÈ2ÖÆ©ë½þ“¥¿ÝÉ…u“¤ü}#}rþ[Y~Ĭ´Úe#(¡•#(1iâŒ7Ê£ iÑ‚Åë[U¤’ã8URÝ‹G•¹CÁi…¥Š9v×l¨"¶(ÒàÎÏ"ïG$n†wª×Hç“ ™ï(ËV°¦qPå#,»VÄL±©¶1똃ˆÕ˜íÒƒ¢Çæ>T£#+ì>éöw1Ÿ>®GÚ9PX=YÌ \•4p©Aì <Öjh¨ ¡Ë=Ú¡{&™Ü­’Ñ™Dfhsg6‹á/#,RwïÒ¸c×WžyMÅ;£Í½S¥=ŽC†uËõ'gØàÖ\¨?ý*CÕãlGµ‘ÝÃ?œ(äõ5;PКÞ]Ú»’8u…ùJûŸ˜T[¶ìuÍU#(P)ùW&ò2|ÄÂ-ÂØgtPH¸Iúõ[bàß"Ѐ BDùc"E¸vìy™‰vÙ#(ž*“%8ùî¶])h͸Û%ÜÒÉÐÐÞy}"•X™Ês•¬1âÌRÉPÝ)Šl’JÞ(BwCEŠÈjÜ™ÍgáĨja°Ê†ß´w*²†˜BÓmcJ±F†ûSBþFÆb@"+K³¥Ž &l¡u–.¥Œ0$ uçö'yUééGTñª×¹};øvX)#+’J`±@DÊ00Ï:ÕõÕëß­¹ƒ±R‘±Š4fÑFô“kÝW¦"¸Åà xÒ¶=Ebô¾/l§/5¯&¯æñzº›Y" c)±Þþ#+×îÁ¾g`“2¶ü}~Z+¯Ç¾.X@\Õj qqѺK vBÃIÍ…jwž¹C]ÆÆŒÞk‚³™äÔ²››ìb¤»0Jãú'_@RúÒŽA-SiJË#(DA‘×öð8îépO Ïñmô'ï¦4 îêÅ98ZWÝðrDVÇ (ßoBDÊ#+åäÓb|cêãâî‰o]ÂŽÅ6*]¤ߪTÅ}ÇÃÜæ¾Cêô_Pî[[ˆâàÍ88<§|‚ìå#,q#(Ö@ —iöÊe¦áê,Èà¸ådº¤¦[l§QQkQçKÉŽ 8[)VLÁ3áAO—Ë¿$Ö]#,?¼]±)˜IŽâ1 ´œÑ£x £½ç1O¥2Û9á f$@_ó[åÕ»ëiþ› D %Ÿd× h¯®Æ)'³?ðîñ)»?)·ÑïË¿®ã6`Wîìo¶.ÕV§.¦G£ÂëD¬Ü†z+šézµ#+sAá@pŸwé5ÜÚºØÂ@ýeË-(‚ÅL!„Ä:bP%ÐõË=Î\n°Fتw3ÄGAûíåñ‹¯‘Â[^$ÖèÒ5³ÕÖ`» {[Á²Ì.00J%3:±›¬lKPL¹BúY$(µ)Õ,A"ˆÄsÀd–J#(„J”©ªïBùÃZAe¨¦.¢¶#,RDØÃ5º#UóLÛ• ¤5ò²aˆRå[ƒoè¾øÜÆŸ"ô¢tEÏðødΡl²$¼YÓDÑtœäï“VA*Ôdj#+锦jb ††TдRŽ“µ’Pȳ IíÐœYÄhÉH£"Š8-æHl°Š\×O É5#,ÍP)i’¥!²]q  4U.Œt |˜MsEK×jfëž<çƒ=î½/wšm šNÂ%Ž!•¶ŽY˜e+ØÐ<ƒqp”’¨eC‰ƒ%P‘B ™`Ix(–-ëŸ?®ggÛÓÒœí!V½Å;dýzèë’-kÞëž„™URÐkbŠÞ´ï³Q¹«­œÞâôç‘Ò>ÉõóFÔeš—drŽòìϲ+¼È˜¿4ÐÝõX‘ôî¹âП{‘:mÛ¢uÌ-æ—<9®)&¯ÉË‘p<ÇBr)˜û«ò'Ò¸HÆöþ/¢ÏÞà{]l]OÂŽwÛ›VBn2)eÖZÆðù÷ÂǾ®Äëà¾wU=^ )|^CÒOv[îïîƒ)ƒv9#+Å"6=Ì|.D{uè£oÔp@°nP’ê$»\°×@BŽçg˜§€GÔÉK#,EŒE:nn‹T¿Ú¹bÁÕaüFÝæôn:dy'ùåìØ¡’÷O¬ñ="Vx”ù§“N«‰’qÂu-¾ã¾LY¿DY c¦‰Ë+nvSÆqïÚK×õy×Û4§œŸlÑ®©ÃÁDÆ)úÖ~°ðwœx~þS¾¶\ 8&ØÁ\Iz÷è£ì‹Æ'ú}ùa„¡AÈ!žd2˜'wÅ9»"íÄ„Y`ðµ»y¿`|ÿ :‘Þñ:r.AcC>ÕF”:ÐFœ(ƒ¢(L¤O³=$Ù»Ùñe\£Õ;*1Ŝ;h´OÉUÊQŠðxâæ©¥6Êþd‰°î˜YŸíûê§ìÚ~õèŽ~x~¬Àåê6t ¸ÞÆ64&`à×ôXjºªZjRDbŠš¨b¥ ^ÞÚ·†²æšõ»>žjdž>5Å4£q0n ÏF#+¥¯›XÚ†ÎPþñáCMŸiʹùÛâE) ‚¦Ïæß-ƒg¶ËÿdÇÉt™8d ËÏC_(‰:a—趮\u¶ÉÝáü=XîóÿâºÅÞìEd#(Áâ®(4);ÓöÖ°æˆPŒ3EÔ¡¸ u†AO ]w#,ʽ—êyËê¹Ó\Ýð{^â-Œ'Lú¨jcü2#(ê²kºféa‘DdŠå¹«]6#W-Ò´ksmº@š¤CÌ,ÎXR°Ó*¶CÂÁPDo¨[H»ÌAËXÄß_Ïΰòï\Í­C&fvPÂÏ.ê#+¤ÓõWýóºmØLëÇé k~¿sÓFü:LÝmÜûjfhóúê6ÈÖ¼|§CÆNAí\ðšÅÌüÀûÁü»Ú@ê”#(˦¼ËþšÅ™X­ÜCï-Uî?Íí×õOèÏ¢\DßÕÒ_ðÊ×ø °l!ê|yúy‚i× ƒ±Qb—æ;¬`ñ´ç|r&Á`Ⱦ¡ (ñ5ù/ý\ƒõßùú<•§™uiú㾫»»m~ê4²Lí¶Ç3àåg@73‚Áâ0˜svrµV yHJ|ì•ÅSRz=8…µ=é…or îïÊWu.#,2Ô6· GR«üYîýk½«`ÅÅúSPüIÔâJã•Cÿý¾gy¾‹éa‹×ƒ„eÂîg8âú³ƒËûÞÅê¡<ÐPf²›'¾VM¦¢¡ZȧFªPödGn!i±¬.¨¦êŠßž¹W£Í]Kð‡(Õæ],Qvƒ?8È çç‚Ù-žŸ/ŸÈ?OÏ|ÿ³û~îûôPŽ‹•«Êð²EAx&f…éóòÁ#R£/þét´~ÒZ®v}•~íW0j¯³ÖŸNŒ¾U‡èvý×Y•ÊÞGN9±_º"…¬á5Ï“¯”þaÝêÆúW ½œÚ±Ïæ }(‘*çà•€Ë(x­›o|ôÔçy|š[¬ýÑžËh~¢9ˆQšéáãÒ ×é)æÃît¼û5z»9µur³sKŒ!Ñù:°^»¦/Y¤»}°o‘Bˆ(ÔÜ= õÌçü¼ G€×Ýv÷°äL#,æýGî¿óÅÞl&Þž„a‰À7ìM¯¨x>ÑOÝî]ö#+ú笜ýsózFýœ½üÚ[èš×áõ/HQp~Iß3Ã×ÏàöRûŸVüÁÿXýKõåé—2Hå=Rã¯Ç"o#+~!»>л}‡¦œïáÉ D¤¥Ó6Zré¿…6š’‹Œøf=<ãmú‹$YëWu;uï÷`!G>\o`½Ÿ{kàD7á¯~ûµàÜ &9 ˆ"X¡‹*¨$„R¼ª9#_\<žÙ4ËÌ {7ɺSãráËÚw8µ7I)m$zyÝ£y6šÐÓˆƒþýãF·…kÙqÞ Ûê?ŪlˆN¥#s"~™ÛvO{¥jþÒúŽÑñ9Uy¤Œ_QWýû ëgË¾È òÆÉ»|•¼4c郛5°R>x@ÓrøcÀk;!>0ž¦?ž…fJW^¤S >­ªÞ—KWyƒä€pø1ò¶›Cm®3/$Ã}”…°ôœ ÇÚ‘!A‹'5 Y/‡çüž—¿»~þš§Ê,ÍÝÇ^bÜõ\ʽ§Á‘à*@£ˆ¶B}§¯¿ÇBt»îq§ÝoûÜr]§—ŸrÀv“ °‚°ïzÑŒë #XÖ›$¯V«]U…<‘‚D’³-s¼©µ‘y“a[uD!©LîÛÐ;$¥Z¬à[0îŸh¨t, Ø4ÁfÅ—’*+›aH‘Sû˜ý·þŸöÿu¤[ÿ$_i"CQbÍû^‰Û·®Ø…B‹b3ÔêÐE3jK&‰1›*X”_˜ã14i±Wô«ÑÛv¢%SEJ)%«:ÿ$àÂö¯ÔÖy_·óœøçÏýÁÔ?À&›Í¹ë7&Xÿ'· ”Ô]IÓ(†xÄÜg퇕Z°#An.mÝ:Ë6R®[°´¾ïyçGbkóéÊÿ_?êÔÕû°Qr‰hÔäørýw)F@PD>}OÌOaïÆ“í¬¦•µPÂÎz L²-D˜­ý‚¶Üѯ´û4óö¼oÖmî¸@èÌŒÞ'&@õ™A”AVÔ«¢^’F5t«ðJ¾U ±Cµ*Š"‡œ"ƒ· üO¿#é—3¶†ê6Ób18Ä[0…Í5`Züa5‚ˆösÁÏ·óñ¾ ô˜«ý}àó²uþY§Dú ƒ*æUãþÓq¹½f—ØÓ©üÑ~µ)bùàú÷´ºŽ¸Âä…µ–KâØ«mÝÿhöpg#+ÊÀ7íPÞwÀE`Ý1òžBÊàôpôs®'#(øôbŠ"Ícåó£€Î=÷€—Íó|âÏw­|Üé=¸/LEÁëq‡·N‘®S»ô´ÂÿU[ 3¬›©ã^¦.AÒ@r å˜$`{{‹¥ÂêVsãbÆG ¹ÄL®>S=×ÇÙ%|ööõ`oL±®ø„öéoåïþzîG¯!Ú奎þí¾HÙÉ&³mesÿ›Pëþ­ kw3…©fŽÜ;^’ã»Óiϸô“œªÓ\©åÙôïÁ!ütEý,i‚׌é÷äy‘›Å”¿¯­,=Ê4Öþg#(H2˜-ÁÀò_¥ y—ÄB"˜óìÆ|µóÿ3åÛÒÏwkP#:÷6ÜñÍÛÜçuð£þ.馹A…ç}ûý.Ê9zdûñÏWwÃß*ùŽAH@U|Ì5Œ4 <™[§À£ˆâ¦‹¡XòHúHaî‡r9ÄqG#,ê^‰ó(p ¥ Ó¡‡o’çE4G/fSòËja¡2zuwºž¾˜PRv²Ä…¥2˜kt.0TV7EH×/à…ãøøqÒkµlï­…¾ß{¹¥¦¡XlÕJÆ ›)éU o0e)Q5MÍEU1V`ÚÈP$à¤æ§±³Ô¿oŠ‰ óYP÷¨¤6`„€Ð8G•_„C+Ê€³!^TPÅ?Á§ØÃK~6úæ9ÃËwCwüÐÉŽ’\K‡îIhÆÖ5#J‰ûªŒÍ?³ý³LüÄv>ô>g^Ä%ê}úiçbIŠÂ{÷öÑ\F™Z Ó¡ B¨€4š¼¿µBðUWÀ%ÄZzüûYå0QÄùÏ!Ýe…€ÄŽEüÚ0J ÎȆ%|êÄï]»$.Y!ÅÙútÍc'SÕù»Ur‡Š>0¤ ZA€ÝBZFê*#Û#,“Ÿêó{¯ïãÏ`ÿj0þj4°4o'öà å\ád´JK`P’…©ýï|†)™h3‰#T.¥¾ü~sLóNÍ—ÐHÞàgcdN—’‰Je×?öíêïöx}”ö|ÿ=ÇÖrŽî=qUAíõsûNÏ]3Ú›>O’Ë+‡'œÉ_cg?M¬ë»A§šcB–×Uùܹl³±ÞÆE—»ßö7‡²õý<›ðº×êiÝù;öŽûòãÂÁ ^W¦‹ñø1–.Ùloö?.~Ö´¸y£½zy¤×e#,8íxboÝ«Ñ©Èw;„WÞV”ßÞE£­Úÿ6øÿ?/·gw«V~ch¼;ÏŽ¯ìéø\w||®#+¨X:€ÊþïN·Ó®ztyk®ƒÓN›qÀx=‡­I!ùÓÜþ¹{ñßG!#(Ë™ 4>6êû!Œ‚öè§IOqˆ²þ#éÃò¼s)²BZHs?K&#Ëu²†{ïç[kæá&×—;ÛÛr§Lúôô>Lc )Ø>h#+œÓaŸ_³O¨Úîn¬SŸŸë±Œ4«køÞ5ÈÝHrìÛª7Zú#+#Î÷òà-½m<Ðô%b,î••/øFèµze¨xN.‰6®lýÕÀk]vWº—(yŠa7ëïÆÊTKËŸ{Ž6øDë,ÌK×È#æ 6#(Þ™9ÝjæŸÕî9ïQ«–̱åÂNäõsrc²ßØnßé;µ“lpÞï9÷=œ/»OO«ï­98¶|7khyT0é1`xÙ;ù¸¬d3楧‡²Èôtë«ŠHï/h^žV)C÷s*Öwü>î·@s!uóÓ­ü/—ãñLÐÑ]ù^98|Á6 ½ž…íü¦žÿ§Ð=çfÃŽCVÛé8ŒÌ9áMƒ?‚#«.î»ÞU}Šï²Ý^þ¿&ÛìêØü¶ j fÎ÷<Â3Ñ}8ndùc `súùgvîŠK%×€`iõ›ÔVˆ=Ó/'˲o•Q¸c|{ãªRàÞàêÊŸ_šwù÷[…st~¶)gÅbsd½ÿ'&Î\ÿÝ:ó¶ãÕÚžoáí÷ã=N¾ßÏ­¶o:~ü¥/\àÝ«¿†¬{ó¿ß¼Ôýfžô'7Ö ½Û‡?ÁÙ¿—T(>GZéàC‰\BŽÜ=E~œ[#+ºI}Þ-pøöó;ãMr~NêsÝ©~¯ÈeºÇÏRúc¦ve|éKrO`Öyåþo‰_ÉùuZx¾÷"§:‚.w›¸ z<³–—{ü?ulîü–ŽÚ°O”ýä|¿1ügû]¦Îý¦Ëú♇#,ö?üZ½Ï]–[oï*={!÷„#Ñö…ŽwFc?$»[—g”7íüÚ5?_¯ð%ïD±ïqŠbƼ¿´|2^aýgçòòÓüÿISdš¡ Þêg¦Ô#(TN’%ÕÇÈÓ5Ÿâ(>Š¨¼#(¤˜¤Ÿ1Ÿ^Çzýkeùþ}ýjé~?`OÀ鯧°gòSò|Ÿ#+ÝXth}Ÿ»;³ðüÂÆfÙãÚ;îÇÕ=oÖwýý=ß—,A¶Î­»m]»¾}·ôzH]ÚÑ8þeñAâPjêì±ÃøñÐy|> öö}û.}þøø䣬z0çóyGç#,-㩶ÊX÷\ÿßP6~7U#(Pjþ¤[¼yGÇDˈüzÿÅùÿWñ§Mº¾šípÐpø¹Z·}þËãQ°Tmô§'÷þÁ°Tr.¬ºaÃá<}3`)ö‰mùyÇ>!øÇäe>Ôªx'Ÿˆ×Ï#(ŽUh…9_+ØÐS’C[?nö˜}áB#(Ó눞/]˜¢,‘&è›C2pæa•}4íýý=ëÈ.ÛÏä¾_»Žé|eŠþväv@ú-îåVÓ™ÿ„øV$Ëçb|'m<ÓØQ‡Îðýÿ³cRE“¾ø•F:‰¢ôcɤülËßv±Ç༻MXÓªþŽg\-ÀlØàóÁH˜ìfcíßÀ=ÉË~ÇsI-©Ÿ¸ŽCÌØhöHÊ’À‡LA.#œu[#(€‡íMÿ§—VïDôøwyÂpµág¸cîøl‡0¤Ðu;¹¬w$ø?,E¯h3ò¹f#,ÙË*Ö”EpÔyŒœz2åk-k´wGÅN4šÆÀå‘£©QQÁ\3¸¢qÓcwr×E”Ö±¶1/1B+Sáž÷›¼yk«ïQ}=:ÕѧBxõl2oä?€ì!6 —)Ñ-–ï‰WB×K)œšDE†A}|87­87¸ñ«#+É*åÉ i<¹Õ¢ †z oà+Á9@°jžXÖqxŠ¸#+^Œ+Þñ§¾(ñò‘ékë]_éˆå’“¸ADŽÍïˆ5X¡À=ƒVÓ‰½ƒÜñ®,âkÝôɶ´±³ÑòeAŒ…¿Cú§à„!KJ÷?é»=ëE‡¡öêxð†íÈ®àÝöR¯™ª_Ð>zÂN”œzçz‚#+ht¤ßÓ>Ç_!†(£V¤»JêãŸm’ººWû}ý†ç/Ïö4©»·:Žýí)–ä<ù“&g÷–¾\°Þzß;OGËÊ}åL<<ãh#‘0æ­»¼*uŸÑèÚÛXy3¼ß»zïu‡•ûøú™ÿ¯“Dáv»ý7z!ØbÉ$ß¹ô×íÉ«ªÒÖB)q=ш{¬µ×LyˆÎðœÝs«g¯:æúøþÛîX4ö#+A¼€rÕ’ò=„:”’WŸ!Žã÷ošT…’©N|†$y=\—âQ²JyG‡ÉÞ=`Þ¾YG0û¹å» Ü_ d­Ý߯J“äù~UƒFO•§÷j32æFÔ±» Y`Ô‚#ƒŸw¦£Ô4ª#+¶*GG‚jQR‰7l@Fˆhs‹ UiAÆàRY ¦Íô»‹!Y«»”Õ™fj££B0L0„m…„v)lv5‚Ec#+2J`B#+YCCt!I±ˆÕŠØ"öÕ¯QŒp¡=çŽáÌì`±¶†Àì˜`ؤ‚í奷‹®¡ÉÉ \‘·´ZÓŠÑÃ&Ó¬ÿfÂ/×|;ò#õgO#+i„  Î¿ÏÖ=¬?ILðšÌ€õ„,×ø C5•Ô[zõ9 Ô…‡a±…È¢ÚIm#,Lcø{8ÿ#,Î>¯ìcäñ7œ‚©äy™PÖ•ðYƒb$x:P#7˜»´-&ô@cd‰µ#,Q¢Ä¦†(V¶T‡li¶ai$ªIöH†Ãà&.…¸WÚtú´MSß‹WÉåÊ噦jkûÿ&úM÷²7òéÆ–Á!“…£Iö,ÒXÀNsµ[®»5=–Õá°bYxþ;Ñï{=ëXXæÄ0 aé®ìþ7a0©Ê¥¼ñ~æø~ß#+¾½¿¾ÝœuÝÄš~dMùYøOíÓÏ1l–@L/áÚ'íøŸðËôR¶ÿ)ûAèͽ·šxéýÝ?æªwÇÑú:rÆ&r¼ Vä*‹jÑ"¶”Y륮yX*0ÂŒ£yu¼^´yçœÛÅæ³)d©#(ØÆ¢œÑ`b†#+´#«@Mïxb{r(ˆ5Æ7¦VŠî1Jòƒ"!k…„hkc°1”¬¶?¢£FÁñ•V®sF7ÈZZ¥ˆÂÙP´[ƒƒm-VX2#+á’o5¼×ƒ4Œk¶ÂT¤ ©‚•¦Bn`Â0 š‰Ãµ¼Í®›%4#+Œc¦:F£HŒJ´ÂœR3¦ÔZCâÓ¸èèKk™Á$-ç0¤KkjÒ,B­9ü£i†`2ãzv¨[¶ú^WSLT¦#,aAA6“*d*q=Øûê#cÒdAþ©£†­¬I´WDä F‚(3š*ˆÂ®´ÊŒp##-#ÆÉæ#+(—,ÐÙÁ;‚XbH)$•Äö@· Å^KBn‘{Ù/DO[±ðï{®2w¼aö #þsÃÕ·Òn5"¢±{yÂØÏPüËø½©Þ{†ÈüêŠ[§L׳£òÅ=Èeô9|Ž¼2¢¥ñ<)·á³$g~-ªëëös>:¢‚aW''`Gp=z™6œÊ)R#k“¡Þ¹»ŒBƒžÏÝcÔºåøËëóê„M‘§?‘z§²œ­÷s=¶šxÝônOOæ0-4Üàì™ú°}§GÈüªÖõA;nw-.ˆéxè$^èåŸä@#+#+†•âö#Ú?&îš#žÎÝÆv l‘üj:‚#+«ïz‹Øª¥ÈI%™UU°ðQ8$y#(´%À9,HÙb3Åþžm¡áâ^SÌrCó4å$¡G4}Ûì–¯•yăòŸp@äë_Ì©3o†îW>ϯÉK½’I!‚?é£}ŽEQTb¼Ëéä`ÜšÆÙH<9QÑœ}¨Ëç„€aRP>`jŠAž§Í5)ŒìI#,Ð\—áS]îy$Ü$%ø#,ua«›—–Õzä`Û—´O½îëë›k¿áøTkF …TfDPÛ_ÃÑH›“û+d"ªFÆHG¹b€eŠºÀŸÚÊi¼‰í¢Þ]UHPK*+(bˆÈÔ¿Ñí—ñøõ|^k>±«ìñi[ñïõýǧá“Aó­¬@XÁcéP¡:µ=[éaêLÈŠ9Že_®ŠÐ+í41"Z$m.#+Iá×9Ì44j›è‹›¨,]0̱„D'© cË]õQVƒ!Z ÈÑX7’0Îjƒ48"™˜e¡AÔ`ÄÊ‹Q`{œÑ5Å¥â^›šù¤ÈtÞ#1äp(XçQ%ƒƒd-¬IíÚš ú fˆÖ¬D"}‹S"%›·86AUƒ„Œ‹«àr9PtG5h|j¢³nC¬!™[‘ŽDɧÓ"f#+H#+Š!±”H#,)’bX$Ê GYcPç¤MÙ+~:¦hŠÈá`ừ¡AíN*À](¶eÛJ˜£)ü_Ó£Fƒ½ð`u™Í,U†[˜¥JÏ ß%ÓJ.áà“åkE«—átS¾–.Q23‚MC¢(€Pf„>5õþŸèýƒ~¢ÞÊo¨*[h!B#,ƒv\Ûú_rù#(;¼Áß–3ñ½(ž_£s¡B`ÈŽ&0Å(‰zãõ]}A\"@q°ð ½AP®cüüzfƒ¬xúøKœÙ†r’srn™ú½ ŸpüCÉ<¶éÇ_¯.”éôƒÞ#,w¸-ž |#+\‘äDe…FØ£,-*«ò¿Žª hiÆ ê¼bÜŠé‘Ò.n0¼8´£M"TéöO~–#,¬’éÔˆâ$dH‘ºš‡ƒ¿=š‹ˆ'H¨7×45„­ôå;ø¸Ëñ†¶pñ&ö¦ VÉ’ÛÕ0qv=B+Üx=04¤´]<‹D ¨'S¡·ÆóÌ*usjéUZ*„B§=¼¿g–Nšíwtm¾p¦JT%…šÕ¶  ˯‡òµçõuß»Ûé?¯4“ÑŽ.øºôe¯¼dŸ‹íþ1§mÁ[¤9ÁÄU¢nǦlúäÐH¹iZ Å»8˜ëYAò1ÚáÑÒ:KLbQº‘@PDû*PÓH±ƒÀÖíK³PAæ >Ò:ÛŒç¯Ã Zdî…t[dÕ”°"‘¸¾È[¡‘±³ó‹Û+Ö.¸Œ-”+†š¢g^šm±eÃV+M#,ȡƳÃyœÀâ¢hâòó\Ë‘hà˜1•ØP„E“xJe@¹‘­0ß•! #(PŽ›Q#)RŠi¨#,!ÕPÒ,¦ò/6CÍ’¦ŒÁ® h±Ú¨ÉÃw›à­¶—n ¨#±u’L…$4Áta-3$Ðœ.a‘m¬PuÄâÀ¼–$DN׳A£PÓŒ+geC,fHÆ£k¡ÐÊ&E½À­Û¨@ÁÒ„y™dŒaL•ó•Y»]ÎSú5Æ·ü÷«¿r|ÅÿêOòhmŒÅ2õu¼£êûv¤ŽÅQ"°a×;#(†aFéºÙqš?r#,œR­+õ³¥egc}í6¼Œ,ïÃtÖF£Lr;'Ê€IS±ºfÓ[¤7›÷¨urmP©ðSLæ*¶Þ@C¸ag#,X´£\ÿ‡äyÃw̉Èfͳ…”Þ›ÏÆ™ÄXí ®ÄòÔ…¶È#, ð48²BqÜ\HÖÅ!/éw[6÷íßgÉ…#+ s¢ä;ÎÎ9x#(¼PURª¶1´¬îÌѤ^·pj[W^tù3m±Œ}ñA¾àÞqݾŒÔmɹ"¥])n1v6«D˜E¼ Œƒ$M±ëUÈNÇ>€7¦Ùò€ÚÚfd£^ÞM¼Q{çÊvëŒØ8Ò@ìfö/#, lnɱ#,d¡Ì6Î3ÅŠ#,}Ueµ¾j¯mY›Û–¶Ûú[Ií4äp?Ë8jÂ@ðL›i‹7t Ü>%—ÜÛc4å4‰†ÕŽ:M³¸‹ZÏ'ŒÝfÆѧ#+šœQˆÍwHQ±GÌGPÁX/‹ø‰žV¼†Üq·ž*“$žwcg#ª1^þ5ƒ¿8o¨bÜ÷8z@Qiû‰ A ™#,æ#+âK°q2!f[sM¤G#+Á°ÌÞRÞ+‚™}8ßkÎíëÖ荒!Š t“cƼš—Pàñ8r­S®/B«‹ÊÕV¶“* ¹œ.¤¢G±ã†ãÊìî®w;iŽƒ%¿%¶b îj9‡„Ê¥(·‹|âÙ6í­t®TGå$ ÖãCpD(ŽïÅ.÷øÚw¡×qFÛQÔuÙÝAY7˜–JÇp¨Üã`£›ËgtÛã²)uÅÆB°ð Ö,7m­oQ°èǽtŠÕŽÐ‰ÑŠnºº8ÎdäÎÍ•$¡¥‘\b< vi—N›19ÆlŒ1²' ³”ç&5¡SaÈ3}\’sJ) ssZ+­Ý°,+N¡Œ7.Ûldå¤É6µ&†Dm<ÍŽFKEƒZc@ìnè[£,j‰TrŠªužàó&*ŸÔQ€%çzù·AáÐ]P1B ^á;‹¾6=<×1hŸZ)á/wÇžJmø½˜lV-¸“/trˆÆ0„b#%To늗¦{mºJÿÅq‘'‘Ø’«gË'êaMm×L ¨äUñNÿ‚¢j/vÛB´Dbfå_úû®wP£ (Êi“j¿’œªD—M9#,–¦4fA&"©õ·½›eŽÕ ymå.2–ÏÃoJd‚¨ÒΤ$ç…—sY9©—|º¨…NôÇ#+¯¦…pp,ðÍß•ol Q‹žÝYþÛ¥·D$«lv™2É„É’½£r”Ü¿NæÂO'úW2Kºïðê{,ÞUñˆ‰‰¥HËÇ#À§  àÇú=dŠ<­ûx€Ï\sÏVüyeG8A¬ê bârä&ÍÝȳV_|:T´îÞJ ˜)¥æÇÊ2š,˜Õ×Á^í™K5Ä1ãÕ¸ÕÌ%–3o¾¯–Ñm‡'3Âõ­“?s³i¡œù'· ­†ägÎœHµ—’´:gM•hSiÖ¯¿Ç,XÆðvRŒ"¼¢#,&¬?" BM…(ΛJ.]7Ø£3G.™£W[¨1ËPVÙI¡:c?7×—xÜáWºmp¤B8üW¦D²Íß%+4{ºUÃx„è³x˜ÓO{šRÃt⌳ۦ9K/,ž9æʼn'õŒ&2_r8ß#+Ž›nµ]³Ø™¯)ø+©®ñ³Ðé#,§¨Š­9?Ëg”yœ£‹îA\£$Sĸ œE Ìí}1]h¥NwfY¾ü0ÕeÔ¢kŽó à?聾ÿŒiø˜xz,õ{ÿ±!æßÂK²¯dpð[òàÜÕíÄ:ÿí¯é5l@•P‚?¨¸\ôö Eú÷AØ„)ó—ãý¸i¡¡üÿÕ\PMXÃT—_d‡ ëü#Ò:M¯î‡;™EÀÌÀ “ÞüøÊ'ßk"&ígŒÿ«àò–•ª7bã¯Ðú+‡µolù÷;5Øðe»Ós Ó¿ÖÿQi%ÕI˜cx‰-ùáw®ÛÔ>ï~¾šºŽZR(ÂԖڅᣵp/x…Ù-(Ä}û½¾ÏºçžÝv}=KçÕ«À[J#(ýJ5h[S”2 ™@ñó(³|rÉTíþË—#+Xf™æ`í#,/@úyTA$6ˆAIyùäqg#ˆ9#(_eþy3õéú`Ýúì:|;3]H.U~­ñ±Ãm89á¤Iú9->M#,^y"¡;±ÓÇW„Z2˜Õpí³T‡ö j,tN_Ðâä ϰ˼N¹ÁðÕ*Ñ$kª¸ã5° hƒÒQ#Þ~Z3ý»û’ØθO2ÿd?Ößâ}Uiý¢÷‡µÿ±·P$Þ{7P£¯Œ&b©ò˜Ý}™CðÞYàlŠRU»%—eË¡L¬?ˆÅØA×i£h™„Uô5Ók½´dA!|àÜŒdG¸Ç¾/ç=Ï7Ȫøã‡þ¹ çÈÕÔ²!ÜT/„:ÙQ±0ñ0ó‰Ã„S‘>™ÀÊç¾T·d«)ÇéÑŠwlW””„*X¾ïRFŸ#ƒÝüðä#,Ífæ£7Â66¶M*™:%þQ^’ø’f0ÇQ_¯L\׳ypóX#(Ò|ç€ ñÚË£Úö©êêÛ[²¬BÉ÷–{…¦ôGMƒBÑÝÚ‘T?IåRÄj²æQ¤ÛS¯—BNçÙ4¸n™ˆº´Q­Ü¿9ƒQmñÿBGùT7™õ}cиov“»/ ¾ß¥ðy‘šqШßgœæ‹GÉ|!|¶Ð‘UÃŽ›HEuÌ‹Êd±iá¡°ªv\òq~éÎJÉ.ÏÂw“[Ó|^Pè®»W¹›”xgýFî3¡&aÃ1íÍo»ÝÁ éät¶“ᶽ+·Y×GïdðÕôPÔ7z³úJx7øÃ>/ö²â{ÇiÅú5c¤s#È¡¦æž]†jR6ÜÙÈFA/rkk$ôச#,M#,ÙóYOC²éD5^³!®.rm¦ÔûÄѳJµcÇ„¨%†Ò|ü^~ľ]iÔqáù_#+1 †åÛ±-tJáwÇH®£7‹~x þz†µ #(ä, ƒ6 œr?(œºW*A?År>g-úþ·#,ÍWG:²m_¿Œ©LHçPRiLuP}sfÊ°á…îÛ}p<3R˜tZ€ýzགྷЈã¯?>GËó~Ýv:¬l\v¥w³'NÆL ÀuxœI±lcühÊ™Ë`½¦š>·…îÌT…´/%¿CÊ7h¼L8,\³Öxä>o?ÙÀá«oÚgôú[<ŽèRyÊÛyáTªüzøð`[ÞüÃ{ˆ9–¢ã åßG |óîØâšzåæк]%©ICE¶ôë“®¯žå>_tìg”’[ý<†:ó»OeËC˜7Ù—À¨)×—'o¿4`ËžPkNûÑ/ð©óNšÐõ´C.Õð:ïg®mµ 9¯.%y8©º‘5:Lfa&c&.kÔol%0¸N;Ø\ÜßJ[“ŽJtœ@v%ýéÛN>-Äy¹9}Ï7oDa$Š§ZÉÅÔYK^~Ö#ÚFi?÷çî¤è—DÁÒ÷T)ìä"´|Ö”Z²tòS•øMÍl9~»ADº·> ¼}s¶‘ÒL´&S™$›áÃÒ1ÏÞ~Κ0ü< ÆÚ5KD»šËjÁÃê˜U{¦“EcÊsµÐ!Ì´CÍÁü³ê3~¼½œ0q8™á#,|Rí9Nø+1‹ht1äþP_ Œ¸Vj ‡Ý¥"K‰¦Ãt›_¼¾‘¤#3–…„ìÄ7ø¦#®_̇§÷tўц8¬²-TWعÅ&Áï‡âœãeø!ñÌGÄI²»GIoîãèi”}ÃåÌrÐ::1’¨ÕjŽå —0ä+©îŠzd$Nr°­wlêatCÚr¬%d³ ¡ßá9³µFÝ65†|‰à*¤êÓÊ«{óšûžqx—DÊ[" ¯)œà§ÉY¸—šß~†(®!Έ|¢{\­ê÷ù¼´!$ÕNñã$™Ge»¡ˆF–Ê2üõ*6\(TÖGDõ<9 …jrGDtËåqÐ}-nˆW¥ÐÉdn2,Y—(èñf³_<ßJêk¥6*ÅDƒéÒ1¶óE³ÍéLð/_]¬“éÛÝÛÕ#¸à$CR%Ķº²Û·ZÅžT÷q£¥Š½úq¿\]¾wçÉUH¶å‘Ш„Ž‹ÉÎá춞ѧTc™½;Ûéö¢“É•«Û­ÆJÚ3ôˆ§’d™ö÷+% ë"™mÂwóˆiÎzT×ØãxؘY7[ÈBêµrïPï3Þ[™%övÂ18Â3£Þšã£-8Jj¸xá§~Ü™¿6„íÖ?Ü-g×ß—k‘3¥×>Ji5xx#ÍõcõuWC³â ÙÜF I\o§ãVJqZÄ Lò$1Hò^q1Ž…ž“ѧ5®ût’íî]£9¦xÞâ%¶=¶sèvy:çBn[–™Û ªø8 ¦†ßçæßz4V‡qàë9]k†ŸV®Eö”a¶Ù'Ùº™qô?£çwÆÉí²Ú†>œQÃÚB`M³k»Py ðÜÞ8!i;±f¯czšAvJ98zÔY0T^ͲýyœKÁl”=R[k‡£ÑËçÁf±z1´'¨(XzÝÿªq;æ!òºKi>£k«Mìo–È‘Å.?|AŒ(ÃÛ3ÅR+‡ópŽsr8{¨+ùjvwšb¬‹…ª¬á*4Ýïh5y¥Ì\‚@aÉVæ)£X}E#â<3ì9Ý‹¢úz, 4hÏOvŸ†!ÞʨÁÕüÔÙì¤sDS‰ÄoÒ]vùc,E‰}èé­°Ãìa5`Ï6vçb•+eîXlÏ&èy%ÝØ‹´”Ùâ¹"^mTTPG³•7·/å1ƒÓ_àáJø:†ÆàÆäkm£˜@Šì8K 4¼.‘²öár–ë–*e2Šïzx–à›+såçèkbß;ædGúåL¢]ûÈðäoé-!¦¶ðfkÆ) ÚdzäÍÖ¾Eã[<:Á›j˜Ï2ПnŒs#(wŽë&4½3'¼8Äü1“Ë¿¤€ÈÆÕDg¢txµ6‚쬜Ô_#+w.--þ!?›N{çàè5Aì#,¾ ,U#íó¬qi´ÌŸkêùD)C“”A·²9ô?—Ò HGácN\˲ݓ´î¹ã£ö Qï!$/-˜í”¯â«ñ.U½ËqE#,«Y^³JAçkPÝ7÷8SGãìhÎìÝf+nÛl-xbQ0[˜ÑÛ.O5”¹®„;-Wuk²ê ×tRüÝJÎr¯Þ\,[0真e¼OÈ«œ±®¨ÒÔ±uè×>Ñ bgsIø[ƒõsàÓ\š‡7 ál-XŸ±èèßᣡM")ä‚ÇjÇžþPÊ0ööX’ªðVRÁiÏdwážá9¹Õ­¼sdñ’ßkEyKÏä¬,8ÁŠÉŸÉ~Ë ±SèÖì5[t™ƒÚ‘4•rɽT›×”Òêrº/k•¨ùÂèf×—ÀÍRÆ Å%w¬ä-—½…Ï”ÙÇ{ÔÄ;8N•—ä÷»P€] âÀ¥VrÝÏ•¶Ýdë…ªúÆ[z«ò¤„ùìQsµÙhÏìÛسç"èŒÙ«³¦í‚ª:ê¼;m»qÕ~»ÁÔZ3®b¦­dÈ.h¼>×RûåYâË(ÂìîPcbþŠ@N*ÑóÖÛ„²‹¥×;¹¼vÒf·PUãVAC«{&x-H~³“X ¸Ufûó.~ÆWàØÞ) d#,ÑWi“ÝžvZ?XÞçÞôTò¨óµÜ^ä7¯.ý+îÏf*ê’¯Œ\t€y=Nf“XX¬NÝ‘v圜£•wS–üâùKU x›ÖÒ@¼r¬Ò*,«KÃK-ȇºa¿•—þö‹ƒŽN3º„EpeWö7Z*èJÌÄE]¥Š1¢Ä­Uj7o$5„o‹wËìÉ盤ê BéÍõžúÁÓmmÐËl`*.ñ¿†ªµã1£Ñï“ÊçŠ×iè·¬ë+í-åqˆéAÅÌùõñõœãŸn67¼òGdŸ´Ë‘·/ÄèÓj<ž#ïãxmÿ}•ÌïK?&1ÉuÉoèø¶Ú0_혲‚AàPŽ7¦1-® • ;,êÆUv††•ç½»àšÎÎH¼Ýµw‹—˜é¨ÚÜÖDXå6SRÚåMÕ5…Ü$ќ쫄 9Xí…Žyæ#C²—Ê(j8<ÂÚaK–ô¼É¬7V#>m91ÆqÂ#\\2nù‡eÕ‹²Ùæ]î­Š!jû÷\&òEÔ¶½Ù*ÅêšÊ2Í¢ CE¦þ­šÅfŠ0`µ–; )iÄQGž=EÈ­^Ú0•‚Üëœ/„`É#+š¤øY(I/ƤQ¹¡J‰‰Þcä·ŽØâ\ÝpkVûQîû|ºØN¢2;«ÏeóÚÇPy¶héÝ–ë¹-|ím‡v.ØênÝGC*Ü[ ]-V#,„9ÔȲ‡2u^úcĈ̭7ksÍTæ¼®Ÿêx1±‡ŠÆy¼U×uºÉ¿Q:¹¸ß(FÙ¸p¦¼±“*¯1z© šF°†Q“—ÛV-¢­]ÌÂÐH5‰ƒc2&ò#:þš×Ó’”¤ÞýEœö´ oÀlåÃEq²àeäk N¿]Í…J¦7tgb;~íâs7 Y&²äØwHß«_IŠ½ïÞ¯Ÿ(×çÕzVI$O#Ié¶éNÍtјÈÁUföºøkuÂnþQ;Ùãýœô‘Ýv©·,¤ÇY|<47o<Ù‚Wj9öËZÁÞ:pŠ ®<ùí¿˜^nò• å ÓS¹˜Á»4mWSQå²¹o³tÖDÖ[*!Â9¨” ºPgA$imð&ýËMõ|èúZð¶SMÖuH\0s­v5úåÁ¾bu„`Ñ”¡rØa¯g^8…Ý]kGkøK.(JôŽ×#,e ë@’¾,ns„Ärç•`+!sO3#,JÅÛvØ…Sä,!ˆåþ=;oÐä‚ÖŠ~`>>ð§Þöéæ¢Ã¼ëá3pN”ü¦Òô~¾~Õb·1½a÷&L,ðøìk·kÀjl¨é+<÷–ªÀ¿IgɪRYPZC$ÕAÀ=ó»læ¦ßl›gÜAêÿ_IºeÁ@æãÖª*•ý·»>¨ö 2¹¥Ø²X&AÉÁ”\uËײÜp£ÒxÖ$‚ ƒ÷UÂVÑÝôƒ^6F½qhG—ù–„ZHüEm?b:ô–Q{L|)ÛÆo¾ÔÒ¬¾ìœÎ؆A8ßÁ૤c™lWBLcOœÄ>ñ´V`ê,¡[––(Ý{ÔËXÝ:´$ð¡˜ÕBÏ­™šq#,‹¯?œ\½õ™S´4Lyóé¼ÛŽ±æã·“ñHÍÂN1/Õ“ÒÞÅ‘ô*ˆ¤9ÉtG "‘­ê fš´ËQfƒ*íÀbm|ä9Dj¦nŠtç¢9DÌ(ÑŒ\”¡®Ô“ÄUñË…Ž Ûf.»(ã8?Zœr Ƥí¯(Ò"’~§#+^F³„0–snËÔáYl6gU¾ç…8(¢û UF‡7Õ ´Ÿ%¼ò„¢7(3™-e$1 ô°3·Rˆsi €·žÃÎda}rÉ NàQľ#,ʦòÑŠmWz! ãv½M­lˆžÅ@vê¼Gy¡ý¬˜#+vá›ÝmaXÆqSbÂcƒÅðTÇÒë\øÅm=k߃º†HH\I7°Q­1Qª¢ÑWVë h3Ô>D@k½Æ6â%ŠŸLVó4×dÒTVØ*§ƒW&âD•®}Q#(!3ñ¹‚#+Ycœ —èuîÕ&vÎ¥©(›bæøh¦˜O™’9a%ˆ¦ç3–…Ï|地¶Èb­ZŒ°e—N»4Þõ‚“iÞäÂ#,ñgM‹›Ãõöµ`•0ýù@˜Hb1;Ùe£Ö%#(ѹV>éËzÈ#+ÓA*æímNNÊ׌+[æûÈ™-¯7[\¸,n³%QÖür½„+/9“Dz°®y-êŠ h°ì­Xˆ¦ù)‚¦¯kÐniÃÌFȯ¨Œ(£ŽÕHvë¹ÚÂrA´†>Rš?>ªÇª:ž  m ùvrW>YM:#,|3T糤±(17O^þÊt¯"½în^µóß}ÒnsP¤õ9©¤Ú/ »÷'à$ý<«à=ÝZ£S°1Grþ骧2úŽ m#(ÍÆíÛÏW’Gì‡Ï úu¢-Ö™DDñp 5ª‡,ÊVc \EE‹ad&CÜ$vuGg¸i!~«6TJ_W.¿_«ø|5Ðn…PV«K_öµÕ-%nÀ—GKU+ ¡¸«…ò»ªËa§`8dµ:÷EçÉÄ4,)Ì®ÁÉl“”KLñ™ÐY,:ÝóŠ 5jÂdï•‹)‚å3n–§«è–¥\:Ö¢t•sKmÍ3`ÄaÑã[¬KDNÁ›ªýlÃq^#jé0†«â²á‘CªÇEÈû¤!š¸Š«I×ÚèPP ‰.LŠ› Š¿é°ù” u  ‰»i‹¹îÚ†÷h‘·V@Œw@a–/݇jŒ¹Öút‡ò À+zª™Só5€¼1ù6;’ ­ÙçåŸ0’±ÛÁ¯4ÙZÜ™E÷˜xÚÐì9Aßå]bû#+´Bªò‡IŸ+»#+å¯#S-dìDd†:“nŸ+ì!“¿óâˆìxKø¹wìyCË-B/±ì/Ty¶(Ò0ç˜fmþ¾¼-“Â&£iìh7Aá1…ýæP²]œ)£M+¨õH-YŠ8åìË}£g`¶”ìæZFlÔjRþ‚J*`×Ë9BQIo…9ûcª‹>Ù#,: À¿&¹œ`$&£K).P0ÁC##,(`k‚PÂå]VJa…®È[³~"Ž Hs£XCœñ™Øy_IsŒ»)¥Dä¤fšõ®NlbןxÖÅÊ« (¦é5bΑ.‚L¯pb.›¬pMFÁç HÖ ö´à>|kbÜ’­“F"ýKn66™ñÞŽ()BÂf—¹’Ÿsô¹]l1<°×ÞR²´éš½'Œ%/\T5ósimëìƒÈhRL!ź5öô¯³mzÎŽy¸VséUxõœÂÊ´ Æ}ðV®´}‘­Z!ÑÛï3?µOœÑí#+^˜õø?¿Žå']ï3/¤#+šê©#,ùDà ‘àR ©£é ç%hºãªE•ìdð¿c“u—L::¶¥»J‡Vë0²4ÑñÁÏŠ‘!@Î4'C(á,7E5ÖÅép¼¾äTmñ•ÕL™¥cÊ)½EeZº7É•£I3Ôtškƒ#,cÆç‚ÂfÌy7‹5{´yœl4 –Óåø¹c6Ï^?Àv,Ò7Lrɺ±¶ñ×Â9£¬?¿WâãÉ qŒÖ_öÐÙÑ™N]«mÓ¾”ß±CÈ9`Cˆy½Ø(´´’E%¿tö’<Á~õ ÿÁî%'}9ºe×¥œPVª¾úZ'gRú©ð6Ý#+Ñ6Û×¥Óe{íË«#+õ‚ŠÌ#+ne¥êÂä"7у:áâÙSj–H>…7°u¹¿v N3µ(]ÖI²sž~¼rÉ€‚#,»w-'>É©IÙãÏ涇CƒåÚ7vyŽÄý‡ßâ=Ž†zíÞÜG›ä‡·;¨M2<ŽòA\W7b ê¨2 )Ià IöLB#('0½vîTefCÏ€h˹'óîÛ×h#,Åõ°äªÞÖRÈÉ5v*#,! Üp¡L‹ír3u4h§ŸÌùòu§H¾¶tÒétÒdS{)çíõõ´¼ê”€ešCfrMïáïL;çAûtpäÞ>VÅÓîÙï³ñ'œ†nÚ½•­>[õ‡‡!B¿#(¾^¯¡ï |^Eë mx¼HkÿŠ£™¨<ÖO G^ŽÌbªFžH³Ö˱v|lÝ(N®’˜è?¥ Rï4°3[ j˸[÷&#(ÕF±‚<•fÅœ4×ë5mÛPv˜Ó¼ÎJÌÅÏáQ†ŸH¼Óf€Ø¡M'ê™re2´1£†—ožÓ_yù_bd¤–Ì{žFÅÐ9/ C‘G’B+Ôy5ùóÎZHmºkfAlŽ®°Ñ×b]­ò4I,èëC£9BØÇßW$  I2§ÁAÙ5'Óö ^yÑå9]ñA;Ap Áiè÷ý®Ö¾Á·C,£~ï4Ô@xŠçó{/¯êðñOŸƒŸ³æŸKEòsñUDMfDhD@ÁS1ô{Xü?z}ÿŒ›ÐôîGB. èì}Žâ˜yñX]c¼ `@xt=ïNÊÉtÚ(hÏi/JDCø¼èØûõÕ’ôK ¨ÉÒ~oê+Íö!mI"ˆgÏÛ6ýz(‰I#h²[&dd@¨€TPhª"kòølËZjzØÚÅ+¡DÁBˆ¾¶ ôg¿ÅçcœHÍîÜf-ŸK™ùíÛ²ˆ‘¡ýð8Ãaõ“K¸š©¨,[*-E)«Ö«kô%çõ}6†y¸Þ(<% ¤ 3(WÙv…Qyæpפá¯ðÐÛËcü›¼VÇ÷S3o`û™I[“#,«å¿Kê¤Çfý!ùÿº‡Ê57‹ûøešqŒ,$Gñׇä5Š>ˆw§BL2U#,Ä*¢JÅš·oÒÿx$j¢É mŠS*K5Äÿ;Ãü»K<¦ÒG½ Ê#+¯Võ¢´!pqÃäšmàÿ'Û[·)×DìNÅ”{#,\eóµôöKíˆd­¯û>nW`ÑF˜/G©#(¨¯¼5ða³W"ìºÈ|¡oäFéƒqÏîawéô2~oýî…ªzïnRc‘× ß'ÔŒ€Ü’t¥6®æçõ3ƒŠ\ª‰bú<\%Ž!^ð¿2¼Cœ‘¦»wÙ…Kîx=㎵©×ŽŠÎ`|ï§'#((ŸY ŸUìo6Of­Z¹Ú¸üZ;kzŽè0A7‹Ã{À¸ ™)õÎÞc¿€_æ’”`»ÖÕ‚€@UVeÈZmË›CW'Ò¿›¿ú‰W3Áq*Ѓv\—lçPäÖ½a0_­Ùê·–.0ä#,{·3ºmAÎõ ›1s¹}}ö –™ Cx†°üwë{¼ºæÀÅ\2¥4Ô@KÁI;\"Ë»‘ù¼?H*½á‘ê’}ëñ¦6¬ó,kÌô#~˜=°;­}±"ÉgëêñØMBÅeFEƒÑ¤7‡(­Ì¡F´RTUÛì©Á5d?cö§T†S½4J`sº#(Ö³ü¶Û  È·ñ6‡8-ॲEA‹ŒEw*’CÇÛ@nŠ&’€Ñ*ç2æ¨èÃT¤Ñ€¾ZÖsBÒqe$5.¤˜Ù0ˆ9&µ0LØQÔ%#(g¦ d³­äomRÁñ‹·Î€}d(†Ø·¦ÃmÝ®v,'öÁ¨vÀ^ú¿½ªy®›˜“ëšûŸ®’½}p˜{"¼±J×Ò´CD:§¢§,û›}•@ëëÓÏŸ,¸Ïwjp1a ââ^âGÂÆ°Åì‡4ÏþÏø/¢Ho†î3ejÜê…>§L“¢,VUv{UP0ä•fXAió=ÛWiƺ*_;mÞ•¾4”áx}7##+À™“®ÞÄÆìïùUÀ”žü`/Ùë÷,#ƒŸf0‚qEí¦#(³¹ú>Ìq¹Lš«•]§Ë¡{A\}>8ùÏ]‰ÒÕSÔÒD;Ãü¤=óBü~›áݲ-¢#w;±ÀJ8ôþ晑îë¾Ê­®™Õ£?©'¤©K##,©©~¦çs¼fØ4E”{QO6÷ çç£XÁyÞ¨°å #(=ST3ÏáX.HW=ÜùœñßgÊ@ÒšÜ\#,DàDÕõ³]ü÷#+mXƒ+,² #+ˆUB†µãç2†¶Î î÷šAåkZÔ¶Ãòˆ(©ã%˜Kºuª.¢‘Œ¨ h1çX´)Åvlãd6BA4#+ªr"(§ñ÷i+Ÿncô‹¤ìŸc–õçx^'+ä,B>-µÜXƒ®Ú,î…i£¹c#+–îÛ¶©½µ#<Š0#,ÄDäî3¹ä&ê(BX… U#,Ê/$o¨>ðö8Câò,DKn*9òo¼#,ŒP.Þ^^›ÿ¯›ƒ ää½êüöü;=*cÃð¹…pÍî§W·÷«S»Ž¶/²¨ ¬D* mËDÝ0Qa×É3-ú'ÍjîªcP1(¯7n…ÂQ`¹kg‘Ä*tLP˜HtaE¦q·âÁùWï(ÇJnGÌÆ4O#>«š§bTU“S²¨AaÍ!F uÁFjÍÏž©|Àyù†8ïë4®äéEÐK¯¥ÁÓ¿[>—ºh'—×/by2—EeÉb"º÷‡ë÷cžÉ#+‡qˆ`çÙȵæô\_¿J³ÏÃîò¬~Žt²`í^ü’ÛkŸo~¡ë¹ØDÐî+$É8¨äTö/[2±W =gþë:Òo|¾î „k |îÙ…ÊÐœœ#] â¦Båg³˜XFyŨ É÷z”7—B‘<ùñŸ«Èû¯O/tö@ù½Î#6F"‰¢©C2¦° {ZRO%žšGIk ´‘®³o'®™º…Ö'jÁªãüŸ§ö~(ô<æX“•”68Ú¯/ÎëÖ®q^a¿¶$l©*€#,Ö³h» ºsÓÓnP±Ó}“ÈjÔ[§ÓÖߥóÄÏ ÞˆR'Põ8›#C7™¿#,¦¬6°®b$yëom;vô=/_7ØñJ#7…o(€l÷>Þ|æ´Â2,¾ÑÞ3MÕhñ½Ñ’N9©ˆ=š'ËŽë„—b’'/·Qq4ál¢CÌŽ—¸FS€ÄžÂÚ°Xº¢RdÂà-«¹&Ñ°%ĬîF#+ˆ´yh _ ÌG»¾¶ÍîÍB8º…G6´¹ÁćÝÑ“—|7G+!qX/+̯ÞW=È(Óµ…áÉÌ|n£Çk»H­©;52móÑp:^Èq7ÌN‘ä˜oÑ+½m&8Ù€BŒt/rª0‡(<#,:LjUvjpêR**§Y¶{ß”­ÂÝÅ7Y´€Â)Ð3ºBks^GtÞ=ˆŠ¹\¡±BÃŽú/ˆÒ¢aÓ”¸¦5G¹×‰8¶Æ8âý+ˆA¨O˜$ !ûÉd‘`„fÏŒ7-"€_ø¸F£(ã®pámÈõ©#(† ™„ÀÞç—xŒç$g¼ 篇0|o¡†òãÄ~“ŸnUo˜¸Fð%Æ„¨xÄsóñP#­lap\É%šäµ÷ó‹ØAáí¦¹9b®Í©dûqâøÆYg%–Ìši*-A/êExrÂóO&ÐòrrŸÙÌ0ÇíS¸òã;ö'sXzßér1=»¢R~üAº)3)ɤöýYǯl“¦öVó;Ñpìt`„-  1¡˜ÆN@&AÄ<ÛQØu‡½FàwÖ0Ù«r~w)_™úy§.z"÷ñåäùݱÛéxïr‰!§¼ð…ц¸Ü…»8]c4BçÞÞÞR&DìýV—a“gô·@1‹hë«Rng»z:MIO1îäÁ3—èÎÇÚq ÇHF<ÜëtÇ-ý'Ò ¼ôúi­\<Ë°(À¦Tç„ïÙÇGÏHny$€#(Égkþèý$mu9mGæ÷ßYâ†dŽa ØX”ëáÌ£œ\m-…—ŒJN–å6±Ü¼u÷‘ã£ÓEÏjø6Z™ôg®Á#+S'Gg–Š)¨F`ØrÊÎGïêLÎD¦©‚-Á9ÙŽí#(€æÙJmÕûñÓ`„O>^ýFSÕÌ!„̱ío 4 ‘vÛ#s°ÙÛÝ[ìÛÚ`¢6¥0ÞæÌžâž=ÈlgPÑ~°?Â㯄ø~Îy‡»ò60Š7°œ_ŠØý‘¶H%ÆÇõÁeLÖO#,©¼ÐúŽðD†o"ŽÅVðñ*ÎÕ4Ç|6¥ÏfìœH( ƒõyÅ^Üg0 ^Ù¦8ñ9Eï]„Ëz wÁçNHº•ux²a »kñWWXMT¢nä’(yE­›æð_’¹1Dr§ô¦;Sá_–ªn[Så³Z~g; }\øë¶WWp¼C¤TYµÏ#,Ì¡Þpe媦7ë/è…Ný{s4ÞOcƒe&ȺӀÖrzÌöG6í¤f„Ý÷/·÷¨€´‹^ ’Ga‘^ý#ô´Â1`#+öÓ®‡$ ŽR¬½Ã8L™Õ’ì„JZûmpÔ QÜ#,aÁRÛ#(JtsâöK±ž‹g;õÉ7zèÂ<ú 1è#+×ÓÓËDuYc¼Ä›Bz†ˆ:î9á†áŠ#+¶˜¹#,y÷L"ëØ©G1(®É¶Þ={ËÛî !þzOZ¤ù燳", -^ËX¯¡^-J_ÑMmí¿_•ÿiòÿýlÿ}9‡/Îl_ãö[3Ô?ºôônºé– 0Ú?—Öb*Ð/Êl`ý¿ðý?ªd¸ñÄËýwëÖAÓtö^þË'K `bsa.7aS¿¡~F(䛳t<›øª)¶b êÙª•„{R‹¢¦#+ý xã9÷ê+¨|Éåtâ+™1M £Î#,e#(†€d –kMŽx##| ª)to³ÅK¯‚$†ù!¤£eô‡&I ¦ë#+Ûú‚ËA½ZO9þìõüÏ.ÎÞX-îüýÉî:>µƒë#ÿ<ÓN³ã«VKsÞ#/ô¼¿ïþ¯-‡Õ¦âl½[ãM#(Hpø!à‚û†N‰G¡KL(^^³4éx@àëØ0=o{'äú,´ãà˜æÔ®¿BÌ?êˆ{òéɸıàXÿ%hÉ¢¡A‰0 ”Í*Y­3%1cì¼ú¯£Ô'ƒ„’4ÈÐ6‘/£ J­Av#,yÎL÷¬Ñà;Èì *˜£ ò1|ÑÀ÷ÍÀAµ³ÂèrCªå#+òCß=è9™„š&&°"#¸óâoÉÙÔ¼›,Z©±ðį‡ y£›^úJ#Щ:¸Ë¶ø2¯×Oiî¹×•rÞ×­íÂH¾­}̵õ-#+“h­™lPÊ`yÂsaaæÈr8ô¢ß3:òÉLÝÂÔêÜdv:Ë2/#ÇE =ä ÓVµ:erhÒLz¡Ê¸5[b¨Í $Õ~#Ñ z8:¡§‘#,r[ühÖ¢}•øØ ŒÎ¼E"r]=2טe¤ -Âœ÷´n‚CÛ®šÜ­ºšÆÛ Q³»D㧒é$4ÿÁYŠEP†âPƒJyyRÖ ÃpÁÕ¶Úë†ÓŒîƒžý·Ç¹;'pZ*1i#,ª×v1Hî¬.´øHE:E±„o6Ü¢Ì"á¦7ÛÄâpvϬ}}Ü}Ü1v Z©ŒlÎ@1®ÿ=¼5Nr¥FEåB#,³¥Q'#()"¦Pv‡^Ýüá®~{kÕúü;]º¼ l ÊœùtYg£cX”>ªï¤´¡eÒB ÜM#(?ùÏÓv7ô1‡=ŠWCÛ*#(qï³¼zF1$¯PÛ#,ø8ÞPƒ#(,ôÌ¡šXuåq"H–Lw‡\[…ýèí#,‘˜P€²KB"P0sÃ×CG\D‚¬‘d”ªbrôçß®B#(zL÷ú¶Îü°Ö$Ìj@:æñŃCÈ°“M»©” ¿ÆùíR#(h…ûëò ù7Û¾=y®;œ|zÎÜ^JDEM•cðì&ô‚ˆóE(*»&&,€,#,)#,Âx3Ï/7žs˳ZîéI+rÒ¬¦RêŠbÔªiÒE|&ÂùyƒÐôþÉå‚®ñêLÔ¬yµ0lÁ¼ùmÒiãT§:ðÞ¬¶&[^ç1á0JŽz÷TåIBƒ$ gFОO£4I) ,ñ3j!nZg¦("Àƒ õ’ÉÒÉqØÜßñõSÌ82Á›HÙH›¼¡²ùY:´:žeܨÅDEX-$(Z+IN˜Áã¿‚:Ù:,ÛÛ¸K7fÎÀç1>ìuè»OoYMV¼,Æžæ©$˜NÀv;Ôó„a:³6²{ÃúýXÀc§I®½ßS¦?¸;C®‡#+!=È|wσQ]¨¡® gzJü½<1“ÛL+¨ ›6ÈÒ×¾*Ž¾Í­9"̼ñJ<#,Û»7®ÿ#+…¬j¢Õ¼„´Äb'4ä>蕧µ]:ÞÈ;³@Òëg—nP×0Ã#+@“ :ýõÉ•Ò¡—&½™]3ŽYPÔ ®Rc$*P<8xmå>†â¾Ù¶øL(]¿gM#+P“)A“¬¡hFGÎ-èúoªÎ›«½gg,8¤Èã‘’”¯ á©\Né5`YE€Á"#+Ô)i+Ææ]Õdz™zóžFR[¦-ÃØû¶7ŸY¶ôG]3³¸Š-Óˆç’ ì›Ø[ î÷ñsl§…Sª,®tæ£k,)ïHqa‚¨.x÷Üð×73A׿å¼ ²¡:¡•E€B#ˆ‰¤N™Å“0’4pË$@_y„«Î‚Œæ,KѾÃ=ú£åEÐðZ¦ƒ.†ÆƒËiBóÒN¼lñj=²ÙzàŒù¦c fNæáäħÉq“èj½‘i‰i¬Þw†Ô#+çÜú0(g-»;aÍ-‹9ÊÛºü½žÆ!3ÌÜ_P9NŸÖC—7AxQÑ#+š@8˜Õ[ïdž)Ù“›¯‰ÜB¤ÄÀ¤Ö¹¶W;&Œ'²Ä´á™F1NÜ ;¤#,ªB ’F$„B¤Óli1”ØÊû­“|R¤e‹ Áêi.®šR‚©Lhsʼn¥ž'n‰õ…©¸œŽ%ÌB*ƒàÑ)“‡é€ÙŒöéøו¿Ç9-gxÕâœ|´k8sìÍ<¢Ÿ}xÙG„ïg^|$Ññ*óCª#(¡¿:Ë-<ªy,ƒÖžÛ8>5^òi–„]‘*õU!ÒQ¾•w¨í¢èr (ÝÞrŠåuØC½8Wa‚EÞÅb¯mPtäv#(6#~,Ü2Ø’®qœ”¿³ëäû0.ÓDÅæ$P¨àƒÍÒ÷iÿ–‚”žà¤{µ œ_£œ÷!¾™?6#+õ°ÑVAÒº#+MSëÓÇ«[1š—÷M»?ë9(qÿ?æL2GÛ#(ÿ‹ooÿ~Å#(;üÿÛ´7ü¨ò±ÿ~çY0‡Û#,È¡î6Ò?P’¤…l…¶Ç²«ê5«§/äýÚ‡/†ÃK“åfò¿{÷Tö(–J#(Yî°{)ÏuÂCGIcêè xË.#,*´ ²&·ô´¿ƒÂͳÃxßÉ 4»#á6a7OÊ”­9™ï^þã~¿~°¸Žñ*}#îÌV=ù×=*5Rð—…6ÖîïŒ~&yçÒL1–ÁGI>ÜÜx¯ œÈû#%ª“.S=²lPSÙ‹JôH#(óü¿¶ŸÌ/öá4MÝÍš&Žqi‹Ê2HBöÇ#+Ó(R ¨’Õ}-Š)#+•Õ…ºÿ-FÛY|õ,É¿ È<Ó—Ÿ úYmYcs¢X!ØÏñœzQ-‡µ J¯ÍEÊJtÅiŽÿ#,=yïÔ=»é3ÿ“™7ë·)r!>±ÿ°‰ÿd*ÝܳÝ×WŸŠ€\;mª¨@€tQÄ2" @€{¿éÿÉèþÿoÿü¿ß/þ’Ÿü+B¢?óùh¬?Ôûl'oúŸý\ÜM?­§Ø)ûèülÓ|ö‹$uå7CVÝ—Ž­R¿|m8eÃU÷z¶X%è{¶ñã¾–®™V,÷Ï/œ½5>ãné^F~'·ÚBéóU‰_Š€AËÙ‹=ë#,ƒ?¤Ë0r(ºÌ[0„1„3$feûÊ­ó¶÷°5! iL „súþ­`ú7¾×N$ÌÓÔ1$m½w»Šé‹#,tWr†CƒEs†WªÐþ+U&-·vã¿bHì•ìª!Qª¨C˜þÅü_£N“ðÍ "gTëÇ •é@ cÿÇi¸Þ’8阔è¡¿sÐ¸í·¹zzùÕÚº˜¤G³íñœo5f2æKªqLÛßyûÌ^#+¤/ð#+),šy×5¿p×>#+zñ߯/Þ¼“ÕtT(”x%ûL^:¹)óË3—ñ[Òè~Î0~Ȏر¸cdÁ_Ùý •;ß‚§ÉZnpf1ÒFqBQlTÔÊ(X± šV7(€åî&zòŽ/‰RJ×fà”E¢SWEAvTûÅ™„ëDnÁ°SrÉ/Ô@ȸ0ýã[ve ÛÉM®ð#,>ÙöZˆ#(÷|?þÏúë5R­˜§uòæq-ÒÚ€ÙÛ;ý{Í6ð2᪩6üè«nô¥÷ç¿m睊·ƒÛ ÁÛ=/Õ½T®Gb©ÝÊŒ@ p­±ku-Â`‰Ú0Šóff! *×ZÊß%k0BË1 ìÌÂ0m~_sVDÊ]Ÿ)Ìòñ/(Ï5uÿMFÆ“‚©‘(›ÁàO"GÓªÞl0aOžg¦é≽Q”!âæ{¯Ñ“Ôø!×UHÈHš=šÛgÆËO²†{Jç.“sùÿÁ;9 ‹­¨¨!Í”’H‘ˆÈ”;³ù·Oãã÷O_³Ï#׶½™]Ë= ®ï‹u5 ÷Ÿ©ú~‰ùtöu™ìãÜóÎbÿ†TÚH¯ØöÐùÄõCÙ2.^³‘Ç_¿Že<ßêfrM⟽6Å;*yT¡"Å“bƒô‹­Ã®>†Àª®Ã¬=ëŒëc²"ÖdR ΓIípk(G盃­õízvŒ>¡ ¿ÑËoñü1êLB0â4Ðs"{AötÀ ä*€ð1'‹Ãººú{»wó÷Zç{;yƒ‡˜Û©}Fò£Ø¬,#(hDCŒü%Ȉ0Ø·Ô%Ý·ÅÝ)W‡þ[Æ^ͯ)eŸkÈÌm-s 4ÀÇÝä^;~Òv¨ñþi¼çØ#+Ž¨+«çQ¯þ`4tíˆÁšÈ0Äfió\/ÙÚ tãïfgäs7@æîdö¢ËáØ#(î Ë0ž“R¥Äˆs®w€k=jvýr&$ù¼è’A$ÉFKAw³*ãP#+  |SDF‚Ç°uìp:{•ý±„C=ã iëêÜ*?ê™Ôò|þÂ\ÚjÛ¿5ž‘ñòü2ü|˲¼<Ÿ °~"qÆ€‰`û±Kì[ff6¿KZÈYýKkqµû®HÎ…´ö û×ë(HìÉÿ³¥èïåÈ!ò9¢¾Üiì­±ô“ûä{×Ä>œ·—im³;†P#(°!Ôœ{ÿ_Ÿw¤£ûÚ«ømê±õw~;—‡ÃÿÔÙìljí 9åAmš(ƒ(i#ú3fŸ~çÙ è”%…‡¬pãë÷ç>¥9;ièŽê¬òT¾!@>;«¯òò©éçßjP#,#yX½¯– ë›ë—lÐöANÈéì >]ål?äŽ?FŸO³níRÂÄÉ=<}à·õmÇ„^:¹#(•ó¡bVO‹Šý§Ïñ°aŠ5Õöfhs_Óö^o|ágûì[1ÈÝ"Ãݾ½Ê¦™ä?³-yðKoDH|ˆm/Š9C¹O©maÖ"e™˜ê©#(4ð{Ýëø¬=/Ô0åóôvi©"|R`x‘¯'7ò<(ötDúÅSЙ™‹ªïiî®X¿6fÀê#, Ý9}Bò¨‚/ƒ0q–|½xáÝ…0˜ííuÚ¨áLɹývêÔ´¡#(ǶWC²s€óy’ƒ§áé¶ïƹTaÊÙÖ_xü#X¾2ŧqák[ÊÕ+<`Ù¬c ‘:bI#+#kÊøkÓ¿¡~ÓÐà„Ì&{™9ŽM ±¿^RG`¸ðrèÔž2Ãq~®Éë‡d#+‹æÇÏ$xܺå²Õ»ÍF|^ÔSt·äíÄY1$1‚‘­zŠ1³,ò𬰠ÄO‡j~’JŸ©ü‡§Þñˆˆr{´šm—pLq'Ú#(Ößj .Ç2¸ „ôÚW®ûC÷³n9ï ÊWrÅTò #(#(àÌþe}† Ù]®_垪žÐg„÷Ëåpüã¢×ìç°ñÛ³—0O”ã[Ý›D<8ª¯íF2o¡*ó+ꈈ%;0¸ ¨%£4¨ÍhbRˆƒ”’'·œZß;®èÌÐ!#([ÌÞ!Íþ k$éèl!°'U¬7³×Þ¾æ a^Û¾mh²ÆÔD Àü•€…ât—ËŽ¿_#+pó"#(#(…mD²"8 =ùˆôwTÅÑýy£®<¾ËyöàŒùªxÀ:Ä#+ 0$#+ߣ¬³köŸ×¡òãÏÙ»»¶¼79ÐñúH8n Äëk`8þšQ‘6?X wŽïÃ$H#(Ûø€þ¾ö}œüú{Á‡ªÇP]æ>õÆRgÐú‚¹çí }õp”‘BÛß>¶ÎSr`Ô¢¼zïc#(ó9ë—¶èºã°_ÝýBƈ?UC5áB¨Èé kîø¿Vùçp)ÌÚšsV¼PšâØÙŒ>VW¬yJ+•fË„âŽù6ígAwEÖZñŒ_ÑÍlŽ.îx‡PØ ï'÷Tnm´Ò\ô‹—‡…÷ßwû7¸ÂÜC˜Þ(¸ñß5U^kSÁîÖ3×-õ×5iT¯E´žÖõì| Ûí¢[!zðûK¢’G¢:Ûš¼âQT£·ÁéÑ^/oug/×ÄæP÷ÙÚöª6¡ÝèÒî°Zk²GEõ¯„yëøÓy÷}¶cw&_—[º§äƒ§+/óU/)‹Ÿ7û—ÅhBLª„^™;ñn’•ò“i.úTŸJñ¦Ú¾9y7܇^>Ÿe”Š7ŒfŸ—~›`œ«À| Óõ¿²ºÌüóÊóÇÌ½Ñ —ˆH_“¹¼ŒÙ}ºÖüšzÒ©Kk&<ïƒäÜ’^s¡¥5‹ù0a#,¨Ì5‘#,ò½FæLO4ÀQ~õ«Ë’ßûBÇš#,(T:#,ŒÊwy¨ú%åpÏ¡ø‹¢ŽÂæÆÐWaR¯k …ÊÞëå—^òdžú¼5éèïÑU±ç‚·ãÄeW̯`£7³:`>+Ï‚3už3Ó¼;Q*?1‚#,GÉBD=ÇH~¾q¼u,#,®âﬔŸö¼&Téam>øtŠËåb·xzv‘Š™ý»\|lŽžï„}!ÍÈxª„:]=]‹Ÿá½Kíï©ã=î+pšüì°$(¾W,º%ÒMO°Imz§ÖåŸëÔ¯-º(ž2|”|s—k9ˆ&wÍ™ÚZhÆ=qp«Ûxí—Ä¥…ûö)…])¼ùÞu,žêàϤ霜úEz91;¾!ëï¬Ç_šœK‹8£·Mqâ³®×:§?"äÏIúçkY ú©½¼â<¼zjC©nD\{&‹ÙkÃο“ l as2n܃§Hˆˆ‘ b/†¥wDa8Ä’I*q,Õ›b³#+äd}A_k@³ÙS§[Áûlù¼Ísfƒ¨¦£º+äò0úý[)lî/‰±÷Máõ+µZ"RãŽn‰UAŠÉTæ­5Sƒ#,ðÕXG÷ï»eÎKûU7“ñHüÝãl»}((Š´ù²ÿN­º»x܆™cO˜t+ÇM¢¼£×zÊšúGàvÔ/ŽÇ»šƒwa1{Àç.E:þI£šzsÿïhi”RsO"„—àw"éûÜ@óÎ殓¿¦ŠÊ¢…óÖêj‹Öi¨ â°±Ë7†W–>w¶s#+Ó½ƒÞé³5&耹áI=Ì`ôuR«¥lTZÄÝ.ó62jLýoŸ™|:sOyelQúÛhü1Æ–?^8ÇMó©Ñlv§Xp¡Äu’w}$¼‘¢“z‹:“¸«-ZwNè§<áЕ¹=Ùý#+±œáÝ#(²Rr|Ãëéúi}ÛzÅ›¿)Š@p†¤ÌJgG¬ÅkÈÉüôǵs´™Rï (ļ>ŸzªÃùœ7sÊHÔ?ˆ…Ì9Ïë˜îPF¹‚‡*2~ýeYë˜Á™þ#(áDhßz‰¹_$eGD· 1t‰Œ|‘h}ý;b¸­‘RW—S8íà¢8#(öåÁ›Ä±G”€yÞÃ".ÒOÁìB—uªJº]ôgÀv‰\_ÝÕøê{yênìUÛ·Ý/+ãÍ}ÑzDÛ;9¨â\Sñn,ú?*æÍÍôK÷¹¾wùªÅÕ+•AìííÉI!6õÞ¼GÛŽÛ­”(ù¨9y ¨‰†{}n»|QŠ¿#‰“+Êž#(ê"®õòí^0sƒ”*`ÖØí°AÑ[šðùìíi$ƒžÑY3=í·%aò²ÎB¯¢,Ó°=ò'˜8sk~PÖš÷ºßK(®o®UâÈÂÅæ{Þ›ž!àkuÚ:E) Ô.*'+©õ߬7Ñ£–§tK:ÝeIäžé×zj?õ§:øÞ³ô¶ÇÛ<0F1Ûu´ÄuÍö­EA^`÷”rmp¼­­J¤ʶ‰P•ûž#ÏÕàŇE-‚¡ø3%ËŒG`Ó¼áANŸ£ÃÔõ®!*g±¤QÞÞXð/ÇåŠ#(œzfAŸDüYƒÆsC¢‡0ï<æXõž&B=â¡þn¸ ÒË:çW°]µP$$‚#(¤qâÌ´ˆÌ¬´µúÄ%¨üÏË¿õu-È/µå(KêÇ@š2ü_—•6ÏsKWø¯/èå­?„§ÝY÷¸ö©« §eïŽÁªj8t#×Dw L%±‡úËûß±å˜PŸ„ÛNjACœQQöºÖ©‡5á÷ÙcóI>Æ};×$IIëñ®=hÐ{#,JBeØ~‡« Œà‡Dݰ•ô!Ovh±&O†·Í”ž±$Ñ7¬{þó'NÊ#+Ò£]K»aëçÂú׋½PŒ7«³ûLtv6Çw#(U¤¹~T|yÈü•ù.aÍ×Ùø@kÓpã™úÝjÊÞÕÿZ:nøÿ=Ý~N8gžjDÀÎ#+Ý@ñCÿoªðºk‹¯Ž2a5‡ªmWO#,«žÏ0‡^\”#ÖsI¶†I·-ç[âlq8!;UF#,Šò…uÃ%_¤#+™WÚ0ï»6DõoZ€Nª¦Õµ‚;¥B&5kar€r—½ }‘Sº|!êÊžEŽq ¨z!õs¨òóãƒdòÓ¶ä>L5=ÚÞø©QaA]ÅÅ\è Èh³¸qß¿öB´Çƒž—%Üž‡$<ÎQ份Þ¾äSFfˆ®QµWY#(j#E€`"ñê¢f"É3ô£¡†z'9äëf›aãƒácªQ9éMCt=Ñ<#l#+8MÔ›AÂfn{¤SÜ̳ԓË%²Éîax(¦`ŠBÚMþ}lù¸á­ÝWO»ŸºDXÎêçé<·Py©ù=P²²;|TE¼á†ó,„ö»›3F„éÙtDƒ†€ãpƒ$?Ãã˜Ø„ƒ6£’46ÈÖ˜€¹HÈ!`’ÓKCE¢ ˆëjÊ#,eʦñ; w¡Uy¶MܸwôAÉï3®˜SÝéŒ#+ÏyµT[Œ>5u®¡Lt“‡´ ¸Ÿ…¼'ûó÷A&ÝöÞWÇÎ+rZ„Ó.tF)ʧ:54“Œ£ËD§ªg!¼¿FÚïزº”s®¥$.½qjŸ*#+vŒF#$@#(œÍ? ÷0›]2Èå.´ý+«\鵬þoHdOÖ>Ñîû0Ï%pþò¿Ûß#,Ìë'×c±´Pž4Zxm¯®÷¾XPâDo×~ŸË“»õý?ÐHá‚f}¼øü«wÿ÷Þ0™}Žš»·Ü@ý2‘?tÂ?ç§_ùzÓ«½Ì°ýì¥OOµÁü<Ì'ô\±!úûµÙ»Ä79ßlV`m÷ŠT,½\= •Eö+gúÜÎ#,Plæþ9_¹¯þŸŽüçò{¼ý>L>xª¿TÐã2–¿/cSûÿøÌYÃqŒ¢ð›@[¸û) OyÏ‚k=Ý!×øâõìûþ%žòWïh´¨†¡áX„ˆý!ôøÉXÿâ}}€þ?‹ÿO胳ÄG´d>Vßμx±ù`—AJpý{áç³W`áÜ®~“ÞüUéÐ)ì)$õ ÜÄtufû64‘¿9ØðcÖpZj”KþJòÓRŒ|Js¶Ë÷Ÿrtýéý³Hœ)0DKål˜ZDå±ílí@Âr¤3ÏÖ8®Aà’H*^À#(Å?hÿM¿ %fžæ©Äx.|Ûtâô’ …¨Ç¡]” „> Pߊ/‹à™$Ú& ¯/㶃#4?ÔÑÎ#,&¦RRÿ±´Óó-¢ÜCF7¯Ø6SÝçx"r³&ßÜ•à€£æy™®«àæOï)J#+’)èanOÙð½Yß*øÇëæt´ÙnÁéÉt)òHŒ‡ESÔ0åF$[EÉÞ÷›§s¯.5º{ ýÀ “H0@$Aï¦øΞ¼ †¶ uÚ÷)•ÈÀ›¥`i€>ÐœµWfPt…ýÔG¾%~|±yŸžAÄjƒÁ‚çm$ðñ·¡Š-Xª-zcž¹÷é×óõúÚAê3¢ØW(±%:š Ë+ró?Ìim‚_÷üÜñ]ý\N߉¢8 °€,=̹lJ‚‡woK‰r#(#,¢7ËHž²7õÞ¨6¡æÙÂYþ˜Ì Ä/b…(2î,("ñ:× ä/µWÞSçˆFå<Úòkì¬{,®šDãHjÅMðr ñ—¸I#2ß&M‹Ì’Âɼ LÖSa`‹£>—Ò·ƒH†¹v$þä#(9“‰½ÓÌ›~:(¦ß{cÖÁó։ϹÜàÜ{9]–¾;¼¢²ŸðÀëƒúšO* ¬À,Á]¼X•´ŽeŠìãE#,ð(»¼íV¥’ÝJ5¯B©´kEL/TK#,ʶ’ºl‚D±@,G&øw†å!£?_Ë‹(4¹g/{Ú߆ḚfÙeq5ßâôy#+¯ Ã)ÜpçXæ}ÒD1Ò¢+©!öò:‚Ñ>8Àü"($§„~2è: ¢2¾r™ Ž‡™Xo‡ñ[ËìÀÈb»Úõm”P•'@î}QÎÞzâòk6×næRø¤ÈåÁ@ ›h%PiPƒ1@qØøgÑàmúNÂɸ0½ú"@7›SìPÔéIóÒsÖãg ëÞ¸ïÞR(6gïóË“X]r¼Žk¡ÎÇë‹äDåܱ´wp¾Ë/fä6 ŽsÙ¦¸vÒûàX õŸ…QB@‹6-~§SN¨ª?_*kÝã?»Æ(†U@C·ª J<¸íó[Zñ›‚Hˆ¦(x^«ø2Uý>Ì÷e6ïMOBºJÑ@#+¼gu¼q—éÃí–ÛÈ0ÁéaHiÚÎÆ­ü¿k)ˆó#,´œ0¯Ñð‹<4Þ~"4mÖŽ U—¥þ¡XOó²¹à‚¤PýnÍü#)x•ðSûŽ¬˜Bh:kAûð¢°Á…Fö³lY}ýVq£´Dhß–Ûe(ë³ù¶4å¦e°»Ÿ¸¤#(ä|ö£ƒâPXÂð3K|\=˜¸¬ –…ÚázNö}˪PdÁì#L„î»U+îlh'".µg·DvÓ£‡IœzYhÛïˆg—JпŸ~8)¶ù]Oƒ‡‡lÅÂãfžj5°¹yv*ÑÜ0öl¿à€¿ ÐHeëÒá‡De›ÓŽN{¥‡³¯½ÇÐ5E…2È<›Õ”Ö»½0‘]:½Ì· >ê”rÈèƒ}®ù÷–iÏZ&dÛí¸óZZ#F$Ûç•¥ÂÒtó\gxüðvFæç9¢Àò ¦¥*qÜ|Ö¦aA¾}ÒñYk‰ƒHi¸aÜ*ß±:†ª¯—“3v—E€ÂGxB“}²9ÿ]Ö¿ttŒÃ„"/’#+¯ðÔ²Øö–°4X*˜îsˆÓH3Þ×O`’¼Ér]&é4ÆBzè¹ÒMG¢Òé3•wÁo|x+³ÆÆß0˜Œp„Ÿ@ÑÆù´^®+ÛÍ>G¬#Qª maÅ"i¹B³¹Ž´BQ¦Åì$§Íî`çv;߃‡¹#±}t¦Ñm°UÏv›'„ž“¥îgÒ¤Š¬'‡’`U åŸwÃHFOonÒUbº&ùþQÍÛâ·Ÿ/’LÕÙ¼A×É°sF‹œlpšr.5¶`q˜”›nržyVWmÞG&ÐzŒ+c*ÃfV"F÷òùâÉrðþ›i´ý[þÇWÅvG£ÑÒó4G}sÆCxªÛ®Ï½fFXùgÇýeËõÉ“‡Í'Û÷tÌi·Òé#9"£J>]hpmIÑÕž?:ÑÝ&ûÔÔfï:0¦zGxtºmÌú5u5o#,¦çiƒÂtˆw·1ú&içÃê}àðãpÉÔ:ú82#,¥åÛªˆ~…ú ÛgåÝŸÉXŽò5GI1nÍB׺ˆ¦\¿Þ¹ }}K–tDZ#+Ÿ¹]3¬Ù/±æ¬ýK@•Òæ % ùbÀ”˜n#[Þ˜$=vw'ÅçºÍ”UQ,± ‘`¸ì¤¹&‰¶­X˜îÜQ÷@ A7›½>ß%£È$¶#,€(À(OI×éÐ A=f¿-ñ‚úäÐNß²eQbªüytšÏ•ëãÂ{­ÀwÍ)æëñáÉš ôˆvùÃ]WæBeÑ€î OuÅò«Ç·ƒ¤Ðø#Rlàã·òp’SÇ~ù?<‡ÁB²mȶ¿/»›-›ù¶Þ݇Ø{Mà€Ê­`Á6õ׎JõÔ‰‚Š‡sxpî{^ @ƒ£U8»6HÏI„·]¾%ÀÕÄ`ð›do²p ¶¹³° ú{x¯ÏÙÛÌö#x8ÝœýsëС ]>Q(¨ ðH‘¸€Üxµ>^ õàYouÀâ3aÓ—#(,;Ù;%ã-…¨ˆû’íØpÏ— ?5ƒÉ ? e’#,– Ÿo{T‘$Ź5Õl—\á!‹¢ð¨¤ Å%kÃ’…Öü#¤!`ê{Áêµ~‡eŽG@f•Õª½ØcˆÆ€rH‡)BA6 kGu¶\t#š«YQ7#+åm»Ã<¶&¹»¾ãÞx•ÈÁÕ¼x‚œŠD<” HÁ8f&"D‹³Ê) ų(j+)C§-!ÛM¢ÚY¶º:W­8L#+ŸCøZ>&ÒWá¦ö’Äaž"Nk39Â|½íäæv^Øn´Þ€‘‹Œ==}¦0P±D$1­ýB «ò »ø^•°W‡`ò]Øâé¯l@ÞI›?{fêz]YœfåŸî“zÄÐ†ìš ã½Æùò×eT.§lûâ‡^†˜Ødøœûì¢:‹vM„œçì("­‚8i$Qpl_ˆv0P#+Ëxk‘ò<(6ÝÇ;’¹Ž¦ƒ¨Bä"™$JjptVqrn Õlñ¡ÂÁ*&äÜ”PaueEÀí¡Ùãã¡ã©àƒœ3€ñ<»ÈXË¡#(­jƒ •r@$¡±G9ø –€ ¥["#K:]ÏéÌ<òŬ6à¶ö€d Ä5ÑÜû¹¾J"Ã]$Œ{òäÖöµOré¸ÍX=Ê…j[¶7Î&+¯ÝQ,­;4Õü3‰?‚ÃRâÚï[#(·7`óVd"6diÉú=á…—9‰OäÍ”eµûqäw,4(ÉÙÛÊ*³ä׿‹f%ÅŒgÔ¼þHºÒôÕ µðÂì¢:‘F£›‡ ×ÉEDì(Ö·€lŠ|+–ÁŽœÙC nÌZŽ,^©[ÇG  NŒ]úGÁƒÖû!m½å¸ù›çœÒŽ›iÍ£ávûÁS˜=;»N²8z3K¢k|uBòŽª©ü©ŒSœvaæߢ —ªQÁ6û0 ů Ê"7Ra“˜ŽÊ.#(a(§Ù'ɵ Þ.À+ÖÁ~#(çˈWpŽ¡‹êƒ:à5y•MÊ<¢§n%ÜÊýŸãã[é|^µË¬Ö@ÁØóLÚ7× W[ jÝ•mHæx€Âñv¸ŠJC_WQ6ŽUИph;…úÑ„k³e¯Ð`0"àÔC°jR M…ÒÆ’µÔf!²“§½é€íáó"òûÞÂþï"s„)ªä6#+ø À‘Ë#+AáHºãˬ"26òòñ½ÏÀFŠ'µQj#(òÈPLB—`!@nŽ~~Çá<9N\-6d[Û>º‘ŽUꈰŠØî«cÁuû˲åÚÑæ›Ðe,ˆ;kÊzÔ+ÏÇj„÷ë$·ëì£"ê•ElÉhy#,¾z+*ºç¹åB¦Ïåùöñüÿ´|^ï}: ؃N/ùà¿@rž6|À„6¨úv*'<‚€4*±k¶:¾åË#çahÊ‘@´§‘ÇãP¨Óu~}ô®#+ˆÈˆšU[(Q¦rñæN`˜QªD‰·Ìàzþ>ÐŽŒ|OÁÓ[…ÖÀ] OÐ'ô~+.O;œàk°rðpÌþ® ÑÀ,ÀÔíy‹F˜Ÿa”ëÃ6~¯Ö½ž[»Ü€r~>ÿOœz ^/Ã÷ã¼^\|O×öà#h_JÛ? bô¢ç"ýGV8˜<i@+PÈá÷Œ|Ødgòüø9Y•bίÔD®÷#(#(}è!ø|±{€³ü| Ø@â%¢ˆMß.¿£1HDDAªsÀVµðCbûßЀr„Í>Üa/ã¦_#(Çùf„ŸÜ‡ø‡øT,`€/íö, -#+$•ùsH©Š“úÚª…Oó?ÒK©dTWölWá;XHë´^AFÄ¢Ê#+S˜£`ù-`b`vê-Ÿó3üE½yì|;ìq>è]¹á¡a·ûç¦Å¸¾ Qü›˜æ8 ºv£ ïëð8#,šŠšNä¸ Ðñ#‰Ë˜•ëæmN_gŠ ä×yå¨,Á¿aò„ð7ƒ2 üÃ`ÂAèCu~Ðá×ü¥ÁÝÖpØÕE£0± —ž7qŽƒe#wöX´#(Sa¨9©`Í)aé #+¤zôw¨¬Qv’ybˆfnµêž@ãÁ•!êì_kg ‚ÿÉ3á¥J®7-y~w˜|»€ü{Aæzw`s^'_ƒoÙܶOÏí%JØoÛѵGCg‘­ˆþTG¬Û^û±²*#+Ô°–D8±`²‘.Øróƒà\sÅiJ0!dï÷–Íê«™ Éz3$t©V6Çik™•’@´j«„C|áˆØa#,¾ó?¸£û¨¢Š¡Uªððþ™û'ˆ~QRg÷Á=·$˜@—¦„ƒ‚ÿ•{ò£d-„¿+¤ý?bäÁìý®I¢ZTÜ«#+[ÆAEèzLÉ4#,ª{ÆR‹À-€(áÃÿ´³¾û` VyW­®hÐl’­|8Ò­¼Oög©Côÿ#,±ø“¸’irêe7,Yqh[=˜Ê§Ò”ê%üôrwÄïùêƒ;µ#+XrN«¸0R¥è#,2:ìøjò±X<üñ†Ã>-õ˜"옒Û{3‰™”‘Hý7.}Þ|°Å%+ O×ì >R«ë·ÙêÅ5úÀ©±þzݶŽ}síù5‰ñƒ%‹GFk73Z£$ýf¹°Ë¯È‡PDåS§™r~.šÂÍ3›Ýÿ³3ë_æÑðjïåpÎÚ)úÍÄAˆûO<ÍN†‰=vk“åî£@¥ß¸Ä•zƒ$ø'ÃÔrêv=B#+?gô†Ö²Û¢þ·¨#,RÜ£¼¨$ªa %—¥Ëö\`ízÔÊ.€u”áÿT¸jç‘f‹û=§÷_~ m? Æå­ü6°5è)·Ÿ½”eÚŠRÆk¡¯uÒ¢®¦QÎsš¥UReVIyôöí\‘ç·áÀ>¦Ä~%ɳ†þ3àgÁéLùר;\:‘a~a׀ᑔ6£5Ò÷¯MY‡jY¶N3$±v¨¦ÙzC£øþ¬oãõ{ë/r|dO|+¾ÂÐËð>ó€…¿#üð“GWe‡ó‡ùûõ{Ÿ˜üŽÃÈ?}‘ƒûšY1B°m«Çúfù]|¹ˆ8eךŸ@òŒhVx—ÂlK@Ð3•>Ò…@[Ö€–I¢'ã#,´H6a8½™‡ eÏ×?ÎþÓý?Ù#+ŽGŠ¯âzb.¦Øa†ÌÃ)%±¿ ìHHñšôÆÐÞH¿FËp €p°?\Ûúå\‡Jý›6mWj"‚DdhqCWZÇ]ÈsšÐ? ò–°B pŠ#+#(HÚÐhþn#(»·ôŠ@289¼#,>Ï@É4"êk˜›Ô~#,#+>?£ýÝÝùß˯¼‚A¢†™#(8v)¸ÞŸ,À»;.g4;;ˆá,ºInûÜY! Ðøà{ƒ4 ÔcùºNî-ôA#+ÛØØ„1:¤Št—ãeAúÒ•05¾,>¼â­‚N¡L¢vl›—X’d èfÂ@drÔ¦ŒÔÃ#+àLÌËê‹féщãÔIãÍû#,ý}†> Ølc7D;~¶FzÜIXSQ#,D×[ŸÝ⼸ÝûCyÄäÞ¨IÞ-ˆx÷ZH{SWp÷#+C]0hèÅÂ%ŒŒ)v!@ØI"8(.d?Cùû}?IÖ¤;‡ýŠdL?ž#(oC¼?§ú ÎÅ ý×°t_× =òx`¸kÅv5¬ëQ¨Â$ÂÈ?Ü~××£^†ßÏpã]=zíI½)2b¥Hˆ¢(,ï+ŸN]xÿ¯ëÀÎô$ß{±°èÄLç4Y8}ãª&A´æS>óª­õ½Ñ¬é„S! èJë#k4k4õ­B¦ãPïÔÔðfßâ´ #(‡‡—ПŠ?Î*zõ#('P´?Xîõ–—­}•,š„'1‘QRýo!ôå®%×ä{¯Ùû ÌÀ|Â3؈ZjH M)ßQl‰ÐªïVY¬$ˆ €r¶PRm82d?óíƱœšŒñÒôµUœ WÀ«li¥ ¤ˆ"šÎÝ+ß3/‰ð|³Ç©Ík-5¤Ù§|ºl7²üš|Äç´õÅ%)üwîÕÖ/‰¡X=òàeê|2Spž ÍþðZÅ› Öú#G§=ô¦î/âÅ$D‘‹1°Úa£~mt“R›¥©ss )¨Ó+–«Ì‡¡bâÎãààâFBB~Dî3uCÈ…/÷Y·LÌ·wDO_{@€JïûJÖ¬ËOÚœmS#+ÒlhØü~¾½äü—ãž#(^¦}Â!_AÄ÷ã“c»âU4RÔ…BBàÑL”Û´Ù«-Ô›1 æ¢â#(bìØ–/%(RYÖS#éúÏQ¿N/0âÒ»õ?#(q_TN'%>_) BHSº!¼Ÿ‰àOÅ’RŒõ! bŠe˜¤"‹z-ì‰PmòB†è#+:ˆ Ü&ž‡[ç×ྪ¢\Ñq{Îv#(ÝÈ6ŸmÀ/’vÕÂÞ@ݼð©Ëî¥2"9„#(@ŸP~oŸÞO;²óò¿Ý%ùÔ#(ñáèÆ~Žg¶yåÙû|,mŠO¢¨’}·û¢×Á%½ïz‚YöP‚ÑD¾ãr'®ÇQƒðȹg ž¸>¿ÁØãé“âŽÓ˜¾°8¶OpØ[,!Ïå¢\Û,B Aý'A‡ÚÐx~×3–çÄàš|!ý‹Ó¿¹ûŽÐö„6ÕØiK¹ŒƒË~ÿ$ý!¡ò#(ˆ§y#(h"F®7¾}â€L¦IFÁüƒÒÁŠ {8uö×›Àõ'{F±ëöšsÜ­C8ñ§œñäSi*—w ö­#+–œúÒD‘YdR2™Ú&~à³±_ï=ApPø™móÖç‚r|¿>†‡‡05 PGiè‡\êHê#+ù÷ý¯[…?°ýß…! C.þçqú5?wÍ—Bßpÿ=¨/Æ ‰?ù?)6ž•Ž3T@–%l ~Ü®ùå©÷ž?ž ë´=¿YWÖÇ$2êlà¦j˜„‡»’I'Éê©í‹ïßüzˆUŠÈDK@Híó÷«úÒ)'ßÚŠvdzp[a³¼žˆ–ý‡wéhòÏÀ,Bò³êɽ3Í,½&ÆZžþÞ/ø Ù†sNÜÆÍÇb> #(‚¼ÿolm šW*üǺ¤¬Péõ†œ;² ƒ¬|#,¯àŒð:’2I÷P- ‚ï«{Î`vg0q`±>!bÃÔZ‡>ƒ»ÄíüNí‚Ç<ÓŒ™’ÎÄ`"O_Ä“2 ì„iQò’åœ ›‘–~È%ÄÚªšQzô8D°X“ƒ#WöÆØμ¾N" ñ#,Ÿg³íÌ@Ä<ÕDc ’*‰RqÖqß¾i¢bQ†b×X·#mˆ¶80—<²º‡{íãíM½\ÜȦaxî<µ™ã "H*É>ß#(¢ l•±VÌ|û!ÞyžÇ¤Á,pH„êó=&&|“`Z6:HÛC›6#Çdz¯ ‡®’æPÇǼöŠzØ¡ }y½áà!‚>=8ÎÑØDÑWÈÜlÚ¯0ôýim\Þa#()̦ÕR‹Üõ|~·ñoñ?üsÌþÙGh^~ö‡æzÏu‹hÒÕÛØ»˜lüSˆmÓUŒSŒª„BÀ¦Eà·óôë@?CL"hrOåQG•IB¿ö®l9«¸âˆ8ƒLg~Ð/†.#(ÞÅF•(ƒDÖÁÃÃÇÒ{ÏI<ç¶ÖÁØ}tv)Î' Ò—ëÉ¥î>Ä"xÔKd’ôC[a©†ˆ\~e½¯yÛôJ>`Pä±ù@^!#+ÛM¿è9NgÞs w‚ž‚,eR‚Œb>Õ7y'3ñ?Ïš.8Ü㺔kõŪDè|ÜÏ^è#+ÎL´_§éãc {bW{Å#(ïÈÀ§ÓcÃœãÙ'AÁò å‚ÅŠó#, G ‹ü gÑ+@Ö‹h¨Þ)ÀLó„êíû†ü—ÏxX>„–—ýŽP Ñù=oóÎ}Yöã@'Áž«0Ã8ÉÊGãZ7…´Ö¹r¼ 7¨·­"0?bTÎjРd‘®uBÜÔ<ÀýŒ‡ƒA*•n“#(Æ€±¢”‚êÈý¥ÆLÁR.C1bàE | ® ’1"¡ˆ”U Dt]¢€fù‡ìÈE@$`Õ©oÇ«'pWêö3ù³DÐYòúÓŸé/¦#,Àö$É1òìPd„¡b¨s€rAdú¢SÃiÀئ†Ð£ß´±,”„Rw£Af R!_¿ô¿»±7ïrŒ„ƒoîƒJÂÉrߟÝD†<-_#,,- Øû1Zøi ²,f)DQ¢S)DfMòü¾^«|«4j½›p®‘¶®Ò•"b#,Íe·uç™u¶/%x×j@NÜOð—x§@õû}¿Ž“Ó9PõÁ–~O{ëƒîà]R‚ƒ‚ú|\#(ü™‘˜? פȊYÌ=þ·¢0ØíHäÜ`í7?~ Sf•ƒü#(ÙØŽä,A1T°‰,ŠÂ!@d6p\ãR2€‡T7]JX}(䥅¬ÄôRò®PµãÍ6ðHIG¯"ýGNÛ´ôŠáKy‘¥æ;¤#+tnà›Ó÷OÆŠIʸÁgqÆf:¨z@#(ÚqHp(ì G Û¸£wtB·6“§Ev9èÏ?|î·U¿mssÜdFÍ…´…@š#+Oa$ýÎ{²Q¹ïýe’ÏåI¬¢Èú¾ƒK­Åaùð–•%1AEEùwÒ”»:ü4=¾OÔ¡'¬’¤”þ¼—)óù¾û§ß#¶¬\ÛíO³èô[ÜøT¯oØK´†]!$?‰+Cà8E¥2•!äšw#M# r!#+ð(ùIVI%¾4w¡ðÛ¡¶a"6ÎŽrá@ËŠº†÷²à—„¢ƒ\ÕSñ8ug*)~ÒÏpSÝGLÒ;#,#¦Y&H_NïjõF@„ˆݪA02¡)®„G¼#,øð;´÷ϧ÷!ØT—‘›Ã³~äy‡ià†HDi3ãËǽ…Ÿ•z¢3ŒÞžðOãM'oßè©ïêÿ,$yK)äB0®±ùð%d»Þf…|AY‘AIgs=Ha€ƒ+€Éö–†”^~|Q³Cq‡'zHüLÓýßÎÿ¿ÚS—C÷úÖK%­Ó_ÐÇõi‹nOÚƒðÐÀ~̨#(ëÅBY#+Hÿ3Ÿ._—êM5™13#%?ÛôŸ/Ðs#¦3ˆbŠ(H* ä¥U¢¨÷ŽáÂ¥1L„åjr£ð¿vʃ"ýC#,ýIñµA1蕀ŌÒ~±¥,ûRzÓ(…˜Îdåê´²­|]²B ’AýªþÔˆ¸~ÔäãNÊ™ÙÄ+ýñëÒÜþáa4Mª´ŠRY..,OÖð²Yñ3<ŽEë:Ô4O4Q?gâ/߃q÷I@”nŸ„3N¬¼MÜQë ãžõ|òzƒ!RÛ8¯ÝøÙ0 S!@4Õ]Âm=Ç<Ôì\ß~ÿ^ÑíS°;´9=qwt©ÎÒFIru@ ýöAÀŽÀ luyë¾89ÙX ES§#(0óò=%ÔEaÔa‰T(5ø¤w“Ï©©ð+ëPó*‘HRZ(9©IGÝÆc(~Òq'ç?-?¿€ýÍùð•QVæpóÒe/0Mç¬ÓRŠ¨*rÓŸãöTóêãùÆ~ϯ=UGiÞm¾$4óó TÈÁ_›"âÍóv´„¼"ÂpœÐ‹ù2T¬‘|÷LÏÆF¸útvÒ_ƒã„ñÒRƒQŠñ{wóx8RR¤‰­B®T:¤3"XaËbŒBõéž´Jò˜†ôÔe扗þºÜþ9PsZÓ8›ú7ѱŸN«[@õ‚*ªU'óɺ9¢º§Ê¨´§F¥‰íPØ A¶_NáAJŽ]<á÷Áõð.Ÿr"v~ ùç`òyqóìÁàp1“Ûß÷']JUæoå{‡j~vÎdÓ(…“bI8J£‘îÌÃiæéRhw€¯ÌPxÝxå×nÔNÈ#(¤Œ0Ÿ·oRžÛë ?E–”÷ý…²â\æÅyn#(Ìy‡# ›Ãmöó´Ñìôï5 `8T6Pþ‚*naäg&ãHÄ„4!̃W€ ŠY"%¨åzì·Cê„÷‡©è!ãåÌhYê ž%ÜŒ‰ªÌª¢ZE³˜qxvr9r#+§iª0‹¸¥…„xŸÉÞ~ùïª#+ù-'¬Eów!FsÕyrTÊ×Äò¾¡õQ‚õ¤IN×níF¶O8”€¢˜˜ßû118#+y²#(}‰øyörú=åwºJý ËòÔ,þâägÁõiVmÌ‘šÈ4ÿk±ôŸé/ b×éûÜmسýZ„žÒc€`µo}DB> ¿MoÕ¼úÈæ$ô•dTô**zþT[–‘$H_:-øÁÏþ|_uå?å€ ç3;Ôþ5'§ûL~Ì›»:9ãúÀ³¤kË0çPáùº»gó'[óÚ÷½5ã¸nK·PLÜÊG;:—š ˜*À&ì-/BÒÌ݅ņØ l4§-L0}!³~åîG$,x%ùIP>üËC„Cy“b p,wbªPþ1øx*÷pD'S0â†å?ŒVLøÅ‘c‘èëQ|° ‚¯xî^iÔóïL¼(sÁØ&HZ#,÷‰ÏC°äïê×6‚ ïúÿnýÎÛ¨Ù=‹²Žƒ•bð„ãÌèWªä³‚mUL’úô2'êG´¯=ÅjèwÙkØÒñ <3B„³š`Ž0Ø71¸ß˜QjÜr ŽF!;‘#(ä†g!?/¯éGÕ>ær§óÛ¿ 4šªï=*JD›{éw]¼íÔ¹#(–æå ÎéWdµP`¤ïd†NGåFt©<~¯wÄ}õÊ쵇Ýz^Ÿ/Óaø#+؃Ì ˆ‡Ø–XÉO!`P°~˜Âj¿?#+¿ #Àó8¦jÛwÒ·rÛì£n[J„„›˜’Õ<¯'ð‡hÑÞ«Þ샀x c3»ù/°û?ÄruOЕ+MÔODÐYbˆ¿?H„‚ e³;]wwe}ñN,#(­Dü´±V™`»ù#+*~#u¸xiJøcsSž±oH†˜ì…hfÏíë+ݞݷMF+Ï;y‚ëº^»´™ˆ2$¸à*IfèwˆÛ9ž€úzT%4À…Ôöþì4H¨û¾À†ì<´r¤ýoGì~³•#+T|õ±2jÜ)+ê /Ê ›ÑÈ0MËð8ú§TéGO¶×“ó5PÄDöìøÅF0Dšqé±ÉÏú ‚Ú²5¤<}…~’Ñ9P÷³Úû$+XçWµà€`êîÕrd/ûá"Cò|‘nzwð÷jq—œjþãù¶e9J5PL"H®öRmRI‹X¡½>ÓO¤ùµëÛài•MivU°¸Cä&½V#,Ó^¡“~˦c'ù˜P¡ñ&‡)Ò0¨“Ä¢‰:y• X ; ÛVC\¨Qï‡ãm¿ÍÀ#cjºÄ±˲Ù8#Ùú¦Çç¾gwäk€¬†¤ÊݺZÁ¯F² õí²­à0$„`àö#(:\÷/#(´"A–Uxï¿Á+0Úïü±‚\þ½ORt~?j\?ÈO·"NàüÇö„?*Oö|¾ŸÜCÓý‡øBoï}Ó…o!þ`gô&¶evšÇ‰Öð…|ŽTl‚~[‡¨0k=Æqøž¤¡#„N®—Ykš™¼ç]3-“ÊS¼¹%#(¨²YeX%0Ê¥²D2Ä`Æ*A"fŸ„Æ¿AÔ—‡žH®``UhQX'T‘ÄÊ Ú‘Sñ µ?£çgaš‡©R˜?ôÍgÀ'HS[1׈0µÿªjˆÆ€þšˆ öd× 1ìy`§{Vq×Âkàt«Z\sø91W®½:…TB•H&5#,I†]“d/#cˆ®Ö¹º“‘ÔbUˆàÖL#+!ƒW¡ ºð˜.—•ô”Ïïvký/ÔW´þÉü|/á×aÌHöe@¾Ò·¯@ÿ“µS´.2whÿ ÞyH¡R¤fÚ9Ì„q(¤ýÐ|DýŠÄÈs$½ó•…`¿©§ù™œÜ-ý. Àß!ïøÙø„-Æ£½LoÂ×#ˆ=ñüŠƒQIh²[ `³N53]½™!÷ÔìkZm#+iÕ÷’ \#+Ðl f¯n¤ú@#+2¦=.¶3t•Ü®#(RڣʢßÜÜ«~AV‘ÃÃ:eŒ¸i»£„LV×Þ©Ú9Ò÷ ~À‰Çìô!vú_n¸ôê„m3¦÷½•Ðš‡Ù¯NÔ‰ 2##úúa˜Ìz#,€dw¹æt&ÍèÞqâÉΠƒ?çÀ œ4€q¼#,ˆ+P;¾‚vo#+‘LCH¨Ôd‰#ú6L^êÂZ«áöaG®-’{67ªAãÛPAlõ¨d% s§òª‚SœŽ•$£ÚÄpV¥Q4oÈÁxm°[œ<#+À÷Dn=,´¦~›tŽÅ7³Qð×Þ‹?4jÖ}½^™Ws$‡¡Ð?Îþ—f¨§Mö'5ËýÃFn‰–I—*¥„š9yŸ´>(S«R°˜!ÊbVQ@¨Õ¥ÞI8÷¹Šqõýò"º60aú‹ô&ÍæÖA ¾fØ, Ùþœg†§LÏï6Åuuoû;p8™&“6§ùaˆb eÎúLÚ.’9Pò:ìçƒL tG0å£5M/šÐÙ~ƒÔL9Nµ¦8=6t™¸Yr#,…Ý7"—sPDë&î ÐT¡é+Äòœ×?ß+ËR›âõcdCrÕÑã(8fìâå@pèk¹@Ul(?Šxrí!yžœè÷ AH† èrJòz©å“áÒÿiу§ûÂÔ TôÏá†âþ¾‡uuþTé糃yßúiBì÷bý¤®ª'æ·gáäÙGöñU#,“†Â5UG` C{ ÌïkO;‡Y±À9ÑáùÕzuÚŠpÉê7?~¿†óAÞJî‚ej&:M—ÿXøjÍtœ{€º#H½É8”#,–µw½”Á^­Œ|á«Æñd8UH{o<þœ‚¿yb8´áb 6ÃcmB£ÁfÕX'ÙÆøã€Ç³°é€øHo2`tš#r,¼çø‡cb‚‘àqdQѺÆþ¨(ÿ9©ñ=9i`ÔÑ·8‹6êás„+ŸcˆD?#9ÅBƒ•z’ë+ŸìG3é.ïw5G¿owÆ·(k¼ç„$Xü.HR󢣩ô×ѳ¨Z#+‰ÏŒ%ä„)ܯY±x–n0U{/L*ØÁPŸÓ·—m3¹N\px¹õí.ãß»‘¤ß’…Ø´c…8­…8oT‘㟲ë¦?fò~|%[Öí‹R<Œ#,SÐ@!ÄbxC#GR¢6b‚e7J%ƒð¤#ŠøE‡TC&€×½#(Àøûÿ»½ú<™>·§dü#kÃwã`z;ùz#(æ߈—½UêÀâ-Fäã¹Ñ}èÄHŽ2Ö»qÓè÷jú«ßcH¬Ê‘~¸õf;å`ö•§JÉMgç—+¥Ç3@ƒÛÅàiU"j_ND¹ú7/toq‰ºD#,–6{z~D9ŸØ×g—k=~{±ÂbN¾#Ru‚ÄØòpzP¬ª%nW&¶¸zlÔúÄEŒR¾#+;¢ñ½Ïp¹W^¸¢“1õ&É«Øvè}Ø:²Ed#hùùzTm‘tC±ºq,ö—k(X-Ù²«Ü˜~÷ þî–`­¬áÒìñó¯^Å-’ÓDpìàùŸ…C‡¯¶-tÉ7t3RÔ§ÓŒkGRø½£é (¯§ê‡]8ès¼ÓÓµy¹:œËa©Ø èfÃø¸YßÙŸXÎ]yµ¡ß"Å…?Dà6îØșɺÇ2S3´d†d• º¦>‡ f9:n¦ÂFŠ¤\G#YÎá…ŒeÏÒ% ^½]T8'6ù [&´™&C­ÖªÓ#,Õ#,:c‡YÚð03Õ÷I>r‰*)µ•Ö¡ü®ÙПÁ0iG‘e íŸ!€ $ó!O·«úÊqLϹîóîü?ŠË #( €J#(z~o2 Ýûk‹rá4¼þÈÓÙ?4zñþwðå³Ma©Ì¯ï )'ö ~ó,_Ý÷×”ÎÌ4>…ƒe¿ƒwòz®ÇüÃë?ÑŸô>ƒqôÂO$ØzÓrÿV2-몪°ÿœö0.¦ 'ôcY$Ðlm]ÙÃk¸ÒÈ«;80ÙÍþ5Ü3náämM¡NýCøÂŒ8Èâm(4„”©¡5þÜéñ1tȘQ…´^¾¯'¬ŽC®ÝŠ¸ÉâÁ©#+Ž‡LÚAÀ “myº·Yë$›®u§j˜NÝ ¡ u"ÑÞò²y‹üßçÈ—NȪ*½7à=°2hÂtñØsn§ÄÌI$—ÈÇ©íÐo@èísßĸm/Á¥9’CÚ¨oTÈ”Ð5™ê 3!©•³?Âlx?Âléˆ0zxÝ«uwKT“Ã!Ý›!ØïAFÒÞ†¿}@œaŸ}¬6a0v¼!(N£’zÏÍîJüßšÞ5ý(YÈÈ *a$š e™D|NùÏ—®*Ä==§ªh6©äàç¢ûDj¹˜±z½¦†;“î/ÎÞ*.þ\K‡–áǤäh Гwч4›N4vúÆ|ÑJ¡U8µ#¬Óóàîaƒc#+ 1¬0FÄÐŒF"@\)F Í-‡ÒpÝ^ƒ¤˜;F•ßMØAÇÖq3XŒ½¨´¦Òû‡zs[qôÚžÞª#+ŒªòP!*@¨1¹Óš\ ­ê ßY©Ç””OB*UìÝêó;µ}Ä…;2ðâÖNÅËî÷û/t·pþÈÊ/á®#Xäú#ùáîTYž«;·ƒ¬2#(4Ī „×Ø~CièÉG ¬H!UU³D1tU|nmÖõë»$·Áš··]*›L~rv•¤†H4( 0\s²o#+ŠC&ÙgÈ©ÿ[ø‹ôÙÊ°Ž”×+†&ªþ]µçšôÕâ™<¯Õýÿð=«{JÍiš1mX×óˆ“dˆ#O íi(Ä!ÎÒQ¹›lmBFÆ+@jÚv>còÿZª?8}%w„ͪç4’jiÅù¨ÄZÅÛv.nÞfhjv†¤¾~éûÑ¡ãµ Á“á{}À$„[Wù«‘„ƒ¢é9IŠÔëçǼyaÿ&ou ?ÎàC—ÉPæ!õù—‘Õt*¢±¯¾C½Ž÷Î:qãœ>¦†ÄíÄ[ï€m[.ÒÅÇýFˆ£¹È£©Ès@X6Äša0G†|Ôê|ЈâF¥Snž+G¹{WÇ…«jñLP¡º2ž£y·´Bòkk·ÿdÎ牯¬êðð‡ÔäŠCÈ'§J˜á*;ô#,Í ÛÒ<ˆ—‚Mou™]^²`Åу€šÊöžÿ.G#ûÛê$ílõÐcoBL¦ÀgeQøÂ<½uœ°w=#(Ø£ANjF¦"±E T£´a¿Z•Iwä8äÔ"™±¢)TQMŒÏ&£ ÜÞ—4qÀŒÈ:€¹aÓÕý}%LðÞõ‘øóìðñØfê&¥àL qŽM€íݶì>ó„{¶4*ì“A#,è6Ì’ò"S›Û”—áèî·LVê…aÅÖÙ-&\¹Æ¸¦V!Ãw!ù…’ ïêg+fÐk}“‹G_vÌ#((ñ.ù÷žÓƒot$MÞ^¸ßáòÛåߌã—Ó™:Õ2<¼%,;B—r#+…)˜A“-xS"ªhøC“Lû8˶ý#+¶7ó»•£ ÌwvÅ)'‘æ‡/.ðŸ/Á£ío äF¼Sˆ ­Á2²% ÂaÔBàc8™ÍiÔÙb µØ=p&ô,ç;(4ºänç¡“"^«î$#+ªTQ¡ Œ‚H,ˆÁ7­t\ôcTYë s…&»á|4Bl¶Ç¸òÙ,Ú¸Fˆ=#+Éfɪ J>2hQ.´K–UÌÔ<>pòz¼ÂÄš°ÔÚôÞ”â;ÊE€½§xcÚòIhÛ&O{®âñŒ3j•”4oN‰;vX(‚#Ö™ËQÁ†”(ÖòìËÕ'šª64y20¯Itñ w&“Ó?czö}ˆK‚͘p’=½Þç\‡Sô/Þù=HÙ©#܆yŠÇzRl"#+G™åÌyÝƘQÛâ!læŠÄ)„[îa~ Bdi4œÊ-.ûçóô;NíjÌQ(HUÜ.à0ÏR#(:ƒß·ùª »Ó‹#(r Zv¾f¥°SŸ>Gàu)ÛÀ÷®DTb"¼Fк/T- kÝ ´ÄÛcfónKjæ‘Ä$ŽüJö#+ÓC4œ,`x{L™âXĤØ`i€­RE”·,  *Œ3L"òÁûJ¹§4¨ª¤¦ÍiêÎ¥ë¦9á #+1Áè«7t¸z¦í8Î8Â'¨Ð Æ˜à:›/—‰ N8÷ƒ}¦¨µäïS‚Éì *m:Àj*HHH$X*RnÁ¬dÌÒPÎ~d­™uRHÁ¨›£f¢oÖNlê8Ê.™ÿ ­æäÑ ÍhÝMÊØÑ CÀƒÛvÜâq0ï~¾¯XùuË\LÖ2SFÒIËë5Þ>«¯¦úg×ø×g¿F:i-ŽÇW:…zû»T̈‡hS3ó3&\ÌÌËf5•fY™$«³<ÑÜOž8©Ÿ ÏR)!É#+nö¢¦Ò¹J¥XF()°@C¾©E‹ ÂÞÚ—Š1Q)’ñÖû½C›9Û#(!{„6O(•Ynnp[­Ó¨ß{£šgH™ÜvÖÎ †Ú¨}Ù=œMkeU9Õ}™ËÍè#,‹=#+ÖéïÖ#+bDÙžµ,ÊÈ#®\YCRe#,ͲæˆÍPA§LŽÌ!éÌär&42tèÖRÏ@Åíéíâví% ¹!¢ŸGp¤»ŒYÁ).Šb©e‹ED/2ÎzÌ=ýÇÇè†uÚ¨#V|œ­KïsáVBUçqfÚˆ[Y¼ð’äøäÝß–æcíðeeÐOµÃ#+CCd“¿­náÂ8:‹vô*¡ˆÈE ‡`jŸ‡-¦= Š¾¯/‹ù·Ï=’³ã™$ï¸r³h#,»`U(ßÏ´Íó³*†!Š¦†±Xêi8Iˆ’ϳÁÏFÁùv¡^RIV¦®î#,õûTRà.T¢Ws‚ÈxØ”ÄÝ?+#,lή¦= õ¥1Ól/‹«Ô`t;,ï¨4MHõ3'}±Æ<çé/Îü§åN“;±t§\‘ÕÌ^$!Ðé¯#,SŃÕ"]ß|¾ÇÞË#\°òIº;LmÆ Î7‘:èh·“)<’ÊÓ”ˆ<¼Ñ‘F6ÉÅSµºë™€‘ú]¹ÃJ½Nrò*n¸˜$"›U|õÅåÜ.ô-x3OA ÕBžŽGøäUÌCÌ=Ð'N·m£jÝ»f¼DÕÉÚìk$àÐt‹‚ÐÑÝÝc›cË.\‹,Xyiõ-XÔæPúÍÊBhpQ¥Eèq$ž^}áIÃQ66›—«¤M}á#+¼t'(IJ€¢0<(b¥qèfÁ`™J«ºÑd³’@8€ ðÏ¿ø»ÑÔ#+yù;Ä è`ÈMÑF*4µ‚uöm’MBxF¦Ù©,ž‹vœÈ!yc¯®ËÛ³¯4ÙEìs›ƒ²eÕ5TCdƒ-œgF/Kî(“©Â©9c:)#+˜£dõaR¡åØäíî1?hV0ÈÑa%0tPl CsÁv)!Õ]>àç}RË#,ø·q‹ŸDn8Û ”™>)›´ç̨nT„“2ž¤Æ™&#,4ÍH"¾Aú; ‹æMi1ÕZY$!FÁ¡Í„Ù#+çš¡OCI¤ê ]r›2úrjBÌ@fžœ‹; "'“Ó—ê}~²4[â ˆpêyÐC7l1bidJ”K Ͻ€‰‚s#+†àƒ4š õbØ%ÈšÑõ¢œJJð9êQCSªm£H(»#+q«Hk5²nŠG$|à fCˆŸCI飓ˆäÁèy¤ÆæZkZ½C3hh즽ÊBÁqBT€fráâÖ¤(`Ÿ%”:3OTã´#+TAækŽ);¾5^qÀ-JÚR0§’€–é‚æ¥lÐB™((Òë·Y»¶‰¦Í®Ëvb‘Ði9Ÿ!É6ˆddä]aÖ;LÇžÖ•”u†ÅÑôx–Ä6›Îºê)ûý’VfÜŠ•¡nzv=§!^ç¼ÎŽï42.l6ukL¬Åè¼—¡L‡)#+ËÙÚÊVÊâNЇ³ÀMÏ ÃµÚ‡2ŒÄ`##†#,‹šk®ÑŽFîP¿7»#(çÑW4Ããtiêñ£JÙçÜÇ¿¹í}úý°#(p€E5µ1òÃĹÛŽé›$Ї<ä¡mÔœ__Ç×ÎlOƒà÷xa®a&ß#,`,I¯$¼Ò…ñ9cvFv˘iA—YÖüÚÕË­Bfô†4†&! ¤³”`LÀ{Ã!#+Ô®‘@m $ÜÙVI6“-»n%A=d¡`çìš;&|Ž!ÿç©Ž{„€#+¥™Ù¯¿©='yN"Z#+D¨-ª½ÒÆ~Ü°ºâ€Ö˜cY?A¤Ì“DšOå 9KÏ¿¿î›5§>ÝݶK¥\ÏÒÑÐ!—Ú'Ru·½Zcô¦“ÎÁMb_e+òoæ)ûH  \0eDÂ>×þ€S½#+¦7:M#,Žµ*«[W¨h1”7–]ã{íðñÏbP¹n¸][¥!ßÙ¸\9Þ{nÌU{ÆåËÆÄãz#(¹l1Š<Ýå$ºT/[¸|ÑD¢4kü“‰ò¨¢RTçÀPX© T#(ñ÷ûÞœSÓÁÁXµÈ'ppW§ÞG»ýÈÇðL³ù¿àœ8­Ed·søtÕ£I`¿2âAÛ®ÖÝ¿7òk_ÏìڊȲÒJ™JØت•6¶®–ŸŽÓÞ]¤’’Ì#FP‡ø`¡(ïïöyˆö¨oÙ$O.Ú!âõ(ÇV:ò¾>f€(I¤ªÏ÷FæÈ)+}$<§åòüX°A’filÛLš¢‰@’X2™$iîè‰2þºkª #²ˆ‘z€>I)Úå 4†# âkçú®OÌ#+ˆ#+ÎUó01É#,#ðÞ¬ B,š†”ܦ.©@ŠÝ4Õ#,‡ò™ï0PLWŽ&/'!{"ß2HHIHWÅZLgT”{,ƒôÿ$?Jã’¥ Ôõ&êDÑëz$_W3¥€qÕxï¯eþõ_‡€›äùoµ}:/·ÜÑ€c —aAzJ¡hjè¨Á¬ŸD“±ýÅ$`¬a¤nÁª(B_À‰…pÐÀR¾6¾+md±chÁ´Y,[X¿m×èH©|pé~#,²Ü,DÀþzú›(?M]½1Œ# n@(`7#(CcDÆõ)AJœÃ°ÈÙ_AùÒÈÀ‚#,ˆ@ê†w­T•ã§V-’ËΗݮŸ~’ئä$‰Mˆ‚”š\Â#,Œctê‹n5¦’5*fCrV6ÛaŒ#,1µ!#(ˆf`Jò­Fp`]ÚÃ$¡#,phü".¸»zy¾áOrUêkg·uŸ°;‰¨rHIÄçØ(§”ï9Á91ï+ËL²|î][Pð÷–ÄXI‰:… í3;XEüj|Ñu?˜Jf@!åÌh!7#(Ü#+[Ó]î¹ì(T_ kó²Î}×°ê”`éFr<{µó;ÔqÚ Ú›û6^'¹:‚ ·AÉÂ(ùÂAVA A 5ãÝ2{6ÚSm·Ì¬m\´U-%›@!£îL‡y"ŒÁD±m¢­µµ4µjéW¼ÒŒ /4CÚÑ+ƒŽ}’X›3ê…em­tšRXj´k#,i4˜Í¸A»½äd„I¸@M†#,µËæ5ý¹>¦nq-èbô×¢¥$Ì[ÕÜÃxôÕ¹^¦õ75Ø”nîÐIxuúž\ÅãnóÏ6ñs–Lwr®njJÊîÂŽjÑ*ìh”#Z0ZBPÂ)3*Ÿ÷1Úª3ÝH°ŽV¿Äod…#,$ºªúªûŸzUäOTÉ †Ÿá”6̱°ìXv¤PV=¡í|Ù=¸_£éŸÜÉÛ÷ɪ)$ÛNˆy2†’ê‹wúñ±Ðl×´óö/Ì>º¼Ã쉴V’ýæ·å¥#,\ÖcìòZ#o^Êë!oñÿ~ÉÕÒwò? : ó©=TŠñÔ!ALÃ#,b%ŽE(†¼þ'˜Äɽü:䡦7höí°ùÊ”5S²=¾ò…³µŸ¡D6*3Z ¢çà¸aVYỔÏì(_°ÎŒóã`é:-DeìN Td!C ¹.ØÉ9w:'qéÜv~j< ·y@m€ñ¤:ÉÍ(2æiŠÓ“øgA”?r€™Ø’Fµóuzû_ü ›8åŸ#È!Ü¿ÚçµïÁÍåP˜4w¹'‹ÒÁ¬+‚‚¦òã¬Ò‹oñ‡2ÄTAã‘0 r#( HÃêxäEcî>—WìÔ˜z§”4G»wâ×O¥yiă>i#+Ž½T~ßYz1—_õÜÜ0ǼEÿDP½½#(5ðbÉÊoÓžˆd4BÌçT)D#,…!Ô!Ó~ Ä)qû‰…¢LøÓÞ,PM\$á¶4ÄePãW8r5D'!Ÿþ »³YÖqvÀÉ úàÙI<æоÈ1Xâ㙈Å `ĽµëíÕø¦Lm©+eMaù•)Hˆy{†Ÿ•%#(<ƒ¤Ø‡Î¤5ÃyñzNÓ í_ã#,ÙÜšª/ r´Šç¤’¼ÿŸüÊÔ°D¸ÿIý¿^PÒ Õ”ÕQPiF¢  ÿQöwÀyýlT›†®î·r†‹ ±"wzÿ¢BES1C(¬ÙšëÝܽ³·×—NyÂÀÏB‚ÄKÛKbÝêKñAKxà8"0ž¸bÞ롶ŠLŠ(Ê܉:þȆ+q~ÔÆÓø÷vÆö ê€MÅãFši¦ši¦ÌQíngÀ'ø~€–qn"¦…/rÆ0Ð¥´-jHˆÄ#+˜#(ŽÁáÀ¥Sæ×Ô¼*…=ëìe dyM¹Ct|›ÂY†e P¹R¨wíˆ~.´-¬Ú©AâE¡—Ã,ð¾#(ŒÕ-8 ”91—Ç ùS9Úú‹\†82‰ô¯IëàߟMA8VùŽªâöãß3Æ5‡µ{ÖËÄúœ ng¦¿[Mê÷Uá £¢˜;Ö°:<=t¶ã§jìºxã¬v×<®ãŽ(ÇmYŽ…—¸û4ºÛ%B0.QÛ‡ÛìÀ7ø4ç7uÐQN|¶ïŽÏ]#,<,C+üƒòý£òù!ÛúV;œ‚¸q¸iºÝ¸Ðèâ]·P·Ù€ÂÿfÍz<ØX…‰wG€Å_¬/#ùžp;D÷ú,ø`hb„z§^1òd`È=‹£ÂÙÒnâs]öòù`Οb‡çNH•—ù”[dñ!°ÍWG`rO9Ù¯=»FÑsùq¶î~O4èÈóøv{AŠ(p=D@#+ÐÕs:¶ŸO¶³*€7lÐØSn\^æ3ãkk¹¹,IÀ©4"XmÁkÍ’ögÉ-lý¥o-ܪÏstÓvd:_eÆì,›¯ è¼ 9Ó² îÙéàèÔõI áFç%:ò"ÕT©b‚0ÈvvwxƒæWÝ:á›È“S{N†3d8)ÀÐV›ïé­;´òÓ·LLF ¢0DVnÒc2aXgrʧCkíº“ÝîæccÖŠ¨Cá×¥K¶¡Yª0`Á¨€Â#+°š`äÞ˜¢œcs'¬„WÊ;­wëÞúÑ®ئÂc¬`«×¯¼—r›&ü{¾Ífx$'K=½áÕÄÏfÜÍØ?;ì0]…sÕá^‡¥‘ „Cû{#(aïç¬Þ®¡íR%Y£Ðr¡ÊûuHu£ß55#hüûú²#Á¯2DœP‰ß]/„•;ó¼@’“Ñšz³v×l³»ÙLÕ#(›M§&@þ/nÝÂ$BKdûzö/MÕ äp$ë÷ä×fõTÚýô'@9ÊÊ'›¥‚`ÇÍ#,Y† `…QK"Ã6Kk¦æÊiÝ®¦Îî–-kšÒí÷|ò¯g¬×È}o×J|-¸Ö*‰öqðxåØU{@áÔp’Íè¡þ÷>WÜiʆXˆ‚EƒÖŠ"Îg¨èÆ3W›WWEò©ŠªcÏ{åo§C—AV mfûKwÖdÙô!D/ÞB¶Ñ¬ÕãŠ7í¹ÆÜ5ÍUL'1Q†1U¬‡<ÇCq]W=°âËÎøZñ*q„t) Õ"wRÊ\ñ8m‡«éÛI¼"ös9w.pŽòöh×a¯vÛ’ÀÛv^UßØçZ*ˆ`!B#+'‡Pà"Öá y¼6`ºêf€†Ã[ñVr³Bdä¥Àºû4¡ ‚)LB ã6C¸XX)wC‚ ðnÍ@Ôd„#+uV s—…@QaAæHÈ‹üÞì®ïÁŸ" 3Á#+@˜÷à*g–—+™`¡$ëZŠ#(ÙØVŠ#,l‹´i6›ìÞ]ŒFTRŽ°F!D#zÈÒ+©††˜2&(@¸³ÈÒÖˆáŽÃSg$²nâÉ:ëøñˆ£—.¦Ä©;–?Kº0À"'•¦?º=Ä4Ä·“QC¹ §—ÆÖ.$æNðÑR /™'gš{áÆ|ؼÍÊ¦Ñ &èIê.¨å+Ýõʪ#+„‚hs쇀,#?BìíÔE`‰¦:å p&ÌFfE !ä‡gX*(`¶ØÐ6›F'†[¶(Ṳ̈qÖc1@6z{ç=YÏj‚5Ôb1‚õ:6é¼Gµ}c ÚØm¬£w,ÀË2K›FcEr$ª´*;#(ƒ,0Ð5@Px“,(}‘SÑBÏ¢‰ƒIç`i«ëå‡,Î…—U™´ñäàbG¹…Ñ<ÓšœI~§‡³GÓK®«) lHÎS•`ÓLS4§×LF=#+Q‘°ÐÙR4#+AË\—~Ï ÙÀpÁ‡ËL¬Æ37¾æe:&\Ž¹E ¢§nÅѨ(1™éXÛdŒ‡J×.‰6®A/™‘©!ÖA‹ C`E¬±²¢*&ׯ~µì 7ž·ÝðC3 $(M.L7(0§!Bc7ºT‹ìÆƘ,FßFŠ‘6°~çùDC}¢4b tæ''@£3ŠGg’ ~”fS—s?ÏÎfЮBd¹xK5jH^¨g¯#+ͪc‡QNª`iõâD™¬·…‡ÃNŸèÚÁr@^õéu4¨’Þ;¨ÙÒ#,âw¨Æ°uÖú½Ž0ºÃ;#Ä„©Þèâ%˜Œ#+¬Ø¿Â›û© ÈaÜBnãL<[SV¬6ÄvÞ‘ ˆ»È¡°FÃA@•UF¡&DÅÁ„hÔÇ \SÂÒ⩾Yp•”£‘ZA«&#,••1KÅ«#°ìÃKÜòñ-H”Ó!£€ÐipFºk­mœue9‹Eˆ›D6ÊööÕŒ 1Õ±å‚àdtfÔ¢²‘j“fVj#œ`*蔥–èg8Q™y’¨Ái›4;¥8ìëºgë†#+JÀpdC$#+:‡,KI‘#,`["f’©Kaº<imI£D€°ÐÝ«v]#$tªNëúðyK¶î|!ñÎwQ5QFyÔ˜„aT”îî3’ô†³tú§Á§'g4Åë0fqo7C¬ÿ–]k+ãN#eÔD!‚„ì°îÍÎ{à±Ëg¥WØJ'F‘àŠ Hpw¿ }Ü—Çg.B´D«±ŠCPn‰5 åÂKi83yF¶aVh)øg fú\Dã[_@Ð… =©®7óã˜P‰$yL(ÑÈÁ’J0GZȲ•¢-û)L wùÐ!»È w#¬Nq¾¥8€*·¶³"Ú#wwa¾æí±#(Æâo3Fµ|?–S‡£v|g¿ÒÿO¯¤Î#,™Úeœ8ÚÓšóZ¸™šòyÇWÒÎð!ЙS™Sf„ðõ:N¼,PÉ5Âh¯«q¦©$¼6m±†å7(c@á#,%‚˜¼1';Ö€¨`i1ú½Xbj¢—@Ì4°‰„,—c@®…âkzª©WTÅŒ ™H!uXȼuÃa‘ºÍ À÷¹d¶0@#(¸ç½š&ú†%(f$#,Œ†ô°P‘"°„#+‰`Â&pE#(€ýœÜ./Ü7¶ÄØ·2ãdfvº›_sxÚB I¯¨þ_TJÃQx‚i±pYìÏ;–õ¯HH¢^†‚im+\pPk»'\u~‡=â96Lý¾7³]ªÆ‹#+åì¦äÏDbð~‰–ŠÓ´£Sœ¾®jJpb~ƒ%™— S”¿'cñöx° Œ@#( ò‹ö”)*žtÈý1Fx£®×I)RºmͶåμëyçc\A`mF­®î¶¹Q[›ZæµµËTj«ElV×fÅÛ•·+›jƵt´®·[uˆE]§Ó°{}%Ñæ@BñO(¦®^¨ñ_#•ú¤“JR¢#(O„9‹Þpì#+tvÜá]0{Ï®XD@$<„ˆª F2i”ÉILÒÔÍ2h€ZM3)#lZRE¨ß•»dÂVÒ!(F”¨šE™`ÉM¥#,6³&{öܤdÖ“IDÓ+e™“šfHÂE¨ÛJMKèî¢4Tl–Fš1 Ù3™!’ÌŠ¦ÕÑ ”ŒQBX¬JŠ(ŒÔ”¦E*LÐÚI“ZbšÅHe(”™)”Ô%)¨ÍÃM™´’‹#ˆ³MÅÉ7›½´Gðæè˜öŒã3˜0ò¾\­;·1@™Åë%mU}La9B—iý»Ç4C=*§#,dLÑLÇ>ËŒ~˜<4cªô–JÇÒnºbúLÐ.Þ[—,`0xn$–Ó a»pÛ(H˜ L¢ÚúÚóʱˆÍõ;¼gyô‰ß(¥E#,dü¨õ¼i1FãpQ\·åpð´áD¹cz‚¯“¡…œö ¸^Ë®Ù1#+ `!S|&^3[°T¢ ¤¹-!*Y,-DH¶%ØÐPŠ©EÇF8Ñ£%P—냽’B@ÃOŒrʟ׋Á,h†uL1ã+K× ½¹¾¡Î’Z#,6›Œ’Æ?ªª&ßTÈù>PÛ#s…¨7DFÛ0†[fñ¯P”Iû]-Ï„ÌÜF÷#%ooë~Ù¾7"’ÝÙ¸Õ2]ß·tL¡º‹{#(û}ê}ÈoÑ0-ÌW2nƒbÉ;Kv–»¡066É0À##(% iB¨$!dܹ}#( !–ÌÄÏïÌX‘6K`ÓÙ¬›F£³-2Ê¢Š£"|xíßÝåÛÚ&f&(¿ufÀu‰B5®©œ¿&v{3æz¢¦ósŒ0õê'ÊCÙÜ8Ïy¾ ú©¿;jt9Q*J•Ò-ÛC&ŠSÓŽ˜šûÞú¸8X\ãkúÿv*´4‡ŠiÛ®$^¦åŠDK8>$X;²8…¶#,õòºÁžâë&+ vj´‚!ˆƒ`H’ “Êà—ûû „ÊeøWëΫ7òçŸH£¤B)x2ÿ‡áwwçÁJˆéQÁmÍ`ÑnýáǘX“ç¿úc4là‘D°§šªª÷ý°Ã »M1´cM2¹–Ó‡jr4õ0õ}îk«Pk)ëŠxGÚÞO«‰I8¨#,CÎMô/¯…÷Ò¶Ô‡œìr†œPVÁZ9Ž½‹ Óì˜sZsy ÙlI?mãF«æÖù0Z‚]&P¾rGMµ;r¾rß©ñºe8xÔ;RÜÓN⨼ٮéthc3k¹žJÂ#,áøL@‚¥T)}Ï{ÎÔå¼$¥ií8˜óJÜêç¬n²Ð=Iã9QG²z^ó=4VŽéÚhXˆÁJ˜O!‰Ô­ËºÍ……Ct4EFÆÜÂ]‡D7ÍŸm‹JBHç ”eºˆ¬âû¹Ç<(Ÿg\Ùdç׳YëßÇÅ.“Ë Cm$!ÏÒNÖ­öêê'¾½Þ#(ìí±ö{½Cã÷ý•Ê÷ý§U¤ëHTÏ_ð©8ˆežûýWÄ{Ný¿_×–Óe¬¿…!ùƒ¿\?l,eŸuVµÚê(£ (GeùOfz8ÓÖš‚VßYR}ûíïs)Ø)l‚Š}úQ-‚ÌÕÚ<ꇳ´{ Ø­âpÊØfÄÕo³y™s@(\‘-T º>wÚC¬ÎΛ‘4"ìÓ5'qàp6»#ÍÔÔJ=•Ô‡vœÑ^¿²{qd,D`j„ŠŠâƒZƒò¯êN¯:qà`;ß ºiç±ïhùI¿Ã3’Ïñ¸Æ鸉¶DžCèhŽ¶ÈÖ0®5¢F8Ù–åg´Ûlɪ”°¥ ù9¬‘”dìE×N'¬ÇÙè£C=×—˜ocœFÇ£zSRÙ«§Y–bœ—¥I¥ùº$….TR„’)"H‰E’³•­­5øô¼mðÝQax¹™KÅ(kJ®™7«M5†-X´bãPÑ–ÔP×[&m­p®ì›·Ó™ÊåÑËÄçäxiG8ÎÚÖ²\œa¬t¼Xf+ÏcõÍïl{eKî˜3¦Ò#(*Ë}•b#+éšä¦íU*áâxÂœ5a\ÕËLŽ iš’LU&Tç3rÒ^ "P4¤˜q^š ³I뛩±?ïÑ7‡#aÞóÏ8Ç#+nùEÖ`ÊØYÙí@Ž]'Hz{—ƒ4o9Y.ó:ŒR1¨´‘´ÃHÚÝä#+Œ¦È˜7ˌѺ$Â…Ô€»¨: Øó]tëÓ\qáŽFD¤EðUÝŽKhZ6@:BˆãÙXÁ¼T&._¨€Ê4>Y´¥:»9³ëu³"L;gT~Ø(ÄÁÌð^Æ#+£XÃÅ$Ÿ&ß<Á£|ÆË ¸YãƒRd:ñÀPœRr[­ÌÓîõÂXÕ›m€OKm¥žáÈˬâÌBÑ¢nF¡gÓX˜]-kýòH™Y‹—ý:7J[Š¸f7ŒÌ˜ÅKí xÆ(X:CCf±š¸u±l~LÛ¯±Þë3ŠŽ ÅNxf•†°=–Ï„„ ­“©ƒœÛÆ1¿8Y!Uq‡uUGºýŠ~v¼NÛlçäZ¸xSäæb/X”’´ŽglÁy¢"cFùµÆ^1&YuÞ‹z"VnöÍfrg£Ãⶭ·¹ŒéÄ΀tî‡m¶W0EF_ê¶Í”/%ÆkµîÆØÞ‡ç“3uËo/>ÄŸ½Ã¤¹‡QŒ‰I”²û­VѪœõÇlPFvƇš59Œ÷â¸3HÔrñ½ÜÅ5Š\sÖ÷Ëçœf£ÕÙ#(/ƒÔaÞü”5Ø÷´n>ææs–lV ªŒ>_š˜Ùöiw’I/NêIÛA4Ó:±¢:ÞósRièÔxÑ”ØfMŒ>Ù¥CÆ—‡mÉm)²‰˜Ñ†NÕ×Ëï½W›äøø„` ¹‚ ÚR‡.¡µÐ‰œF™#(Ö«ã-¢lDg#+*]TGÔh#M…#+CŠvÔyÓPôa½Aç;ŒåÇÚ³›¬CÖTÊ„¦XZv”ëTöžó¥3v’ÁQ˾ê·WÇi¦Üq –ršsƃ|fIÁÃlÑZ¾š*M×ÃŽ÷Ò`·—…³)‡ŠòiÉ.„Â…/Ò#+ñ’v¦V^Õ$¼±uÍÑضL8ÒðÄôfÆm¬²éR^ž³Á#(L‰“o¼“¤ËälíFÉÄ‘‚(x-º*èå-=åC±üvƒ”Räë½9,Z”׬›Uà6n#(Æ#,غáRØ^âCS™Ô)MæxójõÛÝкU¦ó‹Bx»1ík}­wœInœ”Y0ºž€»ÅÛôÎ)6Q†\DkÆxƒ¦ó.OLº„ÊiÁ”¾Ó)*Ú.8rÃu$(ËÏ3¦†Rñ½»bå³J‰F‡a[*×C5±›Q™†¶Ž¹r´ú؆ÚE‹t¢bs™#+Œ\+iÌëV‘h´h&^¨RÈ5„Ï#ÔKòA'™lå`Z”Ÿ}›Â¸aS"+L’`‡}Ûìû|Í!#,èy•¶ŸÎ ³4ˆ2¸ $70ë~ŠÌ®ãô@•ÉR,(#8òÈŠ§Âž(ÚËC~Oœ×ám%„„zݺޢ—?²Y)pµœ#/‚1ì#ºº¨û&õÆÞB¬}"iÍRÓ8ݺˆi™’öÙÏ<Ô¥¼„Š„•¼ÎMÔ–àò‘—yRJ™‘ß÷¨1oœLH°¶¢•K¨wUÕèÍÜÌĸÈdžy©!uˆ8·ÓÛ¸ä-lK•Ÿ·2hœxilÒ&íÜs%O6;­bš–#+¼ÙI®‘.ê¨JâRz˜„Õ’©‡ë5£ÉÝ©w¼LN%Cùý1ÅcZQO5Ü‹uˆ‘8x•O#ª›ˆ¢<æ'eYFÎö‘ãgî‡)éÝò·*#+çÓX3(—lNXQ™xI$äÊF™[pf8lm•§©¦¼ò…[O°6¥\;¼‹ÞªsP$¡!Å.Y5QU„÷Bº9‰“lšE"9œi˜sÆ®sË4ú¼cÌ»é«OC”‘åÔhl¹¬.ºžfoí•Évár¹“2<ŽªË3Œ4›hÔr]L„Á:\É©£S—§¨FÙ“O3fL³eî•ž•<åBÕÓ_,V•<#žFgn,­špšJ†á ±ÝV0>ÎòŸÅy=1{½Êe‡j0Š:9eª¨-`)ˆàCEŽZqZÅIÓbº©~RAfÜÛÎH©uª…š9™7*m±mƒc$#,œq rI wÛ-$»¸°§Qix@Xn8Ôuè©B8TE:`ÔjY·yP4¶ÅMd²Ar¤†2›7ըɆ‰ á$R¦²Bp¸3R½æbQ„/ZÍió”k|6=ÔJ.rf§Hï‹lRË]*©š0í” ¹Ê¡†1µÙuÁÛü´fÔpU­ãv«µ÷`É b‰&Íœf} ÔtW’Ä(„¢r¦o41ر†. †¨sI [àçh+SWUS}Á\HX6áb¢mãu{¯vzˆ:n×(T(û•§ÂÃLÆ%›¤€æiìè̵àÏ}oÙ*Ñ#(#]V-ww×]ãBÌ"á;LÂyM#,‹Ž#+¹L¡ß¥e ½,qohLÙɘr:Ìg,÷*Ɖ¾xQGŸÕA©øp?º;†±Ï1“^ÚP=3®Ø[ O˜ªäÂÐY0ï¤Ã&©š©M2Ì°´ L]Y3ßE6ÄmѤqè“!ËAˆpa¶kƒ0™Z¢e¨7Ó\PR#+Öu¤ÍhȈ#+*#£ ˆáÙ¶mºH¹wfÙî½µ£Ý .5A®Õ9ºˆ7AF(7uL&ÂkŠÃ²¸ldFCL´L&SfZ »9ëFšÐe#,Eš ™XµZ¡É%¤[Å¥òm‡ VéíÉSZ“š¼YÅ0º ⊌)4IªŒ#+Y9¦¹W&oÁ!ZPåC¾ŒÎkÃ}ƒ3°næ6¾* œÉ*­ø±CÁÕ¢›fÚ:°`Ò§W™Á2¨…ØÊ ãc8zŒò̹v#(õ8!²Lc#+˜,nRâªfÃË6n3šñá9Õ‹0í3Á(˼&N$q™•ÌŽOÂŽï-OŽ7ٹד\¼’’„8ÕA¸·¬g;3~/‰ÒÙlpNZÖQÄÈÐÎ2–ƨ¦iÞIS¼5f©‡a–³+À­œEçRV²bŒña¶sÛZ#uÆn:(#(¡å#+c)–¨Îíó‘6.±hk…Ý(Z-ÃzÝ-0k†çT,,ÕC´k¤@™á?ÆÞ‡ydmÆ(4¤Š#+p´‚éjœÛÞùá–=nguÁÁ—‡:ˆ{6] 8> áIšÜ¡ØaÂ6N¢"yû 7‘=-°œW‘Ìâë˜êÎEëœdJÆn`cDaÃ#D# ÉaQQ´a¹*-¥)£žÒš’ØÙ#,XÆLƒÝäèw#,#GX‰£ ƒŒ™dcmHF’cg uî¼þZåBãxeÕSSV [ÔwýŠ¤c5.ÒÄ%#,d:]÷l嬕+jÒVz#(R%9daÔ2 ‡Rlp+RÌóX4pŒTP¸Ê2p#,30²ÍIE[ÄÛk„r—#( Ú§-ð×ÝzÛn[P58ï‰4 CY‚#,¹%KªÂZ°#F›``Ù LÇ×#+³lÖõC³§—v#*-TƒC{Fàp¡ÆvÙ#+ÍÖMdÈÐÁ’&ý]æ'$°2•§9QŠöcGb8A å,Xˆ@A Úm#+¤°(dŒ`"ho369Ñžœº²L‚âa¤3É+¤0†LÑ‹à³T›E4"À‚í©-Tp"a:1dØg00læ‡ m³J»tÌYç6É£E#±0# :«°PÀ[Ëì–˜Ù‹BX)‘$ƒ;6Žžö¡ xÁ°h³…ÐÈs]¸#+WS#6˜YuJG#,8Òjèá"@…vg&™ñ*´vƒ£´M·»6–pfÂÂæ"lq.S{… w%[†¶5,¢™Ø dÔÖ+É#+*Š  1@ÿ"€‚Â)@'ñn(é$ŠB Žø*hgx#+*oTØP°iÔ¤"ˆ5þœÑ“Õä~δÍ-¯›ï2«ïî6àhÕŒ0e¢*®¨ä~#ü¦A˜Å Ö¢)#(DM°Í8u8H§øtˆuZ–ñHÅVò¥vꦛmê^Uæ eI^×à[s²â¦õD¹D¾e¬zÌAìÎv* m2@¡÷Âø™£§‘W+Ô»Óƒ>ž`¨¦Œ/.y/#+{Ôšƒ¢ÑÁEŸ5c um‰wÝâ0ƒyg‚IÚ›"hÊS5£xɻطYE$XŽ®rûp¸‰Òb˜¼«!?\õ[`³D¸âЇâ×W*N#,O½Ì9v@Ójù(UÇDt¯NÁÔÚ!ÂÙÜ•ur-#(«86"­§M3ŽÕ»‡Nçr[Al±É#+Ê‹:6»<#(Ó÷^½¥‹jvÊSøí@ô8Ba9)$‚E9!¶ÎÛ*Š%L·nœiÜ·52­÷ÔÍm©5ˆ‚ A±š PÙYãé ,¨Â-¡ú2ZGœdcD#")c¤]¢gHeÛáÚ‘2swSÛ©RšÐ-!`µŠj$ènÇR¡ŒŒ‚Yj¨øüsókÊ šb#,w=òI>ϯ4;ð }!#(Q4€ Ãêନ{¢T?|BT(*©#,c"]Ù››®—A«›%~éy©áûÚ¦ëúÝƾâƒÐQçþYÞ<‰tQ¥þG¬î„"<%17Š/ GŠ' 9ŸÇ„¥&S>§šCë §)ØAƒ9jÔQøi%ˆ‡ÖCè3 Ë ²Áý7™›ÇàùÉÉ¡ˆ0}$̸i˜žò*¸ÀNÇC°#Ê>ÅÅ€Ûö}l~y™|„|¯3a_(aËXÌ›yÚÙ¥%5–i«Ér¨/²ha8v¦Ð”o@d¶…ØöúpÔ[7þg o@ÆÅ‘"i‰E‹zV‚áGˆåf#F˜Ž"àÁf؈Z €çè=ÇTŒ Ô]b’†ATR¢#+£ô±%ÌD6köÛÙì —,^\7Št=ðÊ7’XÈšŠî>gʺtÖÔÚ$šJ5EQ¶4Z6´kD”Z"dj ÓÈ#E ŠMÿ‡ å’q„…A,¨n´O°xý=4­{Ô®Õ:mìñ\“ Éy—GS¿åH¦»Hø([äµÞHÂ/LJê‘zäÈdHˆ8(®á)„ô·¿mêZ²v¼Û»Æ«%`äUаÐÔLâ#(ˆšA¨þ²² Ü—Ñò7=ÂΦ©¨AHGJMt<§…¾ŽÒf쇉x;Jdæ˜ï·#,ÕM/ÙaZ³òÚ Loä|_÷V†™/2—Qž—^¥pk k¬ŒxÑ a“+p-ÁÆó}Æ$߉Í[&Þž6××,øv±ËÓZ¹W@,˜ ˜TX–z„š²Ëª 1…¡¶M“(¤˜`5þÉÆU6Ǹ©Ü¨Eith—¥ðÂä¿m|Þ^y*çÍÜ–M%±«‰di0h#,¯…-Îþýhaš’ÒeK¿§Ÿ­1=/¬´ nLVŠ¡“{÷¢î"+D‰.Db:ïÓ=5&òUR„(hª- –u7¼0ºz&Wt Ä`±QÔè2Ì~ÌÉ  (Yù•R]kE»üaŒ.¦ªàh¦žY>0GäÔÖÆé®ei6³ˆåVFÖÞayµµˆÁ¼ üxà¬ä`s“ £†õ]]1UÐa‚âgJÿÑê´ÆŠÉ#+ 4ßH™ÑŸK¼GÇ1üŠCNH¦§gÁÊáí‹XÍmTî!Qé#+*"TÌ!)·„â¤DWz¥ÄföS&‰ ¦ûQ&Á°Ã@lŒ°ÎIŵ´°¬&ZåÅ°Š¿î ’p‡D90Ç:N«ÒÜCÜÙ¦§M`ò$EÆÖÒ BÚž4µÙ=äZš…HNS#%ÓbAÛô¥‰D¨,@³ˆ$H9»¶j´vƒ¶Ë™Ãq”ƒ9¶ï`Án@QÇÙ›g^œ”K†ÎvTŽ¡‡6"œ(w!#,ôi8f˜+‹Ò듉ÆÖ&$‰yi¦tZBËiÀʪ،Zî- Rè¤4„iHŧT˜Á#+$ÈHõ4A»Ò …¶œ…øPÐæ0騵¨]AGÒN2ë4)±Y8RðZ5Ë^,˜†ÔeèdôLƒÊZÚ{1ÛɲµšÔÓèâêâfÈpvÅ#,2ÛeÔ!šrJ\‚áI¤·‹€(Ϋj#(@ИPÄšh*ÕZX’ä2‚B…×D$€ÑÈ :—X!"ÁFH(BP‰’Òà€BÐ ˜%Ð\ÌÀ0 …ø!±ײE#(J‚˜ LÎÄLMᢽ۫sM€”Mm  ~ðˆ)^#,„N[7…ÏÚÕçB©~ìɇÉ\«N)XØöP0zŒû.£ÜP{êÀX¹ê'ógCb¾ŠzÑ°†k†;XûÎè ª‹å0îhOØèÂqtpûžC‰ÿPƵµNTö˜–9ÝÉd#(;Gt;}ªžöÖ¥Dj]Ý7I Vл´¸Åw„-'Í#,E"Š Š €©"ˆˆå"#ƒ#"BGÚùƒšìÒ“C±*¨Ëìz—>j•Ï#,~¯˜xÛlÏ$âã ëKX%qöªæhß/ ¡5­>Wö°Üm]0\êÒãÇe#,8ÞeèÙvŒ$’ÄŠc×NÏ+e2òeZ©˜u•*\RËY”ëY{Ͷ“e#+¤¢ÛeÝÊW<ŠŒZiZ¥š#+±#+,žDÒG§ Ç“p×#,ÜpÔXΣÒ38’Š$ÄÎ%ÞIÔš¢Œ"à§Jƒ®bÔŽDâ.¢Ý[ñŒÆVÝ !T³mTC’g¥8jMÑs%âÈ@⬶]àÎüí´Taô<2Š‚BZ2òî¶ØÄoˆµ‡©7ã¦Õƒt$˜Ï(ˆ8ƒrSÄ#,+œ„òæúW6Œ;pœ*Ùò­ UI‹žq€:j·éA”nop쉙‡™Ýòãí-i½ñÃí‘s„×)5¹Í|Ƶ:d£'mk½÷q3ts¯~,ãp°›•5•ë ÜŠñyàªØÆ ±X‡­+—³a6CbŒ.N#,5C/O“N#(ÖæÂV$!’TÔÛmKiVbUIŠ¦m-´©¶Éµªeµ“ÜœŒ\ã#(w£VéJ  $•D#+E¦,b#„Ë(÷çË_ƒ/-Tb8L`©KJC¨A…8¬†RŽZÂ\ˆ¥­D‹"PÔU'È,6P$‰,€6…FáFȃePÐ"B*â#Ay‚ÒËÊõ {àSѬ0H8#+‰!ø[#Œa$U]£ݱvîЕ.î¯H8ò•«d©’7E,…Œw2¶ìMn–i¹«¡W[u·NíÙ7Šå¯]®L´í<Ýw™W“bcJÝJÜ6+²Ñ´i*^2Ÿó~“%"G¢›FÍHZ‘´q”­2Ô¤…”Ñ6m±­6b™®¥®•e¥¤¶–fËmŸ.×Éåäe£jƒŠ™E¶´%ETÒ“lÊBä[Ýê3pu"è£õF®k‰ZÅ—,ÚÁQ9&ws ˜E*$KoÞFÐ ¦”D¡G¶‹ ö 7Á}QäCØxë·ìEz—ç*ñ½(€´ì³8xA,;óÓ3#,ebbiAt¢Ö‘·õÓȶ”\”bö97Ók¶ª2Hx÷YlwÆàì°Ü8´”b~Cø?¢ÂÜT¸Å*UP-DJŠ\‘Cú@V›S ¢F€(Ð%Jäò2ã“#,Ç#+zÄ&ìMd£ñêo¯Z]ýÍr0§|_“A×£îbs™##ºMÀÎ#(l’´®ä£8š&_$:á) $ÉVò ÀŠÜ»#+œ4ëþ‡†î{#(ÚïaÖÇp&9êjŃfý½V†ÓòÉÐWê“ç†÷6áxY¢ôS¥D6brãàñ:¥½¯ëïåè˜i›`k†hl2'’#(D#(NšBò™!‡— “ódÐÙ#+Г¯»³îP¸¢80éŠ ±¡´ËWRœkZ‹«ZñSûÉMÉ Ü£JÁìõ^Æû.˜øØÜ_±Ã1ÒkœŒÜÕŸÚ)°l}wªmgŽÒ€Ð&ù4çâ¡÷¢ŠÈ!F#,‘Sò}=¿cî~brû(©#ÖVÚmòµ_ØeÓé…›¡"üûY ²ëŒêQÓòû¾ÿãäÙ¦·„¸D66„ñÚI¬Wdɵiï6ÒM/;],¢ZA)¶Ud²I¹mn{öÝH¦±#+RLkÝ»V¹K6¥c!)m&Ê6-#T²)¥,›)¤Ò´Å,«¦4gá]bSmf™…M¥(Óm[T¶Ù¢5zîí]ÔVIµ+ºêmB_FÓ­›^Ýv4TÄ&ˆÈ$ffµejRÚ’ªPÔb²‘*¾eªío•ÌÁS7¿vÉ6EldÛZ©K÷ýÈÕ-­¼]T˜š‹ßº“-¥$ššÔ¯o^kÊTM¦Ò¦‰šdVÅRLZ¶–ͤޜ[m¥lcãWEeKyÖëÎä”eZ6™4+ŠšêËRW‚ë-x®±M2H¶Ð”Ux¥Tˆ  *eö|œ¿Ä¹ùe¦n¡e•„m#ËaÂe¥ZHÕ¬…”ì#+½;&ufÝmò¤¬=}<[è‡9AB0J¢Óú#,ád†ìÙÞýw“ð?|ù{»x‰·ÉÌá1О«ŠfI0©Fÿ,Ù3PÊ&Ñ(:xo>„ˆ‡Ü“µÊ¶”Å!î@´¦“:QÒaK·F,DVDq2ÛJ¢Š’BΨŒAi´³4­W+©5R¾.=Ü6°ÂCÉ#(5H"¢Š0BF kŵ]-ª*¾ ³lÒóv¹V .Ê lBˆ  QdPAjp€‹e"¦cÖ(†”ØT×sHˆd¤@u#(#(‘DB[66cKL¦%¶‘BQiIµ)Uªm›L«lš¨iM©J¾+r†%-EeQ6’‚Q”i¥$(ÐÚm”¦‘5&hØi˜Ê1Ab0Э”ScdÄ–†£RmcmJU¢¥6T¥2Z’ÔRU%¤iD6£Vm4,… ”˜ÐRe&™&™6–Zͱ¢*È‘µ±2ÚL’,Öµ,ÖLš4¤š”ªÒÍmIªÚ÷­UÝmYYµ¦ÒY«IJ½å­®š›5­)m¬–ÛX‹W³W€A†(ðѦ#,2!Ò#(#+M´¥°[QmiV¦¦µ ŠùE2BD±`^ò{C“´§ùñ»7™Ó–%¤–ÎîGc ÖJ@æ5Òz'©ÒøæïÝw=uÇž«´d‘Œ"ÄŠ¬‘X  (áXA@Òy>®$þ§·F‰™“ç#,x–¤ÜF#+äBïwK`$ŠÁOM)IR`óvžAJ{ Q0G=7ÔµDéžNV¿ðù#(S=à*}|ú²ÂzáÆ;£Ù Yñw†EØg§«¢kÅÓ^;S%¡ÎÖÍeö,Œò]M÷œ”£v’‡sK-ZZÅ×cä†;ží¹†ÓüÚp}Y[•öÎ\r‡B‡ð6a%æf……T[Óš4$9fÕµgU#lk‚„b¨‚Â…ø€yŒó}ˆsûD ô€G}FòP}fÍno£ªlM°Ÿ0¥@ìUQ¯àððlÚõñÙ!É&t£ðȇW?*Àºíï£&Ÿ–@ü_{ˆ" "“1ÂPàãŽç½s³öLLO©+š({ðb“M:̺A¹OuJ¾žÖeÁt`Cu‚Ç4Üx#,mm‚8@C¨ØŽþ#,̹‡èãòh{{ Ù@˜)ߎ/Õ3·Éۧߗí úI[bðèh\ª³5JŸMWéj¸j\F[#,ÖˆøuÖëüêôΗeT>ŽÜŽ–ï1øvßPß0#›lÔŸ÷‰‡?„àÅ+LP›àˆd›JO}>œ½²üyVÊ1Â8˜cD"§ ƒ×í&É ÆîÜ 9Œ zäHi:&˜’f Òª©#+H<»€#(cUª0m¾iWuÖä=N&%+½#,ÀWƱlƒí)#")Y¾uÅÑO(O[»ûeÎc»K[9Eu0ðžwçÐÚ…‘XEçZœ ÈM·†cᔃÈλðK—¶»qÇsëHæìïÖµ#+~£G„D§ëêۻ䠉íÐ9·Ç¯½v­æíΟÇ…vnñ¥0deŠlM@:‚#, –`~êé{CVÁ´1^Ç#H.sº›Y$Ò³þÔ[®[:¡HV)ƒm °´¦(üñWýÍå©H,˜@A‹,JÒ ÿwø­|°­or²Ø£hee$IQƒfŒæª“Ʊ¶d Œ#m"´ñÔ‘ëq¸<#c°ÙXAšÈ+‘1#+…7Ó©8Ø÷Æ¡‰­cŠ±¬Œ‚h¼°Š³†7#+»KTŠ3› ˆl L#,`¶–ãXâ–*!¢m(UT‹"ƹ]$ ˜*Z´.µV-ó¾HC7†"¾âÔ·ÜÚä×&ÆIG&~Já#+¨&ˆ†0e¦Æ”Ç;¦@›”0gŽ(Ê[!é%eL¨®ß:fó?«&øÐý?®þ Ý“#+ìF'¶ºy9G¦eVõYt+oV.Iö9Þj´šÕ}¬&ét…bÛ –MUI%‡Ê4Èü|ú½gî#+.-p%»<˜›¬Eat§‡*.Kú–ŤÀj£ñøÊØ š×#,’­¥D¶Ö¾ÏÓ£@ÐÐÄ#iêœPnm $€ÓR’“É£ÏQÐÜ& ,r•‹˜yÖ5‹£CÊë™­>›oê®M¦í ³ƒ#(à€\Ñ"FYFgC(T1ÃkÖíø'°tŽE®7„ æf±UÆ‘Ykª©¸PdóõR¹1ºÁË:êk–LÙ¼ÄÕšœ2kIÜcj‡A¨‰«Zô­t1–Í*íüm8Ÿmü$AV1Œò>ÂÆ.‡UD-­øµñÊ X µEßµ15›‘ïµ¾å3ë_=0€Ò@ÁrpAy…½“…X§ DÐã¤ÒŒa1€/dÀD,Ѷ7º«ùãËñéÒ°óý=ê‘õJ³hç°ç+²,ŽÈ^ "p\¥…(@ ……ëâU YbF7´Y\æÉÄXšÇêð„ß:[NM}@I,âWÆ¥ìÒ˜|5¼ÌNl‰²aÒmb‹)SÃc¡¤ÀF,\6|2ôÔ#+¡¸ißóÎÃ#+¡¡¡p¹›À,Øv¹¹–ßÛ9#XÉŒXÈ…Øa½È1•»hkmŠ¨Û„F*fƒ#,¢ìêXQÈ:Ér#(‰™ÉÝ<(“5V"¯ªŠUá ë/QH'§qÃ;ºÍålÏ%BãN󾩦':Nƒ‰¬jT¤¨1ˆ % M!VÕ×FÏc¶ŠbMYk.Q‘%…¤È@õ¹fLÂ4à°#,Ë…ý¸Ê?âöÕóéJ6ƱŠÆ}A^ÅN"™ÅÜ=Fò„TÙr¤©ÖÛ_U5]Ko§Úò励ƒ¬’ŠïJ’ ¶ ±ejЈ#+%.8eë»Î<÷¯ô4F.oUîpPа  Œ¤!a'œÛd]j‡A<F ‚ÓF¨V.”¶¦2&¥wçìÐÓ”4œµ6Ü ±#ïà#,K#+“ÄÞhpvÞ«’c LbZ^:ˆ›ë4âIRbjê”$ਙ#(ß*‡Ü±—š•F,ýK&šËš-ÚüÌƽñ#*/´’ÛòKhêêzèm¨yuÚàtñõÑ’ŽàñUJ*Š#QNm4¹®dªí—fÓk˜D‘j€2#(¯Óͯp¹#+ OÕ@F³z5”Gxž`×Â7qÀ×HX­è½pV1‚@#(‚ëHŽA•…zíó§/®>ðâ›8•Ï"ʈ¤ˆg¥Ý{„Y ih‰²#(×al—^.õiúôÜ+¡¥%fŽ?øa‹¸4‹°.Ȩ–…Ô_ ÛŒ²lRª£ý15â. Ž@oê8×w_gWîMGh|´ó—àÆâv*2èz#,"Âí¤P’~ †Á#(>Þ>8×ê»töébá9©ÒBk©ÍÇõåH/µ>Ý“.Uù–ôGO°~«_@J$="ÔŽ¸%ᘆî²múÛ|Xz‡@ÏîÓÐࢭiúþßÝqAM'¿-Û¿d.Bå¡Eöõq½èÝ°}݆ºÈoÝÒ›vlþßÄ:vuð†‚#?@=È qt6ƒŸSTSb˜Îõ~ïPzÂý~S½r@¿o¢®DRIí ¢J¥*#,‰D#(RA*"TRESx@‚سBñ€!"YÉQJjÎv/ͳ {‘½±Üµ ,òu¸Áš•Ñ‚»ª‹M%¥¡¬ÈX¢Þ»õ&™„r;Ž¤ê>V>×Þ¦¦Ÿ³ô¹yÝX†"OÀz$›“Öžô£¬9D#+¢>@ ‡YL‚–_¡ÝCêÙ=u&.h›ûºÒ<%Jžß´sICêJý,¨£•©+2›×r¶»ÎºòRÝX‰hcC#(¤O§÷cû))„c­Iš?¶'eë‘ÏŸÉëú›ÃÇ“¨j΢ö¦Ðªê_H9?õ¤¡."¤‰)ÖMW¾ "‰ˆÄM¿êy  #,îFåå³6Æ¥¦’ñ«šo©Tb!QMçW]Öæ.›vlÚ¦˜Tk\Õ[©TVÑQZ¹Ò[f¥¥¦˜Z …Z ¡²%ÕU€KR ‚$€¯ê,œÉœ2œî¸ïDØ@H\Ê$"î²9p(ò?»¨°?†") ó–py}õÝñò«ñÔ”XÁ¹Ëðõ®HhzµC#,RE`!#+#+#+é‚+,ÉJc—áV;’)FÂÕŽ ±¤»¿E.‚ÁìED¨…^*—PH¢DDô]už5“ã)à:G97$' ÃìŽæÙâêª!"H«óªÁMk^¦Ü·/uå6K}m-ë·R•,­s\ÖôÚúV×–dEÉb¶›ÚgvÈmQí5‹6 #(lFš#+“(Ø̈"`}¬®µó6×›T£{vÛÖ\¢‹1)$¶Ñ¶Ô“M²_^Íªå¶ ÛH6ÂH (E2Plub“„»´|önƒq…á*gC‰d¶âÃúu”&è! Ú P+#,UÒ5#,\’û%ô#(”& H% GpŒ™d›*J©PI,@%ñ5DBUTP‹p7Iúa ”#(Ø‚̳6X¬„Ø6Äj¸¬ÄÂmú °mž|§Þ°ä¶)"ìn§Ä”hhñÀø鬧/ CÈœõš§8ôf…«Á6U"PYñ×óøõ=ÚîŠ ÜµBq,T-Ùc&¡¹”-Êj–C’ŒŸÀ«0‹kþûS7l¨lúÃT#(ÝW=ì>þ‘8¸¹ö¨T6qÙ½j臭|ÆÁÜwâͯëvÝÅ$i¥¥)ªÅ´M{Êí5Y¦²üsw´®Ñ¬F4L±ªRD­PŠú±:žGC2z=)Nß:=ˆ¸#+#,l“(£kÜÔ+þWЯÃz}Þþ‚odàŽaZG,Ý–]>eF VHM›!K&Û'“ÊÍôüTÛÐŒú8ÑŠí>ú)±¥<éÂl¿x|ÓÝ‘W+™?WÓÖ̬ù B²'•©VÉ‹´É¶Šj&›¸ÍàÃ.q75œÔkŽ0"Õ8x+2B3†VtéδkwÃvuI11¡“L­¢†ZÖ50ÛH#(íuDA¡¦#‡i7-b"ΪTN؉#(4®‘FûiàÂXHÌG!õ‰ÃÖˆ­=þ÷ú*¬NåUV‹–Ïð=ǽç$=#(ò CaT˜˜fè¿9@C¸éæˆ:”4 #,„x¦ªä“Jüò2(pÂSSFf醢ÓA!h†ú~­À¡»¹Øo’:ì8(ú¦CÇ^<#(Á³iF1‰k›hØ–ùdP08MÐYÏÖœhék’ C÷1JU¢8#“}l;È `ˆ˜ŸÅ¨’ä‡-!£ É*A mˆ”—*g{)YTT}ðüž8êü>Îóvõ&H‰¬Ð8 zèIÒJ>Mx2ŠS_õàêÿn þË!•eÙé÷;^Ka!dÀe¦ˆfž”us”`w°ØðŒüE“ å8óÓsé(ÎÆu'Û#+Y;7¡Æ}©æ"×à›5ª¹m2Pû߯mäúClæj<À¶öçª!-)¢Ø‘Z0–- JJ’’‚hÒjY¦bÚ–¬µ!„¢#+©3Y Ã_™+­$†±YJ˜²f¥Ÿ´jÜ)µJfÛ261R²#,£BȦ°ª­˜Õ6”Ø‹m5Ye™RÖ[R¶eZ3YmšA¦lBZ”j(±SViI¦Ík4KMS%±V6ªX@,´‰X©²·ºãëúOÓ"\@>Êa0?ØVŽ]®MѶZ¤"j #(2#(yA9þ¾ºK[›hÖÖêsU¨ÛXµÔ­kšÝ›Á«Ì*0múº­¼76R 8¡;“¬òìã §B¾~¾e·5s‘µ¹QŠN¥ø¯æ’.?ãÈ%ÔÌDî„$€¨Š†ûP‡ë( zâ¿.¥̪œé¢ d•Æ-a0)ö( 0p?‡Ô°½²|a6 ! '×Èí°¸‚à£ÂÜ%à."ÂÊú`Pöú“½Ñ:’ „€4@j8à! kñNˆR}€9ëüJRL¤ @m´Rˆ•#, ~V¥±Jµ-Ò)8ÒoÁ íô ® ¯#(H¶:ëå˜þ72tëÍ›Å$(é˜#(rS¡‰Mèç3sÛ Îúm!-)M/°[.hõÛÌ*c%pêʶÃg=ËÙËÜH+#J&%ËZ9ÝšÁÅɺb œñkš—aÝ3¾`+°‹°3-úÔ¢àD†B8hn,¡l¢ Æ*FÜÏ»ô>˜#,s€±""wCHÉî=Y21zìשÒSÌ;ÏUÒU¬ÌÇ„(#+"`ØŸI¸Ï!â ¥sæ—#,î¹41:ˆn‚#(CA#(1Écq1lR#+0N0ðÀ8;ü2fÀÔÑlŒPXd‚YIh%#e‰B\#+§Ì5‹œ>‡§Y< B+SCQ¡!¡¢H7#+¬/öWyfŽŽÂ«š:˜cEžOîî:6} ¿}‚—ë0‰ˆe¥gó×#Ž•ª¿?DŸdŸGBš„>“-¨ØM=È8A”N£ýv$¬õ†‰4‘ 1lc¿Ž‰’R$€HA#(z#M ˆßgëÓnìnµ§Ýí¢p¢¤á(_AWs˜–C]ÁYºF9‡¤#,åS:þÓL ó}}Ô$ÕµÒsÕÞZò’››·.—MÚmET”§ÃåàiŽ»V»FQó¢åŒjDŠŒÙ·Ù\Ä2¤ÆÞ-׬yx?£zÖ#+ï÷UÄÅS¢Þ 2Ogô»ºM,Ù¼€=ZjcUeHDöTg¶•VÅ"D„aĦ6òÇÓmbvP…•H±"ùûýß^#+fè¡9óÄÀ‰î#+‘¡éÀG,-ʈÈÂ9 GJÓ— …±KC ’TJ­Q¯c`b ÄQŒ`šÝ§¶âÞpzåâ1C‘z¼è˜»Áû¼)Kcd±@†ÉQd»PF! IêK`ÿ=;cˆ)Ž± fFŒª’&T¾ø#(s²$ÑéH#(ã—­+¶ÆHyTwúo?f—<óé¤ Šã®tÂ8ΛÍãCk“.&’j#+Á„f ˜ÔI%œ¨T–#+ܲu:´ …ë†ð-íÐÍ-ç-1¡‡4J-ÿ BØÏÙ죬"$‡B…Í‚<‚#J°¹#QÔ»]o.Ý¢šRjÌÝ&ˆ„ˆB„)€ ól6bŽª÷*zÁƒ8)Cíïô¥é. °UÐv#(~^†@†]½bû‡t{üÈž5V±#,iƒ½ƒ‰´Æ#jFÚ%kÁÞ—RÃáœ)⟵<4Š»¬)¤±K©³•¤vÜ’Ã`\4³pÅo½—¸š8ð °~ã#(=RØÇ~É·T¦m;”#(}R¾ÂâúÇ%vr¤9CzÌ}›#+b]½T‘ÐI„dÙ5s\ÝݬÊå,JUßrxËý'}߀$’#ÂQJ€ÝS=l¡’YX–É  (EëuæzÞôJ]¾6QdP÷5Ĉ†ò¨R#,!‘#+¦â%évÀË|—fRìædÕ& 6H5Ä¥ˆŽ)²†èÉbœhÒs­ÒL»{;¤š @ÓJ8†õt|=þ ïhgjÂûhT`æ¼`¸t•õƒ#,6TùPV)R¦sn"ª® ÚY—*YddâC–CvkIû2ìÓ¦¢Ï†\Ò#(.$${L­ÓûlìÿÙ¶+p݈÷]nJ~ýrk#+Â_WúÎÐüˆI&gÁÇr ` 4Ç»”estÖbƒGu)âƒ#,¡Ò²f2i®ÂY³NØ:]`Ö\¸ÎGÄñ…ÆIŒýçëÂÆFNe;Jуžxs½.†€]ÀÐŽíéÄDìpæM‡.#+¡&¡‡lÒ¾)¶bDÄÞÈ8ÇœÐAÝË‹\±·ÀŽgÐ$oIKŸ£:uQ F{gW¤î^µÕl!Ôâ]j•“T6Ò1é÷ºÖ?m\5³KÁÎmACÒ#,Ë‘‚N0WIÔ2A:ÞbZÜrƒ\±c6d‡ ±?×ø2è\ìêñÛr-ô[†7ÔŒî,HmbáV#,‰%]€"‚’˜’Š P¶o-vΚ¦X´¥>¶½^oU®”(0"p-€l+p<«À°yì¦AOq#(,í#,؈¸û'gਲ਼¢q7ñ¡ó ³a–ì Ué²÷eï×~o#¨ù»dpì5Ï·Üæ¢*²Š¡È9jÑÖ'‘Ö Ù!Ö3Ç®…n WV6Ì]ä ¸#(Þ‘;‡ Gê‰Ýì 6ööû5C]üO#+3&¼ï;ÃñÎ&Ò"û_µ×dϽÍ=`±$<ꘞ,z¢@¦„B’’ôêôC2&ÚLšñ]㦮¼ï&óµÚ2Z›Y5µIZ(ÛK3uÔî+]Ø B¢%‰À`0°H…ÏùzÏYÞB‚Ùߊ&þ± ñ‚íEl ¸"TßRQM4„#(_Ô ^Ưùü&!j2À)˜¬³ê%jêcHm¡1 mjA‰¤DÜpõ?_XSnïm묬nè¸Zbðc Ã1&* S$UãhÒñª5k–<¼v×K|ªî±À´””©‡)0À¦Ý[1Te¶ÊRåçcc³L÷´^mוÒF1^”\âÈ“ƒg.X´œ²˜±*Áé„k[M;m£™YFMBeâ˜iâm¶Þ4›dl5 ã #k%§¢œ5‚_͵h¡µ·£bW9X†wnÑ#(„i»›tr#‡bPy1 Ûf#…FY¹F{À÷@^'õßT¨w”ÏÎä#ªT [l­ˆî*‚*- $2#(Ïs)äæó¬7JÐ.þ`r ÄO§ÕmKÌî¶_ÏŸ·öx³ëhãòœ³]a{qf¯ù®3mV"ÂÊ&l¦6»ʈ{èJ¼XÐ ¤‚H á{â–`0RÊ(ÖJÙ&Z6-&¬È#(ˆž¸§”Jcx-ˆ@²ªÉù½çvñE^+r)wW5N¨‡ßâQ‹‡"—õñk¨Øõܲ”\ßØÚ¦ ·ŸPrá½QBŽ®ëY«QùÍ£‘Jqë9ó;b{§2ÇË,±ÐT SéÒ}ë\ýLÌSµ \\Ë:–©ð›z¨óÆ!V³þKmª°18Á#+ý‹£Kµ³CÆc†Xi)ßɯb&©bUeK¡{\Y‹«ãÃ^áÓ==çG†ÜßraX âl©iKì³äj°‘ÌÌìÕåŠL^Ù—\qŽ68DX™2mñ‰õëч1‹Åê¬ÞBðì&Ú)a°5Ì¡qr“i™‘ Pf^k¾ïÝWᙂÚ)–‰#( Ž÷æRùK½¾­±n|ͤîòÇc}íºþDnv£Ïoµ]†N‘vò;5´2;}I?àìM}):wkT9ﯪ‡Š/v“]½g‡§¼óóQ]Û•_Qæ(¯Ã;!p7ð=~}Ãá#(铽Ì*§˜ˆe X©¡¥„1^`v®MãL›ùƒO“Ú˜Äá®=92(\Ð;®¬ã¶8nQT1,.¬Z˜¨Vr&Žo@éô¤Y>t+4ØÑߧ²a OLV D/¢¿ÖhT°ŠE|žFݬʇu'+Ê—³Ÿ€‡2Ù5l}$uA˜ÐXÖš›âD¢PŸš*[Z!¡´ÜÿÍ·]£<&{ºÉx«pÓ’øÄöb;åùf‚±Œ>#+øöú¦¹6—¥§¸€‹TwžxV5Ý×O]u·é®™,™ª%±VHˆ…! –‚.je?o~ÒŒ[³†¨(p ¨| bŽP5ƒ;%Áþ÷ßMû,´ e ÙBi¸çQºÚ,EÄÐb¥aUhƒÆK%b*,IƒèÓh€ŠGLT”\#,iŠ£LPof!H%Œ!¼»#(*H™>ñ¸2L2)2DØgJ¸Þl4½t<øäy§l.ugÖw|aÞOyÝ8ob}%yÀˆÁAeÒ ¢íüçSz6&þ3½*§9Kq%6ñB>ÀîñGçé㻫«#+Ӄ켻ÖO(ày #,ù“ÂQ+¶ŒØW–-#Ã|ûÕ^S˃#+a4ø7‘¶=¥¡Ñ2‚´•µ·JÍ1ÃP ©h§bš˜0Æbr7Æfcyœ1/#+Ä6 bÒ“4ôÝ:)¦âUµÝò‘$˜¢¥¿N-‰Þ Ý{ š]G[LÄõJ7š]ªµ›Z’Þµß2>ƒÚ[>¸‘XHšë³XÏYÛ±Uv!àŽ=bx‹ÙÐØ¡,§—»ç¸$A¼ÇKÂ0#+>"DÐÔÝØKñ}Ы‚Ñ*×N¾G<»VC¹Þ»Ì'Š“µ±šã¶®¹®íÍuºÝÚ®Óm)ZåmÝ]ªêM’m­šV«ªØÑr#++ºñy›Ë»eo5UòæÍŠSTÛUEQS¶Î‡ª„íª›{#,è|»³…+M{#,PS†nœ­ÔÎk.Ea„ä¢9kã@°)&øö_Rn›jÙ0Î|y^U´È¤#(#+ûPenï‘Þ1˹9­zÎ9†PÀ+ÄŸ7|«õÿðþæú¬ÑüH)bqTkƒ›alaÒùÞ\s½H!áùøRZ¤(MÊ:e­bK䢨ˆ#mklL/H~sYZKÙ•`ú¶ÌÌ5¯Ít=j\‘¶òh6#(Ô  ö-λ@8…0Þ¢ÀôÁ3ò“¡Ã–ÚʼnDŠXYàý#+Ô†4¶A‰ƒÝ½¾s¡ßV¢ÙŒ¢sòVC5iÎPRn„¾MN6ÇÔeé2F#(ì>¯{_dâžÖ>%T@ÆqÈPDþÏÝÖwÁúí$’óf£@™–øÙ“íÝ×W³ Å·ÊöÄ䈘Ž#+ãq›ª dÔxkf¤¤žaƒ¸,Êð@2/]A„kí³hZ#+¢rœ™«3#+ãù˜Œ"0ð3¹zt¶Ûì錢cK#,eИl %&ò#+¨²ï.’LÂðüóhØiß© ?)­ªHØ™èÃJ_íoYÏYýŒ!úæKýžî,—B(¤`;¶lTÁIñÌ(Ge3=3ÐuóÈïTÄ„¹ÛèÞ &cÌKt7E?ñØ#(“FÈ„a§õÖš·=ÜT®¥°;8ÑÇð}ØÒf!±L#rMï¦ü¬áž—wœã‘î Z‹#(Á ²EÈ_Ç ­¶}T ?ÃãÛ•±M‘r4zc÷s$=œÍØþÖíáÆfèéIHÖ3Ù†ê¾à2ö'j¥ ‰úøŸ¶Ç‡žçÝË?ˆ† þBDb0Í !O­)4Ç}Á©îè¦`Ž±OâH¢9lð#+÷0È(H<ëks[§ÛZ/FÕ­UEµ±X¶ÛÀb¬–Ѭ–*£V›UKVñlTQdR¢#,îbe.AÜ\ÔÌÿÛVø¸+À,#,ŒL B£,´…LÄ‚£²#, #dÈT61¦“(A I!ìîÜn;o»3>*m #(àÈ0Ìâø˜ž£9'…}'jºêˆdÆR#(i#(wér‰ñÍ÷ï3Ðuc‘€LÿM[iŠ~G]ÙX¸Ö^ܨ#(¾ˆø¥ä60!°%u°_›Ï /?nš4›¦H2I#+ÐáyáÓ4d™Mt7šŸŠ½„¢*Ñû¼Sê3DÙ7žq¯ÙóP(HÃSب>Íù‡¼U7hVJ„äPq0!Þ•à7ßSÃÃ4ðF®âû5£dJŸ„ddtý”ºBÐ7”îÝ•ô·LhfÀ’ÞtÅã×b×Ô¤j”=4=•¸¨ wÄ0Ì´!¶ÛVb£59C~Ø>–ç(‘J@6MšÝ¥þZÞºé‚P˜7õð’\Ü¿`{¹ÉêHA[Cý;ìjê3"'Æ •„R°4µ×%UQUG#(Ê9^•M”#,űêk¦ pÒgc‚\ÙAQu½.Xh‡V$÷&ºT†[º` q ”!¢7Z,)žp‘6Ü Ò¢ŒWc™#þ¶è”‹qX¢+e `£qFã¨6¹€E£»§e¯”Ìä ¤pPc€ÈÎ!¼1#$Ù•R ¢«T.¯$û½þ-¾{±^~¾óÝ#Yæ`ĈÈUu8®çuݽ_J#,c&Öø“b_;>èÖa{²æ(ëôCöüö™õî­•;ejAt-9X/j—°Zs•0–ZfB¦U.@œ‘*6‚«’䌄å.l6áÌ9¥ýÇ«”{=¬ÖwòвÐ#+É=Óò »%½`=@’é¯áǾèÑÿ†ôõÎ퇟áóðú‚÷Ú:(ÇÄJ1ϤßË3D'½>Itvû¶Dº=‡c¤¬ÜËý•RÜ«¾@Ë–ÐQQ5ªkVlÓZ4fD…2’ª…‹@ó3hºÐS6CF=è89§lÜR(ß‘#+Vo¢i°xÑ@UÉ5iPLBl®²¥-«›¥›ò«´mLfÛCE£Jòjê5îëßך®è—bãI¢Ãw؆8B!“%—b1‘p”`24K‚Ùë¥å\Îv”ÒȆ—8éyå£eX:6Í™£Bi„ v•»‘ìB²DŽa„Ð7©"­÷≘o<›øKHŽ8à7IúêгI*TEDdDt«•åÝ{uË6J´¥^:LŒõºë%*B”ZW|žw—nÃÔ®ÙíÙzñD¶XÓÖr˜cQ0%f‚X^ãlÉD¤‘ˆ ¨ƒ8»±ÆU&+V\óof¼ñ®¬°EšÌÈÖ@4¬‘©m”´°™EF-&ÓfIÍ6›–XƳ2“#[)Yzî¯.ÖóΚžw.Zwfƒnºå·4êíðžž-ëzë¼¹wk”*Z…1¼ë­ïë½·®3aM4ÍKÍè!K ÷J ‚*ll4Gèxrq5°€Ð<6ÍÉŒƒQ1G#+Z¸ÉCPØF'BJ¢âCAŠdœ ÍœM‹ø¾ÄÝ#(ó?Fþ‡MŒ¦˜G±4’Y˜“]ÓÆÂûX¹æOKÛ§O 6[bé †8UÚ¶am˜¢ÝÑY {YCC½ª!ºã`V Y¡¬P‰ Ö’¤q•›âbå=S܄Ħéw­H`“¹Î3HW£eXiPÑpŠ¸ ävÅIA÷=MC§P8'#+ávûs×î½Pέp¹ÎZi ¹,8Bâñ˜Š}x C ZEáI›8k†ƒlï£a8‰8T­Âƨ3-né2-kAéV=2ãT2!˜@ðBèSb„Ȉ‹#,%$T¨©"Ø3¢‘I#(¹b”bÜ)¸D„ƘÖ˜ƒØè0c¤*ÛË#,‹JšË-æºfÛ]åæÇT²ZÅ2IBGΊ15ævvûIÝ Ž0úZX ¤ J`'9 5×S—Ñøq—Ó°â’“ºýŽäˆºýîT:çR…pt6ê®Z?(ˆˆò1”,A+%?/Ñ5×@ÐÚûoŠ=}­(É£ûV# ˆ(ˆÝU5"ÕE«H]•U)×ÆÞ±Už¦MZkðŽ[êl¶á¨b–ZÛ»©¬Äì\8ü\¯!“èày³O55u†dlx^ŒÊä«e£á§Saà¼úhyh¨Ž°V‡•ŸÞû›º7-ç3’C˜s3â³´nËÊ«®¸ØÛ„˜F4ã;Ž+Ü«§C†ldërëFv“¤ÕäàmEQTd¹’»´[I#(åé›]k‘¶=꫸œ¼èp_Í>û™ßÛâ`ˆr9~¢t£u—ºœ, ³·ß[†ðÜ6¸Ábn- ˜_‰¸Zià£tÂ=I¤ÞXð’Wá–â~¦¯c¹»^ù‘œ¡îçUuϼ¥Ra¶=žØÆË†ÙË\TiH¥–D†ç|+†û.~œÔŒwѤt…‰]äoê¿ËºÞ‚CéqœìÔÖå§C>%°àYNÚÃòÛWU)-‡âúCä—°#í4Íõ·¨>±~£ìqq@Û"k¦×UóëFýlUK{©”XÅ¡ÀŠD²-‘>ø¨›[#(û)UK—@8À3.( p9"ÊH9#d¤49Z£©Kh@FZˆ€Z¤B@/S¦Úñë»Elmy×.šº¶ø¶¹å)çkÒÔSÂîå™bÒ-#*UÎ;¶îê±µ¦¨¡oJÕâÛɵ¤ÜÚÝ«¯<ÞLkm¶ñZ**õkò*àÅ…2‡Ý³WÜÓu…õºØW!j–—ï»X¯ •‹Ñ÷¤ÌÃ/¢ê¶VÚ¹¦K­·eU+ukÆžù ‘…ÐEn-!àÆË#+Èid.”‚°-I#,†d,c , Äè…’Ô'¾oÙ– æÉ©WKµe]«Ù­b£Z”Úl•‘¾¥ÕLŠl¢¬4fi¦£j-E£S1±¢£j*ŠÙ›A£F4Ëi5%¦P&LKRňÕJZ@ÒÇÛëv¦ÊÖj½ Q#Ò¡#(¡„C‰õe…CíÈÈ>Ï´™#,òïšÕµê¼Á¤ÚÑh¢¨¨#,B\ŸyáÇKù{°|=õÙ&+åõ\³öûµ³7аõ‡‹9QÓÕÝîèHl¶óuž°#(Tƒ ‹çE‘$,Óhµ%¦V±«_Cšú7®¡e±kGà›oºÚÛ†ÖÉ~§WPZ4׬ê*-³»²ë«wh¦¶ÜÑQµj)-¹nnUr»«µ67gVÕ5¬¯]»4Á$#,R-4{¬ÿ¶C4äoÊÎDX:j@üºáí}òT€4†¢DÕ#(0bI"‚‰Ä†¥„‹òN9"¦! H$Š#,zØ4ìXÈ­*¨X£‰ãÙÔ¥·%*bƒ]óÔ‰#(€F*f\?#,gQââ2VÄ&³Úü$#,~‹µ>¡Øûyµî›}"HCÛƒqsn*²>ó„ÿz{á#,°%›b4ØÓh^ýG@HúŽ=D$ºéýmuâ,ÛŒö¥o&3Ÿ}–8ØÆ2»™&› ‚F5X‘qH² Ú†›£‚M0Ì‘çäÛèåpÅ<#,!F$IÁàqKþë{ǧ—‹ØBkÓÂc`yMèdÍY:lø «$Lã U;«LXò ÖÈrOÀ®’ìl¾Ž÷ƒxÑá4)‹2fÃg4ƒ7Èç@9íɵ§e>f¡-®Ù\ñ–dÑœ; ÑÆŽ×D´V#aƒÂ<I&Ô: iN„`™/#,‘`“ Iû—™D‘Œ#(í zÜåÈ¿=B±±Øn¼¬‡bŽÕ6N6[?^6ßãCý R›£$Œœ4TÎ¥T™ÓX ñƒ rkÄÊŠ=O˜…įxj ‡ÓYKcIV´[F©-¾J}†µpý")(¨T¤¤(aBÞˆ|I®j"+¤TnMb¨X„Ä ‘d$P¨ –#,-ÃÒØÀþÕr´ý(' åÝT\gÕH(‡êi/Ž«8úR¡"õ~æL8ú/5€", b#(‰¶iÓg·FŶÅ•k¥µh…ˆ€‡(å°@Á"´Eqûˆ†Ô–ƒ3GSå88›Qì ®Š^Ë[(Žò@’"+AˆÙ+V¿QGšÅòûÙ*¼îÕÁOuÞ*ê‘m7-ÞNÝݾÓg®x»ÉkÆkÅ2Ù6 FH!9 3yt¼\b#Œ¨ØZˆ£)1a @ËU@Î.ÅLÕ°«j„´%AÍÑk¸,¢Iˆ€Ái¶0¡(#,¤¢‚Ô*#(‚e©¡ˆT”E(#,âRRk#("Ââ–ñƒ*Ã÷â@DY¡#(–‚ˆA¡t g…õÛgw(êC[AdHÄH°&¼.ÒXYmÉýþ/IP¼b$) ÒÏs¢ýGç$ûØv¶ƒ SŸiÀmµ¤ÆxÏN¥‹¶6`îÆí¦éét™!ÒÉCœc–ÒZûõùqφˆ (›¥*-µQj×Þ¼&#(1#({;„º‚áB(—_GËÀn•˜ýÁ÷Óá-h>Dü¨ÖèÔý½x·ÿ =©z“ #+>øšFçÜÊßâÓD7›h$øÿr€^gYû2pHkTQK*˜wÕtÅ¥›YÇå­#,p~—zXÙÈ1øHãËe«§Ö|Ý›ö©›9bñ;})Ã]Ž“^#+ÐëeÜ-—/’F"‹Ûi`èxf ŠÉ»íQpà8ŽŽ;dõÂ#+éÃtUñ‰‰TŦ“gÐQàisç#(†¾|I‡¾‹#5»â£ ÷:± ‰¤w5X(#+`ÔB€Ç#(™\»¢Fù–&cªR–lñ!À½ r$ˆ+HDS'Ÿž[/Ž½ï#(ÐhÉ´b½^®ßÍsl,¯ôýÄEcL   €, ¤Âòæ,Üy:·wmOœ€°#,ŽÞ©@´f ç±+Þh¡êŸÆ÷5PÌÌõ()ÓšÙN)ê½>Gð|¶Ö@Õá QZ)€N”Fªîµ-ÕÝŒÕöuÖõÚª×QBïstñ$D¨¥#,P $P!.ðDÆ|¿†Ïׂ#¶^ %n«º®;kdS+;5®Ì~…<—QŠ’t?‹ŒŸ&,‹ †5»ƒW]\º2æÕÃJ:îñy#+‰J2ò»R%fË"i$l%J–£Å«´ªM(¦l`Þ7ÁH6é\Û›¸î¼æ^Mq×]²‹ •ÝÛ¥æñoJ¤æ–[ÉæmÕ˹¬Ë»ÍTÚÑ‘çj·7-tÕ²mR–5ºÆ›2ÉdñXîÓšº»3¦¹"šÉœáʺ¥Î²ÑhÑÊ´Zí¥W(¶éUuûß+Ê 7·|â¢c#,ª{Û#(¸äS¶¨fäJA#+ ƒÝ¿ÙŸlœÞÇ®#b#(x#ý¾ ãñT H¥ A¨B(§2ºÒÈÝ@Nö"\ćæPó’v¹€¾ªsŸP8ˆØ·ä»Võ¯¦$˜†”P‰J6–Ä1 bÕõþó›ï~$ó þû›KVßÆÖÌO¦#(í½Þ"“óСAû>[ÓöûöøˆQÂ)Ü|Aº€TŒFF£UFYšß[jÖ¯WAQdïªU$UHEª ?ò”?Ë DŒT3Ÿ.–Ad“V+V…- µ’š½æ¿Bü­ëåºÆ¿?j©Í¤SãâíÉgµ…#,âãÉU‘ 1D,$H˜¨M… ÙB–G2„@(DƤ¢g´!»’Ù­ô4}£@b\°Œ¶#,±ƒ,ñ‰‰<ãvöî“xºRE’®\6uvå«à­&ÕµòöºåĬÄ@•&"H ±šS›kÓšH£\½;6µz›W©¯*„¦)x °#``1fȶaê>üË r`ZQ³"@$S,§yÏM™6R­ #(5 Æä#+uJ*Ú—½þV·ÛÌ#+‚j§Ô€¼­²ÅƒÛCfKTÿ¨ùxÃb”TÆDa#b”C/#,‚o?“ã5>5lx‡peÕÏ‚Z/%#(ðTUQ´¶¦Ö£RÍ‚ÙjkiSZšªRËKè¶Ü0rOaåµSqâA@ƒ±Gj¬#(„6Jk6M,Ù1f©ƒ5cmS6¬²¬&Uhµçßßv½g©Œbu!¹@ò>¨mÉd D ´ÌLÖ×îí©™­#+šklÁ BàŠ©þ¨:dmµ3Êž­iv{ Œ9ÁO¼ÀmÁqME›¿È›ïaÞJ€¨ÂÕ#,r™G§ÛáŒlr„å<ÆN<ýÚîÕýØú×ó²0Oh3>d½ïÓÝ_ªû%Ü@—CC-å12ÌGêSOcc“*Ç‘@«ÁP‚éw¶5 .²å3Σ»aMÒa¢)÷Ú-gZ•|>wêѧxçt'X"3Z•–’KYÃN3¶KéTl™±‹1#,÷†ÁäC8êÈO¢RI;ÌèüqH~Ñ*wñ‚ƒC×rÖæe4ù¡vJBa‘0ª¨m’+E @‰`§ò\(D)j#(¸’……F-ˆÈGI0È[L†Rí¬›Ow‹Êé[–ºI«š½Þi&ÒÖâ+5!*"•ªƒ¯X%±#(ÐV†MA1.Í’àƒLa¸Þñ]mãETxû+WŒ^•r¤Ú´3(—Š‹b C&€%©;ßll”:„ñd $‘ÍA™»w½V4 Å|\YÌN_ŒéPîÊ«F  C$®В 0&©%04`œ&)/D€Æ†é7’¾ynñùÑ™3GH@ÕlA£J©Ì‹ZIîÞY#,""†tµm zi°¡‘= Ý@2ä.ÔÉ´¨2Å_*nH#" "•€”`\2ð€X˦UFá&dW((¼ {óL↦̓?v`j»KY8pà‚!p¡÷#,þ4ƒPýcÇ´¥EÊÃ)P=Åc‘ß±Ö~ÂÒ¤Áh€#)P¬']7jLT„u¤( 4…R…Є ¥¬iãë§kï ?—ØôVýâù·èµµ}˜VÒ3!_M¦¬qëïçE,*+)i#(‚ÅQ‰‰Pª±C¬"‚oŠ!œµQ"@í$ÄM„…,E¨ d Ù[vݨ’¾ÛÍóf™­·Y*hŠ— §jnð)ç|#(.'©:ÜaAbŸ2ŸîŠ"mfgÒþ¤+è\“J7º¡¸Ü’’R6&-¢›VâqœYM#^ÙWÒÃA²´r5ôŽÈ±‹”ƒ7h¤Û•¹µnë iCι6ÞE,™#2@! $i…u‹ƒBV*ò¶Ü’R¼À¶,ýÓm6/ñز,Å\aNîÒ8×sèë”j V^U[m…{¥0µÅÏê;4¼×Œ^ša°Ñ!Ša÷‘ò)OMCq¡Ür#+ÇHT÷èÙ¨Üqó7Z×±@Ÿ²¨Â€_÷El›Ž®(=ÕB„úæµkTUbêk[O:Ý–Õ©¿+«KðÓZ¹«_n—-÷é]Né “¡sJlÏç€8·à=‘09…UÏ«‡¢ÀgÞzIÿé‰Ðé©ÉáÏÄOôtüéÿVgŠ}ý~®”É¢#+!`©MR}`}‘@V{w¾*9‚‹«ö ‚ä?wï5¯Ÿ·úƒúßðq£ß30x@×ÎZ˜ºóNZ”üC%DU#+‚Ïw Ì­²á¦¸âËÎ53f±™2j#F†¾v4 g,Fͯ¥^Æäl†‰PEGmŠpfêwN?CEld3™Ú Q«qt#+¦ID2i‹§:–[£WœBTzÃd‡Þ΃ƒ§AÜÜЦtÌ9g¨v«N Ù¸ >òhoôHêCFiÕFm´7Âì#•!l×[‰ËZ<¢#(k€¨×*+e?DÌ¡û'šy¢'#¦‡N<ŽœÚ†-)#+ ÅTñ7íCô~•·Ã>€û©LÕÆJ¨ÈÆ@¡Š,†ˆ|ÐÓƒýÿ§´ëôp¯Ða«zqÁª– ôQ#Ÿ„½±ÓÒå)ψœcœýLñŒ <æeöŒ„“ÃðìŽVêîƒX5RÂqÞþxKTÜfÕßIÔ·Ãñ§l=rИ¦<ÄYfõ¿ [B÷ìó×Càhy²¤4ýžLì8Q®@` ÀF ÔbÆš#,"zô®™ò=/;·wsx¹³ÒH‰™m'¤!¡´‘†ÃVß7Æ&Ãe‹EàÅ[“6 èw¦ÐSr}ïÊ—Y9¤™ôËéxõ¹îÙ’3¶øÄaZ|a8£h«Óë-0ŠÞX…Šâd÷Ô´ïgZy¥ïþ—­<Û6q&æÐìkv¾Py, y+bŸ#,CXºú2ƒxM˜Úsߧ†íŠ0#+¶Øo5Óxßˬ®¤< ownÒð(¿³pDÖƒ–Î`‚0DiivfT–¦ñ#rf_FB{¡‹ZJ”=L Ç«ì‰0Æp†ÏJ„ýæ!Þ[?Œ’f]ÕN©ãÏ´`rŽ…;w R‰Õ¸M@ƒ§2¢ 4P9C‹bÈ`R?›#"!0­î`¤2àP¥Î#,ëßÔyið<™\ëôÕ{Ö£z?¼©B4‡O³ùúŒÈ80;¸uð_gofýtÍZw®]¨\³‚¬µ¹ûóq‚üƼŽ{–2‘(ô7&ˆn€uëI((]Þ!gtBDaniÿI»›ÒþK*åžó±GuN:4°õœ¦… £ÈF‡À;Iþ/GbÅÊEåzàLoTÉØ­0š3‰¥S¡À†ç!ZŽŸ¡Þ&.è¾'Ÿ]´=£ž•È5ËÓ„¤VÙ>~ê}ð#,f EbŠ’¦ÚH:‡ 3¼øêv&¢íqì"ää\_¼ñ£±7ߪÿ®¬~îýqÙYEu¦¹¾Ú²é[qÜwøðÆfB¶ËciºË&2?·z«.ÏÉêWãjäÏu××vr*æìLŸÁðkŸDäjI[$“[Ö«ù¾y‹|Pkòb\-úKÅãžž-«ÎçvŠ«›Ô²iFƒ+A¿׊päˆYdˆh®WI$#+o8yØhÙœh¯1ûSè9"ž©ðwŠ±#+µËš¡E܉e•Kf¢ÔÂrÕHá)ÅbfóSoF_åiÈóºë©ñxþ§ºzÌ=—4g½Óº¼*’Ø‘‘Uî*P˜£Dñ®}Œ²·Ìb};J¦žp¢jÎF#(J®W,´‚¢a"#,¾%µÎ¾[Ñ£¾L¡½ŠFÆ7•$æÂøT”¹”©^ØpÁfÙ ±\û÷´P#3"£œW8Þ H¦ µ$ »J"Š‚1˜ÞÍ’ºv|wÉjj:çX±ç\1fŸ#,•ƒâ`ÒyÙJwÏ[ߧH–*¨*0ê*L´ÜÃ8ÂË ç~f3lÓ#y Ò3¹ÔVÆŽ5\;Ì”õöõ>sÇjÆõQ’‚0#,ô׈å8ª ÔÌZþdƳ¿ÊY3 Ч©[jEmpIÛsæªtãžXhª§”i­èB(T/Ë0È õ#{CîÞ”R«Â{º|û+9áììÛ#,˜I¸ôÿ˜>^]þ!Ó:\É»´yŠ§Ëò#(}¸Ð#+Þ0†cP‡?Ýæùd¼ÕOyP ½<þ”pÁ‰‘ˆˆ")â‰ä‘#(Ô¿Ù#+AOðŠÀ.ùR@ ADˆ"²‡~ò÷´ÚH¸~|9äTmx*õž´Èff´žÌ²³py=ÐIáO& uzƒê„{²ùŸ$ï—P¬öjÚq2;/™nŠ:Ó«˜ñ]3 1DU!„O *‘#,ˆR S@òèk 뇅¶0¯#+×=Äš\‹;„`ý©˜¿0ðJÞ¤”´!bŸÑ X[ñç-Â@qE˜¸×Ó×ú_ÓðfVREí§ðÆ‹Ò ’X>¤¶[µÒ¡âN¼¸û¡¤ BPŒ¦HŽŒAl€j;ù'ÚÙÄù^Âd@;û|餧òœ hî¶,x{¨0ÌRˆCÙ%øÅÁELͨi‚KPfÃä©{¥;¹nÈÐƾQA‘s›8T#+0Ìú°ë_V¥GÊHvá^ì>&mR²?=¸*2å؇¨ýxÀòœ¾µ÷g›þLb{¹öÛûŸïëÎü»H ³=4‡´ÅÜ«÷¨Vˆž„gÕéÈ›#Òx½×l#+ΔímAU›P6zE™xšÝ@º –2A'2Ñ&ÍË©\)ñÂW¤Æ$5Á †}×üïÑß;Ðt¡_w!(6¿þÁùÚ?¿ÏÇ>¼ÈHH d_®*˜Üg)$s"_N]bSÉ×~‘Ý7¬e—hB`éÓ‚yÖy6x$–ùÑíÔ¢Ôƒ$"yÏ‚ü<ª$rð󤶕"£;>w 0üu„…«a"KFf¼=üª›qð»AfaÆuÚ‚‡#iµ’xüOÍàˆà¡$ƒ³Ô4[¤]° ×ào±Ü³ë®”˜ü[j§zî±6&¨„ 4¡¡½˜®ª2U’m²¥žÙ(K"!³®Š$ŒcgéË¢IÚpðÝ—èxĨÈ.‡ÜŒFù‰Ð}o26ŒÊ2¤ˆ£0h ”Ú&&¢)1 1£(ÄFšTŒ”M#,L›6IDXÅH~‰9q}Ùâ É³'€ªø²}iþ pøéŸçyp`á8Í°‡^8\*tÃ)°á¦5œ,|³J^9ÈÄ#(qnÌÏô’5ö™¶º¯ÓÃTéÃ÷ •C¡¶¡Æ"÷NsËïŽD>Ñãêi0ìÈѺ5ÇW#èúãw­+yž^Ú0È/Ž&(i ¢–(áÿiWû…$3QæN,xÊÂñmamtÒoU9|ÝQIéºP¸†H÷ìZ ¸8¤Ø8š»oIóª]¤ÔWØ0d„D6èsÉ…Ý$ßd—•|Ô#(ø#,#('4>³§Ýê¨fèÎ[‰‘À ËõWäÃ/2oŠmïIfÚ0²4BH˜ÄôöÆÛÀçŠRH~ØFÌ™?'ù¿ÞÚG~憚N鳺S3ˆ#+UE"*ÊÍÝíasö"¢Ö[©Œ”¥m¦œbŽ$²FPȨ(ÀP!F.±ZdS ×rjîêšåÕ\³ºç.¥r¶í9—7WZéíyÞC[2’R‹d"²fÑŒ¼XVÄ*`µL1ŒAXa(9™ $1šQ@¼P´[pƒJ"¥Ð0¤‡¾£n 4Â0Á¸U©#(QªÏÞxËRF‹Z5“R[Jmâ®\ºW,î²î­¶Ü¯_~zÑìÔ«iO"­!DÛm¯L[6aR¶qB#Bl@LVUÀ\ÍPe)¶©”(Š*¶Õ¤¥®#,!²‘¡z[y!"Dnž[W¬S[×^³Ël´mҦλ]Nï0ä¦Öâ!à ¨&š€Ù !! É$Pe±¢ÚDäNÑi’Bb Œ4¡¦65ƒiBH”2Ä*Òu‰èmÚ¢£i‰AYmì(WX(Z—)-Â6Ø:ëx„fØE\ZlLQA¤7TŠ7"B¡\•¨â¬aamn!´Üj’¡²¼ÂUF¡iŽ#,I…V#+*0Á°hΙ+ÀnÞ“yܸæ&£C»Ý7´CW{DÑwq,¥ ™VCP‚‘IÁ!@™ík-³2d[Wz=ìc£9|:ÎN#¹›ì´È*‰ƒK#+:0±(VàRK9JV#,ñ:Û1 Ó+ˆ–ÜɉBÀ”v™K)CcjVª››Ýš&ƒy‰UDã=Þ8 #«·”ƒÏm¬ÖRX˜º ¢ÁÒ6vq4cÆV‰ÑZà:â,ÑCy#+kŠá†Z€Æ20£À•­¨²x»ƒ41Í8*0eFÇCÉ ûé.µUxdt eV™VéÌT`ô‚‘”iÂÙ:8}9A6%ä£#.‰QÌÀc­b;# a#(m ¢pi`KCIƨÀÓLA4¨¶P¦h´Ú²*–4-$2"%D’bª-E ¶‘(ζh†"‚&©(&qëü@0{0F Z,Ô)˜ˆN–±”ÊÚ­!ÄJ`nÒgi#,J`«j2$Ê (e²2i¥e  ¢½-¹®Y–õçm^5—rL°£BºdIØ‚ P`´Ñ½A#¿EP![/×nf¥ÀiðfE_)›x±M*±(‹q3€È6b1%-¡¥–8áfñJ6ñÆ‘¨(.ø´frÊF7k¡t¨ÇJ7° Äi± Ü fž&zðÕ:MÍ…Aƒ5†C‘£Ñ#,U…ZÌ{™DÅ]œÆàÖé†È”|E¼­jÈ Q![çÐa‚[bC3•ƒ¹9¾·Y·‰aBÒtŠŒ8k¦‘Å8ôèÐt6[vÝ#(ÆèŒ5ÄUHFO$†ÃÆš|4rÌr{} 5ÔÎVV(ˆµe°FÓ"&˜ÒíAE h2"ž1iŽ”dDÀ%šT¥\T’ a°¹c%#(˜\CE‘®”‹d )bƒ$,ˆ·VÃBX…6*äQˆ@†CD(‰1bÜÀ€² %‰¡3Œ'å#+àÈ ûÜö)H£T.²mÌ[¼;†îíâ~·åÓ£%‹w®®–ý¿\OW#½w™0jê‘E€ -yp6'ðDd(¶Ø¡jlÚfË&M[渌¨!eü•€¥?xàÏZoÝ45æ$`’!#+Š-âî”yþÎ]™A  *@¡€H$ŠH°>yÀ¾ýžJ1öĺ{;îòýˆþc·?0åÆßäùz;Ø ÷é$Žÿ&âW³à§d¶°Ûà ·aP˜õ¬#,¨ÁbÌ°2¶!™Fa¨'Ü´£¶‡*œ½/€—É…lŒ+_>²æ&ìøÕv¾hòÎs¤ã`j+›ÆÁCÆ`«÷ÕG“®{Š>ÓÞ ÄD'\íÜdÉ6î»cfE±­Ii”“eÄd+ËïO;LÝ5’NV­Áç!SÍ­×eåå[D›¦°#+SIdÒ‘B ŽYÍVËè¢CX; èjü#,©QÃDw†ý÷-7y”=Ш¨`84•ç|xœ8š§@¡ƒž$”"ÌÐgDTÈ>uB ¦¬QD¦P:S6)ÚÇBTUT×vYujèè_²œµ“º›QËEÈØ÷Ý9î‡(Y­¡£LÞ™)–½òø÷0=òîêë®îd‰ 6ÚŒ#+´ŽPmíH%Q¶•Yð°—†# ×2ä98tcw)–ye#(Ç·í, J§f{·[¤b„]É”\Qœ#,%r4ta‡ g.ê/q!‰¥ÈÝVÞká¿*û<]Ñ+äîq§Ñ 8JvJØe‰D@ºÃR_ ­ãˆ&®j© 0%ÛQa?&³ÈßçHœŽ¤LÜر@X’!„Ñ_*¢a*¨Ôß?U®T—*Ý"ÝÛqi{~ß¼±¬XÙ6ö–¹­¤ÕE{6µØ›r»»U~¬µÂ·‹h­c‘\Û]Ýt­·KTPmŠ¹µ&ÖåRmÊå[rÚw{µÈ±«&Ô£[År¼E²5A!ýÜ$ÑGz\»°âLr¯éú, ŒÊצ1“˜“]ß*¹ÙW;óöÄ„Hr÷­Œ{+´‹c:è`…D"‡(€}ÌPl@Ô¨¥T¡ðGúp9‘%ÂüyÕuàNaë5Þ aâÕOºÐùB‡Ð öpý#(¯ó@8E"©¹~‰ü´’ÇÞC0œ‡_æØ¥jª4¡FÊiÈ#,C@ÄX–‹)<;åáȈǵ»4µÜmºîãµÒk:îê¾ÿá®÷P€X%Ô`bäƒa25DL1EBDDY!Z†Ñm]JlKiµ¾ßÍUè×ÀŠ… —opê*©xD€ªõÅ eKd¶Éµ²jÓú|ϸDᢨêSüŠ#(þ¨¯ìˆ|=0=WÐCV3_NC`#S*FÒGÕ‚&W•=e¥KÚÒƒ¯€§H’—ŠŠ‹ vLÉýGrŸì ¤‚H1" ÷{#+ÉYŽä€ „:ò+óTÒ‡¡ïرlT¨’ȉ”OK>ˆ¡`ùÀ¬l2¬­!&É4•DÃAc–HËF“cf†Ô”Z‰•Š°k$¤ÓE³-‘©µXª-lUh­©FÚkD•J,jeM¢Ö‹ci5²ÛÏW¯Ãã&D‚±×³"0ˆ#Èñ ªäoÓ”Ã(Úci¶ÆåYHd¯$sRuã£Ò®ËË×M·•qç L G”HÈ2¨•[h«­»·=y\ž]»½U×”—‹‚±&Êàã,–h‘#, Q°vVöUì²J{Tu®T›6ÝwZºæÝnb¦›hÕÚm­šµQ@FAH#,×i€`Q|‘P‘ªÍ"Ú4–¹®©i³gîuðò½µí[n¬Ôm¢µƒ µ}þÚñ*xÒèÛ¦¦îéÝ”n'Z_]én¯NSkxÔP0€„’Yš’Жž`uÄ,H»©¢@j*»‘…Aƒ, ¶›>í#+! ©‘ç*§ÞP¸Pš;l?Sta9ˆûúÓH@O)Ÿœ#2“}üÚÈäÚ-vwRži¡-¡¢3ro%D)¤äý>ûÍ^ººf>#ØÒ?o3aµàe0d0ÃÎêCBnªÿ¬|“šw¡â©¦£Ö‘:èhÍtØÜ»]Ýâó5ævî®·›.¥Jy–•ÜÝ•qnœÕrGw[¦—鮣mmäÄbI"ÜÚ®j×-TZ-­Ê¶Ì¶²ml–«»[³n»¥“3O»$½½M¯[^7•)D’#Sd±žIfv‡êª_/êÎåI(ÍLâ©Á·ve3T…²¯øµÚ±”Õ”JÒùT#µTJ B[ˆ„QOèÿ yGO׶)”í ÚR—åcQ]1ÇJv‹š;šM×}â«üÊòõãgnˆg÷t¯|╼Ìܦ%^c{©X¬êGíªÇ#¶ÿNo[æ w’ ‡ }ºiæj[,ÝTy„Ís. Z`ÙæŽÉˆ·\c¾·!ùòãŸn¯ÐßiBå¢V4;Zå:P®ÈçÍÙøÁ ¸fní»&? —÷ec”ãÄ$úb$¤*Xˆâ˜sÒz®¶ôåõ:Dúû¨!§ty¤³™c¢ð±7K‹g´Q'ŠD |ï2vëÒë¤hŒÙ×Ú[=<¡˜2ÁÛ4ÙëÞN·ƒ&qwLÜ\¾MÜÚâvZspÒašŠN·-Üöí¾#+ûoZz{‰¾wæÖÖŒß.7*Æu–4wx'uÄØ-,¦¤‘Á8Ü;j{*ë—ßwér˜ø{Î+¶·Yáµ]6Œ»—#,h€H€hùÇJVÆñolâ>*øª½Ot”;ºm¦/¿_tä¿TivnbÒêMùO–6˜çA ¹r\¢ÑºÒcSíñõïg•Ävãjî³{ˆ¢ïüžZ#+!p11z þ×´µŽåBÏøº†­vÓa€Ãk­yPn;9Û¤ƒ\#+¸u\ú”ÜìEµ˜În_º¥YÉ|JÓu>¹cŽÚÒ#¾ÞûÃs.a8é:„8Œôâ[q¹E–o©ÞJ—…´àÚG¿W{¼K2MçB±zT.÷7/²cMž±P—‘>={uë¬pé!š“°h¦*7®w¢ØÏCßòrr̆ã`;ØàÞ††PCp˜I¦÷\wºäòYâ\Û[NDÊn*c£ºãìßm<׌3`dÂH:&f#mø«žtØËØaöM+Bøví¼¦áÝ‘ÒÑQúüÔñdÓÔdŒîjã13|6Î2é§wBDTÌ¡ãxÕtž#,*µWY…°A§šóãJ0B‰¤NÍh$Á. Çœt6¦b˜#+–݉ï#:~›ðq‘®òi(‡Å³Cë†V¯#W»b1Ät³¥Œºº)6˜á¼°Ja°øaô㉟—Ý TÞÄέë*Ñ€ÆX04Å/iÀÚ|#(PÒeŠ6¡-ì/-Ý7zS³ã¡j¦$píB‰CKqíNC»föƒð&d±}#,p4ïvÉY3Yç1†oG<ª6Ç“àd˜¾xìY¿Žì¹éž*ŠLiA’ x¥ÞŽM¹+.1a¹vÖA:òKÂÄÓ#+¶L›ŒìûôLܱçç¯"LBͬ':é—m#,“(w¾["kág¤b“q›ÐƒèuÝ™Œ.ð+µEU›%5Ýæ’f’hiÌÓ¦çÕ›a—…”°æ išË…N¼®m0¥¿ͨ­Á#,Þm Ç49ÓÚ> ¢6‡µ®½¶¡¤ÃxÜÁÆ=#ͯw~bf`#,Þiþ»î—5õLÎч/s´„¨y¬ bZH£?¸ÙÈ…Ú7¾€xÑ…ÏŠlO.àæšÅ—SOKz#,Õ®pÙ+Ð<‘0)ñ;º§ß±ã©MkMiÛFF(’5D uóë*_`[º-»MLÞjž±…<9‘@ÉôæmÌq:f‰ã‹Ø¼¶R±¦ív²(z,|EØé–œí.Ï7¦K³p:V|?OLUÒá¸Û~«Žäì¯Ë¼ ½Ì÷™;`îºV«®Ý¢S6’Öãï¡ðKõë™Ý[_¥QØ£…õ8þLof2½ÇTyã«u2`;ðæö牸ÞKŒuí8º¼Í«ãźÄ§}X–<µQ/œ(³YòŒJ‘ã%Lñ[¼Žñx¯7#+ ç2—“ѳ¿òVvN#Üúe3€>á/#Ó» Л-­÷p²:X#(7¨clÚTN6ú½NÈ‚Á™‡‘KŠzò!…ˆ¨Aw ¶É±^áå(ä·°ÇépÅ`\r ‡Pžio7à¼#,so»Ä3G·ö&=Šª†Ÿ_ñN¼%³Xa;àxzþú#(²òvÀ×Áú‰†Ð¦©YDíã×ÔV úºêúºÚ= rãÄöƒËµ9äOTN!ÈÚ<:K™êûÊЦ0‘a ‘û$M¦1Š4' ùDÓù9ªIII±v|þ¾7ɾqpMÃDr='UMaŒÂÆÓ2ÇÆh„lD£e°šM1Ó É 4ˆÐA¼‰uçw]³צåo¶¤¤­sEemŽB±Vb\4 Õd@bX«Hbe€Ò0æè’[#(5kmr­éV6­âª¹m˜A¶h1Cº™H²5p"7¤11”ƒCÅDÊ ”"iER(˜TQ” A#,¤Ò"V"1#×ã:žów·Ì×;–øfqÈ#(Ñ7B&DÜ»hK°kù®ðC²„XAEŒë6_‡ŽôÞ6ñâÏ;%˜Í‚A¢ƒìˆ’"$‚"T[Ž1#("5½fiüÎ#,8ÌÒ¢ãå†gª»øa6ˆr•c+C²*šÝ†m+zû-z­·e©ÐR—Žb¬cØ4±B·EH-rùÙŽ° ÷4ÛµÍᛂÕº*Â#+ÓüGFÖ)²Õv`ÊâdÛ4ª|=س¦´ãF!Vb8úÇW ¥šïÌcÆhR+VŒE)Ö …$)8pXðv„1”ªŒ|¸Õ#+6Èy™–=qÀ»<Û˜s…‹!Kë©*ÚgŒåíŒxç4Q5M¦ÒƤŠXKÇšñfMuêíãf“Ò]ÓÉÚ~2%¤C@ÒDº©o ÌÃù^c;ƒPäqæÝÈIØ9LEÉ$+Ñ|¿:lÐxºÒÚ màü<*Ã3I¥Š­h¦*›ÌÕ›´ž«¯Ó_0£j6õj°8¨Þ“f<¼ËƒÍJÜabnF;Û¯c/mJi•£¿Žv²ÍîFjh£MÔU¬zmkZ¦A¸Lk;³LÔ™cf­'Cœ\æ­•¾L¶˜ØÉD×qMj¡`"Í3DUbÇá0ÄÛPjÍ+m†I%¯®øÖ§<äînÑ¡€°¬†g)Þ%}y"G#+#+¤1mïæöí¼»—]7Y9É“^žù n*ëµsµµPA·Cš‘/¥•N5s+|ÃJÉ’•˜Iw­˜A¸Lº”L`ΰ4Ý€ÞéŽ3§ÌM¢Â±Ø—`xœs„¤Ø'–‘ºrѾºŽ=pøá€eIœ21ç-Žòaf‡Ÿ»0õÓOZMN"¼±B83½ŠUèÔ»¡#+éM3“¨ÉXãQ¨E´nUT(U†A£q)¡ÃHi4Úš„ÅÅ£o7ÞL¤JËevõça›[;™NfßM2­C‚*TQ®çƒŽâ;EÆq®¹‹˜i§HCFˆÑa†Qª»6á•» ¨ÇäøÍT£É͇#+qÄ þ3¼Æûudá^‡)>þ•…»3„Ñ^&¥R6üäiŠ¹Ì‚j·©.*7Ì®õt‰4³Mf3мÌi¤W¹ßlPË`”Æ1dª¦•–¡²r7F¤ƒDîcM¬xÀäLĨLJ[QdhE£E3÷§„êoKj‚™¹ÐÖ‡‡|#+Q¬U‡”ß~*7”ãÞÄ'ÁV][‚¼RI$¢’AꢕC!]”Õ•# .F,Ëü½ÔþîôQìEj>ÕæcÉ:³#(ed@£cn5$oÔÐG¹Í:Ý”¶˜&ºw@ƃìFàÖèXdL“)¡ã~g4HS‡¦Þ,-™Ja²âÂìkV3<m-öaZ¸2ÈF;g‹¸HÈsëK6té¨WS"c· š¤ÄP³<Õ‚¹™XšÝãDÎH¶ë#+ˆÁtJ†#i¨ôøÒ†q…clŒÒM-ºnÍ)r)b°o®³ÖYÈ]Œuƒ:paÆrnVáHU¨…#=e­©ô]¾p½ÜnHø¼ ò.wí2¹OƒóS48’.H£âýß’¿ÜÙÄ 2‚ °Q)F¥…ÝC™ƒ®¾äšvöW¿ã«ãû(\³ó»vÅ©”ÔO:ªì¤5)My:üûk~[)"ÒNiKCP*F!Ñm§Úl…/C³„óµ4Ê!¨ÊC¼#,ª§uX3#`Û±”Ý…$UTIÃ=Þ²•}ì)êM5¨T?MVÊÊÅ—Nq˜{q2*ý³Ì+?l x§à#,‰ýŒMŸ=ë”p©áA$ Â^m³MRL‰>SPëš0D¾óµº“燠>þ$óo§bQ…q7ysóªÇÏ#,@JpšÛ×'ÍΓA›…Ä1%~«Òÿ…F»8Ñ2ªW–cÌøq›ÜóÛœ€Ö›Ñ9né;»“‹÷;ºÉɪ•UN¼ÃÃiìb.µö>=gu÷‡|>{[>`xIêˆáÔ4Þˆt*‹Vq¿:(K)¦†¸Bʧ9^€OÔyøz¶8'™<»uIõ%%ˆS=€ÉÊx@hCÁ@fså«3m%%]ªiM[eå×+bÕ¬Zº^5¶¼Å”ƒERHˆHTV¢B/€7æþÛa=@Ca´K#êþ†ÛxWÏƯ~žD#©h¨i›kaF+Œ˜Æ&1¤KD©(Z¦UŠYl[%LÛVJJ-‰+%SeE±ˆe¡M6I¥&ÉJ*I *#CmQ)h¤…3E”Ò)TÑ…¤˜m†0‰JLU´U±û^­LÏ3ÙÙ![LUW¥ID:óÁ§¶mAý |Nã¼/¨™Š|bÞÅû.>éÞÎÝÇå4Zê¹ ?>#(¯ØœÅA ÍŸ©C‘ ŨZ”1 ‡"#(œTìîRÛ#+˜¢Jæ}™ïðȤžÇ1o#(¼ƒ1Mó½#(I"ëµ±î9ÖáEd—F\†>î|únfàã¬è¶óaOh#+_vÆŸ“ïÑÒ/[(aô#mïÜu’UF+ ·Ž@}o¦aÐàAñíþ(]ÔKU2Œ$%»jÉíæ¼’H\¨Øí½ý‡Óîöh‡Ó³´âñðŒ ÕF©Fú¸¼Ln~©kð9Â,ÂiñœPHzWú…~vÕ¾Ãj-Q’Û&ÑjÄj¤Ö¨Ñô6­t¬ØÔ¡Dj"ŒZÄgÕv®fÙ‚±BTrY´X“þ~¼ß°4WÃ8ŒŒ‹€hR·Ï –1`‘è’¼ßÌ]@÷#{bÑLE…á½ÆôcËùµtj ¬b§Ìâèñ¨t¨£ƒ%bš’9IˆŠÌ‘1ƒ#QƘÄï2½°&âÆ ¬4ÒAZ´ÜÄp”’aM¤ÄŒôIlZ¢]ݺvs^ÞwŒÍÊk³oi e¥ aBSLýô&3 ¢à÷ªôÃ#(£qvwP‚lZ(âAãlŠÄˆÐ½K¡î‡mïkÚ|¨5O©ÂEÉ›!É‚ÝL\#+™m—jÛèõµÞMë\6¾V·aI+B’¢3×R™ÂìÀlHÄÙú¦Ägƒèñ·›‘ŠU‘V®‡\¬Ùê!˜Ü0rˆ&˜„}P2±0‡‰&Á°GSRFÖÚ,aÆØ ªØN#(hH°9’á9ö2HÅUfd’@ï‰#(‡p{1殀ÓôvéÕw¬PLÓ »àg¡/Òî-#+,z-‰þé™%”÷?•îi<òpÎ~‘ƒÓõ~"Cë—éÓy[‘X¼A¶ËÚ¯Dï÷qÐ~ˆÈøÿ,o4K×ßëí4’zâ ;¸é" ã®ûmŽ~Kí*G;ö‡i0Ø´GP¼';[ã=¶Û¦Î¥GTô‡@õ >y\Ϥà·át~9S4?éúÙžàämrjQ£%°®,¹Óz¯MwÔL¡!útÙD© "À'Þ„/ÇÊ;«Öe§Pe­¡åñ>v#+bvûßÈ8ÁÜ¥·¤§~&Ï蜻3Ï2SÃÚ}4 ÑG^ §1x @_CŽÃÔ6çϨžvêñ“Sß÷IÁ}i¸#+È:œ9Þ{JW.T{”±¡H*¨•B§aî4ï'Û3bžÃÃŽ–Fv8–<Ý¡oQ}’J#+èŸÐW³9ö”noÒ¬yâ4x™`E‰¸‹BÕ»äÐ ߎSå´+ “31ú8ýèÜ~P#(ršóð¯¢[ðþwòßpciXXÖÉ%0gñö5ȾÝ5»`»#,R™Û´cs³æxûSËÚãë(ÚÝ\Ã7¼O.¯õt¨ìŠL$0bƒ‰ Ðd:LÇ”¥³çû¿µÂGáœæS3,ŸTäàñáÒ+šÌ0Hä4Rbs$0Ç[²¦*ýðó@'¥ž9.¾æ/I a×Ùnn´ßôŸ0枺<¡îõô#(ö{HÿÆöíùìSùÎV)]$È }TÒé.}ÙÝJW¬D¬B=ê ì+Xq÷~¯<Ô¨ZÔz“¤-éuNw‡Á¬–j6ɇÑÙÌ+ZqÐäíR“îìèTö‚Ä:Cí…„aælÅ—VòG\× ΦxTÌ KµF5& )Bªˆ[)r#(&v¨ È A#(¥¦!Oäee´ä)„]bWýØ qQ)!«ÖG!:]‹¹7£}.ˆã«‰‡ –AŽ*¡p#ºò]ªhˆíYU{.[ð6;h¡"¼%f‚¢ˆò¨L ¶Ká½e#( £"ÌAhb#(F³#(ʶŠ ñ¾¥†tíÈÚXÓß¡™ ’².¦*ªHE5™tDËA8Jã«:œ´3oÚ… Æ£D4£„Šå†M»©‚‡9CNŒ/h#,6åÒÈŒX#,"¡ÂˆTˆÉâPp=‡ì30(€”€‰’¨D‡!6Ù!ƒ®Âm‰RÄI |ó†³V'%¶òšEŒ‘²m¯‡®½û¶ôb’#+³Ó¾;ðÔpC4&4ÍÉbU ­¤€¢Pµê–m”u\£KÒÀ"¨Bf@@Dmï½n`ÄVÐÌêâjZ@(Í)©ÓzŒ"Hn±í¬é­îqN8†#, ‹Xf#(Pk¿MÛtf¢]¹ªh+1ÊC’‡€¨}½|¤žPûv¶R$Ù³¹à9ã½®€úmmÂɸø;œHÏœÜ;IƒHÝî "™ ‘aœ›ÀMN Y˜–’*&P'$ÃÂì¹% Úß3óÿT-÷æ%³ª™•×)™ÅרøË /MmÜRc…’}WqЦ8p]ëªä9I¤0º²WÒ8 ôҤ℺f™ÃKr,ÞåÝnD¹)JŠEŒZ•° Òm¶‘‘#,h&ÓHmLh\õ€–˜¼xLàZÛº2n“ËJÐH©&ž*R—QQ3Lá¢æSÝ]IÞp1•ðMC9Ð[£M㕸4äé H.BÒD·8š‘’ÐÏ#00…#Ƴˆb0&ÍÎ4Fʪ‚½í`‚¬ZãO†$“.c|釒õ„^šn®S3 YvRæP0#<˜¤-^–”5¥ E!ݶD›YÀĶž\P/)·8mÖóÏ97…À3ì!PHÛ¶ÛmLXañDX‡µX:Ds™¢ãÒ’·Îí:ö\š{‚eÌŒzíÃdɽ=¶òV‡ƒeÉ1²0eÃS¶"CNí*/— €šÕtØ„b´•K6É#+¶Æsm.å$Í3™ÒÕ-•TêqŽÉ¥íæ^¬ºÙñ m¦ O-eĤ:*ÊlÛÈ×õúav˜ä[ó“š‹y§‘Ètâƒqábs±ÇkÀ´°_h®2b#+f­ŒÝ‘»Æ æé]—»kO9© óG:ÕZ€ù–na%³F9V,IÓœf˜öýîʘ¾%« ÞºCË¡çJºNì(k¦î³â[ò]u‰“"iÒtîÔ’Âç®#,[* Žó¦Ê4ð…§+¢Ê­¶›»Ú\œ@Ä3 (S 8Ä9f³-#,H\•,ÂU`an¾žuQE½t[CÆ+VbÆš|ÛÊÝ®© êýÝñÞ»g*EÈ¢:šé6+¬E#,66ª`vÅÐËxLh6x»xYtI¼áŠlš•­ê­S²Â²n  ƒD²îdèd|e­1×í-ltæåhHLáÆÎ,’pI{DøêÜú¬,¢˜¡nðPþŽ9±5’“tãËK»ÓDb7Y½HŽ™XÊË}c ežZ í6`+á(–!q€#&ؤ•³\tȨÅ­ñˆfE™®š4~v-"·U ¤mÖøUØÖušÕ_E°nÑÌr.ÁÑka–ô/ßfô 2Ò˜d‡WOEÇc.iÛ‘¬q§ÅWNùÁšk1(vi©a¡¢f;HÔ#EÓ$ÃÝ®)¶Xq˜0K¥DÑÃ[Ôtͤp‰?_òþPŒ½¶\ÍGB^‹9NÌï†ç‡a¡»†6c® í‚„—y.‰³èçŠseæõ/5Otò&)³˜!ܬûkz],èŒs|EË3!ÏI†)ƒêùr"Õ|ÆKÔE)w—Ä©Ùai1`š¶vµŒ4ï8òYÙë%¶\³›”ËlÅÛ•‰Ã\q¼Ujl©À+7cñçWã×th:µˆ#+´»»QcÈl§#4(LI¶hÚTß6D&†I®ZL ŽûêtC1–j1Tݺ,+CY‘C“ˆ f”3BÒ1·Hi–x3œÖSµP#+4w5¶‘ƒQ#+#, J6)0W—“œõN™-¡›¡€L9bbm«z±¬£Žbˆàq²©¾W2â`—sK·D‚9ÜEëŽÜ¬Ž]çræ&§0.æz3#§&IË?D_K^h–é <õ–€6L¶HQÜšëÖ3L5•µK\³ƒ‰'¬ÇRðÒl/ øÂaÁÆöïu½x‹Ý'‡Ãn#mæhPãW0š&D4xáÛ•Íê:;PRê%Ýغ­$ÆñPÎ!,§AΔâÜxØŽ¦D‘jƒ#(‘ÓDq63V7˜+Úh(‚Š¤ª bÉÉêi#i‰›ùI6É"ƒmE‘æ†1TЋ· 2ÒAÍR†¦õK&Þ {·lÏ[£’[âÍStØ“;¦Ð€M%ðì +#(#°à…Ùp#¹•#+ fE×BJ¤– Ã…ÕŠ”C#+)°ÌopÔ“"IU#,!ÔgÖdºŒ ˜44Ì „`›4"è¦NÓ ÓT!Ôtn3a ±L—WŒ¶!@k,É¢ÉP8›†¬q32ÅTMa`q,Ðã£m„v½Ûp#+”4©¥@x ‹#(Ø*B•ƒ¥Ú,×o‰q!µwÈÆ!°É‚7`Á½’ "3”ÃEl(ª#,u6f!M6ŽN#,ƒài(qÛ¹VFHF¬-"«£mœšÙȺ!1`ºSFËËfu,6ŒEm´¬w&š0§­a[#ð4ÐP¯¢¬Á#+›I‚j!#+¥@:#(qR«@´T†¸q8ÇŒj‰RZ6†i(#,Šì«¸ÑNyã¯t¥¦æ¢FhŠuVƒb(ä3 Š™…Ôì ‘T×<ÇH&6DD`Q Ý Á$ŠGk7Úé©5©#+Clª‹"‘AD'Ö ƒéásæcÚÚÇ(ÕPFŠ)œ¥Te»ó›^*›~¹•¬©9Žm3ÂÒ–æ/îÇ1κ…º#+º|}KôÄÛg¢’(òb+!: ÷ÁA DA;Éþ(‚½_Æ{wÛ€ßà{~¼¯f{éUõ…eõ¾^ÓÔZ*_§çSO¢Z_iÓMÖNŠ#+?Ð>£MÃÛ¹–_ylx¨âÙàm&-£™×B¸kMµ‹h ,6pr"wë Î*LÚ¿Ò4Œ0mƒÁ›Ù×ô¢©ú=Þxë0rEò°kí‚oŒŽrîQB¾4ŠÈ#(q“„äMžu„¼#,”R3IBq‰À9Rm㥌 O·NôÑôÐâãÍZhñèïm­ÍÏ!ÀDNq†5jWäPœ‚â”òÕU­ÐW˜ä¹×Œ6æïsÅ×ÚÍg-1²È“zÌÍÌbwÕ.˜{#(|€ùO­¯©Q >ú2ãÅíùŸBgLøșևUönŽÑã°3†üœ¡Ðùéóˆýr#(ÙnÐÕPx0”ø&ê Òƒc‘82 ‡mÂîyÁ¨o"õš¹H–&T†dU0•ÆŒˆÚTCíz»®unye!I’Å^L`¬­É*¤Cm&dr¸WY Ô2\0+´”¥Ì®Ø,*k™)€$°A£4†”†šTDÔ¥#,¢*¢ TÀAiU0¨Ðüô™ªÀ=x5’K@Ö58-Â.aÍÑ·›Î{A”1fj^¢ØtTN¹#+f†ˆïÐÑVÅ •Q"„&CÕÙÛ;Ÿ‡˜CÛ xžŒufÞ‡Ö"öES¡ˆ¡Ö ¶:ã£K­P>1Ý82µmÐßÃkM2‘¨öA¡ÒGŽæ™™‘¡ l°ˆˆ¬Jì‘1 %0¯hk| ­!"¨-¥#,$ÝÄJëë ±N£ŸA‚5½²X‘èo®vDcÌIܩ쳟d4hꨚ2HübÊIíÒEüïöÎ'>‚hP>ð°ñ¬Yı·e†8¯)58ãž» CŸ+6ŽƒíÎS*¶Å,Ä*˜“‰npÌú£NMì]f"jën@ìHÃl'I@ZYPIŒÜ3©!ÇVÌðy.äË» #+Üs 5pÓXùK4~ œ¢ˆkL[c_La´’lakÎŒ¶ÊÅ‘ŠÄDžÄ£æk8aœòô4£&t¯­ôëjû›_´]¤òµºÚ+6×ìÚ¨¶ÝµQµ–ÛiME%´lkcL¾»d­’DKDj(&€ÂÙŠ#(ðP°hcTd`ŠÒ3#+R4„H‰ €Ù *`"DŠ ‰´Q: žPD]ê#(O~~¬Ê©iR&Àèºù*¡îÌØoóÒ¸r6¨v°ðÛS“!‚A *HB(ïÙŒnÀ–_7Ð(-îS+‹\8äÖjŸÀ#(‚²"F*„€,€‚MŸN7nùeŠž|kÊq¯Ké"·kÔ…²ÎJe×`ßpÝYºƒY|×c*)rŒTI4e|“ \‚Š&gg!ÈÁ‘›g.ݵ·ÇKÒõé¸Ûéyy»£Ê«EH(DÚeƒ"Ž:‹UÖä¡ ÉÔ‰E9Y”´–11(V„ä!˜­#(y(4Æ7O+IŠ³Muš»kr¯š¸˜Ø5§›«W5µ&ÒZ´"ŠÆ#(¢) $+P;#+ÜvàL’ ,ÐÒ³ aQ݃%<ô¨Q#(â¥À(C~ Ë0#+m¥ëðNþ‘ízÏg7¢X`BLU‡oèøÓ3 ƒ2øƒªe[4)HBzQ—²„?á:PÅo¸ÌMÑ×Üǻա› 7Œ7@0x”V ÀP…ÝyîÈ8½5—}#,>æ‹>*‹7ÐÇ&¢è‹"Žµ#,BP$QŽR@¡šq ¶¤¡ H:r\fïjÀo÷€ÂnîÌ×#,QpfƒÐd”;‰ÅÈLHÊWñþ\3¹&öülÇm 6 ¸BÒ M * ArÛ9F!¯)è•ÀˆA  Cë­Fµ‡(hÖçHçH–3ŒH„Ð!´#(6#+­5Mo,%\²†ñ3Ôšš.ÃrÈ~ͯ-þØÅò=Ð#"B[À/zp]µó˜|ÄÆU¨9ÅŠl8üêÖ† ioÑÉÂ_i`3ö3¦ø.™™YWÅ•…:Ž[”#+„± Àwø{^@Ù,ªõ•ÑgZ” Á¼>´ÈD #,¨þøÆ 0`"¹ALôÕ¾A$>^ 1ê/??[«<Ù1ü#+›šÔjÐ:êˆ0 „ö¬Dˆ#(Z·KYé¿Uª´‡\VÞ¼}Ç@0‡jÕ.é¥gt4™iä{ˆZ%Mên¨)£íòôx!Ùé”."Œ”"TT„®”‘‘·@©e„ø Óoªá¤¹ó¿´ÿE#+w¼˜è½¡×È¡±hP´zÁÀÜGíû(T]GtP(¨¾›6Xž¶ l«ôëz¾¶(Á$2Q”K¨Ô‘4™]×d1¢Üét»>ŽòÃôû¶¹l]=y¼ßVöó³kp’6JQM!¨£FĽMÜ·,æ6“Q¶5^-Íwu5Ý×¼ò¹“Jš-AʼXXÂû¤J#,IÑæªE7 Sy}w}Þó×ã(¡¢«À¯/•Q†ög¼<‰+5L'°ÓÙ} §©@éÚK× @„#(!#‚0K¨'™Þp·ãßwj×ÇîÙc!QR‘¨Ö4‘K)-dÌ#^ß’~ol¤î»Rúµ_[~(`(ÒC•¢´VlÌÒªßzÔí2J^öòkõ&Þš“@€š{!!HÃz¦ñ€™VSÚwSà @`€%2dê)U¿'mö&毒W­7uÂÌSbÉo'³ÑF4hÉLŒ•“+)E²Á‰½zïÚKZIfÖSk_s«kÆ­’#+#(—·PŠkÿOáÕðø>¿§Ý| 'R½AÙ°8…g3{ÓÖz}9TÇ×™S[°®?/»vA 1> ›f¯áK»kÔnÙ‹“½GÊDŒ<øˆgZ‹žl㘙ÅÓÌ÷úõDËåEI^êþ1ab)’EZgÔ?Ét €Îâ¡–O$˜ÈT#,öB„b”)A–OÆÛÝٷဨ©ˆ#+¥nÏbnz*›•`mÑ€øA…NÄø«D êUAEÞØ*@Š„"²©ïNZ©¶¤Ócjgš\ÛßÊíÌKÎÅ›Aû€û#(H¹™ܹsœ)=¢{„0…½Èwé ¿“y32t€wøà‚/@ˆB°…Âä©LôdO²î7&¦vßÓ­îgË‘ŠAë£<ì6üŒ5†W§4°#›‰Ñ5øh[83]/EYŸºÂö¤üƒ¤&XS6bŸ6ÀÕ„àÀöÖQñXGÒÛÞN–÷ÎÛŒô’~Ì¥©áÇ2ò憨y¦À¸ØòCêGÙü€è#( òWX±‡”!*£AT–űJi¥I²f”Í)I¬b¢ƒcFÆÛ›l)£B—áUʾ¥®K £ZM™c562¦ªû?`îá9XäØÉFZ! PTеL!Iê ±w#(ûÃ"#ˆ£ Q@îJZˆ€#(ÂiºŠ”Å68ò(àK¨½ ‰ÁÚ©ãëü9!DÙÉx;±CÆûåÛMj¿yPÚµyV-¨Æ´¥#,£BU›,FÖ6Ð,`Œ'ÊJ(<Î5ÙÔÛæÎý­¥VY*~ã/;Ÿ¢ÈU)¨·Š2#(0?’BçÕcÆ›ÔI 4¤¬ßvŠ j÷Åæß„íñ‰ÈÜîÇ"­„q¥-¿s0ñK#­í™‘#+€Å…‚•4šg„ÓU‚‹/ý£BÀ¢Œ!ÄT*Šé¼u¾UºÍ&¦ŠT·¬ØDHr&"H˜VŠ¨"#(Ò*䨷›ºÌÝ™•]svÔUÎÔ["Í«Ë»h›]Ý]ÝZM•%L‰Mo;«x†‹+ TèR¬$0p)Ú‹yy+L"ô¯^\Fµ)¦$Á cLL `ˆ…`@¶#,Ê6”f™U,T¥¯;¹n×vè²ÆkeÓ]&¹k·=¯/•{tL$(ÑA׈#,´#p¡W5ýaÏd“po¸#+©:P}Åé#+l&#,^ÕM딩m®|þ×Yü·¤Ê[Fh¥Ÿ&QŒP¹{äÁ7Œb˜)‡fáÜéƒû2ny ñ›˜.@‚.ßérþ;ˆ—l$»tÞÍaòÌ=1n…ž{|ï“y=#+µœXŒ©M°Cª5&óÜK‰ wkÇ<Ÿ/̈%Ð̇©CUR§Kß:3¬[Á³…½ïLiÂßW‰™‡®B†^ÞHˆ ÅW(¡“g5ŒîfRÉ‹ê4á2a*pþ/‘3:#+4††m¦XÙˆ"ÛazüwqèÙm[»ò0Þ´’þùÐ b÷ o5ûÉÚñÔëõ’²îõÎ=øèCèM!Ž@ yò#,S*Œ gzXÍß#(ίҫÌá®Ò(vKFÑJŽøm²ªv¾F¡œ(€}¶5ès)5¿Q²#+âJá‚N˜ùeßÖ+Ò¯"´«[FˆÒôxy£¡Hžèý§Õ(œY<à¦è˜ØÐkL=½Ž “E"q qƒ1§&Cf2|¸MÈ£«„íû€Bˆì†Gt–g¯§¾òï}P®€¥”#M*µAeÉÔsº]‹”ÍѤ8®›nªê¥wZTŠîîåÝ·vnîó»x—RËtÛ²²º»u3iD¨4"¤(D¢CR#((BP…‹ bËXAšû;ù˜älîêþþÔkè­ ¹¥ I˜!º`,UŸ‡=õÁ'ø h‘žeíí²\H±ç%ìó’ñÆðÌr™³#(˜Ž”%ÓêSËÝW$#(z´K¾žC"p)•Ã€fÿWÇifæ¯Fˆ»f›(eÝDLõƒ;ðÈpŠÒ¦mÇàß Â#(áŠbç–âƃ©ÚvMÍÖÿž(–#ü‡|Þ´¥U‘ØŸ—{°±T]´ú_}–„œ-¾´„(¤*‘£Cû —-DEdÓHM&ïö+±¿eD@«¾®&ÃÄÄâƒKûÔŠ6VEÈ4”.•DquWÇ\›më8oŒ| òŒ»)áÎ*;ñ¡p‰H´+4ZÀÔb´¥âq1ô—½Ð4Ðt[Ãmº¹À¨„hˆ¨+‘Ížd å¦T¡1R,ƒQ²ã3\Ž±##ØzI=ic9ÌÓ³A ÅTªf•aÌP#+¯@•ñÈ7ŸIs—‹mÇé9£Øci8X$$|Kî¬í:/iÈ"˜>ˆYÌñ=½š89•gW··(nFxWî{ÿ/³ô<Ù4Ù²'ã€3R~8ŠZLGñØ#(Žrúà mf*ƒÁ ˆîÖr)òh²¹{09L”­ZÁe1ðqýd|qUìÌ#(}øÆvÁ—e¡³˜ C(UiECLÓ&lÖCF"“Zþ(ªÚ!?øB?õ@`ŽzíƔ֟ŒLBÄ#+NT&q!ðûÎåâ¹CˆV¿*W0æj[ õû„‘@DF º‘p÷†FÙƒ½ºÃ##,ßC8"‡ÒG ó&Á=Iª¨©E…™h ÇÀýþz¦ªDDUDcô„är$ '!€UµY#+ÓÙæz‚îi´C\y$rB¦Nƒ.‚Qg‘åg—+ÙB"°#,w#+};xnKŽ›Š šÂ½¢Î°äíÉíõƒJ™>$_´Y”t#·qOçÇ|·>ÐY¡,^ä¡ eÈ'ï6ÅêU'&[¯#+/P´¶[!uD°r‡ÒÖÔ¹MꢎÔ¶òž>g âL7@g5ÀåPé*Á´Öö˜ÀÌjÍ#œ°Qd,|r|å› %ÜI‚ƒ š6µi³Ú!ªÇ3¤íšeÖØwáÐÃ\8:ë‡gDYFòø¢ìÆ­Ô¾4úû5Gô¦l&çÁy¾ä.X÷u‚Gõµ—€ÔVæ#+.…ææ×GŸ¼†Y€ ¸ÐÃIu üã‰7é3?m±¹ʶì[1\VÞeðÞk VÚ}:Fı®ÌdÉq#([1¹ 0†o>Ú±ëX]%½çܬDðõÐ4ÃÝ‘uí6ë;âXšp•Ši½uA°\xB@a3ºË‰LNižÌ%Ü)!À°IC®W˜¡êõC~éÀªPO1˜B$”W×€Éb #(£^­ôÈâàÙÜhäcÓ`±Ó5³(V#, zóD•\ùõ‘˜Àß60#(Ø- 2CpÜ©#+Û(±°Ä$`¯¡(KöY²¡‰"$b‹!x ¤9<#,®TU€sH€x|Hïuí,LθÿY7\¬˜ ó€ñmÉ}á¹Ý!†BfHÁBL({:m°¡ÁŠjqÔÜ[Ë®¶©ö›dÚ¹¹dÖ¬¥HÞ75,)-¶5´ÓL«EhÖM¤Ì©"e6Q‘R¯­vÕÚÚ¯‡Ãª·Ù#,!r"fð>²)œCóÕ¿]Tµg,Rزs=r€Ë‰M@"³¿ð#(ûú>îÊÕE‘¨QSäÚE*û¥Ÿ;}ßMð8‹–•°ËTjçó_3Òyœåêœá÷v$ŒVŒiϨ…"ɯ£Ê#îÉÎ3.c£™’Ë,{²¥9Ø›bZ“R[ÙnêL¡áÑ…þ8þ‰ÛÕØ#NFrÇ"ìÁõ´­Mõ+§}F& hë367ô†¢Êed±²&ª˜IäÎÓt뛼h L¸¡úû÷ïáàlŪÁÒPhˆ}`ù¤ÔÆÓÉ,9®ª´ÃllM¤H©¢PŒYbä*tÏ 4ˆ(‡7)*1*64šfYA±°(@TŸ$5’\'ٲЗ&ÎÆ•!˜°áÜIè†w©1… š¡\µÄ0T#3*Œía, @Sê‚îáèl­dÛ#+wï}#+XÑoƒmó·e‹x¶’ o¥ncbÑò*¹lkF6ñUzQ[ÙVÞ¦,Zô­ºi6ŒbA´Á¡†w…F›–¤SqV#+×^#(‹ØÖ*Ú¢n£Á†pI„cpКSum")I†€ ˆ}4/ùH\‰Ç`È9 9È»›°"…Š{š]Žû–œOòÀ X D6»QÞxj)D”P&³-Y6ÔÍMrÆ««WfÕó¬fÍIkÕòëU~I&‹ˆ ‹¾7í“èøüéû‡{,…ÿ×÷ƒ¶0F#(yöóý~_¨|_·ÝðŸWܦ›;—Ùe§ïzà\Bð#+éV ñƒõËdNßÇôïëû¿Å MXB@&ŽnG?ß~‚ÙYmˆ¨êg¨7?6NÓǦy’$p¿®o#Ù1¦œ·Ö6lêÈR)4Mù]¬`̹mÝz`â}‰)Šùþ¢„ˆ‹_Ò€õqñ:ËHþ¯ÒðH;À÷ˆbp„òþ#+«ò…Å>Î{ùM»ž—-ôúŸåþ¯§ävžêüþ¨~"ì4úshœ6øjq]|±ç{Ç›úõûŽOŒ'ÌB=“ÖY.÷}ÿOÊO$F|€q_ãby¸~Ÿ¸Ö¨?Ée%¡–ú#+ ?‹úè‡DŸÊ˜fÃX)6j!gí92?w–“û½‹úemá›qA]DÉ6ïÙýÞÑ=ÿ@eT¡˜Ÿã !°*\IO¨CÉR÷tZÎJíâqTE3‚o®«…ÆY̘wÈânÓ§m3 ÊÊÇòó–&ðÖÂX­ŠÇ¼Ð?)ÅÏðiaº1 Fk-* ®¾ù¾Cº4øæ?õr<þÿpã7÷Œ7)Ny˜ØãZë’õ¢Zë/ì÷èæ’¨ÿ+©Ýá(¾{Õ—[>Ë®G†‰¢E”­ÂxZ è¾b|FàõtöÎÿ½a¼­À)ÄRQ݃¾ru7¸ 'åÁ0ó‹zщ$¡B ؘÁy½õ@,Ò/ÅÛ%ý‚\â‘É>£B>Q¼máû¿—ÀDÿÿrE8PI3ð #<== diff --git a/wscript b/wscript index 77cecec4..72533145 100644 --- a/wscript +++ b/wscript @@ -8,10 +8,10 @@ from waflib.Build import BuildContext APPNAME = "abacus" VERSION = "6.0.1" - +NO_RECURSE = False def configure(conf): - conf.set_cxx_std(14) + conf.set_cxx_std(17) def build(bld): From 7317897d63d4641cf134eb8bdd7e2bd71dd9a1e9 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 20 Dec 2024 14:22:04 +0100 Subject: [PATCH 02/68] work --- protobuf/metrics.proto | 129 +- src/abacus/metric_info2.hpp | 102 +- src/abacus/metrics2.hpp | 189 +- src/abacus/protobuf/metrics.pb.cc | 4713 ++++++++++++------------ src/abacus/protobuf/metrics.pb.h | 5550 ++++++++++++++--------------- test/src/test_metrics2.cpp | 2 +- 6 files changed, 5278 insertions(+), 5407 deletions(-) diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 3290dd8c..9397e034 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -15,80 +15,92 @@ enum Endianness { BIG = 1; // Big-endian byte order } -// A unified metric container supporting multiple types -message Metric { - string description = 1; // Metric description - Kind kind = 2; // Kind of metric - uint32 value_offset = 2; // Offset into packed memory for the value - uint32 valid_offset = 3; // Offset into packed memory for validity - - oneof type { - UInt64Type uint64_type = 4; // Unsigned 64-bit metric - Int64Type int64_type = 5; // Signed 64-bit metric - UInt32Type uint32_type = 6; // Unsigned 32-bit metric - Int32Type int32_type = 7; // Signed 32-bit metric - Float64Type float64_type = 8; // 64-bit floating-point metric - Float32Type float32_type = 9;// 32-bit floating-point metric - BoolType bool_type = 10; // Boolean metric - EnumType enum_type = 11; // Enumerated metric - } -} - // Metadata for unsigned 64-bit metrics -message UInt64Type { - string unit = 1; // Unit of measurement - uint64 min = 2; // Minimum allowable value - uint64 max = 3; // Maximum allowable value +message UInt64Metric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement + optional uint64 min = 4; // Minimum allowable value + optional uint64 max = 5; // Maximum allowable value } // Metadata for signed 64-bit metrics -message Int64Type { - string unit = 1; // Unit of measurement - int64 min = 2; // Minimum allowable value - int64 max = 3; // Maximum allowable value +message Int64Metric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement + optional int64 min = 4; // Minimum allowable value + optional int64 max = 5; // Maximum allowable value } // Metadata for unsigned 32-bit metrics -message UInt32Type { - string unit = 1; // Unit of measurement - uint32 min = 2; // Minimum allowable value - uint32 max = 3; // Maximum allowable value +message UInt32Metric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement + optional uint32 min = 4; // Minimum allowable value + optional uint32 max = 5; // Maximum allowable value } // Metadata for signed 32-bit metrics -message Int32Type { - string unit = 1; // Unit of measurement - int32 min = 2; // Minimum allowable value - int32 max = 3; // Maximum allowable value +message Int32Metric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement + optional int32 min = 4; // Minimum allowable value + optional int32 max = 5; // Maximum allowable value } // Metadata for 64-bit floating-point metrics -message Float64Type { - string unit = 1; // Unit of measurement - double min = 2; // Minimum allowable value - double max = 3; // Maximum allowable value +message Float64Metric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement + optional double min = 4; // Minimum allowable value + optional double max = 5; // Maximum allowable value } // Metadata for 32-bit floating-point metrics -message Float32Type { - string unit = 1; // Unit of measurement - float min = 2; // Minimum allowable value - float max = 3; // Maximum allowable value +message Float32Metric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement + optional float min = 4; // Minimum allowable value + optional float max = 5; // Maximum allowable value } // Metadata for boolean metrics -message BoolType { - string unit = 1; // Unit of measurement +message BoolMetric { + string description = 1; // Metric description + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement } -message EnumInfo { +message EnumValue { string name = 1; // Enum name optional string description = 2; // Enum description } // Metadata for enumerated metrics -message EnumType { - map enum_map = 1; // Mapping from packed index to enum info +message Enum8Metric { + string description = 1; // Metric description + optional string unit = 2; // Unit of measurement + map values = 3; // Mapping from packed index to enum info +} + +message Metric +{ + uint32 offset = 1; // Offset into packed memory for the value + oneof type { + UInt64Metric uint64 = 2; // Metadata for unsigned 64-bit metrics + Int64Metric int64 = 3; // Metadata for signed 64-bit metrics + UInt32Metric uint32 = 4; // Metadata for unsigned 32-bit metrics + Int32Metric int32 = 5; // Metadata for signed 32-bit metrics + Float64Metric float64 = 6; // Metadata for 64-bit floating-point metrics + Float32Metric float32 = 7; // Metadata for 32-bit floating-point metrics + BoolMetric boolean = 8; // Metadata for boolean metrics + Enum8Metric enum8 = 9; // Metadata for enumerated metrics + } } // Metadata collection for all metrics @@ -98,24 +110,3 @@ message MetricsMetadata { uint32 sync_value = 3; // Synchronization value map metrics = 4; // Mapping from metric name to metadata } - -// Value container for a single metric -message MetricValue { - bool valid = 1; // Validity of the metric - oneof value { - uint64 uint64_value = 2; // Unsigned 64-bit value - int64 int64_value = 3; // Signed 64-bit value - uint32 uint32_value = 4; // Unsigned 32-bit value - int32 int32_value = 5; // Signed 32-bit value - float float32_value = 6; // 32-bit floating-point value - double float64_value = 7; // 64-bit floating-point value - bool bool_value = 8; // Boolean value - uint32 enum_value = 9; // Enumerated value index - } -} - -// Value container for all metrics -message MetricValues { - uint32 sync_value = 1; // Synchronization value - repeated MetricValue values = 2; // List of metric values -} diff --git a/src/abacus/metric_info2.hpp b/src/abacus/metric_info2.hpp index 5b0da8ce..4d644854 100644 --- a/src/abacus/metric_info2.hpp +++ b/src/abacus/metric_info2.hpp @@ -5,42 +5,94 @@ #pragma once +#include +#include +#include +#include +#include + #include "kind.hpp" -#include "max.hpp" -#include "min.hpp" -#include "type.hpp" #include "unit.hpp" -#include - namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { - -/// Object used to describe a metric. Used in the metrics() constructor. -struct metric_info +struct uint64 { - /// Name of the metric - std::string name; - - /// Description of the metric + using type = uint64_t; std::string description; - - /// Type of the metric. A metric_type enum. - abacus::type type; - - /// enum describing the flags of a metric. abacus::kind kind; + std::string unit; + std::optional min; + std::optional max; +}; +struct int64 +{ + using type = int64_t; + std::string description; + abacus::kind kind; + std::string unit; + std::optional min; + std::optional max; +}; +struct uint32 +{ + using type = uint32_t; + std::string description; + abacus::kind kind; + std::string unit; + std::optional min; + std::optional max; +}; +struct int32 +{ + using type = int32_t; + std::string description; + abacus::kind kind; + std::string unit; + std::optional min; + std::optional max; +}; +struct float64 +{ + using type = double; + std::string description; + abacus::kind kind; + std::string unit; + std::optional min; + std::optional max; +}; +struct float32 +{ + using type = float; + std::string description; + abacus::kind kind; + std::string unit; + std::optional min; + std::optional max; +}; +struct boolean +{ + using type = bool; + std::string description; + abacus::kind kind; +}; - /// The unit of the metric - abacus::unit unit = abacus::unit{""}; - - /// The minimum value of the metric - abacus::min min = abacus::min{uint64_t{0U}}; - - /// The maximum value of the metric - abacus::max max = abacus::max{uint64_t{0U}}; +struct enum8 +{ + using type = uint8_t; + struct value + { + std::string name; + std::string description; + }; + std::string description; + std::string unit; + std::map values; }; +using metric_info2 = + std::map>; } } diff --git a/src/abacus/metrics2.hpp b/src/abacus/metrics2.hpp index 8cb0ba4e..102f47c7 100644 --- a/src/abacus/metrics2.hpp +++ b/src/abacus/metrics2.hpp @@ -9,18 +9,42 @@ #include #include #include +#include #include "detail/value_size_info.hpp" #include "metric.hpp" +#include "metric_info2.hpp" +#include "protocol_version.hpp" #include "type.hpp" #include "version.hpp" #include "protobuf/metrics.pb.h" +#include + namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +template +static auto size_of_type() -> std::size_t +{ + return sizeof(typename T::type); +} + +static inline auto to_protobuf_kind(abacus::kind kind) -> protobuf::Kind +{ + switch (kind) + { + case abacus::kind::counter: + return protobuf::Kind::COUNTER; + case abacus::kind::constant: + return protobuf::Kind::CONSTANT; + case abacus::kind::gauge: + return protobuf::Kind::GAUGE; + } +} + /// This class is used for creating descriptive counters that are contiguous in /// memory, to allow for fast access and arithmetic operations. class metrics2 @@ -34,13 +58,162 @@ class metrics2 /// Constructor /// @param info The info of the metrics in a pointer. /// @param count The number of infos. - metrics2(const protobuf::MetricsMetadata metadata) : m_metadata(metadata) + metrics2(const metric_info2& infos) { - m_value_data = new uint8_t[value_bytes()]; - } + m_metadata = protobuf::MetricsMetadata(); + m_metadata.set_protocol_version(protocol_version()); + m_metadata.set_endianness(endian::is_big_endian() + ? protobuf::Endianness::BIG + : protobuf::Endianness::LITTLE); + std::size_t offset = 0; + for (auto [name, value] : infos) + { + // metric_info2 is a variant type, so we need to use a visitor to + // extract the correct type + + protobuf::Metric metric; + metric.set_offset(offset); + offset += sizeof(size_of_type()); + if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_uint64()->set_description(m.description); + metric.mutable_uint64()->set_kind(to_protobuf_kind(m.kind)); + if (!m.unit.empty()) + { + metric.mutable_uint64()->set_unit(m.unit); + } + if (m.min.has_value()) + { + metric.mutable_uint64()->set_min(m.min.value()); + } + if (m.max.has_value()) + { + metric.mutable_uint64()->set_max(m.max.value()); + } + } + else if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_int64()->set_description(m.description); + metric.mutable_int64()->set_kind(to_protobuf_kind(m.kind)); + if (!m.unit.empty()) + { + metric.mutable_int64()->set_unit(m.unit); + } + if (m.min.has_value()) + { + metric.mutable_int64()->set_min(m.min.value()); + } + if (m.max.has_value()) + { + metric.mutable_int64()->set_max(m.max.value()); + } + } + else if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_uint32()->set_description(m.description); + metric.mutable_uint32()->set_kind(to_protobuf_kind(m.kind)); + if (!m.unit.empty()) + { + metric.mutable_uint32()->set_unit(m.unit); + } + if (m.min.has_value()) + { + metric.mutable_uint32()->set_min(m.min.value()); + } + if (m.max.has_value()) + { + metric.mutable_uint32()->set_max(m.max.value()); + } + } + else if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_int32()->set_description(m.description); + metric.mutable_int32()->set_kind(to_protobuf_kind(m.kind)); + if (!m.unit.empty()) + { + metric.mutable_int32()->set_unit(m.unit); + } + if (m.min.has_value()) + { + metric.mutable_int32()->set_min(m.min.value()); + } + if (m.max.has_value()) + { + metric.mutable_int32()->set_max(m.max.value()); + } + } + else if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_float64()->set_description(m.description); + metric.mutable_float64()->set_kind(to_protobuf_kind(m.kind)); + if (!m.unit.empty()) + { + metric.mutable_float64()->set_unit(m.unit); + } + if (m.min.has_value()) + { + metric.mutable_float64()->set_min(m.min.value()); + } + if (m.max.has_value()) + { + metric.mutable_float64()->set_max(m.max.value()); + } + } + else if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_float32()->set_description(m.description); + metric.mutable_float32()->set_kind(to_protobuf_kind(m.kind)); + if (!m.unit.empty()) + { + metric.mutable_float32()->set_unit(m.unit); + } + if (m.min.has_value()) + { + metric.mutable_float32()->set_min(m.min.value()); + } + if (m.max.has_value()) + { + metric.mutable_float32()->set_max(m.max.value()); + } + } + else if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_boolean()->set_description(m.description); + metric.mutable_boolean()->set_kind(to_protobuf_kind(m.kind)); + } + else if (std::holds_alternative(value)) + { + auto m = std::get(value); + metric.mutable_enum8()->set_description(m.description); + for (auto [key, value] : m.values) + { + + auto enum_value = protobuf::EnumValue(); + enum_value.set_name(value.name); + if (!value.description.empty()) + { + enum_value.set_description(value.description); + } - /// Move assignment - auto operator=(metrics2&& other) noexcept -> metrics2&; + metric.mutable_enum8()->mutable_values()->insert( + {key, enum_value}); + } + } + + m_metadata.mutable_metrics()->insert({name, metric}); + } + + // @ + int hash = std::hash{}(m_metadata.SerializeAsString()); + m_metadata.set_sync_value(hash); + } /// Destructor ~metrics2(); @@ -58,7 +231,7 @@ class metrics2 auto initialize_metric(const std::string& name) const -> metric { using value_type = typename metric::value_type; - auto offset = m_metadata.metrics().at(name).value_offset(); + auto offset = m_metadata.metrics().at(name).offset(); value_type* value_ptr = (value_type*)initialize(offset); @@ -71,9 +244,7 @@ class metrics2 typename metric::value_type value) const { using value_type = typename metric::value_type; - auto offset = m_metadata.metrics().at(name).value_offset(); - assert(m_metadata.metrics().at(name).kind(index) == - abacus::kind::constant); + auto offset = m_metadata.metrics().at(name).offset(); *static_cast(initialize(offset)) = value; } diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index faa8b546..e3b23047 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -23,31 +23,14 @@ namespace _fl = ::google::protobuf::internal::field_layout; namespace abacus { namespace protobuf { template -PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR UInt64Metric::UInt64Metric(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.description_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.value_offset_)*/ 0u, - /*decltype(_impl_.valid_offset_)*/ 0u, - /*decltype(_impl_.type_)*/ {}, - /*decltype(_impl_._cached_size_)*/ {}, - /*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 UInt64Type::UInt64Type(::_pbi::ConstantInitialized) - : _impl_{ /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, @@ -55,21 +38,26 @@ PROTOBUF_CONSTEXPR UInt64Type::UInt64Type(::_pbi::ConstantInitialized) /*decltype(_impl_.min_)*/ ::uint64_t{0u}, /*decltype(_impl_.max_)*/ ::uint64_t{0u}, /*decltype(_impl_.kind_)*/ 0, - /*decltype(_impl_._cached_size_)*/ {}, } {} -struct UInt64TypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR UInt64TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~UInt64TypeDefaultTypeInternal() {} +struct UInt64MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR UInt64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~UInt64MetricDefaultTypeInternal() {} union { - UInt64Type _instance; + UInt64Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UInt64TypeDefaultTypeInternal _UInt64Type_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UInt64MetricDefaultTypeInternal _UInt64Metric_default_instance_; template -PROTOBUF_CONSTEXPR Int64Type::Int64Type(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Int64Metric::Int64Metric(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, @@ -77,21 +65,26 @@ PROTOBUF_CONSTEXPR Int64Type::Int64Type(::_pbi::ConstantInitialized) /*decltype(_impl_.min_)*/ ::int64_t{0}, /*decltype(_impl_.max_)*/ ::int64_t{0}, /*decltype(_impl_.kind_)*/ 0, - /*decltype(_impl_._cached_size_)*/ {}, } {} -struct Int64TypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR Int64TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~Int64TypeDefaultTypeInternal() {} +struct Int64MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR Int64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Int64MetricDefaultTypeInternal() {} union { - Int64Type _instance; + Int64Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Int64TypeDefaultTypeInternal _Int64Type_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Int64MetricDefaultTypeInternal _Int64Metric_default_instance_; template -PROTOBUF_CONSTEXPR UInt32Type::UInt32Type(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR UInt32Metric::UInt32Metric(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, @@ -99,21 +92,26 @@ PROTOBUF_CONSTEXPR UInt32Type::UInt32Type(::_pbi::ConstantInitialized) /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0u, /*decltype(_impl_.max_)*/ 0u, - /*decltype(_impl_._cached_size_)*/ {}, } {} -struct UInt32TypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR UInt32TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~UInt32TypeDefaultTypeInternal() {} +struct UInt32MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR UInt32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~UInt32MetricDefaultTypeInternal() {} union { - UInt32Type _instance; + UInt32Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UInt32TypeDefaultTypeInternal _UInt32Type_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UInt32MetricDefaultTypeInternal _UInt32Metric_default_instance_; template -PROTOBUF_CONSTEXPR Int32Type::Int32Type(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Int32Metric::Int32Metric(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, @@ -121,21 +119,26 @@ PROTOBUF_CONSTEXPR Int32Type::Int32Type(::_pbi::ConstantInitialized) /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, - /*decltype(_impl_._cached_size_)*/ {}, } {} -struct Int32TypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR Int32TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~Int32TypeDefaultTypeInternal() {} +struct Int32MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR Int32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Int32MetricDefaultTypeInternal() {} union { - Int32Type _instance; + Int32Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Int32TypeDefaultTypeInternal _Int32Type_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Int32MetricDefaultTypeInternal _Int32Metric_default_instance_; template -PROTOBUF_CONSTEXPR Float64Type::Float64Type(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Float64Metric::Float64Metric(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, @@ -143,21 +146,26 @@ PROTOBUF_CONSTEXPR Float64Type::Float64Type(::_pbi::ConstantInitialized) /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, /*decltype(_impl_.kind_)*/ 0, - /*decltype(_impl_._cached_size_)*/ {}, } {} -struct Float64TypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR Float64TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~Float64TypeDefaultTypeInternal() {} +struct Float64MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR Float64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Float64MetricDefaultTypeInternal() {} union { - Float64Type _instance; + Float64Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Float64TypeDefaultTypeInternal _Float64Type_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Float64MetricDefaultTypeInternal _Float64Metric_default_instance_; template -PROTOBUF_CONSTEXPR Float32Type::Float32Type(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Float32Metric::Float32Metric(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, @@ -165,40 +173,44 @@ PROTOBUF_CONSTEXPR Float32Type::Float32Type(::_pbi::ConstantInitialized) /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, - /*decltype(_impl_._cached_size_)*/ {}, } {} -struct Float32TypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR Float32TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~Float32TypeDefaultTypeInternal() {} +struct Float32MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR Float32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Float32MetricDefaultTypeInternal() {} union { - Float32Type _instance; + Float32Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Float32TypeDefaultTypeInternal _Float32Type_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Float32MetricDefaultTypeInternal _Float32Metric_default_instance_; template -PROTOBUF_CONSTEXPR BoolType::BoolType(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR BoolMetric::BoolMetric(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, /*decltype(_impl_.unit_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.kind_)*/ 0, - /*decltype(_impl_._cached_size_)*/ {}, } {} -struct BoolTypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR BoolTypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~BoolTypeDefaultTypeInternal() {} +struct BoolMetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR BoolMetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~BoolMetricDefaultTypeInternal() {} union { - BoolType _instance; + BoolMetric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BoolTypeDefaultTypeInternal _BoolType_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BoolMetricDefaultTypeInternal _BoolMetric_default_instance_; template -PROTOBUF_CONSTEXPR EnumInfo::EnumInfo(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR EnumValue::EnumValue(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, @@ -210,46 +222,72 @@ PROTOBUF_CONSTEXPR EnumInfo::EnumInfo(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.severity_)*/ 0u, } {} -struct EnumInfoDefaultTypeInternal { - PROTOBUF_CONSTEXPR EnumInfoDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~EnumInfoDefaultTypeInternal() {} +struct EnumValueDefaultTypeInternal { + PROTOBUF_CONSTEXPR EnumValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~EnumValueDefaultTypeInternal() {} union { - EnumInfo _instance; + EnumValue _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumInfoDefaultTypeInternal _EnumInfo_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumValueDefaultTypeInternal _EnumValue_default_instance_; template -PROTOBUF_CONSTEXPR EnumType_EnumMapEntry_DoNotUse::EnumType_EnumMapEntry_DoNotUse(::_pbi::ConstantInitialized) {} -struct EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal { - PROTOBUF_CONSTEXPR EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal() {} +PROTOBUF_CONSTEXPR Enum8Metric_ValuesEntry_DoNotUse::Enum8Metric_ValuesEntry_DoNotUse(::_pbi::ConstantInitialized) {} +struct Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal() {} + union { + Enum8Metric_ValuesEntry_DoNotUse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal _Enum8Metric_ValuesEntry_DoNotUse_default_instance_; + template +PROTOBUF_CONSTEXPR Enum8Metric::Enum8Metric(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /* decltype(_impl_.values_) */ {}, + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + } {} +struct Enum8MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR Enum8MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Enum8MetricDefaultTypeInternal() {} union { - EnumType_EnumMapEntry_DoNotUse _instance; + Enum8Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal _EnumType_EnumMapEntry_DoNotUse_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Enum8MetricDefaultTypeInternal _Enum8Metric_default_instance_; template -PROTOBUF_CONSTEXPR EnumType::EnumType(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) : _impl_{ - /* decltype(_impl_.enum_map_) */ {}, + /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.type_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} -struct EnumTypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR EnumTypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~EnumTypeDefaultTypeInternal() {} +struct MetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~MetricDefaultTypeInternal() {} union { - EnumType _instance; + Metric _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumTypeDefaultTypeInternal _EnumType_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricDefaultTypeInternal _Metric_default_instance_; template PROTOBUF_CONSTEXPR MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse(::_pbi::ConstantInitialized) {} struct MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal { @@ -281,186 +319,192 @@ struct MetricsMetadataDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; - template -PROTOBUF_CONSTEXPR MetricValue::MetricValue(::_pbi::ConstantInitialized) - : _impl_{ - /*decltype(_impl_.valid_)*/ false, - /*decltype(_impl_.value_)*/ {}, - /*decltype(_impl_._cached_size_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, - } {} -struct MetricValueDefaultTypeInternal { - PROTOBUF_CONSTEXPR MetricValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MetricValueDefaultTypeInternal() {} - union { - MetricValue _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricValueDefaultTypeInternal _MetricValue_default_instance_; - template -PROTOBUF_CONSTEXPR MetricValues::MetricValues(::_pbi::ConstantInitialized) - : _impl_{ - /*decltype(_impl_.values_)*/ {}, - /*decltype(_impl_.sync_value_)*/ 0u, - /*decltype(_impl_._cached_size_)*/ {}, - } {} -struct MetricValuesDefaultTypeInternal { - PROTOBUF_CONSTEXPR MetricValuesDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MetricValuesDefaultTypeInternal() {} - union { - MetricValues _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricValuesDefaultTypeInternal _MetricValues_default_instance_; } // namespace protobuf } // namespace abacus -static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[15]; +static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[2]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.value_offset_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.valid_offset_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.type_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.max_), + ~0u, + ~0u, + 0, + 1, + 2, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _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(::abacus::protobuf::UInt64Type, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _impl_.min_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Type, _impl_.max_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.max_), + ~0u, + ~0u, + 0, + 1, + 2, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _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(::abacus::protobuf::Int64Type, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _impl_.min_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Type, _impl_.max_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.max_), + ~0u, + ~0u, + 0, + 1, + 2, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _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(::abacus::protobuf::UInt32Type, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _impl_.min_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Type, _impl_.max_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.max_), + ~0u, + ~0u, + 0, + 1, + 2, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _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(::abacus::protobuf::Int32Type, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _impl_.min_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Type, _impl_.max_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.max_), + ~0u, + ~0u, + 0, + 1, + 2, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _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(::abacus::protobuf::Float64Type, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _impl_.min_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Type, _impl_.max_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.min_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.max_), + ~0u, + ~0u, + 0, + 1, + 2, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _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(::abacus::protobuf::Float32Type, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _impl_.min_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Type, _impl_.max_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolType, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.unit_), + ~0u, + ~0u, + 0, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumValue, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumValue, _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(::abacus::protobuf::BoolType, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolType, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumValue, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumValue, _impl_.description_), + ~0u, + 0, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse, _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(::abacus::protobuf::EnumInfo, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumInfo, _impl_.severity_), - ~0u, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse, value_), 0, 1, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, _has_bits_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _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(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, key_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse, value_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.values_), + ~0u, 0, - 1, + ~0u, ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumType, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::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(::abacus::protobuf::EnumType, _impl_.enum_map_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.offset_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.type_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, _has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, _internal_metadata_), ~0u, // no _extensions_ @@ -485,137 +529,107 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.endianness_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.sync_value_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.metrics_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_._oneof_case_[0]), - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_.valid_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_.value_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValues, _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(::abacus::protobuf::MetricValues, _impl_.sync_value_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValues, _impl_.values_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {20, -1, -1, sizeof(::abacus::protobuf::UInt64Type)}, - {32, -1, -1, sizeof(::abacus::protobuf::Int64Type)}, - {44, -1, -1, sizeof(::abacus::protobuf::UInt32Type)}, - {56, -1, -1, sizeof(::abacus::protobuf::Int32Type)}, - {68, -1, -1, sizeof(::abacus::protobuf::Float64Type)}, - {80, -1, -1, sizeof(::abacus::protobuf::Float32Type)}, - {92, -1, -1, sizeof(::abacus::protobuf::BoolType)}, - {102, 113, -1, sizeof(::abacus::protobuf::EnumInfo)}, - {116, 126, -1, sizeof(::abacus::protobuf::EnumType_EnumMapEntry_DoNotUse)}, - {128, -1, -1, sizeof(::abacus::protobuf::EnumType)}, - {137, 147, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {149, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, - {161, -1, -1, sizeof(::abacus::protobuf::MetricValue)}, - {179, -1, -1, sizeof(::abacus::protobuf::MetricValues)}, + {0, 13, -1, sizeof(::abacus::protobuf::UInt64Metric)}, + {18, 31, -1, sizeof(::abacus::protobuf::Int64Metric)}, + {36, 49, -1, sizeof(::abacus::protobuf::UInt32Metric)}, + {54, 67, -1, sizeof(::abacus::protobuf::Int32Metric)}, + {72, 85, -1, sizeof(::abacus::protobuf::Float64Metric)}, + {90, 103, -1, sizeof(::abacus::protobuf::Float32Metric)}, + {108, 119, -1, sizeof(::abacus::protobuf::BoolMetric)}, + {122, 132, -1, sizeof(::abacus::protobuf::EnumValue)}, + {134, 144, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, + {146, 157, -1, sizeof(::abacus::protobuf::Enum8Metric)}, + {160, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {178, 188, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {190, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::abacus::protobuf::_UInt64Metric_default_instance_._instance, + &::abacus::protobuf::_Int64Metric_default_instance_._instance, + &::abacus::protobuf::_UInt32Metric_default_instance_._instance, + &::abacus::protobuf::_Int32Metric_default_instance_._instance, + &::abacus::protobuf::_Float64Metric_default_instance_._instance, + &::abacus::protobuf::_Float32Metric_default_instance_._instance, + &::abacus::protobuf::_BoolMetric_default_instance_._instance, + &::abacus::protobuf::_EnumValue_default_instance_._instance, + &::abacus::protobuf::_Enum8Metric_ValuesEntry_DoNotUse_default_instance_._instance, + &::abacus::protobuf::_Enum8Metric_default_instance_._instance, &::abacus::protobuf::_Metric_default_instance_._instance, - &::abacus::protobuf::_UInt64Type_default_instance_._instance, - &::abacus::protobuf::_Int64Type_default_instance_._instance, - &::abacus::protobuf::_UInt32Type_default_instance_._instance, - &::abacus::protobuf::_Int32Type_default_instance_._instance, - &::abacus::protobuf::_Float64Type_default_instance_._instance, - &::abacus::protobuf::_Float32Type_default_instance_._instance, - &::abacus::protobuf::_BoolType_default_instance_._instance, - &::abacus::protobuf::_EnumInfo_default_instance_._instance, - &::abacus::protobuf::_EnumType_EnumMapEntry_DoNotUse_default_instance_._instance, - &::abacus::protobuf::_EnumType_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_MetricsEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_default_instance_._instance, - &::abacus::protobuf::_MetricValue_default_instance_._instance, - &::abacus::protobuf::_MetricValues_default_instance_._instance, }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." - "protobuf\"\351\003\n\006Metric\022\023\n\013description\030\001 \001(\t" - "\022\024\n\014value_offset\030\002 \001(\r\022\024\n\014valid_offset\030\003" - " \001(\r\0222\n\013uint64_type\030\004 \001(\0132\033.abacus.proto" - "buf.UInt64TypeH\000\0220\n\nint64_type\030\005 \001(\0132\032.a" - "bacus.protobuf.Int64TypeH\000\0222\n\013uint32_typ" - "e\030\006 \001(\0132\033.abacus.protobuf.UInt32TypeH\000\0220" - "\n\nint32_type\030\007 \001(\0132\032.abacus.protobuf.Int" - "32TypeH\000\0224\n\014float64_type\030\010 \001(\0132\034.abacus." - "protobuf.Float64TypeH\000\0224\n\014float32_type\030\t" - " \001(\0132\034.abacus.protobuf.Float32TypeH\000\022.\n\t" - "bool_type\030\n \001(\0132\031.abacus.protobuf.BoolTy" - "peH\000\022.\n\tenum_type\030\013 \001(\0132\031.abacus.protobu" - "f.EnumTypeH\000B\006\n\004type\"Y\n\nUInt64Type\022\014\n\004un" - "it\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf" - ".Kind\022\013\n\003min\030\003 \001(\004\022\013\n\003max\030\004 \001(\004\"X\n\tInt64" - "Type\022\014\n\004unit\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacu" - "s.protobuf.Kind\022\013\n\003min\030\003 \001(\003\022\013\n\003max\030\004 \001(" - "\003\"Y\n\nUInt32Type\022\014\n\004unit\030\001 \001(\t\022#\n\004kind\030\002 " - "\001(\0162\025.abacus.protobuf.Kind\022\013\n\003min\030\003 \001(\r\022" - "\013\n\003max\030\004 \001(\r\"X\n\tInt32Type\022\014\n\004unit\030\001 \001(\t\022" - "#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\013\n\003" - "min\030\003 \001(\005\022\013\n\003max\030\004 \001(\005\"Z\n\013Float64Type\022\014\n" - "\004unit\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.proto" - "buf.Kind\022\013\n\003min\030\003 \001(\001\022\013\n\003max\030\004 \001(\001\"Z\n\013Fl" - "oat32Type\022\014\n\004unit\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025." - "abacus.protobuf.Kind\022\013\n\003min\030\003 \001(\002\022\013\n\003max" - "\030\004 \001(\002\"=\n\010BoolType\022\014\n\004unit\030\001 \001(\t\022#\n\004kind" - "\030\002 \001(\0162\025.abacus.protobuf.Kind\"f\n\010EnumInf" - "o\022\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001" - "\001\022\025\n\010severity\030\003 \001(\rH\001\210\001\001B\016\n\014_description" - "B\013\n\t_severity\"\217\001\n\010EnumType\0228\n\010enum_map\030\001" - " \003(\0132&.abacus.protobuf.EnumType.EnumMapE" - "ntry\032I\n\014EnumMapEntry\022\013\n\003key\030\001 \001(\r\022(\n\005val" - "ue\030\002 \001(\0132\031.abacus.protobuf.EnumInfo:\0028\001\"" - "\371\001\n\017MetricsMetadata\022\030\n\020protocol_version\030" - "\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.abacus.proto" - "buf.Endianness\022\022\n\nsync_value\030\003 \001(\r\022>\n\007me" - "trics\030\004 \003(\0132-.abacus.protobuf.MetricsMet" - "adata.MetricsEntry\032G\n\014MetricsEntry\022\013\n\003ke" - "y\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacus.protobuf" - ".Metric:\0028\001\"\341\001\n\013MetricValue\022\r\n\005valid\030\001 \001" - "(\010\022\026\n\014uint64_value\030\002 \001(\004H\000\022\025\n\013int64_valu" - "e\030\003 \001(\003H\000\022\026\n\014uint32_value\030\004 \001(\rH\000\022\025\n\013int" - "32_value\030\005 \001(\005H\000\022\027\n\rfloat32_value\030\006 \001(\002H" - "\000\022\027\n\rfloat64_value\030\007 \001(\001H\000\022\024\n\nbool_value" - "\030\010 \001(\010H\000\022\024\n\nenum_value\030\t \001(\rH\000B\007\n\005value\"" - "P\n\014MetricValues\022\022\n\nsync_value\030\001 \001(\r\022,\n\006v" - "alues\030\002 \003(\0132\034.abacus.protobuf.MetricValu" - "e*,\n\004Kind\022\013\n\007COUNTER\020\000\022\014\n\010CONSTANT\020\001\022\t\n\005" - "GAUGE\020\002*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007\n\003BIG" - "\020\001B\021Z\017abacus/protobufb\006proto3" + "protobuf\"\230\001\n\014UInt64Metric\022\023\n\013description" + "\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.K" + "ind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\004H\001\210\001\001" + "\022\020\n\003max\030\005 \001(\004H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_" + "max\"\227\001\n\013Int64Metric\022\023\n\013description\030\001 \001(\t" + "\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021\n" + "\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\003H\001\210\001\001\022\020\n\003ma" + "x\030\005 \001(\003H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\230\001" + "\n\014UInt32Metric\022\023\n\013description\030\001 \001(\t\022#\n\004k" + "ind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit" + "\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\rH\001\210\001\001\022\020\n\003max\030\005 \001" + "(\rH\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\227\001\n\013Int" + "32Metric\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 " + "\001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\t" + "H\000\210\001\001\022\020\n\003min\030\004 \001(\005H\001\210\001\001\022\020\n\003max\030\005 \001(\005H\002\210\001" + "\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\231\001\n\rFloat64Me" + "tric\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162" + "\025.abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001" + "\001\022\020\n\003min\030\004 \001(\001H\001\210\001\001\022\020\n\003max\030\005 \001(\001H\002\210\001\001B\007\n" + "\005_unitB\006\n\004_minB\006\n\004_max\"\231\001\n\rFloat32Metric" + "\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.ab" + "acus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n" + "\003min\030\004 \001(\002H\001\210\001\001\022\020\n\003max\030\005 \001(\002H\002\210\001\001B\007\n\005_un" + "itB\006\n\004_minB\006\n\004_max\"b\n\nBoolMetric\022\023\n\013desc" + "ription\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.pro" + "tobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001B\007\n\005_unit\"C" + "\n\tEnumValue\022\014\n\004name\030\001 \001(\t\022\030\n\013description" + "\030\002 \001(\tH\000\210\001\001B\016\n\014_description\"\303\001\n\013Enum8Met" + "ric\022\023\n\013description\030\001 \001(\t\022\021\n\004unit\030\002 \001(\tH\000" + "\210\001\001\0228\n\006values\030\003 \003(\0132(.abacus.protobuf.En" + "um8Metric.ValuesEntry\032I\n\013ValuesEntry\022\013\n\003" + "key\030\001 \001(\r\022)\n\005value\030\002 \001(\0132\032.abacus.protob" + "uf.EnumValue:\0028\001B\007\n\005_unit\"\245\003\n\006Metric\022\016\n\006" + "offset\030\001 \001(\r\022/\n\006uint64\030\002 \001(\0132\035.abacus.pr" + "otobuf.UInt64MetricH\000\022-\n\005int64\030\003 \001(\0132\034.a" + "bacus.protobuf.Int64MetricH\000\022/\n\006uint32\030\004" + " \001(\0132\035.abacus.protobuf.UInt32MetricH\000\022-\n" + "\005int32\030\005 \001(\0132\034.abacus.protobuf.Int32Metr" + "icH\000\0221\n\007float64\030\006 \001(\0132\036.abacus.protobuf." + "Float64MetricH\000\0221\n\007float32\030\007 \001(\0132\036.abacu" + "s.protobuf.Float32MetricH\000\022.\n\007boolean\030\010 " + "\001(\0132\033.abacus.protobuf.BoolMetricH\000\022-\n\005en" + "um8\030\t \001(\0132\034.abacus.protobuf.Enum8MetricH" + "\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030\n\020protoco" + "l_version\030\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.ab" + "acus.protobuf.Endianness\022\022\n\nsync_value\030\003" + " \001(\r\022>\n\007metrics\030\004 \003(\0132-.abacus.protobuf." + "MetricsMetadata.MetricsEntry\032G\n\014MetricsE" + "ntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacu" + "s.protobuf.Metric:\0028\001*,\n\004Kind\022\013\n\007COUNTER" + "\020\000\022\014\n\010CONSTANT\020\001\022\t\n\005GAUGE\020\002*!\n\nEndiannes" + "s\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/protobu" + "fb\006proto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2069, + 2129, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, nullptr, 0, - 15, + 13, schemas, file_default_instances, TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets, @@ -672,792 +686,117 @@ bool Endianness_IsValid(int value) { } // =================================================================== -class Metric::_Internal { +class UInt64Metric::_Internal { public: - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::UInt64Type& uint64_type(const Metric* msg); - static const ::abacus::protobuf::Int64Type& int64_type(const Metric* msg); - static const ::abacus::protobuf::UInt32Type& uint32_type(const Metric* msg); - static const ::abacus::protobuf::Int32Type& int32_type(const Metric* msg); - static const ::abacus::protobuf::Float64Type& float64_type(const Metric* msg); - static const ::abacus::protobuf::Float32Type& float32_type(const Metric* msg); - static const ::abacus::protobuf::BoolType& bool_type(const Metric* msg); - static const ::abacus::protobuf::EnumType& enum_type(const Metric* msg); + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; -const ::abacus::protobuf::UInt64Type& Metric::_Internal::uint64_type(const Metric* msg) { - return *msg->_impl_.type_.uint64_type_; -} -const ::abacus::protobuf::Int64Type& Metric::_Internal::int64_type(const Metric* msg) { - return *msg->_impl_.type_.int64_type_; -} -const ::abacus::protobuf::UInt32Type& Metric::_Internal::uint32_type(const Metric* msg) { - return *msg->_impl_.type_.uint32_type_; -} -const ::abacus::protobuf::Int32Type& Metric::_Internal::int32_type(const Metric* msg) { - return *msg->_impl_.type_.int32_type_; -} -const ::abacus::protobuf::Float64Type& Metric::_Internal::float64_type(const Metric* msg) { - return *msg->_impl_.type_.float64_type_; -} -const ::abacus::protobuf::Float32Type& Metric::_Internal::float32_type(const Metric* msg) { - return *msg->_impl_.type_.float32_type_; -} -const ::abacus::protobuf::BoolType& Metric::_Internal::bool_type(const Metric* msg) { - return *msg->_impl_.type_.bool_type_; -} -const ::abacus::protobuf::EnumType& Metric::_Internal::enum_type(const Metric* msg) { - return *msg->_impl_.type_.enum_type_; +UInt64Metric::UInt64Metric(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt64Metric) } -void Metric::set_allocated_uint64_type(::abacus::protobuf::UInt64Type* uint64_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (uint64_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(uint64_type); - if (message_arena != submessage_arena) { - uint64_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, uint64_type, submessage_arena); - } - set_has_uint64_type(); - _impl_.type_.uint64_type_ = uint64_type; +UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Message() { + UInt64Metric* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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()); } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.uint64_type) -} -void Metric::set_allocated_int64_type(::abacus::protobuf::Int64Type* int64_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (int64_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(int64_type); - if (message_arena != submessage_arena) { - int64_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, int64_type, submessage_arena); - } - set_has_int64_type(); - _impl_.type_.int64_type_ = int64_type; + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.int64_type) + ::memcpy(&_impl_.min_, &from._impl_.min_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Metric) } -void Metric::set_allocated_uint32_type(::abacus::protobuf::UInt32Type* uint32_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (uint32_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(uint32_type); - if (message_arena != submessage_arena) { - uint32_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, uint32_type, submessage_arena); - } - set_has_uint32_type(); - _impl_.type_.uint32_type_ = uint32_type; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.uint32_type) -} -void Metric::set_allocated_int32_type(::abacus::protobuf::Int32Type* int32_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (int32_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(int32_type); - if (message_arena != submessage_arena) { - int32_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, int32_type, submessage_arena); - } - set_has_int32_type(); - _impl_.type_.int32_type_ = int32_type; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.int32_type) -} -void Metric::set_allocated_float64_type(::abacus::protobuf::Float64Type* float64_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (float64_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(float64_type); - if (message_arena != submessage_arena) { - float64_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, float64_type, submessage_arena); - } - set_has_float64_type(); - _impl_.type_.float64_type_ = float64_type; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.float64_type) -} -void Metric::set_allocated_float32_type(::abacus::protobuf::Float32Type* float32_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (float32_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(float32_type); - if (message_arena != submessage_arena) { - float32_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, float32_type, submessage_arena); - } - set_has_float32_type(); - _impl_.type_.float32_type_ = float32_type; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.float32_type) -} -void Metric::set_allocated_bool_type(::abacus::protobuf::BoolType* bool_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (bool_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(bool_type); - if (message_arena != submessage_arena) { - bool_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, bool_type, submessage_arena); - } - set_has_bool_type(); - _impl_.type_.bool_type_ = bool_type; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.bool_type) -} -void Metric::set_allocated_enum_type(::abacus::protobuf::EnumType* enum_type) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (enum_type) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(enum_type); - if (message_arena != submessage_arena) { - enum_type = ::google::protobuf::internal::GetOwnedMessage( - message_arena, enum_type, submessage_arena); - } - set_has_enum_type(); - _impl_.type_.enum_type_ = enum_type; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.enum_type) -} -Metric::Metric(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Metric) -} -Metric::Metric(const Metric& from) : ::google::protobuf::Message() { - Metric* const _this = this; - (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.description_){}, - decltype(_impl_.value_offset_){}, - decltype(_impl_.valid_offset_){}, - decltype(_impl_.type_){}, - /*decltype(_impl_._cached_size_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, - }; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - _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()); - } - ::memcpy(&_impl_.value_offset_, &from._impl_.value_offset_, - static_cast<::size_t>(reinterpret_cast(&_impl_.valid_offset_) - - reinterpret_cast(&_impl_.value_offset_)) + sizeof(_impl_.valid_offset_)); - clear_has_type(); - switch (from.type_case()) { - case kUint64Type: { - _this->_internal_mutable_uint64_type()->::abacus::protobuf::UInt64Type::MergeFrom( - from._internal_uint64_type()); - break; - } - case kInt64Type: { - _this->_internal_mutable_int64_type()->::abacus::protobuf::Int64Type::MergeFrom( - from._internal_int64_type()); - break; - } - case kUint32Type: { - _this->_internal_mutable_uint32_type()->::abacus::protobuf::UInt32Type::MergeFrom( - from._internal_uint32_type()); - break; - } - case kInt32Type: { - _this->_internal_mutable_int32_type()->::abacus::protobuf::Int32Type::MergeFrom( - from._internal_int32_type()); - break; - } - case kFloat64Type: { - _this->_internal_mutable_float64_type()->::abacus::protobuf::Float64Type::MergeFrom( - from._internal_float64_type()); - break; - } - case kFloat32Type: { - _this->_internal_mutable_float32_type()->::abacus::protobuf::Float32Type::MergeFrom( - from._internal_float32_type()); - break; - } - case kBoolType: { - _this->_internal_mutable_bool_type()->::abacus::protobuf::BoolType::MergeFrom( - from._internal_bool_type()); - break; - } - case kEnumType: { - _this->_internal_mutable_enum_type()->::abacus::protobuf::EnumType::MergeFrom( - from._internal_enum_type()); - break; - } - case TYPE_NOT_SET: { - break; - } - } - - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Metric) -} -inline void Metric::SharedCtor(::_pb::Arena* arena) { +inline void UInt64Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.description_){}, - decltype(_impl_.value_offset_){0u}, - decltype(_impl_.valid_offset_){0u}, - decltype(_impl_.type_){}, - /*decltype(_impl_._cached_size_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, - }; - _impl_.description_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.description_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_type(); -} -Metric::~Metric() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Metric) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Metric::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.description_.Destroy(); - if (has_type()) { - clear_type(); - } -} -void Metric::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void Metric::clear_type() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Metric) - switch (type_case()) { - case kUint64Type: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.uint64_type_; - } - break; - } - case kInt64Type: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.int64_type_; - } - break; - } - case kUint32Type: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.uint32_type_; - } - break; - } - case kInt32Type: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.int32_type_; - } - break; - } - case kFloat64Type: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.float64_type_; - } - break; - } - case kFloat32Type: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.float32_type_; - } - break; - } - case kBoolType: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.bool_type_; - } - break; - } - case kEnumType: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.enum_type_; - } - break; - } - case TYPE_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = TYPE_NOT_SET; -} - - -PROTOBUF_NOINLINE void Metric::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Metric) - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.description_.ClearToEmpty(); - ::memset(&_impl_.value_offset_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.valid_offset_) - - reinterpret_cast(&_impl_.value_offset_)) + sizeof(_impl_.valid_offset_)); - clear_type(); - _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<2, 11, 8, 50, 2> Metric::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 11, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294965248, // skipmap - offsetof(decltype(_table_), field_entries), - 11, // num_field_entries - 8, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_Metric_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; - {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.description_)}}, - // uint32 value_offset = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.value_offset_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_offset_)}}, - // uint32 valid_offset = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.valid_offset_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.valid_offset_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // string description = 1; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.description_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint32 value_offset = 2; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_offset_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // uint32 valid_offset = 3; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.valid_offset_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // .abacus.protobuf.UInt64Type uint64_type = 4; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_type_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Int64Type int64_type = 5; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int64_type_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.UInt32Type uint32_type = 6; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint32_type_), _Internal::kOneofCaseOffset + 0, 2, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Int32Type int32_type = 7; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int32_type_), _Internal::kOneofCaseOffset + 0, 3, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Float64Type float64_type = 8; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float64_type_), _Internal::kOneofCaseOffset + 0, 4, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Float32Type float32_type = 9; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float32_type_), _Internal::kOneofCaseOffset + 0, 5, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.BoolType bool_type = 10; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.bool_type_), _Internal::kOneofCaseOffset + 0, 6, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.EnumType enum_type = 11; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.enum_type_), _Internal::kOneofCaseOffset + 0, 7, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt64Type>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Int64Type>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt32Type>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Int32Type>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Float64Type>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Float32Type>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::BoolType>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::EnumType>()}, - }}, {{ - "\26\13\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "abacus.protobuf.Metric" - "description" - }}, -}; - -::uint8_t* Metric::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Metric) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // string description = 1; - 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, "abacus.protobuf.Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); - } - - // uint32 value_offset = 2; - if (this->_internal_value_offset() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 2, this->_internal_value_offset(), target); - } - - // uint32 valid_offset = 3; - if (this->_internal_valid_offset() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 3, this->_internal_valid_offset(), target); - } - - switch (type_case()) { - case kUint64Type: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::uint64_type(this), - _Internal::uint64_type(this).GetCachedSize(), target, stream); - break; - } - case kInt64Type: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::int64_type(this), - _Internal::int64_type(this).GetCachedSize(), target, stream); - break; - } - case kUint32Type: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(6, _Internal::uint32_type(this), - _Internal::uint32_type(this).GetCachedSize(), target, stream); - break; - } - case kInt32Type: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::int32_type(this), - _Internal::int32_type(this).GetCachedSize(), target, stream); - break; - } - case kFloat64Type: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::float64_type(this), - _Internal::float64_type(this).GetCachedSize(), target, stream); - break; - } - case kFloat32Type: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(9, _Internal::float32_type(this), - _Internal::float32_type(this).GetCachedSize(), target, stream); - break; - } - case kBoolType: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(10, _Internal::bool_type(this), - _Internal::bool_type(this).GetCachedSize(), target, stream); - break; - } - case kEnumType: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(11, _Internal::enum_type(this), - _Internal::enum_type(this).GetCachedSize(), target, stream); - 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:abacus.protobuf.Metric) - return target; -} - -::size_t Metric::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.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; - - // string description = 1; - if (!this->_internal_description().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_description()); - } - - // uint32 value_offset = 2; - if (this->_internal_value_offset() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_value_offset()); - } - - // uint32 valid_offset = 3; - if (this->_internal_valid_offset() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_valid_offset()); - } - - switch (type_case()) { - // .abacus.protobuf.UInt64Type uint64_type = 4; - case kUint64Type: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.uint64_type_); - break; - } - // .abacus.protobuf.Int64Type int64_type = 5; - case kInt64Type: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.int64_type_); - break; - } - // .abacus.protobuf.UInt32Type uint32_type = 6; - case kUint32Type: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.uint32_type_); - break; - } - // .abacus.protobuf.Int32Type int32_type = 7; - case kInt32Type: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.int32_type_); - break; - } - // .abacus.protobuf.Float64Type float64_type = 8; - case kFloat64Type: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.float64_type_); - break; - } - // .abacus.protobuf.Float32Type float32_type = 9; - case kFloat32Type: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.float32_type_); - break; - } - // .abacus.protobuf.BoolType bool_type = 10; - case kBoolType: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.bool_type_); - break; - } - // .abacus.protobuf.EnumType enum_type = 11; - case kEnumType: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.enum_type_); - break; - } - case TYPE_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:abacus.protobuf.Metric) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_description().empty()) { - _this->_internal_set_description(from._internal_description()); - } - if (from._internal_value_offset() != 0) { - _this->_internal_set_value_offset(from._internal_value_offset()); - } - if (from._internal_valid_offset() != 0) { - _this->_internal_set_valid_offset(from._internal_valid_offset()); - } - switch (from.type_case()) { - case kUint64Type: { - _this->_internal_mutable_uint64_type()->::abacus::protobuf::UInt64Type::MergeFrom( - from._internal_uint64_type()); - break; - } - case kInt64Type: { - _this->_internal_mutable_int64_type()->::abacus::protobuf::Int64Type::MergeFrom( - from._internal_int64_type()); - break; - } - case kUint32Type: { - _this->_internal_mutable_uint32_type()->::abacus::protobuf::UInt32Type::MergeFrom( - from._internal_uint32_type()); - break; - } - case kInt32Type: { - _this->_internal_mutable_int32_type()->::abacus::protobuf::Int32Type::MergeFrom( - from._internal_int32_type()); - break; - } - case kFloat64Type: { - _this->_internal_mutable_float64_type()->::abacus::protobuf::Float64Type::MergeFrom( - from._internal_float64_type()); - break; - } - case kFloat32Type: { - _this->_internal_mutable_float32_type()->::abacus::protobuf::Float32Type::MergeFrom( - from._internal_float32_type()); - break; - } - case kBoolType: { - _this->_internal_mutable_bool_type()->::abacus::protobuf::BoolType::MergeFrom( - from._internal_bool_type()); - break; - } - case kEnumType: { - _this->_internal_mutable_enum_type()->::abacus::protobuf::EnumType::MergeFrom( - from._internal_enum_type()); - break; - } - case TYPE_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:abacus.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; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, - &other->_impl_.description_, rhs_arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Metric, _impl_.valid_offset_) - + sizeof(Metric::_impl_.valid_offset_) - - PROTOBUF_FIELD_OFFSET(Metric, _impl_.value_offset_)>( - reinterpret_cast(&_impl_.value_offset_), - reinterpret_cast(&other->_impl_.value_offset_)); - swap(_impl_.type_, other->_impl_.type_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); -} - -::google::protobuf::Metadata Metric::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); -} -// =================================================================== - -class UInt64Type::_Internal { - public: -}; - -UInt64Type::UInt64Type(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt64Type) -} -UInt64Type::UInt64Type(const UInt64Type& from) : ::google::protobuf::Message() { - UInt64Type* const _this = this; - (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.unit_){}, - decltype(_impl_.min_){}, - decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, + decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, - }; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - _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_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); - - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Type) -} -inline void UInt64Type::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.min_){::uint64_t{0u}}, decltype(_impl_.max_){::uint64_t{0u}}, decltype(_impl_.kind_){0}, - /*decltype(_impl_._cached_size_)*/ {}, }; + _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 } -UInt64Type::~UInt64Type() { - // @@protoc_insertion_point(destructor:abacus.protobuf.UInt64Type) +UInt64Metric::~UInt64Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.UInt64Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void UInt64Type::SharedDtor() { +inline void UInt64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); _impl_.unit_.Destroy(); } -void UInt64Type::SetCachedSize(int size) const { +void UInt64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void UInt64Type::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt64Type) +PROTOBUF_NOINLINE void UInt64Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt64Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.unit_.ClearToEmpty(); - ::memset(&_impl_.min_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + _impl_.kind_ = 0; + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* UInt64Type::_InternalParse( +const char* UInt64Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -1465,68 +804,78 @@ const char* UInt64Type::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 39, 2> UInt64Type::_table_ = { +const ::_pbi::TcParseTable<3, 5, 0, 52, 2> UInt64Metric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 5, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_UInt64Type_default_instance_._instance, + &_UInt64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // uint64 max = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Type, _impl_.max_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.max_)}}, - // string unit = 1; + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.unit_)}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_)}}, // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Type, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.kind_)}}, - // uint64 min = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Type, _impl_.min_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.min_)}}, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Metric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, + // optional uint64 min = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.min_), 1>(), + {32, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, + // optional uint64 max = 5; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), + {40, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string unit = 1; - {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.unit_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.kind_), 0, 0, + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // uint64 min = 3; - {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.min_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // uint64 max = 4; - {PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.max_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, + // optional string unit = 3; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional uint64 min = 4; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // optional uint64 max = 5; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, }}, // no aux_entries {{ - "\32\4\0\0\0\0\0\0" - "abacus.protobuf.UInt64Type" + "\34\13\0\4\0\0\0\0" + "abacus.protobuf.UInt64Metric" + "description" "unit" }}, }; -::uint8_t* UInt64Type::_InternalSerialize( +::uint8_t* UInt64Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt64Type) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt64Metric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string unit = 1; - if (!this->_internal_unit().empty()) { - const std::string& _s = this->_internal_unit(); + // string description = 1; + 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, "abacus.protobuf.UInt64Type.unit"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt64Metric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -1537,18 +886,27 @@ ::uint8_t* UInt64Type::_InternalSerialize( 2, this->_internal_kind(), target); } - // uint64 min = 3; - if (this->_internal_min() != 0) { + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt64Metric.unit"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + + // optional uint64 min = 4; + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 3, this->_internal_min(), target); + 4, this->_internal_min(), target); } - // uint64 max = 4; - if (this->_internal_max() != 0) { + // optional uint64 max = 5; + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 4, this->_internal_max(), target); + 5, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1556,36 +914,45 @@ ::uint8_t* UInt64Type::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.UInt64Type) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.UInt64Metric) return target; } -::size_t UInt64Type::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.UInt64Type) +::size_t UInt64Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.UInt64Metric) ::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 unit = 1; - if (!this->_internal_unit().empty()) { + // string description = 1; + if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); + this->_internal_description()); } - // uint64 min = 3; - if (this->_internal_min() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_min()); - } + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } - // uint64 max = 4; - if (this->_internal_max() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_max()); - } + // optional uint64 min = 4; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_min()); + } + + // optional uint64 max = 5; + if (cached_has_bits & 0x00000004u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_max()); + } + } // .abacus.protobuf.Kind kind = 2; if (this->_internal_kind() != 0) { total_size += 1 + @@ -1595,29 +962,36 @@ ::size_t UInt64Type::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData UInt64Type::_class_data_ = { +const ::google::protobuf::Message::ClassData UInt64Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - UInt64Type::MergeImpl + UInt64Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*UInt64Type::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*UInt64Metric::GetClassData() const { return &_class_data_; } -void UInt64Type::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:abacus.protobuf.UInt64Type) +void UInt64Metric::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:abacus.protobuf.UInt64Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_unit().empty()) { - _this->_internal_set_unit(from._internal_unit()); - } - if (from._internal_min() != 0) { - _this->_internal_set_min(from._internal_min()); + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); } - if (from._internal_max() != 0) { - _this->_internal_set_max(from._internal_max()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_unit(from._internal_unit()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.min_ = from._impl_.min_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.max_ = from._impl_.max_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); @@ -1625,114 +999,153 @@ void UInt64Type::MergeImpl(::google::protobuf::Message& to_msg, const ::google:: _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void UInt64Type::CopyFrom(const UInt64Type& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.UInt64Type) +void UInt64Metric::CopyFrom(const UInt64Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.UInt64Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool UInt64Type::IsInitialized() const { +PROTOBUF_NOINLINE bool UInt64Metric::IsInitialized() const { return true; } -void UInt64Type::InternalSwap(UInt64Type* other) { +void UInt64Metric::InternalSwap(UInt64Metric* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_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(UInt64Type, _impl_.kind_) - + sizeof(UInt64Type::_impl_.kind_) - - PROTOBUF_FIELD_OFFSET(UInt64Type, _impl_.min_)>( + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_) + + sizeof(UInt64Metric::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); } -::google::protobuf::Metadata UInt64Type::GetMetadata() const { +::google::protobuf::Metadata UInt64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); } // =================================================================== -class Int64Type::_Internal { +class Int64Metric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; -Int64Type::Int64Type(::google::protobuf::Arena* arena) +Int64Metric::Int64Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Int64Type) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Int64Metric) } -Int64Type::Int64Type(const Int64Type& from) : ::google::protobuf::Message() { - Int64Type* const _this = this; +Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message() { + Int64Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, decltype(_impl_.kind_){}, - /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); + _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()) { + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.min_, &from._impl_.min_, static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int64Type) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int64Metric) } -inline void Int64Type::SharedCtor(::_pb::Arena* arena) { +inline void Int64Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.min_){::int64_t{0}}, decltype(_impl_.max_){::int64_t{0}}, decltype(_impl_.kind_){0}, - /*decltype(_impl_._cached_size_)*/ {}, }; + _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 } -Int64Type::~Int64Type() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Int64Type) +Int64Metric::~Int64Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Int64Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Int64Type::SharedDtor() { +inline void Int64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); _impl_.unit_.Destroy(); } -void Int64Type::SetCachedSize(int size) const { +void Int64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void Int64Type::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int64Type) +PROTOBUF_NOINLINE void Int64Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int64Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.unit_.ClearToEmpty(); - ::memset(&_impl_.min_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + _impl_.kind_ = 0; + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Int64Type::_InternalParse( +const char* Int64Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -1740,68 +1153,78 @@ const char* Int64Type::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 38, 2> Int64Type::_table_ = { +const ::_pbi::TcParseTable<3, 5, 0, 51, 2> Int64Metric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 5, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_Int64Type_default_instance_._instance, + &_Int64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // int64 max = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Type, _impl_.max_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.max_)}}, - // string unit = 1; + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.unit_)}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_)}}, // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Type, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.kind_)}}, - // int64 min = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Type, _impl_.min_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.min_)}}, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Metric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, + // optional int64 min = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.min_), 1>(), + {32, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, + // optional int64 max = 5; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.max_), 2>(), + {40, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string unit = 1; - {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.unit_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.kind_), 0, 0, + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // int64 min = 3; - {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.min_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kInt64)}, - // int64 max = 4; - {PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.max_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kInt64)}, + // optional string unit = 3; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional int64 min = 4; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, + // optional int64 max = 5; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, }}, // no aux_entries {{ - "\31\4\0\0\0\0\0\0" - "abacus.protobuf.Int64Type" + "\33\13\0\4\0\0\0\0" + "abacus.protobuf.Int64Metric" + "description" "unit" }}, }; -::uint8_t* Int64Type::_InternalSerialize( +::uint8_t* Int64Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Int64Type) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Int64Metric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string unit = 1; - if (!this->_internal_unit().empty()) { - const std::string& _s = this->_internal_unit(); + // string description = 1; + 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, "abacus.protobuf.Int64Type.unit"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int64Metric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -1812,17 +1235,26 @@ ::uint8_t* Int64Type::_InternalSerialize( 2, this->_internal_kind(), target); } - // int64 min = 3; - if (this->_internal_min() != 0) { + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int64Metric.unit"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + + // optional int64 min = 4; + if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<3>( + WriteInt64ToArrayWithField<4>( stream, this->_internal_min(), target); } - // int64 max = 4; - if (this->_internal_max() != 0) { + // optional int64 max = 5; + if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<4>( + WriteInt64ToArrayWithField<5>( stream, this->_internal_max(), target); } @@ -1831,36 +1263,45 @@ ::uint8_t* Int64Type::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Int64Type) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Int64Metric) return target; } -::size_t Int64Type::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Int64Type) +::size_t Int64Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Int64Metric) ::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 unit = 1; - if (!this->_internal_unit().empty()) { + // string description = 1; + if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); + this->_internal_description()); } - // int64 min = 3; - if (this->_internal_min() != 0) { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( - this->_internal_min()); - } + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } - // int64 max = 4; - if (this->_internal_max() != 0) { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( - this->_internal_max()); - } + // optional int64 min = 4; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_min()); + } + + // optional int64 max = 5; + if (cached_has_bits & 0x00000004u) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_max()); + } + } // .abacus.protobuf.Kind kind = 2; if (this->_internal_kind() != 0) { total_size += 1 + @@ -1870,29 +1311,36 @@ ::size_t Int64Type::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData Int64Type::_class_data_ = { +const ::google::protobuf::Message::ClassData Int64Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - Int64Type::MergeImpl + Int64Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*Int64Type::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Int64Metric::GetClassData() const { return &_class_data_; } -void Int64Type::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:abacus.protobuf.Int64Type) +void Int64Metric::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:abacus.protobuf.Int64Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_unit().empty()) { - _this->_internal_set_unit(from._internal_unit()); - } - if (from._internal_min() != 0) { - _this->_internal_set_min(from._internal_min()); + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); } - if (from._internal_max() != 0) { - _this->_internal_set_max(from._internal_max()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_unit(from._internal_unit()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.min_ = from._impl_.min_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.max_ = from._impl_.max_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); @@ -1900,114 +1348,153 @@ void Int64Type::MergeImpl(::google::protobuf::Message& to_msg, const ::google::p _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void Int64Type::CopyFrom(const Int64Type& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Int64Type) +void Int64Metric::CopyFrom(const Int64Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Int64Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool Int64Type::IsInitialized() const { +PROTOBUF_NOINLINE bool Int64Metric::IsInitialized() const { return true; } -void Int64Type::InternalSwap(Int64Type* other) { +void Int64Metric::InternalSwap(Int64Metric* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_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(Int64Type, _impl_.kind_) - + sizeof(Int64Type::_impl_.kind_) - - PROTOBUF_FIELD_OFFSET(Int64Type, _impl_.min_)>( + PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_) + + sizeof(Int64Metric::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); } -::google::protobuf::Metadata Int64Type::GetMetadata() const { +::google::protobuf::Metadata Int64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); } // =================================================================== -class UInt32Type::_Internal { +class UInt32Metric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; -UInt32Type::UInt32Type(::google::protobuf::Arena* arena) +UInt32Metric::UInt32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt32Type) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt32Metric) } -UInt32Type::UInt32Type(const UInt32Type& from) : ::google::protobuf::Message() { - UInt32Type* const _this = this; +UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Message() { + UInt32Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); + _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()) { + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.kind_, &from._impl_.kind_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt32Type) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt32Metric) } -inline void UInt32Type::SharedCtor(::_pb::Arena* arena) { +inline void UInt32Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){0}, decltype(_impl_.min_){0u}, decltype(_impl_.max_){0u}, - /*decltype(_impl_._cached_size_)*/ {}, }; + _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 } -UInt32Type::~UInt32Type() { - // @@protoc_insertion_point(destructor:abacus.protobuf.UInt32Type) +UInt32Metric::~UInt32Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.UInt32Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void UInt32Type::SharedDtor() { +inline void UInt32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); _impl_.unit_.Destroy(); } -void UInt32Type::SetCachedSize(int size) const { +void UInt32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void UInt32Type::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt32Type) +PROTOBUF_NOINLINE void UInt32Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt32Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.unit_.ClearToEmpty(); - ::memset(&_impl_.kind_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + _impl_.kind_ = 0; + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* UInt32Type::_InternalParse( +const char* UInt32Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -2015,68 +1502,78 @@ const char* UInt32Type::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 39, 2> UInt32Type::_table_ = { +const ::_pbi::TcParseTable<3, 5, 0, 52, 2> UInt32Metric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 5, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_UInt32Type_default_instance_._instance, + &_UInt32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // uint32 max = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Type, _impl_.max_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.max_)}}, - // string unit = 1; + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.unit_)}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_)}}, // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Type, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.kind_)}}, - // uint32 min = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Type, _impl_.min_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.min_)}}, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, + // optional uint32 min = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.min_), 1>(), + {32, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, + // optional uint32 max = 5; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.max_), 2>(), + {40, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string unit = 1; - {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.unit_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.kind_), 0, 0, + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // uint32 min = 3; - {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.min_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // uint32 max = 4; - {PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.max_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // optional string unit = 3; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional uint32 min = 4; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + // optional uint32 max = 5; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, }}, // no aux_entries {{ - "\32\4\0\0\0\0\0\0" - "abacus.protobuf.UInt32Type" + "\34\13\0\4\0\0\0\0" + "abacus.protobuf.UInt32Metric" + "description" "unit" }}, }; -::uint8_t* UInt32Type::_InternalSerialize( +::uint8_t* UInt32Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt32Type) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt32Metric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string unit = 1; - if (!this->_internal_unit().empty()) { - const std::string& _s = this->_internal_unit(); + // string description = 1; + 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, "abacus.protobuf.UInt32Type.unit"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt32Metric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -2087,18 +1584,27 @@ ::uint8_t* UInt32Type::_InternalSerialize( 2, this->_internal_kind(), target); } - // uint32 min = 3; - if (this->_internal_min() != 0) { + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt32Metric.unit"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + + // optional uint32 min = 4; + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 3, this->_internal_min(), target); + 4, this->_internal_min(), target); } - // uint32 max = 4; - if (this->_internal_max() != 0) { + // optional uint32 max = 5; + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 4, this->_internal_max(), target); + 5, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2106,20 +1612,27 @@ ::uint8_t* UInt32Type::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.UInt32Type) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.UInt32Metric) return target; } -::size_t UInt32Type::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.UInt32Type) +::size_t UInt32Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.UInt32Metric) ::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 unit = 1; - if (!this->_internal_unit().empty()) { + // string description = 1; + if (!this->_internal_description().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + // optional string unit = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } @@ -2130,159 +1643,207 @@ ::size_t UInt32Type::ByteSizeLong() const { ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } - // uint32 min = 3; - if (this->_internal_min() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_min()); - } + if (cached_has_bits & 0x00000006u) { + // optional uint32 min = 4; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_min()); + } - // uint32 max = 4; - if (this->_internal_max() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_max()); - } + // optional uint32 max = 5; + if (cached_has_bits & 0x00000004u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_max()); + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData UInt32Type::_class_data_ = { +const ::google::protobuf::Message::ClassData UInt32Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - UInt32Type::MergeImpl + UInt32Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*UInt32Type::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*UInt32Metric::GetClassData() const { return &_class_data_; } -void UInt32Type::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:abacus.protobuf.UInt32Type) +void UInt32Metric::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:abacus.protobuf.UInt32Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_unit().empty()) { + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); + } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); } - if (from._internal_min() != 0) { - _this->_internal_set_min(from._internal_min()); - } - if (from._internal_max() != 0) { - _this->_internal_set_max(from._internal_max()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000006u) { + if (cached_has_bits & 0x00000002u) { + _this->_impl_.min_ = from._impl_.min_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.max_ = from._impl_.max_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void UInt32Type::CopyFrom(const UInt32Type& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.UInt32Type) +void UInt32Metric::CopyFrom(const UInt32Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.UInt32Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool UInt32Type::IsInitialized() const { +PROTOBUF_NOINLINE bool UInt32Metric::IsInitialized() const { return true; } -void UInt32Type::InternalSwap(UInt32Type* other) { +void UInt32Metric::InternalSwap(UInt32Metric* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_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(UInt32Type, _impl_.max_) - + sizeof(UInt32Type::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(UInt32Type, _impl_.kind_)>( + PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_) + + sizeof(UInt32Metric::_impl_.max_) + - PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_)>( reinterpret_cast(&_impl_.kind_), reinterpret_cast(&other->_impl_.kind_)); } -::google::protobuf::Metadata UInt32Type::GetMetadata() const { +::google::protobuf::Metadata UInt32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); } // =================================================================== -class Int32Type::_Internal { +class Int32Metric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; -Int32Type::Int32Type(::google::protobuf::Arena* arena) +Int32Metric::Int32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Int32Type) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Int32Metric) } -Int32Type::Int32Type(const Int32Type& from) : ::google::protobuf::Message() { - Int32Type* const _this = this; +Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message() { + Int32Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); + _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()) { + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.kind_, &from._impl_.kind_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int32Type) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int32Metric) } -inline void Int32Type::SharedCtor(::_pb::Arena* arena) { +inline void Int32Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, - /*decltype(_impl_._cached_size_)*/ {}, }; + _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 } -Int32Type::~Int32Type() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Int32Type) +Int32Metric::~Int32Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Int32Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Int32Type::SharedDtor() { +inline void Int32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); _impl_.unit_.Destroy(); } -void Int32Type::SetCachedSize(int size) const { +void Int32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void Int32Type::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int32Type) +PROTOBUF_NOINLINE void Int32Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int32Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.unit_.ClearToEmpty(); - ::memset(&_impl_.kind_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + _impl_.kind_ = 0; + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Int32Type::_InternalParse( +const char* Int32Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -2290,68 +1851,78 @@ const char* Int32Type::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 38, 2> Int32Type::_table_ = { +const ::_pbi::TcParseTable<3, 5, 0, 51, 2> Int32Metric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 5, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_Int32Type_default_instance_._instance, + &_Int32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // int32 max = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Type, _impl_.max_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.max_)}}, - // string unit = 1; + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.unit_)}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_)}}, // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Type, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.kind_)}}, - // int32 min = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Type, _impl_.min_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.min_)}}, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, + // optional int32 min = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.min_), 1>(), + {32, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, + // optional int32 max = 5; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.max_), 2>(), + {40, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string unit = 1; - {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.unit_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.kind_), 0, 0, + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // int32 min = 3; - {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.min_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, - // int32 max = 4; - {PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.max_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, + // optional string unit = 3; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional int32 min = 4; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // optional int32 max = 5; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, }}, // no aux_entries {{ - "\31\4\0\0\0\0\0\0" - "abacus.protobuf.Int32Type" + "\33\13\0\4\0\0\0\0" + "abacus.protobuf.Int32Metric" + "description" "unit" }}, }; -::uint8_t* Int32Type::_InternalSerialize( +::uint8_t* Int32Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Int32Type) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Int32Metric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string unit = 1; - if (!this->_internal_unit().empty()) { - const std::string& _s = this->_internal_unit(); + // string description = 1; + 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, "abacus.protobuf.Int32Type.unit"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int32Metric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -2362,17 +1933,26 @@ ::uint8_t* Int32Type::_InternalSerialize( 2, this->_internal_kind(), target); } - // int32 min = 3; - if (this->_internal_min() != 0) { + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int32Metric.unit"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + + // optional int32 min = 4; + if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<3>( + WriteInt32ToArrayWithField<4>( stream, this->_internal_min(), target); } - // int32 max = 4; - if (this->_internal_max() != 0) { + // optional int32 max = 5; + if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<4>( + WriteInt32ToArrayWithField<5>( stream, this->_internal_max(), target); } @@ -2381,20 +1961,27 @@ ::uint8_t* Int32Type::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Int32Type) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Int32Metric) return target; } -::size_t Int32Type::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Int32Type) +::size_t Int32Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Int32Metric) ::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 unit = 1; - if (!this->_internal_unit().empty()) { + // string description = 1; + if (!this->_internal_description().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + // optional string unit = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } @@ -2405,159 +1992,207 @@ ::size_t Int32Type::ByteSizeLong() const { ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } - // int32 min = 3; - if (this->_internal_min() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( - this->_internal_min()); - } + if (cached_has_bits & 0x00000006u) { + // optional int32 min = 4; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_min()); + } + + // optional int32 max = 5; + if (cached_has_bits & 0x00000004u) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_max()); + } - // int32 max = 4; - if (this->_internal_max() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( - this->_internal_max()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData Int32Type::_class_data_ = { +const ::google::protobuf::Message::ClassData Int32Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - Int32Type::MergeImpl + Int32Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*Int32Type::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Int32Metric::GetClassData() const { return &_class_data_; } -void Int32Type::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:abacus.protobuf.Int32Type) +void Int32Metric::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:abacus.protobuf.Int32Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_unit().empty()) { + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); + } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); } - if (from._internal_min() != 0) { - _this->_internal_set_min(from._internal_min()); - } - if (from._internal_max() != 0) { - _this->_internal_set_max(from._internal_max()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000006u) { + if (cached_has_bits & 0x00000002u) { + _this->_impl_.min_ = from._impl_.min_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.max_ = from._impl_.max_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void Int32Type::CopyFrom(const Int32Type& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Int32Type) +void Int32Metric::CopyFrom(const Int32Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Int32Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool Int32Type::IsInitialized() const { +PROTOBUF_NOINLINE bool Int32Metric::IsInitialized() const { return true; } -void Int32Type::InternalSwap(Int32Type* other) { +void Int32Metric::InternalSwap(Int32Metric* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_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(Int32Type, _impl_.max_) - + sizeof(Int32Type::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(Int32Type, _impl_.kind_)>( + PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_) + + sizeof(Int32Metric::_impl_.max_) + - PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_)>( reinterpret_cast(&_impl_.kind_), reinterpret_cast(&other->_impl_.kind_)); } -::google::protobuf::Metadata Int32Type::GetMetadata() const { +::google::protobuf::Metadata Int32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[4]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]); } // =================================================================== -class Float64Type::_Internal { +class Float64Metric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; -Float64Type::Float64Type(::google::protobuf::Arena* arena) +Float64Metric::Float64Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Float64Type) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Float64Metric) } -Float64Type::Float64Type(const Float64Type& from) : ::google::protobuf::Message() { - Float64Type* const _this = this; +Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Message() { + Float64Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, decltype(_impl_.kind_){}, - /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); + _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()) { + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.min_, &from._impl_.min_, static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float64Type) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float64Metric) } -inline void Float64Type::SharedCtor(::_pb::Arena* arena) { +inline void Float64Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, decltype(_impl_.kind_){0}, - /*decltype(_impl_._cached_size_)*/ {}, }; + _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 } -Float64Type::~Float64Type() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Float64Type) +Float64Metric::~Float64Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Float64Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Float64Type::SharedDtor() { +inline void Float64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); _impl_.unit_.Destroy(); } -void Float64Type::SetCachedSize(int size) const { +void Float64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void Float64Type::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float64Type) +PROTOBUF_NOINLINE void Float64Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float64Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.unit_.ClearToEmpty(); - ::memset(&_impl_.min_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + _impl_.kind_ = 0; + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Float64Type::_InternalParse( +const char* Float64Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -2565,68 +2200,78 @@ const char* Float64Type::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 40, 2> Float64Type::_table_ = { +const ::_pbi::TcParseTable<3, 5, 0, 53, 2> Float64Metric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 5, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_Float64Type_default_instance_._instance, + &_Float64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // double max = 4; - {::_pbi::TcParser::FastF64S1, - {33, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.max_)}}, - // string unit = 1; + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.unit_)}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_)}}, // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Type, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.kind_)}}, - // double min = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Metric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, + // optional double min = 4; {::_pbi::TcParser::FastF64S1, - {25, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.min_)}}, + {33, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, + // optional double max = 5; + {::_pbi::TcParser::FastF64S1, + {41, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string unit = 1; - {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.unit_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.kind_), 0, 0, + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // double min = 3; - {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.min_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kDouble)}, - // double max = 4; - {PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.max_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kDouble)}, + // optional string unit = 3; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional double min = 4; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, + // optional double max = 5; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, }}, // no aux_entries {{ - "\33\4\0\0\0\0\0\0" - "abacus.protobuf.Float64Type" + "\35\13\0\4\0\0\0\0" + "abacus.protobuf.Float64Metric" + "description" "unit" }}, }; -::uint8_t* Float64Type::_InternalSerialize( +::uint8_t* Float64Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Float64Type) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Float64Metric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string unit = 1; - if (!this->_internal_unit().empty()) { - const std::string& _s = this->_internal_unit(); + // string description = 1; + 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, "abacus.protobuf.Float64Type.unit"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float64Metric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -2637,28 +2282,27 @@ ::uint8_t* Float64Type::_InternalSerialize( 2, this->_internal_kind(), target); } - // double min = 3; - static_assert(sizeof(::uint64_t) == sizeof(double), - "Code assumes ::uint64_t and double are the same size."); - double tmp_min = this->_internal_min(); - ::uint64_t raw_min; - memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); - if (raw_min != 0) { + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float64Metric.unit"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + + // optional double min = 4; + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 3, this->_internal_min(), target); + 4, this->_internal_min(), target); } - // double max = 4; - static_assert(sizeof(::uint64_t) == sizeof(double), - "Code assumes ::uint64_t and double are the same size."); - double tmp_max = this->_internal_max(); - ::uint64_t raw_max; - memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); - if (raw_max != 0) { + // optional double max = 5; + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 4, this->_internal_max(), target); + 5, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2666,44 +2310,43 @@ ::uint8_t* Float64Type::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Float64Type) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Float64Metric) return target; } -::size_t Float64Type::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Float64Type) +::size_t Float64Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Float64Metric) ::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 unit = 1; - if (!this->_internal_unit().empty()) { + // string description = 1; + if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); + this->_internal_description()); } - // double min = 3; - static_assert(sizeof(::uint64_t) == sizeof(double), - "Code assumes ::uint64_t and double are the same size."); - double tmp_min = this->_internal_min(); - ::uint64_t raw_min; - memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); - if (raw_min != 0) { - total_size += 9; - } + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } - // double max = 4; - static_assert(sizeof(::uint64_t) == sizeof(double), - "Code assumes ::uint64_t and double are the same size."); - double tmp_max = this->_internal_max(); - ::uint64_t raw_max; - memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); - if (raw_max != 0) { - total_size += 9; - } + // optional double min = 4; + if (cached_has_bits & 0x00000002u) { + total_size += 9; + } + + // optional double max = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 9; + } + } // .abacus.protobuf.Kind kind = 2; if (this->_internal_kind() != 0) { total_size += 1 + @@ -2713,39 +2356,36 @@ ::size_t Float64Type::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData Float64Type::_class_data_ = { +const ::google::protobuf::Message::ClassData Float64Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - Float64Type::MergeImpl + Float64Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*Float64Type::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Float64Metric::GetClassData() const { return &_class_data_; } -void Float64Type::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:abacus.protobuf.Float64Type) +void Float64Metric::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:abacus.protobuf.Float64Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_unit().empty()) { - _this->_internal_set_unit(from._internal_unit()); + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); } - static_assert(sizeof(::uint64_t) == sizeof(double), - "Code assumes ::uint64_t and double are the same size."); - double tmp_min = from._internal_min(); - ::uint64_t raw_min; - memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); - if (raw_min != 0) { - _this->_internal_set_min(from._internal_min()); - } - static_assert(sizeof(::uint64_t) == sizeof(double), - "Code assumes ::uint64_t and double are the same size."); - double tmp_max = from._internal_max(); - ::uint64_t raw_max; - memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); - if (raw_max != 0) { - _this->_internal_set_max(from._internal_max()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_unit(from._internal_unit()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.min_ = from._impl_.min_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.max_ = from._impl_.max_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); @@ -2753,114 +2393,153 @@ void Float64Type::MergeImpl(::google::protobuf::Message& to_msg, const ::google: _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void Float64Type::CopyFrom(const Float64Type& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Float64Type) +void Float64Metric::CopyFrom(const Float64Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Float64Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool Float64Type::IsInitialized() const { +PROTOBUF_NOINLINE bool Float64Metric::IsInitialized() const { return true; } -void Float64Type::InternalSwap(Float64Type* other) { +void Float64Metric::InternalSwap(Float64Metric* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_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(Float64Type, _impl_.kind_) - + sizeof(Float64Type::_impl_.kind_) - - PROTOBUF_FIELD_OFFSET(Float64Type, _impl_.min_)>( + PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_) + + sizeof(Float64Metric::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); } -::google::protobuf::Metadata Float64Type::GetMetadata() const { +::google::protobuf::Metadata Float64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[5]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[4]); } // =================================================================== -class Float32Type::_Internal { +class Float32Metric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; -Float32Type::Float32Type(::google::protobuf::Arena* arena) +Float32Metric::Float32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Float32Type) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Float32Metric) } -Float32Type::Float32Type(const Float32Type& from) : ::google::protobuf::Message() { - Float32Type* const _this = this; +Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Message() { + Float32Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); + _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()) { + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.kind_, &from._impl_.kind_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float32Type) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float32Metric) } -inline void Float32Type::SharedCtor(::_pb::Arena* arena) { +inline void Float32Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, - /*decltype(_impl_._cached_size_)*/ {}, }; + _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 } -Float32Type::~Float32Type() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Float32Type) +Float32Metric::~Float32Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Float32Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Float32Type::SharedDtor() { +inline void Float32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); _impl_.unit_.Destroy(); } -void Float32Type::SetCachedSize(int size) const { +void Float32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void Float32Type::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float32Type) +PROTOBUF_NOINLINE void Float32Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float32Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.unit_.ClearToEmpty(); - ::memset(&_impl_.kind_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + _impl_.kind_ = 0; + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Float32Type::_InternalParse( +const char* Float32Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -2868,68 +2547,78 @@ const char* Float32Type::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 40, 2> Float32Type::_table_ = { +const ::_pbi::TcParseTable<3, 5, 0, 53, 2> Float32Metric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 5, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_Float32Type_default_instance_._instance, + &_Float32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // float max = 4; - {::_pbi::TcParser::FastF32S1, - {37, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.max_)}}, - // string unit = 1; + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.unit_)}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_)}}, // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Type, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.kind_)}}, - // float min = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Metric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, + // optional float min = 4; + {::_pbi::TcParser::FastF32S1, + {37, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, + // optional float max = 5; {::_pbi::TcParser::FastF32S1, - {29, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.min_)}}, + {45, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string unit = 1; - {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.unit_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.kind_), 0, 0, + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // float min = 3; - {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.min_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, - // float max = 4; - {PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.max_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + // optional string unit = 3; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional float min = 4; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, + // optional float max = 5; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, }}, // no aux_entries {{ - "\33\4\0\0\0\0\0\0" - "abacus.protobuf.Float32Type" + "\35\13\0\4\0\0\0\0" + "abacus.protobuf.Float32Metric" + "description" "unit" }}, }; -::uint8_t* Float32Type::_InternalSerialize( +::uint8_t* Float32Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Float32Type) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Float32Metric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string unit = 1; - if (!this->_internal_unit().empty()) { - const std::string& _s = this->_internal_unit(); + // string description = 1; + 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, "abacus.protobuf.Float32Type.unit"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float32Metric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -2940,28 +2629,27 @@ ::uint8_t* Float32Type::_InternalSerialize( 2, this->_internal_kind(), target); } - // float min = 3; - static_assert(sizeof(::uint32_t) == sizeof(float), - "Code assumes ::uint32_t and float are the same size."); - float tmp_min = this->_internal_min(); - ::uint32_t raw_min; - memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); - if (raw_min != 0) { + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float32Metric.unit"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + + // optional float min = 4; + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 3, this->_internal_min(), target); + 4, this->_internal_min(), target); } - // float max = 4; - static_assert(sizeof(::uint32_t) == sizeof(float), - "Code assumes ::uint32_t and float are the same size."); - float tmp_max = this->_internal_max(); - ::uint32_t raw_max; - memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); - if (raw_max != 0) { + // optional float max = 5; + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 4, this->_internal_max(), target); + 5, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2969,20 +2657,27 @@ ::uint8_t* Float32Type::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Float32Type) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Float32Metric) return target; } -::size_t Float32Type::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Float32Type) +::size_t Float32Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Float32Metric) ::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 unit = 1; - if (!this->_internal_unit().empty()) { + // string description = 1; + if (!this->_internal_description().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + // optional string unit = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } @@ -2993,169 +2688,188 @@ ::size_t Float32Type::ByteSizeLong() const { ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } - // float min = 3; - static_assert(sizeof(::uint32_t) == sizeof(float), - "Code assumes ::uint32_t and float are the same size."); - float tmp_min = this->_internal_min(); - ::uint32_t raw_min; - memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); - if (raw_min != 0) { - total_size += 5; - } + if (cached_has_bits & 0x00000006u) { + // optional float min = 4; + if (cached_has_bits & 0x00000002u) { + total_size += 5; + } - // float max = 4; - static_assert(sizeof(::uint32_t) == sizeof(float), - "Code assumes ::uint32_t and float are the same size."); - float tmp_max = this->_internal_max(); - ::uint32_t raw_max; - memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); - if (raw_max != 0) { - total_size += 5; - } + // optional float max = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 5; + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData Float32Type::_class_data_ = { +const ::google::protobuf::Message::ClassData Float32Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - Float32Type::MergeImpl + Float32Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*Float32Type::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Float32Metric::GetClassData() const { return &_class_data_; } -void Float32Type::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:abacus.protobuf.Float32Type) +void Float32Metric::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:abacus.protobuf.Float32Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_unit().empty()) { + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); + } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); } - static_assert(sizeof(::uint32_t) == sizeof(float), - "Code assumes ::uint32_t and float are the same size."); - float tmp_min = from._internal_min(); - ::uint32_t raw_min; - memcpy(&raw_min, &tmp_min, sizeof(tmp_min)); - if (raw_min != 0) { - _this->_internal_set_min(from._internal_min()); - } - static_assert(sizeof(::uint32_t) == sizeof(float), - "Code assumes ::uint32_t and float are the same size."); - float tmp_max = from._internal_max(); - ::uint32_t raw_max; - memcpy(&raw_max, &tmp_max, sizeof(tmp_max)); - if (raw_max != 0) { - _this->_internal_set_max(from._internal_max()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000006u) { + if (cached_has_bits & 0x00000002u) { + _this->_impl_.min_ = from._impl_.min_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.max_ = from._impl_.max_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void Float32Type::CopyFrom(const Float32Type& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Float32Type) +void Float32Metric::CopyFrom(const Float32Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Float32Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool Float32Type::IsInitialized() const { +PROTOBUF_NOINLINE bool Float32Metric::IsInitialized() const { return true; } -void Float32Type::InternalSwap(Float32Type* other) { +void Float32Metric::InternalSwap(Float32Metric* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_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(Float32Type, _impl_.max_) - + sizeof(Float32Type::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(Float32Type, _impl_.kind_)>( + PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_) + + sizeof(Float32Metric::_impl_.max_) + - PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_)>( reinterpret_cast(&_impl_.kind_), reinterpret_cast(&other->_impl_.kind_)); } -::google::protobuf::Metadata Float32Type::GetMetadata() const { +::google::protobuf::Metadata Float32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[6]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[5]); } // =================================================================== -class BoolType::_Internal { +class BoolMetric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; -BoolType::BoolType(::google::protobuf::Arena* arena) +BoolMetric::BoolMetric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.BoolType) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.BoolMetric) } -BoolType::BoolType(const BoolType& from) : ::google::protobuf::Message() { - BoolType* const _this = this; +BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { + BoolMetric* const _this = this; (void)_this; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){}, - /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); + _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()) { + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } _this->_impl_.kind_ = from._impl_.kind_; - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.BoolType) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.BoolMetric) } -inline void BoolType::SharedCtor(::_pb::Arena* arena) { +inline void BoolMetric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){0}, - /*decltype(_impl_._cached_size_)*/ {}, }; + _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 } -BoolType::~BoolType() { - // @@protoc_insertion_point(destructor:abacus.protobuf.BoolType) +BoolMetric::~BoolMetric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.BoolMetric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void BoolType::SharedDtor() { +inline void BoolMetric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); _impl_.unit_.Destroy(); } -void BoolType::SetCachedSize(int size) const { +void BoolMetric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void BoolType::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.BoolType) +PROTOBUF_NOINLINE void BoolMetric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.BoolMetric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.unit_.ClearToEmpty(); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } _impl_.kind_ = 0; + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* BoolType::_InternalParse( +const char* BoolMetric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -3163,56 +2877,64 @@ const char* BoolType::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 37, 2> BoolType::_table_ = { +const ::_pbi::TcParseTable<2, 3, 0, 50, 2> BoolMetric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_), 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask + 3, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 2, // num_field_entries + 3, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_BoolType_default_instance_._instance, + &_BoolMetric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_)}}, // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(BoolType, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(BoolType, _impl_.kind_)}}, - // string unit = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(BoolMetric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_)}}, + // optional string unit = 3; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(BoolType, _impl_.unit_)}}, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, }}, {{ 65535, 65535 }}, {{ - // string unit = 1; - {PROTOBUF_FIELD_OFFSET(BoolType, _impl_.unit_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(BoolType, _impl_.kind_), 0, 0, + {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 3; + {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, }}, // no aux_entries {{ - "\30\4\0\0\0\0\0\0" - "abacus.protobuf.BoolType" + "\32\13\0\4\0\0\0\0" + "abacus.protobuf.BoolMetric" + "description" "unit" }}, }; -::uint8_t* BoolType::_InternalSerialize( +::uint8_t* BoolMetric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.BoolType) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.BoolMetric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string unit = 1; - if (!this->_internal_unit().empty()) { - const std::string& _s = this->_internal_unit(); + // string description = 1; + 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, "abacus.protobuf.BoolType.unit"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.BoolMetric.description"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -3223,25 +2945,41 @@ ::uint8_t* BoolType::_InternalSerialize( 2, this->_internal_kind(), target); } + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 3; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.BoolMetric.unit"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + 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:abacus.protobuf.BoolType) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.BoolMetric) return target; } -::size_t BoolType::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.BoolType) +::size_t BoolMetric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.BoolMetric) ::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 unit = 1; - if (!this->_internal_unit().empty()) { + // string description = 1; + if (!this->_internal_description().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + // optional string unit = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } @@ -3255,22 +2993,25 @@ ::size_t BoolType::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData BoolType::_class_data_ = { +const ::google::protobuf::Message::ClassData BoolMetric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - BoolType::MergeImpl + BoolMetric::MergeImpl }; -const ::google::protobuf::Message::ClassData*BoolType::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*BoolMetric::GetClassData() const { return &_class_data_; } -void BoolType::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:abacus.protobuf.BoolType) +void BoolMetric::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:abacus.protobuf.BoolMetric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_unit().empty()) { + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); + } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } if (from._internal_kind() != 0) { @@ -3279,61 +3020,60 @@ void BoolType::MergeImpl(::google::protobuf::Message& to_msg, const ::google::pr _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void BoolType::CopyFrom(const BoolType& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.BoolType) +void BoolMetric::CopyFrom(const BoolMetric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.BoolMetric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool BoolType::IsInitialized() const { +PROTOBUF_NOINLINE bool BoolMetric::IsInitialized() const { return true; } -void BoolType::InternalSwap(BoolType* other) { +void BoolMetric::InternalSwap(BoolMetric* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, + &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); swap(_impl_.kind_, other->_impl_.kind_); } -::google::protobuf::Metadata BoolType::GetMetadata() const { +::google::protobuf::Metadata BoolMetric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[6]); } // =================================================================== -class EnumInfo::_Internal { +class EnumValue::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); + using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_._has_bits_); + 8 * PROTOBUF_FIELD_OFFSET(EnumValue, _impl_._has_bits_); static void set_has_description(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_severity(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } }; -EnumInfo::EnumInfo(::google::protobuf::Arena* arena) +EnumValue::EnumValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.EnumInfo) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.EnumValue) } -EnumInfo::EnumInfo(const EnumInfo& from) : ::google::protobuf::Message() { - EnumInfo* const _this = this; +EnumValue::EnumValue(const EnumValue& from) : ::google::protobuf::Message() { + EnumValue* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.name_){}, decltype(_impl_.description_){}, - decltype(_impl_.severity_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -3351,18 +3091,16 @@ EnumInfo::EnumInfo(const EnumInfo& from) : ::google::protobuf::Message() { if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.description_.Set(from._internal_description(), _this->GetArenaForAllocation()); } - _this->_impl_.severity_ = from._impl_.severity_; - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.EnumInfo) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.EnumValue) } -inline void EnumInfo::SharedCtor(::_pb::Arena* arena) { +inline void EnumValue::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.name_){}, decltype(_impl_.description_){}, - decltype(_impl_.severity_){0u}, }; _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -3373,22 +3111,22 @@ inline void EnumInfo::SharedCtor(::_pb::Arena* arena) { _impl_.description_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -EnumInfo::~EnumInfo() { - // @@protoc_insertion_point(destructor:abacus.protobuf.EnumInfo) +EnumValue::~EnumValue() { + // @@protoc_insertion_point(destructor:abacus.protobuf.EnumValue) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void EnumInfo::SharedDtor() { +inline void EnumValue::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.name_.Destroy(); _impl_.description_.Destroy(); } -void EnumInfo::SetCachedSize(int size) const { +void EnumValue::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void EnumInfo::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.EnumInfo) +PROTOBUF_NOINLINE void EnumValue::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.EnumValue) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3398,12 +3136,11 @@ PROTOBUF_NOINLINE void EnumInfo::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.description_.ClearNonDefaultToEmpty(); } - _impl_.severity_ = 0u; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* EnumInfo::_InternalParse( +const char* EnumValue::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -3411,56 +3148,49 @@ const char* EnumInfo::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 3, 0, 48, 2> EnumInfo::_table_ = { +const ::_pbi::TcParseTable<1, 2, 0, 49, 2> EnumValue::_table_ = { { - PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(EnumValue, _impl_._has_bits_), 0, // no _extensions_ - 3, 24, // max_field_number, fast_idx_mask + 2, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap + 4294967292, // skipmap offsetof(decltype(_table_), field_entries), - 3, // num_field_entries + 2, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_EnumInfo_default_instance_._instance, + &_EnumValue_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string name = 1; - {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.name_)}}, // optional string description = 2; {::_pbi::TcParser::FastUS1, - {18, 0, 0, PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.description_)}}, - // optional uint32 severity = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(EnumInfo, _impl_.severity_), 1>(), - {24, 1, 0, PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.severity_)}}, + {18, 0, 0, PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.description_)}}, + // string name = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.name_)}}, }}, {{ 65535, 65535 }}, {{ // string name = 1; - {PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.name_), -1, 0, + {PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.name_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // optional string description = 2; - {PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.description_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.description_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint32 severity = 3; - {PROTOBUF_FIELD_OFFSET(EnumInfo, _impl_.severity_), _Internal::kHasBitsOffset + 1, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, }}, // no aux_entries {{ - "\30\4\13\0\0\0\0\0" - "abacus.protobuf.EnumInfo" + "\31\4\13\0\0\0\0\0" + "abacus.protobuf.EnumValue" "name" "description" }}, }; -::uint8_t* EnumInfo::_InternalSerialize( +::uint8_t* EnumValue::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.EnumInfo) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.EnumValue) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3468,7 +3198,7 @@ ::uint8_t* EnumInfo::_InternalSerialize( 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, "abacus.protobuf.EnumInfo.name"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.EnumValue.name"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -3477,28 +3207,21 @@ ::uint8_t* EnumInfo::_InternalSerialize( if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_description(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.EnumInfo.description"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.EnumValue.description"); target = stream->WriteStringMaybeAliased(2, _s, target); } - // optional uint32 severity = 3; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 3, this->_internal_severity(), target); - } - 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:abacus.protobuf.EnumInfo) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.EnumValue) return target; } -::size_t EnumInfo::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.EnumInfo) +::size_t EnumValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.EnumValue) ::size_t total_size = 0; ::uint32_t cached_has_bits = 0; @@ -3511,35 +3234,27 @@ ::size_t EnumInfo::ByteSizeLong() const { this->_internal_name()); } + // optional string description = 2; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // optional string description = 2; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_description()); - } - - // optional uint32 severity = 3; - if (cached_has_bits & 0x00000002u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_severity()); - } - + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData EnumInfo::_class_data_ = { +const ::google::protobuf::Message::ClassData EnumValue::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - EnumInfo::MergeImpl + EnumValue::MergeImpl }; -const ::google::protobuf::Message::ClassData*EnumInfo::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*EnumValue::GetClassData() const { return &_class_data_; } -void EnumInfo::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:abacus.protobuf.EnumInfo) +void EnumValue::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:abacus.protobuf.EnumValue) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -3547,31 +3262,24 @@ void EnumInfo::MergeImpl(::google::protobuf::Message& to_msg, const ::google::pr if (!from._internal_name().empty()) { _this->_internal_set_name(from._internal_name()); } - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_description(from._internal_description()); - } - if (cached_has_bits & 0x00000002u) { - _this->_impl_.severity_ = from._impl_.severity_; - } - _this->_impl_._has_bits_[0] |= cached_has_bits; + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_description(from._internal_description()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void EnumInfo::CopyFrom(const EnumInfo& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.EnumInfo) +void EnumValue::CopyFrom(const EnumValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.EnumValue) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool EnumInfo::IsInitialized() const { +PROTOBUF_NOINLINE bool EnumValue::IsInitialized() const { return true; } -void EnumInfo::InternalSwap(EnumInfo* other) { +void EnumValue::InternalSwap(EnumValue* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); @@ -3581,289 +3289,123 @@ void EnumInfo::InternalSwap(EnumInfo* other) { &other->_impl_.name_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, &other->_impl_.description_, rhs_arena); - swap(_impl_.severity_, other->_impl_.severity_); } -::google::protobuf::Metadata EnumInfo::GetMetadata() const { +::google::protobuf::Metadata EnumValue::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[8]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); } // =================================================================== -EnumType_EnumMapEntry_DoNotUse::EnumType_EnumMapEntry_DoNotUse() {} -EnumType_EnumMapEntry_DoNotUse::EnumType_EnumMapEntry_DoNotUse(::google::protobuf::Arena* arena) +Enum8Metric_ValuesEntry_DoNotUse::Enum8Metric_ValuesEntry_DoNotUse() {} +Enum8Metric_ValuesEntry_DoNotUse::Enum8Metric_ValuesEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} -void EnumType_EnumMapEntry_DoNotUse::MergeFrom(const EnumType_EnumMapEntry_DoNotUse& other) { +void Enum8Metric_ValuesEntry_DoNotUse::MergeFrom(const Enum8Metric_ValuesEntry_DoNotUse& other) { MergeFromInternal(other); } -::google::protobuf::Metadata EnumType_EnumMapEntry_DoNotUse::GetMetadata() const { +::google::protobuf::Metadata Enum8Metric_ValuesEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[9]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[8]); } // =================================================================== -class EnumType::_Internal { +class Enum8Metric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; -EnumType::EnumType(::google::protobuf::Arena* arena) +Enum8Metric::Enum8Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.EnumType) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Enum8Metric) } -EnumType::EnumType(const EnumType& from) : ::google::protobuf::Message() { - EnumType* const _this = this; +Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message() { + Enum8Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ - /* decltype(_impl_.enum_map_) */ {}, + decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, + /* decltype(_impl_.values_) */ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _this->_impl_.enum_map_.MergeFrom(from._impl_.enum_map_); - - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.EnumType) -} -inline void EnumType::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ - /* decltype(_impl_.enum_map_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, - /*decltype(_impl_._cached_size_)*/ {}, - }; -} -EnumType::~EnumType() { - // @@protoc_insertion_point(destructor:abacus.protobuf.EnumType) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void EnumType::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.enum_map_.~MapField(); -} -void EnumType::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -PROTOBUF_NOINLINE void EnumType::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.EnumType) - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.enum_map_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* EnumType::_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, 1, 2, 0, 2> EnumType::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 1, 0, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967294, // skipmap - offsetof(decltype(_table_), field_entries), - 1, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_EnumType_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // map enum_map = 1; - {PROTOBUF_FIELD_OFFSET(EnumType, _impl_.enum_map_), 0, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, - }}, {{ - {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, - {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::EnumInfo>}, - }}, {{ - }}, -}; - -::uint8_t* EnumType::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.EnumType) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // map enum_map = 1; - if (!_internal_enum_map().empty()) { - using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>; - using WireHelper = EnumType_EnumMapEntry_DoNotUse::Funcs; - const auto& field = _internal_enum_map(); - - if (stream->IsSerializationDeterministic() && field.size() > 1) { - for (const auto& entry : ::google::protobuf::internal::MapSorterFlat(field)) { - target = WireHelper::InternalSerialize( - 1, entry.first, entry.second, target, stream); - } - } else { - for (const auto& entry : field) { - target = WireHelper::InternalSerialize( - 1, entry.first, entry.second, 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); + _this->_impl_.values_.MergeFrom(from._impl_.values_); + _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()); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.EnumType) - return target; -} - -::size_t EnumType::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.EnumType) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // map enum_map = 1; - total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_enum_map_size()); - for (const auto& entry : _internal_enum_map()) { - total_size += EnumType_EnumMapEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData EnumType::_class_data_ = { - ::google::protobuf::Message::CopyWithSourceCheck, - EnumType::MergeImpl -}; -const ::google::protobuf::Message::ClassData*EnumType::GetClassData() const { return &_class_data_; } - - -void EnumType::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:abacus.protobuf.EnumType) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_impl_.enum_map_.MergeFrom(from._impl_.enum_map_); - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void EnumType::CopyFrom(const EnumType& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.EnumType) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool EnumType::IsInitialized() const { - return true; -} - -void EnumType::InternalSwap(EnumType* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.enum_map_.InternalSwap(&other->_impl_.enum_map_); -} - -::google::protobuf::Metadata EnumType::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[10]); -} -// =================================================================== - -MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse() {} -MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse(::google::protobuf::Arena* arena) - : SuperType(arena) {} -void MetricsMetadata_MetricsEntry_DoNotUse::MergeFrom(const MetricsMetadata_MetricsEntry_DoNotUse& other) { - MergeFromInternal(other); -} -::google::protobuf::Metadata MetricsMetadata_MetricsEntry_DoNotUse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[11]); -} -// =================================================================== - -class MetricsMetadata::_Internal { - public: -}; - -MetricsMetadata::MetricsMetadata(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.MetricsMetadata) -} -MetricsMetadata::MetricsMetadata(const MetricsMetadata& from) : ::google::protobuf::Message() { - MetricsMetadata* const _this = this; - (void)_this; - new (&_impl_) Impl_{ - /* decltype(_impl_.metrics_) */ {}, - decltype(_impl_.protocol_version_){}, - decltype(_impl_.endianness_){}, - decltype(_impl_.sync_value_){}, - /*decltype(_impl_._cached_size_)*/ {}, - }; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_); - ::memcpy(&_impl_.protocol_version_, &from._impl_.protocol_version_, - static_cast<::size_t>(reinterpret_cast(&_impl_.sync_value_) - - reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.sync_value_)); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.MetricsMetadata) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Enum8Metric) } -inline void MetricsMetadata::SharedCtor(::_pb::Arena* arena) { +inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - /* decltype(_impl_.metrics_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, - decltype(_impl_.protocol_version_){0u}, - decltype(_impl_.endianness_){0}, - decltype(_impl_.sync_value_){0u}, + decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, + /* decltype(_impl_.values_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, }; + _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 } -MetricsMetadata::~MetricsMetadata() { - // @@protoc_insertion_point(destructor:abacus.protobuf.MetricsMetadata) +Enum8Metric::~Enum8Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Enum8Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void MetricsMetadata::SharedDtor() { +inline void Enum8Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.metrics_.~MapField(); + _impl_.values_.~MapField(); + _impl_.description_.Destroy(); + _impl_.unit_.Destroy(); } -void MetricsMetadata::SetCachedSize(int size) const { +void Enum8Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void MetricsMetadata::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.MetricsMetadata) +PROTOBUF_NOINLINE void Enum8Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Enum8Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.metrics_.Clear(); - ::memset(&_impl_.protocol_version_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.sync_value_) - - reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.sync_value_)); + _impl_.values_.Clear(); + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* MetricsMetadata::_InternalParse( +const char* Enum8Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -3871,104 +3413,88 @@ const char* MetricsMetadata::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 2, 47, 2> MetricsMetadata::_table_ = { +const ::_pbi::TcParseTable<1, 3, 2, 51, 2> Enum8Metric::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 3, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 3, // num_field_entries 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), - &_MetricsMetadata_default_instance_._instance, + &_Enum8Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // uint32 protocol_version = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.protocol_version_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_)}}, - // .abacus.protobuf.Endianness endianness = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.endianness_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_)}}, - // uint32 sync_value = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.sync_value_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_)}}, + // optional string unit = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_)}}, + // string description = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_)}}, }}, {{ 65535, 65535 }}, {{ - // uint32 protocol_version = 1; - {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // .abacus.protobuf.Endianness endianness = 2; - {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // uint32 sync_value = 3; - {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // map metrics = 4; - {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.metrics_), 0, 0, + // string description = 1; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional string unit = 2; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // map values = 3; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, }}, {{ - {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, - {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Metric>}, + {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, + {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::EnumValue>}, }}, {{ - "\37\0\0\0\7\0\0\0" - "abacus.protobuf.MetricsMetadata" - "metrics" + "\33\13\4\0\0\0\0\0" + "abacus.protobuf.Enum8Metric" + "description" + "unit" }}, }; -::uint8_t* MetricsMetadata::_InternalSerialize( +::uint8_t* Enum8Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.MetricsMetadata) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Enum8Metric) ::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); - } - - // .abacus.protobuf.Endianness endianness = 2; - if (this->_internal_endianness() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_endianness(), target); + // string description = 1; + 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, "abacus.protobuf.Enum8Metric.description"); + target = stream->WriteStringMaybeAliased(1, _s, target); } - // uint32 sync_value = 3; - if (this->_internal_sync_value() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 3, this->_internal_sync_value(), target); + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 2; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.unit"); + target = stream->WriteStringMaybeAliased(2, _s, target); } - // map metrics = 4; - if (!_internal_metrics().empty()) { - using MapType = ::google::protobuf::Map; - using WireHelper = MetricsMetadata_MetricsEntry_DoNotUse::Funcs; - const auto& field = _internal_metrics(); + // map values = 3; + if (!_internal_values().empty()) { + using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>; + using WireHelper = Enum8Metric_ValuesEntry_DoNotUse::Funcs; + const auto& field = _internal_values(); if (stream->IsSerializationDeterministic() && field.size() > 1) { - for (const auto& entry : ::google::protobuf::internal::MapSorterPtr(field)) { + for (const auto& entry : ::google::protobuf::internal::MapSorterFlat(field)) { target = WireHelper::InternalSerialize( - 4, entry.first, entry.second, target, stream); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - entry.first.data(), static_cast(entry.first.length()), - ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.MetricsMetadata.metrics"); + 3, entry.first, entry.second, target, stream); } } else { for (const auto& entry : field) { target = WireHelper::InternalSerialize( - 4, entry.first, entry.second, target, stream); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - entry.first.data(), static_cast(entry.first.length()), - ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.MetricsMetadata.metrics"); + 3, entry.first, entry.second, target, stream); } } } @@ -3978,246 +3504,415 @@ ::uint8_t* MetricsMetadata::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.MetricsMetadata) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Enum8Metric) return target; } -::size_t MetricsMetadata::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.MetricsMetadata) +::size_t Enum8Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Enum8Metric) ::size_t total_size = 0; ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // map metrics = 4; - total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_metrics_size()); - for (const auto& entry : _internal_metrics()) { - total_size += MetricsMetadata_MetricsEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); - } - // uint32 protocol_version = 1; - if (this->_internal_protocol_version() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_protocol_version()); + // map values = 3; + total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_values_size()); + for (const auto& entry : _internal_values()) { + total_size += Enum8Metric_ValuesEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); } - - // .abacus.protobuf.Endianness endianness = 2; - if (this->_internal_endianness() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_endianness()); + // string description = 1; + if (!this->_internal_description().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); } - // uint32 sync_value = 3; - if (this->_internal_sync_value() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_sync_value()); + // optional string unit = 2; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData MetricsMetadata::_class_data_ = { +const ::google::protobuf::Message::ClassData Enum8Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - MetricsMetadata::MergeImpl + Enum8Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*MetricsMetadata::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Enum8Metric::GetClassData() const { return &_class_data_; } -void MetricsMetadata::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:abacus.protobuf.MetricsMetadata) +void Enum8Metric::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:abacus.protobuf.Enum8Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_); - if (from._internal_protocol_version() != 0) { - _this->_internal_set_protocol_version(from._internal_protocol_version()); - } - if (from._internal_endianness() != 0) { - _this->_internal_set_endianness(from._internal_endianness()); + _this->_impl_.values_.MergeFrom(from._impl_.values_); + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); } - if (from._internal_sync_value() != 0) { - _this->_internal_set_sync_value(from._internal_sync_value()); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void MetricsMetadata::CopyFrom(const MetricsMetadata& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.MetricsMetadata) +void Enum8Metric::CopyFrom(const Enum8Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Enum8Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool MetricsMetadata::IsInitialized() const { +PROTOBUF_NOINLINE bool Enum8Metric::IsInitialized() const { return true; } -void MetricsMetadata::InternalSwap(MetricsMetadata* other) { +void Enum8Metric::InternalSwap(Enum8Metric* other) { using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.metrics_.InternalSwap(&other->_impl_.metrics_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_) - + sizeof(MetricsMetadata::_impl_.sync_value_) - - PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_)>( - reinterpret_cast(&_impl_.protocol_version_), - reinterpret_cast(&other->_impl_.protocol_version_)); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.values_.InternalSwap(&other->_impl_.values_); + ::_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::Metadata MetricsMetadata::GetMetadata() const { +::google::protobuf::Metadata Enum8Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[9]); } // =================================================================== -class MetricValue::_Internal { +class Metric::_Internal { public: static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricValue, _impl_._oneof_case_); + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::UInt64Metric& uint64(const Metric* msg); + static const ::abacus::protobuf::Int64Metric& int64(const Metric* msg); + static const ::abacus::protobuf::UInt32Metric& uint32(const Metric* msg); + static const ::abacus::protobuf::Int32Metric& int32(const Metric* msg); + static const ::abacus::protobuf::Float64Metric& float64(const Metric* msg); + static const ::abacus::protobuf::Float32Metric& float32(const Metric* msg); + static const ::abacus::protobuf::BoolMetric& boolean(const Metric* msg); + static const ::abacus::protobuf::Enum8Metric& enum8(const Metric* msg); }; -MetricValue::MetricValue(::google::protobuf::Arena* arena) +const ::abacus::protobuf::UInt64Metric& Metric::_Internal::uint64(const Metric* msg) { + return *msg->_impl_.type_.uint64_; +} +const ::abacus::protobuf::Int64Metric& Metric::_Internal::int64(const Metric* msg) { + return *msg->_impl_.type_.int64_; +} +const ::abacus::protobuf::UInt32Metric& Metric::_Internal::uint32(const Metric* msg) { + return *msg->_impl_.type_.uint32_; +} +const ::abacus::protobuf::Int32Metric& Metric::_Internal::int32(const Metric* msg) { + return *msg->_impl_.type_.int32_; +} +const ::abacus::protobuf::Float64Metric& Metric::_Internal::float64(const Metric* msg) { + return *msg->_impl_.type_.float64_; +} +const ::abacus::protobuf::Float32Metric& Metric::_Internal::float32(const Metric* msg) { + return *msg->_impl_.type_.float32_; +} +const ::abacus::protobuf::BoolMetric& Metric::_Internal::boolean(const Metric* msg) { + return *msg->_impl_.type_.boolean_; +} +const ::abacus::protobuf::Enum8Metric& Metric::_Internal::enum8(const Metric* msg) { + return *msg->_impl_.type_.enum8_; +} +void Metric::set_allocated_uint64(::abacus::protobuf::UInt64Metric* uint64) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (uint64) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(uint64); + if (message_arena != submessage_arena) { + uint64 = ::google::protobuf::internal::GetOwnedMessage( + message_arena, uint64, submessage_arena); + } + set_has_uint64(); + _impl_.type_.uint64_ = uint64; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.uint64) +} +void Metric::set_allocated_int64(::abacus::protobuf::Int64Metric* int64) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (int64) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(int64); + if (message_arena != submessage_arena) { + int64 = ::google::protobuf::internal::GetOwnedMessage( + message_arena, int64, submessage_arena); + } + set_has_int64(); + _impl_.type_.int64_ = int64; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.int64) +} +void Metric::set_allocated_uint32(::abacus::protobuf::UInt32Metric* uint32) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (uint32) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(uint32); + if (message_arena != submessage_arena) { + uint32 = ::google::protobuf::internal::GetOwnedMessage( + message_arena, uint32, submessage_arena); + } + set_has_uint32(); + _impl_.type_.uint32_ = uint32; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.uint32) +} +void Metric::set_allocated_int32(::abacus::protobuf::Int32Metric* int32) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (int32) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(int32); + if (message_arena != submessage_arena) { + int32 = ::google::protobuf::internal::GetOwnedMessage( + message_arena, int32, submessage_arena); + } + set_has_int32(); + _impl_.type_.int32_ = int32; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.int32) +} +void Metric::set_allocated_float64(::abacus::protobuf::Float64Metric* float64) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (float64) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(float64); + if (message_arena != submessage_arena) { + float64 = ::google::protobuf::internal::GetOwnedMessage( + message_arena, float64, submessage_arena); + } + set_has_float64(); + _impl_.type_.float64_ = float64; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.float64) +} +void Metric::set_allocated_float32(::abacus::protobuf::Float32Metric* float32) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (float32) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(float32); + if (message_arena != submessage_arena) { + float32 = ::google::protobuf::internal::GetOwnedMessage( + message_arena, float32, submessage_arena); + } + set_has_float32(); + _impl_.type_.float32_ = float32; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.float32) +} +void Metric::set_allocated_boolean(::abacus::protobuf::BoolMetric* boolean) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (boolean) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(boolean); + if (message_arena != submessage_arena) { + boolean = ::google::protobuf::internal::GetOwnedMessage( + message_arena, boolean, submessage_arena); + } + set_has_boolean(); + _impl_.type_.boolean_ = boolean; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.boolean) +} +void Metric::set_allocated_enum8(::abacus::protobuf::Enum8Metric* enum8) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (enum8) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(enum8); + if (message_arena != submessage_arena) { + enum8 = ::google::protobuf::internal::GetOwnedMessage( + message_arena, enum8, submessage_arena); + } + set_has_enum8(); + _impl_.type_.enum8_ = enum8; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.enum8) +} +Metric::Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.MetricValue) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Metric) } -MetricValue::MetricValue(const MetricValue& from) : ::google::protobuf::Message() { - MetricValue* const _this = this; +Metric::Metric(const Metric& from) : ::google::protobuf::Message() { + Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.valid_){}, - decltype(_impl_.value_){}, + decltype(_impl_.offset_){}, + decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _this->_impl_.valid_ = from._impl_.valid_; - clear_has_value(); - switch (from.value_case()) { - case kUint64Value: { - _this->_internal_set_uint64_value(from._internal_uint64_value()); + _this->_impl_.offset_ = from._impl_.offset_; + clear_has_type(); + switch (from.type_case()) { + case kUint64: { + _this->_internal_mutable_uint64()->::abacus::protobuf::UInt64Metric::MergeFrom( + from._internal_uint64()); break; } - case kInt64Value: { - _this->_internal_set_int64_value(from._internal_int64_value()); + case kInt64: { + _this->_internal_mutable_int64()->::abacus::protobuf::Int64Metric::MergeFrom( + from._internal_int64()); break; } - case kUint32Value: { - _this->_internal_set_uint32_value(from._internal_uint32_value()); + case kUint32: { + _this->_internal_mutable_uint32()->::abacus::protobuf::UInt32Metric::MergeFrom( + from._internal_uint32()); break; } - case kInt32Value: { - _this->_internal_set_int32_value(from._internal_int32_value()); + case kInt32: { + _this->_internal_mutable_int32()->::abacus::protobuf::Int32Metric::MergeFrom( + from._internal_int32()); break; } - case kFloat32Value: { - _this->_internal_set_float32_value(from._internal_float32_value()); + case kFloat64: { + _this->_internal_mutable_float64()->::abacus::protobuf::Float64Metric::MergeFrom( + from._internal_float64()); break; } - case kFloat64Value: { - _this->_internal_set_float64_value(from._internal_float64_value()); + case kFloat32: { + _this->_internal_mutable_float32()->::abacus::protobuf::Float32Metric::MergeFrom( + from._internal_float32()); break; } - case kBoolValue: { - _this->_internal_set_bool_value(from._internal_bool_value()); + case kBoolean: { + _this->_internal_mutable_boolean()->::abacus::protobuf::BoolMetric::MergeFrom( + from._internal_boolean()); break; } - case kEnumValue: { - _this->_internal_set_enum_value(from._internal_enum_value()); + case kEnum8: { + _this->_internal_mutable_enum8()->::abacus::protobuf::Enum8Metric::MergeFrom( + from._internal_enum8()); break; } - case VALUE_NOT_SET: { + case TYPE_NOT_SET: { break; } } - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.MetricValue) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Metric) } -inline void MetricValue::SharedCtor(::_pb::Arena* arena) { +inline void Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.valid_){false}, - decltype(_impl_.value_){}, + decltype(_impl_.offset_){0u}, + decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, }; - clear_has_value(); + clear_has_type(); } -MetricValue::~MetricValue() { - // @@protoc_insertion_point(destructor:abacus.protobuf.MetricValue) +Metric::~Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void MetricValue::SharedDtor() { +inline void Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - if (has_value()) { - clear_value(); + if (has_type()) { + clear_type(); } } -void MetricValue::SetCachedSize(int size) const { +void Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void MetricValue::clear_value() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.MetricValue) - switch (value_case()) { - case kUint64Value: { - // No need to clear +void Metric::clear_type() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Metric) + switch (type_case()) { + case kUint64: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint64_; + } break; } - case kInt64Value: { - // No need to clear + case kInt64: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int64_; + } break; } - case kUint32Value: { - // No need to clear + case kUint32: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint32_; + } break; } - case kInt32Value: { - // No need to clear + case kInt32: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int32_; + } break; } - case kFloat32Value: { - // No need to clear + case kFloat64: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float64_; + } break; } - case kFloat64Value: { - // No need to clear + case kFloat32: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float32_; + } break; } - case kBoolValue: { - // No need to clear + case kBoolean: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.boolean_; + } break; } - case kEnumValue: { - // No need to clear + case kEnum8: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.enum8_; + } break; } - case VALUE_NOT_SET: { + case TYPE_NOT_SET: { break; } } - _impl_._oneof_case_[0] = VALUE_NOT_SET; + _impl_._oneof_case_[0] = TYPE_NOT_SET; } -PROTOBUF_NOINLINE void MetricValue::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.MetricValue) +PROTOBUF_NOINLINE void Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.valid_ = false; - clear_value(); + _impl_.offset_ = 0u; + clear_type(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* MetricValue::_InternalParse( +const char* Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -4225,7 +3920,7 @@ const char* MetricValue::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 9, 0, 0, 2> MetricValue::_table_ = { +const ::_pbi::TcParseTable<0, 9, 8, 0, 2> Metric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ @@ -4234,111 +3929,118 @@ const ::_pbi::TcParseTable<0, 9, 0, 0, 2> MetricValue::_table_ = { 4294966784, // skipmap offsetof(decltype(_table_), field_entries), 9, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_MetricValue_default_instance_._instance, + 8, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // bool valid = 1; - {::_pbi::TcParser::SingularVarintNoZag1(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.valid_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_)}}, }}, {{ 65535, 65535 }}, {{ - // bool valid = 1; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.valid_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // uint64 uint64_value = 2; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.uint64_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kUInt64)}, - // int64 int64_value = 3; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.int64_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kInt64)}, - // uint32 uint32_value = 4; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.uint32_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, - // int32 int32_value = 5; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.int32_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kInt32)}, - // float float32_value = 6; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.float32_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kFloat)}, - // double float64_value = 7; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.float64_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, - // bool bool_value = 8; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.bool_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kBool)}, - // uint32 enum_value = 9; - {PROTOBUF_FIELD_OFFSET(MetricValue, _impl_.value_.enum_value_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, - }}, - // no aux_entries - {{ + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // .abacus.protobuf.UInt64Metric uint64 = 2; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Int64Metric int64 = 3; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int64_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.UInt32Metric uint32 = 4; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint32_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Int32Metric int32 = 5; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int32_), _Internal::kOneofCaseOffset + 0, 3, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Float64Metric float64 = 6; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float64_), _Internal::kOneofCaseOffset + 0, 4, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Float32Metric float32 = 7; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float32_), _Internal::kOneofCaseOffset + 0, 5, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.BoolMetric boolean = 8; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.boolean_), _Internal::kOneofCaseOffset + 0, 6, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Enum8Metric enum8 = 9; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.enum8_), _Internal::kOneofCaseOffset + 0, 7, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt64Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Int64Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt32Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Int32Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Float64Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Float32Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::BoolMetric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Enum8Metric>()}, + }}, {{ }}, }; -::uint8_t* MetricValue::_InternalSerialize( +::uint8_t* Metric::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.MetricValue) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Metric) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // bool valid = 1; - if (this->_internal_valid() != 0) { + // uint32 offset = 1; + if (this->_internal_offset() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 1, this->_internal_valid(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), target); } - switch (value_case()) { - case kUint64Value: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_uint64_value(), target); + switch (type_case()) { + case kUint64: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::uint64(this), + _Internal::uint64(this).GetCachedSize(), target, stream); break; } - case kInt64Value: { + case kInt64: { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<3>( - stream, this->_internal_int64_value(), target); + InternalWriteMessage(3, _Internal::int64(this), + _Internal::int64(this).GetCachedSize(), target, stream); break; } - case kUint32Value: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 4, this->_internal_uint32_value(), target); + case kUint32: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::uint32(this), + _Internal::uint32(this).GetCachedSize(), target, stream); break; } - case kInt32Value: { + case kInt32: { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<5>( - stream, this->_internal_int32_value(), target); + InternalWriteMessage(5, _Internal::int32(this), + _Internal::int32(this).GetCachedSize(), target, stream); break; } - case kFloat32Value: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteFloatToArray( - 6, this->_internal_float32_value(), target); + case kFloat64: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::float64(this), + _Internal::float64(this).GetCachedSize(), target, stream); break; } - case kFloat64Value: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 7, this->_internal_float64_value(), target); + case kFloat32: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::float32(this), + _Internal::float32(this).GetCachedSize(), target, stream); break; } - case kBoolValue: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 8, this->_internal_bool_value(), target); + case kBoolean: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::boolean(this), + _Internal::boolean(this).GetCachedSize(), target, stream); break; } - case kEnumValue: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 9, this->_internal_enum_value(), target); + case kEnum8: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(9, _Internal::enum8(this), + _Internal::enum8(this).GetCachedSize(), target, stream); break; } default: @@ -4349,216 +4051,258 @@ ::uint8_t* MetricValue::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.MetricValue) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Metric) return target; } -::size_t MetricValue::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.MetricValue) +::size_t Metric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.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; - // bool valid = 1; - if (this->_internal_valid() != 0) { - total_size += 2; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); } - switch (value_case()) { - // uint64 uint64_value = 2; - case kUint64Value: { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_uint64_value()); + switch (type_case()) { + // .abacus.protobuf.UInt64Metric uint64 = 2; + case kUint64: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.uint64_); break; } - // int64 int64_value = 3; - case kInt64Value: { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( - this->_internal_int64_value()); + // .abacus.protobuf.Int64Metric int64 = 3; + case kInt64: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.int64_); break; } - // uint32 uint32_value = 4; - case kUint32Value: { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_uint32_value()); + // .abacus.protobuf.UInt32Metric uint32 = 4; + case kUint32: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.uint32_); break; } - // int32 int32_value = 5; - case kInt32Value: { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( - this->_internal_int32_value()); + // .abacus.protobuf.Int32Metric int32 = 5; + case kInt32: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.int32_); break; } - // float float32_value = 6; - case kFloat32Value: { - total_size += 5; + // .abacus.protobuf.Float64Metric float64 = 6; + case kFloat64: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.float64_); break; } - // double float64_value = 7; - case kFloat64Value: { - total_size += 9; + // .abacus.protobuf.Float32Metric float32 = 7; + case kFloat32: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.float32_); break; } - // bool bool_value = 8; - case kBoolValue: { - total_size += 2; + // .abacus.protobuf.BoolMetric boolean = 8; + case kBoolean: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.boolean_); break; } - // uint32 enum_value = 9; - case kEnumValue: { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_enum_value()); + // .abacus.protobuf.Enum8Metric enum8 = 9; + case kEnum8: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.enum8_); break; } - case VALUE_NOT_SET: { + case TYPE_NOT_SET: { break; } } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData MetricValue::_class_data_ = { +const ::google::protobuf::Message::ClassData Metric::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - MetricValue::MergeImpl + Metric::MergeImpl }; -const ::google::protobuf::Message::ClassData*MetricValue::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Metric::GetClassData() const { return &_class_data_; } -void MetricValue::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:abacus.protobuf.MetricValue) +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:abacus.protobuf.Metric) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_valid() != 0) { - _this->_internal_set_valid(from._internal_valid()); + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); } - switch (from.value_case()) { - case kUint64Value: { - _this->_internal_set_uint64_value(from._internal_uint64_value()); + switch (from.type_case()) { + case kUint64: { + _this->_internal_mutable_uint64()->::abacus::protobuf::UInt64Metric::MergeFrom( + from._internal_uint64()); break; } - case kInt64Value: { - _this->_internal_set_int64_value(from._internal_int64_value()); + case kInt64: { + _this->_internal_mutable_int64()->::abacus::protobuf::Int64Metric::MergeFrom( + from._internal_int64()); break; } - case kUint32Value: { - _this->_internal_set_uint32_value(from._internal_uint32_value()); + case kUint32: { + _this->_internal_mutable_uint32()->::abacus::protobuf::UInt32Metric::MergeFrom( + from._internal_uint32()); break; } - case kInt32Value: { - _this->_internal_set_int32_value(from._internal_int32_value()); + case kInt32: { + _this->_internal_mutable_int32()->::abacus::protobuf::Int32Metric::MergeFrom( + from._internal_int32()); break; } - case kFloat32Value: { - _this->_internal_set_float32_value(from._internal_float32_value()); + case kFloat64: { + _this->_internal_mutable_float64()->::abacus::protobuf::Float64Metric::MergeFrom( + from._internal_float64()); break; } - case kFloat64Value: { - _this->_internal_set_float64_value(from._internal_float64_value()); + case kFloat32: { + _this->_internal_mutable_float32()->::abacus::protobuf::Float32Metric::MergeFrom( + from._internal_float32()); break; } - case kBoolValue: { - _this->_internal_set_bool_value(from._internal_bool_value()); + case kBoolean: { + _this->_internal_mutable_boolean()->::abacus::protobuf::BoolMetric::MergeFrom( + from._internal_boolean()); break; } - case kEnumValue: { - _this->_internal_set_enum_value(from._internal_enum_value()); + case kEnum8: { + _this->_internal_mutable_enum8()->::abacus::protobuf::Enum8Metric::MergeFrom( + from._internal_enum8()); break; } - case VALUE_NOT_SET: { + case TYPE_NOT_SET: { break; } } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void MetricValue::CopyFrom(const MetricValue& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.MetricValue) +void Metric::CopyFrom(const Metric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Metric) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool MetricValue::IsInitialized() const { +PROTOBUF_NOINLINE bool Metric::IsInitialized() const { return true; } -void MetricValue::InternalSwap(MetricValue* other) { +void Metric::InternalSwap(Metric* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.valid_, other->_impl_.valid_); - swap(_impl_.value_, other->_impl_.value_); + swap(_impl_.offset_, other->_impl_.offset_); + swap(_impl_.type_, other->_impl_.type_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } -::google::protobuf::Metadata MetricValue::GetMetadata() const { +::google::protobuf::Metadata Metric::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[10]); +} +// =================================================================== + +MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse() {} +MetricsMetadata_MetricsEntry_DoNotUse::MetricsMetadata_MetricsEntry_DoNotUse(::google::protobuf::Arena* arena) + : SuperType(arena) {} +void MetricsMetadata_MetricsEntry_DoNotUse::MergeFrom(const MetricsMetadata_MetricsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata MetricsMetadata_MetricsEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[11]); } // =================================================================== -class MetricValues::_Internal { +class MetricsMetadata::_Internal { public: }; -MetricValues::MetricValues(::google::protobuf::Arena* arena) +MetricsMetadata::MetricsMetadata(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.MetricValues) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.MetricsMetadata) } -MetricValues::MetricValues(const MetricValues& from) : ::google::protobuf::Message() { - MetricValues* const _this = this; +MetricsMetadata::MetricsMetadata(const MetricsMetadata& from) : ::google::protobuf::Message() { + MetricsMetadata* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.values_){from._impl_.values_}, + /* decltype(_impl_.metrics_) */ {}, + decltype(_impl_.protocol_version_){}, + decltype(_impl_.endianness_){}, decltype(_impl_.sync_value_){}, /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _this->_impl_.sync_value_ = from._impl_.sync_value_; + _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_); + ::memcpy(&_impl_.protocol_version_, &from._impl_.protocol_version_, + static_cast<::size_t>(reinterpret_cast(&_impl_.sync_value_) - + reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.sync_value_)); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.MetricValues) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.MetricsMetadata) } -inline void MetricValues::SharedCtor(::_pb::Arena* arena) { +inline void MetricsMetadata::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.values_){arena}, + /* decltype(_impl_.metrics_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, + decltype(_impl_.protocol_version_){0u}, + decltype(_impl_.endianness_){0}, decltype(_impl_.sync_value_){0u}, /*decltype(_impl_._cached_size_)*/ {}, }; } -MetricValues::~MetricValues() { - // @@protoc_insertion_point(destructor:abacus.protobuf.MetricValues) +MetricsMetadata::~MetricsMetadata() { + // @@protoc_insertion_point(destructor:abacus.protobuf.MetricsMetadata) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void MetricValues::SharedDtor() { +inline void MetricsMetadata::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.values_.~RepeatedPtrField(); + _impl_.metrics_.~MapField(); } -void MetricValues::SetCachedSize(int size) const { +void MetricsMetadata::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void MetricValues::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.MetricValues) +PROTOBUF_NOINLINE void MetricsMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.MetricsMetadata) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _internal_mutable_values()->Clear(); - _impl_.sync_value_ = 0u; + _impl_.metrics_.Clear(); + ::memset(&_impl_.protocol_version_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.sync_value_) - + reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.sync_value_)); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* MetricValues::_InternalParse( +const char* MetricsMetadata::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -4566,61 +4310,106 @@ const char* MetricValues::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> MetricValues::_table_ = { +const ::_pbi::TcParseTable<2, 4, 2, 47, 2> MetricsMetadata::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask + 4, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap + 4294967280, // skipmap offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries + 4, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), - &_MetricValues_default_instance_._instance, + &_MetricsMetadata_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // repeated .abacus.protobuf.MetricValue values = 2; - {::_pbi::TcParser::FastMtR1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.values_)}}, - // uint32 sync_value = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricValues, _impl_.sync_value_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.sync_value_)}}, + {::_pbi::TcParser::MiniParse, {}}, + // uint32 protocol_version = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.protocol_version_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_)}}, + // .abacus.protobuf.Endianness endianness = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.endianness_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_)}}, + // uint32 sync_value = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.sync_value_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_)}}, }}, {{ 65535, 65535 }}, {{ - // uint32 sync_value = 1; - {PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.sync_value_), 0, 0, + // uint32 protocol_version = 1; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // repeated .abacus.protobuf.MetricValue values = 2; - {PROTOBUF_FIELD_OFFSET(MetricValues, _impl_.values_), 0, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Endianness endianness = 2; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // uint32 sync_value = 3; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // map metrics = 4; + {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.metrics_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::MetricValue>()}, + {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, + {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Metric>}, }}, {{ + "\37\0\0\0\7\0\0\0" + "abacus.protobuf.MetricsMetadata" + "metrics" }}, }; -::uint8_t* MetricValues::_InternalSerialize( +::uint8_t* MetricsMetadata::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.MetricValues) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.MetricsMetadata) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // uint32 sync_value = 1; + // uint32 protocol_version = 1; + if (this->_internal_protocol_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_protocol_version(), target); + } + + // .abacus.protobuf.Endianness endianness = 2; + if (this->_internal_endianness() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_endianness(), target); + } + + // uint32 sync_value = 3; if (this->_internal_sync_value() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 1, this->_internal_sync_value(), target); + 3, this->_internal_sync_value(), target); } - // repeated .abacus.protobuf.MetricValue values = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_values_size()); i < n; i++) { - const auto& repfield = this->_internal_values().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + // map metrics = 4; + if (!_internal_metrics().empty()) { + using MapType = ::google::protobuf::Map; + using WireHelper = MetricsMetadata_MetricsEntry_DoNotUse::Funcs; + const auto& field = _internal_metrics(); + + if (stream->IsSerializationDeterministic() && field.size() > 1) { + for (const auto& entry : ::google::protobuf::internal::MapSorterPtr(field)) { + target = WireHelper::InternalSerialize( + 4, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.MetricsMetadata.metrics"); + } + } else { + for (const auto& entry : field) { + target = WireHelper::InternalSerialize( + 4, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.MetricsMetadata.metrics"); + } + } } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -4628,25 +4417,36 @@ ::uint8_t* MetricValues::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.MetricValues) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.MetricsMetadata) return target; } -::size_t MetricValues::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.MetricValues) +::size_t MetricsMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.MetricsMetadata) ::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 .abacus.protobuf.MetricValue values = 2; - total_size += 1UL * this->_internal_values_size(); - for (const auto& msg : this->_internal_values()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + // map metrics = 4; + total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_metrics_size()); + for (const auto& entry : _internal_metrics()) { + total_size += MetricsMetadata_MetricsEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); + } + // uint32 protocol_version = 1; + if (this->_internal_protocol_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_protocol_version()); + } + + // .abacus.protobuf.Endianness endianness = 2; + if (this->_internal_endianness() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_endianness()); } - // uint32 sync_value = 1; + + // uint32 sync_value = 3; if (this->_internal_sync_value() != 0) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_sync_value()); @@ -4655,50 +4455,61 @@ ::size_t MetricValues::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData MetricValues::_class_data_ = { +const ::google::protobuf::Message::ClassData MetricsMetadata::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - MetricValues::MergeImpl + MetricsMetadata::MergeImpl }; -const ::google::protobuf::Message::ClassData*MetricValues::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*MetricsMetadata::GetClassData() const { return &_class_data_; } -void MetricValues::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:abacus.protobuf.MetricValues) +void MetricsMetadata::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:abacus.protobuf.MetricsMetadata) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_internal_mutable_values()->MergeFrom(from._internal_values()); + _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_); + if (from._internal_protocol_version() != 0) { + _this->_internal_set_protocol_version(from._internal_protocol_version()); + } + if (from._internal_endianness() != 0) { + _this->_internal_set_endianness(from._internal_endianness()); + } if (from._internal_sync_value() != 0) { _this->_internal_set_sync_value(from._internal_sync_value()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void MetricValues::CopyFrom(const MetricValues& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.MetricValues) +void MetricsMetadata::CopyFrom(const MetricsMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.MetricsMetadata) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool MetricValues::IsInitialized() const { +PROTOBUF_NOINLINE bool MetricsMetadata::IsInitialized() const { return true; } -void MetricValues::InternalSwap(MetricValues* other) { +void MetricsMetadata::InternalSwap(MetricsMetadata* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.values_.InternalSwap(&other->_impl_.values_); - swap(_impl_.sync_value_, other->_impl_.sync_value_); + _impl_.metrics_.InternalSwap(&other->_impl_.metrics_); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_) + + sizeof(MetricsMetadata::_impl_.sync_value_) + - PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.protocol_version_)>( + reinterpret_cast(&_impl_.protocol_version_), + reinterpret_cast(&other->_impl_.protocol_version_)); } -::google::protobuf::Metadata MetricValues::GetMetadata() const { +::google::protobuf::Metadata MetricsMetadata::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); } // @@protoc_insertion_point(namespace_scope) } // namespace protobuf diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 32843427..47288a20 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -59,51 +59,45 @@ extern const ::google::protobuf::internal::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto; namespace abacus { namespace protobuf { -class BoolType; -struct BoolTypeDefaultTypeInternal; -extern BoolTypeDefaultTypeInternal _BoolType_default_instance_; -class EnumInfo; -struct EnumInfoDefaultTypeInternal; -extern EnumInfoDefaultTypeInternal _EnumInfo_default_instance_; -class EnumType; -struct EnumTypeDefaultTypeInternal; -extern EnumTypeDefaultTypeInternal _EnumType_default_instance_; -class EnumType_EnumMapEntry_DoNotUse; -struct EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal; -extern EnumType_EnumMapEntry_DoNotUseDefaultTypeInternal _EnumType_EnumMapEntry_DoNotUse_default_instance_; -class Float32Type; -struct Float32TypeDefaultTypeInternal; -extern Float32TypeDefaultTypeInternal _Float32Type_default_instance_; -class Float64Type; -struct Float64TypeDefaultTypeInternal; -extern Float64TypeDefaultTypeInternal _Float64Type_default_instance_; -class Int32Type; -struct Int32TypeDefaultTypeInternal; -extern Int32TypeDefaultTypeInternal _Int32Type_default_instance_; -class Int64Type; -struct Int64TypeDefaultTypeInternal; -extern Int64TypeDefaultTypeInternal _Int64Type_default_instance_; +class BoolMetric; +struct BoolMetricDefaultTypeInternal; +extern BoolMetricDefaultTypeInternal _BoolMetric_default_instance_; +class Enum8Metric; +struct Enum8MetricDefaultTypeInternal; +extern Enum8MetricDefaultTypeInternal _Enum8Metric_default_instance_; +class Enum8Metric_ValuesEntry_DoNotUse; +struct Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal; +extern Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal _Enum8Metric_ValuesEntry_DoNotUse_default_instance_; +class EnumValue; +struct EnumValueDefaultTypeInternal; +extern EnumValueDefaultTypeInternal _EnumValue_default_instance_; +class Float32Metric; +struct Float32MetricDefaultTypeInternal; +extern Float32MetricDefaultTypeInternal _Float32Metric_default_instance_; +class Float64Metric; +struct Float64MetricDefaultTypeInternal; +extern Float64MetricDefaultTypeInternal _Float64Metric_default_instance_; +class Int32Metric; +struct Int32MetricDefaultTypeInternal; +extern Int32MetricDefaultTypeInternal _Int32Metric_default_instance_; +class Int64Metric; +struct Int64MetricDefaultTypeInternal; +extern Int64MetricDefaultTypeInternal _Int64Metric_default_instance_; class Metric; struct MetricDefaultTypeInternal; extern MetricDefaultTypeInternal _Metric_default_instance_; -class MetricValue; -struct MetricValueDefaultTypeInternal; -extern MetricValueDefaultTypeInternal _MetricValue_default_instance_; -class MetricValues; -struct MetricValuesDefaultTypeInternal; -extern MetricValuesDefaultTypeInternal _MetricValues_default_instance_; class MetricsMetadata; struct MetricsMetadataDefaultTypeInternal; extern MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; class MetricsMetadata_MetricsEntry_DoNotUse; struct MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal; extern MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal _MetricsMetadata_MetricsEntry_DoNotUse_default_instance_; -class UInt32Type; -struct UInt32TypeDefaultTypeInternal; -extern UInt32TypeDefaultTypeInternal _UInt32Type_default_instance_; -class UInt64Type; -struct UInt64TypeDefaultTypeInternal; -extern UInt64TypeDefaultTypeInternal _UInt64Type_default_instance_; +class UInt32Metric; +struct UInt32MetricDefaultTypeInternal; +extern UInt32MetricDefaultTypeInternal _UInt32Metric_default_instance_; +class UInt64Metric; +struct UInt64MetricDefaultTypeInternal; +extern UInt64MetricDefaultTypeInternal _UInt64Metric_default_instance_; } // namespace protobuf } // namespace abacus namespace google { @@ -184,25 +178,25 @@ inline bool Endianness_Parse(absl::string_view name, Endianness* value) { // ------------------------------------------------------------------- -class Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Metric) */ { +class UInt64Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt64Metric) */ { public: - inline Metric() : Metric(nullptr) {} - ~Metric() override; + inline UInt64Metric() : UInt64Metric(nullptr) {} + ~UInt64Metric() override; template - explicit PROTOBUF_CONSTEXPR Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UInt64Metric(::google::protobuf::internal::ConstantInitialized); - Metric(const Metric& from); - Metric(Metric&& from) noexcept - : Metric() { + UInt64Metric(const UInt64Metric& from); + UInt64Metric(UInt64Metric&& from) noexcept + : UInt64Metric() { *this = ::std::move(from); } - inline Metric& operator=(const Metric& from) { + inline UInt64Metric& operator=(const UInt64Metric& from) { CopyFrom(from); return *this; } - inline Metric& operator=(Metric&& from) noexcept { + inline UInt64Metric& operator=(UInt64Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -232,32 +226,20 @@ class Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Metric& default_instance() { + static const UInt64Metric& default_instance() { return *internal_default_instance(); } - enum TypeCase { - kUint64Type = 4, - kInt64Type = 5, - kUint32Type = 6, - kInt32Type = 7, - kFloat64Type = 8, - kFloat32Type = 9, - kBoolType = 10, - kEnumType = 11, - TYPE_NOT_SET = 0, - }; - - static inline const Metric* internal_default_instance() { - return reinterpret_cast( - &_Metric_default_instance_); + static inline const UInt64Metric* internal_default_instance() { + return reinterpret_cast( + &_UInt64Metric_default_instance_); } static constexpr int kIndexInFileMessages = 0; - friend void swap(Metric& a, Metric& b) { + friend void swap(UInt64Metric& a, UInt64Metric& b) { a.Swap(&b); } - inline void Swap(Metric* other) { + inline void Swap(UInt64Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -270,7 +252,7 @@ class Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Metric* other) { + void UnsafeArenaSwap(UInt64Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -278,14 +260,14 @@ class Metric final : // implements Message ---------------------------------------------- - Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + UInt64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Metric& from); + void CopyFrom(const UInt64Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Metric& from) { - Metric::MergeImpl(*this, from); + void MergeFrom( const UInt64Metric& from) { + UInt64Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -303,15 +285,15 @@ class Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Metric* other); + void InternalSwap(UInt64Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Metric"; + return "abacus.protobuf.UInt64Metric"; } protected: - explicit Metric(::google::protobuf::Arena* arena); + explicit UInt64Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -325,16 +307,10 @@ class Metric final : enum : int { kDescriptionFieldNumber = 1, - kValueOffsetFieldNumber = 2, - kValidOffsetFieldNumber = 3, - kUint64TypeFieldNumber = 4, - kInt64TypeFieldNumber = 5, - kUint32TypeFieldNumber = 6, - kInt32TypeFieldNumber = 7, - kFloat64TypeFieldNumber = 8, - kFloat32TypeFieldNumber = 9, - kBoolTypeFieldNumber = 10, - kEnumTypeFieldNumber = 11, + kUnitFieldNumber = 3, + kMinFieldNumber = 4, + kMaxFieldNumber = 5, + kKindFieldNumber = 2, }; // string description = 1; void clear_description() ; @@ -352,244 +328,97 @@ class Metric final : std::string* _internal_mutable_description(); public: - // uint32 value_offset = 2; - void clear_value_offset() ; - ::uint32_t value_offset() const; - void set_value_offset(::uint32_t value); - - private: - ::uint32_t _internal_value_offset() const; - void _internal_set_value_offset(::uint32_t value); - - public: - // uint32 valid_offset = 3; - void clear_valid_offset() ; - ::uint32_t valid_offset() const; - void set_valid_offset(::uint32_t value); - - private: - ::uint32_t _internal_valid_offset() const; - void _internal_set_valid_offset(::uint32_t value); - - public: - // .abacus.protobuf.UInt64Type uint64_type = 4; - bool has_uint64_type() const; - private: - bool _internal_has_uint64_type() const; - - public: - void clear_uint64_type() ; - const ::abacus::protobuf::UInt64Type& uint64_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::UInt64Type* release_uint64_type(); - ::abacus::protobuf::UInt64Type* mutable_uint64_type(); - void set_allocated_uint64_type(::abacus::protobuf::UInt64Type* value); - void unsafe_arena_set_allocated_uint64_type(::abacus::protobuf::UInt64Type* value); - ::abacus::protobuf::UInt64Type* unsafe_arena_release_uint64_type(); - - private: - const ::abacus::protobuf::UInt64Type& _internal_uint64_type() const; - ::abacus::protobuf::UInt64Type* _internal_mutable_uint64_type(); - - public: - // .abacus.protobuf.Int64Type int64_type = 5; - bool has_int64_type() const; - private: - bool _internal_has_int64_type() const; - - public: - void clear_int64_type() ; - const ::abacus::protobuf::Int64Type& int64_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Int64Type* release_int64_type(); - ::abacus::protobuf::Int64Type* mutable_int64_type(); - void set_allocated_int64_type(::abacus::protobuf::Int64Type* value); - void unsafe_arena_set_allocated_int64_type(::abacus::protobuf::Int64Type* value); - ::abacus::protobuf::Int64Type* unsafe_arena_release_int64_type(); - - private: - const ::abacus::protobuf::Int64Type& _internal_int64_type() const; - ::abacus::protobuf::Int64Type* _internal_mutable_int64_type(); - - public: - // .abacus.protobuf.UInt32Type uint32_type = 6; - bool has_uint32_type() const; - private: - bool _internal_has_uint32_type() const; - - public: - void clear_uint32_type() ; - const ::abacus::protobuf::UInt32Type& uint32_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::UInt32Type* release_uint32_type(); - ::abacus::protobuf::UInt32Type* mutable_uint32_type(); - void set_allocated_uint32_type(::abacus::protobuf::UInt32Type* value); - void unsafe_arena_set_allocated_uint32_type(::abacus::protobuf::UInt32Type* value); - ::abacus::protobuf::UInt32Type* unsafe_arena_release_uint32_type(); - - private: - const ::abacus::protobuf::UInt32Type& _internal_uint32_type() const; - ::abacus::protobuf::UInt32Type* _internal_mutable_uint32_type(); - - public: - // .abacus.protobuf.Int32Type int32_type = 7; - bool has_int32_type() const; - private: - bool _internal_has_int32_type() const; - - public: - void clear_int32_type() ; - const ::abacus::protobuf::Int32Type& int32_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Int32Type* release_int32_type(); - ::abacus::protobuf::Int32Type* mutable_int32_type(); - void set_allocated_int32_type(::abacus::protobuf::Int32Type* value); - void unsafe_arena_set_allocated_int32_type(::abacus::protobuf::Int32Type* value); - ::abacus::protobuf::Int32Type* unsafe_arena_release_int32_type(); - - private: - const ::abacus::protobuf::Int32Type& _internal_int32_type() const; - ::abacus::protobuf::Int32Type* _internal_mutable_int32_type(); - - public: - // .abacus.protobuf.Float64Type float64_type = 8; - bool has_float64_type() const; - private: - bool _internal_has_float64_type() const; - - public: - void clear_float64_type() ; - const ::abacus::protobuf::Float64Type& float64_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Float64Type* release_float64_type(); - ::abacus::protobuf::Float64Type* mutable_float64_type(); - void set_allocated_float64_type(::abacus::protobuf::Float64Type* value); - void unsafe_arena_set_allocated_float64_type(::abacus::protobuf::Float64Type* value); - ::abacus::protobuf::Float64Type* unsafe_arena_release_float64_type(); - - private: - const ::abacus::protobuf::Float64Type& _internal_float64_type() const; - ::abacus::protobuf::Float64Type* _internal_mutable_float64_type(); + // optional string unit = 3; + bool has_unit() const; + 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); - public: - // .abacus.protobuf.Float32Type float32_type = 9; - bool has_float32_type() const; private: - bool _internal_has_float32_type() const; + const std::string& _internal_unit() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_unit( + const std::string& value); + std::string* _internal_mutable_unit(); public: - void clear_float32_type() ; - const ::abacus::protobuf::Float32Type& float32_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Float32Type* release_float32_type(); - ::abacus::protobuf::Float32Type* mutable_float32_type(); - void set_allocated_float32_type(::abacus::protobuf::Float32Type* value); - void unsafe_arena_set_allocated_float32_type(::abacus::protobuf::Float32Type* value); - ::abacus::protobuf::Float32Type* unsafe_arena_release_float32_type(); - - private: - const ::abacus::protobuf::Float32Type& _internal_float32_type() const; - ::abacus::protobuf::Float32Type* _internal_mutable_float32_type(); + // optional uint64 min = 4; + bool has_min() const; + void clear_min() ; + ::uint64_t min() const; + void set_min(::uint64_t value); - public: - // .abacus.protobuf.BoolType bool_type = 10; - bool has_bool_type() const; private: - bool _internal_has_bool_type() const; + ::uint64_t _internal_min() const; + void _internal_set_min(::uint64_t value); public: - void clear_bool_type() ; - const ::abacus::protobuf::BoolType& bool_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::BoolType* release_bool_type(); - ::abacus::protobuf::BoolType* mutable_bool_type(); - void set_allocated_bool_type(::abacus::protobuf::BoolType* value); - void unsafe_arena_set_allocated_bool_type(::abacus::protobuf::BoolType* value); - ::abacus::protobuf::BoolType* unsafe_arena_release_bool_type(); - - private: - const ::abacus::protobuf::BoolType& _internal_bool_type() const; - ::abacus::protobuf::BoolType* _internal_mutable_bool_type(); + // optional uint64 max = 5; + bool has_max() const; + void clear_max() ; + ::uint64_t max() const; + void set_max(::uint64_t value); - public: - // .abacus.protobuf.EnumType enum_type = 11; - bool has_enum_type() const; private: - bool _internal_has_enum_type() const; + ::uint64_t _internal_max() const; + void _internal_set_max(::uint64_t value); public: - void clear_enum_type() ; - const ::abacus::protobuf::EnumType& enum_type() const; - PROTOBUF_NODISCARD ::abacus::protobuf::EnumType* release_enum_type(); - ::abacus::protobuf::EnumType* mutable_enum_type(); - void set_allocated_enum_type(::abacus::protobuf::EnumType* value); - void unsafe_arena_set_allocated_enum_type(::abacus::protobuf::EnumType* value); - ::abacus::protobuf::EnumType* unsafe_arena_release_enum_type(); + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - const ::abacus::protobuf::EnumType& _internal_enum_type() const; - ::abacus::protobuf::EnumType* _internal_mutable_enum_type(); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - void clear_type(); - TypeCase type_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt64Metric) private: class _Internal; - void set_has_uint64_type(); - void set_has_int64_type(); - void set_has_uint32_type(); - void set_has_int32_type(); - void set_has_float64_type(); - void set_has_float32_type(); - void set_has_bool_type(); - void set_has_enum_type(); - - inline bool has_type() const; - inline void clear_has_type(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 11, 8, 50, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 52, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::google::protobuf::internal::ArenaStringPtr description_; - ::uint32_t value_offset_; - ::uint32_t valid_offset_; - union TypeUnion { - constexpr TypeUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::UInt64Type* uint64_type_; - ::abacus::protobuf::Int64Type* int64_type_; - ::abacus::protobuf::UInt32Type* uint32_type_; - ::abacus::protobuf::Int32Type* int32_type_; - ::abacus::protobuf::Float64Type* float64_type_; - ::abacus::protobuf::Float32Type* float32_type_; - ::abacus::protobuf::BoolType* bool_type_; - ::abacus::protobuf::EnumType* enum_type_; - } type_; + ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::uint32_t _oneof_case_[1]; - + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint64_t min_; + ::uint64_t max_; + int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class UInt64Type final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt64Type) */ { +class Int64Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int64Metric) */ { public: - inline UInt64Type() : UInt64Type(nullptr) {} - ~UInt64Type() override; + inline Int64Metric() : Int64Metric(nullptr) {} + ~Int64Metric() override; template - explicit PROTOBUF_CONSTEXPR UInt64Type(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Int64Metric(::google::protobuf::internal::ConstantInitialized); - UInt64Type(const UInt64Type& from); - UInt64Type(UInt64Type&& from) noexcept - : UInt64Type() { + Int64Metric(const Int64Metric& from); + Int64Metric(Int64Metric&& from) noexcept + : Int64Metric() { *this = ::std::move(from); } - inline UInt64Type& operator=(const UInt64Type& from) { + inline Int64Metric& operator=(const Int64Metric& from) { CopyFrom(from); return *this; } - inline UInt64Type& operator=(UInt64Type&& from) noexcept { + inline Int64Metric& operator=(Int64Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -619,20 +448,20 @@ class UInt64Type final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const UInt64Type& default_instance() { + static const Int64Metric& default_instance() { return *internal_default_instance(); } - static inline const UInt64Type* internal_default_instance() { - return reinterpret_cast( - &_UInt64Type_default_instance_); + static inline const Int64Metric* internal_default_instance() { + return reinterpret_cast( + &_Int64Metric_default_instance_); } static constexpr int kIndexInFileMessages = 1; - friend void swap(UInt64Type& a, UInt64Type& b) { + friend void swap(Int64Metric& a, Int64Metric& b) { a.Swap(&b); } - inline void Swap(UInt64Type* other) { + inline void Swap(Int64Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -645,7 +474,7 @@ class UInt64Type final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(UInt64Type* other) { + void UnsafeArenaSwap(Int64Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -653,14 +482,14 @@ class UInt64Type final : // implements Message ---------------------------------------------- - UInt64Type* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Int64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const UInt64Type& from); + void CopyFrom(const Int64Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const UInt64Type& from) { - UInt64Type::MergeImpl(*this, from); + void MergeFrom( const Int64Metric& from) { + Int64Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -678,15 +507,15 @@ class UInt64Type final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(UInt64Type* other); + void InternalSwap(Int64Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.UInt64Type"; + return "abacus.protobuf.Int64Metric"; } protected: - explicit UInt64Type(::google::protobuf::Arena* arena); + explicit Int64Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -699,12 +528,30 @@ class UInt64Type final : // accessors ------------------------------------------------------- enum : int { - kUnitFieldNumber = 1, - kMinFieldNumber = 3, - kMaxFieldNumber = 4, + kDescriptionFieldNumber = 1, + kUnitFieldNumber = 3, + kMinFieldNumber = 4, + kMaxFieldNumber = 5, kKindFieldNumber = 2, }; - // string unit = 1; + // string description = 1; + 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: + // optional string unit = 3; + bool has_unit() const; void clear_unit() ; const std::string& unit() const; template @@ -720,24 +567,26 @@ class UInt64Type final : std::string* _internal_mutable_unit(); public: - // uint64 min = 3; + // optional int64 min = 4; + bool has_min() const; void clear_min() ; - ::uint64_t min() const; - void set_min(::uint64_t value); + ::int64_t min() const; + void set_min(::int64_t value); private: - ::uint64_t _internal_min() const; - void _internal_set_min(::uint64_t value); + ::int64_t _internal_min() const; + void _internal_set_min(::int64_t value); public: - // uint64 max = 4; + // optional int64 max = 5; + bool has_max() const; void clear_max() ; - ::uint64_t max() const; - void set_max(::uint64_t value); + ::int64_t max() const; + void set_max(::int64_t value); private: - ::uint64_t _internal_max() const; - void _internal_set_max(::uint64_t value); + ::int64_t _internal_max() const; + void _internal_set_max(::int64_t value); public: // .abacus.protobuf.Kind kind = 2; @@ -750,46 +599,48 @@ class UInt64Type final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt64Type) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Int64Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 39, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 51, 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_; + ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - ::uint64_t min_; - ::uint64_t max_; + ::int64_t min_; + ::int64_t max_; int kind_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Int64Type final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int64Type) */ { +class UInt32Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt32Metric) */ { public: - inline Int64Type() : Int64Type(nullptr) {} - ~Int64Type() override; + inline UInt32Metric() : UInt32Metric(nullptr) {} + ~UInt32Metric() override; template - explicit PROTOBUF_CONSTEXPR Int64Type(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UInt32Metric(::google::protobuf::internal::ConstantInitialized); - Int64Type(const Int64Type& from); - Int64Type(Int64Type&& from) noexcept - : Int64Type() { + UInt32Metric(const UInt32Metric& from); + UInt32Metric(UInt32Metric&& from) noexcept + : UInt32Metric() { *this = ::std::move(from); } - inline Int64Type& operator=(const Int64Type& from) { + inline UInt32Metric& operator=(const UInt32Metric& from) { CopyFrom(from); return *this; } - inline Int64Type& operator=(Int64Type&& from) noexcept { + inline UInt32Metric& operator=(UInt32Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -819,20 +670,20 @@ class Int64Type final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Int64Type& default_instance() { + static const UInt32Metric& default_instance() { return *internal_default_instance(); } - static inline const Int64Type* internal_default_instance() { - return reinterpret_cast( - &_Int64Type_default_instance_); + static inline const UInt32Metric* internal_default_instance() { + return reinterpret_cast( + &_UInt32Metric_default_instance_); } static constexpr int kIndexInFileMessages = 2; - friend void swap(Int64Type& a, Int64Type& b) { + friend void swap(UInt32Metric& a, UInt32Metric& b) { a.Swap(&b); } - inline void Swap(Int64Type* other) { + inline void Swap(UInt32Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -845,7 +696,7 @@ class Int64Type final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Int64Type* other) { + void UnsafeArenaSwap(UInt32Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -853,14 +704,14 @@ class Int64Type final : // implements Message ---------------------------------------------- - Int64Type* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + UInt32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Int64Type& from); + void CopyFrom(const UInt32Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Int64Type& from) { - Int64Type::MergeImpl(*this, from); + void MergeFrom( const UInt32Metric& from) { + UInt32Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -878,15 +729,15 @@ class Int64Type final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Int64Type* other); + void InternalSwap(UInt32Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Int64Type"; + return "abacus.protobuf.UInt32Metric"; } protected: - explicit Int64Type(::google::protobuf::Arena* arena); + explicit UInt32Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -899,12 +750,30 @@ class Int64Type final : // accessors ------------------------------------------------------- enum : int { - kUnitFieldNumber = 1, - kMinFieldNumber = 3, - kMaxFieldNumber = 4, + kDescriptionFieldNumber = 1, + kUnitFieldNumber = 3, kKindFieldNumber = 2, + kMinFieldNumber = 4, + kMaxFieldNumber = 5, }; - // string unit = 1; + // string description = 1; + 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: + // optional string unit = 3; + bool has_unit() const; void clear_unit() ; const std::string& unit() const; template @@ -920,76 +789,80 @@ class Int64Type final : std::string* _internal_mutable_unit(); public: - // int64 min = 3; - void clear_min() ; - ::int64_t min() const; - void set_min(::int64_t value); + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - ::int64_t _internal_min() const; - void _internal_set_min(::int64_t value); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - // int64 max = 4; - void clear_max() ; - ::int64_t max() const; - void set_max(::int64_t value); + // optional uint32 min = 4; + bool has_min() const; + void clear_min() ; + ::uint32_t min() const; + void set_min(::uint32_t value); private: - ::int64_t _internal_max() const; - void _internal_set_max(::int64_t value); + ::uint32_t _internal_min() const; + void _internal_set_min(::uint32_t value); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); + // optional uint32 max = 5; + bool has_max() const; + void clear_max() ; + ::uint32_t max() const; + void set_max(::uint32_t value); private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); + ::uint32_t _internal_max() const; + void _internal_set_max(::uint32_t value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Int64Type) + // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt32Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 38, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 52, 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_; + ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - ::int64_t min_; - ::int64_t max_; int kind_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t min_; + ::uint32_t max_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class UInt32Type final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt32Type) */ { +class Int32Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int32Metric) */ { public: - inline UInt32Type() : UInt32Type(nullptr) {} - ~UInt32Type() override; + inline Int32Metric() : Int32Metric(nullptr) {} + ~Int32Metric() override; template - explicit PROTOBUF_CONSTEXPR UInt32Type(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Int32Metric(::google::protobuf::internal::ConstantInitialized); - UInt32Type(const UInt32Type& from); - UInt32Type(UInt32Type&& from) noexcept - : UInt32Type() { + Int32Metric(const Int32Metric& from); + Int32Metric(Int32Metric&& from) noexcept + : Int32Metric() { *this = ::std::move(from); } - inline UInt32Type& operator=(const UInt32Type& from) { + inline Int32Metric& operator=(const Int32Metric& from) { CopyFrom(from); return *this; } - inline UInt32Type& operator=(UInt32Type&& from) noexcept { + inline Int32Metric& operator=(Int32Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1019,20 +892,20 @@ class UInt32Type final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const UInt32Type& default_instance() { + static const Int32Metric& default_instance() { return *internal_default_instance(); } - static inline const UInt32Type* internal_default_instance() { - return reinterpret_cast( - &_UInt32Type_default_instance_); + static inline const Int32Metric* internal_default_instance() { + return reinterpret_cast( + &_Int32Metric_default_instance_); } static constexpr int kIndexInFileMessages = 3; - friend void swap(UInt32Type& a, UInt32Type& b) { + friend void swap(Int32Metric& a, Int32Metric& b) { a.Swap(&b); } - inline void Swap(UInt32Type* other) { + inline void Swap(Int32Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1045,7 +918,7 @@ class UInt32Type final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(UInt32Type* other) { + void UnsafeArenaSwap(Int32Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1053,14 +926,14 @@ class UInt32Type final : // implements Message ---------------------------------------------- - UInt32Type* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Int32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const UInt32Type& from); + void CopyFrom(const Int32Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const UInt32Type& from) { - UInt32Type::MergeImpl(*this, from); + void MergeFrom( const Int32Metric& from) { + Int32Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1078,15 +951,15 @@ class UInt32Type final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(UInt32Type* other); + void InternalSwap(Int32Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.UInt32Type"; + return "abacus.protobuf.Int32Metric"; } protected: - explicit UInt32Type(::google::protobuf::Arena* arena); + explicit Int32Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1099,12 +972,30 @@ class UInt32Type final : // accessors ------------------------------------------------------- enum : int { - kUnitFieldNumber = 1, + kDescriptionFieldNumber = 1, + kUnitFieldNumber = 3, kKindFieldNumber = 2, - kMinFieldNumber = 3, - kMaxFieldNumber = 4, + kMinFieldNumber = 4, + kMaxFieldNumber = 5, }; - // string unit = 1; + // string description = 1; + 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: + // optional string unit = 3; + bool has_unit() const; void clear_unit() ; const std::string& unit() const; template @@ -1130,66 +1021,70 @@ class UInt32Type final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // uint32 min = 3; + // optional int32 min = 4; + bool has_min() const; void clear_min() ; - ::uint32_t min() const; - void set_min(::uint32_t value); + ::int32_t min() const; + void set_min(::int32_t value); private: - ::uint32_t _internal_min() const; - void _internal_set_min(::uint32_t value); + ::int32_t _internal_min() const; + void _internal_set_min(::int32_t value); public: - // uint32 max = 4; + // optional int32 max = 5; + bool has_max() const; void clear_max() ; - ::uint32_t max() const; - void set_max(::uint32_t value); + ::int32_t max() const; + void set_max(::int32_t value); private: - ::uint32_t _internal_max() const; - void _internal_set_max(::uint32_t value); + ::int32_t _internal_max() const; + void _internal_set_max(::int32_t value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt32Type) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Int32Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 39, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::google::protobuf::internal::ArenaStringPtr unit_; - int kind_; - ::uint32_t min_; - ::uint32_t max_; + ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr unit_; + int kind_; + ::int32_t min_; + ::int32_t max_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Int32Type final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int32Type) */ { +class Float64Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float64Metric) */ { public: - inline Int32Type() : Int32Type(nullptr) {} - ~Int32Type() override; + inline Float64Metric() : Float64Metric(nullptr) {} + ~Float64Metric() override; template - explicit PROTOBUF_CONSTEXPR Int32Type(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Float64Metric(::google::protobuf::internal::ConstantInitialized); - Int32Type(const Int32Type& from); - Int32Type(Int32Type&& from) noexcept - : Int32Type() { + Float64Metric(const Float64Metric& from); + Float64Metric(Float64Metric&& from) noexcept + : Float64Metric() { *this = ::std::move(from); } - inline Int32Type& operator=(const Int32Type& from) { + inline Float64Metric& operator=(const Float64Metric& from) { CopyFrom(from); return *this; } - inline Int32Type& operator=(Int32Type&& from) noexcept { + inline Float64Metric& operator=(Float64Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1219,20 +1114,20 @@ class Int32Type final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Int32Type& default_instance() { + static const Float64Metric& default_instance() { return *internal_default_instance(); } - static inline const Int32Type* internal_default_instance() { - return reinterpret_cast( - &_Int32Type_default_instance_); + static inline const Float64Metric* internal_default_instance() { + return reinterpret_cast( + &_Float64Metric_default_instance_); } static constexpr int kIndexInFileMessages = 4; - friend void swap(Int32Type& a, Int32Type& b) { + friend void swap(Float64Metric& a, Float64Metric& b) { a.Swap(&b); } - inline void Swap(Int32Type* other) { + inline void Swap(Float64Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1245,7 +1140,7 @@ class Int32Type final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Int32Type* other) { + void UnsafeArenaSwap(Float64Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1253,14 +1148,14 @@ class Int32Type final : // implements Message ---------------------------------------------- - Int32Type* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Float64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Int32Type& from); + void CopyFrom(const Float64Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Int32Type& from) { - Int32Type::MergeImpl(*this, from); + void MergeFrom( const Float64Metric& from) { + Float64Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1278,15 +1173,15 @@ class Int32Type final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Int32Type* other); + void InternalSwap(Float64Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Int32Type"; + return "abacus.protobuf.Float64Metric"; } protected: - explicit Int32Type(::google::protobuf::Arena* arena); + explicit Float64Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1299,212 +1194,30 @@ class Int32Type final : // accessors ------------------------------------------------------- enum : int { - kUnitFieldNumber = 1, + kDescriptionFieldNumber = 1, + kUnitFieldNumber = 3, + kMinFieldNumber = 4, + kMaxFieldNumber = 5, kKindFieldNumber = 2, - kMinFieldNumber = 3, - kMaxFieldNumber = 4, }; - // string unit = 1; - void clear_unit() ; - const std::string& unit() const; + // string description = 1; + void clear_description() ; + const std::string& description() 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); + 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_unit() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_unit( + const std::string& _internal_description() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_description( const std::string& value); - std::string* _internal_mutable_unit(); - - public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); - - private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); - - public: - // int32 min = 3; - void clear_min() ; - ::int32_t min() const; - void set_min(::int32_t value); - - private: - ::int32_t _internal_min() const; - void _internal_set_min(::int32_t value); - - public: - // int32 max = 4; - void clear_max() ; - ::int32_t max() const; - void set_max(::int32_t value); - - private: - ::int32_t _internal_max() const; - void _internal_set_max(::int32_t value); - - public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Int32Type) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 38, 2> _table_; - template friend class ::google::protobuf::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::google::protobuf::internal::ArenaStringPtr unit_; - int kind_; - ::int32_t min_; - ::int32_t max_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -};// ------------------------------------------------------------------- - -class Float64Type final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float64Type) */ { - public: - inline Float64Type() : Float64Type(nullptr) {} - ~Float64Type() override; - template - explicit PROTOBUF_CONSTEXPR Float64Type(::google::protobuf::internal::ConstantInitialized); - - Float64Type(const Float64Type& from); - Float64Type(Float64Type&& from) noexcept - : Float64Type() { - *this = ::std::move(from); - } - - inline Float64Type& operator=(const Float64Type& from) { - CopyFrom(from); - return *this; - } - inline Float64Type& operator=(Float64Type&& 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 Float64Type& default_instance() { - return *internal_default_instance(); - } - static inline const Float64Type* internal_default_instance() { - return reinterpret_cast( - &_Float64Type_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(Float64Type& a, Float64Type& b) { - a.Swap(&b); - } - inline void Swap(Float64Type* 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(Float64Type* other) { - if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Float64Type* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Float64Type& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Float64Type& from) { - Float64Type::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(Float64Type* other); + std::string* _internal_mutable_description(); - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Float64Type"; - } - protected: - explicit Float64Type(::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 { - kUnitFieldNumber = 1, - kMinFieldNumber = 3, - kMaxFieldNumber = 4, - kKindFieldNumber = 2, - }; - // string unit = 1; + // optional string unit = 3; + bool has_unit() const; void clear_unit() ; const std::string& unit() const; template @@ -1520,7 +1233,8 @@ class Float64Type final : std::string* _internal_mutable_unit(); public: - // double min = 3; + // optional double min = 4; + bool has_min() const; void clear_min() ; double min() const; void set_min(double value); @@ -1530,7 +1244,8 @@ class Float64Type final : void _internal_set_min(double value); public: - // double max = 4; + // optional double max = 5; + bool has_max() const; void clear_max() ; double max() const; void set_max(double value); @@ -1550,46 +1265,48 @@ class Float64Type final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Float64Type) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Float64Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 40, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 53, 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_; + ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; double min_; double max_; int kind_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Float32Type final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float32Type) */ { +class Float32Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float32Metric) */ { public: - inline Float32Type() : Float32Type(nullptr) {} - ~Float32Type() override; + inline Float32Metric() : Float32Metric(nullptr) {} + ~Float32Metric() override; template - explicit PROTOBUF_CONSTEXPR Float32Type(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Float32Metric(::google::protobuf::internal::ConstantInitialized); - Float32Type(const Float32Type& from); - Float32Type(Float32Type&& from) noexcept - : Float32Type() { + Float32Metric(const Float32Metric& from); + Float32Metric(Float32Metric&& from) noexcept + : Float32Metric() { *this = ::std::move(from); } - inline Float32Type& operator=(const Float32Type& from) { + inline Float32Metric& operator=(const Float32Metric& from) { CopyFrom(from); return *this; } - inline Float32Type& operator=(Float32Type&& from) noexcept { + inline Float32Metric& operator=(Float32Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1619,20 +1336,20 @@ class Float32Type final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Float32Type& default_instance() { + static const Float32Metric& default_instance() { return *internal_default_instance(); } - static inline const Float32Type* internal_default_instance() { - return reinterpret_cast( - &_Float32Type_default_instance_); + static inline const Float32Metric* internal_default_instance() { + return reinterpret_cast( + &_Float32Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 5; - friend void swap(Float32Type& a, Float32Type& b) { + friend void swap(Float32Metric& a, Float32Metric& b) { a.Swap(&b); } - inline void Swap(Float32Type* other) { + inline void Swap(Float32Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1645,7 +1362,7 @@ class Float32Type final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Float32Type* other) { + void UnsafeArenaSwap(Float32Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1653,14 +1370,14 @@ class Float32Type final : // implements Message ---------------------------------------------- - Float32Type* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Float32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Float32Type& from); + void CopyFrom(const Float32Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Float32Type& from) { - Float32Type::MergeImpl(*this, from); + void MergeFrom( const Float32Metric& from) { + Float32Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1678,15 +1395,15 @@ class Float32Type final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Float32Type* other); + void InternalSwap(Float32Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Float32Type"; + return "abacus.protobuf.Float32Metric"; } protected: - explicit Float32Type(::google::protobuf::Arena* arena); + explicit Float32Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1699,12 +1416,30 @@ class Float32Type final : // accessors ------------------------------------------------------- enum : int { - kUnitFieldNumber = 1, + kDescriptionFieldNumber = 1, + kUnitFieldNumber = 3, kKindFieldNumber = 2, - kMinFieldNumber = 3, - kMaxFieldNumber = 4, + kMinFieldNumber = 4, + kMaxFieldNumber = 5, }; - // string unit = 1; + // string description = 1; + 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: + // optional string unit = 3; + bool has_unit() const; void clear_unit() ; const std::string& unit() const; template @@ -1730,7 +1465,8 @@ class Float32Type final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // float min = 3; + // optional float min = 4; + bool has_min() const; void clear_min() ; float min() const; void set_min(float value); @@ -1740,7 +1476,8 @@ class Float32Type final : void _internal_set_min(float value); public: - // float max = 4; + // optional float max = 5; + bool has_max() const; void clear_max() ; float max() const; void set_max(float value); @@ -1750,46 +1487,48 @@ class Float32Type final : void _internal_set_max(float value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Float32Type) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Float32Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 40, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 53, 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_; + ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; int kind_; float min_; float max_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class BoolType final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.BoolType) */ { +class BoolMetric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.BoolMetric) */ { public: - inline BoolType() : BoolType(nullptr) {} - ~BoolType() override; + inline BoolMetric() : BoolMetric(nullptr) {} + ~BoolMetric() override; template - explicit PROTOBUF_CONSTEXPR BoolType(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BoolMetric(::google::protobuf::internal::ConstantInitialized); - BoolType(const BoolType& from); - BoolType(BoolType&& from) noexcept - : BoolType() { + BoolMetric(const BoolMetric& from); + BoolMetric(BoolMetric&& from) noexcept + : BoolMetric() { *this = ::std::move(from); } - inline BoolType& operator=(const BoolType& from) { + inline BoolMetric& operator=(const BoolMetric& from) { CopyFrom(from); return *this; } - inline BoolType& operator=(BoolType&& from) noexcept { + inline BoolMetric& operator=(BoolMetric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1819,20 +1558,20 @@ class BoolType final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const BoolType& default_instance() { + static const BoolMetric& default_instance() { return *internal_default_instance(); } - static inline const BoolType* internal_default_instance() { - return reinterpret_cast( - &_BoolType_default_instance_); + static inline const BoolMetric* internal_default_instance() { + return reinterpret_cast( + &_BoolMetric_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 6; - friend void swap(BoolType& a, BoolType& b) { + friend void swap(BoolMetric& a, BoolMetric& b) { a.Swap(&b); } - inline void Swap(BoolType* other) { + inline void Swap(BoolMetric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1845,7 +1584,7 @@ class BoolType final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(BoolType* other) { + void UnsafeArenaSwap(BoolMetric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1853,14 +1592,14 @@ class BoolType final : // implements Message ---------------------------------------------- - BoolType* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + BoolMetric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const BoolType& from); + void CopyFrom(const BoolMetric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const BoolType& from) { - BoolType::MergeImpl(*this, from); + void MergeFrom( const BoolMetric& from) { + BoolMetric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1878,15 +1617,15 @@ class BoolType final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(BoolType* other); + void InternalSwap(BoolMetric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.BoolType"; + return "abacus.protobuf.BoolMetric"; } protected: - explicit BoolType(::google::protobuf::Arena* arena); + explicit BoolMetric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1899,10 +1638,28 @@ class BoolType final : // accessors ------------------------------------------------------- enum : int { - kUnitFieldNumber = 1, + kDescriptionFieldNumber = 1, + kUnitFieldNumber = 3, kKindFieldNumber = 2, }; - // string unit = 1; + // string description = 1; + 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: + // optional string unit = 3; + bool has_unit() const; void clear_unit() ; const std::string& unit() const; template @@ -1928,44 +1685,46 @@ class BoolType final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.BoolType) + // @@protoc_insertion_point(class_scope:abacus.protobuf.BoolMetric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 37, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 3, 0, 50, 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_; + ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; int kind_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class EnumInfo final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.EnumInfo) */ { +class EnumValue final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.EnumValue) */ { public: - inline EnumInfo() : EnumInfo(nullptr) {} - ~EnumInfo() override; + inline EnumValue() : EnumValue(nullptr) {} + ~EnumValue() override; template - explicit PROTOBUF_CONSTEXPR EnumInfo(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EnumValue(::google::protobuf::internal::ConstantInitialized); - EnumInfo(const EnumInfo& from); - EnumInfo(EnumInfo&& from) noexcept - : EnumInfo() { + EnumValue(const EnumValue& from); + EnumValue(EnumValue&& from) noexcept + : EnumValue() { *this = ::std::move(from); } - inline EnumInfo& operator=(const EnumInfo& from) { + inline EnumValue& operator=(const EnumValue& from) { CopyFrom(from); return *this; } - inline EnumInfo& operator=(EnumInfo&& from) noexcept { + inline EnumValue& operator=(EnumValue&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1995,20 +1754,20 @@ class EnumInfo final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const EnumInfo& default_instance() { + static const EnumValue& default_instance() { return *internal_default_instance(); } - static inline const EnumInfo* internal_default_instance() { - return reinterpret_cast( - &_EnumInfo_default_instance_); + static inline const EnumValue* internal_default_instance() { + return reinterpret_cast( + &_EnumValue_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 7; - friend void swap(EnumInfo& a, EnumInfo& b) { + friend void swap(EnumValue& a, EnumValue& b) { a.Swap(&b); } - inline void Swap(EnumInfo* other) { + inline void Swap(EnumValue* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2021,7 +1780,7 @@ class EnumInfo final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(EnumInfo* other) { + void UnsafeArenaSwap(EnumValue* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2029,14 +1788,14 @@ class EnumInfo final : // implements Message ---------------------------------------------- - EnumInfo* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + EnumValue* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const EnumInfo& from); + void CopyFrom(const EnumValue& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const EnumInfo& from) { - EnumInfo::MergeImpl(*this, from); + void MergeFrom( const EnumValue& from) { + EnumValue::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -2054,15 +1813,15 @@ class EnumInfo final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(EnumInfo* other); + void InternalSwap(EnumValue* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.EnumInfo"; + return "abacus.protobuf.EnumValue"; } protected: - explicit EnumInfo(::google::protobuf::Arena* arena); + explicit EnumValue(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -2077,7 +1836,6 @@ class EnumInfo final : enum : int { kNameFieldNumber = 1, kDescriptionFieldNumber = 2, - kSeverityFieldNumber = 3, }; // string name = 1; void clear_name() ; @@ -2112,23 +1870,12 @@ class EnumInfo final : std::string* _internal_mutable_description(); public: - // optional uint32 severity = 3; - bool has_severity() const; - void clear_severity() ; - ::uint32_t severity() const; - void set_severity(::uint32_t value); - - private: - ::uint32_t _internal_severity() const; - void _internal_set_severity(::uint32_t value); - - public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.EnumInfo) + // @@protoc_insertion_point(class_scope:abacus.protobuf.EnumValue) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 3, 0, 48, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 49, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2137,29 +1884,28 @@ class EnumInfo final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr description_; - ::uint32_t severity_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class EnumType_EnumMapEntry_DoNotUse final : public ::google::protobuf::internal::MapEntry { public: - typedef ::google::protobuf::internal::MapEntry SuperType; - EnumType_EnumMapEntry_DoNotUse(); + Enum8Metric_ValuesEntry_DoNotUse(); template - explicit PROTOBUF_CONSTEXPR EnumType_EnumMapEntry_DoNotUse( + explicit PROTOBUF_CONSTEXPR Enum8Metric_ValuesEntry_DoNotUse( ::google::protobuf::internal::ConstantInitialized); - explicit EnumType_EnumMapEntry_DoNotUse(::google::protobuf::Arena* arena); - void MergeFrom(const EnumType_EnumMapEntry_DoNotUse& other); - static const EnumType_EnumMapEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_EnumType_EnumMapEntry_DoNotUse_default_instance_); } + explicit Enum8Metric_ValuesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const Enum8Metric_ValuesEntry_DoNotUse& other); + static const Enum8Metric_ValuesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Enum8Metric_ValuesEntry_DoNotUse_default_instance_); } static bool ValidateKey(void*) { return true; } static bool ValidateValue(void*) { return true; } using ::google::protobuf::Message::MergeFrom; @@ -2168,25 +1914,25 @@ class EnumType_EnumMapEntry_DoNotUse final : public ::google::protobuf::internal }; // ------------------------------------------------------------------- -class EnumType final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.EnumType) */ { +class Enum8Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Enum8Metric) */ { public: - inline EnumType() : EnumType(nullptr) {} - ~EnumType() override; + inline Enum8Metric() : Enum8Metric(nullptr) {} + ~Enum8Metric() override; template - explicit PROTOBUF_CONSTEXPR EnumType(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Enum8Metric(::google::protobuf::internal::ConstantInitialized); - EnumType(const EnumType& from); - EnumType(EnumType&& from) noexcept - : EnumType() { + Enum8Metric(const Enum8Metric& from); + Enum8Metric(Enum8Metric&& from) noexcept + : Enum8Metric() { *this = ::std::move(from); } - inline EnumType& operator=(const EnumType& from) { + inline Enum8Metric& operator=(const Enum8Metric& from) { CopyFrom(from); return *this; } - inline EnumType& operator=(EnumType&& from) noexcept { + inline Enum8Metric& operator=(Enum8Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2216,20 +1962,20 @@ class EnumType final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const EnumType& default_instance() { + static const Enum8Metric& default_instance() { return *internal_default_instance(); } - static inline const EnumType* internal_default_instance() { - return reinterpret_cast( - &_EnumType_default_instance_); + static inline const Enum8Metric* internal_default_instance() { + return reinterpret_cast( + &_Enum8Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 9; - friend void swap(EnumType& a, EnumType& b) { + friend void swap(Enum8Metric& a, Enum8Metric& b) { a.Swap(&b); } - inline void Swap(EnumType* other) { + inline void Swap(Enum8Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2242,7 +1988,7 @@ class EnumType final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(EnumType* other) { + void UnsafeArenaSwap(Enum8Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2250,14 +1996,14 @@ class EnumType final : // implements Message ---------------------------------------------- - EnumType* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Enum8Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const EnumType& from); + void CopyFrom(const Enum8Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const EnumType& from) { - EnumType::MergeImpl(*this, from); + void MergeFrom( const Enum8Metric& from) { + Enum8Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -2275,15 +2021,15 @@ class EnumType final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(EnumType* other); + void InternalSwap(Enum8Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.EnumType"; + return "abacus.protobuf.Enum8Metric"; } protected: - explicit EnumType(::google::protobuf::Arena* arena); + explicit Enum8Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -2297,38 +2043,433 @@ class EnumType final : // accessors ------------------------------------------------------- enum : int { - kEnumMapFieldNumber = 1, + kValuesFieldNumber = 3, + kDescriptionFieldNumber = 1, + kUnitFieldNumber = 2, }; - // map enum_map = 1; - int enum_map_size() const; + // map values = 3; + int values_size() const; private: - int _internal_enum_map_size() const; + int _internal_values_size() const; public: - void clear_enum_map() ; - const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& enum_map() const; - ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* mutable_enum_map(); + void clear_values() ; + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& values() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* mutable_values(); private: - const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& _internal_enum_map() const; - ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* _internal_mutable_enum_map(); + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& _internal_values() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* _internal_mutable_values(); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.EnumType) - private: - class _Internal; + // string description = 1; + 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); - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 1, 2, 0, 2> _table_; - template friend class ::google::protobuf::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::google::protobuf::internal::MapField + 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: + // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 3, 2, 51, 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_; + ::google::protobuf::internal::MapField - enum_map_; + values_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr unit_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.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 TypeCase { + kUint64 = 2, + kInt64 = 3, + kUint32 = 4, + kInt32 = 5, + kFloat64 = 6, + kFloat32 = 7, + kBoolean = 8, + kEnum8 = 9, + TYPE_NOT_SET = 0, + }; + + static inline const Metric* internal_default_instance() { + return reinterpret_cast( + &_Metric_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + 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 "abacus.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 { + kOffsetFieldNumber = 1, + kUint64FieldNumber = 2, + kInt64FieldNumber = 3, + kUint32FieldNumber = 4, + kInt32FieldNumber = 5, + kFloat64FieldNumber = 6, + kFloat32FieldNumber = 7, + kBooleanFieldNumber = 8, + kEnum8FieldNumber = 9, + }; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // .abacus.protobuf.UInt64Metric uint64 = 2; + bool has_uint64() const; + private: + bool _internal_has_uint64() const; + + public: + void clear_uint64() ; + const ::abacus::protobuf::UInt64Metric& uint64() const; + PROTOBUF_NODISCARD ::abacus::protobuf::UInt64Metric* release_uint64(); + ::abacus::protobuf::UInt64Metric* mutable_uint64(); + void set_allocated_uint64(::abacus::protobuf::UInt64Metric* value); + void unsafe_arena_set_allocated_uint64(::abacus::protobuf::UInt64Metric* value); + ::abacus::protobuf::UInt64Metric* unsafe_arena_release_uint64(); + + private: + const ::abacus::protobuf::UInt64Metric& _internal_uint64() const; + ::abacus::protobuf::UInt64Metric* _internal_mutable_uint64(); + + public: + // .abacus.protobuf.Int64Metric int64 = 3; + bool has_int64() const; + private: + bool _internal_has_int64() const; + + public: + void clear_int64() ; + const ::abacus::protobuf::Int64Metric& int64() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Int64Metric* release_int64(); + ::abacus::protobuf::Int64Metric* mutable_int64(); + void set_allocated_int64(::abacus::protobuf::Int64Metric* value); + void unsafe_arena_set_allocated_int64(::abacus::protobuf::Int64Metric* value); + ::abacus::protobuf::Int64Metric* unsafe_arena_release_int64(); + + private: + const ::abacus::protobuf::Int64Metric& _internal_int64() const; + ::abacus::protobuf::Int64Metric* _internal_mutable_int64(); + + public: + // .abacus.protobuf.UInt32Metric uint32 = 4; + bool has_uint32() const; + private: + bool _internal_has_uint32() const; + + public: + void clear_uint32() ; + const ::abacus::protobuf::UInt32Metric& uint32() const; + PROTOBUF_NODISCARD ::abacus::protobuf::UInt32Metric* release_uint32(); + ::abacus::protobuf::UInt32Metric* mutable_uint32(); + void set_allocated_uint32(::abacus::protobuf::UInt32Metric* value); + void unsafe_arena_set_allocated_uint32(::abacus::protobuf::UInt32Metric* value); + ::abacus::protobuf::UInt32Metric* unsafe_arena_release_uint32(); + + private: + const ::abacus::protobuf::UInt32Metric& _internal_uint32() const; + ::abacus::protobuf::UInt32Metric* _internal_mutable_uint32(); + + public: + // .abacus.protobuf.Int32Metric int32 = 5; + bool has_int32() const; + private: + bool _internal_has_int32() const; + + public: + void clear_int32() ; + const ::abacus::protobuf::Int32Metric& int32() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Int32Metric* release_int32(); + ::abacus::protobuf::Int32Metric* mutable_int32(); + void set_allocated_int32(::abacus::protobuf::Int32Metric* value); + void unsafe_arena_set_allocated_int32(::abacus::protobuf::Int32Metric* value); + ::abacus::protobuf::Int32Metric* unsafe_arena_release_int32(); + + private: + const ::abacus::protobuf::Int32Metric& _internal_int32() const; + ::abacus::protobuf::Int32Metric* _internal_mutable_int32(); + + public: + // .abacus.protobuf.Float64Metric float64 = 6; + bool has_float64() const; + private: + bool _internal_has_float64() const; + + public: + void clear_float64() ; + const ::abacus::protobuf::Float64Metric& float64() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Float64Metric* release_float64(); + ::abacus::protobuf::Float64Metric* mutable_float64(); + void set_allocated_float64(::abacus::protobuf::Float64Metric* value); + void unsafe_arena_set_allocated_float64(::abacus::protobuf::Float64Metric* value); + ::abacus::protobuf::Float64Metric* unsafe_arena_release_float64(); + + private: + const ::abacus::protobuf::Float64Metric& _internal_float64() const; + ::abacus::protobuf::Float64Metric* _internal_mutable_float64(); + + public: + // .abacus.protobuf.Float32Metric float32 = 7; + bool has_float32() const; + private: + bool _internal_has_float32() const; + + public: + void clear_float32() ; + const ::abacus::protobuf::Float32Metric& float32() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Float32Metric* release_float32(); + ::abacus::protobuf::Float32Metric* mutable_float32(); + void set_allocated_float32(::abacus::protobuf::Float32Metric* value); + void unsafe_arena_set_allocated_float32(::abacus::protobuf::Float32Metric* value); + ::abacus::protobuf::Float32Metric* unsafe_arena_release_float32(); + + private: + const ::abacus::protobuf::Float32Metric& _internal_float32() const; + ::abacus::protobuf::Float32Metric* _internal_mutable_float32(); + + public: + // .abacus.protobuf.BoolMetric boolean = 8; + bool has_boolean() const; + private: + bool _internal_has_boolean() const; + + public: + void clear_boolean() ; + const ::abacus::protobuf::BoolMetric& boolean() const; + PROTOBUF_NODISCARD ::abacus::protobuf::BoolMetric* release_boolean(); + ::abacus::protobuf::BoolMetric* mutable_boolean(); + void set_allocated_boolean(::abacus::protobuf::BoolMetric* value); + void unsafe_arena_set_allocated_boolean(::abacus::protobuf::BoolMetric* value); + ::abacus::protobuf::BoolMetric* unsafe_arena_release_boolean(); + + private: + const ::abacus::protobuf::BoolMetric& _internal_boolean() const; + ::abacus::protobuf::BoolMetric* _internal_mutable_boolean(); + + public: + // .abacus.protobuf.Enum8Metric enum8 = 9; + bool has_enum8() const; + private: + bool _internal_has_enum8() const; + + public: + void clear_enum8() ; + const ::abacus::protobuf::Enum8Metric& enum8() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Enum8Metric* release_enum8(); + ::abacus::protobuf::Enum8Metric* mutable_enum8(); + void set_allocated_enum8(::abacus::protobuf::Enum8Metric* value); + void unsafe_arena_set_allocated_enum8(::abacus::protobuf::Enum8Metric* value); + ::abacus::protobuf::Enum8Metric* unsafe_arena_release_enum8(); + + private: + const ::abacus::protobuf::Enum8Metric& _internal_enum8() const; + ::abacus::protobuf::Enum8Metric* _internal_mutable_enum8(); + + public: + void clear_type(); + TypeCase type_case() const; + // @@protoc_insertion_point(class_scope:abacus.protobuf.Metric) + private: + class _Internal; + void set_has_uint64(); + void set_has_int64(); + void set_has_uint32(); + void set_has_int32(); + void set_has_float64(); + void set_has_float32(); + void set_has_boolean(); + void set_has_enum8(); + + inline bool has_type() const; + inline void clear_has_type(); + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 9, 8, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::uint32_t offset_; + union TypeUnion { + constexpr TypeUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::UInt64Metric* uint64_; + ::abacus::protobuf::Int64Metric* int64_; + ::abacus::protobuf::UInt32Metric* uint32_; + ::abacus::protobuf::Int32Metric* int32_; + ::abacus::protobuf::Float64Metric* float64_; + ::abacus::protobuf::Float32Metric* float32_; + ::abacus::protobuf::BoolMetric* boolean_; + ::abacus::protobuf::Enum8Metric* enum8_; + } type_; mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -2562,536 +2703,265 @@ class MetricsMetadata final : }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -};// ------------------------------------------------------------------- +}; -class MetricValue final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.MetricValue) */ { - public: - inline MetricValue() : MetricValue(nullptr) {} - ~MetricValue() override; - template - explicit PROTOBUF_CONSTEXPR MetricValue(::google::protobuf::internal::ConstantInitialized); - - MetricValue(const MetricValue& from); - MetricValue(MetricValue&& from) noexcept - : MetricValue() { - *this = ::std::move(from); - } - - inline MetricValue& operator=(const MetricValue& from) { - CopyFrom(from); - return *this; - } - inline MetricValue& operator=(MetricValue&& 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 MetricValue& default_instance() { - return *internal_default_instance(); - } - enum ValueCase { - kUint64Value = 2, - kInt64Value = 3, - kUint32Value = 4, - kInt32Value = 5, - kFloat32Value = 6, - kFloat64Value = 7, - kBoolValue = 8, - kEnumValue = 9, - VALUE_NOT_SET = 0, - }; - - static inline const MetricValue* internal_default_instance() { - return reinterpret_cast( - &_MetricValue_default_instance_); - } - static constexpr int kIndexInFileMessages = - 13; - - friend void swap(MetricValue& a, MetricValue& b) { - a.Swap(&b); - } - inline void Swap(MetricValue* 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(MetricValue* other) { - if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - MetricValue* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const MetricValue& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const MetricValue& from) { - MetricValue::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(MetricValue* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "abacus.protobuf.MetricValue"; - } - protected: - explicit MetricValue(::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 { - kValidFieldNumber = 1, - kUint64ValueFieldNumber = 2, - kInt64ValueFieldNumber = 3, - kUint32ValueFieldNumber = 4, - kInt32ValueFieldNumber = 5, - kFloat32ValueFieldNumber = 6, - kFloat64ValueFieldNumber = 7, - kBoolValueFieldNumber = 8, - kEnumValueFieldNumber = 9, - }; - // bool valid = 1; - void clear_valid() ; - bool valid() const; - void set_valid(bool value); - - private: - bool _internal_valid() const; - void _internal_set_valid(bool value); - - 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: - // uint32 uint32_value = 4; - bool has_uint32_value() const; - void clear_uint32_value() ; - ::uint32_t uint32_value() const; - void set_uint32_value(::uint32_t value); - - private: - ::uint32_t _internal_uint32_value() const; - void _internal_set_uint32_value(::uint32_t value); - - public: - // int32 int32_value = 5; - bool has_int32_value() const; - void clear_int32_value() ; - ::int32_t int32_value() const; - void set_int32_value(::int32_t value); - - private: - ::int32_t _internal_int32_value() const; - void _internal_set_int32_value(::int32_t value); - - public: - // float float32_value = 6; - bool has_float32_value() const; - void clear_float32_value() ; - float float32_value() const; - void set_float32_value(float value); - - private: - float _internal_float32_value() const; - void _internal_set_float32_value(float value); - - public: - // double float64_value = 7; - 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 = 8; - 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: - // uint32 enum_value = 9; - bool has_enum_value() const; - void clear_enum_value() ; - ::uint32_t enum_value() const; - void set_enum_value(::uint32_t value); - - private: - ::uint32_t _internal_enum_value() const; - void _internal_set_enum_value(::uint32_t value); - - public: - void clear_value(); - ValueCase value_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.MetricValue) - private: - class _Internal; - void set_has_uint64_value(); - void set_has_int64_value(); - void set_has_uint32_value(); - void set_has_int32_value(); - void set_has_float32_value(); - void set_has_float64_value(); - void set_has_bool_value(); - void set_has_enum_value(); - - inline bool has_value() const; - inline void clear_has_value(); - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 9, 0, 0, 2> _table_; - template friend class ::google::protobuf::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - bool valid_; - union ValueUnion { - constexpr ValueUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::uint64_t uint64_value_; - ::int64_t int64_value_; - ::uint32_t uint32_value_; - ::int32_t int32_value_; - float float32_value_; - double float64_value_; - bool bool_value_; - ::uint32_t enum_value_; - } value_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::uint32_t _oneof_case_[1]; - - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -};// ------------------------------------------------------------------- - -class MetricValues final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.MetricValues) */ { - public: - inline MetricValues() : MetricValues(nullptr) {} - ~MetricValues() override; - template - explicit PROTOBUF_CONSTEXPR MetricValues(::google::protobuf::internal::ConstantInitialized); - - MetricValues(const MetricValues& from); - MetricValues(MetricValues&& from) noexcept - : MetricValues() { - *this = ::std::move(from); - } - - inline MetricValues& operator=(const MetricValues& from) { - CopyFrom(from); - return *this; - } - inline MetricValues& operator=(MetricValues&& 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 MetricValues& default_instance() { - return *internal_default_instance(); - } - static inline const MetricValues* internal_default_instance() { - return reinterpret_cast( - &_MetricValues_default_instance_); - } - static constexpr int kIndexInFileMessages = - 14; - - friend void swap(MetricValues& a, MetricValues& b) { - a.Swap(&b); - } - inline void Swap(MetricValues* 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(MetricValues* other) { - if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - MetricValues* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const MetricValues& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const MetricValues& from) { - MetricValues::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(MetricValues* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "abacus.protobuf.MetricValues"; - } - protected: - explicit MetricValues(::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 { - kValuesFieldNumber = 2, - kSyncValueFieldNumber = 1, - }; - // repeated .abacus.protobuf.MetricValue values = 2; - int values_size() const; - private: - int _internal_values_size() const; - public: - void clear_values() ; - ::abacus::protobuf::MetricValue* mutable_values(int index); - ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >* - mutable_values(); - private: - const ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>& _internal_values() const; - ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>* _internal_mutable_values(); - public: - const ::abacus::protobuf::MetricValue& values(int index) const; - ::abacus::protobuf::MetricValue* add_values(); - const ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >& - values() const; - // uint32 sync_value = 1; - void clear_sync_value() ; - ::uint32_t sync_value() const; - void set_sync_value(::uint32_t value); - private: - ::uint32_t _internal_sync_value() const; - void _internal_set_sync_value(::uint32_t value); +// =================================================================== - public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.MetricValues) - 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< ::abacus::protobuf::MetricValue > values_; - ::uint32_t sync_value_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -}; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- -// =================================================================== +// UInt64Metric +// string description = 1; +inline void UInt64Metric::clear_description() { + _impl_.description_.ClearToEmpty(); +} +inline const std::string& UInt64Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.description) + return _internal_description(); +} +template +inline PROTOBUF_ALWAYS_INLINE void UInt64Metric::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:abacus.protobuf.UInt64Metric.description) +} +inline std::string* UInt64Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.description) + return _s; +} +inline const std::string& UInt64Metric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); +} +inline void UInt64Metric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); +} +inline std::string* UInt64Metric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); +} +inline std::string* UInt64Metric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.description) + return _impl_.description_.Release(); +} +inline void UInt64Metric::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:abacus.protobuf.UInt64Metric.description) +} +// .abacus.protobuf.Kind kind = 2; +inline void UInt64Metric::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind UInt64Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.kind) + return _internal_kind(); +} +inline void UInt64Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.kind) +} +inline ::abacus::protobuf::Kind UInt64Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void UInt64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} +// optional string unit = 3; +inline bool UInt64Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void UInt64Metric::clear_unit() { + _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& UInt64Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void UInt64Metric::set_unit(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.unit) +} +inline std::string* UInt64Metric::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.unit) + return _s; +} +inline const std::string& UInt64Metric::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void UInt64Metric::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* UInt64Metric::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* UInt64Metric::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void UInt64Metric::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _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:abacus.protobuf.UInt64Metric.unit) +} -// =================================================================== +// optional uint64 min = 4; +inline bool UInt64Metric::has_min() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void UInt64Metric::clear_min() { + _impl_.min_ = ::uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline ::uint64_t UInt64Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.min) + return _internal_min(); +} +inline void UInt64Metric::set_min(::uint64_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.min) +} +inline ::uint64_t UInt64Metric::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void UInt64Metric::_internal_set_min(::uint64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.min_ = value; +} +// optional uint64 max = 5; +inline bool UInt64Metric::has_max() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void UInt64Metric::clear_max() { + _impl_.max_ = ::uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::uint64_t UInt64Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.max) + return _internal_max(); +} +inline void UInt64Metric::set_max(::uint64_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.max) +} +inline ::uint64_t UInt64Metric::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void UInt64Metric::_internal_set_max(::uint64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.max_ = value; +} -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ // ------------------------------------------------------------------- -// Metric +// Int64Metric // string description = 1; -inline void Metric::clear_description() { +inline void Int64Metric::clear_description() { _impl_.description_.ClearToEmpty(); } -inline const std::string& Metric::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.description) +inline const std::string& Int64Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.description) return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void Metric::set_description(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Int64Metric::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:abacus.protobuf.Metric.description) + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.description) } -inline std::string* Metric::mutable_description() { +inline std::string* Int64Metric::mutable_description() { std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.description) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.description) return _s; } -inline const std::string& Metric::_internal_description() const { +inline const std::string& Int64Metric::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.description_.Get(); } -inline void Metric::_internal_set_description(const std::string& value) { +inline void Int64Metric::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* Metric::_internal_mutable_description() { +inline std::string* Int64Metric::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* Metric::release_description() { +inline std::string* Int64Metric::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.description) + // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.description) return _impl_.description_.Release(); } -inline void Metric::set_allocated_description(std::string* value) { +inline void Int64Metric::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_.description_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -3099,1641 +2969,2004 @@ inline void Metric::set_allocated_description(std::string* value) { _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.description) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.description) } -// uint32 value_offset = 2; -inline void Metric::clear_value_offset() { - _impl_.value_offset_ = 0u; +// .abacus.protobuf.Kind kind = 2; +inline void Int64Metric::clear_kind() { + _impl_.kind_ = 0; } -inline ::uint32_t Metric::value_offset() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.value_offset) - return _internal_value_offset(); +inline ::abacus::protobuf::Kind Int64Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.kind) + return _internal_kind(); } -inline void Metric::set_value_offset(::uint32_t value) { - _internal_set_value_offset(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.value_offset) +inline void Int64Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.kind) } -inline ::uint32_t Metric::_internal_value_offset() const { +inline ::abacus::protobuf::Kind Int64Metric::_internal_kind() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.value_offset_; + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline void Metric::_internal_set_value_offset(::uint32_t value) { +inline void Int64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.value_offset_ = value; + _impl_.kind_ = value; } -// uint32 valid_offset = 3; -inline void Metric::clear_valid_offset() { - _impl_.valid_offset_ = 0u; -} -inline ::uint32_t Metric::valid_offset() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.valid_offset) - return _internal_valid_offset(); +// optional string unit = 3; +inline bool Int64Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; } -inline void Metric::set_valid_offset(::uint32_t value) { - _internal_set_valid_offset(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.valid_offset) +inline void Int64Metric::clear_unit() { + _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline ::uint32_t Metric::_internal_valid_offset() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.valid_offset_; +inline const std::string& Int64Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.unit) + return _internal_unit(); } -inline void Metric::_internal_set_valid_offset(::uint32_t value) { +template +inline PROTOBUF_ALWAYS_INLINE void Int64Metric::set_unit(Arg_&& arg, + Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.valid_offset_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.unit) } - -// .abacus.protobuf.UInt64Type uint64_type = 4; -inline bool Metric::has_uint64_type() const { - return type_case() == kUint64Type; +inline std::string* Int64Metric::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.unit) + return _s; } -inline bool Metric::_internal_has_uint64_type() const { - return type_case() == kUint64Type; +inline const std::string& Int64Metric::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); } -inline void Metric::set_has_uint64_type() { - _impl_._oneof_case_[0] = kUint64Type; +inline void Int64Metric::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline void Metric::clear_uint64_type() { - if (type_case() == kUint64Type) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.uint64_type_; - } - clear_has_type(); - } +inline std::string* Int64Metric::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline ::abacus::protobuf::UInt64Type* Metric::release_uint64_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.uint64_type) - if (type_case() == kUint64Type) { - clear_has_type(); - ::abacus::protobuf::UInt64Type* temp = _impl_.type_.uint64_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.uint64_type_ = nullptr; - return temp; - } else { +inline std::string* Int64Metric::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline const ::abacus::protobuf::UInt64Type& Metric::_internal_uint64_type() const { - return type_case() == kUint64Type - ? *_impl_.type_.uint64_type_ - : reinterpret_cast<::abacus::protobuf::UInt64Type&>(::abacus::protobuf::_UInt64Type_default_instance_); -} -inline const ::abacus::protobuf::UInt64Type& Metric::uint64_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.uint64_type) - return _internal_uint64_type(); -} -inline ::abacus::protobuf::UInt64Type* Metric::unsafe_arena_release_uint64_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.uint64_type) - if (type_case() == kUint64Type) { - clear_has_type(); - ::abacus::protobuf::UInt64Type* temp = _impl_.type_.uint64_type_; - _impl_.type_.uint64_type_ = nullptr; - return temp; +inline void Int64Metric::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - return nullptr; + _impl_._has_bits_[0] &= ~0x00000001u; } + _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:abacus.protobuf.Int64Metric.unit) } -inline void Metric::unsafe_arena_set_allocated_uint64_type(::abacus::protobuf::UInt64Type* uint64_type) { - clear_type(); - if (uint64_type) { - set_has_uint64_type(); - _impl_.type_.uint64_type_ = uint64_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.uint64_type) + +// optional int64 min = 4; +inline bool Int64Metric::has_min() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline ::abacus::protobuf::UInt64Type* Metric::_internal_mutable_uint64_type() { - if (type_case() != kUint64Type) { - clear_type(); - set_has_uint64_type(); - _impl_.type_.uint64_type_ = CreateMaybeMessage< ::abacus::protobuf::UInt64Type >(GetArenaForAllocation()); - } - return _impl_.type_.uint64_type_; +inline void Int64Metric::clear_min() { + _impl_.min_ = ::int64_t{0}; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline ::abacus::protobuf::UInt64Type* Metric::mutable_uint64_type() { - ::abacus::protobuf::UInt64Type* _msg = _internal_mutable_uint64_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.uint64_type) - return _msg; +inline ::int64_t Int64Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.min) + return _internal_min(); } - -// .abacus.protobuf.Int64Type int64_type = 5; -inline bool Metric::has_int64_type() const { - return type_case() == kInt64Type; +inline void Int64Metric::set_min(::int64_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.min) } -inline bool Metric::_internal_has_int64_type() const { - return type_case() == kInt64Type; +inline ::int64_t Int64Metric::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; } -inline void Metric::set_has_int64_type() { - _impl_._oneof_case_[0] = kInt64Type; +inline void Int64Metric::_internal_set_min(::int64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.min_ = value; } -inline void Metric::clear_int64_type() { - if (type_case() == kInt64Type) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.int64_type_; - } - clear_has_type(); - } + +// optional int64 max = 5; +inline bool Int64Metric::has_max() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline ::abacus::protobuf::Int64Type* Metric::release_int64_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.int64_type) - if (type_case() == kInt64Type) { - clear_has_type(); - ::abacus::protobuf::Int64Type* temp = _impl_.type_.int64_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.int64_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void Int64Metric::clear_max() { + _impl_.max_ = ::int64_t{0}; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline const ::abacus::protobuf::Int64Type& Metric::_internal_int64_type() const { - return type_case() == kInt64Type - ? *_impl_.type_.int64_type_ - : reinterpret_cast<::abacus::protobuf::Int64Type&>(::abacus::protobuf::_Int64Type_default_instance_); +inline ::int64_t Int64Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.max) + return _internal_max(); } -inline const ::abacus::protobuf::Int64Type& Metric::int64_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.int64_type) - return _internal_int64_type(); +inline void Int64Metric::set_max(::int64_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.max) } -inline ::abacus::protobuf::Int64Type* Metric::unsafe_arena_release_int64_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.int64_type) - if (type_case() == kInt64Type) { - clear_has_type(); - ::abacus::protobuf::Int64Type* temp = _impl_.type_.int64_type_; - _impl_.type_.int64_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::int64_t Int64Metric::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; } -inline void Metric::unsafe_arena_set_allocated_int64_type(::abacus::protobuf::Int64Type* int64_type) { - clear_type(); - if (int64_type) { - set_has_int64_type(); - _impl_.type_.int64_type_ = int64_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.int64_type) +inline void Int64Metric::_internal_set_max(::int64_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.max_ = value; } -inline ::abacus::protobuf::Int64Type* Metric::_internal_mutable_int64_type() { - if (type_case() != kInt64Type) { - clear_type(); - set_has_int64_type(); - _impl_.type_.int64_type_ = CreateMaybeMessage< ::abacus::protobuf::Int64Type >(GetArenaForAllocation()); - } - return _impl_.type_.int64_type_; + +// ------------------------------------------------------------------- + +// UInt32Metric + +// string description = 1; +inline void UInt32Metric::clear_description() { + _impl_.description_.ClearToEmpty(); } -inline ::abacus::protobuf::Int64Type* Metric::mutable_int64_type() { - ::abacus::protobuf::Int64Type* _msg = _internal_mutable_int64_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.int64_type) - return _msg; +inline const std::string& UInt32Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.description) + return _internal_description(); } - -// .abacus.protobuf.UInt32Type uint32_type = 6; -inline bool Metric::has_uint32_type() const { - return type_case() == kUint32Type; +template +inline PROTOBUF_ALWAYS_INLINE void UInt32Metric::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:abacus.protobuf.UInt32Metric.description) } -inline bool Metric::_internal_has_uint32_type() const { - return type_case() == kUint32Type; +inline std::string* UInt32Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.description) + return _s; } -inline void Metric::set_has_uint32_type() { - _impl_._oneof_case_[0] = kUint32Type; +inline const std::string& UInt32Metric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); } -inline void Metric::clear_uint32_type() { - if (type_case() == kUint32Type) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.uint32_type_; - } - clear_has_type(); - } +inline void UInt32Metric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); } -inline ::abacus::protobuf::UInt32Type* Metric::release_uint32_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.uint32_type) - if (type_case() == kUint32Type) { - clear_has_type(); - ::abacus::protobuf::UInt32Type* temp = _impl_.type_.uint32_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.uint32_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline std::string* UInt32Metric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); +} +inline std::string* UInt32Metric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.description) + return _impl_.description_.Release(); } -inline const ::abacus::protobuf::UInt32Type& Metric::_internal_uint32_type() const { - return type_case() == kUint32Type - ? *_impl_.type_.uint32_type_ - : reinterpret_cast<::abacus::protobuf::UInt32Type&>(::abacus::protobuf::_UInt32Type_default_instance_); +inline void UInt32Metric::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:abacus.protobuf.UInt32Metric.description) } -inline const ::abacus::protobuf::UInt32Type& Metric::uint32_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.uint32_type) - return _internal_uint32_type(); + +// .abacus.protobuf.Kind kind = 2; +inline void UInt32Metric::clear_kind() { + _impl_.kind_ = 0; } -inline ::abacus::protobuf::UInt32Type* Metric::unsafe_arena_release_uint32_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.uint32_type) - if (type_case() == kUint32Type) { - clear_has_type(); - ::abacus::protobuf::UInt32Type* temp = _impl_.type_.uint32_type_; - _impl_.type_.uint32_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::abacus::protobuf::Kind UInt32Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.kind) + return _internal_kind(); } -inline void Metric::unsafe_arena_set_allocated_uint32_type(::abacus::protobuf::UInt32Type* uint32_type) { - clear_type(); - if (uint32_type) { - set_has_uint32_type(); - _impl_.type_.uint32_type_ = uint32_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.uint32_type) +inline void UInt32Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.kind) } -inline ::abacus::protobuf::UInt32Type* Metric::_internal_mutable_uint32_type() { - if (type_case() != kUint32Type) { - clear_type(); - set_has_uint32_type(); - _impl_.type_.uint32_type_ = CreateMaybeMessage< ::abacus::protobuf::UInt32Type >(GetArenaForAllocation()); - } - return _impl_.type_.uint32_type_; +inline ::abacus::protobuf::Kind UInt32Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline ::abacus::protobuf::UInt32Type* Metric::mutable_uint32_type() { - ::abacus::protobuf::UInt32Type* _msg = _internal_mutable_uint32_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.uint32_type) - return _msg; +inline void UInt32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; } -// .abacus.protobuf.Int32Type int32_type = 7; -inline bool Metric::has_int32_type() const { - return type_case() == kInt32Type; +// optional string unit = 3; +inline bool UInt32Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; } -inline bool Metric::_internal_has_int32_type() const { - return type_case() == kInt32Type; +inline void UInt32Metric::clear_unit() { + _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline void Metric::set_has_int32_type() { - _impl_._oneof_case_[0] = kInt32Type; +inline const std::string& UInt32Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.unit) + return _internal_unit(); } -inline void Metric::clear_int32_type() { - if (type_case() == kInt32Type) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.int32_type_; - } - clear_has_type(); - } +template +inline PROTOBUF_ALWAYS_INLINE void UInt32Metric::set_unit(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.unit) } -inline ::abacus::protobuf::Int32Type* Metric::release_int32_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.int32_type) - if (type_case() == kInt32Type) { - clear_has_type(); - ::abacus::protobuf::Int32Type* temp = _impl_.type_.int32_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.int32_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline std::string* UInt32Metric::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.unit) + return _s; } -inline const ::abacus::protobuf::Int32Type& Metric::_internal_int32_type() const { - return type_case() == kInt32Type - ? *_impl_.type_.int32_type_ - : reinterpret_cast<::abacus::protobuf::Int32Type&>(::abacus::protobuf::_Int32Type_default_instance_); +inline const std::string& UInt32Metric::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); } -inline const ::abacus::protobuf::Int32Type& Metric::int32_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.int32_type) - return _internal_int32_type(); +inline void UInt32Metric::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline ::abacus::protobuf::Int32Type* Metric::unsafe_arena_release_int32_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.int32_type) - if (type_case() == kInt32Type) { - clear_has_type(); - ::abacus::protobuf::Int32Type* temp = _impl_.type_.int32_type_; - _impl_.type_.int32_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline std::string* UInt32Metric::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline void Metric::unsafe_arena_set_allocated_int32_type(::abacus::protobuf::Int32Type* int32_type) { - clear_type(); - if (int32_type) { - set_has_int32_type(); - _impl_.type_.int32_type_ = int32_type; +inline std::string* UInt32Metric::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.int32_type) + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline ::abacus::protobuf::Int32Type* Metric::_internal_mutable_int32_type() { - if (type_case() != kInt32Type) { - clear_type(); - set_has_int32_type(); - _impl_.type_.int32_type_ = CreateMaybeMessage< ::abacus::protobuf::Int32Type >(GetArenaForAllocation()); +inline void UInt32Metric::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; } - return _impl_.type_.int32_type_; -} -inline ::abacus::protobuf::Int32Type* Metric::mutable_int32_type() { - ::abacus::protobuf::Int32Type* _msg = _internal_mutable_int32_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.int32_type) - return _msg; + _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:abacus.protobuf.UInt32Metric.unit) } -// .abacus.protobuf.Float64Type float64_type = 8; -inline bool Metric::has_float64_type() const { - return type_case() == kFloat64Type; -} -inline bool Metric::_internal_has_float64_type() const { - return type_case() == kFloat64Type; +// optional uint32 min = 4; +inline bool UInt32Metric::has_min() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline void Metric::set_has_float64_type() { - _impl_._oneof_case_[0] = kFloat64Type; +inline void UInt32Metric::clear_min() { + _impl_.min_ = 0u; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline void Metric::clear_float64_type() { - if (type_case() == kFloat64Type) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.float64_type_; - } - clear_has_type(); - } +inline ::uint32_t UInt32Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.min) + return _internal_min(); } -inline ::abacus::protobuf::Float64Type* Metric::release_float64_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.float64_type) - if (type_case() == kFloat64Type) { - clear_has_type(); - ::abacus::protobuf::Float64Type* temp = _impl_.type_.float64_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.float64_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void UInt32Metric::set_min(::uint32_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.min) } -inline const ::abacus::protobuf::Float64Type& Metric::_internal_float64_type() const { - return type_case() == kFloat64Type - ? *_impl_.type_.float64_type_ - : reinterpret_cast<::abacus::protobuf::Float64Type&>(::abacus::protobuf::_Float64Type_default_instance_); +inline ::uint32_t UInt32Metric::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; } -inline const ::abacus::protobuf::Float64Type& Metric::float64_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.float64_type) - return _internal_float64_type(); +inline void UInt32Metric::_internal_set_min(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.min_ = value; } -inline ::abacus::protobuf::Float64Type* Metric::unsafe_arena_release_float64_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.float64_type) - if (type_case() == kFloat64Type) { - clear_has_type(); - ::abacus::protobuf::Float64Type* temp = _impl_.type_.float64_type_; - _impl_.type_.float64_type_ = nullptr; - return temp; - } else { - return nullptr; - } + +// optional uint32 max = 5; +inline bool UInt32Metric::has_max() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline void Metric::unsafe_arena_set_allocated_float64_type(::abacus::protobuf::Float64Type* float64_type) { - clear_type(); - if (float64_type) { - set_has_float64_type(); - _impl_.type_.float64_type_ = float64_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.float64_type) +inline void UInt32Metric::clear_max() { + _impl_.max_ = 0u; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline ::abacus::protobuf::Float64Type* Metric::_internal_mutable_float64_type() { - if (type_case() != kFloat64Type) { - clear_type(); - set_has_float64_type(); - _impl_.type_.float64_type_ = CreateMaybeMessage< ::abacus::protobuf::Float64Type >(GetArenaForAllocation()); - } - return _impl_.type_.float64_type_; +inline ::uint32_t UInt32Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.max) + return _internal_max(); } -inline ::abacus::protobuf::Float64Type* Metric::mutable_float64_type() { - ::abacus::protobuf::Float64Type* _msg = _internal_mutable_float64_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.float64_type) - return _msg; +inline void UInt32Metric::set_max(::uint32_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.max) } - -// .abacus.protobuf.Float32Type float32_type = 9; -inline bool Metric::has_float32_type() const { - return type_case() == kFloat32Type; +inline ::uint32_t UInt32Metric::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; } -inline bool Metric::_internal_has_float32_type() const { - return type_case() == kFloat32Type; +inline void UInt32Metric::_internal_set_max(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.max_ = value; } -inline void Metric::set_has_float32_type() { - _impl_._oneof_case_[0] = kFloat32Type; + +// ------------------------------------------------------------------- + +// Int32Metric + +// string description = 1; +inline void Int32Metric::clear_description() { + _impl_.description_.ClearToEmpty(); } -inline void Metric::clear_float32_type() { - if (type_case() == kFloat32Type) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.float32_type_; - } - clear_has_type(); - } +inline const std::string& Int32Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.description) + return _internal_description(); } -inline ::abacus::protobuf::Float32Type* Metric::release_float32_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.float32_type) - if (type_case() == kFloat32Type) { - clear_has_type(); - ::abacus::protobuf::Float32Type* temp = _impl_.type_.float32_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.float32_type_ = nullptr; - return temp; - } else { - return nullptr; - } +template +inline PROTOBUF_ALWAYS_INLINE void Int32Metric::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:abacus.protobuf.Int32Metric.description) } -inline const ::abacus::protobuf::Float32Type& Metric::_internal_float32_type() const { - return type_case() == kFloat32Type - ? *_impl_.type_.float32_type_ - : reinterpret_cast<::abacus::protobuf::Float32Type&>(::abacus::protobuf::_Float32Type_default_instance_); +inline std::string* Int32Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.description) + return _s; } -inline const ::abacus::protobuf::Float32Type& Metric::float32_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.float32_type) - return _internal_float32_type(); +inline const std::string& Int32Metric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); } -inline ::abacus::protobuf::Float32Type* Metric::unsafe_arena_release_float32_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.float32_type) - if (type_case() == kFloat32Type) { - clear_has_type(); - ::abacus::protobuf::Float32Type* temp = _impl_.type_.float32_type_; - _impl_.type_.float32_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void Int32Metric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); } -inline void Metric::unsafe_arena_set_allocated_float32_type(::abacus::protobuf::Float32Type* float32_type) { - clear_type(); - if (float32_type) { - set_has_float32_type(); - _impl_.type_.float32_type_ = float32_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.float32_type) +inline std::string* Int32Metric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline ::abacus::protobuf::Float32Type* Metric::_internal_mutable_float32_type() { - if (type_case() != kFloat32Type) { - clear_type(); - set_has_float32_type(); - _impl_.type_.float32_type_ = CreateMaybeMessage< ::abacus::protobuf::Float32Type >(GetArenaForAllocation()); - } - return _impl_.type_.float32_type_; +inline std::string* Int32Metric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.description) + return _impl_.description_.Release(); } -inline ::abacus::protobuf::Float32Type* Metric::mutable_float32_type() { - ::abacus::protobuf::Float32Type* _msg = _internal_mutable_float32_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.float32_type) - return _msg; +inline void Int32Metric::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:abacus.protobuf.Int32Metric.description) } -// .abacus.protobuf.BoolType bool_type = 10; -inline bool Metric::has_bool_type() const { - return type_case() == kBoolType; -} -inline bool Metric::_internal_has_bool_type() const { - return type_case() == kBoolType; +// .abacus.protobuf.Kind kind = 2; +inline void Int32Metric::clear_kind() { + _impl_.kind_ = 0; } -inline void Metric::set_has_bool_type() { - _impl_._oneof_case_[0] = kBoolType; +inline ::abacus::protobuf::Kind Int32Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.kind) + return _internal_kind(); } -inline void Metric::clear_bool_type() { - if (type_case() == kBoolType) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.bool_type_; - } - clear_has_type(); - } +inline void Int32Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.kind) } -inline ::abacus::protobuf::BoolType* Metric::release_bool_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.bool_type) - if (type_case() == kBoolType) { - clear_has_type(); - ::abacus::protobuf::BoolType* temp = _impl_.type_.bool_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.bool_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::abacus::protobuf::Kind Int32Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline const ::abacus::protobuf::BoolType& Metric::_internal_bool_type() const { - return type_case() == kBoolType - ? *_impl_.type_.bool_type_ - : reinterpret_cast<::abacus::protobuf::BoolType&>(::abacus::protobuf::_BoolType_default_instance_); +inline void Int32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; } -inline const ::abacus::protobuf::BoolType& Metric::bool_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.bool_type) - return _internal_bool_type(); + +// optional string unit = 3; +inline bool Int32Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; } -inline ::abacus::protobuf::BoolType* Metric::unsafe_arena_release_bool_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.bool_type) - if (type_case() == kBoolType) { - clear_has_type(); - ::abacus::protobuf::BoolType* temp = _impl_.type_.bool_type_; - _impl_.type_.bool_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void Int32Metric::clear_unit() { + _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline void Metric::unsafe_arena_set_allocated_bool_type(::abacus::protobuf::BoolType* bool_type) { - clear_type(); - if (bool_type) { - set_has_bool_type(); - _impl_.type_.bool_type_ = bool_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.bool_type) +inline const std::string& Int32Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.unit) + return _internal_unit(); } -inline ::abacus::protobuf::BoolType* Metric::_internal_mutable_bool_type() { - if (type_case() != kBoolType) { - clear_type(); - set_has_bool_type(); - _impl_.type_.bool_type_ = CreateMaybeMessage< ::abacus::protobuf::BoolType >(GetArenaForAllocation()); - } - return _impl_.type_.bool_type_; +template +inline PROTOBUF_ALWAYS_INLINE void Int32Metric::set_unit(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.unit) } -inline ::abacus::protobuf::BoolType* Metric::mutable_bool_type() { - ::abacus::protobuf::BoolType* _msg = _internal_mutable_bool_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.bool_type) - return _msg; +inline std::string* Int32Metric::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.unit) + return _s; } - -// .abacus.protobuf.EnumType enum_type = 11; -inline bool Metric::has_enum_type() const { - return type_case() == kEnumType; +inline const std::string& Int32Metric::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); } -inline bool Metric::_internal_has_enum_type() const { - return type_case() == kEnumType; +inline void Int32Metric::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline void Metric::set_has_enum_type() { - _impl_._oneof_case_[0] = kEnumType; +inline std::string* Int32Metric::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline void Metric::clear_enum_type() { - if (type_case() == kEnumType) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.enum_type_; - } - clear_has_type(); +inline std::string* Int32Metric::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline ::abacus::protobuf::EnumType* Metric::release_enum_type() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.enum_type) - if (type_case() == kEnumType) { - clear_has_type(); - ::abacus::protobuf::EnumType* temp = _impl_.type_.enum_type_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.enum_type_ = nullptr; - return temp; +inline void Int32Metric::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - return nullptr; + _impl_._has_bits_[0] &= ~0x00000001u; } + _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:abacus.protobuf.Int32Metric.unit) } -inline const ::abacus::protobuf::EnumType& Metric::_internal_enum_type() const { - return type_case() == kEnumType - ? *_impl_.type_.enum_type_ - : reinterpret_cast<::abacus::protobuf::EnumType&>(::abacus::protobuf::_EnumType_default_instance_); -} -inline const ::abacus::protobuf::EnumType& Metric::enum_type() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.enum_type) - return _internal_enum_type(); + +// optional int32 min = 4; +inline bool Int32Metric::has_min() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline ::abacus::protobuf::EnumType* Metric::unsafe_arena_release_enum_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.enum_type) - if (type_case() == kEnumType) { - clear_has_type(); - ::abacus::protobuf::EnumType* temp = _impl_.type_.enum_type_; - _impl_.type_.enum_type_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void Int32Metric::clear_min() { + _impl_.min_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline void Metric::unsafe_arena_set_allocated_enum_type(::abacus::protobuf::EnumType* enum_type) { - clear_type(); - if (enum_type) { - set_has_enum_type(); - _impl_.type_.enum_type_ = enum_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.enum_type) +inline ::int32_t Int32Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.min) + return _internal_min(); } -inline ::abacus::protobuf::EnumType* Metric::_internal_mutable_enum_type() { - if (type_case() != kEnumType) { - clear_type(); - set_has_enum_type(); - _impl_.type_.enum_type_ = CreateMaybeMessage< ::abacus::protobuf::EnumType >(GetArenaForAllocation()); - } - return _impl_.type_.enum_type_; +inline void Int32Metric::set_min(::int32_t value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.min) } -inline ::abacus::protobuf::EnumType* Metric::mutable_enum_type() { - ::abacus::protobuf::EnumType* _msg = _internal_mutable_enum_type(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.enum_type) - return _msg; +inline ::int32_t Int32Metric::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void Int32Metric::_internal_set_min(::int32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.min_ = value; } -inline bool Metric::has_type() const { - return type_case() != TYPE_NOT_SET; +// optional int32 max = 5; +inline bool Int32Metric::has_max() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline void Metric::clear_has_type() { - _impl_._oneof_case_[0] = TYPE_NOT_SET; +inline void Int32Metric::clear_max() { + _impl_.max_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline Metric::TypeCase Metric::type_case() const { - return Metric::TypeCase(_impl_._oneof_case_[0]); +inline ::int32_t Int32Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.max) + return _internal_max(); +} +inline void Int32Metric::set_max(::int32_t value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.max) } +inline ::int32_t Int32Metric::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; +} +inline void Int32Metric::_internal_set_max(::int32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.max_ = value; +} + // ------------------------------------------------------------------- -// UInt64Type +// Float64Metric -// string unit = 1; -inline void UInt64Type::clear_unit() { - _impl_.unit_.ClearToEmpty(); +// string description = 1; +inline void Float64Metric::clear_description() { + _impl_.description_.ClearToEmpty(); } -inline const std::string& UInt64Type::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.unit) - return _internal_unit(); +inline const std::string& Float64Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.description) + return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void UInt64Type::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Float64Metric::set_description(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Type.unit) + _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.description) } -inline std::string* UInt64Type::mutable_unit() { - std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Type.unit) +inline std::string* Float64Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.description) return _s; } -inline const std::string& UInt64Type::_internal_unit() const { +inline const std::string& Float64Metric::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.unit_.Get(); + return _impl_.description_.Get(); } -inline void UInt64Type::_internal_set_unit(const std::string& value) { +inline void Float64Metric::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.unit_.Set(value, GetArenaForAllocation()); + _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* UInt64Type::_internal_mutable_unit() { +inline std::string* Float64Metric::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - return _impl_.unit_.Mutable( GetArenaForAllocation()); + return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* UInt64Type::release_unit() { +inline std::string* Float64Metric::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Type.unit) - return _impl_.unit_.Release(); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.description) + return _impl_.description_.Release(); } -inline void UInt64Type::set_allocated_unit(std::string* value) { +inline void Float64Metric::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.unit_.SetAllocated(value, GetArenaForAllocation()); + _impl_.description_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.unit_.IsDefault()) { - _impl_.unit_.Set("", GetArenaForAllocation()); + if (_impl_.description_.IsDefault()) { + _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Type.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.description) } // .abacus.protobuf.Kind kind = 2; -inline void UInt64Type::clear_kind() { +inline void Float64Metric::clear_kind() { _impl_.kind_ = 0; } -inline ::abacus::protobuf::Kind UInt64Type::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.kind) +inline ::abacus::protobuf::Kind Float64Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.kind) return _internal_kind(); } -inline void UInt64Type::set_kind(::abacus::protobuf::Kind value) { +inline void Float64Metric::set_kind(::abacus::protobuf::Kind value) { _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Type.kind) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.kind) } -inline ::abacus::protobuf::Kind UInt64Type::_internal_kind() const { +inline ::abacus::protobuf::Kind Float64Metric::_internal_kind() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline void UInt64Type::_internal_set_kind(::abacus::protobuf::Kind value) { +inline void Float64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.kind_ = value; } -// uint64 min = 3; -inline void UInt64Type::clear_min() { - _impl_.min_ = ::uint64_t{0u}; +// optional string unit = 3; +inline bool Float64Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void Float64Metric::clear_unit() { + _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Float64Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Float64Metric::set_unit(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.unit) +} +inline std::string* Float64Metric::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.unit) + return _s; +} +inline const std::string& Float64Metric::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Float64Metric::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Float64Metric::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Float64Metric::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void Float64Metric::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _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:abacus.protobuf.Float64Metric.unit) +} + +// optional double min = 4; +inline bool Float64Metric::has_min() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void Float64Metric::clear_min() { + _impl_.min_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline ::uint64_t UInt64Type::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.min) +inline double Float64Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.min) return _internal_min(); } -inline void UInt64Type::set_min(::uint64_t value) { +inline void Float64Metric::set_min(double value) { _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Type.min) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.min) } -inline ::uint64_t UInt64Type::_internal_min() const { +inline double Float64Metric::_internal_min() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.min_; } -inline void UInt64Type::_internal_set_min(::uint64_t value) { +inline void Float64Metric::_internal_set_min(double value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.min_ = value; } -// uint64 max = 4; -inline void UInt64Type::clear_max() { - _impl_.max_ = ::uint64_t{0u}; +// optional double max = 5; +inline bool Float64Metric::has_max() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void Float64Metric::clear_max() { + _impl_.max_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline ::uint64_t UInt64Type::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Type.max) +inline double Float64Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.max) return _internal_max(); } -inline void UInt64Type::set_max(::uint64_t value) { +inline void Float64Metric::set_max(double value) { _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Type.max) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.max) } -inline ::uint64_t UInt64Type::_internal_max() const { +inline double Float64Metric::_internal_max() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.max_; } -inline void UInt64Type::_internal_set_max(::uint64_t value) { +inline void Float64Metric::_internal_set_max(double value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000004u; _impl_.max_ = value; } // ------------------------------------------------------------------- -// Int64Type +// Float32Metric -// string unit = 1; -inline void Int64Type::clear_unit() { - _impl_.unit_.ClearToEmpty(); +// string description = 1; +inline void Float32Metric::clear_description() { + _impl_.description_.ClearToEmpty(); } -inline const std::string& Int64Type::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.unit) - return _internal_unit(); +inline const std::string& Float32Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.description) + return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void Int64Type::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Float32Metric::set_description(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Type.unit) + _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.description) } -inline std::string* Int64Type::mutable_unit() { - std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Type.unit) +inline std::string* Float32Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.description) return _s; } -inline const std::string& Int64Type::_internal_unit() const { +inline const std::string& Float32Metric::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.unit_.Get(); + return _impl_.description_.Get(); } -inline void Int64Type::_internal_set_unit(const std::string& value) { +inline void Float32Metric::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.unit_.Set(value, GetArenaForAllocation()); + _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* Int64Type::_internal_mutable_unit() { +inline std::string* Float32Metric::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - return _impl_.unit_.Mutable( GetArenaForAllocation()); + return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* Int64Type::release_unit() { +inline std::string* Float32Metric::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Type.unit) - return _impl_.unit_.Release(); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.description) + return _impl_.description_.Release(); } -inline void Int64Type::set_allocated_unit(std::string* value) { +inline void Float32Metric::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.unit_.SetAllocated(value, GetArenaForAllocation()); + _impl_.description_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.unit_.IsDefault()) { - _impl_.unit_.Set("", GetArenaForAllocation()); + if (_impl_.description_.IsDefault()) { + _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Type.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.description) } // .abacus.protobuf.Kind kind = 2; -inline void Int64Type::clear_kind() { +inline void Float32Metric::clear_kind() { _impl_.kind_ = 0; } -inline ::abacus::protobuf::Kind Int64Type::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.kind) +inline ::abacus::protobuf::Kind Float32Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.kind) return _internal_kind(); } -inline void Int64Type::set_kind(::abacus::protobuf::Kind value) { +inline void Float32Metric::set_kind(::abacus::protobuf::Kind value) { _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Type.kind) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.kind) } -inline ::abacus::protobuf::Kind Int64Type::_internal_kind() const { +inline ::abacus::protobuf::Kind Float32Metric::_internal_kind() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline void Int64Type::_internal_set_kind(::abacus::protobuf::Kind value) { +inline void Float32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.kind_ = value; } -// int64 min = 3; -inline void Int64Type::clear_min() { - _impl_.min_ = ::int64_t{0}; +// optional string unit = 3; +inline bool Float32Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void Float32Metric::clear_unit() { + _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Float32Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Float32Metric::set_unit(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.unit) +} +inline std::string* Float32Metric::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.unit) + return _s; +} +inline const std::string& Float32Metric::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Float32Metric::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Float32Metric::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Float32Metric::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void Float32Metric::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _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:abacus.protobuf.Float32Metric.unit) +} + +// optional float min = 4; +inline bool Float32Metric::has_min() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void Float32Metric::clear_min() { + _impl_.min_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline ::int64_t Int64Type::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.min) +inline float Float32Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.min) return _internal_min(); } -inline void Int64Type::set_min(::int64_t value) { +inline void Float32Metric::set_min(float value) { _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Type.min) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.min) } -inline ::int64_t Int64Type::_internal_min() const { +inline float Float32Metric::_internal_min() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.min_; } -inline void Int64Type::_internal_set_min(::int64_t value) { +inline void Float32Metric::_internal_set_min(float value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.min_ = value; } -// int64 max = 4; -inline void Int64Type::clear_max() { - _impl_.max_ = ::int64_t{0}; +// optional float max = 5; +inline bool Float32Metric::has_max() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline ::int64_t Int64Type::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Type.max) +inline void Float32Metric::clear_max() { + _impl_.max_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline float Float32Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.max) return _internal_max(); } -inline void Int64Type::set_max(::int64_t value) { +inline void Float32Metric::set_max(float value) { _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Type.max) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.max) } -inline ::int64_t Int64Type::_internal_max() const { +inline float Float32Metric::_internal_max() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.max_; } -inline void Int64Type::_internal_set_max(::int64_t value) { +inline void Float32Metric::_internal_set_max(float value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.max_ = value; +} + +// ------------------------------------------------------------------- + +// BoolMetric + +// string description = 1; +inline void BoolMetric::clear_description() { + _impl_.description_.ClearToEmpty(); +} +inline const std::string& BoolMetric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.description) + return _internal_description(); +} +template +inline PROTOBUF_ALWAYS_INLINE void BoolMetric::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:abacus.protobuf.BoolMetric.description) +} +inline std::string* BoolMetric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.description) + return _s; +} +inline const std::string& BoolMetric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); +} +inline void BoolMetric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); +} +inline std::string* BoolMetric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); +} +inline std::string* BoolMetric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.description) + return _impl_.description_.Release(); +} +inline void BoolMetric::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:abacus.protobuf.BoolMetric.description) +} + +// .abacus.protobuf.Kind kind = 2; +inline void BoolMetric::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind BoolMetric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.kind) + return _internal_kind(); +} +inline void BoolMetric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.kind) +} +inline ::abacus::protobuf::Kind BoolMetric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void BoolMetric::_internal_set_kind(::abacus::protobuf::Kind value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.max_ = value; + _impl_.kind_ = value; } -// ------------------------------------------------------------------- - -// UInt32Type - -// string unit = 1; -inline void UInt32Type::clear_unit() { +// optional string unit = 3; +inline bool BoolMetric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void BoolMetric::clear_unit() { _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& UInt32Type::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.unit) +inline const std::string& BoolMetric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.unit) return _internal_unit(); } template -inline PROTOBUF_ALWAYS_INLINE void UInt32Type::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void BoolMetric::set_unit(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Type.unit) + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.unit) } -inline std::string* UInt32Type::mutable_unit() { +inline std::string* BoolMetric::mutable_unit() { std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Type.unit) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.unit) return _s; } -inline const std::string& UInt32Type::_internal_unit() const { +inline const std::string& BoolMetric::_internal_unit() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.unit_.Get(); } -inline void UInt32Type::_internal_set_unit(const std::string& value) { +inline void BoolMetric::_internal_set_unit(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline std::string* UInt32Type::_internal_mutable_unit() { +inline std::string* BoolMetric::_internal_mutable_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline std::string* UInt32Type::release_unit() { +inline std::string* BoolMetric::release_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Type.unit) - return _impl_.unit_.Release(); + // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline void UInt32Type::set_allocated_unit(std::string* value) { +inline void BoolMetric::set_allocated_unit(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } _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:abacus.protobuf.UInt32Type.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.unit) } -// .abacus.protobuf.Kind kind = 2; -inline void UInt32Type::clear_kind() { - _impl_.kind_ = 0; -} -inline ::abacus::protobuf::Kind UInt32Type::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.kind) - return _internal_kind(); -} -inline void UInt32Type::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Type.kind) +// ------------------------------------------------------------------- + +// EnumValue + +// string name = 1; +inline void EnumValue::clear_name() { + _impl_.name_.ClearToEmpty(); } -inline ::abacus::protobuf::Kind UInt32Type::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline const std::string& EnumValue::name() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.EnumValue.name) + return _internal_name(); } -inline void UInt32Type::_internal_set_kind(::abacus::protobuf::Kind value) { +template +inline PROTOBUF_ALWAYS_INLINE void EnumValue::set_name(Arg_&& arg, + Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.kind_ = value; -} - -// uint32 min = 3; -inline void UInt32Type::clear_min() { - _impl_.min_ = 0u; -} -inline ::uint32_t UInt32Type::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.min) - return _internal_min(); + _impl_.name_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.EnumValue.name) } -inline void UInt32Type::set_min(::uint32_t value) { - _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Type.min) +inline std::string* EnumValue::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumValue.name) + return _s; } -inline ::uint32_t UInt32Type::_internal_min() const { +inline const std::string& EnumValue::_internal_name() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.min_; + return _impl_.name_.Get(); } -inline void UInt32Type::_internal_set_min(::uint32_t value) { +inline void EnumValue::_internal_set_name(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.min_ = value; -} - -// uint32 max = 4; -inline void UInt32Type::clear_max() { - _impl_.max_ = 0u; -} -inline ::uint32_t UInt32Type::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Type.max) - return _internal_max(); + _impl_.name_.Set(value, GetArenaForAllocation()); } -inline void UInt32Type::set_max(::uint32_t value) { - _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Type.max) +inline std::string* EnumValue::_internal_mutable_name() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.name_.Mutable( GetArenaForAllocation()); } -inline ::uint32_t UInt32Type::_internal_max() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.max_; +inline std::string* EnumValue::release_name() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.EnumValue.name) + return _impl_.name_.Release(); } -inline void UInt32Type::_internal_set_max(::uint32_t value) { +inline void EnumValue::set_allocated_name(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.max_ = value; + _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:abacus.protobuf.EnumValue.name) } -// ------------------------------------------------------------------- - -// Int32Type - -// string unit = 1; -inline void Int32Type::clear_unit() { - _impl_.unit_.ClearToEmpty(); +// optional string description = 2; +inline bool EnumValue::has_description() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; } -inline const std::string& Int32Type::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.unit) - return _internal_unit(); +inline void EnumValue::clear_description() { + _impl_.description_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& EnumValue::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.EnumValue.description) + return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void Int32Type::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void EnumValue::set_description(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Type.unit) + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.EnumValue.description) } -inline std::string* Int32Type::mutable_unit() { - std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Type.unit) +inline std::string* EnumValue::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumValue.description) return _s; } -inline const std::string& Int32Type::_internal_unit() const { +inline const std::string& EnumValue::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.unit_.Get(); + return _impl_.description_.Get(); } -inline void Int32Type::_internal_set_unit(const std::string& value) { +inline void EnumValue::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.unit_.Set(value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* Int32Type::_internal_mutable_unit() { +inline std::string* EnumValue::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.unit_.Mutable( GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* Int32Type::release_unit() { +inline std::string* EnumValue::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Type.unit) - return _impl_.unit_.Release(); + // @@protoc_insertion_point(field_release:abacus.protobuf.EnumValue.description) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.description_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.description_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline void Int32Type::set_allocated_unit(std::string* value) { +inline void EnumValue::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.unit_.SetAllocated(value, GetArenaForAllocation()); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.description_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.unit_.IsDefault()) { - _impl_.unit_.Set("", GetArenaForAllocation()); + if (_impl_.description_.IsDefault()) { + _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Type.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.EnumValue.description) } -// .abacus.protobuf.Kind kind = 2; -inline void Int32Type::clear_kind() { - _impl_.kind_ = 0; -} -inline ::abacus::protobuf::Kind Int32Type::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.kind) - return _internal_kind(); -} -inline void Int32Type::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Type.kind) +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// Enum8Metric + +// string description = 1; +inline void Enum8Metric::clear_description() { + _impl_.description_.ClearToEmpty(); } -inline ::abacus::protobuf::Kind Int32Type::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline const std::string& Enum8Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.description) + return _internal_description(); } -inline void Int32Type::_internal_set_kind(::abacus::protobuf::Kind value) { +template +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric::set_description(Arg_&& arg, + Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.kind_ = value; -} - -// int32 min = 3; -inline void Int32Type::clear_min() { - _impl_.min_ = 0; -} -inline ::int32_t Int32Type::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.min) - return _internal_min(); + _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.description) } -inline void Int32Type::set_min(::int32_t value) { - _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Type.min) +inline std::string* Enum8Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.description) + return _s; } -inline ::int32_t Int32Type::_internal_min() const { +inline const std::string& Enum8Metric::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.min_; + return _impl_.description_.Get(); } -inline void Int32Type::_internal_set_min(::int32_t value) { +inline void Enum8Metric::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; - _impl_.min_ = value; -} - -// int32 max = 4; -inline void Int32Type::clear_max() { - _impl_.max_ = 0; -} -inline ::int32_t Int32Type::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Type.max) - return _internal_max(); + _impl_.description_.Set(value, GetArenaForAllocation()); } -inline void Int32Type::set_max(::int32_t value) { - _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Type.max) +inline std::string* Enum8Metric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline ::int32_t Int32Type::_internal_max() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.max_; +inline std::string* Enum8Metric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.description) + return _impl_.description_.Release(); } -inline void Int32Type::_internal_set_max(::int32_t value) { +inline void Enum8Metric::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.max_ = value; + _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:abacus.protobuf.Enum8Metric.description) } -// ------------------------------------------------------------------- - -// Float64Type - -// string unit = 1; -inline void Float64Type::clear_unit() { +// optional string unit = 2; +inline bool Enum8Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void Enum8Metric::clear_unit() { _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& Float64Type::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.unit) +inline const std::string& Enum8Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.unit) return _internal_unit(); } template -inline PROTOBUF_ALWAYS_INLINE void Float64Type::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric::set_unit(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Type.unit) + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.unit) } -inline std::string* Float64Type::mutable_unit() { +inline std::string* Enum8Metric::mutable_unit() { std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Type.unit) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.unit) return _s; } -inline const std::string& Float64Type::_internal_unit() const { +inline const std::string& Enum8Metric::_internal_unit() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.unit_.Get(); } -inline void Float64Type::_internal_set_unit(const std::string& value) { +inline void Enum8Metric::_internal_set_unit(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline std::string* Float64Type::_internal_mutable_unit() { +inline std::string* Enum8Metric::_internal_mutable_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; + _impl_._has_bits_[0] |= 0x00000001u; return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline std::string* Float64Type::release_unit() { +inline std::string* Enum8Metric::release_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Type.unit) - return _impl_.unit_.Release(); + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline void Float64Type::set_allocated_unit(std::string* value) { +inline void Enum8Metric::set_allocated_unit(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } _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:abacus.protobuf.Float64Type.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.unit) } -// .abacus.protobuf.Kind kind = 2; -inline void Float64Type::clear_kind() { - _impl_.kind_ = 0; +// map values = 3; +inline int Enum8Metric::_internal_values_size() const { + return _internal_values().size(); } -inline ::abacus::protobuf::Kind Float64Type::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.kind) - return _internal_kind(); +inline int Enum8Metric::values_size() const { + return _internal_values_size(); } -inline void Float64Type::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Type.kind) +inline void Enum8Metric::clear_values() { + _impl_.values_.Clear(); } -inline ::abacus::protobuf::Kind Float64Type::_internal_kind() const { +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& Enum8Metric::_internal_values() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); + return _impl_.values_.GetMap(); +} +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& Enum8Metric::values() const { + // @@protoc_insertion_point(field_map:abacus.protobuf.Enum8Metric.values) + return _internal_values(); +} +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* Enum8Metric::_internal_mutable_values() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + return _impl_.values_.MutableMap(); +} +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* Enum8Metric::mutable_values() { + // @@protoc_insertion_point(field_mutable_map:abacus.protobuf.Enum8Metric.values) + return _internal_mutable_values(); +} + +// ------------------------------------------------------------------- + +// Metric + +// uint32 offset = 1; +inline void Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.offset) + return _internal_offset(); +} +inline void Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.offset) +} +inline ::uint32_t Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// .abacus.protobuf.UInt64Metric uint64 = 2; +inline bool Metric::has_uint64() const { + return type_case() == kUint64; +} +inline bool Metric::_internal_has_uint64() const { + return type_case() == kUint64; +} +inline void Metric::set_has_uint64() { + _impl_._oneof_case_[0] = kUint64; +} +inline void Metric::clear_uint64() { + if (type_case() == kUint64) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint64_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::UInt64Metric* Metric::release_uint64() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.uint64) + if (type_case() == kUint64) { + clear_has_type(); + ::abacus::protobuf::UInt64Metric* temp = _impl_.type_.uint64_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.uint64_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::UInt64Metric& Metric::_internal_uint64() const { + return type_case() == kUint64 + ? *_impl_.type_.uint64_ + : reinterpret_cast<::abacus::protobuf::UInt64Metric&>(::abacus::protobuf::_UInt64Metric_default_instance_); +} +inline const ::abacus::protobuf::UInt64Metric& Metric::uint64() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.uint64) + return _internal_uint64(); +} +inline ::abacus::protobuf::UInt64Metric* Metric::unsafe_arena_release_uint64() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.uint64) + if (type_case() == kUint64) { + clear_has_type(); + ::abacus::protobuf::UInt64Metric* temp = _impl_.type_.uint64_; + _impl_.type_.uint64_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline void Float64Type::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline void Metric::unsafe_arena_set_allocated_uint64(::abacus::protobuf::UInt64Metric* uint64) { + clear_type(); + if (uint64) { + set_has_uint64(); + _impl_.type_.uint64_ = uint64; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.uint64) } - -// double min = 3; -inline void Float64Type::clear_min() { - _impl_.min_ = 0; +inline ::abacus::protobuf::UInt64Metric* Metric::_internal_mutable_uint64() { + if (type_case() != kUint64) { + clear_type(); + set_has_uint64(); + _impl_.type_.uint64_ = CreateMaybeMessage< ::abacus::protobuf::UInt64Metric >(GetArenaForAllocation()); + } + return _impl_.type_.uint64_; } -inline double Float64Type::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.min) - return _internal_min(); +inline ::abacus::protobuf::UInt64Metric* Metric::mutable_uint64() { + ::abacus::protobuf::UInt64Metric* _msg = _internal_mutable_uint64(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.uint64) + return _msg; } -inline void Float64Type::set_min(double value) { - _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Type.min) + +// .abacus.protobuf.Int64Metric int64 = 3; +inline bool Metric::has_int64() const { + return type_case() == kInt64; } -inline double Float64Type::_internal_min() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.min_; +inline bool Metric::_internal_has_int64() const { + return type_case() == kInt64; } -inline void Float64Type::_internal_set_min(double value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.min_ = value; +inline void Metric::set_has_int64() { + _impl_._oneof_case_[0] = kInt64; } - -// double max = 4; -inline void Float64Type::clear_max() { - _impl_.max_ = 0; +inline void Metric::clear_int64() { + if (type_case() == kInt64) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int64_; + } + clear_has_type(); + } } -inline double Float64Type::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Type.max) - return _internal_max(); +inline ::abacus::protobuf::Int64Metric* Metric::release_int64() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.int64) + if (type_case() == kInt64) { + clear_has_type(); + ::abacus::protobuf::Int64Metric* temp = _impl_.type_.int64_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.int64_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline void Float64Type::set_max(double value) { - _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Type.max) +inline const ::abacus::protobuf::Int64Metric& Metric::_internal_int64() const { + return type_case() == kInt64 + ? *_impl_.type_.int64_ + : reinterpret_cast<::abacus::protobuf::Int64Metric&>(::abacus::protobuf::_Int64Metric_default_instance_); } -inline double Float64Type::_internal_max() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.max_; +inline const ::abacus::protobuf::Int64Metric& Metric::int64() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.int64) + return _internal_int64(); } -inline void Float64Type::_internal_set_max(double value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.max_ = value; +inline ::abacus::protobuf::Int64Metric* Metric::unsafe_arena_release_int64() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.int64) + if (type_case() == kInt64) { + clear_has_type(); + ::abacus::protobuf::Int64Metric* temp = _impl_.type_.int64_; + _impl_.type_.int64_ = nullptr; + return temp; + } else { + return nullptr; + } } - -// ------------------------------------------------------------------- - -// Float32Type - -// string unit = 1; -inline void Float32Type::clear_unit() { - _impl_.unit_.ClearToEmpty(); +inline void Metric::unsafe_arena_set_allocated_int64(::abacus::protobuf::Int64Metric* int64) { + clear_type(); + if (int64) { + set_has_int64(); + _impl_.type_.int64_ = int64; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.int64) } -inline const std::string& Float32Type::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.unit) - return _internal_unit(); +inline ::abacus::protobuf::Int64Metric* Metric::_internal_mutable_int64() { + if (type_case() != kInt64) { + clear_type(); + set_has_int64(); + _impl_.type_.int64_ = CreateMaybeMessage< ::abacus::protobuf::Int64Metric >(GetArenaForAllocation()); + } + return _impl_.type_.int64_; } -template -inline PROTOBUF_ALWAYS_INLINE void Float32Type::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:abacus.protobuf.Float32Type.unit) +inline ::abacus::protobuf::Int64Metric* Metric::mutable_int64() { + ::abacus::protobuf::Int64Metric* _msg = _internal_mutable_int64(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.int64) + return _msg; } -inline std::string* Float32Type::mutable_unit() { - std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Type.unit) - return _s; + +// .abacus.protobuf.UInt32Metric uint32 = 4; +inline bool Metric::has_uint32() const { + return type_case() == kUint32; } -inline const std::string& Float32Type::_internal_unit() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.unit_.Get(); +inline bool Metric::_internal_has_uint32() const { + return type_case() == kUint32; } -inline void Float32Type::_internal_set_unit(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.unit_.Set(value, GetArenaForAllocation()); +inline void Metric::set_has_uint32() { + _impl_._oneof_case_[0] = kUint32; } -inline std::string* Float32Type::_internal_mutable_unit() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.unit_.Mutable( GetArenaForAllocation()); +inline void Metric::clear_uint32() { + if (type_case() == kUint32) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.uint32_; + } + clear_has_type(); + } } -inline std::string* Float32Type::release_unit() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Type.unit) - return _impl_.unit_.Release(); +inline ::abacus::protobuf::UInt32Metric* Metric::release_uint32() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.uint32) + if (type_case() == kUint32) { + clear_has_type(); + ::abacus::protobuf::UInt32Metric* temp = _impl_.type_.uint32_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.uint32_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline void Float32Type::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:abacus.protobuf.Float32Type.unit) +inline const ::abacus::protobuf::UInt32Metric& Metric::_internal_uint32() const { + return type_case() == kUint32 + ? *_impl_.type_.uint32_ + : reinterpret_cast<::abacus::protobuf::UInt32Metric&>(::abacus::protobuf::_UInt32Metric_default_instance_); } - -// .abacus.protobuf.Kind kind = 2; -inline void Float32Type::clear_kind() { - _impl_.kind_ = 0; +inline const ::abacus::protobuf::UInt32Metric& Metric::uint32() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.uint32) + return _internal_uint32(); } -inline ::abacus::protobuf::Kind Float32Type::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.kind) - return _internal_kind(); +inline ::abacus::protobuf::UInt32Metric* Metric::unsafe_arena_release_uint32() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.uint32) + if (type_case() == kUint32) { + clear_has_type(); + ::abacus::protobuf::UInt32Metric* temp = _impl_.type_.uint32_; + _impl_.type_.uint32_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline void Float32Type::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Type.kind) +inline void Metric::unsafe_arena_set_allocated_uint32(::abacus::protobuf::UInt32Metric* uint32) { + clear_type(); + if (uint32) { + set_has_uint32(); + _impl_.type_.uint32_ = uint32; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.uint32) } -inline ::abacus::protobuf::Kind Float32Type::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline ::abacus::protobuf::UInt32Metric* Metric::_internal_mutable_uint32() { + if (type_case() != kUint32) { + clear_type(); + set_has_uint32(); + _impl_.type_.uint32_ = CreateMaybeMessage< ::abacus::protobuf::UInt32Metric >(GetArenaForAllocation()); + } + return _impl_.type_.uint32_; } -inline void Float32Type::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::UInt32Metric* Metric::mutable_uint32() { + ::abacus::protobuf::UInt32Metric* _msg = _internal_mutable_uint32(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.uint32) + return _msg; } -// float min = 3; -inline void Float32Type::clear_min() { - _impl_.min_ = 0; +// .abacus.protobuf.Int32Metric int32 = 5; +inline bool Metric::has_int32() const { + return type_case() == kInt32; } -inline float Float32Type::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.min) - return _internal_min(); +inline bool Metric::_internal_has_int32() const { + return type_case() == kInt32; } -inline void Float32Type::set_min(float value) { - _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Type.min) +inline void Metric::set_has_int32() { + _impl_._oneof_case_[0] = kInt32; } -inline float Float32Type::_internal_min() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.min_; +inline void Metric::clear_int32() { + if (type_case() == kInt32) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.int32_; + } + clear_has_type(); + } } -inline void Float32Type::_internal_set_min(float value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.min_ = value; +inline ::abacus::protobuf::Int32Metric* Metric::release_int32() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.int32) + if (type_case() == kInt32) { + clear_has_type(); + ::abacus::protobuf::Int32Metric* temp = _impl_.type_.int32_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.int32_ = nullptr; + return temp; + } else { + return nullptr; + } } - -// float max = 4; -inline void Float32Type::clear_max() { - _impl_.max_ = 0; +inline const ::abacus::protobuf::Int32Metric& Metric::_internal_int32() const { + return type_case() == kInt32 + ? *_impl_.type_.int32_ + : reinterpret_cast<::abacus::protobuf::Int32Metric&>(::abacus::protobuf::_Int32Metric_default_instance_); } -inline float Float32Type::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Type.max) - return _internal_max(); +inline const ::abacus::protobuf::Int32Metric& Metric::int32() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.int32) + return _internal_int32(); } -inline void Float32Type::set_max(float value) { - _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Type.max) +inline ::abacus::protobuf::Int32Metric* Metric::unsafe_arena_release_int32() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.int32) + if (type_case() == kInt32) { + clear_has_type(); + ::abacus::protobuf::Int32Metric* temp = _impl_.type_.int32_; + _impl_.type_.int32_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline float Float32Type::_internal_max() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.max_; +inline void Metric::unsafe_arena_set_allocated_int32(::abacus::protobuf::Int32Metric* int32) { + clear_type(); + if (int32) { + set_has_int32(); + _impl_.type_.int32_ = int32; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.int32) } -inline void Float32Type::_internal_set_max(float value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.max_ = value; +inline ::abacus::protobuf::Int32Metric* Metric::_internal_mutable_int32() { + if (type_case() != kInt32) { + clear_type(); + set_has_int32(); + _impl_.type_.int32_ = CreateMaybeMessage< ::abacus::protobuf::Int32Metric >(GetArenaForAllocation()); + } + return _impl_.type_.int32_; } - -// ------------------------------------------------------------------- - -// BoolType - -// string unit = 1; -inline void BoolType::clear_unit() { - _impl_.unit_.ClearToEmpty(); +inline ::abacus::protobuf::Int32Metric* Metric::mutable_int32() { + ::abacus::protobuf::Int32Metric* _msg = _internal_mutable_int32(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.int32) + return _msg; } -inline const std::string& BoolType::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolType.unit) - return _internal_unit(); + +// .abacus.protobuf.Float64Metric float64 = 6; +inline bool Metric::has_float64() const { + return type_case() == kFloat64; } -template -inline PROTOBUF_ALWAYS_INLINE void BoolType::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:abacus.protobuf.BoolType.unit) +inline bool Metric::_internal_has_float64() const { + return type_case() == kFloat64; } -inline std::string* BoolType::mutable_unit() { - std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolType.unit) - return _s; +inline void Metric::set_has_float64() { + _impl_._oneof_case_[0] = kFloat64; } -inline const std::string& BoolType::_internal_unit() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.unit_.Get(); +inline void Metric::clear_float64() { + if (type_case() == kFloat64) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float64_; + } + clear_has_type(); + } } -inline void BoolType::_internal_set_unit(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.unit_.Set(value, GetArenaForAllocation()); +inline ::abacus::protobuf::Float64Metric* Metric::release_float64() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.float64) + if (type_case() == kFloat64) { + clear_has_type(); + ::abacus::protobuf::Float64Metric* temp = _impl_.type_.float64_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.float64_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline std::string* BoolType::_internal_mutable_unit() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.unit_.Mutable( GetArenaForAllocation()); +inline const ::abacus::protobuf::Float64Metric& Metric::_internal_float64() const { + return type_case() == kFloat64 + ? *_impl_.type_.float64_ + : reinterpret_cast<::abacus::protobuf::Float64Metric&>(::abacus::protobuf::_Float64Metric_default_instance_); } -inline std::string* BoolType::release_unit() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.BoolType.unit) - return _impl_.unit_.Release(); +inline const ::abacus::protobuf::Float64Metric& Metric::float64() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.float64) + return _internal_float64(); } -inline void BoolType::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:abacus.protobuf.BoolType.unit) +inline ::abacus::protobuf::Float64Metric* Metric::unsafe_arena_release_float64() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.float64) + if (type_case() == kFloat64) { + clear_has_type(); + ::abacus::protobuf::Float64Metric* temp = _impl_.type_.float64_; + _impl_.type_.float64_ = nullptr; + return temp; + } else { + return nullptr; + } } - -// .abacus.protobuf.Kind kind = 2; -inline void BoolType::clear_kind() { - _impl_.kind_ = 0; +inline void Metric::unsafe_arena_set_allocated_float64(::abacus::protobuf::Float64Metric* float64) { + clear_type(); + if (float64) { + set_has_float64(); + _impl_.type_.float64_ = float64; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.float64) } -inline ::abacus::protobuf::Kind BoolType::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolType.kind) - return _internal_kind(); +inline ::abacus::protobuf::Float64Metric* Metric::_internal_mutable_float64() { + if (type_case() != kFloat64) { + clear_type(); + set_has_float64(); + _impl_.type_.float64_ = CreateMaybeMessage< ::abacus::protobuf::Float64Metric >(GetArenaForAllocation()); + } + return _impl_.type_.float64_; } -inline void BoolType::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.BoolType.kind) +inline ::abacus::protobuf::Float64Metric* Metric::mutable_float64() { + ::abacus::protobuf::Float64Metric* _msg = _internal_mutable_float64(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.float64) + return _msg; } -inline ::abacus::protobuf::Kind BoolType::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); + +// .abacus.protobuf.Float32Metric float32 = 7; +inline bool Metric::has_float32() const { + return type_case() == kFloat32; } -inline void BoolType::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline bool Metric::_internal_has_float32() const { + return type_case() == kFloat32; } - -// ------------------------------------------------------------------- - -// EnumInfo - -// string name = 1; -inline void EnumInfo::clear_name() { - _impl_.name_.ClearToEmpty(); +inline void Metric::set_has_float32() { + _impl_._oneof_case_[0] = kFloat32; } -inline const std::string& EnumInfo::name() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.EnumInfo.name) - return _internal_name(); +inline void Metric::clear_float32() { + if (type_case() == kFloat32) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.float32_; + } + clear_has_type(); + } } -template -inline PROTOBUF_ALWAYS_INLINE void EnumInfo::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:abacus.protobuf.EnumInfo.name) +inline ::abacus::protobuf::Float32Metric* Metric::release_float32() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.float32) + if (type_case() == kFloat32) { + clear_has_type(); + ::abacus::protobuf::Float32Metric* temp = _impl_.type_.float32_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.float32_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline std::string* EnumInfo::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumInfo.name) - return _s; +inline const ::abacus::protobuf::Float32Metric& Metric::_internal_float32() const { + return type_case() == kFloat32 + ? *_impl_.type_.float32_ + : reinterpret_cast<::abacus::protobuf::Float32Metric&>(::abacus::protobuf::_Float32Metric_default_instance_); } -inline const std::string& EnumInfo::_internal_name() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.name_.Get(); +inline const ::abacus::protobuf::Float32Metric& Metric::float32() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.float32) + return _internal_float32(); } -inline void EnumInfo::_internal_set_name(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.name_.Set(value, GetArenaForAllocation()); +inline ::abacus::protobuf::Float32Metric* Metric::unsafe_arena_release_float32() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.float32) + if (type_case() == kFloat32) { + clear_has_type(); + ::abacus::protobuf::Float32Metric* temp = _impl_.type_.float32_; + _impl_.type_.float32_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline std::string* EnumInfo::_internal_mutable_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.name_.Mutable( GetArenaForAllocation()); +inline void Metric::unsafe_arena_set_allocated_float32(::abacus::protobuf::Float32Metric* float32) { + clear_type(); + if (float32) { + set_has_float32(); + _impl_.type_.float32_ = float32; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.float32) } -inline std::string* EnumInfo::release_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.EnumInfo.name) - return _impl_.name_.Release(); +inline ::abacus::protobuf::Float32Metric* Metric::_internal_mutable_float32() { + if (type_case() != kFloat32) { + clear_type(); + set_has_float32(); + _impl_.type_.float32_ = CreateMaybeMessage< ::abacus::protobuf::Float32Metric >(GetArenaForAllocation()); + } + return _impl_.type_.float32_; } -inline void EnumInfo::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:abacus.protobuf.EnumInfo.name) +inline ::abacus::protobuf::Float32Metric* Metric::mutable_float32() { + ::abacus::protobuf::Float32Metric* _msg = _internal_mutable_float32(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.float32) + return _msg; } -// optional string description = 2; -inline bool EnumInfo::has_description() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline void EnumInfo::clear_description() { - _impl_.description_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; +// .abacus.protobuf.BoolMetric boolean = 8; +inline bool Metric::has_boolean() const { + return type_case() == kBoolean; } -inline const std::string& EnumInfo::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.EnumInfo.description) - return _internal_description(); +inline bool Metric::_internal_has_boolean() const { + return type_case() == kBoolean; } -template -inline PROTOBUF_ALWAYS_INLINE void EnumInfo::set_description(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.EnumInfo.description) +inline void Metric::set_has_boolean() { + _impl_._oneof_case_[0] = kBoolean; } -inline std::string* EnumInfo::mutable_description() { - std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumInfo.description) - return _s; +inline void Metric::clear_boolean() { + if (type_case() == kBoolean) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.boolean_; + } + clear_has_type(); + } } -inline const std::string& EnumInfo::_internal_description() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.description_.Get(); +inline ::abacus::protobuf::BoolMetric* Metric::release_boolean() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.boolean) + if (type_case() == kBoolean) { + clear_has_type(); + ::abacus::protobuf::BoolMetric* temp = _impl_.type_.boolean_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.boolean_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline void EnumInfo::_internal_set_description(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.description_.Set(value, GetArenaForAllocation()); +inline const ::abacus::protobuf::BoolMetric& Metric::_internal_boolean() const { + return type_case() == kBoolean + ? *_impl_.type_.boolean_ + : reinterpret_cast<::abacus::protobuf::BoolMetric&>(::abacus::protobuf::_BoolMetric_default_instance_); } -inline std::string* EnumInfo::_internal_mutable_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.description_.Mutable( GetArenaForAllocation()); +inline const ::abacus::protobuf::BoolMetric& Metric::boolean() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.boolean) + return _internal_boolean(); } -inline std::string* EnumInfo::release_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.EnumInfo.description) - if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { +inline ::abacus::protobuf::BoolMetric* Metric::unsafe_arena_release_boolean() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.boolean) + if (type_case() == kBoolean) { + clear_has_type(); + ::abacus::protobuf::BoolMetric* temp = _impl_.type_.boolean_; + _impl_.type_.boolean_ = nullptr; + return temp; + } else { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* released = _impl_.description_.Release(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.description_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return released; } -inline void EnumInfo::set_allocated_description(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; +inline void Metric::unsafe_arena_set_allocated_boolean(::abacus::protobuf::BoolMetric* boolean) { + clear_type(); + if (boolean) { + set_has_boolean(); + _impl_.type_.boolean_ = boolean; } - _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:abacus.protobuf.EnumInfo.description) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.boolean) } - -// optional uint32 severity = 3; -inline bool EnumInfo::has_severity() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; +inline ::abacus::protobuf::BoolMetric* Metric::_internal_mutable_boolean() { + if (type_case() != kBoolean) { + clear_type(); + set_has_boolean(); + _impl_.type_.boolean_ = CreateMaybeMessage< ::abacus::protobuf::BoolMetric >(GetArenaForAllocation()); + } + return _impl_.type_.boolean_; } -inline void EnumInfo::clear_severity() { - _impl_.severity_ = 0u; - _impl_._has_bits_[0] &= ~0x00000002u; +inline ::abacus::protobuf::BoolMetric* Metric::mutable_boolean() { + ::abacus::protobuf::BoolMetric* _msg = _internal_mutable_boolean(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.boolean) + return _msg; } -inline ::uint32_t EnumInfo::severity() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.EnumInfo.severity) - return _internal_severity(); + +// .abacus.protobuf.Enum8Metric enum8 = 9; +inline bool Metric::has_enum8() const { + return type_case() == kEnum8; } -inline void EnumInfo::set_severity(::uint32_t value) { - _internal_set_severity(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.EnumInfo.severity) +inline bool Metric::_internal_has_enum8() const { + return type_case() == kEnum8; } -inline ::uint32_t EnumInfo::_internal_severity() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.severity_; +inline void Metric::set_has_enum8() { + _impl_._oneof_case_[0] = kEnum8; } -inline void EnumInfo::_internal_set_severity(::uint32_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.severity_ = value; +inline void Metric::clear_enum8() { + if (type_case() == kEnum8) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.enum8_; + } + clear_has_type(); + } } - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// EnumType - -// map enum_map = 1; -inline int EnumType::_internal_enum_map_size() const { - return _internal_enum_map().size(); +inline ::abacus::protobuf::Enum8Metric* Metric::release_enum8() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.enum8) + if (type_case() == kEnum8) { + clear_has_type(); + ::abacus::protobuf::Enum8Metric* temp = _impl_.type_.enum8_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.enum8_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline int EnumType::enum_map_size() const { - return _internal_enum_map_size(); +inline const ::abacus::protobuf::Enum8Metric& Metric::_internal_enum8() const { + return type_case() == kEnum8 + ? *_impl_.type_.enum8_ + : reinterpret_cast<::abacus::protobuf::Enum8Metric&>(::abacus::protobuf::_Enum8Metric_default_instance_); } -inline void EnumType::clear_enum_map() { - _impl_.enum_map_.Clear(); +inline const ::abacus::protobuf::Enum8Metric& Metric::enum8() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.enum8) + return _internal_enum8(); } -inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& EnumType::_internal_enum_map() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.enum_map_.GetMap(); +inline ::abacus::protobuf::Enum8Metric* Metric::unsafe_arena_release_enum8() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.enum8) + if (type_case() == kEnum8) { + clear_has_type(); + ::abacus::protobuf::Enum8Metric* temp = _impl_.type_.enum8_; + _impl_.type_.enum8_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>& EnumType::enum_map() const { - // @@protoc_insertion_point(field_map:abacus.protobuf.EnumType.enum_map) - return _internal_enum_map(); +inline void Metric::unsafe_arena_set_allocated_enum8(::abacus::protobuf::Enum8Metric* enum8) { + clear_type(); + if (enum8) { + set_has_enum8(); + _impl_.type_.enum8_ = enum8; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.enum8) } -inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* EnumType::_internal_mutable_enum_map() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _impl_.enum_map_.MutableMap(); +inline ::abacus::protobuf::Enum8Metric* Metric::_internal_mutable_enum8() { + if (type_case() != kEnum8) { + clear_type(); + set_has_enum8(); + _impl_.type_.enum8_ = CreateMaybeMessage< ::abacus::protobuf::Enum8Metric >(GetArenaForAllocation()); + } + return _impl_.type_.enum8_; } -inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumInfo>* EnumType::mutable_enum_map() { - // @@protoc_insertion_point(field_mutable_map:abacus.protobuf.EnumType.enum_map) - return _internal_mutable_enum_map(); +inline ::abacus::protobuf::Enum8Metric* Metric::mutable_enum8() { + ::abacus::protobuf::Enum8Metric* _msg = _internal_mutable_enum8(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.enum8) + return _msg; } +inline bool Metric::has_type() const { + return type_case() != TYPE_NOT_SET; +} +inline void Metric::clear_has_type() { + _impl_._oneof_case_[0] = TYPE_NOT_SET; +} +inline Metric::TypeCase Metric::type_case() const { + return Metric::TypeCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // ------------------------------------------------------------------- @@ -4833,393 +5066,6 @@ inline ::google::protobuf::Map* Metrics return _internal_mutable_metrics(); } -// ------------------------------------------------------------------- - -// MetricValue - -// bool valid = 1; -inline void MetricValue::clear_valid() { - _impl_.valid_ = false; -} -inline bool MetricValue::valid() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.valid) - return _internal_valid(); -} -inline void MetricValue::set_valid(bool value) { - _internal_set_valid(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.valid) -} -inline bool MetricValue::_internal_valid() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.valid_; -} -inline void MetricValue::_internal_set_valid(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.valid_ = value; -} - -// uint64 uint64_value = 2; -inline bool MetricValue::has_uint64_value() const { - return value_case() == kUint64Value; -} -inline void MetricValue::set_has_uint64_value() { - _impl_._oneof_case_[0] = kUint64Value; -} -inline void MetricValue::clear_uint64_value() { - if (value_case() == kUint64Value) { - _impl_.value_.uint64_value_ = ::uint64_t{0u}; - clear_has_value(); - } -} -inline ::uint64_t MetricValue::uint64_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.uint64_value) - return _internal_uint64_value(); -} -inline void MetricValue::set_uint64_value(::uint64_t value) { - _internal_set_uint64_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.uint64_value) -} -inline ::uint64_t MetricValue::_internal_uint64_value() const { - if (value_case() == kUint64Value) { - return _impl_.value_.uint64_value_; - } - return ::uint64_t{0u}; -} -inline void MetricValue::_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 MetricValue::has_int64_value() const { - return value_case() == kInt64Value; -} -inline void MetricValue::set_has_int64_value() { - _impl_._oneof_case_[0] = kInt64Value; -} -inline void MetricValue::clear_int64_value() { - if (value_case() == kInt64Value) { - _impl_.value_.int64_value_ = ::int64_t{0}; - clear_has_value(); - } -} -inline ::int64_t MetricValue::int64_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.int64_value) - return _internal_int64_value(); -} -inline void MetricValue::set_int64_value(::int64_t value) { - _internal_set_int64_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.int64_value) -} -inline ::int64_t MetricValue::_internal_int64_value() const { - if (value_case() == kInt64Value) { - return _impl_.value_.int64_value_; - } - return ::int64_t{0}; -} -inline void MetricValue::_internal_set_int64_value(::int64_t value) { - if (value_case() != kInt64Value) { - clear_value(); - set_has_int64_value(); - } - _impl_.value_.int64_value_ = value; -} - -// uint32 uint32_value = 4; -inline bool MetricValue::has_uint32_value() const { - return value_case() == kUint32Value; -} -inline void MetricValue::set_has_uint32_value() { - _impl_._oneof_case_[0] = kUint32Value; -} -inline void MetricValue::clear_uint32_value() { - if (value_case() == kUint32Value) { - _impl_.value_.uint32_value_ = 0u; - clear_has_value(); - } -} -inline ::uint32_t MetricValue::uint32_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.uint32_value) - return _internal_uint32_value(); -} -inline void MetricValue::set_uint32_value(::uint32_t value) { - _internal_set_uint32_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.uint32_value) -} -inline ::uint32_t MetricValue::_internal_uint32_value() const { - if (value_case() == kUint32Value) { - return _impl_.value_.uint32_value_; - } - return 0u; -} -inline void MetricValue::_internal_set_uint32_value(::uint32_t value) { - if (value_case() != kUint32Value) { - clear_value(); - set_has_uint32_value(); - } - _impl_.value_.uint32_value_ = value; -} - -// int32 int32_value = 5; -inline bool MetricValue::has_int32_value() const { - return value_case() == kInt32Value; -} -inline void MetricValue::set_has_int32_value() { - _impl_._oneof_case_[0] = kInt32Value; -} -inline void MetricValue::clear_int32_value() { - if (value_case() == kInt32Value) { - _impl_.value_.int32_value_ = 0; - clear_has_value(); - } -} -inline ::int32_t MetricValue::int32_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.int32_value) - return _internal_int32_value(); -} -inline void MetricValue::set_int32_value(::int32_t value) { - _internal_set_int32_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.int32_value) -} -inline ::int32_t MetricValue::_internal_int32_value() const { - if (value_case() == kInt32Value) { - return _impl_.value_.int32_value_; - } - return 0; -} -inline void MetricValue::_internal_set_int32_value(::int32_t value) { - if (value_case() != kInt32Value) { - clear_value(); - set_has_int32_value(); - } - _impl_.value_.int32_value_ = value; -} - -// float float32_value = 6; -inline bool MetricValue::has_float32_value() const { - return value_case() == kFloat32Value; -} -inline void MetricValue::set_has_float32_value() { - _impl_._oneof_case_[0] = kFloat32Value; -} -inline void MetricValue::clear_float32_value() { - if (value_case() == kFloat32Value) { - _impl_.value_.float32_value_ = 0; - clear_has_value(); - } -} -inline float MetricValue::float32_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.float32_value) - return _internal_float32_value(); -} -inline void MetricValue::set_float32_value(float value) { - _internal_set_float32_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.float32_value) -} -inline float MetricValue::_internal_float32_value() const { - if (value_case() == kFloat32Value) { - return _impl_.value_.float32_value_; - } - return 0; -} -inline void MetricValue::_internal_set_float32_value(float value) { - if (value_case() != kFloat32Value) { - clear_value(); - set_has_float32_value(); - } - _impl_.value_.float32_value_ = value; -} - -// double float64_value = 7; -inline bool MetricValue::has_float64_value() const { - return value_case() == kFloat64Value; -} -inline void MetricValue::set_has_float64_value() { - _impl_._oneof_case_[0] = kFloat64Value; -} -inline void MetricValue::clear_float64_value() { - if (value_case() == kFloat64Value) { - _impl_.value_.float64_value_ = 0; - clear_has_value(); - } -} -inline double MetricValue::float64_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.float64_value) - return _internal_float64_value(); -} -inline void MetricValue::set_float64_value(double value) { - _internal_set_float64_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.float64_value) -} -inline double MetricValue::_internal_float64_value() const { - if (value_case() == kFloat64Value) { - return _impl_.value_.float64_value_; - } - return 0; -} -inline void MetricValue::_internal_set_float64_value(double value) { - if (value_case() != kFloat64Value) { - clear_value(); - set_has_float64_value(); - } - _impl_.value_.float64_value_ = value; -} - -// bool bool_value = 8; -inline bool MetricValue::has_bool_value() const { - return value_case() == kBoolValue; -} -inline void MetricValue::set_has_bool_value() { - _impl_._oneof_case_[0] = kBoolValue; -} -inline void MetricValue::clear_bool_value() { - if (value_case() == kBoolValue) { - _impl_.value_.bool_value_ = false; - clear_has_value(); - } -} -inline bool MetricValue::bool_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.bool_value) - return _internal_bool_value(); -} -inline void MetricValue::set_bool_value(bool value) { - _internal_set_bool_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.bool_value) -} -inline bool MetricValue::_internal_bool_value() const { - if (value_case() == kBoolValue) { - return _impl_.value_.bool_value_; - } - return false; -} -inline void MetricValue::_internal_set_bool_value(bool value) { - if (value_case() != kBoolValue) { - clear_value(); - set_has_bool_value(); - } - _impl_.value_.bool_value_ = value; -} - -// uint32 enum_value = 9; -inline bool MetricValue::has_enum_value() const { - return value_case() == kEnumValue; -} -inline void MetricValue::set_has_enum_value() { - _impl_._oneof_case_[0] = kEnumValue; -} -inline void MetricValue::clear_enum_value() { - if (value_case() == kEnumValue) { - _impl_.value_.enum_value_ = 0u; - clear_has_value(); - } -} -inline ::uint32_t MetricValue::enum_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValue.enum_value) - return _internal_enum_value(); -} -inline void MetricValue::set_enum_value(::uint32_t value) { - _internal_set_enum_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValue.enum_value) -} -inline ::uint32_t MetricValue::_internal_enum_value() const { - if (value_case() == kEnumValue) { - return _impl_.value_.enum_value_; - } - return 0u; -} -inline void MetricValue::_internal_set_enum_value(::uint32_t value) { - if (value_case() != kEnumValue) { - clear_value(); - set_has_enum_value(); - } - _impl_.value_.enum_value_ = value; -} - -inline bool MetricValue::has_value() const { - return value_case() != VALUE_NOT_SET; -} -inline void MetricValue::clear_has_value() { - _impl_._oneof_case_[0] = VALUE_NOT_SET; -} -inline MetricValue::ValueCase MetricValue::value_case() const { - return MetricValue::ValueCase(_impl_._oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// MetricValues - -// uint32 sync_value = 1; -inline void MetricValues::clear_sync_value() { - _impl_.sync_value_ = 0u; -} -inline ::uint32_t MetricValues::sync_value() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValues.sync_value) - return _internal_sync_value(); -} -inline void MetricValues::set_sync_value(::uint32_t value) { - _internal_set_sync_value(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.MetricValues.sync_value) -} -inline ::uint32_t MetricValues::_internal_sync_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.sync_value_; -} -inline void MetricValues::_internal_set_sync_value(::uint32_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.sync_value_ = value; -} - -// repeated .abacus.protobuf.MetricValue values = 2; -inline int MetricValues::_internal_values_size() const { - return _internal_values().size(); -} -inline int MetricValues::values_size() const { - return _internal_values_size(); -} -inline void MetricValues::clear_values() { - _internal_mutable_values()->Clear(); -} -inline ::abacus::protobuf::MetricValue* MetricValues::mutable_values(int index) { - // @@protoc_insertion_point(field_mutable:abacus.protobuf.MetricValues.values) - return _internal_mutable_values()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >* -MetricValues::mutable_values() { - // @@protoc_insertion_point(field_mutable_list:abacus.protobuf.MetricValues.values) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_values(); -} -inline const ::abacus::protobuf::MetricValue& MetricValues::values(int index) const { - // @@protoc_insertion_point(field_get:abacus.protobuf.MetricValues.values) - return _internal_values().Get(index); -} -inline ::abacus::protobuf::MetricValue* MetricValues::add_values() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::abacus::protobuf::MetricValue* _add = _internal_mutable_values()->Add(); - // @@protoc_insertion_point(field_add:abacus.protobuf.MetricValues.values) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField< ::abacus::protobuf::MetricValue >& -MetricValues::values() const { - // @@protoc_insertion_point(field_list:abacus.protobuf.MetricValues.values) - return _internal_values(); -} -inline const ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>& -MetricValues::_internal_values() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.values_; -} -inline ::google::protobuf::RepeatedPtrField<::abacus::protobuf::MetricValue>* -MetricValues::_internal_mutable_values() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.values_; -} - #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/test/src/test_metrics2.cpp b/test/src/test_metrics2.cpp index cf4617c1..b2727b0d 100644 --- a/test/src/test_metrics2.cpp +++ b/test/src/test_metrics2.cpp @@ -7,4 +7,4 @@ #include #include -// #include +#include From 552cea5338418e4498a7ca19311d444ec57687ab Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 23 Dec 2024 14:43:11 +0100 Subject: [PATCH 03/68] working on it --- src/abacus/detail/hash_function.hpp | 34 +++ src/abacus/get_value.hpp | 71 ++++++ src/abacus/metric_info2.hpp | 98 -------- src/abacus/metrics2.hpp | 309 +++++++++++++++--------- src/abacus/type2.hpp | 362 ++++++++++++++++++++++++++++ src/abacus/view2.hpp | 92 +++++++ test/src/test_metric.cpp | 68 +++--- test/src/test_metrics2.cpp | 45 ++++ test/src/test_type2.cpp | 101 ++++++++ 9 files changed, 940 insertions(+), 240 deletions(-) create mode 100644 src/abacus/detail/hash_function.hpp create mode 100644 src/abacus/get_value.hpp delete mode 100644 src/abacus/metric_info2.hpp create mode 100644 src/abacus/type2.hpp create mode 100644 src/abacus/view2.hpp create mode 100644 test/src/test_type2.cpp diff --git a/src/abacus/detail/hash_function.hpp b/src/abacus/detail/hash_function.hpp new file mode 100644 index 00000000..79afeffc --- /dev/null +++ b/src/abacus/detail/hash_function.hpp @@ -0,0 +1,34 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include + +#include "../version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +namespace detail +{ +/// Converts a string to a 32-bit FNV-1a hash used for identifying actions +constexpr auto hash_function(const uint8_t* data, std::size_t bytes) -> uint32_t +{ + uint32_t hash = 0x811c9dc5; // FNV-1a 32-bit offset basis + constexpr uint32_t prime = 0x01000193; // FNV-1a 32-bit prime + + for (std::size_t i = 0; i < bytes; ++i) + { + hash ^= static_cast(data[i]); + hash *= prime; + } + + return hash; +} +} +} +} diff --git a/src/abacus/get_value.hpp b/src/abacus/get_value.hpp new file mode 100644 index 00000000..4c9256d0 --- /dev/null +++ b/src/abacus/get_value.hpp @@ -0,0 +1,71 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include +#include + +#include "detail/hash_function.hpp" +#include "metric.hpp" +#include "metric_info2.hpp" +#include "protocol_version.hpp" +#include "type.hpp" +#include "version.hpp" + +#include "protobuf/metrics.pb.h" + +#include +#include +#include + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +template +static inline auto get_value(const uint8_t* data, const std::string& name) + -> std::optional +{ +} + +template +static inline auto +get_value(const protobuf::MetricsMetadata& meta, const uint8_t* value_data, + const std::string& name) -> std::optional +{ + auto endian = meta.endianness(); + uint32_t sync_bytes; + if (endian == protobuf::Endianness::BIG) + { + sync_bytes = endian::big_endian::get(value_data); + } + else + { + sync_bytes = endian::little_endian::get(value_data); + } + + // Check the sync bytes + if (meta.sync() != sync_bytes) + { + return std::nullopt; + } + + const protobuf::Metric& proto_metric = meta.metrics().at(name); + auto offset = proto_metric.offset(); + + typename T::metric m(value_data + offset); + if (!m.has_value()) + { + return std::nullopt; + } + return m.value(); +} +} +} diff --git a/src/abacus/metric_info2.hpp b/src/abacus/metric_info2.hpp deleted file mode 100644 index 4d644854..00000000 --- a/src/abacus/metric_info2.hpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include -#include - -#include "kind.hpp" -#include "unit.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -struct uint64 -{ - using type = uint64_t; - std::string description; - abacus::kind kind; - std::string unit; - std::optional min; - std::optional max; -}; -struct int64 -{ - using type = int64_t; - std::string description; - abacus::kind kind; - std::string unit; - std::optional min; - std::optional max; -}; -struct uint32 -{ - using type = uint32_t; - std::string description; - abacus::kind kind; - std::string unit; - std::optional min; - std::optional max; -}; -struct int32 -{ - using type = int32_t; - std::string description; - abacus::kind kind; - std::string unit; - std::optional min; - std::optional max; -}; -struct float64 -{ - using type = double; - std::string description; - abacus::kind kind; - std::string unit; - std::optional min; - std::optional max; -}; -struct float32 -{ - using type = float; - std::string description; - abacus::kind kind; - std::string unit; - std::optional min; - std::optional max; -}; -struct boolean -{ - using type = bool; - std::string description; - abacus::kind kind; -}; - -struct enum8 -{ - using type = uint8_t; - struct value - { - std::string name; - std::string description; - }; - std::string description; - std::string unit; - std::map values; -}; -using metric_info2 = - std::map>; -} -} diff --git a/src/abacus/metrics2.hpp b/src/abacus/metrics2.hpp index 102f47c7..d5427d9a 100644 --- a/src/abacus/metrics2.hpp +++ b/src/abacus/metrics2.hpp @@ -11,11 +11,9 @@ #include #include -#include "detail/value_size_info.hpp" -#include "metric.hpp" -#include "metric_info2.hpp" +#include "detail/hash_function.hpp" #include "protocol_version.hpp" -#include "type.hpp" +#include "type2.hpp" #include "version.hpp" #include "protobuf/metrics.pb.h" @@ -45,154 +43,171 @@ static inline auto to_protobuf_kind(abacus::kind kind) -> protobuf::Kind } } +static inline auto +get_kind(const protobuf::Metric& metric) -> std::optional +{ + switch (metric.type_case()) + { + case protobuf::Metric::kUint64: + return metric.uint64().kind(); + case protobuf::Metric::kInt64: + return metric.int64().kind(); + case protobuf::Metric::kUint32: + return metric.uint32().kind(); + case protobuf::Metric::kInt32: + return metric.int32().kind(); + case protobuf::Metric::kFloat64: + return metric.float64().kind(); + case protobuf::Metric::kFloat32: + return metric.float32().kind(); + case protobuf::Metric::kBoolean: + return metric.boolean().kind(); + case protobuf::Metric::kEnum8: + default: + return std::nullopt; + } +} + /// This class is used for creating descriptive counters that are contiguous in /// memory, to allow for fast access and arithmetic operations. class metrics2 { - public: /// Default constructor /// No metrics will be contained within this object. - metrics2(); + metrics2() = default; /// Constructor /// @param info The info of the metrics in a pointer. /// @param count The number of infos. - metrics2(const metric_info2& infos) + metrics2(const std::map& infos) { m_metadata = protobuf::MetricsMetadata(); m_metadata.set_protocol_version(protocol_version()); m_metadata.set_endianness(endian::is_big_endian() ? protobuf::Endianness::BIG : protobuf::Endianness::LITTLE); - std::size_t offset = 0; + + // The first byte is reserved for the sync value + std::size_t m_value_bytes = sizeof(uint32_t); for (auto [name, value] : infos) { - // metric_info2 is a variant type, so we need to use a visitor to - // extract the correct type - protobuf::Metric metric; - metric.set_offset(offset); - offset += sizeof(size_of_type()); - if (std::holds_alternative(value)) + metric.set_offset(m_value_bytes); + // The offset is incremented by the size of the type plus one byte + // which represents whether the metric is set or not. + m_value_bytes += 1 + sizeof(size_of_type()); + if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_uint64()->set_description(m.description); - metric.mutable_uint64()->set_kind(to_protobuf_kind(m.kind)); - if (!m.unit.empty()) + metric.mutable_uint64()->set_description(m->description); + metric.mutable_uint64()->set_kind(to_protobuf_kind(m->kind)); + if (!m->unit.empty()) { - metric.mutable_uint64()->set_unit(m.unit); + metric.mutable_uint64()->set_unit(m->unit); } - if (m.min.has_value()) + if (m->min.has_value()) { - metric.mutable_uint64()->set_min(m.min.value()); + metric.mutable_uint64()->set_min(m->min.value()); } - if (m.max.has_value()) + if (m->max.has_value()) { - metric.mutable_uint64()->set_max(m.max.value()); + metric.mutable_uint64()->set_max(m->max.value()); } } - else if (std::holds_alternative(value)) + else if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_int64()->set_description(m.description); - metric.mutable_int64()->set_kind(to_protobuf_kind(m.kind)); - if (!m.unit.empty()) + metric.mutable_int64()->set_description(m->description); + metric.mutable_int64()->set_kind(to_protobuf_kind(m->kind)); + if (!m->unit.empty()) { - metric.mutable_int64()->set_unit(m.unit); + metric.mutable_int64()->set_unit(m->unit); } - if (m.min.has_value()) + if (m->min.has_value()) { - metric.mutable_int64()->set_min(m.min.value()); + metric.mutable_int64()->set_min(m->min.value()); } - if (m.max.has_value()) + if (m->max.has_value()) { - metric.mutable_int64()->set_max(m.max.value()); + metric.mutable_int64()->set_max(m->max.value()); } } - else if (std::holds_alternative(value)) + else if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_uint32()->set_description(m.description); - metric.mutable_uint32()->set_kind(to_protobuf_kind(m.kind)); - if (!m.unit.empty()) + metric.mutable_uint32()->set_description(m->description); + metric.mutable_uint32()->set_kind(to_protobuf_kind(m->kind)); + if (!m->unit.empty()) { - metric.mutable_uint32()->set_unit(m.unit); + metric.mutable_uint32()->set_unit(m->unit); } - if (m.min.has_value()) + if (m->min.has_value()) { - metric.mutable_uint32()->set_min(m.min.value()); + metric.mutable_uint32()->set_min(m->min.value()); } - if (m.max.has_value()) + if (m->max.has_value()) { - metric.mutable_uint32()->set_max(m.max.value()); + metric.mutable_uint32()->set_max(m->max.value()); } } - else if (std::holds_alternative(value)) + else if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_int32()->set_description(m.description); - metric.mutable_int32()->set_kind(to_protobuf_kind(m.kind)); - if (!m.unit.empty()) + metric.mutable_int32()->set_description(m->description); + metric.mutable_int32()->set_kind(to_protobuf_kind(m->kind)); + if (!m->unit.empty()) { - metric.mutable_int32()->set_unit(m.unit); + metric.mutable_int32()->set_unit(m->unit); } - if (m.min.has_value()) + if (m->min.has_value()) { - metric.mutable_int32()->set_min(m.min.value()); + metric.mutable_int32()->set_min(m->min.value()); } - if (m.max.has_value()) + if (m->max.has_value()) { - metric.mutable_int32()->set_max(m.max.value()); + metric.mutable_int32()->set_max(m->max.value()); } } - else if (std::holds_alternative(value)) + else if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_float64()->set_description(m.description); - metric.mutable_float64()->set_kind(to_protobuf_kind(m.kind)); - if (!m.unit.empty()) + metric.mutable_float64()->set_description(m->description); + metric.mutable_float64()->set_kind(to_protobuf_kind(m->kind)); + if (!m->unit.empty()) { - metric.mutable_float64()->set_unit(m.unit); + metric.mutable_float64()->set_unit(m->unit); } - if (m.min.has_value()) + if (m->min.has_value()) { - metric.mutable_float64()->set_min(m.min.value()); + metric.mutable_float64()->set_min(m->min.value()); } - if (m.max.has_value()) + if (m->max.has_value()) { - metric.mutable_float64()->set_max(m.max.value()); + metric.mutable_float64()->set_max(m->max.value()); } } - else if (std::holds_alternative(value)) + else if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_float32()->set_description(m.description); - metric.mutable_float32()->set_kind(to_protobuf_kind(m.kind)); - if (!m.unit.empty()) + metric.mutable_float32()->set_description(m->description); + metric.mutable_float32()->set_kind(to_protobuf_kind(m->kind)); + if (!m->unit.empty()) { - metric.mutable_float32()->set_unit(m.unit); + metric.mutable_float32()->set_unit(m->unit); } - if (m.min.has_value()) + if (m->min.has_value()) { - metric.mutable_float32()->set_min(m.min.value()); + metric.mutable_float32()->set_min(m->min.value()); } - if (m.max.has_value()) + if (m->max.has_value()) { - metric.mutable_float32()->set_max(m.max.value()); + metric.mutable_float32()->set_max(m->max.value()); } } - else if (std::holds_alternative(value)) + else if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_boolean()->set_description(m.description); - metric.mutable_boolean()->set_kind(to_protobuf_kind(m.kind)); + metric.mutable_boolean()->set_description(m->description); + metric.mutable_boolean()->set_kind(to_protobuf_kind(m->kind)); } - else if (std::holds_alternative(value)) + else if (auto* m = std::get_if(&value)) { - auto m = std::get(value); - metric.mutable_enum8()->set_description(m.description); - for (auto [key, value] : m.values) + metric.mutable_enum8()->set_description(m->description); + for (auto [key, value] : m->values) { auto enum_value = protobuf::EnumValue(); @@ -208,52 +223,123 @@ class metrics2 } m_metadata.mutable_metrics()->insert({name, metric}); + m_initialized[name] = false; } - // @ - int hash = std::hash{}(m_metadata.SerializeAsString()); - m_metadata.set_sync_value(hash); + m_meta_bytes = m_metadata.ByteSizeLong(); + m_data = new uint8_t[m_meta_bytes + m_value_bytes]; + + // Serialize the metadata + m_metadata.SerializeToArray(m_data, m_meta_bytes); + + // Calculate the hash of the metadata + m_hash = detail::hash_function(m_data, m_meta_bytes); + + // Update the sync value + m_metadata.set_sync_value(m_hash); + + // Serialize the metadata again to include the sync value + m_metadata.SerializeToArray(m_data, m_meta_bytes); + + // Write the sync value to the first byte of the value data (this will + // be written as the endianess of the system) + // Consuming code can use the endianness field in the metadata to + // read the sync value + *reinterpret_cast(m_data + m_meta_bytes) = m_hash; } /// Destructor - ~metrics2(); + ~metrics2() + { + if (m_data != nullptr) + delete[] m_data; + } /// @return the pointer to the value data of the metrics. - auto value_data() const -> const uint8_t*; + auto value_data() const -> const uint8_t* + { + return m_data + m_meta_bytes; + } /// @return the size of the value data of the metrics. - auto value_bytes() const -> std::size_t; + auto value_bytes() const -> std::size_t + { + return m_value_bytes; + } + + auto meta_data() const -> const uint8_t* + { + return m_data; + } - /// @return the meta data of the metrics. - auto metadata() const -> const protobuf::MetricsMetadata&; + auto meta_bytes() const -> std::size_t + { + return m_meta_bytes; + } - template - auto initialize_metric(const std::string& name) const -> metric + template + auto initialize_metric(const std::string& name, + std::optional value = + std::nullopt) -> typename Metric::metric { - using value_type = typename metric::value_type; - auto offset = m_metadata.metrics().at(name).offset(); + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + auto kind = get_kind(proto_metric); + if (kind.has_value()) + { + assert(kind.value() != protobuf::Kind::CONSTANT); + } + + auto offset = proto_metric.offset(); + + if (value.has_value()) + { + return typename Metric::metric(m_data + m_meta_bytes + offset, + value.value()); + } + else + { + return typename Metric::metric(m_data + m_meta_bytes + offset); + } + } - value_type* value_ptr = (value_type*)initialize(offset); + template + void initialize_constant(const std::string& name, + typename Metric::type value) + { + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; - return metric{value_ptr}; + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + auto offset = proto_metric.offset(); + auto kind = get_kind(proto_metric); + assert(kind.has_value() && kind.value() != protobuf::Kind::CONSTANT); + typename Metric::metric(m_data + m_meta_bytes + offset, value); } - template - void - initialize_constant(const std::string& name, - typename metric::value_type value) const + /// @return the number of metrics + auto count() const -> std::size_t { - using value_type = typename metric::value_type; - auto offset = m_metadata.metrics().at(name).offset(); - *static_cast(initialize(offset)) = value; + return m_metadata.metrics().size(); } - void reset_metrics(); - void reset_metric(const std::string& name); + /// @return true if all metrics have been initialized + auto is_initialized() const -> bool + { + for (auto [name, initialized] : m_initialized) + { + if (!initialized) + { + return false; + } + } + return true; + } private: - auto initialize(std::size_t offset) const -> void*; - /// No copy metrics2(metrics2&) = delete; @@ -261,11 +347,18 @@ class metrics2 metrics2& operator=(metrics2&) = delete; private: + /// The raw memory for the metadata and value data + uint8_t* m_data = nullptr; + /// The info of the metrics separated by byte-sizes protobuf::MetricsMetadata m_metadata; - /// The raw memory for the value data - uint8_t* m_value_data = nullptr; + uint32_t m_hash; + + std::size_t m_meta_bytes; + std::size_t m_value_bytes; + + std::map m_initialized; }; } } diff --git a/src/abacus/type2.hpp b/src/abacus/type2.hpp new file mode 100644 index 00000000..d7bc2df1 --- /dev/null +++ b/src/abacus/type2.hpp @@ -0,0 +1,362 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "kind.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +namespace +{ +template +struct common +{ + using type = typename T::type; + using metric = typename T::metric; + /// Default constructor + common() = default; + + common(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(type) + 1); + } + + common(uint8_t* memory, type value) : m_memory(memory) + { + assert(m_memory != nullptr); + set_value(value); + } + + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + + auto value() const -> type + { + assert(is_initialized()); + assert(has_value()); + type value; + std::memcpy(&value, m_memory + 1, sizeof(value)); + return value; + } + + auto set_value(type value) -> void + { + assert(is_initialized()); + m_memory[0] = 1; + std::memcpy(m_memory + 1, &value, sizeof(value)); + } + + /// Assign the counter a new value + /// @param value The value to assign + /// @return a counter with the new value + auto operator=(type value) -> metric& + { + assert(is_initialized()); + set_value(value); + return (metric&)*this; + } + + /// Increment the counter + /// @param value The value to add + /// @return The result of the arithmetic + auto operator+=(type value) -> metric& + { + assert(has_value()); + auto new_value = this->value() + value; + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + + /// Decrement the counter + /// @param value The value to subtract + /// @return The result of the arithmetic + auto operator-=(type value) -> metric& + { + assert(has_value()); + auto new_value = this->value() - value; + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + + /// Increment the value of the counter + /// @return The result of the arithmetic + auto operator++() -> metric& + { + assert(has_value()); + auto new_value = value() + 1; + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + + /// Decrement the value of the counter + /// @return The result of the arithmetic + auto operator--() -> metric& + { + auto new_value = value() - 1; + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; +} + +struct uint64 +{ + using type = uint64_t; + struct metric : public common + { + using common::common; + using common::operator=; + }; + + abacus::kind kind; + std::string description; + std::string unit; + std::optional min; + std::optional max; +}; +struct int64 +{ + using type = int64_t; + struct metric : public common + { + using common::common; + using common::operator=; + }; + abacus::kind kind; + std::string description; + std::string unit; + std::optional min; + std::optional max; +}; +struct uint32 +{ + using type = uint32_t; + struct metric : public common + { + using common::common; + using common::operator=; + }; + abacus::kind kind; + std::string description; + std::string unit; + std::optional min; + std::optional max; +}; +struct int32 +{ + using type = int32_t; + struct metric : public common + { + using common::common; + using common::operator=; + }; + abacus::kind kind; + std::string description; + std::string unit; + std::optional min; + std::optional max; +}; +struct float64 +{ + using type = double; + struct metric : public common + { + using common::common; + using common::operator=; + }; + abacus::kind kind; + std::string description; + std::string unit; + std::optional min; + std::optional max; +}; +struct float32 +{ + using type = float; + struct metric : public common + { + using common::common; + using common::operator=; + }; + abacus::kind kind; + std::string description; + std::string unit; + std::optional min; + std::optional max; +}; +struct boolean +{ + using type = bool; + struct metric + { + metric() = default; + + metric(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(type) + 1); + } + + metric(uint8_t* memory, type value) : m_memory(memory) + { + assert(m_memory != nullptr); + set_value(value); + } + + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + + auto value() const -> type + { + assert(is_initialized()); + return m_memory[1]; + } + + auto set_value(type value) -> void + { + assert(is_initialized()); + m_memory[0] = 1; + m_memory[1] = value; + } + + /// Assign the counter a new value + /// @param value The value to assign + /// @return a counter with the new value + auto operator=(type value) -> metric& + { + assert(is_initialized()); + set_value(value); + return *this; + } + + private: + /// The metric memory + uint8_t* m_memory = nullptr; + }; + abacus::kind kind; + std::string description; +}; + +struct enum8 +{ + using type = uint8_t; + struct metric + { + metric() = default; + + metric(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(type) + 1); + } + + metric(uint8_t* memory, type value) : m_memory(memory) + { + assert(m_memory != nullptr); + set_value(value); + } + + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + + auto value() const -> type + { + assert(is_initialized()); + return m_memory[1]; + } + + auto set_value(type value) -> void + { + assert(is_initialized()); + m_memory[0] = 1; + m_memory[1] = value; + } + + /// Assign the counter a new value + /// @param value The value to assign + /// @return a counter with the new value + auto operator=(type value) -> metric& + { + assert(is_initialized()); + set_value(value); + return *this; + } + + private: + /// The metric memory + uint8_t* m_memory = nullptr; + }; + + struct value + { + std::string name; + std::string description; + }; + std::string description; + std::map values; + std::string unit; +}; +using type2 = std::variant; +} +} diff --git a/src/abacus/view2.hpp b/src/abacus/view2.hpp new file mode 100644 index 00000000..7d98c5df --- /dev/null +++ b/src/abacus/view2.hpp @@ -0,0 +1,92 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "protobuf/metrics.pb.h" +#include "type.hpp" +#include "type2.hpp" +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// This class contains utility functions used to read a metrics data +/// buffer. +/// +/// It's main use-case is for when the data of a metrics object is +/// copied to a data buffer. abacus::view can then be used to extract the +/// information from the metrics-data. +/// +/// The class cannot manipulate the memory, only access the +/// pointed to values +/// +/// Note that this class has no constructor, so it can only be declared and +/// then view.set_meta_data() can be called to initialize the view with the +/// meta data, subsequently view.set_value_data() can be called to populate +/// the view with the value data. To update the view with new value data +/// view.set_value_data() can be called again. +class view2 +{ + +public: + /// Sets the meta data pointer + /// @param meta_data The meta data pointer + void set_meta_data(const uint8_t* meta_data); + + /// Sets the value data pointer + /// @param value_data The value data pointer + void set_value_data(const uint8_t* value_data); + + /// Gets the meta data pointer + /// @return The meta data pointer + const uint8_t* meta_data() const; + + /// Gets the value data pointer + /// @return The value data pointer + const uint8_t* value_data() const; + + /// Gets the meta data size in bytes + /// @return The meta data size in bytes + std::size_t meta_bytes() const; + + /// Gets the value data size in bytes + /// @return The value data size in bytes + std::size_t value_bytes() const; + + /// @return the number of metrics from in a metrics data pointer + auto count() const -> uint16_t; + + /// Gets the protocol version of the metrics + /// @return The protocol version of the metrics + auto protocol_version() const -> uint8_t; + + auto names() const -> std::vector; + + auto type() const -> std::optional; + + template + auto + value(const std::string& name) const -> std::optional; + + const protobuf::Metric& metric_info(const std::string& name) const; + +private: + /// The meta data pointer + const uint8_t* m_meta_data; + + /// The value data pointer + const uint8_t* m_value_data; +}; +} +} diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index 4fb7ef05..e3b361a5 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -30,40 +30,40 @@ TEST(test_metric, constructor) EXPECT_TRUE(bool_metric.is_initialized()); } -TEST(test_metric, float_assignment) -{ - double double_count = 1123.12; - abacus::metric double_metric(&double_count); - EXPECT_TRUE(double_metric.is_initialized()); - EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); +// TEST(test_metric, float_assignment) +// { +// double double_count = 1123.12; +// abacus::metric double_metric(&double_count); +// EXPECT_TRUE(double_metric.is_initialized()); +// EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); - // Assignment - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric = 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric = 1 / -0.0, ""); +// // Assignment +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / -0.0, ""); - // Add and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric += 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric += 1 / -0.0, ""); +// // Add and Assign +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric += 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric += 1 / -0.0, ""); - // Subtract and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / -0.0, ""); -} +// // Subtract and Assign +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +// } diff --git a/test/src/test_metrics2.cpp b/test/src/test_metrics2.cpp index b2727b0d..fa8da2b1 100644 --- a/test/src/test_metrics2.cpp +++ b/test/src/test_metrics2.cpp @@ -8,3 +8,48 @@ #include #include + +TEST(test_metrics2, empty) +{ + abacus::metrics2 metrics2; + EXPECT_EQ(metrics2.count(), 0U); + EXPECT_TRUE(metrics2.is_initialized()); +} + +TEST(test_metrics2, default_constructor) +{ + const uint16_t metric_count = 6; + + std::string name0 = "metric0"; + std::string name1 = "metric1"; + std::string name2 = "metric2"; + std::string name3 = "metric3"; + std::string name4 = "metric4"; + std::string name5 = "metric5"; + + std::map infos = { + {name0, abacus::boolean{abacus::kind::counter, "A boolean metric"}}, + {name1, + abacus::uint32{abacus::kind::counter, "An unsigned integer metric"}}, + {name2, abacus::int32{abacus::kind::gauge, "A signed integer metric"}}, + {name3, + abacus::float32{abacus::kind::gauge, "A floating point metric"}}, + {name4, + abacus::boolean{abacus::kind::constant, "A constant boolean metric"}}, + {name5, abacus::float64{abacus::kind::constant, + "A constant floating point metric"}}}; + + abacus::metrics2 metrics(infos); + + EXPECT_EQ(metrics.count(), metric_count); + EXPECT_FALSE(metrics.is_initialized()); + + auto m0 = metrics.initialize_metric(name0); + auto m1 = metrics.initialize_metric(name1); + auto m2 = metrics.initialize_metric(name2); + auto m3 = metrics.initialize_metric(name3); + metrics.initialize_constant(name4, true); + metrics.initialize_constant(name5, 42.42); + + EXPECT_TRUE(metrics.is_initialized()); +} diff --git a/test/src/test_type2.cpp b/test/src/test_type2.cpp new file mode 100644 index 00000000..685cf668 --- /dev/null +++ b/test/src/test_type2.cpp @@ -0,0 +1,101 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst +// file. + +#include +#include + +#include + +template +void integer_test() +{ + using metric = typename T::metric; + using type = typename T::type; + + uint8_t data[sizeof(type) + 1]; + metric m; + EXPECT_FALSE(m.is_initialized()); + m = metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = 10U; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), 10U); + m += 12; + m -= 2; + ++m; + --m; + + EXPECT_EQ(m.value(), 20U); +} + +template +void float_test() +{ + using metric = typename T::metric; + using type = typename T::type; + + uint8_t data[sizeof(type) + 1]; + metric m; + EXPECT_FALSE(m.is_initialized()); + m = metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = 10.0; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), 10.0); + m += 12.0; + m -= 2.0; + ++m; + --m; + + EXPECT_EQ(m.value(), 20.0); +} + +void boolean_test() +{ + uint8_t data[sizeof(bool) + 1]; + abacus::boolean::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::boolean::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = true; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), true); + m = false; + EXPECT_EQ(m.value(), false); +} + +void enum8_test() +{ + uint8_t data[sizeof(uint8_t) + 1]; + abacus::enum8::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::enum8::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = 10U; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), 10U); + m = 20U; + EXPECT_EQ(m.value(), 20U); +} + +TEST(test_metrics2, api) +{ + integer_test(); + integer_test(); + integer_test(); + integer_test(); + + float_test(); + float_test(); + + boolean_test(); + + enum8_test(); +} From f8d1bb2a2771ead5e58f701cbff3c5787860a8cd Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 6 Jan 2025 15:34:06 +0100 Subject: [PATCH 04/68] working on it --- protobuf/metrics.proto | 2 +- src/abacus/max.hpp | 13 ++++ src/abacus/metrics2.hpp | 110 ++++++++++++++++---------- src/abacus/min.hpp | 16 +++- src/abacus/protobuf/metrics.pb.cc | 21 +++-- src/abacus/protobuf/metrics.pb.h | 4 +- src/abacus/type2.hpp | 40 +++++----- src/abacus/unit.hpp | 3 + src/abacus/view2.hpp | 124 ++++++++++++++++++++++++------ test/src/test_metrics.cpp | 108 +++++++++++--------------- test/src/test_metrics2.cpp | 2 - 11 files changed, 275 insertions(+), 168 deletions(-) diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 9397e034..15898242 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -107,6 +107,6 @@ message Metric message MetricsMetadata { uint32 protocol_version = 1; // Protocol version for compatibility Endianness endianness = 2; // Endianness of packed memory - uint32 sync_value = 3; // Synchronization value + fixed32 sync_value = 3; // Synchronization value map metrics = 4; // Mapping from metric name to metadata } diff --git a/src/abacus/max.hpp b/src/abacus/max.hpp index 944d7757..9d4d62bb 100644 --- a/src/abacus/max.hpp +++ b/src/abacus/max.hpp @@ -5,12 +5,25 @@ #pragma once +#include + #include "version.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +template +struct max2 +{ + max2() = default; + + explicit max2(T value) : value(value) + { + } + + std::optional value; +}; union max { diff --git a/src/abacus/metrics2.hpp b/src/abacus/metrics2.hpp index d5427d9a..7a665ce4 100644 --- a/src/abacus/metrics2.hpp +++ b/src/abacus/metrics2.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -77,6 +78,22 @@ class metrics2 /// No metrics will be contained within this object. metrics2() = default; + /// Move constructor + /// @param other The metrics to move from. + metrics2(metrics2&& other) noexcept : + m_data(other.m_data), m_metadata(std::move(other.m_metadata)), + m_hash(other.m_hash), m_meta_bytes(other.m_meta_bytes), + m_value_bytes(other.m_value_bytes), + m_initialized(std::move(other.m_initialized)) + { + other.m_data = nullptr; + other.m_metadata = protobuf::MetricsMetadata(); + other.m_hash = 0; + other.m_meta_bytes = 0; + other.m_value_bytes = 0; + other.m_initialized.clear(); + } + /// Constructor /// @param info The info of the metrics in a pointer. /// @param count The number of infos. @@ -94,24 +111,28 @@ class metrics2 { protobuf::Metric metric; metric.set_offset(m_value_bytes); - // The offset is incremented by the size of the type plus one byte - // which represents whether the metric is set or not. - m_value_bytes += 1 + sizeof(size_of_type()); + + // The offset is incremented by one byte which represents whether + // the metric is set or not. + m_value_bytes += 1; + + // The offset is incremented by the size of the type + m_value_bytes += sizeof(size_of_type()); if (auto* m = std::get_if(&value)) { metric.mutable_uint64()->set_description(m->description); metric.mutable_uint64()->set_kind(to_protobuf_kind(m->kind)); if (!m->unit.empty()) { - metric.mutable_uint64()->set_unit(m->unit); + metric.mutable_uint64()->set_unit(m->unit.value); } - if (m->min.has_value()) + if (m->min.value.has_value()) { - metric.mutable_uint64()->set_min(m->min.value()); + metric.mutable_uint64()->set_min(m->min.value.value()); } - if (m->max.has_value()) + if (m->max.value.has_value()) { - metric.mutable_uint64()->set_max(m->max.value()); + metric.mutable_uint64()->set_max(m->max.value.value()); } } else if (auto* m = std::get_if(&value)) @@ -120,15 +141,15 @@ class metrics2 metric.mutable_int64()->set_kind(to_protobuf_kind(m->kind)); if (!m->unit.empty()) { - metric.mutable_int64()->set_unit(m->unit); + metric.mutable_int64()->set_unit(m->unit.value); } - if (m->min.has_value()) + if (m->min.value.has_value()) { - metric.mutable_int64()->set_min(m->min.value()); + metric.mutable_int64()->set_min(m->min.value.value()); } - if (m->max.has_value()) + if (m->max.value.has_value()) { - metric.mutable_int64()->set_max(m->max.value()); + metric.mutable_int64()->set_max(m->max.value.value()); } } else if (auto* m = std::get_if(&value)) @@ -137,15 +158,15 @@ class metrics2 metric.mutable_uint32()->set_kind(to_protobuf_kind(m->kind)); if (!m->unit.empty()) { - metric.mutable_uint32()->set_unit(m->unit); + metric.mutable_uint32()->set_unit(m->unit.value); } - if (m->min.has_value()) + if (m->min.value.has_value()) { - metric.mutable_uint32()->set_min(m->min.value()); + metric.mutable_uint32()->set_min(m->min.value.value()); } - if (m->max.has_value()) + if (m->max.value.has_value()) { - metric.mutable_uint32()->set_max(m->max.value()); + metric.mutable_uint32()->set_max(m->max.value.value()); } } else if (auto* m = std::get_if(&value)) @@ -154,15 +175,15 @@ class metrics2 metric.mutable_int32()->set_kind(to_protobuf_kind(m->kind)); if (!m->unit.empty()) { - metric.mutable_int32()->set_unit(m->unit); + metric.mutable_int32()->set_unit(m->unit.value); } - if (m->min.has_value()) + if (m->min.value.has_value()) { - metric.mutable_int32()->set_min(m->min.value()); + metric.mutable_int32()->set_min(m->min.value.value()); } - if (m->max.has_value()) + if (m->max.value.has_value()) { - metric.mutable_int32()->set_max(m->max.value()); + metric.mutable_int32()->set_max(m->max.value.value()); } } else if (auto* m = std::get_if(&value)) @@ -171,15 +192,15 @@ class metrics2 metric.mutable_float64()->set_kind(to_protobuf_kind(m->kind)); if (!m->unit.empty()) { - metric.mutable_float64()->set_unit(m->unit); + metric.mutable_float64()->set_unit(m->unit.value); } - if (m->min.has_value()) + if (m->min.value.has_value()) { - metric.mutable_float64()->set_min(m->min.value()); + metric.mutable_float64()->set_min(m->min.value.value()); } - if (m->max.has_value()) + if (m->max.value.has_value()) { - metric.mutable_float64()->set_max(m->max.value()); + metric.mutable_float64()->set_max(m->max.value.value()); } } else if (auto* m = std::get_if(&value)) @@ -188,15 +209,15 @@ class metrics2 metric.mutable_float32()->set_kind(to_protobuf_kind(m->kind)); if (!m->unit.empty()) { - metric.mutable_float32()->set_unit(m->unit); + metric.mutable_float32()->set_unit(m->unit.value); } - if (m->min.has_value()) + if (m->min.value.has_value()) { - metric.mutable_float32()->set_min(m->min.value()); + metric.mutable_float32()->set_min(m->min.value.value()); } - if (m->max.has_value()) + if (m->max.value.has_value()) { - metric.mutable_float32()->set_max(m->max.value()); + metric.mutable_float32()->set_max(m->max.value.value()); } } else if (auto* m = std::get_if(&value)) @@ -209,7 +230,6 @@ class metrics2 metric.mutable_enum8()->set_description(m->description); for (auto [key, value] : m->values) { - auto enum_value = protobuf::EnumValue(); enum_value.set_name(value.name); if (!value.description.empty()) @@ -226,6 +246,10 @@ class metrics2 m_initialized[name] = false; } + // Set the sync value to 1 so that the size of the metadata is + // calculated correctly + m_metadata.set_sync_value(1); + m_meta_bytes = m_metadata.ByteSizeLong(); m_data = new uint8_t[m_meta_bytes + m_value_bytes]; @@ -241,6 +265,9 @@ class metrics2 // Serialize the metadata again to include the sync value m_metadata.SerializeToArray(m_data, m_meta_bytes); + // Make sure the metadata didn't change unexpectedly + assert(m_metadata.ByteSizeLong() == m_meta_bytes); + // Write the sync value to the first byte of the value data (this will // be written as the endianess of the system) // Consuming code can use the endianness field in the metadata to @@ -267,11 +294,16 @@ class metrics2 return m_value_bytes; } - auto meta_data() const -> const uint8_t* + auto metadata_ptr() const -> const uint8_t* { return m_data; } + auto metadata() const -> const protobuf::MetricsMetadata& + { + return m_metadata; + } + auto meta_bytes() const -> std::size_t { return m_meta_bytes; @@ -316,16 +348,10 @@ class metrics2 const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); auto offset = proto_metric.offset(); auto kind = get_kind(proto_metric); - assert(kind.has_value() && kind.value() != protobuf::Kind::CONSTANT); + assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); typename Metric::metric(m_data + m_meta_bytes + offset, value); } - /// @return the number of metrics - auto count() const -> std::size_t - { - return m_metadata.metrics().size(); - } - /// @return true if all metrics have been initialized auto is_initialized() const -> bool { diff --git a/src/abacus/min.hpp b/src/abacus/min.hpp index 85467d7c..d1fec675 100644 --- a/src/abacus/min.hpp +++ b/src/abacus/min.hpp @@ -5,15 +5,29 @@ #pragma once +#include + #include "version.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -union min + +template +struct min2 { + min2() = default; + + explicit min2(T value) : value(value) + { + } + + std::optional value; +}; +union min +{ min(uint64_t value) : m_uint(value) { } diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index e3b23047..32b39379 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -611,7 +611,7 @@ const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTO "\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030\n\020protoco" "l_version\030\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.ab" "acus.protobuf.Endianness\022\022\n\nsync_value\030\003" - " \001(\r\022>\n\007metrics\030\004 \003(\0132-.abacus.protobuf." + " \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus.protobuf." "MetricsMetadata.MetricsEntry\032G\n\014MetricsE" "ntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacu" "s.protobuf.Metric:\0028\001*,\n\004Kind\022\013\n\007COUNTER" @@ -4331,9 +4331,9 @@ const ::_pbi::TcParseTable<2, 4, 2, 47, 2> MetricsMetadata::_table_ = { // .abacus.protobuf.Endianness endianness = 2; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.endianness_), 63>(), {16, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_)}}, - // uint32 sync_value = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MetricsMetadata, _impl_.sync_value_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_)}}, + // fixed32 sync_value = 3; + {::_pbi::TcParser::FastF32S1, + {29, 63, 0, PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_)}}, }}, {{ 65535, 65535 }}, {{ @@ -4343,9 +4343,9 @@ const ::_pbi::TcParseTable<2, 4, 2, 47, 2> MetricsMetadata::_table_ = { // .abacus.protobuf.Endianness endianness = 2; {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.endianness_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // uint32 sync_value = 3; + // fixed32 sync_value = 3; {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.sync_value_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + (0 | ::_fl::kFcSingular | ::_fl::kFixed32)}, // map metrics = 4; {PROTOBUF_FIELD_OFFSET(MetricsMetadata, _impl_.metrics_), 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, @@ -4380,10 +4380,10 @@ ::uint8_t* MetricsMetadata::_InternalSerialize( 2, this->_internal_endianness(), target); } - // uint32 sync_value = 3; + // fixed32 sync_value = 3; if (this->_internal_sync_value() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + target = ::_pbi::WireFormatLite::WriteFixed32ToArray( 3, this->_internal_sync_value(), target); } @@ -4446,10 +4446,9 @@ ::size_t MetricsMetadata::ByteSizeLong() const { ::_pbi::WireFormatLite::EnumSize(this->_internal_endianness()); } - // uint32 sync_value = 3; + // fixed32 sync_value = 3; if (this->_internal_sync_value() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_sync_value()); + total_size += 5; } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 47288a20..ba38ffb6 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -2671,7 +2671,7 @@ class MetricsMetadata final : void _internal_set_endianness(::abacus::protobuf::Endianness value); public: - // uint32 sync_value = 3; + // fixed32 sync_value = 3; void clear_sync_value() ; ::uint32_t sync_value() const; void set_sync_value(::uint32_t value); @@ -5017,7 +5017,7 @@ inline void MetricsMetadata::_internal_set_endianness(::abacus::protobuf::Endian _impl_.endianness_ = value; } -// uint32 sync_value = 3; +// fixed32 sync_value = 3; inline void MetricsMetadata::clear_sync_value() { _impl_.sync_value_ = 0u; } diff --git a/src/abacus/type2.hpp b/src/abacus/type2.hpp index d7bc2df1..91d4f4b8 100644 --- a/src/abacus/type2.hpp +++ b/src/abacus/type2.hpp @@ -13,6 +13,8 @@ #include #include "kind.hpp" +#include "max.hpp" +#include "min.hpp" #include "unit.hpp" namespace abacus @@ -142,9 +144,9 @@ struct uint64 abacus::kind kind; std::string description; - std::string unit; - std::optional min; - std::optional max; + abacus::unit unit; + abacus::min2 min; + abacus::max2 max; }; struct int64 { @@ -156,9 +158,9 @@ struct int64 }; abacus::kind kind; std::string description; - std::string unit; - std::optional min; - std::optional max; + abacus::unit unit; + abacus::min2 min; + abacus::max2 max; }; struct uint32 { @@ -170,9 +172,9 @@ struct uint32 }; abacus::kind kind; std::string description; - std::string unit; - std::optional min; - std::optional max; + abacus::unit unit; + abacus::min2 min; + abacus::max2 max; }; struct int32 { @@ -184,9 +186,9 @@ struct int32 }; abacus::kind kind; std::string description; - std::string unit; - std::optional min; - std::optional max; + abacus::unit unit; + abacus::min2 min; + abacus::max2 max; }; struct float64 { @@ -198,9 +200,9 @@ struct float64 }; abacus::kind kind; std::string description; - std::string unit; - std::optional min; - std::optional max; + abacus::unit unit; + abacus::min2 min; + abacus::max2 max; }; struct float32 { @@ -212,9 +214,9 @@ struct float32 }; abacus::kind kind; std::string description; - std::string unit; - std::optional min; - std::optional max; + abacus::unit unit; + abacus::min2 min; + abacus::max2 max; }; struct boolean { @@ -354,7 +356,7 @@ struct enum8 }; std::string description; std::map values; - std::string unit; + abacus::unit unit; }; using type2 = std::variant; diff --git a/src/abacus/unit.hpp b/src/abacus/unit.hpp index a8bedf66..6fd3dae9 100644 --- a/src/abacus/unit.hpp +++ b/src/abacus/unit.hpp @@ -15,6 +15,9 @@ inline namespace STEINWURF_ABACUS_VERSION /// Wrapper for a unit string for more explicit code struct unit { + /// Default constructor + unit() = default; + /// Explicit constructor explicit unit(const std::string& name) : value(name) { diff --git a/src/abacus/view2.hpp b/src/abacus/view2.hpp index 7d98c5df..4eccffd9 100644 --- a/src/abacus/view2.hpp +++ b/src/abacus/view2.hpp @@ -9,6 +9,11 @@ #include #include +#include +#include +#include + +#include "detail/hash_function.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" @@ -38,55 +43,124 @@ inline namespace STEINWURF_ABACUS_VERSION /// view.set_value_data() can be called again. class view2 { - public: + void set_data(const uint8_t* data, std::size_t bytes) + { + } + /// Sets the meta data pointer /// @param meta_data The meta data pointer - void set_meta_data(const uint8_t* meta_data); + void set_meta_data(const uint8_t* metadata_ptr, std::size_t meta_bytes) + { + assert(metadata_ptr != nullptr); + m_metadata_ptr = metadata_ptr; + m_meta_bytes = meta_bytes; + m_value_data = nullptr; + m_value_bytes = 0; + + m_metadata.ParseFromArray(metadata_ptr, meta_bytes); + } /// Sets the value data pointer /// @param value_data The value data pointer - void set_value_data(const uint8_t* value_data); - - /// Gets the meta data pointer - /// @return The meta data pointer - const uint8_t* meta_data() const; + /// @return true if the hash is correct otherwise false + auto set_value_data(const uint8_t* value_data, + std::size_t value_bytes) -> bool + { + assert(m_metadata_ptr != nullptr); + assert(value_data != nullptr); + + // Check that the hash is correct + auto value_data_hash = detail::hash_function(value_data, value_bytes); + + if (m_metadata.sync_value() != value_data_hash) + { + return false; + } + m_value_data = value_data; + m_value_bytes = value_bytes; + return true; + } + + auto metadata_ptr() const -> const uint8_t* + { + return m_metadata_ptr; + } /// Gets the value data pointer /// @return The value data pointer - const uint8_t* value_data() const; + const uint8_t* value_data() const + { + return m_value_data; + } /// Gets the meta data size in bytes /// @return The meta data size in bytes - std::size_t meta_bytes() const; + std::size_t meta_bytes() const + { + return m_meta_bytes; + } /// Gets the value data size in bytes /// @return The value data size in bytes - std::size_t value_bytes() const; + std::size_t value_bytes() const + { + return m_value_bytes; + } - /// @return the number of metrics from in a metrics data pointer - auto count() const -> uint16_t; + auto metadata() const -> const protobuf::MetricsMetadata& + { + return m_metadata; + } - /// Gets the protocol version of the metrics - /// @return The protocol version of the metrics - auto protocol_version() const -> uint8_t; - - auto names() const -> std::vector; - - auto type() const -> std::optional; - - template + template auto - value(const std::string& name) const -> std::optional; - - const protobuf::Metric& metric_info(const std::string& name) const; + value(const std::string& name) const -> std::optional + { + assert(m_value_data != nullptr); + assert(m_metadata_ptr != nullptr); + + auto endianness = m_metadata.endianness(); + + auto offset = metric(name).offset(); + assert(offset < m_value_bytes); + + if (m_value_data[offset] == 0) + { + return std::nullopt; + } + + typename Metric::type value; + + switch (m_metadata.endianness()) + { + case protobuf::Endianness::BIG: + endian::big_endian::get(value, m_value_data + offset + 1); + break; + case protobuf::Endianness::LITTLE: + endian::little_endian::get(value, m_value_data + offset + 1); + break; + default: + assert(false); + } + return value; + } + + const protobuf::Metric& metric(const std::string& name) const + { + return m_metadata.metrics().at(name); + } private: /// The meta data pointer - const uint8_t* m_meta_data; + const uint8_t* m_metadata_ptr; + std::size_t m_meta_bytes; + + protobuf::MetricsMetadata m_metadata; /// The value data pointer const uint8_t* m_value_data; + std::size_t m_value_bytes; }; } } diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index cd29cb99..63b7808a 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -7,26 +7,23 @@ #include #include -#include -#include +#include #include TEST(test_metrics, empty) { - abacus::metrics metrics; + abacus::metrics2 metrics; - EXPECT_EQ(0U, metrics.count()); + EXPECT_EQ(0U, metrics.metadata().metrics().size()); - std::vector infos; - abacus::metrics metrics2(infos.data(), infos.size()); + std::map infos; + abacus::metrics2 metrics2(infos); - EXPECT_EQ(0U, metrics2.count()); + EXPECT_EQ(0U, metrics.metadata().metrics().size()); } TEST(test_metrics, default_constructor) { - const uint16_t metric_count = 6; - std::string name0 = "metric0"; std::string name1 = "metric1"; std::string name2 = "metric2"; @@ -34,36 +31,38 @@ TEST(test_metrics, default_constructor) std::string name4 = "metric4"; std::string name5 = "metric5"; - abacus::metric_info infos[metric_count] = { - abacus::metric_info{name0, "A boolean metric", abacus::type::boolean, - abacus::kind::counter}, - abacus::metric_info{name1, "An unsigned integer metric", - abacus::type::uint64, abacus::kind::counter, - abacus::unit{"bytes"}}, - abacus::metric_info{name2, "A signed integer metric", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"USD"}}, - abacus::metric_info{name3, "A floating point metric", - abacus::type::float64, abacus::kind::gauge, - abacus::unit{"ms"}}, - abacus::metric_info{name4, "A constant boolean metric", - abacus::type::boolean, abacus::kind::constant}, - abacus::metric_info{name5, "A constant floating point metric", - abacus::type::float64, abacus::kind::constant, - abacus::unit{"ms"}}}; - - abacus::metrics from_metrics(infos); - abacus::metrics metrics(std::move(from_metrics)); - - EXPECT_EQ(metrics.count(), metric_count); - EXPECT_EQ(metrics.protocol_version(), abacus::protocol_version()); - - EXPECT_EQ(metrics.kind(0), abacus::kind::counter); - EXPECT_EQ(metrics.kind(1), abacus::kind::gauge); - EXPECT_EQ(metrics.kind(2), abacus::kind::gauge); - EXPECT_EQ(metrics.kind(3), abacus::kind::constant); - EXPECT_EQ(metrics.kind(4), abacus::kind::counter); - EXPECT_EQ(metrics.kind(5), abacus::kind::constant); + std::map infos = { + {name0, abacus::boolean{abacus::kind::counter, "A boolean metric"}}, + {name1, + abacus::uint64{abacus::kind::counter, "An unsigned integer metric", + abacus::unit{"bytes"}}}, + {name2, abacus::int64{abacus::kind::gauge, "A signed integer metric", + abacus::unit{"USD"}}}, + {name3, abacus::float64{abacus::kind::gauge, "A floating point metric", + abacus::unit{"ms"}}}, + {name4, + abacus::boolean{abacus::kind::constant, "A constant boolean metric "}}, + {name5, abacus::float64{abacus::kind::constant, + "A constant floating point metric", + abacus::unit{"ms"}}} + + }; + + abacus::metrics2 from_metrics(infos); + abacus::metrics2 metrics(std::move(from_metrics)); + EXPECT_EQ(metrics.metadata().metrics().size(), 6U); + EXPECT_EQ(metrics.metadata().protocol_version(), + abacus::protocol_version()); + + EXPECT_EQ(metrics.metadata().metrics().at(name0).uint64().kind(), + abacus::protobuf::Kind::COUNTER); + // EXPECT_EQ(metrics.kind(1), abacus::kind::gauge); + // EXPECT_EQ(metrics.kind(2), abacus::kind::gauge); + // EXPECT_EQ(metrics.kind(3), abacus::kind::constant); + // EXPECT_EQ(metrics.kind(4), abacus::kind::counter); + // EXPECT_EQ(metrics.kind(5), abacus::kind::constant); +} +/* EXPECT_FALSE(metrics.is_initialized(0)); auto metric0 = metrics.initialize_metric(name1); @@ -144,7 +143,8 @@ TEST(test_metrics, default_constructor) EXPECT_EQ(metrics.index(name4), 5U); EXPECT_EQ(metrics.index(name5), 3U); } - +*/ +/* TEST(test_metrics, value_and_meta_bytes) { const uint16_t metric_count = 2; @@ -165,31 +165,8 @@ TEST(test_metrics, value_and_meta_bytes) metrics.initialize_metric(name0); metrics.initialize_metric(name1); - std::size_t meta_bytes = 0; - // header size - meta_bytes += abacus::detail::header_bytes(); - // name and description sizes - meta_bytes += metric_count * 3 * 2; - // names and descriptions - for (std::size_t i = 0; i < metric_count; ++i) - { - meta_bytes += infos[i].name.size(); - meta_bytes += infos[i].description.size(); - meta_bytes += infos[i].unit.value.size(); - } - // types - meta_bytes += metric_count; - // is_contant bools - meta_bytes += metric_count; - // min and max - meta_bytes += metric_count * sizeof(uint64_t) * 2; - - ASSERT_EQ(meta_bytes, metrics.meta_bytes()); - - std::size_t value_bytes = 0; - value_bytes += metric_count * 8; - value_bytes += (metric_count + 7) / 8; - ASSERT_EQ(value_bytes, metrics.value_bytes()); + EXPECT_EQ(metrics.meta_bytes(), 128U); + EXPECT_EQ(metrics.value_bytes(), 16U); } TEST(test_metrics, reset_counters) @@ -345,3 +322,4 @@ TEST(test_metrics, protocol_version) metrics.value_data() + metrics.value_bytes())); } } +*/ diff --git a/test/src/test_metrics2.cpp b/test/src/test_metrics2.cpp index fa8da2b1..979a31f4 100644 --- a/test/src/test_metrics2.cpp +++ b/test/src/test_metrics2.cpp @@ -12,7 +12,6 @@ TEST(test_metrics2, empty) { abacus::metrics2 metrics2; - EXPECT_EQ(metrics2.count(), 0U); EXPECT_TRUE(metrics2.is_initialized()); } @@ -41,7 +40,6 @@ TEST(test_metrics2, default_constructor) abacus::metrics2 metrics(infos); - EXPECT_EQ(metrics.count(), metric_count); EXPECT_FALSE(metrics.is_initialized()); auto m0 = metrics.initialize_metric(name0); From 27d897a8265ec6c1d5948e73e1860b1637ff27a9 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 7 Jan 2025 15:38:27 +0100 Subject: [PATCH 05/68] working on it --- CMakeLists.txt | 15 +- examples/metrics_simple.cpp | 83 +++--- protobuf/kind.proto | 10 + protobuf/metrics.proto | 9 +- src/abacus/detail/to_json.cpp | 141 ++++++----- src/abacus/detail/to_json.hpp | 4 +- src/abacus/metrics2.hpp | 107 ++++---- src/abacus/protobuf/kind.pb.cc | 98 ++++++++ src/abacus/protobuf/kind.pb.h | 138 ++++++++++ src/abacus/protobuf/metrics.pb.cc | 131 +++++----- src/abacus/protobuf/metrics.pb.h | 40 +-- src/abacus/protocol_version.cpp | 2 +- src/abacus/to_json.cpp | 13 +- src/abacus/to_json.hpp | 7 +- src/abacus/type2.hpp | 86 ++++--- src/abacus/view2.hpp | 44 ++-- test/src/test_metric.cpp | 95 ++++--- test/src/test_metrics.cpp | 403 +++++++++++++++--------------- test/src/test_metrics2.cpp | 53 ---- test/src/test_raw.cpp | 157 ------------ test/src/test_to_json.cpp | 46 ++-- test/src/test_view.cpp | 82 +++--- 22 files changed, 896 insertions(+), 868 deletions(-) create mode 100644 protobuf/kind.proto create mode 100644 src/abacus/protobuf/kind.pb.cc create mode 100644 src/abacus/protobuf/kind.pb.h delete mode 100644 test/src/test_metrics2.cpp delete mode 100644 test/src/test_raw.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 42f7b90e..ad70043d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,9 @@ if(NOT TARGET steinwurf::endian) endif() # protobuf -if (NOT TARGET steinwurf::protobuf) - add_subdirectory("${STEINWURF_RESOLVE}/protobuf" protobuf EXCLUDE_FROM_ALL) -endif () +if(NOT TARGET steinwurf::protobuf) + add_subdirectory("${STEINWURF_RESOLVE}/protobuf" protobuf EXCLUDE_FROM_ALL) +endif() # Define library file(GLOB_RECURSE abacus_sources ./src/*.cpp ./src/*.cc) @@ -81,6 +81,7 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) # Build executables add_executable(metrics_simple examples/metrics_simple.cpp) target_link_libraries(metrics_simple abacus) + target_link_libraries(metrics_simple steinwurf::endian) target_link_libraries(metrics_simple steinwurf::protobuf) enable_testing() @@ -101,10 +102,10 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) add_executable(abacus_test ${abacus_test_sources}) target_link_libraries(abacus_test gtest_main) target_link_libraries(abacus_test - steinwurf::abacus - steinwurf::endian - steinwurf::bourne - steinwurf::protobuf) + steinwurf::abacus + steinwurf::endian + steinwurf::bourne + steinwurf::protobuf) add_test(abacus_test abacus_test) endif() diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 91db41af..1fc7ee29 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -7,62 +7,63 @@ #include #include -#include -#include -#include +// #include +// #include +// #include // Simple example of metrics on a car. int main() { - std::string name0 = "fuel_consumption"; - std::string name1 = "wheels"; - std::string name2 = "days_until_maintenance"; - std::string name3 = "registered"; + // std::string name0 = "fuel_consumption"; + // std::string name1 = "wheels"; + // std::string name2 = "days_until_maintenance"; + // std::string name3 = "registered"; - abacus::metric_info infos[4] = { - abacus::metric_info{name0, "Fuel consumption in kilometers per liter", - abacus::type::float64, abacus::kind::constant, - abacus::unit{"km/l"}}, - abacus::metric_info{name1, "Wheels on the car", abacus::type::uint64, - abacus::kind::constant, abacus::unit{"wheels"}}, - abacus::metric_info{name2, - "Days until next maintenance, if less than 0, " - "maintenance is overdue", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"days"}}, - abacus::metric_info{name3, "Is the car registered", - abacus::type::boolean, abacus::kind::gauge}}; + // abacus::metric_info infos[4] = { + // abacus::metric_info{name0, "Fuel consumption in kilometers per + // liter", + // abacus::type::float64, abacus::kind::constant, + // abacus::unit{"km/l"}}, + // abacus::metric_info{name1, "Wheels on the car", abacus::type::uint64, + // abacus::kind::constant, abacus::unit{"wheels"}}, + // abacus::metric_info{name2, + // "Days until next maintenance, if less than 0, " + // "maintenance is overdue", + // abacus::type::int64, abacus::kind::gauge, + // abacus::unit{"days"}}, + // abacus::metric_info{name3, "Is the car registered", + // abacus::type::boolean, abacus::kind::gauge}}; - abacus::metrics car(infos); + // abacus::metrics car(infos); - car.initialize_constant("fuel_consumption", 22.3); - car.initialize_constant("wheels", 4); - auto days_until_maintenance = - car.initialize_metric("days_until_maintenance"); - auto registered = - car.initialize_metric("registered"); + // car.initialize_constant("fuel_consumption", 22.3); + // car.initialize_constant("wheels", 4); + // auto days_until_maintenance = + // car.initialize_metric("days_until_maintenance"); + // auto registered = + // car.initialize_metric("registered"); - // The car should be registered. - registered = true; + // // The car should be registered. + // registered = true; - // The car is overdue maintenance. - days_until_maintenance = -10; + // // The car is overdue maintenance. + // days_until_maintenance = -10; - /// We want to export the metrics memory, so we need a new storage - std::vector meta_data(car.meta_bytes()); - std::vector value_data(car.value_bytes()); + // /// We want to export the metrics memory, so we need a new storage + // std::vector meta_data(car.meta_bytes()); + // std::vector value_data(car.value_bytes()); - /// Copy the memory into the new storage - std::memcpy(meta_data.data(), car.meta_data(), car.meta_bytes()); - std::memcpy(value_data.data(), car.value_data(), car.value_bytes()); + // /// Copy the memory into the new storage + // std::memcpy(meta_data.data(), car.meta_data(), car.meta_bytes()); + // std::memcpy(value_data.data(), car.value_data(), car.value_bytes()); - abacus::view car_view; + // abacus::view car_view; - car_view.set_meta_data(meta_data.data()); - car_view.set_value_data(value_data.data()); + // car_view.set_meta_data(meta_data.data()); + // car_view.set_value_data(value_data.data()); - std::cout << abacus::to_json(car_view) << std::endl; + // std::cout << abacus::to_json(car_view) << std::endl; return 0; } diff --git a/protobuf/kind.proto b/protobuf/kind.proto new file mode 100644 index 00000000..c87174ec --- /dev/null +++ b/protobuf/kind.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package abacus.protobuf; +option go_package = "abacus/protobuf"; + +// Specifies the kind of metric +enum Kind { + COUNTER = 0; // Counter metric + CONSTANT = 1; // Constant metric + GAUGE = 2; // Gauge metric +} diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 15898242..9946045d 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -2,12 +2,9 @@ syntax = "proto3"; package abacus.protobuf; option go_package = "abacus/protobuf"; -// Specifies the kind of metric -enum Kind { - COUNTER = 0; // Counter metric - CONSTANT = 1; // Constant metric - GAUGE = 2; // Gauge metric -} + +import "abacus/protobuf/kind.proto"; + // Specifies the endianness for multi-byte values enum Endianness { diff --git a/src/abacus/detail/to_json.cpp b/src/abacus/detail/to_json.cpp index 9e830b4c..de4b5d11 100644 --- a/src/abacus/detail/to_json.cpp +++ b/src/abacus/detail/to_json.cpp @@ -6,8 +6,8 @@ #include "to_json.hpp" #include +#include -#include "../to_string.hpp" #include "../version.hpp" namespace abacus @@ -16,82 +16,103 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace detail { -auto to_json(const view& view, bool slim) -> bourne::json +auto to_json(const view2& view, bool slim) -> bourne::json { auto json = bourne::json::object(); - uint64_t uint_value = 0U; - int64_t int_value = 0; - bool bool_value = false; - double float_value = 0.0; - if (!slim) + if (slim) { - json["protocol_version"] = view.protocol_version(); - } - - for (std::size_t i = 0; i < view.count(); ++i) - { - auto value = bourne::json::null(); - auto max = bourne::json::null(); - auto min = bourne::json::null(); - // If metric is not initialized we set it to null - if ((view.is_initialized(i))) + for (const auto& [name, metric] : view.metadata().metrics()) { - switch (view.type(i)) + switch (metric.type_case()) { - case abacus::type::uint64: - view.value(i, uint_value); - value = uint_value; - max = view.max(i).m_uint; - min = view.min(i).m_uint; + case protobuf::Metric::kUint64: + { + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } break; - case abacus::type::int64: - view.value(i, int_value); - value = int_value; - max = view.max(i).m_int; - min = view.min(i).m_int; + } + case protobuf::Metric::kInt64: + { + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } break; - case abacus::type::boolean: - view.value(i, bool_value); - value = bool_value; - max = view.max(i).m_uint; - min = view.min(i).m_uint; + } + case protobuf::Metric::kUint32: + { + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } break; - case abacus::type::float64: - view.value(i, float_value); - value = float_value; - max = view.max(i).m_double; - min = view.min(i).m_double; + } + case protobuf::Metric::kInt32: + { + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } break; - default: - assert(false); + } + case protobuf::Metric::kFloat64: + { + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } break; } - } - if (slim) - { - json[view.name(i)] = value; - } - else - { - std::string kind = to_string(view.kind(i)); - - json[view.name(i)] = { - "description", view.description(i), "kind", kind, "value", - value, - }; - - if (min != 0 || max != 0) + case protobuf::Metric::kFloat32: { - json[view.name(i)]["min"] = min; - json[view.name(i)]["max"] = max; + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } + break; } - - if (!view.unit(i).empty()) + case protobuf::Metric::kBoolean: { - json[view.name(i)]["unit"] = view.unit(i); + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } + break; + } + case protobuf::Metric::kEnum8: + { + auto v = view.value(name); + if (v.has_value()) + { + json[name] = v.value(); + } + break; } + default: + break; + } + } + } + else + { + std::string metadata_json; + auto status = google::protobuf::util::MessageToJsonString( + view.metadata(), &metadata_json); + if (status.ok()) + { + json = bourne::json::parse(metadata_json); } } + return json; } } diff --git a/src/abacus/detail/to_json.hpp b/src/abacus/detail/to_json.hpp index 2a0e6a88..4d56146c 100644 --- a/src/abacus/detail/to_json.hpp +++ b/src/abacus/detail/to_json.hpp @@ -7,7 +7,7 @@ #include -#include "../view.hpp" +#include "../view2.hpp" #include "../version.hpp" @@ -17,7 +17,7 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace detail { -auto to_json(const view& view, bool slim) -> bourne::json; +auto to_json(const view2& view, bool slim) -> bourne::json; } } } diff --git a/src/abacus/metrics2.hpp b/src/abacus/metrics2.hpp index 7a665ce4..80f85738 100644 --- a/src/abacus/metrics2.hpp +++ b/src/abacus/metrics2.hpp @@ -28,20 +28,7 @@ inline namespace STEINWURF_ABACUS_VERSION template static auto size_of_type() -> std::size_t { - return sizeof(typename T::type); -} - -static inline auto to_protobuf_kind(abacus::kind kind) -> protobuf::Kind -{ - switch (kind) - { - case abacus::kind::counter: - return protobuf::Kind::COUNTER; - case abacus::kind::constant: - return protobuf::Kind::CONSTANT; - case abacus::kind::gauge: - return protobuf::Kind::GAUGE; - } + return sizeof(typename std::remove_pointer::type::type); } static inline auto @@ -82,14 +69,14 @@ class metrics2 /// @param other The metrics to move from. metrics2(metrics2&& other) noexcept : m_data(other.m_data), m_metadata(std::move(other.m_metadata)), - m_hash(other.m_hash), m_meta_bytes(other.m_meta_bytes), + m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), m_value_bytes(other.m_value_bytes), m_initialized(std::move(other.m_initialized)) { other.m_data = nullptr; other.m_metadata = protobuf::MetricsMetadata(); other.m_hash = 0; - other.m_meta_bytes = 0; + other.m_metadata_bytes = 0; other.m_value_bytes = 0; other.m_initialized.clear(); } @@ -106,7 +93,8 @@ class metrics2 : protobuf::Endianness::LITTLE); // The first byte is reserved for the sync value - std::size_t m_value_bytes = sizeof(uint32_t); + m_value_bytes = sizeof(uint32_t); + for (auto [name, value] : infos) { protobuf::Metric metric; @@ -116,12 +104,13 @@ class metrics2 // the metric is set or not. m_value_bytes += 1; - // The offset is incremented by the size of the type - m_value_bytes += sizeof(size_of_type()); if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_uint64()->set_description(m->description); - metric.mutable_uint64()->set_kind(to_protobuf_kind(m->kind)); + metric.mutable_uint64()->set_kind(m->kind); if (!m->unit.empty()) { metric.mutable_uint64()->set_unit(m->unit.value); @@ -137,8 +126,11 @@ class metrics2 } else if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_int64()->set_description(m->description); - metric.mutable_int64()->set_kind(to_protobuf_kind(m->kind)); + metric.mutable_int64()->set_kind(m->kind); if (!m->unit.empty()) { metric.mutable_int64()->set_unit(m->unit.value); @@ -154,8 +146,11 @@ class metrics2 } else if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_uint32()->set_description(m->description); - metric.mutable_uint32()->set_kind(to_protobuf_kind(m->kind)); + metric.mutable_uint32()->set_kind(m->kind); if (!m->unit.empty()) { metric.mutable_uint32()->set_unit(m->unit.value); @@ -171,8 +166,11 @@ class metrics2 } else if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_int32()->set_description(m->description); - metric.mutable_int32()->set_kind(to_protobuf_kind(m->kind)); + metric.mutable_int32()->set_kind(m->kind); if (!m->unit.empty()) { metric.mutable_int32()->set_unit(m->unit.value); @@ -188,8 +186,11 @@ class metrics2 } else if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_float64()->set_description(m->description); - metric.mutable_float64()->set_kind(to_protobuf_kind(m->kind)); + metric.mutable_float64()->set_kind(m->kind); if (!m->unit.empty()) { metric.mutable_float64()->set_unit(m->unit.value); @@ -205,8 +206,11 @@ class metrics2 } else if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_float32()->set_description(m->description); - metric.mutable_float32()->set_kind(to_protobuf_kind(m->kind)); + metric.mutable_float32()->set_kind(m->kind); if (!m->unit.empty()) { metric.mutable_float32()->set_unit(m->unit.value); @@ -222,11 +226,17 @@ class metrics2 } else if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_boolean()->set_description(m->description); - metric.mutable_boolean()->set_kind(to_protobuf_kind(m->kind)); + metric.mutable_boolean()->set_kind(m->kind); } else if (auto* m = std::get_if(&value)) { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + metric.mutable_enum8()->set_description(m->description); for (auto [key, value] : m->values) { @@ -250,29 +260,29 @@ class metrics2 // calculated correctly m_metadata.set_sync_value(1); - m_meta_bytes = m_metadata.ByteSizeLong(); - m_data = new uint8_t[m_meta_bytes + m_value_bytes]; + m_metadata_bytes = m_metadata.ByteSizeLong(); + m_data = new uint8_t[m_metadata_bytes + m_value_bytes]; // Serialize the metadata - m_metadata.SerializeToArray(m_data, m_meta_bytes); + m_metadata.SerializeToArray(m_data, m_metadata_bytes); // Calculate the hash of the metadata - m_hash = detail::hash_function(m_data, m_meta_bytes); + m_hash = detail::hash_function(m_data, m_metadata_bytes); // Update the sync value m_metadata.set_sync_value(m_hash); // Serialize the metadata again to include the sync value - m_metadata.SerializeToArray(m_data, m_meta_bytes); + m_metadata.SerializeToArray(m_data, m_metadata_bytes); // Make sure the metadata didn't change unexpectedly - assert(m_metadata.ByteSizeLong() == m_meta_bytes); + assert(m_metadata.ByteSizeLong() == m_metadata_bytes); // Write the sync value to the first byte of the value data (this will // be written as the endianess of the system) // Consuming code can use the endianness field in the metadata to // read the sync value - *reinterpret_cast(m_data + m_meta_bytes) = m_hash; + std::memcpy(m_data + m_metadata_bytes, &m_hash, sizeof(uint32_t)); } /// Destructor @@ -285,7 +295,7 @@ class metrics2 /// @return the pointer to the value data of the metrics. auto value_data() const -> const uint8_t* { - return m_data + m_meta_bytes; + return m_data + m_metadata_bytes; } /// @return the size of the value data of the metrics. @@ -294,7 +304,7 @@ class metrics2 return m_value_bytes; } - auto metadata_ptr() const -> const uint8_t* + auto metadata_data() const -> const uint8_t* { return m_data; } @@ -304,9 +314,9 @@ class metrics2 return m_metadata; } - auto meta_bytes() const -> std::size_t + auto metadata_bytes() const -> std::size_t { - return m_meta_bytes; + return m_metadata_bytes; } template @@ -328,12 +338,12 @@ class metrics2 if (value.has_value()) { - return typename Metric::metric(m_data + m_meta_bytes + offset, + return typename Metric::metric(m_data + m_metadata_bytes + offset, value.value()); } else { - return typename Metric::metric(m_data + m_meta_bytes + offset); + return typename Metric::metric(m_data + m_metadata_bytes + offset); } } @@ -349,7 +359,13 @@ class metrics2 auto offset = proto_metric.offset(); auto kind = get_kind(proto_metric); assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); - typename Metric::metric(m_data + m_meta_bytes + offset, value); + typename Metric::metric(m_data + m_metadata_bytes + offset, value); + } + + auto is_initialized(const std::string& name) const -> bool + { + assert(m_initialized.find(name) != m_initialized.end()); + return m_initialized.at(name); } /// @return true if all metrics have been initialized @@ -365,6 +381,13 @@ class metrics2 return true; } + void reset_metrics() + { + // Reset the value data + std::memset(m_data + m_metadata_bytes + sizeof(uint32_t), 0, + m_value_bytes - sizeof(uint32_t)); + } + private: /// No copy metrics2(metrics2&) = delete; @@ -381,8 +404,8 @@ class metrics2 uint32_t m_hash; - std::size_t m_meta_bytes; - std::size_t m_value_bytes; + std::size_t m_metadata_bytes; + std::size_t m_value_bytes = 1337; std::map m_initialized; }; diff --git a/src/abacus/protobuf/kind.pb.cc b/src/abacus/protobuf/kind.pb.cc new file mode 100644 index 00000000..e02b1918 --- /dev/null +++ b/src/abacus/protobuf/kind.pb.cc @@ -0,0 +1,98 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: abacus/protobuf/kind.proto + +#include "abacus/protobuf/kind.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 abacus { +namespace protobuf { +} // namespace protobuf +} // namespace abacus +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fkind_2eproto[1]; +static constexpr const ::_pb::ServiceDescriptor** + file_level_service_descriptors_abacus_2fprotobuf_2fkind_2eproto = nullptr; +const ::uint32_t TableStruct_abacus_2fprotobuf_2fkind_2eproto::offsets[1] = {}; +static constexpr ::_pbi::MigrationSchema* schemas = nullptr; +static constexpr ::_pb::Message* const* file_default_instances = nullptr; +const char descriptor_table_protodef_abacus_2fprotobuf_2fkind_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + "\n\032abacus/protobuf/kind.proto\022\017abacus.pro" + "tobuf*,\n\004Kind\022\013\n\007COUNTER\020\000\022\014\n\010CONSTANT\020\001" + "\022\t\n\005GAUGE\020\002B\021Z\017abacus/protobufb\006proto3" +}; +static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fkind_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fkind_2eproto = { + false, + false, + 118, + descriptor_table_protodef_abacus_2fprotobuf_2fkind_2eproto, + "abacus/protobuf/kind.proto", + &descriptor_table_abacus_2fprotobuf_2fkind_2eproto_once, + nullptr, + 0, + 0, + schemas, + file_default_instances, + TableStruct_abacus_2fprotobuf_2fkind_2eproto::offsets, + nullptr, + file_level_enum_descriptors_abacus_2fprotobuf_2fkind_2eproto, + file_level_service_descriptors_abacus_2fprotobuf_2fkind_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_abacus_2fprotobuf_2fkind_2eproto_getter() { + return &descriptor_table_abacus_2fprotobuf_2fkind_2eproto; +} +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 +static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_abacus_2fprotobuf_2fkind_2eproto(&descriptor_table_abacus_2fprotobuf_2fkind_2eproto); +namespace abacus { +namespace protobuf { +const ::google::protobuf::EnumDescriptor* Kind_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_abacus_2fprotobuf_2fkind_2eproto); + return file_level_enum_descriptors_abacus_2fprotobuf_2fkind_2eproto[0]; +} +bool Kind_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} +// @@protoc_insertion_point(namespace_scope) +} // namespace protobuf +} // namespace abacus +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google +// @@protoc_insertion_point(global_scope) +#include "google/protobuf/port_undef.inc" diff --git a/src/abacus/protobuf/kind.pb.h b/src/abacus/protobuf/kind.pb.h new file mode 100644 index 00000000..5037d23c --- /dev/null +++ b/src/abacus/protobuf/kind.pb.h @@ -0,0 +1,138 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: abacus/protobuf/kind.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_abacus_2fprotobuf_2fkind_2eproto_2epb_2eh +#define GOOGLE_PROTOBUF_INCLUDED_abacus_2fprotobuf_2fkind_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/repeated_field.h" // IWYU pragma: export +#include "google/protobuf/extension_set.h" // IWYU pragma: export +#include "google/protobuf/generated_enum_reflection.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" + +#define PROTOBUF_INTERNAL_EXPORT_abacus_2fprotobuf_2fkind_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_abacus_2fprotobuf_2fkind_2eproto { + static const ::uint32_t offsets[]; +}; +extern const ::google::protobuf::internal::DescriptorTable + descriptor_table_abacus_2fprotobuf_2fkind_2eproto; +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google + +namespace abacus { +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); +} + +// =================================================================== + + + +// =================================================================== + + + + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) +} // namespace protobuf +} // namespace abacus + + +namespace google { +namespace protobuf { + +template <> +struct is_proto_enum<::abacus::protobuf::Kind> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Kind>() { + return ::abacus::protobuf::Kind_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#include "google/protobuf/port_undef.inc" + +#endif // GOOGLE_PROTOBUF_INCLUDED_abacus_2fprotobuf_2fkind_2eproto_2epb_2eh diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index 32b39379..8174b252 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -322,7 +322,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT } // namespace protobuf } // namespace abacus static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[2]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( @@ -565,70 +565,73 @@ static const ::_pb::Message* const file_default_instances[] = { }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." - "protobuf\"\230\001\n\014UInt64Metric\022\023\n\013description" - "\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.K" - "ind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\004H\001\210\001\001" - "\022\020\n\003max\030\005 \001(\004H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_" - "max\"\227\001\n\013Int64Metric\022\023\n\013description\030\001 \001(\t" - "\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021\n" - "\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\003H\001\210\001\001\022\020\n\003ma" - "x\030\005 \001(\003H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\230\001" - "\n\014UInt32Metric\022\023\n\013description\030\001 \001(\t\022#\n\004k" - "ind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit" - "\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\rH\001\210\001\001\022\020\n\003max\030\005 \001" - "(\rH\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\227\001\n\013Int" - "32Metric\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 " - "\001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\t" - "H\000\210\001\001\022\020\n\003min\030\004 \001(\005H\001\210\001\001\022\020\n\003max\030\005 \001(\005H\002\210\001" - "\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\231\001\n\rFloat64Me" - "tric\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162" - "\025.abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001" - "\001\022\020\n\003min\030\004 \001(\001H\001\210\001\001\022\020\n\003max\030\005 \001(\001H\002\210\001\001B\007\n" - "\005_unitB\006\n\004_minB\006\n\004_max\"\231\001\n\rFloat32Metric" - "\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.ab" - "acus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n" - "\003min\030\004 \001(\002H\001\210\001\001\022\020\n\003max\030\005 \001(\002H\002\210\001\001B\007\n\005_un" - "itB\006\n\004_minB\006\n\004_max\"b\n\nBoolMetric\022\023\n\013desc" + "protobuf\032\032abacus/protobuf/kind.proto\"\230\001\n" + "\014UInt64Metric\022\023\n\013description\030\001 \001(\t\022#\n\004ki" + "nd\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030" + "\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\004H\001\210\001\001\022\020\n\003max\030\005 \001(" + "\004H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\227\001\n\013Int6" + "4Metric\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001" + "(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH" + "\000\210\001\001\022\020\n\003min\030\004 \001(\003H\001\210\001\001\022\020\n\003max\030\005 \001(\003H\002\210\001\001" + "B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\230\001\n\014UInt32Metr" + "ic\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025." + "abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022" + "\020\n\003min\030\004 \001(\rH\001\210\001\001\022\020\n\003max\030\005 \001(\rH\002\210\001\001B\007\n\005_" + "unitB\006\n\004_minB\006\n\004_max\"\227\001\n\013Int32Metric\022\023\n\013" + "description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus" + ".protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min" + "\030\004 \001(\005H\001\210\001\001\022\020\n\003max\030\005 \001(\005H\002\210\001\001B\007\n\005_unitB\006" + "\n\004_minB\006\n\004_max\"\231\001\n\rFloat64Metric\022\023\n\013desc" "ription\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.pro" - "tobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001B\007\n\005_unit\"C" - "\n\tEnumValue\022\014\n\004name\030\001 \001(\t\022\030\n\013description" - "\030\002 \001(\tH\000\210\001\001B\016\n\014_description\"\303\001\n\013Enum8Met" - "ric\022\023\n\013description\030\001 \001(\t\022\021\n\004unit\030\002 \001(\tH\000" - "\210\001\001\0228\n\006values\030\003 \003(\0132(.abacus.protobuf.En" - "um8Metric.ValuesEntry\032I\n\013ValuesEntry\022\013\n\003" - "key\030\001 \001(\r\022)\n\005value\030\002 \001(\0132\032.abacus.protob" - "uf.EnumValue:\0028\001B\007\n\005_unit\"\245\003\n\006Metric\022\016\n\006" - "offset\030\001 \001(\r\022/\n\006uint64\030\002 \001(\0132\035.abacus.pr" - "otobuf.UInt64MetricH\000\022-\n\005int64\030\003 \001(\0132\034.a" - "bacus.protobuf.Int64MetricH\000\022/\n\006uint32\030\004" - " \001(\0132\035.abacus.protobuf.UInt32MetricH\000\022-\n" - "\005int32\030\005 \001(\0132\034.abacus.protobuf.Int32Metr" - "icH\000\0221\n\007float64\030\006 \001(\0132\036.abacus.protobuf." - "Float64MetricH\000\0221\n\007float32\030\007 \001(\0132\036.abacu" - "s.protobuf.Float32MetricH\000\022.\n\007boolean\030\010 " - "\001(\0132\033.abacus.protobuf.BoolMetricH\000\022-\n\005en" - "um8\030\t \001(\0132\034.abacus.protobuf.Enum8MetricH" - "\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030\n\020protoco" - "l_version\030\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.ab" - "acus.protobuf.Endianness\022\022\n\nsync_value\030\003" - " \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus.protobuf." - "MetricsMetadata.MetricsEntry\032G\n\014MetricsE" - "ntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacu" - "s.protobuf.Metric:\0028\001*,\n\004Kind\022\013\n\007COUNTER" - "\020\000\022\014\n\010CONSTANT\020\001\022\t\n\005GAUGE\020\002*!\n\nEndiannes" - "s\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/protobu" - "fb\006proto3" + "tobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001" + "(\001H\001\210\001\001\022\020\n\003max\030\005 \001(\001H\002\210\001\001B\007\n\005_unitB\006\n\004_m" + "inB\006\n\004_max\"\231\001\n\rFloat32Metric\022\023\n\013descript" + "ion\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobu" + "f.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\002H\001" + "\210\001\001\022\020\n\003max\030\005 \001(\002H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006" + "\n\004_max\"b\n\nBoolMetric\022\023\n\013description\030\001 \001(" + "\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021" + "\n\004unit\030\003 \001(\tH\000\210\001\001B\007\n\005_unit\"C\n\tEnumValue\022" + "\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001\001B" + "\016\n\014_description\"\303\001\n\013Enum8Metric\022\023\n\013descr" + "iption\030\001 \001(\t\022\021\n\004unit\030\002 \001(\tH\000\210\001\001\0228\n\006value" + "s\030\003 \003(\0132(.abacus.protobuf.Enum8Metric.Va" + "luesEntry\032I\n\013ValuesEntry\022\013\n\003key\030\001 \001(\r\022)\n" + "\005value\030\002 \001(\0132\032.abacus.protobuf.EnumValue" + ":\0028\001B\007\n\005_unit\"\245\003\n\006Metric\022\016\n\006offset\030\001 \001(\r" + "\022/\n\006uint64\030\002 \001(\0132\035.abacus.protobuf.UInt6" + "4MetricH\000\022-\n\005int64\030\003 \001(\0132\034.abacus.protob" + "uf.Int64MetricH\000\022/\n\006uint32\030\004 \001(\0132\035.abacu" + "s.protobuf.UInt32MetricH\000\022-\n\005int32\030\005 \001(\013" + "2\034.abacus.protobuf.Int32MetricH\000\0221\n\007floa" + "t64\030\006 \001(\0132\036.abacus.protobuf.Float64Metri" + "cH\000\0221\n\007float32\030\007 \001(\0132\036.abacus.protobuf.F" + "loat32MetricH\000\022.\n\007boolean\030\010 \001(\0132\033.abacus" + ".protobuf.BoolMetricH\000\022-\n\005enum8\030\t \001(\0132\034." + "abacus.protobuf.Enum8MetricH\000B\006\n\004type\"\371\001" + "\n\017MetricsMetadata\022\030\n\020protocol_version\030\001 " + "\001(\r\022/\n\nendianness\030\002 \001(\0162\033.abacus.protobu" + "f.Endianness\022\022\n\nsync_value\030\003 \001(\007\022>\n\007metr" + "ics\030\004 \003(\0132-.abacus.protobuf.MetricsMetad" + "ata.MetricsEntry\032G\n\014MetricsEntry\022\013\n\003key\030" + "\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacus.protobuf.M" + "etric:\0028\001*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007\n\003B" + "IG\020\001B\021Z\017abacus/protobufb\006proto3" +}; +static const ::_pbi::DescriptorTable* const descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps[1] = + { + &::descriptor_table_abacus_2fprotobuf_2fkind_2eproto, }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2129, + 2111, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - nullptr, - 0, + descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps, + 1, 13, schemas, file_default_instances, @@ -657,23 +660,9 @@ PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_abacus_2fprotobuf_2fmetrics_2eproto(&descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto); namespace abacus { namespace protobuf { -const ::google::protobuf::EnumDescriptor* Kind_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto); - return file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[0]; -} -bool Kind_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; - } -} const ::google::protobuf::EnumDescriptor* Endianness_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto); - return file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; + return file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[0]; } bool Endianness_IsValid(int value) { switch (value) { diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index ba38ffb6..1a3af02e 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -36,6 +36,7 @@ #include "google/protobuf/map_field_inl.h" #include "google/protobuf/generated_enum_reflection.h" #include "google/protobuf/unknown_field_set.h" +#include "abacus/protobuf/kind.pb.h" // @@protoc_insertion_point(includes) // Must be included last. @@ -107,39 +108,6 @@ namespace protobuf { namespace abacus { 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 Endianness : int { LITTLE = 0, BIG = 1, @@ -5078,12 +5046,6 @@ inline ::google::protobuf::Map* Metrics namespace google { namespace protobuf { -template <> -struct is_proto_enum<::abacus::protobuf::Kind> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Kind>() { - return ::abacus::protobuf::Kind_descriptor(); -} template <> struct is_proto_enum<::abacus::protobuf::Endianness> : std::true_type {}; template <> diff --git a/src/abacus/protocol_version.cpp b/src/abacus/protocol_version.cpp index 556cd435..2a7c58f8 100644 --- a/src/abacus/protocol_version.cpp +++ b/src/abacus/protocol_version.cpp @@ -12,7 +12,7 @@ inline namespace STEINWURF_ABACUS_VERSION { uint8_t protocol_version() { - return 1; + return 2; } } } diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index c18fc2ec..0a303161 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -12,18 +12,19 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -auto to_json(const view& view, bool minimal) -> std::string +auto to_json(const view2& view, bool minimal) -> std::string { bourne::json json = detail::to_json(view, minimal); return json.dump(); } -auto to_json(const uint8_t* meta_data, const uint8_t* value_data, bool minimal) - -> std::string +auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, + const uint8_t* value_data, std::size_t value_bytes, + bool minimal) -> std::string { - view v; - v.set_meta_data(meta_data); - v.set_value_data(value_data); + view2 v; + v.set_meta_data(metadata_data, metadata_bytes); + v.set_value_data(value_data, value_bytes); return to_json(v, minimal); } } diff --git a/src/abacus/to_json.hpp b/src/abacus/to_json.hpp index 6b8b55f2..abd9650e 100644 --- a/src/abacus/to_json.hpp +++ b/src/abacus/to_json.hpp @@ -8,7 +8,7 @@ #include #include "version.hpp" -#include "view.hpp" +#include "view2.hpp" namespace abacus { @@ -20,13 +20,14 @@ inline namespace STEINWURF_ABACUS_VERSION /// @param value_data The value data of the metrics view. /// @param minimal If true, the JSON will be slimmed down to only contain the /// the value data. -auto to_json(const uint8_t* meta_data, const uint8_t* value_data, +auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, + const uint8_t* value_data, std::size_t value_bytes, bool minimal = false) -> std::string; /// @return a JSON-formatted string of a single views data. /// @param view A view with access to metrics-data. /// @param minimal If true, the JSON will be slimmed down to only contain the /// the value data. -auto to_json(const view& view, bool minimal = false) -> std::string; +auto to_json(const view2& view, bool minimal = false) -> std::string; } } diff --git a/src/abacus/type2.hpp b/src/abacus/type2.hpp index 91d4f4b8..5e57d56f 100644 --- a/src/abacus/type2.hpp +++ b/src/abacus/type2.hpp @@ -12,16 +12,16 @@ #include #include -#include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "protobuf/kind.pb.h" #include "unit.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -namespace +namespace detail { template struct common @@ -72,6 +72,8 @@ struct common auto set_value(type value) -> void { assert(is_initialized()); + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); m_memory[0] = 1; std::memcpy(m_memory + 1, &value, sizeof(value)); } @@ -93,6 +95,8 @@ struct common { assert(has_value()); auto new_value = this->value() + value; + assert(!std::isnan(new_value) && "Cannot assign a NaN"); + assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); return (metric&)*this; } @@ -104,6 +108,8 @@ struct common { assert(has_value()); auto new_value = this->value() - value; + assert(!std::isnan(new_value) && "Cannot assign a NaN"); + assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); return (metric&)*this; } @@ -133,90 +139,92 @@ struct common }; } +using kind = protobuf::Kind; + struct uint64 { using type = uint64_t; - struct metric : public common + struct metric : public detail::common { - using common::common; - using common::operator=; + using detail::common::common; + using detail::common::operator=; }; abacus::kind kind; std::string description; - abacus::unit unit; - abacus::min2 min; - abacus::max2 max; + abacus::unit unit{}; + abacus::min2 min{}; + abacus::max2 max{}; }; struct int64 { using type = int64_t; - struct metric : public common + struct metric : public detail::common { - using common::common; - using common::operator=; + using detail::common::common; + using detail::common::operator=; }; abacus::kind kind; std::string description; - abacus::unit unit; - abacus::min2 min; - abacus::max2 max; + abacus::unit unit{}; + abacus::min2 min{}; + abacus::max2 max{}; }; struct uint32 { using type = uint32_t; - struct metric : public common + struct metric : public detail::common { - using common::common; - using common::operator=; + using detail::common::common; + using detail::common::operator=; }; abacus::kind kind; std::string description; - abacus::unit unit; - abacus::min2 min; - abacus::max2 max; + abacus::unit unit{}; + abacus::min2 min{}; + abacus::max2 max{}; }; struct int32 { using type = int32_t; - struct metric : public common + struct metric : public detail::common { - using common::common; - using common::operator=; + using detail::common::common; + using detail::common::operator=; }; abacus::kind kind; std::string description; - abacus::unit unit; - abacus::min2 min; - abacus::max2 max; + abacus::unit unit{}; + abacus::min2 min{}; + abacus::max2 max{}; }; struct float64 { using type = double; - struct metric : public common + struct metric : public detail::common { - using common::common; - using common::operator=; + using detail::common::common; + using detail::common::operator=; }; abacus::kind kind; std::string description; - abacus::unit unit; - abacus::min2 min; - abacus::max2 max; + abacus::unit unit{}; + abacus::min2 min{}; + abacus::max2 max{}; }; struct float32 { using type = float; - struct metric : public common + struct metric : public detail::common { - using common::common; - using common::operator=; + using detail::common::common; + using detail::common::operator=; }; abacus::kind kind; std::string description; - abacus::unit unit; - abacus::min2 min; - abacus::max2 max; + abacus::unit unit{}; + abacus::min2 min{}; + abacus::max2 max{}; }; struct boolean { @@ -356,7 +364,7 @@ struct enum8 }; std::string description; std::map values; - abacus::unit unit; + abacus::unit unit{}; }; using type2 = std::variant; diff --git a/src/abacus/view2.hpp b/src/abacus/view2.hpp index 4eccffd9..716bd955 100644 --- a/src/abacus/view2.hpp +++ b/src/abacus/view2.hpp @@ -14,7 +14,6 @@ #include #include "detail/hash_function.hpp" -#include "kind.hpp" #include "max.hpp" #include "min.hpp" #include "protobuf/metrics.pb.h" @@ -44,21 +43,17 @@ inline namespace STEINWURF_ABACUS_VERSION class view2 { public: - void set_data(const uint8_t* data, std::size_t bytes) - { - } - /// Sets the meta data pointer /// @param meta_data The meta data pointer - void set_meta_data(const uint8_t* metadata_ptr, std::size_t meta_bytes) + void set_meta_data(const uint8_t* metadata_data, std::size_t metadata_bytes) { - assert(metadata_ptr != nullptr); - m_metadata_ptr = metadata_ptr; - m_meta_bytes = meta_bytes; + assert(metadata_data != nullptr); + m_metadata_data = metadata_data; + m_metadata_bytes = metadata_bytes; m_value_data = nullptr; m_value_bytes = 0; - m_metadata.ParseFromArray(metadata_ptr, meta_bytes); + m_metadata.ParseFromArray(metadata_data, metadata_bytes); } /// Sets the value data pointer @@ -67,11 +62,22 @@ class view2 auto set_value_data(const uint8_t* value_data, std::size_t value_bytes) -> bool { - assert(m_metadata_ptr != nullptr); + assert(m_metadata_data != nullptr); assert(value_data != nullptr); // Check that the hash is correct - auto value_data_hash = detail::hash_function(value_data, value_bytes); + uint32_t value_data_hash = 0; + switch (m_metadata.endianness()) + { + case protobuf::Endianness::BIG: + endian::big_endian::get(value_data_hash, value_data); + break; + case protobuf::Endianness::LITTLE: + endian::little_endian::get(value_data_hash, value_data); + break; + default: + assert(false); + } if (m_metadata.sync_value() != value_data_hash) { @@ -82,9 +88,9 @@ class view2 return true; } - auto metadata_ptr() const -> const uint8_t* + auto metadata_data() const -> const uint8_t* { - return m_metadata_ptr; + return m_metadata_data; } /// Gets the value data pointer @@ -96,9 +102,9 @@ class view2 /// Gets the meta data size in bytes /// @return The meta data size in bytes - std::size_t meta_bytes() const + std::size_t metadata_bytes() const { - return m_meta_bytes; + return m_metadata_bytes; } /// Gets the value data size in bytes @@ -118,7 +124,7 @@ class view2 value(const std::string& name) const -> std::optional { assert(m_value_data != nullptr); - assert(m_metadata_ptr != nullptr); + assert(m_metadata_data != nullptr); auto endianness = m_metadata.endianness(); @@ -153,8 +159,8 @@ class view2 private: /// The meta data pointer - const uint8_t* m_metadata_ptr; - std::size_t m_meta_bytes; + const uint8_t* m_metadata_data; + std::size_t m_metadata_bytes; protobuf::MetricsMetadata m_metadata; diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index e3b361a5..ed278079 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -8,62 +8,59 @@ #include #include -#include +#include + TEST(test_metric, constructor) { - uint64_t uint_count = 10000U; + uint8_t data[9] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - abacus::metric uint_metric(&uint_count); + abacus::uint64::metric uint_metric(data); EXPECT_TRUE(uint_metric.is_initialized()); - - int64_t int_count = 10000; - abacus::metric int_metric(&int_count); - EXPECT_TRUE(int_metric.is_initialized()); - - double double_count = 1123.12; - abacus::metric double_metric(&double_count); - EXPECT_TRUE(double_metric.is_initialized()); - - bool bool_count = true; - abacus::metric bool_metric(&bool_count); - EXPECT_TRUE(bool_metric.is_initialized()); + EXPECT_FALSE(uint_metric.has_value()); + uint_metric = 42U; + EXPECT_TRUE(uint_metric.has_value()); + EXPECT_EQ(uint_metric.value(), 42U); } +/* +TEST(test_metric, float_assignment) +{ + uint8_t data[9] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -// TEST(test_metric, float_assignment) -// { -// double double_count = 1123.12; -// abacus::metric double_metric(&double_count); -// EXPECT_TRUE(double_metric.is_initialized()); -// EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); + abacus::float64::metric double_metric(data); + EXPECT_TRUE(double_metric.is_initialized()); + EXPECT_FALSE(double_metric.has_value()); + double_metric = 1123.12; + EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); -// // Assignment -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / -0.0, ""); + // Assignment + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric = 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric = 1 / -0.0, ""); -// // Add and Assign -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric += 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric += 1 / -0.0, ""); + // Add and Assign + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric += 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric += 1 / -0.0, ""); -// // Subtract and Assign -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); -// } + // Subtract and Assign + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +} +*/ diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 63b7808a..bbab6000 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include #include @@ -32,21 +34,19 @@ TEST(test_metrics, default_constructor) std::string name5 = "metric5"; std::map infos = { - {name0, abacus::boolean{abacus::kind::counter, "A boolean metric"}}, + {name0, abacus::boolean{abacus::kind::COUNTER, "A boolean metric"}}, {name1, - abacus::uint64{abacus::kind::counter, "An unsigned integer metric", + abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, - {name2, abacus::int64{abacus::kind::gauge, "A signed integer metric", + {name2, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", abacus::unit{"USD"}}}, - {name3, abacus::float64{abacus::kind::gauge, "A floating point metric", + {name3, abacus::float64{abacus::kind::GAUGE, "A floating point metric", abacus::unit{"ms"}}}, {name4, - abacus::boolean{abacus::kind::constant, "A constant boolean metric "}}, - {name5, abacus::float64{abacus::kind::constant, + abacus::boolean{abacus::kind::CONSTANT, "A constant boolean metric"}}, + {name5, abacus::float64{abacus::kind::CONSTANT, "A constant floating point metric", - abacus::unit{"ms"}}} - - }; + abacus::unit{"ms"}}}}; abacus::metrics2 from_metrics(infos); abacus::metrics2 metrics(std::move(from_metrics)); @@ -54,258 +54,254 @@ TEST(test_metrics, default_constructor) EXPECT_EQ(metrics.metadata().protocol_version(), abacus::protocol_version()); - EXPECT_EQ(metrics.metadata().metrics().at(name0).uint64().kind(), - abacus::protobuf::Kind::COUNTER); - // EXPECT_EQ(metrics.kind(1), abacus::kind::gauge); - // EXPECT_EQ(metrics.kind(2), abacus::kind::gauge); - // EXPECT_EQ(metrics.kind(3), abacus::kind::constant); - // EXPECT_EQ(metrics.kind(4), abacus::kind::counter); - // EXPECT_EQ(metrics.kind(5), abacus::kind::constant); -} -/* - - EXPECT_FALSE(metrics.is_initialized(0)); - auto metric0 = metrics.initialize_metric(name1); - EXPECT_TRUE(metrics.is_initialized(0)); - - EXPECT_FALSE(metrics.is_initialized(1)); - auto metric1 = metrics.initialize_metric(name2); - EXPECT_TRUE(metrics.is_initialized(1)); - - EXPECT_FALSE(metrics.is_initialized(2)); - auto metric2 = metrics.initialize_metric(name3); - EXPECT_TRUE(metrics.is_initialized(2)); - - EXPECT_FALSE(metrics.is_initialized(4)); - auto metric3 = metrics.initialize_metric(name0); - EXPECT_TRUE(metrics.is_initialized(4)); - - EXPECT_FALSE(metrics.is_initialized(5)); - metrics.initialize_constant(name4, true); - EXPECT_TRUE(metrics.is_initialized(5)); - - EXPECT_FALSE(metrics.is_initialized(3)); - metrics.initialize_constant(name5, 42.42); - EXPECT_TRUE(metrics.is_initialized(3)); - - EXPECT_EQ(metrics.name(0), name1); - EXPECT_EQ(metrics.name(1), name2); - EXPECT_EQ(metrics.name(2), name3); - EXPECT_EQ(metrics.name(4), name0); - EXPECT_EQ(metrics.name(5), name4); - - EXPECT_EQ(metrics.description(0), "An unsigned integer metric"); - EXPECT_EQ(metrics.description(1), "A signed integer metric"); - EXPECT_EQ(metrics.description(2), "A floating point metric"); - EXPECT_EQ(metrics.description(3), "A constant floating point metric"); - EXPECT_EQ(metrics.description(4), "A boolean metric"); - EXPECT_EQ(metrics.description(5), "A constant boolean metric"); - - EXPECT_EQ(metrics.unit(0), "bytes"); - EXPECT_EQ(metrics.unit(1), "USD"); - EXPECT_EQ(metrics.unit(2), "ms"); - EXPECT_EQ(metrics.unit(3), "ms"); - EXPECT_EQ(metrics.unit(4), ""); - EXPECT_EQ(metrics.unit(5), ""); - + EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().kind(), + abacus::kind::COUNTER); + EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().description(), + "A boolean metric"); + EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().unit(), + ""); // empty unit + + EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().kind(), + abacus::kind::COUNTER); + EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().description(), + "An unsigned integer metric"); + EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().unit(), "bytes"); + + EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().kind(), + abacus::kind::GAUGE); + EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().description(), + "A signed integer metric"); + EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().unit(), "USD"); + + EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().kind(), + abacus::kind::GAUGE); + EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().description(), + "A floating point metric"); + EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().unit(), "ms"); + + EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().kind(), + abacus::kind::CONSTANT); + EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().description(), + "A constant boolean metric"); + EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().unit(), + ""); // empty unit + + EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().kind(), + abacus::kind::CONSTANT); + EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().description(), + "A constant floating point metric"); + EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().unit(), "ms"); + + EXPECT_FALSE(metrics.is_initialized()); + EXPECT_FALSE(metrics.is_initialized(name1)); + auto metric0 = metrics.initialize_metric(name1, 9000U); + EXPECT_TRUE(metrics.is_initialized(name1)); + + EXPECT_FALSE(metrics.is_initialized()); + EXPECT_FALSE(metrics.is_initialized(name2)); + auto metric1 = metrics.initialize_metric(name2); + EXPECT_TRUE(metrics.is_initialized(name2)); + + EXPECT_FALSE(metrics.is_initialized()); + EXPECT_FALSE(metrics.is_initialized(name3)); + auto metric2 = metrics.initialize_metric(name3); + EXPECT_TRUE(metrics.is_initialized(name3)); + + EXPECT_FALSE(metrics.is_initialized()); + EXPECT_FALSE(metrics.is_initialized(name0)); + auto metric3 = metrics.initialize_metric(name0); + EXPECT_TRUE(metrics.is_initialized(name0)); + + EXPECT_FALSE(metrics.is_initialized()); + EXPECT_FALSE(metrics.is_initialized(name4)); + metrics.initialize_constant(name4, true); + EXPECT_TRUE(metrics.is_initialized(name4)); + + EXPECT_FALSE(metrics.is_initialized()); + EXPECT_FALSE(metrics.is_initialized(name5)); + metrics.initialize_constant(name5, 42.42); + EXPECT_TRUE(metrics.is_initialized(name5)); + + EXPECT_TRUE(metrics.is_initialized()); + + EXPECT_TRUE(metric0.has_value()); + EXPECT_EQ(metric0.value(), 9000U); metric0 = 4U; - metric1 = -4; - metric2 = 3.14; - metric3 = true; - - uint64_t uint_value = 0U; - int64_t int_value = 0; - double float_value = 0.0; - bool bool_value = false; - - metrics.value(0, uint_value); - EXPECT_EQ(uint_value, 4U); - - metrics.value(1, int_value); - EXPECT_EQ(int_value, -4); - - metrics.value(2, float_value); - EXPECT_EQ(float_value, 3.14); - - metrics.value(3, float_value); - EXPECT_EQ(float_value, 42.42); + EXPECT_TRUE(metric0.has_value()); + EXPECT_EQ(metric0.value(), 4U); - metrics.value(4, bool_value); - EXPECT_EQ(bool_value, true); + EXPECT_FALSE(metric1.has_value()); + metric1 = -4; + EXPECT_TRUE(metric1.has_value()); + EXPECT_EQ(metric1.value(), -4); - metrics.value(5, bool_value); - EXPECT_EQ(bool_value, true); + EXPECT_FALSE(metric2.has_value()); + metric2 = 3.14; + EXPECT_TRUE(metric2.has_value()); + EXPECT_EQ(metric2.value(), 3.14); - EXPECT_EQ(metrics.index(name0), 4U); - EXPECT_EQ(metrics.index(name1), 0U); - EXPECT_EQ(metrics.index(name2), 1U); - EXPECT_EQ(metrics.index(name3), 2U); - EXPECT_EQ(metrics.index(name4), 5U); - EXPECT_EQ(metrics.index(name5), 3U); + EXPECT_FALSE(metric3.has_value()); + metric3 = true; + EXPECT_TRUE(metric3.has_value()); + EXPECT_EQ(metric3.value(), true); } -*/ -/* -TEST(test_metrics, value_and_meta_bytes) -{ - const uint16_t metric_count = 2; +TEST(test_metrics, value_and_metadata_bytes) +{ std::string name0 = "metric0"; std::string name1 = "metric1"; - abacus::metric_info infos[metric_count] = { - abacus::metric_info{name0, "An unsigned integer metric", - abacus::type::uint64, abacus::kind::counter, - abacus::unit{"bytes"}}, - abacus::metric_info{name1, "A signed integer metric", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"USD"}}}; + std::map infos = { + {name0, + abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::unit{"bytes"}}}, + {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}}; - abacus::metrics metrics(infos); + abacus::metrics2 metrics{infos}; - metrics.initialize_metric(name0); - metrics.initialize_metric(name1); + metrics.initialize_metric(name0); + metrics.initialize_metric(name1); - EXPECT_EQ(metrics.meta_bytes(), 128U); - EXPECT_EQ(metrics.value_bytes(), 16U); + EXPECT_EQ(metrics.metadata_bytes(), 108U); + EXPECT_EQ(metrics.value_bytes(), + sizeof(uint32_t) + // hash + 1 + sizeof(uint64_t) + // metric0 has_value + value + 1 + sizeof(int64_t) // metric1 has_value + value + ); } - TEST(test_metrics, reset_counters) { std::string name0 = "metric0"; std::string name1 = "metric1"; - abacus::metric_info infos[2] = { - abacus::metric_info{name0, "An unsigned integer metric", - abacus::type::uint64, abacus::kind::counter, - abacus::unit{"bytes"}}, - abacus::metric_info{name1, "A signed integer metric", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"USD"}}}; - - abacus::metrics metrics(infos); + std::map infos = { + {name0, + abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::unit{"bytes"}}}, + {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}}; - auto uint_metric = metrics.initialize_metric(name0); - auto int_metric = metrics.initialize_metric(name1); + abacus::metrics2 metrics{infos}; - uint64_t uint_value = 0U; - int64_t int_value = 0; + auto uint_metric = metrics.initialize_metric(name0); + auto int_metric = metrics.initialize_metric(name1); + EXPECT_FALSE(uint_metric.has_value()); + EXPECT_FALSE(int_metric.has_value()); uint_metric = 4U; int_metric = -4; - metrics.value(0, uint_value); - metrics.value(1, int_value); - - EXPECT_EQ(uint_value, 4U); - EXPECT_EQ(int_value, -4); + EXPECT_TRUE(uint_metric.has_value()); + EXPECT_TRUE(int_metric.has_value()); + EXPECT_EQ(uint_metric.value(), 4U); + EXPECT_EQ(int_metric.value(), -4); - metrics.reset_metric(0); - metrics.reset_metric(1); - - metrics.value(0, uint_value); - metrics.value(1, int_value); + metrics.reset_metrics(); - EXPECT_EQ(uint_value, 0U); - EXPECT_EQ(int_value, 0); + EXPECT_FALSE(uint_metric.has_value()); + EXPECT_FALSE(int_metric.has_value()); uint_metric = 4U; int_metric = -4; - metrics.value(0, uint_value); - metrics.value(1, int_value); - - EXPECT_EQ(uint_value, 4U); - EXPECT_EQ(int_value, -4); - - metrics.reset_metrics(); - - metrics.value(0, uint_value); - metrics.value(1, int_value); - - EXPECT_EQ(uint_value, 0U); - EXPECT_EQ(int_value, 0); + EXPECT_TRUE(uint_metric.has_value()); + EXPECT_TRUE(int_metric.has_value()); + EXPECT_EQ(uint_metric.value(), 4U); + EXPECT_EQ(int_metric.value(), -4); } static const std::vector expected_meta_data = { - 0x00, 0x01, 0x1c, 0x00, 0x58, 0x00, 0x0a, 0x00, 0x03, 0x00, 0x01, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x1a, 0x00, 0x17, 0x00, - 0x17, 0x00, 0x10, 0x00, 0x05, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x31, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x33, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, + 0x08, 0x02, 0x1d, 0x31, 0x5c, 0x0a, 0x3f, 0x22, 0x32, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x27, 0x08, 0x04, 0x12, 0x23, + 0x0a, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x1a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, + 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, 0x12, 0x24, + 0x08, 0x0d, 0x1a, 0x20, 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, - 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, - 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x55, 0x53, 0x44, 0x6d, 0x73, 0x00, 0x01, 0x02, 0x03, 0x00, 0x02, - 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; + 0x65, 0x74, 0x72, 0x69, 0x63, 0x10, 0x02, 0x1a, 0x03, 0x55, 0x53, 0x44, + 0x22, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, + 0x23, 0x08, 0x16, 0x32, 0x1f, 0x0a, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, + 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x10, 0x02, 0x1a, 0x02, 0x6d, 0x73, + 0x22, 0x23, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, + 0x18, 0x08, 0x1f, 0x42, 0x14, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, + 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x10, + 0x02}; static const std::vector expected_value_data = { - 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0x61, 0x40, 0x01, 0x0f}; + 0x31, 0x5c, 0x0a, 0x3f, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x40, 0x01, 0x01, +}; + +namespace google::protobuf::internal +{ +// Note: This method must be named exactly MapTestForceDeterministic to be able +// to call the SetDefaultSerializationDeterministic method as a friend function. +void MapTestForceDeterministic() +{ + // This function is used to force deterministic serialization for the + // map. This is used to make the test more stable and we can compare + // the serialized metadata. + io::CodedOutputStream::SetDefaultSerializationDeterministic(); +} +} TEST(test_metrics, protocol_version) { + // Force deterministic serialization + google::protobuf::internal::MapTestForceDeterministic(); + ASSERT_TRUE(google::protobuf::io::CodedOutputStream:: + IsDefaultSerializationDeterministic()); + SCOPED_TRACE(::testing::Message() << "protocol version: " << abacus::protocol_version()); SCOPED_TRACE( ::testing::Message() << "If this test fails, you need to update the protocol version"); - abacus::metric_info infos[4] = { - abacus::metric_info{"metric0", "An unsigned integer metric", - abacus::type::uint64, abacus::kind::counter, - abacus::unit{"bytes"}}, - abacus::metric_info{"metric1", "A signed integer metric", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"USD"}}, - abacus::metric_info{"metric2", "A floating point metric", - abacus::type::float64, abacus::kind::gauge, - abacus::unit{"ms"}}, - abacus::metric_info{"metric3", "A boolean metric", - abacus::type::boolean, abacus::kind::gauge}}; - - abacus::metrics metrics(infos); + std::map infos = { + {"metric0", + abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::unit{"bytes"}}}, + {"metric1", + abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}, + {"metric2", + abacus::float64{abacus::kind::GAUGE, "A floating point metric", + abacus::unit{"ms"}}}, + {"metric3", abacus::boolean{abacus::kind::GAUGE, "A boolean metric"}}}; + + abacus::metrics2 metrics(infos); auto uint_metric = - metrics.initialize_metric("metric0"); - auto int_metric = metrics.initialize_metric("metric1"); + metrics.initialize_metric("metric0", 42U); + auto int_metric = metrics.initialize_metric("metric1", -42); auto float_metric = - metrics.initialize_metric("metric2"); + metrics.initialize_metric("metric2", 142.0); auto bool_metric = - metrics.initialize_metric("metric3"); - uint_metric = 42U; - int_metric = -42; - float_metric = 142.0; - bool_metric = true; - - EXPECT_EQ(metrics.meta_bytes(), expected_meta_data.size()); - EXPECT_EQ(metrics.value_bytes(), expected_value_data.size()); + metrics.initialize_metric("metric3", true); + EXPECT_EQ(metrics.metadata_bytes(), expected_meta_data.size()); { // Print the metadata as hex std::stringstream meta_stream; meta_stream << std::hex; - for (std::size_t i = 0; i < metrics.meta_bytes(); ++i) + for (std::size_t i = 0; i < metrics.metadata_bytes(); ++i) { meta_stream << "0x" << std::setw(2) << std::setfill('0') - << static_cast(metrics.meta_data()[i]) << ", "; + << static_cast(metrics.metadata_data()[i]) << ", "; } SCOPED_TRACE(::testing::Message() << "Meta data:\n" << meta_stream.str()); - EXPECT_EQ( - expected_meta_data, - std::vector(metrics.meta_data(), - metrics.meta_data() + metrics.meta_bytes())); + EXPECT_EQ(expected_meta_data, + std::vector(metrics.metadata_data(), + metrics.metadata_data() + + metrics.metadata_bytes())); } + + EXPECT_EQ(metrics.value_bytes(), expected_value_data.size()); + { std::stringstream value_stream; value_stream << std::hex; @@ -322,4 +318,3 @@ TEST(test_metrics, protocol_version) metrics.value_data() + metrics.value_bytes())); } } -*/ diff --git a/test/src/test_metrics2.cpp b/test/src/test_metrics2.cpp deleted file mode 100644 index 979a31f4..00000000 --- a/test/src/test_metrics2.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst -// file. - -#include -#include - -#include - -TEST(test_metrics2, empty) -{ - abacus::metrics2 metrics2; - EXPECT_TRUE(metrics2.is_initialized()); -} - -TEST(test_metrics2, default_constructor) -{ - const uint16_t metric_count = 6; - - std::string name0 = "metric0"; - std::string name1 = "metric1"; - std::string name2 = "metric2"; - std::string name3 = "metric3"; - std::string name4 = "metric4"; - std::string name5 = "metric5"; - - std::map infos = { - {name0, abacus::boolean{abacus::kind::counter, "A boolean metric"}}, - {name1, - abacus::uint32{abacus::kind::counter, "An unsigned integer metric"}}, - {name2, abacus::int32{abacus::kind::gauge, "A signed integer metric"}}, - {name3, - abacus::float32{abacus::kind::gauge, "A floating point metric"}}, - {name4, - abacus::boolean{abacus::kind::constant, "A constant boolean metric"}}, - {name5, abacus::float64{abacus::kind::constant, - "A constant floating point metric"}}}; - - abacus::metrics2 metrics(infos); - - EXPECT_FALSE(metrics.is_initialized()); - - auto m0 = metrics.initialize_metric(name0); - auto m1 = metrics.initialize_metric(name1); - auto m2 = metrics.initialize_metric(name2); - auto m3 = metrics.initialize_metric(name3); - metrics.initialize_constant(name4, true); - metrics.initialize_constant(name5, 42.42); - - EXPECT_TRUE(metrics.is_initialized()); -} diff --git a/test/src/test_raw.cpp b/test/src/test_raw.cpp deleted file mode 100644 index 137356be..00000000 --- a/test/src/test_raw.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst -// file. - -#include -#include - -#include -#include - -TEST(test_raw, header_data) -{ - using namespace abacus; - - // The header data is 10 bytes - EXPECT_EQ(detail::header_bytes(), 12U); - - // The first byte is the is_big_endian flag - EXPECT_EQ(detail::is_big_endian_byte_offset(), 0U); - - // The second byte is the protocol version - EXPECT_EQ(detail::protocol_version_offset(), 1U); -} - -TEST(test_raw, meta_data) -{ - const uint16_t metric_count = 6; - - std::string name0 = "metric0"; - std::string name1 = "metric1"; - std::string name2 = "metric2"; - std::string name3 = "metric3"; - std::string name4 = "metric4"; - std::string name5 = "metric5"; - - std::string desc0 = "A boolean metric"; - std::string desc1 = "An unsigned integer metric"; - std::string desc2 = "A signed integer metric"; - std::string desc3 = "A floating point metric"; - std::string desc4 = "A constant boolean metric"; - std::string desc5 = "A constant floating point metric"; - - abacus::type type0 = abacus::type::boolean; - abacus::type type1 = abacus::type::uint64; - abacus::type type2 = abacus::type::int64; - abacus::type type3 = abacus::type::float64; - abacus::type type4 = abacus::type::boolean; - abacus::type type5 = abacus::type::float64; - - abacus::kind kind0 = abacus::kind::gauge; - abacus::kind kind1 = abacus::kind::counter; - abacus::kind kind2 = abacus::kind::counter; - abacus::kind kind3 = abacus::kind::gauge; - abacus::kind kind4 = abacus::kind::constant; - abacus::kind kind5 = abacus::kind::constant; - - abacus::unit unit1 = abacus::unit{"bytes"}; - abacus::unit unit2 = abacus::unit{"USD"}; - abacus::unit unit3 = abacus::unit{"ms"}; - abacus::unit unit5 = abacus::unit{"us"}; - - abacus::metric_info infos[metric_count] = { - abacus::metric_info{name0, desc0, type0, kind0}, - abacus::metric_info{name1, desc1, type1, kind1, unit1}, - abacus::metric_info{name2, desc2, type2, kind2, unit2}, - abacus::metric_info{name3, desc3, type3, kind3, unit3}, - abacus::metric_info{name4, desc4, type4, kind4}, - abacus::metric_info{name5, desc5, type5, kind5, unit5}}; - - abacus::metrics metrics(infos); - - auto meta_data = metrics.meta_data(); - - EXPECT_EQ(4U, abacus::detail::eight_byte_count(meta_data)); - EXPECT_EQ(2U, abacus::detail::one_byte_count(meta_data)); - - EXPECT_EQ(metric_count, abacus::detail::metric_count(meta_data)); - - EXPECT_EQ(name1.size(), abacus::detail::name_size(meta_data, 0)); - EXPECT_EQ(name2.size(), abacus::detail::name_size(meta_data, 1)); - EXPECT_EQ(name3.size(), abacus::detail::name_size(meta_data, 2)); - EXPECT_EQ(name5.size(), abacus::detail::name_size(meta_data, 3)); - EXPECT_EQ(name0.size(), abacus::detail::name_size(meta_data, 4)); - EXPECT_EQ(name4.size(), abacus::detail::name_size(meta_data, 5)); - - EXPECT_EQ(desc1.size(), abacus::detail::description_size(meta_data, 0)); - EXPECT_EQ(desc2.size(), abacus::detail::description_size(meta_data, 1)); - EXPECT_EQ(desc3.size(), abacus::detail::description_size(meta_data, 2)); - EXPECT_EQ(desc5.size(), abacus::detail::description_size(meta_data, 3)); - EXPECT_EQ(desc0.size(), abacus::detail::description_size(meta_data, 4)); - EXPECT_EQ(desc4.size(), abacus::detail::description_size(meta_data, 5)); - - EXPECT_EQ(type1, abacus::detail::type(meta_data, 0)); - EXPECT_EQ(type2, abacus::detail::type(meta_data, 1)); - EXPECT_EQ(type3, abacus::detail::type(meta_data, 2)); - EXPECT_EQ(type5, abacus::detail::type(meta_data, 3)); - EXPECT_EQ(type0, abacus::detail::type(meta_data, 4)); - EXPECT_EQ(type4, abacus::detail::type(meta_data, 5)); - - EXPECT_EQ(kind1, abacus::detail::kind(meta_data, 0)); - EXPECT_EQ(kind2, abacus::detail::kind(meta_data, 1)); - EXPECT_EQ(kind3, abacus::detail::kind(meta_data, 2)); - EXPECT_EQ(kind5, abacus::detail::kind(meta_data, 3)); - EXPECT_EQ(kind0, abacus::detail::kind(meta_data, 4)); - EXPECT_EQ(kind4, abacus::detail::kind(meta_data, 5)); - - EXPECT_EQ(name1, std::string(abacus::detail::name(meta_data, 0), - abacus::detail::name_size(meta_data, 0))); - EXPECT_EQ(name2, std::string(abacus::detail::name(meta_data, 1), - abacus::detail::name_size(meta_data, 1))); - EXPECT_EQ(name3, std::string(abacus::detail::name(meta_data, 2), - abacus::detail::name_size(meta_data, 2))); - EXPECT_EQ(name5, std::string(abacus::detail::name(meta_data, 3), - abacus::detail::name_size(meta_data, 3))); - EXPECT_EQ(name0, std::string(abacus::detail::name(meta_data, 4), - abacus::detail::name_size(meta_data, 4))); - EXPECT_EQ(name4, std::string(abacus::detail::name(meta_data, 5), - abacus::detail::name_size(meta_data, 5))); - - EXPECT_EQ(desc1, - std::string(abacus::detail::description(meta_data, 0), - abacus::detail::description_size(meta_data, 0))); - EXPECT_EQ(desc2, - std::string(abacus::detail::description(meta_data, 1), - abacus::detail::description_size(meta_data, 1))); - EXPECT_EQ(desc3, - std::string(abacus::detail::description(meta_data, 2), - abacus::detail::description_size(meta_data, 2))); - EXPECT_EQ(desc5, - std::string(abacus::detail::description(meta_data, 3), - abacus::detail::description_size(meta_data, 3))); - EXPECT_EQ(desc0, - std::string(abacus::detail::description(meta_data, 4), - abacus::detail::description_size(meta_data, 4))); - EXPECT_EQ(desc4, - std::string(abacus::detail::description(meta_data, 5), - abacus::detail::description_size(meta_data, 5))); - - EXPECT_EQ(unit1.value, - std::string(abacus::detail::unit(meta_data, 0), - abacus::detail::unit_size(meta_data, 0))); - EXPECT_EQ(unit2.value, - std::string(abacus::detail::unit(meta_data, 1), - abacus::detail::unit_size(meta_data, 1))); - EXPECT_EQ(unit3.value, - std::string(abacus::detail::unit(meta_data, 2), - abacus::detail::unit_size(meta_data, 2))); - EXPECT_EQ(unit5.value, - std::string(abacus::detail::unit(meta_data, 3), - abacus::detail::unit_size(meta_data, 3))); - EXPECT_EQ("", std::string(abacus::detail::unit(meta_data, 4), - abacus::detail::unit_size(meta_data, 4))); - EXPECT_EQ("", std::string(abacus::detail::unit(meta_data, 5), - abacus::detail::unit_size(meta_data, 5))); -} diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index e6312dc5..52f1c1d4 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -7,9 +7,9 @@ #include #include -#include +#include #include -#include +#include #include @@ -35,7 +35,7 @@ static const char* expected_json = R"({ "kind" : "constant", "value" : true }, - "protocol_version" : 1 + "protocol_version" : 2 })"; static const char* expected_json_slim = R"({ @@ -50,30 +50,25 @@ TEST(test_to_json, api) std::string name1 = "metric1"; std::string name2 = "metric2"; - abacus::metric_info infos[3] = { - abacus::metric_info{name0, "An unsigned integer metric", - abacus::type::uint64, abacus::kind::counter, - abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, - abacus::max{uint64_t{100U}}}, - abacus::metric_info{name1, "A signed integer metric", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"USD"}, abacus::min{int64_t{-100}}, - abacus::max{int64_t{100}}}, - abacus::metric_info{name2, "A boolean constant", abacus::type::boolean, - abacus::kind::constant}}; + std::map infos = { + {name0, + abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::unit{"bytes"}, abacus::min2{uint64_t{0U}}, + abacus::max2{uint64_t{100U}}}}, + {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}, abacus::min2{int64_t{-100}}, + abacus::max2{int64_t{100}}}}, + {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}}; - abacus::metrics metrics(infos); + abacus::metrics2 metrics(infos); - auto m0 = metrics.initialize_metric(name0); - auto m1 = metrics.initialize_metric(name1); - metrics.initialize_constant(name2, true); + auto m0 = metrics.initialize_metric(name0, 42); + auto m1 = metrics.initialize_metric(name1, -42); + metrics.initialize_constant(name2, true); - m0 = 42; - m1 = -42; - - abacus::view view; - view.set_meta_data(metrics.meta_data()); - view.set_value_data(metrics.value_data()); + abacus::view2 view; + view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); + view.set_value_data(metrics.value_data(), metrics.value_bytes()); auto json_from_view = abacus::to_json(view); @@ -82,7 +77,8 @@ TEST(test_to_json, api) EXPECT_FALSE(error); auto json_from_data = - abacus::to_json(metrics.meta_data(), metrics.value_data()); + abacus::to_json(metrics.metadata_data(), metrics.metadata_bytes(), + metrics.value_data(), metrics.value_bytes()); EXPECT_EQ(json_from_view, json_from_data); EXPECT_EQ(json_from_view, expected_json); diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 1b82a384..41113f51 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -7,9 +7,11 @@ #include #include -#include +#include #include -#include +#include + +#include TEST(test_view, api) { @@ -17,62 +19,54 @@ TEST(test_view, api) std::string name1 = "metric1"; std::string name2 = "metric3"; - abacus::metric_info infos[3] = { - abacus::metric_info{name0, "An unsigned integer metric", - abacus::type::uint64, abacus::kind::counter, - abacus::unit{"bytes"}}, - abacus::metric_info{name1, "A signed integer metric", - abacus::type::int64, abacus::kind::gauge, - abacus::unit{"USD"}}, - abacus::metric_info{name2, "Constant floating point metric", - abacus::type::float64, abacus::kind::constant}}; + std::map infos = { + {name0, + abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::unit{"bytes"}}}, + {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}, + {name2, abacus::float64{abacus::kind::CONSTANT, + "A constant floating point metric", + abacus::unit{"ms"}}}}; - abacus::metrics metrics(infos); + abacus::metrics2 metrics(infos); - metrics.initialize_metric(name0); + auto metric0 = metrics.initialize_metric(name0); - metrics.initialize_metric(name1); + auto metric1 = metrics.initialize_metric(name1); - metrics.initialize_constant(name2, 3.14); + metrics.initialize_constant(name2, 3.14); - std::vector meta_data(metrics.meta_bytes()); + std::vector meta_data(metrics.metadata_bytes()); std::vector value_data(metrics.value_bytes()); - std::memcpy(meta_data.data(), metrics.meta_data(), metrics.meta_bytes()); + std::memcpy(meta_data.data(), metrics.metadata_data(), + metrics.metadata_bytes()); std::memcpy(value_data.data(), metrics.value_data(), metrics.value_bytes()); - abacus::view view; - - view.set_meta_data(meta_data.data()); - view.set_meta_data(meta_data.data()); - EXPECT_EQ(view.protocol_version(), abacus::protocol_version()); - - view.set_value_data(value_data.data()); + abacus::view2 view; - EXPECT_EQ(metrics.count(), view.count()); + view.set_meta_data(meta_data.data(), meta_data.size()); + EXPECT_EQ(view.metadata().protocol_version(), abacus::protocol_version()); - EXPECT_EQ(metrics.name(0), view.name(0)); - EXPECT_EQ(metrics.name(1), view.name(1)); - EXPECT_EQ(metrics.name(2), view.name(2)); + EXPECT_EQ(metrics.metadata().metrics().size(), + view.metadata().metrics().size()); - EXPECT_EQ(view.type(0), abacus::type::uint64); - EXPECT_EQ(view.type(1), abacus::type::int64); - EXPECT_EQ(view.type(2), abacus::type::float64); + EXPECT_TRUE(google::protobuf::util::MessageDifferencer::Equals( + metrics.metadata(), view.metadata())); - EXPECT_EQ(view.kind(0), abacus::kind::counter); - EXPECT_EQ(view.kind(1), abacus::kind::gauge); - EXPECT_EQ(view.kind(2), abacus::kind::constant); + auto success = view.set_value_data(value_data.data(), value_data.size()); + ASSERT_TRUE(success); - EXPECT_EQ(view.unit(0), "bytes"); - EXPECT_EQ(view.unit(1), "USD"); - EXPECT_EQ(view.unit(2), ""); + std::optional view_value = view.value(name0); - uint64_t metrics_value = 12; - uint64_t view_value = 11; - metrics.value(0, metrics_value); - view.value(0, view_value); + EXPECT_FALSE(view_value.has_value()); - EXPECT_EQ(metrics_value, view_value); + // Update metric + metric0 = 9000U; + // and provide new value data to the view + view.set_value_data(metrics.value_data(), metrics.value_bytes()); + view_value = view.value(name0); - EXPECT_EQ(view.meta_data(), meta_data.data()); - EXPECT_EQ(view.value_data(), value_data.data()); + EXPECT_TRUE(view_value.has_value()); + EXPECT_EQ(9000U, view_value.value()); } From 7d9fd279c3a6a9e166468fa1b019b2748760808b Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 8 Jan 2025 10:42:45 +0100 Subject: [PATCH 06/68] cleanup --- examples/metrics_simple.cpp | 100 ++--- src/abacus/boolean.hpp | 112 +++++ src/abacus/detail/common.hpp | 160 +++++++ src/abacus/detail/hash_function.hpp | 3 + src/abacus/detail/raw.hpp | 388 ----------------- src/abacus/detail/to_json.cpp | 28 +- src/abacus/detail/to_json.hpp | 8 +- src/abacus/detail/value_size_info.hpp | 81 ---- src/abacus/enum8.hpp | 124 ++++++ src/abacus/float32.hpp | 53 +++ src/abacus/float64.hpp | 51 +++ src/abacus/get_value.hpp | 71 --- src/abacus/int32.hpp | 51 +++ src/abacus/int64.hpp | 51 +++ src/abacus/kind.hpp | 24 +- src/abacus/max.hpp | 35 +- src/abacus/metric.hpp | 361 ---------------- src/abacus/metric_info.hpp | 46 -- src/abacus/metrics.cpp | 431 ------------------- src/abacus/metrics.hpp | 592 +++++++++++++++----------- src/abacus/metrics2.hpp | 413 ------------------ src/abacus/min.hpp | 35 +- src/abacus/to_json.cpp | 4 +- src/abacus/to_json.hpp | 4 +- src/abacus/to_string.cpp | 29 -- src/abacus/to_string.hpp | 19 - src/abacus/type.hpp | 39 +- src/abacus/type2.hpp | 372 ---------------- src/abacus/uint32.hpp | 51 +++ src/abacus/uint64.hpp | 51 +++ src/abacus/unit.hpp | 3 +- src/abacus/view.cpp | 171 -------- src/abacus/view.hpp | 247 ++++++----- src/abacus/view2.hpp | 172 -------- test/src/test_metric.cpp | 2 +- test/src/test_metrics.cpp | 28 +- test/src/test_to_json.cpp | 99 +++-- test/src/test_type2.cpp | 4 +- test/src/test_view.cpp | 10 +- 39 files changed, 1391 insertions(+), 3132 deletions(-) create mode 100644 src/abacus/boolean.hpp create mode 100644 src/abacus/detail/common.hpp delete mode 100644 src/abacus/detail/raw.hpp delete mode 100644 src/abacus/detail/value_size_info.hpp create mode 100644 src/abacus/enum8.hpp create mode 100644 src/abacus/float32.hpp create mode 100644 src/abacus/float64.hpp delete mode 100644 src/abacus/get_value.hpp create mode 100644 src/abacus/int32.hpp create mode 100644 src/abacus/int64.hpp delete mode 100644 src/abacus/metric.hpp delete mode 100644 src/abacus/metric_info.hpp delete mode 100644 src/abacus/metrics.cpp delete mode 100644 src/abacus/metrics2.hpp delete mode 100644 src/abacus/to_string.cpp delete mode 100644 src/abacus/to_string.hpp delete mode 100644 src/abacus/type2.hpp create mode 100644 src/abacus/uint32.hpp create mode 100644 src/abacus/uint64.hpp delete mode 100644 src/abacus/view.cpp delete mode 100644 src/abacus/view2.hpp diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 1fc7ee29..90de8464 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -7,63 +7,57 @@ #include #include -// #include -// #include -// #include +#include +#include +#include // Simple example of metrics on a car. - int main() { - // std::string name0 = "fuel_consumption"; - // std::string name1 = "wheels"; - // std::string name2 = "days_until_maintenance"; - // std::string name3 = "registered"; - - // abacus::metric_info infos[4] = { - // abacus::metric_info{name0, "Fuel consumption in kilometers per - // liter", - // abacus::type::float64, abacus::kind::constant, - // abacus::unit{"km/l"}}, - // abacus::metric_info{name1, "Wheels on the car", abacus::type::uint64, - // abacus::kind::constant, abacus::unit{"wheels"}}, - // abacus::metric_info{name2, - // "Days until next maintenance, if less than 0, " - // "maintenance is overdue", - // abacus::type::int64, abacus::kind::gauge, - // abacus::unit{"days"}}, - // abacus::metric_info{name3, "Is the car registered", - // abacus::type::boolean, abacus::kind::gauge}}; - - // abacus::metrics car(infos); - - // car.initialize_constant("fuel_consumption", 22.3); - // car.initialize_constant("wheels", 4); - // auto days_until_maintenance = - // car.initialize_metric("days_until_maintenance"); - // auto registered = - // car.initialize_metric("registered"); - - // // The car should be registered. - // registered = true; - - // // The car is overdue maintenance. - // days_until_maintenance = -10; - - // /// We want to export the metrics memory, so we need a new storage - // std::vector meta_data(car.meta_bytes()); - // std::vector value_data(car.value_bytes()); - - // /// Copy the memory into the new storage - // std::memcpy(meta_data.data(), car.meta_data(), car.meta_bytes()); - // std::memcpy(value_data.data(), car.value_data(), car.value_bytes()); - - // abacus::view car_view; - - // car_view.set_meta_data(meta_data.data()); - // car_view.set_value_data(value_data.data()); - - // std::cout << abacus::to_json(car_view) << std::endl; + std::string name0 = "fuel_consumption"; + std::string name1 = "wheels"; + std::string name2 = "days_until_maintenance"; + std::string name3 = "registered"; + + std::map infos = { + {name0, abacus::float64{abacus::kind::CONSTANT, + "Fuel consumption in kilometers per liter ", + abacus::unit{"km/l"}}}, + {name1, abacus::uint64{abacus::kind::CONSTANT, "Wheels on the car", + abacus::unit{"wheels"}}}, + {name2, abacus::int64{abacus::kind::GAUGE, + "Days until next maintenance, if less than 0, " + "maintenance is overdue", + abacus::unit{"days"}}}, + {name3, abacus::boolean{abacus::kind::GAUGE, "Is the car registered"}}}; + + abacus::metrics car(infos); + + car.initialize_constant("fuel_consumption", 22.3); + car.initialize_constant("wheels", 4); + + // The car is overdue maintenance. + auto days_until_maintenance = + car.initialize_metric("days_until_maintenance", -10); + + // The car should be registered. + auto registered = + car.initialize_metric("registered", true); + + /// We want to export the metrics memory, so we need a new storage + std::vector meta_data(car.metadata_bytes()); + std::vector value_data(car.value_bytes()); + + /// Copy the memory into the new storage + std::memcpy(meta_data.data(), car.metadata_data(), car.metadata_bytes()); + std::memcpy(value_data.data(), car.value_data(), car.value_bytes()); + + abacus::view car_view; + + car_view.set_meta_data(meta_data.data(), meta_data.size()); + car_view.set_value_data(value_data.data(), value_data.size()); + + std::cout << abacus::to_json(car_view) << std::endl; return 0; } diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp new file mode 100644 index 00000000..1484c08c --- /dev/null +++ b/src/abacus/boolean.hpp @@ -0,0 +1,112 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include + +#include "kind.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A boolean metric +struct boolean +{ + /// The primitive type of the metric + using type = bool; + + /// The metric type + struct metric + { + /// Default constructor + metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + metric(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(type) + 1); + } + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The initial value of the metric + metric(uint8_t* memory, type value) : metric(memory) + { + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + /// Reset the metric + /// This will set the metric to an uninitialized state and cause + /// has_value() to return false + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> type + { + assert(is_initialized()); + return m_memory[1]; + } + + /// Assign the metric a new value + /// @param value The value to assign + auto set_value(type value) -> void + { + assert(is_initialized()); + m_memory[0] = 1; + m_memory[1] = value; + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return a metric with the new value + auto operator=(type value) -> metric& + { + assert(is_initialized()); + set_value(value); + return *this; + } + + private: + /// The metric memory + uint8_t* m_memory = nullptr; + }; + + /// The kind of the metric + abacus::kind kind; + + /// The description of the metric + std::string description; +}; +} +} diff --git a/src/abacus/detail/common.hpp b/src/abacus/detail/common.hpp new file mode 100644 index 00000000..d15750e5 --- /dev/null +++ b/src/abacus/detail/common.hpp @@ -0,0 +1,160 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include +#include + +#include "../version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +namespace detail +{ +/// A common class for most metrics +template +struct common +{ + /// The primitive type of the metric + using type = typename T::type; + + /// The metric type + using metric = typename T::metric; + + /// Default constructor + common() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + common(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(type) + 1); + } + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The initial value of the metric + common(uint8_t* memory, type value) : common(memory) + { + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + /// Reset the metric + /// This will set the metric to an uninitialized state causing + /// has_value() to return false. + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> type + { + assert(is_initialized()); + assert(has_value()); + type value; + std::memcpy(&value, m_memory + 1, sizeof(value)); + return value; + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(type value) -> void + { + assert(is_initialized()); + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + m_memory[0] = 1; + std::memcpy(m_memory + 1, &value, sizeof(value)); + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(type value) -> metric& + { + assert(is_initialized()); + set_value(value); + return (metric&)*this; + } + + /// Increment the metric + /// @param value The value to add + /// @return The result of the arithmetic + auto operator+=(type value) -> metric& + { + assert(has_value()); + auto new_value = this->value() + value; + assert(!std::isnan(new_value) && "Cannot assign a NaN"); + assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + + /// Decrement the metric + /// @param value The value to subtract + /// @return The result of the arithmetic + auto operator-=(type value) -> metric& + { + assert(has_value()); + auto new_value = this->value() - value; + assert(!std::isnan(new_value) && "Cannot assign a NaN"); + assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + + /// Increment the value of the metric + /// @return The result of the arithmetic + auto operator++() -> metric& + { + assert(has_value()); + auto new_value = value() + 1; + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + + /// Decrement the value of the metric + /// @return The result of the arithmetic + auto operator--() -> metric& + { + auto new_value = value() - 1; + std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); + return (metric&)*this; + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; +} +} +} diff --git a/src/abacus/detail/hash_function.hpp b/src/abacus/detail/hash_function.hpp index 79afeffc..224993f6 100644 --- a/src/abacus/detail/hash_function.hpp +++ b/src/abacus/detail/hash_function.hpp @@ -16,6 +16,9 @@ inline namespace STEINWURF_ABACUS_VERSION namespace detail { /// Converts a string to a 32-bit FNV-1a hash used for identifying actions +/// @param data The data to hash +/// @param bytes The number of bytes to hash +/// @return The 32-bit hash constexpr auto hash_function(const uint8_t* data, std::size_t bytes) -> uint32_t { uint32_t hash = 0x811c9dc5; // FNV-1a 32-bit offset basis diff --git a/src/abacus/detail/raw.hpp b/src/abacus/detail/raw.hpp deleted file mode 100644 index 3ec41e41..00000000 --- a/src/abacus/detail/raw.hpp +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "../kind.hpp" -#include "../max.hpp" -#include "../min.hpp" -#include "../type.hpp" -#include "../version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -namespace detail -{ - -/// @return The size of the header in bytes -inline auto header_bytes() -> std::size_t -{ - return 12; -} - -inline auto is_big_endian_byte_offset() -> std::size_t -{ - return 0; -} - -inline auto is_big_endian(const uint8_t* meta_data) -> bool -{ - return meta_data[is_big_endian_byte_offset()] != 0; -} - -template -T read(const uint8_t* meta_data, const uint8_t* data) -{ - if (is_big_endian(meta_data)) - { - return endian::big_endian::get(data); - } - else - { - return endian::little_endian::get(data); - } -} - -inline auto protocol_version_offset() -> std::size_t -{ - return is_big_endian_byte_offset() + sizeof(bool); -} - -inline auto protocol_version(const uint8_t* meta_data) -> uint8_t -{ - return meta_data[protocol_version_offset()]; -} - -inline auto name_bytes_offset() -> std::size_t -{ - auto offset = protocol_version_offset() + sizeof(uint8_t); - // Assert that the offset is a multiple of 2 as name_bytes is a uint16_t and - // therefore must be aligned on a 2 byte boundary - assert(offset % 2 == 0); - return offset; -} - -inline auto name_bytes(const uint8_t* meta_data) -> uint16_t -{ - return read(meta_data, meta_data + name_bytes_offset()); -} - -inline auto descriptions_bytes_offset() -> std::size_t -{ - return name_bytes_offset() + sizeof(uint16_t); -} - -inline auto descriptions_bytes(const uint8_t* meta_data) -> uint16_t -{ - return read(meta_data, meta_data + descriptions_bytes_offset()); -} - -inline auto description_bytes(const uint8_t* meta_data) -> uint16_t -{ - return read(meta_data, meta_data + descriptions_bytes_offset()); -} - -inline auto unit_bytes_offset() -> std::size_t -{ - return descriptions_bytes_offset() + sizeof(uint16_t); -} - -inline auto unit_bytes(const uint8_t* meta_data) -> uint16_t -{ - return read(meta_data, meta_data + unit_bytes_offset()); -} - -inline auto eight_byte_count_offset() -> std::size_t -{ - return unit_bytes_offset() + sizeof(uint16_t); -} - -inline auto eight_byte_count(const uint8_t* meta_data) -> uint16_t -{ - return read(meta_data, meta_data + eight_byte_count_offset()); -} - -inline auto one_byte_count_offset() -> std::size_t -{ - return eight_byte_count_offset() + sizeof(uint16_t); -} - -inline auto one_byte_count(const uint8_t* meta_data) -> uint16_t -{ - return read(meta_data, meta_data + one_byte_count_offset()); -} - -inline auto metric_count(const uint8_t* meta_data) -> uint16_t -{ - assert(meta_data != nullptr); - return eight_byte_count(meta_data) + one_byte_count(meta_data); -} - -inline auto name_sizes_offset() -> std::size_t -{ - return one_byte_count_offset() + sizeof(uint16_t); -} - -inline auto name_size(const uint8_t* meta_data, std::size_t index) -> uint16_t -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - return read(meta_data, meta_data + name_sizes_offset() + - index * sizeof(uint16_t)); -} - -inline auto description_sizes_offset(const uint8_t* meta_data) -> std::size_t -{ - return name_sizes_offset() + metric_count(meta_data) * sizeof(uint16_t); -} - -inline auto description_size(const uint8_t* meta_data, std::size_t index) - -> uint16_t -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - return read(meta_data, meta_data + - description_sizes_offset(meta_data) + - index * sizeof(uint16_t)); -} - -inline auto unit_sizes_offset(const uint8_t* meta_data) -> std::size_t -{ - return description_sizes_offset(meta_data) + - metric_count(meta_data) * sizeof(uint16_t); -} - -inline auto unit_size(const uint8_t* meta_data, std::size_t index) -> uint16_t -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - return read(meta_data, meta_data + unit_sizes_offset(meta_data) + - index * sizeof(uint16_t)); -} - -inline auto names_offset(const uint8_t* meta_data) -> std::size_t -{ - return unit_sizes_offset(meta_data) + - metric_count(meta_data) * sizeof(uint16_t); -} - -inline auto name(const uint8_t* meta_data, std::size_t index) -> const char* -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - std::size_t offset = names_offset(meta_data); - for (std::size_t i = 0; i < index; ++i) - { - offset += name_size(meta_data, i); - } - return (const char*)(meta_data + offset); -} - -inline auto name(uint8_t* meta_data, std::size_t index) -> char* -{ - return const_cast( - name(const_cast(meta_data), index)); -} - -inline auto descriptions_offset(const uint8_t* meta_data) -> std::size_t -{ - return names_offset(meta_data) + name_bytes(meta_data); -} - -inline auto description(const uint8_t* meta_data, std::size_t index) -> const - char* -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - std::size_t offset = descriptions_offset(meta_data); - for (std::size_t i = 0; i < index; ++i) - { - offset += description_size(meta_data, i); - } - return (const char*)(meta_data + offset); -} - -inline auto description(uint8_t* meta_data, std::size_t index) -> char* -{ - return const_cast( - description(const_cast(meta_data), index)); -} - -inline auto units_offset(const uint8_t* meta_data) -> std::size_t -{ - return descriptions_offset(meta_data) + descriptions_bytes(meta_data); -} - -inline auto unit(const uint8_t* meta_data, std::size_t index) -> const char* -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - std::size_t offset = units_offset(meta_data); - for (std::size_t i = 0; i < index; ++i) - { - offset += unit_size(meta_data, i); - } - return (const char*)(meta_data + offset); -} - -inline auto unit(uint8_t* meta_data, std::size_t index) -> char* -{ - return const_cast( - unit(const_cast(meta_data), index)); -} - -inline auto types_offset(const uint8_t* meta_data) -> std::size_t -{ - return units_offset(meta_data) + unit_bytes(meta_data); -} - -inline auto type(const uint8_t* meta_data, std::size_t index) -> abacus::type -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - std::size_t offset = types_offset(meta_data) + index; - return static_cast( - read(meta_data, meta_data + offset)); -} - -inline auto kind_offset(const uint8_t* meta_data) -> std::size_t -{ - return types_offset(meta_data) + metric_count(meta_data); -} - -inline auto kind(const uint8_t* meta_data, std::size_t index) -> abacus::kind -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - std::size_t offset = kind_offset(meta_data) + index; - return static_cast( - read(meta_data, meta_data + offset)); -} - -inline auto min_offset(const uint8_t* meta_data) -> std::size_t -{ - return kind_offset(meta_data) + metric_count(meta_data); -} - -template -inline auto min_value(const uint8_t* meta_data, std::size_t index) - -> abacus::min -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - std::size_t offset = min_offset(meta_data) + index * sizeof(uint64_t); - return abacus::min{read(meta_data, meta_data + offset)}; -} - -inline auto max_offset(const uint8_t* meta_data) -> std::size_t -{ - return min_offset(meta_data) + metric_count(meta_data) * sizeof(uint64_t); -} -template -inline auto max_value(const uint8_t* meta_data, std::size_t index) - -> abacus::max -{ - assert(meta_data != nullptr); - assert(index < metric_count(meta_data)); - - std::size_t offset = max_offset(meta_data) + index * sizeof(uint64_t); - return abacus::max{read(meta_data, meta_data + offset)}; -} - -inline auto meta_bytes(const uint8_t* meta_data) -> std::size_t -{ - return max_offset(meta_data) + sizeof(uint64_t) * metric_count(meta_data); -} - -/// @param offset The offset in the raw memory -/// @return The extra padding to add to the offset for alignment -inline auto alignment_padding(std::size_t offset) -> std::size_t -{ - auto remainder = offset % 8; - return remainder == 0 ? 0 : 8 - remainder; -} - -inline auto value_ptr(const uint8_t* meta_data, uint8_t* counter_data, - std::size_t index) -> void* -{ - assert(meta_data != nullptr); - assert(counter_data != nullptr); - assert(index < metric_count(meta_data)); - - uint16_t eight_byte_metrics = eight_byte_count(meta_data); - if (index < eight_byte_metrics) - { - return static_cast(counter_data + index * 8U); - } - - return static_cast(counter_data + eight_byte_metrics * 8 + - (index - eight_byte_metrics)); -} - -template -inline T value(const uint8_t* meta_data, const uint8_t* counter_data, - std::size_t index) -{ - assert(meta_data != nullptr); - assert(counter_data != nullptr); - assert(index < metric_count(meta_data)); - - return read(meta_data, - static_cast(value_ptr( - meta_data, const_cast(counter_data), index))); -} - -inline auto metrics_bytes(const uint8_t* meta_data) -> std::size_t -{ - return eight_byte_count(meta_data) * 8U + one_byte_count(meta_data); -} - -inline auto is_metric_initialized(const uint8_t* meta_data, - const uint8_t* value_data, std::size_t index) - -> bool -{ - assert(index < metric_count(meta_data)); - // The last bytes after the value data is a bitset of initialized metrics - auto initialized = value_data + metrics_bytes(meta_data); - return (initialized[index / 8] & (1 << (index % 8))) != 0; -} - -inline void set_metric_initialized(const uint8_t* meta_data, - uint8_t* value_data, std::size_t index) -{ - assert(index < metric_count(meta_data)); - // The last bytes after the value data is a bitset of initialized metrics - auto initialized = value_data + metrics_bytes(meta_data); - initialized[index / 8] |= (1 << (index % 8)); -} - -inline auto value_bytes(const uint8_t* meta_data) -> std::size_t -{ - return metrics_bytes(meta_data) + (metric_count(meta_data) + 7) / 8; -} -} -} -} diff --git a/src/abacus/detail/to_json.cpp b/src/abacus/detail/to_json.cpp index de4b5d11..ea8b6a75 100644 --- a/src/abacus/detail/to_json.cpp +++ b/src/abacus/detail/to_json.cpp @@ -16,10 +16,10 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace detail { -auto to_json(const view2& view, bool slim) -> bourne::json +auto to_json(const view& view, bool minimal) -> bourne::json { auto json = bourne::json::object(); - if (slim) + if (minimal) { for (const auto& [name, metric] : view.metadata().metrics()) { @@ -105,11 +105,29 @@ auto to_json(const view2& view, bool slim) -> bourne::json else { std::string metadata_json; + auto metadata = view.metadata(); + // Go through each metric and remove the offset + for (auto& [name, metric] : *metadata.mutable_metrics()) + { + metric.clear_offset(); + } + auto status = google::protobuf::util::MessageToJsonString( - view.metadata(), &metadata_json); - if (status.ok()) + metadata, &metadata_json); + if (!status.ok()) + { + return json; + } + json = bourne::json::parse(metadata_json); + if (json.has_key("metrics")) + { + json = json["metrics"]; + } + // Call the minimal version recursively to get the values + auto values = to_json(view, true); + for (const auto& [key, value] : values.object_range()) { - json = bourne::json::parse(metadata_json); + json[key]["value"] = value; } } diff --git a/src/abacus/detail/to_json.hpp b/src/abacus/detail/to_json.hpp index 4d56146c..d447a8d1 100644 --- a/src/abacus/detail/to_json.hpp +++ b/src/abacus/detail/to_json.hpp @@ -7,7 +7,7 @@ #include -#include "../view2.hpp" +#include "../view.hpp" #include "../version.hpp" @@ -17,7 +17,11 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace detail { -auto to_json(const view2& view, bool slim) -> bourne::json; +/// @param view A view with access to metrics-data. +/// @param minimal If true, the JSON will a simple map between metric names and +/// values. +/// @return a JSON-formatted string of a metrics views data. +auto to_json(const view& view, bool minimal) -> bourne::json; } } } diff --git a/src/abacus/detail/value_size_info.hpp b/src/abacus/detail/value_size_info.hpp deleted file mode 100644 index 31b15ba1..00000000 --- a/src/abacus/detail/value_size_info.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include - -#include "../metric_info.hpp" -#include "../type.hpp" -#include "../version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -namespace detail -{ - -struct value_size_info -{ - std::vector m_eight_byte_metrics; - std::vector m_one_byte_metrics; - - value_size_info(const metric_info* infos, std::size_t count) - { - assert(count == 0 || infos != nullptr); - for (std::size_t i = 0; i < count; i++) - { - const auto& info = infos[i]; - switch (info.type) - { - case abacus::type::boolean: - m_one_byte_metrics.push_back(info); - break; - case abacus::type::float64: - case abacus::type::int64: - case abacus::type::uint64: - m_eight_byte_metrics.push_back(info); - break; - default: - assert(false); - break; - } - } - } - - std::size_t eight_byte_metrics_count() const - { - return m_eight_byte_metrics.size(); - } - - std::size_t one_byte_metrics_count() const - { - return m_one_byte_metrics.size(); - } - - std::size_t count() const - { - return m_eight_byte_metrics.size() + m_one_byte_metrics.size(); - } - - metric_info operator[](std::size_t index) const - { - assert(index < count()); - - if (index < m_eight_byte_metrics.size()) - { - return m_eight_byte_metrics[index]; - } - else - { - return m_one_byte_metrics[index - m_eight_byte_metrics.size()]; - } - } -}; -} -} -} diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp new file mode 100644 index 00000000..835f004f --- /dev/null +++ b/src/abacus/enum8.hpp @@ -0,0 +1,124 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include +#include + +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A enumeration metric +struct enum8 +{ + /// The primitive type of the metric + using type = uint8_t; + + /// The metric type + struct metric + { + /// Default constructor + metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + metric(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(type) + 1); + } + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The initial value of the metric + metric(uint8_t* memory, type value) : metric(memory) + { + assert(m_memory != nullptr); + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + /// Reset the metric + /// This will set the metric to an uninitialized state and cause + /// has_value() to return false + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> type + { + assert(is_initialized()); + return m_memory[1]; + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(type value) -> void + { + assert(is_initialized()); + m_memory[0] = 1; + m_memory[1] = value; + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return a metric with the new value + auto operator=(type value) -> metric& + { + assert(is_initialized()); + set_value(value); + return *this; + } + + private: + /// The metric memory + uint8_t* m_memory = nullptr; + }; + + /// The enumeration value type + struct value + { + std::string name; + std::string description; + }; + + /// The metric description + std::string description; + + /// The enumeration values + std::map values; + + /// The unit of the metric + abacus::unit unit{}; +}; +} +} diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp new file mode 100644 index 00000000..bc071cbf --- /dev/null +++ b/src/abacus/float32.hpp @@ -0,0 +1,53 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include + +#include "detail/common.hpp" + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A 32-bit floating point metric +struct float32 +{ + /// The primitive type of the metric + using type = float; + + /// The metric type + struct metric : public detail::common + { + /// Inherit the constructors and various operators from the common class + using detail::common::common; + + /// Inherit the assignment operator from the common class + using detail::common::operator=; + }; + + /// The metric kind + abacus::kind kind; + + /// The metric description + std::string description; + + /// The unit of the metric + abacus::unit unit{}; + + /// The minimum value of the metric + abacus::min min{}; + + /// The maximum value of the metric + abacus::max max{}; +}; +} +} diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp new file mode 100644 index 00000000..e9d1f9ff --- /dev/null +++ b/src/abacus/float64.hpp @@ -0,0 +1,51 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "detail/common.hpp" + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A 32-bit floating point metric +struct float64 +{ + /// The primitive type of the metric + using type = double; + + /// The metric type + struct metric : public detail::common + { + /// Inherit the constructors and various operators from the common class + using detail::common::common; + + /// Inherit the assignment operator from the common class + using detail::common::operator=; + }; + + /// The metric kind + abacus::kind kind; + + /// The metric description + std::string description; + + /// The unit of the metric + abacus::unit unit{}; + + /// The minimum value of the metric + abacus::min min{}; + + /// The maximum value of the metric + abacus::max max{}; +}; +} +} diff --git a/src/abacus/get_value.hpp b/src/abacus/get_value.hpp deleted file mode 100644 index 4c9256d0..00000000 --- a/src/abacus/get_value.hpp +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include -#include - -#include "detail/hash_function.hpp" -#include "metric.hpp" -#include "metric_info2.hpp" -#include "protocol_version.hpp" -#include "type.hpp" -#include "version.hpp" - -#include "protobuf/metrics.pb.h" - -#include -#include -#include - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -template -static inline auto get_value(const uint8_t* data, const std::string& name) - -> std::optional -{ -} - -template -static inline auto -get_value(const protobuf::MetricsMetadata& meta, const uint8_t* value_data, - const std::string& name) -> std::optional -{ - auto endian = meta.endianness(); - uint32_t sync_bytes; - if (endian == protobuf::Endianness::BIG) - { - sync_bytes = endian::big_endian::get(value_data); - } - else - { - sync_bytes = endian::little_endian::get(value_data); - } - - // Check the sync bytes - if (meta.sync() != sync_bytes) - { - return std::nullopt; - } - - const protobuf::Metric& proto_metric = meta.metrics().at(name); - auto offset = proto_metric.offset(); - - typename T::metric m(value_data + offset); - if (!m.has_value()) - { - return std::nullopt; - } - return m.value(); -} -} -} diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp new file mode 100644 index 00000000..437daeb0 --- /dev/null +++ b/src/abacus/int32.hpp @@ -0,0 +1,51 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "detail/common.hpp" + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A 32-bit signed integer metric +struct int32 +{ + /// The primitive type of the metric + using type = int32_t; + + /// The metric type + struct metric : public detail::common + { + /// Inherit the constructors and various operators from the common class + using detail::common::common; + + /// Inherit the assignment operator from the common class + using detail::common::operator=; + }; + + /// The metric kind + abacus::kind kind; + + /// The metric description + std::string description; + + /// The unit of the metric + abacus::unit unit{}; + + /// The minimum value of the metric + abacus::min min{}; + + /// The maximum value of the metric + abacus::max max{}; +}; +} +} diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp new file mode 100644 index 00000000..078bf418 --- /dev/null +++ b/src/abacus/int64.hpp @@ -0,0 +1,51 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "detail/common.hpp" + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A 64-bit signed integer metric +struct int64 +{ + /// The primitive type of the metric + using type = int64_t; + + /// The metric type + struct metric : public detail::common + { + /// Inherit the constructors and various operators from the common class + using detail::common::common; + + /// Inherit the assignment operator from the common class + using detail::common::operator=; + }; + + /// The metric kind + abacus::kind kind; + + /// The metric description + std::string description; + + /// The unit of the metric + abacus::unit unit{}; + + /// The minimum value of the metric + abacus::min min{}; + + /// The maximum value of the metric + abacus::max max{}; +}; +} +} diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index cbd0e4bc..a27846d4 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -5,32 +5,14 @@ #pragma once +#include "protobuf/kind.pb.h" #include "version.hpp" -#include namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -/// Enum used for identifying various metric flags. -enum class kind : uint8_t -{ - /// A counter is a cumulative metric that represents a single monotonically - /// increasing counter whose value can only increase or be reset to zero on - /// restart. For example, you can use a counter to represent the number of - /// requests served, tasks completed, or errors. - counter = 0U, - - /// A constant is a metric that represents a single numerical value that - /// never changes. - constant, - - /// A gauge is a metric that represents a single numerical value that can - /// arbitrarily go up and down. - /// Gauges are typically used for measured values like temperatures or - /// current memory usage, but also "counts" that can go up and down, like - /// the number of concurrent requests. - gauge, -}; +/// @brief The kind of a metric +using kind = protobuf::Kind; } } diff --git a/src/abacus/max.hpp b/src/abacus/max.hpp index 9d4d62bb..bd45572a 100644 --- a/src/abacus/max.hpp +++ b/src/abacus/max.hpp @@ -13,39 +13,22 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +/// Stronly typed max value for a metric template -struct max2 +struct max { - max2() = default; - explicit max2(T value) : value(value) - { - } - - std::optional value; -}; -union max -{ - - max(uint64_t value) : m_uint(value) - { - } - - max(double value) : m_double(value) - { - } + /// Default constructor + max() = default; - max(int64_t value) : m_int(value) + /// Constructor + /// @param value The maximum value + explicit max(T value) : value(value) { } - max() : m_uint(0) - { - } - - uint64_t m_uint; - double m_double; - int64_t m_int; + /// The maximum value + std::optional value; }; } } diff --git a/src/abacus/metric.hpp b/src/abacus/metric.hpp deleted file mode 100644 index 90a74941..00000000 --- a/src/abacus/metric.hpp +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include - -#include "type.hpp" -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -/// Wrapper for the value of a counter. -/// -/// See metric, -/// metric, metric and -/// metric for template specializations. -template -class metric; - -/// Metric wrapping uint64_t value. -template <> -class metric -{ -public: - /// The underlying data type - using value_type = uint64_t; - -public: - /// Default constructor - metric() = default; - - /// Create a new counter value from the pointer - /// @param memory A pointer to a value - - metric(uint64_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - } - - /// Assign the counter a new value - /// @param value The value to assign - /// @return a counter with the new value - auto operator=(uint64_t value) -> metric& - { - assert(is_initialized()); - *m_memory = value; - return *this; - } - - /// Increment the counter - /// @param value The value to add - /// @return The result of the arithmetic - auto operator+=(uint64_t value) -> metric& - { - assert(is_initialized()); - *m_memory += value; - return *this; - } - - /// Decrement the counter - /// @param value The value to subtract - /// @return The result of the arithmetic - auto operator-=(uint64_t value) -> metric& - { - assert(is_initialized()); - *m_memory -= value; - return *this; - } - - /// Increment the value of the counter - /// @return The result of the arithmetic - auto operator++() -> metric& - { - assert(is_initialized()); - *m_memory += 1; - return *this; - } - - /// Decrement the value of the counter - /// @return The result of the arithmetic - auto operator--() -> metric& - { - assert(is_initialized()); - *m_memory -= 1; - return *this; - } - - /// @return True if the metric has been assigned memory. False otherwise - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// @return The value of the counter - auto value() const -> uint64_t - { - assert(is_initialized()); - return *m_memory; - } - -private: - /// The metric memory - uint64_t* m_memory = nullptr; -}; - -/// Metric wrapping int64_t value. -template <> -class metric -{ -public: - /// The underlying data type - using value_type = int64_t; - -public: - /// Default constructor - metric() = default; - - /// Create a new counter value from the pointer - /// @param memory A pointer to a value - metric(int64_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - } - - /// Assign the counter a new value - /// @param value The value to assign - /// @return a counter with the new value - auto operator=(int64_t value) -> metric& - { - assert(is_initialized()); - *m_memory = value; - return *this; - } - - /// Increment the counter - /// @param value The value to add - /// @return The result of the arithmetic - auto operator+=(int64_t value) -> metric& - { - assert(is_initialized()); - *m_memory += value; - return *this; - } - - /// Decrement the counter - /// @param value The value to subtract - /// @return The result of the arithmetic - auto operator-=(int64_t value) -> metric& - { - assert(is_initialized()); - *m_memory -= value; - return *this; - } - - /// Increment the value of the counter - /// @return The result of the arithmetic - auto operator++() -> metric& - { - assert(is_initialized()); - *m_memory += 1; - return *this; - } - - /// Decrement the value of the counter - /// @return The result of the arithmetic - auto operator--() -> metric& - { - assert(is_initialized()); - *m_memory -= 1; - return *this; - } - - /// @return True if the metric has been assigned memory. False otherwise - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// @return The value of the counter - auto value() const -> int64_t - { - assert(is_initialized()); - return *m_memory; - } - -private: - /// The metric memory - value_type* m_memory = nullptr; -}; - -/// Metric wrapping double value. -template <> -class metric -{ -public: - /// The underlying data type - using value_type = double; - -public: - /// Default constructor - metric() = default; - - /// Create a new counter value from the pointer - /// @param memory A pointer to a value - - metric(double* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - } - - /// Assign the counter a new value - /// @param value The value to assign - /// @return a counter with the new value - auto operator=(double value) -> metric& - { - assert(is_initialized()); - // We don't allow assignment to NaN or Inf/-Inf - assert(!std::isnan(value) && "Cannot assign a " - "NaN " - "value to a " - "float metric"); - assert(!std::isinf(value) && "Cannot assign an " - "Inf/-Inf " - "value to a " - "float metric"); - *m_memory = value; - return *this; - } - - /// Increment the counter - /// @param value The value to add - /// @return The result of the arithmetic - auto operator+=(double value) -> metric& - { - assert(is_initialized()); - // We don't allow assignment to NaN or Inf/-Inf - assert(!std::isnan(value) && "Cannot assign a " - "NaN " - "value to a " - "float metric"); - assert(!std::isinf(value) && "Cannot assign an " - "Inf/-Inf " - "value to a " - "float metric"); - *m_memory += value; - return *this; - } - - /// Decrement the counter - /// @param value The value to subtract - /// @return The result of the arithmetic - auto operator-=(double value) -> metric& - { - assert(is_initialized()); - // We don't allow assignment to NaN or Inf/-Inf - assert(!std::isnan(value) && "Cannot assign a " - "NaN " - "value to a " - "float metric"); - assert(!std::isinf(value) && "Cannot assign an " - "Inf/-Inf " - "value to a " - "float metric"); - - *m_memory -= value; - return *this; - } - - /// Increment the value of the counter - /// @return The result of the arithmetic - auto operator++() -> metric& - { - assert(is_initialized()); - *m_memory += 1; - return *this; - } - - /// Decrement the value of the counter - /// @return The result of the arithmetic - auto operator--() -> metric& - { - assert(is_initialized()); - *m_memory -= 1; - return *this; - } - - /// @return True if the metric has been assigned memory. False otherwise - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// @return The value of the counter - auto value() const -> double - { - assert(is_initialized()); - return *m_memory; - } - -private: - /// The metric memory - double* m_memory = nullptr; -}; - -/// Metric wrapping bool value. -template <> -class metric -{ -public: - /// The underlying data type - using value_type = bool; - -public: - /// Default constructor - metric() = default; - - /// Create a new counter value from the pointer - /// @param memory A pointer to a value - - metric(bool* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - } - - /// Assign the counter a new value - /// @param value The value to assign - /// @return a counter with the new value - auto operator=(bool value) -> metric& - { - assert(is_initialized()); - *m_memory = value; - return *this; - } - - /// @return True if the metric has been assigned memory. False otherwise - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// @return The value of the counter - auto value() const -> bool - { - assert(is_initialized()); - return *m_memory; - } - -private: - /// The metric memory - bool* m_memory = nullptr; -}; - -} -} diff --git a/src/abacus/metric_info.hpp b/src/abacus/metric_info.hpp deleted file mode 100644 index 5b0da8ce..00000000 --- a/src/abacus/metric_info.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include "kind.hpp" -#include "max.hpp" -#include "min.hpp" -#include "type.hpp" -#include "unit.hpp" - -#include - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -/// Object used to describe a metric. Used in the metrics() constructor. -struct metric_info -{ - /// Name of the metric - std::string name; - - /// Description of the metric - std::string description; - - /// Type of the metric. A metric_type enum. - abacus::type type; - - /// enum describing the flags of a metric. - abacus::kind kind; - - /// The unit of the metric - abacus::unit unit = abacus::unit{""}; - - /// The minimum value of the metric - abacus::min min = abacus::min{uint64_t{0U}}; - - /// The maximum value of the metric - abacus::max max = abacus::max{uint64_t{0U}}; -}; -} -} diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp deleted file mode 100644 index 92023455..00000000 --- a/src/abacus/metrics.cpp +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#include -#include -#include - -#include "detail/raw.hpp" -#include "kind.hpp" -#include "max.hpp" -#include "metric_info.hpp" -#include "metrics.hpp" -#include "min.hpp" -#include "protocol_version.hpp" -#include "type.hpp" - -#include - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -metrics::metrics() : metrics(nullptr, 0) -{ -} - -metrics::metrics(const metric_info* info, std::size_t count) : - m_info(info, count) -{ - assert(count <= std::numeric_limits::max()); - assert(count == 0 || info != nullptr); - - std::size_t name_bytes = 0; - std::size_t description_bytes = 0; - std::size_t unit_bytes = 0; - - // First calculate the total size of header - std::size_t meta_bytes = detail::header_bytes(); - for (std::size_t i = 0; i < m_info.count(); i++) - { - const auto& info = m_info[i]; - m_name_to_index.emplace(info.name, i); - name_bytes += info.name.size(); - description_bytes += info.description.size(); - unit_bytes += info.unit.value.size(); - - // name_size - meta_bytes += sizeof(uint16_t); - // description size - meta_bytes += sizeof(uint16_t); - // unit size - meta_bytes += sizeof(uint16_t); - // name - meta_bytes += info.name.size(); - // description - meta_bytes += info.description.size(); - // unit - meta_bytes += info.unit.value.size(); - // type - meta_bytes += sizeof(uint8_t); - // kind - meta_bytes += sizeof(uint8_t); - // min - meta_bytes += sizeof(uint64_t); - // max - meta_bytes += sizeof(uint64_t); - } - // Add padding to ensure alignment for the values. - std::size_t alignment = detail::alignment_padding(meta_bytes); - - std::size_t value_bytes = 0; - // Add the bytes needed for the values. - value_bytes += - 8 * m_info.eight_byte_metrics_count() + m_info.one_byte_metrics_count(); - - // Finally add the bytes needed for the initalized bitmap - value_bytes += (m_info.count() + 7) / 8; - - std::size_t storage_bytes = meta_bytes + alignment + value_bytes; - - // Allocate the memory needed. - m_meta_data = static_cast(::operator new(storage_bytes)); - - // Make sure that the data is 8-byte-aligned - assert(reinterpret_cast(m_meta_data) % 8U == 0U); - - // Zero out all memory - std::memset(m_meta_data, 0, storage_bytes); - - // Write the header - // The endianness of the data, 0 for little-endian, 1 for big-endian - new (m_meta_data) uint8_t(endian::is_big_endian()); - // The version of the data protocol - new (m_meta_data + 1) uint8_t(abacus::protocol_version()); - - // The total bytes used for names - assert(name_bytes <= std::numeric_limits::max()); - new (m_meta_data + 2) uint16_t((uint16_t)name_bytes); - // The total bytes used for descriptions - assert(description_bytes <= std::numeric_limits::max()); - new (m_meta_data + 4) uint16_t((uint16_t)description_bytes); - // The total bytes used for units - assert(unit_bytes <= std::numeric_limits::max()); - new (m_meta_data + 6) uint16_t((uint16_t)unit_bytes); - // The number of 8-byte metric values (uint64_t, int64_t and double types) - new (m_meta_data + 8) uint16_t((uint16_t)m_info.eight_byte_metrics_count()); - // The number of 1-byte metric values (bool type) - new (m_meta_data + 10) uint16_t((uint16_t)m_info.one_byte_metrics_count()); - - // Write the name sizes into memory - uint8_t* name_sizes_ptr = m_meta_data + detail::name_sizes_offset(); - - // Write the description sizes into memory - uint8_t* description_sizes_ptr = - m_meta_data + detail::description_sizes_offset(m_meta_data); - - // Write the unit sizes into memory - uint8_t* unit_sizes_ptr = - m_meta_data + detail::unit_sizes_offset(m_meta_data); - - // Write the names into memory - uint8_t* names_ptr = m_meta_data + detail::names_offset(m_meta_data); - - // Write the descriptions into memory - uint8_t* descriptions_ptr = - m_meta_data + detail::descriptions_offset(m_meta_data); - - // Write the units into memory - uint8_t* units_ptr = m_meta_data + detail::units_offset(m_meta_data); - - // Write the types into memory - uint8_t* types_ptr = m_meta_data + detail::types_offset(m_meta_data); - - // Write the kind into memory - uint8_t* kind_ptr = m_meta_data + detail::kind_offset(m_meta_data); - - // Write the min into memory - uint8_t* min_ptr = m_meta_data + detail::min_offset(m_meta_data); - - // Write the max into memory - uint8_t* max_ptr = m_meta_data + detail::max_offset(m_meta_data); - - for (std::size_t i = 0; i < m_info.count(); i++) - { - const auto& info = m_info[i]; - uint16_t name_size = static_cast(info.name.size()); - uint16_t description_size = - static_cast(info.description.size()); - uint16_t unit_size = static_cast(info.unit.value.size()); - - std::memcpy(name_sizes_ptr, &name_size, sizeof(name_size)); - name_sizes_ptr += sizeof(name_size); - - std::memcpy(description_sizes_ptr, &description_size, - sizeof(description_size)); - description_sizes_ptr += sizeof(description_size); - - std::memcpy(unit_sizes_ptr, &unit_size, sizeof(unit_size)); - unit_sizes_ptr += sizeof(unit_size); - - std::memcpy(names_ptr, info.name.data(), info.name.size()); - names_ptr += info.name.size(); - - std::memcpy(descriptions_ptr, info.description.data(), - info.description.size()); - descriptions_ptr += info.description.size(); - - std::memcpy(units_ptr, info.unit.value.data(), info.unit.value.size()); - units_ptr += info.unit.value.size(); - - std::memcpy(kind_ptr, &info.kind, sizeof(info.kind)); - kind_ptr += sizeof(info.kind); - - std::memcpy(types_ptr, &info.type, sizeof(info.type)); - types_ptr += sizeof(info.type); - - std::memcpy(min_ptr, &info.min, sizeof(info.min)); - min_ptr += sizeof(info.min); - - std::memcpy(max_ptr, &info.max, sizeof(info.max)); - max_ptr += sizeof(info.max); - } - - m_value_data = m_meta_data + meta_bytes + alignment; - - assert(storage_bytes == - detail::meta_bytes(m_meta_data) + - detail::alignment_padding(detail::meta_bytes(m_meta_data)) + - detail::value_bytes(m_meta_data)); -} - -metrics::metrics(metrics&& other) noexcept : - m_info(std::move(other.m_info)), - m_name_to_index(std::move(other.m_name_to_index)), - m_meta_data(other.m_meta_data), m_value_data(other.m_value_data) -{ - other.m_meta_data = nullptr; - other.m_value_data = nullptr; -} - -auto metrics::operator=(metrics&& other) noexcept -> metrics& -{ - if (this != &other) - { - m_info = std::move(other.m_info); - m_name_to_index = std::move(other.m_name_to_index); - m_meta_data = other.m_meta_data; - m_value_data = other.m_value_data; - other.m_meta_data = nullptr; - other.m_value_data = nullptr; - } - return *this; -} - -metrics::~metrics() -{ - if (m_meta_data != nullptr) - { - ::operator delete(m_meta_data); - } -} - -auto metrics::meta_data() const -> const uint8_t* -{ - assert(m_meta_data != nullptr); - return m_meta_data; -} - -auto metrics::meta_bytes() const -> std::size_t -{ - assert(m_meta_data != nullptr); - return detail::meta_bytes(m_meta_data); -} - -auto metrics::value_data() const -> const uint8_t* -{ - assert(m_meta_data != nullptr); - return m_value_data; -} - -auto metrics::value_bytes() const -> std::size_t -{ - assert(m_meta_data != nullptr); - return detail::value_bytes(m_meta_data); -} - -auto metrics::count() const -> std::size_t -{ - assert(m_meta_data != nullptr); - return m_info.count(); -} - -auto metrics::protocol_version() const -> uint8_t -{ - assert(m_meta_data != nullptr); - return detail::protocol_version(m_meta_data); -} - -auto metrics::is_initialized(std::size_t index) const -> bool -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return detail::is_metric_initialized(m_meta_data, m_value_data, index); -} - -auto metrics::name(std::size_t index) const -> std::string -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return m_info[index].name; -} - -auto metrics::description(std::size_t index) const -> std::string -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return m_info[index].description; -} - -auto metrics::unit(std::size_t index) const -> std::string -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return m_info[index].unit.value; -} - -auto metrics::is_boolean(std::size_t index) const -> bool -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return m_info[index].type == abacus::type::boolean; -} - -auto metrics::is_uint64(std::size_t index) const -> bool -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return m_info[index].type == abacus::type::uint64; -} - -auto metrics::is_int64(std::size_t index) const -> bool -{ - assert(index < count()); - return m_info[index].type == abacus::type::int64; -} - -auto metrics::is_float64(std::size_t index) const -> bool -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return m_info[index].type == abacus::type::float64; -} - -auto metrics::kind(std::size_t index) const -> abacus::kind -{ - assert(m_meta_data != nullptr); - assert(index < count()); - return m_info[index].kind; -} - -void metrics::value(std::size_t index, uint64_t& value) const -{ - assert(m_meta_data != nullptr); - assert(index < count()); - assert(is_initialized(index)); - assert(is_uint64(index)); - value = *static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); -} - -void metrics::value(std::size_t index, int64_t& value) const -{ - assert(m_meta_data != nullptr); - assert(index < count()); - assert(is_initialized(index)); - assert(is_int64(index)); - value = *static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); -} - -void metrics::value(std::size_t index, double& value) const -{ - assert(m_meta_data != nullptr); - assert(index < count()); - assert(is_initialized(index)); - assert(is_float64(index)); - value = *static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); -} - -void metrics::value(std::size_t index, bool& value) const -{ - assert(m_meta_data != nullptr); - assert(index < count()); - assert(is_initialized(index)); - assert(is_boolean(index)); - value = *static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); -} - -auto metrics::index(const std::string& name) const -> std::size_t -{ - assert(m_meta_data != nullptr); - auto it = m_name_to_index.find(name); - assert(it != m_name_to_index.end() && "metric name not found."); - return it->second; -} - -void metrics::reset_metric(std::size_t index) -{ - assert(m_meta_data != nullptr); - assert(index < count()); - assert(is_initialized(index)); - assert(kind(index) != abacus::kind::constant); - - switch (detail::type(m_meta_data, index)) - { - case abacus::type::boolean: - { - bool* value_data = static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); - *value_data = false; - break; - } - case abacus::type::uint64: - { - uint64_t* value_data = static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); - *value_data = 0U; - break; - } - case abacus::type::int64: - { - int64_t* value_data = static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); - *value_data = 0; - break; - } - case abacus::type::float64: - { - double* value_data = static_cast( - detail::value_ptr(m_meta_data, m_value_data, index)); - *value_data = 0.0; - break; - } - default: - assert(false && "Invalid metric type."); - } -} - -void metrics::reset_metrics() -{ - assert(m_meta_data != nullptr); - memset(m_value_data, 0, detail::metrics_bytes(m_meta_data)); -} - -auto metrics::initialize(std::size_t index) const -> void* -{ - assert(m_meta_data != nullptr); - assert(index < count()); - assert(!is_initialized(index)); - // Write that the metric has been initialized into memory - detail::set_metric_initialized(m_meta_data, m_value_data, index); - assert(is_initialized(index)); - return detail::value_ptr(m_meta_data, m_value_data, index); -} -} -} diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 34392ecc..70d08d82 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -7,278 +7,389 @@ #include #include +#include #include #include +#include -#include "detail/value_size_info.hpp" -#include "metric.hpp" +#include "detail/hash_function.hpp" +#include "protocol_version.hpp" #include "type.hpp" #include "version.hpp" +#include "protobuf/metrics.pb.h" + +#include + namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +namespace +{ +template +static auto size_of_type() -> std::size_t +{ + return sizeof(typename std::remove_pointer::type::type); +} + +static inline auto +get_kind(const protobuf::Metric& metric) -> std::optional +{ + switch (metric.type_case()) + { + case protobuf::Metric::kUint64: + return metric.uint64().kind(); + case protobuf::Metric::kInt64: + return metric.int64().kind(); + case protobuf::Metric::kUint32: + return metric.uint32().kind(); + case protobuf::Metric::kInt32: + return metric.int32().kind(); + case protobuf::Metric::kFloat64: + return metric.float64().kind(); + case protobuf::Metric::kFloat32: + return metric.float32().kind(); + case protobuf::Metric::kBoolean: + return metric.boolean().kind(); + case protobuf::Metric::kEnum8: + default: + return std::nullopt; + } +} +} + /// This class is used for creating descriptive counters that are contiguous in /// memory, to allow for fast access and arithmetic operations. -/// -/// The class preallocates memory at construction with the following -/// layout -/// -/// 1. Header of 10 bytes -/// * Is big endian (1 byte) -/// * Protocol version (1 byte) -/// * Total name bytes (2 bytes) -/// * Total description bytes (2 bytes) -/// * Number of 8-byte-value metrics (2 bytes) -/// * Number of 1-byte-value metrics (2 bytes) -/// 2. The name sizes in bytes (2 bytes per metric) -/// 3. The description sizes in bytes (2 bytes per metric) -/// 4. The names of the metrics (? bytes) -/// 5. The descriptions of the metrics (? bytes) -/// 6. The types of metrics (1 byte per metric) -/// 7. The flags of the metrics; initialized, constant. (1 byte per metric) -/// 8. Alignment padding (if needed, max 7 bytes) -/// 9. The 8-byte-values (8 bytes per 8-byte metric) -/// 10. The 1-byte-values (1 byte per 1-byte metric) -/// 11. A bitmap of the initialized metrics (1 byte per 8 metrics) -/// -/// 1-8 are static and are only written once, 9-11 are dynamic and are updated -/// whenever a metric is initialized and updated. -/// class metrics { - public: /// Default constructor /// No metrics will be contained within this object. - metrics(); + metrics() = default; + + /// Move constructor + /// @param other The metrics to move from. + metrics(metrics&& other) noexcept : + m_data(other.m_data), m_metadata(std::move(other.m_metadata)), + m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), + m_value_bytes(other.m_value_bytes), + m_initialized(std::move(other.m_initialized)) + { + other.m_data = nullptr; + other.m_metadata = protobuf::MetricsMetadata(); + other.m_hash = 0; + other.m_metadata_bytes = 0; + other.m_value_bytes = 0; + other.m_initialized.clear(); + } /// Constructor /// @param info The info of the metrics in a pointer. /// @param count The number of infos. - metrics(const metric_info* info, std::size_t count); - - /// Delegate Constructor. Will pass a size-deduced array to the pointer/size - /// constructor - /// @param info The info of the metrics that will be contained within this - /// object with types, names and descriptions - template - metrics(const metric_info (&info)[N]) : metrics(info, N) + metrics(const std::map& infos) { + m_metadata = protobuf::MetricsMetadata(); + m_metadata.set_protocol_version(protocol_version()); + m_metadata.set_endianness(endian::is_big_endian() + ? protobuf::Endianness::BIG + : protobuf::Endianness::LITTLE); + + // The first byte is reserved for the sync value + m_value_bytes = sizeof(uint32_t); + + for (auto [name, value] : infos) + { + protobuf::Metric metric; + metric.set_offset(m_value_bytes); + + // The offset is incremented by one byte which represents whether + // the metric is set or not. + m_value_bytes += 1; + + if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_uint64()->set_description(m->description); + metric.mutable_uint64()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_uint64()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_uint64()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_uint64()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_int64()->set_description(m->description); + metric.mutable_int64()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_int64()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_int64()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_int64()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_uint32()->set_description(m->description); + metric.mutable_uint32()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_uint32()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_uint32()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_uint32()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_int32()->set_description(m->description); + metric.mutable_int32()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_int32()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_int32()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_int32()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_float64()->set_description(m->description); + metric.mutable_float64()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_float64()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_float64()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_float64()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_float32()->set_description(m->description); + metric.mutable_float32()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_float32()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_float32()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_float32()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_boolean()->set_description(m->description); + metric.mutable_boolean()->set_kind(m->kind); + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += size_of_type(); + + metric.mutable_enum8()->set_description(m->description); + for (auto [key, value] : m->values) + { + auto enum_value = protobuf::EnumValue(); + enum_value.set_name(value.name); + if (!value.description.empty()) + { + enum_value.set_description(value.description); + } + + metric.mutable_enum8()->mutable_values()->insert( + {key, enum_value}); + } + } + + m_metadata.mutable_metrics()->insert({name, metric}); + m_initialized[name] = false; + } + + // Set the sync value to 1 so that the size of the metadata is + // calculated correctly + m_metadata.set_sync_value(1); + + m_metadata_bytes = m_metadata.ByteSizeLong(); + m_data = new uint8_t[m_metadata_bytes + m_value_bytes]; + + // Serialize the metadata + m_metadata.SerializeToArray(m_data, m_metadata_bytes); + + // Calculate the hash of the metadata + m_hash = detail::hash_function(m_data, m_metadata_bytes); + + // Update the sync value + m_metadata.set_sync_value(m_hash); + + // Serialize the metadata again to include the sync value + m_metadata.SerializeToArray(m_data, m_metadata_bytes); + + // Make sure the metadata didn't change unexpectedly + assert(m_metadata.ByteSizeLong() == m_metadata_bytes); + + // Write the sync value to the first byte of the value data (this will + // be written as the endianess of the system) + // Consuming code can use the endianness field in the metadata to + // read the sync value + std::memcpy(m_data + m_metadata_bytes, &m_hash, sizeof(uint32_t)); } - /// Constructor. - /// @param infos The infos of the metrics. - metrics(const std::vector& infos) : - metrics(infos.data(), infos.size()) + /// Destructor + ~metrics() { + if (m_data != nullptr) + delete[] m_data; } - /// Move constructor - /// @param other The metrics to move from. - metrics(metrics&& other) noexcept; - - /// Move assignment - auto operator=(metrics&& other) noexcept -> metrics&; + /// @return the pointer to the value data of the metrics. + auto value_data() const -> const uint8_t* + { + return m_data + m_metadata_bytes; + } - /// Destructor - ~metrics(); + /// @return the size of the value data of the metrics. + auto value_bytes() const -> std::size_t + { + return m_value_bytes; + } - /// @returns the pointer to the metadata of the metrics. - auto meta_data() const -> const uint8_t*; + auto metadata_data() const -> const uint8_t* + { + return m_data; + } - /// @return the size of the metadata of the metrics. - auto meta_bytes() const -> std::size_t; + auto metadata() const -> const protobuf::MetricsMetadata& + { + return m_metadata; + } - /// @returns the pointer to the value data of the metrics. - auto value_data() const -> const uint8_t*; + auto metadata_bytes() const -> std::size_t + { + return m_metadata_bytes; + } - /// @return the size of the value data of the metrics. - auto value_bytes() const -> std::size_t; - - /// @returns the number of metrics - auto count() const -> std::size_t; - - /// Gets the protocol version of the metrics - /// @return The protocol version of the metrics - auto protocol_version() const -> uint8_t; - - /// @returns true if the metric is initialized, that is if - /// initialize_metric() has been called for the given index. - /// @param index The index of the metric to check. Must be less than - /// count(). - auto is_initialized(std::size_t index) const -> bool; - - /// @returns the name of the metric at the given index. - /// The name is not written into memory until the metric is initialized with - /// either initialize_metric<>() or initialize_constant(). - /// @param index The index of the metric to check. Must be less than - /// count(). - auto name(std::size_t index) const -> std::string; - - /// @returns the description of the metric at the given index. - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto description(std::size_t index) const -> std::string; - - /// @returns the unit of the metric at the given index. - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto unit(std::size_t index) const -> std::string; - - /// @returns true if the value of the metric is of type uint64_t - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto is_uint64(std::size_t index) const -> bool; - - /// @returns true if the value of the metric is of type int64_t - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto is_int64(std::size_t index) const -> bool; - - /// @returns true if the value of the metric is of type double - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto is_float64(std::size_t index) const -> bool; - - /// @returns true if the value of the metric is of type bool - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto is_boolean(std::size_t index) const -> bool; - - /// @returns The kind of metric at the given index. counter, gauge or - /// constant - /// @param index The index of the metric to check. Must be less than - /// count(). - auto kind(std::size_t index) const -> abacus::kind; - - /// @returns A wrapper for a counter at the given index with type - /// appropriate with given enum. - /// - /// This function writes the name, description, value, etc. for this index - /// into memory, such that only data for initialized metrics will be - /// available when extracting the memory through copy_storage(). - /// - /// The templated type must match the one given through the - /// metric_info used for the constructor. The indices of the metrics do not - /// match the ones in the info, so use index() to get the correct - /// index. Please do not hard-code this, as this may break with changes to - /// yours or our code. - /// - /// @param name The name of the metric. This is used for a check to ensure - /// that the name matches the one at the given index. - template - auto initialize_metric(const std::string& name) const -> metric + template + auto initialize_metric(const std::string& name, + std::optional value = + std::nullopt) -> typename Metric::metric { - using value_type = typename metric::value_type; + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + auto kind = get_kind(proto_metric); + if (kind.has_value()) + { + assert(kind.value() != protobuf::Kind::CONSTANT); + } + + auto offset = proto_metric.offset(); + + if (value.has_value()) + { + return typename Metric::metric(m_data + m_metadata_bytes + offset, + value.value()); + } + else + { + return typename Metric::metric(m_data + m_metadata_bytes + offset); + } + } - auto index = metrics::index(name); - value_type* value_ptr = (value_type*)initialize(index); + template + void initialize_constant(const std::string& name, + typename Metric::type value) + { + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; + + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + auto offset = proto_metric.offset(); + auto kind = get_kind(proto_metric); + assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); + typename Metric::metric(m_data + m_metadata_bytes + offset, value); + } - return metric{value_ptr}; + auto is_initialized(const std::string& name) const -> bool + { + assert(m_initialized.find(name) != m_initialized.end()); + return m_initialized.at(name); } - /// Initialize a constant uint64_t metric at the given index. - /// - /// A constant metric that is initialized with a value and never reset. - /// The value is written into memory at the time of initialization and - /// cannot be altered within the same runtime-environment. - /// - /// The indices of the metrics do not - /// match the ones in the info, so use index() to get the correct - /// index. Please do not hard-code this, as this may break with changes to - /// yours or our code. - /// - /// @param value The value of the constant. A uint64_t value. - /// @param name The name of the metric. This is used for a check to ensure - /// that the name matches the one at the given index. - template - void - initialize_constant(const std::string& name, - typename metric::value_type value) const + /// @return true if all metrics have been initialized + auto is_initialized() const -> bool { - assert(m_meta_data != nullptr); - auto index = metrics::index(name); - assert(kind(index) == abacus::kind::constant); - *static_cast::value_type*>( - initialize(index)) = value; + for (auto [name, initialized] : m_initialized) + { + if (!initialized) + { + return false; + } + } + return true; } - /// Copy the value of the uint64_t metric into a passed reference. This is - /// used to extract the values during runtime. - /// - /// Make sure that the type and index are correct using is_uint64() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A uint64_t reference. - void value(std::size_t index, uint64_t& value) const; - - /// Copy the value of the int64_t metric into a passed reference. This is - /// used to extract the values during runtime. - /// - /// Make sure that the type and index are correct using is_int64() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A int64_t reference. - void value(std::size_t index, int64_t& value) const; - - /// Copy the value of the double metric into a passed reference. This is - /// used to extract the values during runtime. - /// - /// Make sure that the type and index are correct using is_float64() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A double reference. - void value(std::size_t index, double& value) const; - - /// Copy the value of the bool metric into a passed reference. This is used - /// to extract the values during runtime. - /// - /// Make sure that the type and index are correct using is_boolean() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A bool reference. - void value(std::size_t index, bool& value) const; - - /// @returns The index of a metric with the given name. Throws an assert if - /// no metric is found with the given name. Returns the numeric max of - /// std::size_t if asserts are disabled. - /// - /// @param name The name of the metric. - auto index(const std::string& name) const -> std::size_t; - - /// Resets the values of all initialized and non-constant metrics. - void reset_metrics(); - - /// Resets the value of the metric at the given index. The metric must not - /// be constant and must be initialized. - /// - /// @param index the index of the metric to reset. Must be less than - /// count() - void reset_metric(std::size_t index); + void reset_metrics() + { + // Reset the value data + std::memset(m_data + m_metadata_bytes + sizeof(uint32_t), 0, + m_value_bytes - sizeof(uint32_t)); + } private: /// No copy @@ -288,21 +399,18 @@ class metrics metrics& operator=(metrics&) = delete; private: - /// initialize the metrics - auto initialize(std::size_t index) const -> void*; + /// The raw memory for the metadata and value data + uint8_t* m_data = nullptr; -private: /// The info of the metrics separated by byte-sizes - detail::value_size_info m_info; + protobuf::MetricsMetadata m_metadata; - /// Map to get index from names - std::map m_name_to_index; + uint32_t m_hash; - /// The raw memory for the metadata - uint8_t* m_meta_data = nullptr; + std::size_t m_metadata_bytes; + std::size_t m_value_bytes = 1337; - /// The raw memory for the value data - uint8_t* m_value_data = nullptr; + std::map m_initialized; }; } } diff --git a/src/abacus/metrics2.hpp b/src/abacus/metrics2.hpp deleted file mode 100644 index 80f85738..00000000 --- a/src/abacus/metrics2.hpp +++ /dev/null @@ -1,413 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "detail/hash_function.hpp" -#include "protocol_version.hpp" -#include "type2.hpp" -#include "version.hpp" - -#include "protobuf/metrics.pb.h" - -#include - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -template -static auto size_of_type() -> std::size_t -{ - return sizeof(typename std::remove_pointer::type::type); -} - -static inline auto -get_kind(const protobuf::Metric& metric) -> std::optional -{ - switch (metric.type_case()) - { - case protobuf::Metric::kUint64: - return metric.uint64().kind(); - case protobuf::Metric::kInt64: - return metric.int64().kind(); - case protobuf::Metric::kUint32: - return metric.uint32().kind(); - case protobuf::Metric::kInt32: - return metric.int32().kind(); - case protobuf::Metric::kFloat64: - return metric.float64().kind(); - case protobuf::Metric::kFloat32: - return metric.float32().kind(); - case protobuf::Metric::kBoolean: - return metric.boolean().kind(); - case protobuf::Metric::kEnum8: - default: - return std::nullopt; - } -} - -/// This class is used for creating descriptive counters that are contiguous in -/// memory, to allow for fast access and arithmetic operations. -class metrics2 -{ -public: - /// Default constructor - /// No metrics will be contained within this object. - metrics2() = default; - - /// Move constructor - /// @param other The metrics to move from. - metrics2(metrics2&& other) noexcept : - m_data(other.m_data), m_metadata(std::move(other.m_metadata)), - m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), - m_value_bytes(other.m_value_bytes), - m_initialized(std::move(other.m_initialized)) - { - other.m_data = nullptr; - other.m_metadata = protobuf::MetricsMetadata(); - other.m_hash = 0; - other.m_metadata_bytes = 0; - other.m_value_bytes = 0; - other.m_initialized.clear(); - } - - /// Constructor - /// @param info The info of the metrics in a pointer. - /// @param count The number of infos. - metrics2(const std::map& infos) - { - m_metadata = protobuf::MetricsMetadata(); - m_metadata.set_protocol_version(protocol_version()); - m_metadata.set_endianness(endian::is_big_endian() - ? protobuf::Endianness::BIG - : protobuf::Endianness::LITTLE); - - // The first byte is reserved for the sync value - m_value_bytes = sizeof(uint32_t); - - for (auto [name, value] : infos) - { - protobuf::Metric metric; - metric.set_offset(m_value_bytes); - - // The offset is incremented by one byte which represents whether - // the metric is set or not. - m_value_bytes += 1; - - if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_uint64()->set_description(m->description); - metric.mutable_uint64()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_uint64()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_uint64()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_uint64()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_int64()->set_description(m->description); - metric.mutable_int64()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_int64()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_int64()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_int64()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_uint32()->set_description(m->description); - metric.mutable_uint32()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_uint32()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_uint32()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_uint32()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_int32()->set_description(m->description); - metric.mutable_int32()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_int32()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_int32()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_int32()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_float64()->set_description(m->description); - metric.mutable_float64()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_float64()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_float64()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_float64()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_float32()->set_description(m->description); - metric.mutable_float32()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_float32()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_float32()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_float32()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_boolean()->set_description(m->description); - metric.mutable_boolean()->set_kind(m->kind); - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_enum8()->set_description(m->description); - for (auto [key, value] : m->values) - { - auto enum_value = protobuf::EnumValue(); - enum_value.set_name(value.name); - if (!value.description.empty()) - { - enum_value.set_description(value.description); - } - - metric.mutable_enum8()->mutable_values()->insert( - {key, enum_value}); - } - } - - m_metadata.mutable_metrics()->insert({name, metric}); - m_initialized[name] = false; - } - - // Set the sync value to 1 so that the size of the metadata is - // calculated correctly - m_metadata.set_sync_value(1); - - m_metadata_bytes = m_metadata.ByteSizeLong(); - m_data = new uint8_t[m_metadata_bytes + m_value_bytes]; - - // Serialize the metadata - m_metadata.SerializeToArray(m_data, m_metadata_bytes); - - // Calculate the hash of the metadata - m_hash = detail::hash_function(m_data, m_metadata_bytes); - - // Update the sync value - m_metadata.set_sync_value(m_hash); - - // Serialize the metadata again to include the sync value - m_metadata.SerializeToArray(m_data, m_metadata_bytes); - - // Make sure the metadata didn't change unexpectedly - assert(m_metadata.ByteSizeLong() == m_metadata_bytes); - - // Write the sync value to the first byte of the value data (this will - // be written as the endianess of the system) - // Consuming code can use the endianness field in the metadata to - // read the sync value - std::memcpy(m_data + m_metadata_bytes, &m_hash, sizeof(uint32_t)); - } - - /// Destructor - ~metrics2() - { - if (m_data != nullptr) - delete[] m_data; - } - - /// @return the pointer to the value data of the metrics. - auto value_data() const -> const uint8_t* - { - return m_data + m_metadata_bytes; - } - - /// @return the size of the value data of the metrics. - auto value_bytes() const -> std::size_t - { - return m_value_bytes; - } - - auto metadata_data() const -> const uint8_t* - { - return m_data; - } - - auto metadata() const -> const protobuf::MetricsMetadata& - { - return m_metadata; - } - - auto metadata_bytes() const -> std::size_t - { - return m_metadata_bytes; - } - - template - auto initialize_metric(const std::string& name, - std::optional value = - std::nullopt) -> typename Metric::metric - { - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); - auto kind = get_kind(proto_metric); - if (kind.has_value()) - { - assert(kind.value() != protobuf::Kind::CONSTANT); - } - - auto offset = proto_metric.offset(); - - if (value.has_value()) - { - return typename Metric::metric(m_data + m_metadata_bytes + offset, - value.value()); - } - else - { - return typename Metric::metric(m_data + m_metadata_bytes + offset); - } - } - - template - void initialize_constant(const std::string& name, - typename Metric::type value) - { - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); - auto offset = proto_metric.offset(); - auto kind = get_kind(proto_metric); - assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); - typename Metric::metric(m_data + m_metadata_bytes + offset, value); - } - - auto is_initialized(const std::string& name) const -> bool - { - assert(m_initialized.find(name) != m_initialized.end()); - return m_initialized.at(name); - } - - /// @return true if all metrics have been initialized - auto is_initialized() const -> bool - { - for (auto [name, initialized] : m_initialized) - { - if (!initialized) - { - return false; - } - } - return true; - } - - void reset_metrics() - { - // Reset the value data - std::memset(m_data + m_metadata_bytes + sizeof(uint32_t), 0, - m_value_bytes - sizeof(uint32_t)); - } - -private: - /// No copy - metrics2(metrics2&) = delete; - - /// No copy assignment - metrics2& operator=(metrics2&) = delete; - -private: - /// The raw memory for the metadata and value data - uint8_t* m_data = nullptr; - - /// The info of the metrics separated by byte-sizes - protobuf::MetricsMetadata m_metadata; - - uint32_t m_hash; - - std::size_t m_metadata_bytes; - std::size_t m_value_bytes = 1337; - - std::map m_initialized; -}; -} -} diff --git a/src/abacus/min.hpp b/src/abacus/min.hpp index d1fec675..324f4c62 100644 --- a/src/abacus/min.hpp +++ b/src/abacus/min.hpp @@ -14,39 +14,22 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { +/// Stronly typed min value for a metric template -struct min2 +struct min { - min2() = default; - explicit min2(T value) : value(value) - { - } - - std::optional value; -}; - -union min -{ - min(uint64_t value) : m_uint(value) - { - } - - min(double value) : m_double(value) - { - } + /// Default constructor + min() = default; - min(int64_t value) : m_int(value) + /// Constructor + /// @param value The minimum value + explicit min(T value) : value(value) { } - min() : m_uint(0) - { - } - - uint64_t m_uint; - double m_double; - int64_t m_int; + /// The minimum value + std::optional value; }; } } diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index 0a303161..c7535ca4 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -12,7 +12,7 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -auto to_json(const view2& view, bool minimal) -> std::string +auto to_json(const view& view, bool minimal) -> std::string { bourne::json json = detail::to_json(view, minimal); return json.dump(); @@ -22,7 +22,7 @@ auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, const uint8_t* value_data, std::size_t value_bytes, bool minimal) -> std::string { - view2 v; + view v; v.set_meta_data(metadata_data, metadata_bytes); v.set_value_data(value_data, value_bytes); return to_json(v, minimal); diff --git a/src/abacus/to_json.hpp b/src/abacus/to_json.hpp index abd9650e..e08e385b 100644 --- a/src/abacus/to_json.hpp +++ b/src/abacus/to_json.hpp @@ -8,7 +8,7 @@ #include #include "version.hpp" -#include "view2.hpp" +#include "view.hpp" namespace abacus { @@ -28,6 +28,6 @@ auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, /// @param view A view with access to metrics-data. /// @param minimal If true, the JSON will be slimmed down to only contain the /// the value data. -auto to_json(const view2& view, bool minimal = false) -> std::string; +auto to_json(const view& view, bool minimal = false) -> std::string; } } diff --git a/src/abacus/to_string.cpp b/src/abacus/to_string.cpp deleted file mode 100644 index 860a4f0c..00000000 --- a/src/abacus/to_string.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#include "to_string.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -std::string to_string(abacus::kind kind) -{ - switch (kind) - { - case abacus::kind::counter: - return "counter"; - case abacus::kind::gauge: - return "gauge"; - case abacus::kind::constant: - return "constant"; - default: - return "unknown"; - } -} - -} -} diff --git a/src/abacus/to_string.hpp b/src/abacus/to_string.hpp deleted file mode 100644 index 0fbb5069..00000000 --- a/src/abacus/to_string.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include "kind.hpp" -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -std::string to_string(abacus::kind kind); - -} -} diff --git a/src/abacus/type.hpp b/src/abacus/type.hpp index 34c77d0c..dc70c07c 100644 --- a/src/abacus/type.hpp +++ b/src/abacus/type.hpp @@ -5,28 +5,33 @@ #pragma once -#include "version.hpp" +#include #include +#include +#include +#include +#include +#include "detail/common.hpp" +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "unit.hpp" + +#include "boolean.hpp" +#include "enum8.hpp" +#include "float32.hpp" +#include "float64.hpp" +#include "int32.hpp" +#include "int64.hpp" +#include "uint32.hpp" +#include "uint64.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { - -/// Enum used to declare and identify the types of the metric objects. -enum class type : uint8_t -{ - /// uint64_t type - uint64 = 0U, - - /// int64_t type - int64, - - /// double type - float64, - - /// bool type - boolean -}; +/// A variant type for all the supported metric types +using type = std::variant; } } diff --git a/src/abacus/type2.hpp b/src/abacus/type2.hpp deleted file mode 100644 index 5e57d56f..00000000 --- a/src/abacus/type2.hpp +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "max.hpp" -#include "min.hpp" -#include "protobuf/kind.pb.h" -#include "unit.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -namespace detail -{ -template -struct common -{ - using type = typename T::type; - using metric = typename T::metric; - /// Default constructor - common() = default; - - common(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(type) + 1); - } - - common(uint8_t* memory, type value) : m_memory(memory) - { - assert(m_memory != nullptr); - set_value(value); - } - - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - - auto value() const -> type - { - assert(is_initialized()); - assert(has_value()); - type value; - std::memcpy(&value, m_memory + 1, sizeof(value)); - return value; - } - - auto set_value(type value) -> void - { - assert(is_initialized()); - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - m_memory[0] = 1; - std::memcpy(m_memory + 1, &value, sizeof(value)); - } - - /// Assign the counter a new value - /// @param value The value to assign - /// @return a counter with the new value - auto operator=(type value) -> metric& - { - assert(is_initialized()); - set_value(value); - return (metric&)*this; - } - - /// Increment the counter - /// @param value The value to add - /// @return The result of the arithmetic - auto operator+=(type value) -> metric& - { - assert(has_value()); - auto new_value = this->value() + value; - assert(!std::isnan(new_value) && "Cannot assign a NaN"); - assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; - } - - /// Decrement the counter - /// @param value The value to subtract - /// @return The result of the arithmetic - auto operator-=(type value) -> metric& - { - assert(has_value()); - auto new_value = this->value() - value; - assert(!std::isnan(new_value) && "Cannot assign a NaN"); - assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; - } - - /// Increment the value of the counter - /// @return The result of the arithmetic - auto operator++() -> metric& - { - assert(has_value()); - auto new_value = value() + 1; - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; - } - - /// Decrement the value of the counter - /// @return The result of the arithmetic - auto operator--() -> metric& - { - auto new_value = value() - 1; - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; - } - -protected: - /// The metric memory - uint8_t* m_memory = nullptr; -}; -} - -using kind = protobuf::Kind; - -struct uint64 -{ - using type = uint64_t; - struct metric : public detail::common - { - using detail::common::common; - using detail::common::operator=; - }; - - abacus::kind kind; - std::string description; - abacus::unit unit{}; - abacus::min2 min{}; - abacus::max2 max{}; -}; -struct int64 -{ - using type = int64_t; - struct metric : public detail::common - { - using detail::common::common; - using detail::common::operator=; - }; - abacus::kind kind; - std::string description; - abacus::unit unit{}; - abacus::min2 min{}; - abacus::max2 max{}; -}; -struct uint32 -{ - using type = uint32_t; - struct metric : public detail::common - { - using detail::common::common; - using detail::common::operator=; - }; - abacus::kind kind; - std::string description; - abacus::unit unit{}; - abacus::min2 min{}; - abacus::max2 max{}; -}; -struct int32 -{ - using type = int32_t; - struct metric : public detail::common - { - using detail::common::common; - using detail::common::operator=; - }; - abacus::kind kind; - std::string description; - abacus::unit unit{}; - abacus::min2 min{}; - abacus::max2 max{}; -}; -struct float64 -{ - using type = double; - struct metric : public detail::common - { - using detail::common::common; - using detail::common::operator=; - }; - abacus::kind kind; - std::string description; - abacus::unit unit{}; - abacus::min2 min{}; - abacus::max2 max{}; -}; -struct float32 -{ - using type = float; - struct metric : public detail::common - { - using detail::common::common; - using detail::common::operator=; - }; - abacus::kind kind; - std::string description; - abacus::unit unit{}; - abacus::min2 min{}; - abacus::max2 max{}; -}; -struct boolean -{ - using type = bool; - struct metric - { - metric() = default; - - metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(type) + 1); - } - - metric(uint8_t* memory, type value) : m_memory(memory) - { - assert(m_memory != nullptr); - set_value(value); - } - - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - - auto value() const -> type - { - assert(is_initialized()); - return m_memory[1]; - } - - auto set_value(type value) -> void - { - assert(is_initialized()); - m_memory[0] = 1; - m_memory[1] = value; - } - - /// Assign the counter a new value - /// @param value The value to assign - /// @return a counter with the new value - auto operator=(type value) -> metric& - { - assert(is_initialized()); - set_value(value); - return *this; - } - - private: - /// The metric memory - uint8_t* m_memory = nullptr; - }; - abacus::kind kind; - std::string description; -}; - -struct enum8 -{ - using type = uint8_t; - struct metric - { - metric() = default; - - metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(type) + 1); - } - - metric(uint8_t* memory, type value) : m_memory(memory) - { - assert(m_memory != nullptr); - set_value(value); - } - - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - - auto value() const -> type - { - assert(is_initialized()); - return m_memory[1]; - } - - auto set_value(type value) -> void - { - assert(is_initialized()); - m_memory[0] = 1; - m_memory[1] = value; - } - - /// Assign the counter a new value - /// @param value The value to assign - /// @return a counter with the new value - auto operator=(type value) -> metric& - { - assert(is_initialized()); - set_value(value); - return *this; - } - - private: - /// The metric memory - uint8_t* m_memory = nullptr; - }; - - struct value - { - std::string name; - std::string description; - }; - std::string description; - std::map values; - abacus::unit unit{}; -}; -using type2 = std::variant; -} -} diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp new file mode 100644 index 00000000..01b71f63 --- /dev/null +++ b/src/abacus/uint32.hpp @@ -0,0 +1,51 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "detail/common.hpp" + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A 32-bit integer metric +struct uint32 +{ + /// The primitive type of the metric + using type = uint32_t; + + /// The metric type + struct metric : public detail::common + { + /// Inherit the constructors and various operators from the common class + using detail::common::common; + + /// Inherit the assignment operator from the common class + using detail::common::operator=; + }; + + /// The metric kind + abacus::kind kind; + + /// The metric description + std::string description; + + /// The unit of the metric + abacus::unit unit{}; + + /// The minimum value of the metric + abacus::min min{}; + + /// The maximum value of the metric + abacus::max max{}; +}; +} +} diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp new file mode 100644 index 00000000..070497cd --- /dev/null +++ b/src/abacus/uint64.hpp @@ -0,0 +1,51 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "detail/common.hpp" + +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A 64-bit integer metric +struct uint64 +{ + /// The primitive type of the metric + using type = uint64_t; + + /// The metric type + struct metric : public detail::common + { + /// Inherit the constructors and various operators from the common class + using detail::common::common; + + /// Inherit the assignment operator from the common class + using detail::common::operator=; + }; + + /// The metric kind + abacus::kind kind; + + /// The metric description + std::string description; + + /// The unit of the metric + abacus::unit unit{}; + + /// The minimum value of the metric + abacus::min min{}; + + /// The maximum value of the metric + abacus::max max{}; +}; +} +} diff --git a/src/abacus/unit.hpp b/src/abacus/unit.hpp index 6fd3dae9..8e66f8f9 100644 --- a/src/abacus/unit.hpp +++ b/src/abacus/unit.hpp @@ -12,7 +12,7 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -/// Wrapper for a unit string for more explicit code +/// Strongly typed unit for a metric struct unit { /// Default constructor @@ -23,7 +23,6 @@ struct unit { } - /// @brief Check if the unit is empty /// @return True if the unit is empty otherwise false bool empty() const { diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp deleted file mode 100644 index 8c132433..00000000 --- a/src/abacus/view.cpp +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#include -#include - -#include "detail/raw.hpp" -#include "view.hpp" - -#include -#include - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ - -void view::set_meta_data(const uint8_t* meta_data) -{ - m_meta_data = meta_data; - m_value_data = nullptr; - - for (std::size_t i = 0; i < count(); ++i) - { - m_name_to_index.emplace(name(i), i); - } -} - -void view::set_value_data(const uint8_t* value_data) -{ - assert(m_meta_data != nullptr); - m_value_data = value_data; -} - -const uint8_t* view::meta_data() const -{ - return m_meta_data; -} - -const uint8_t* view::value_data() const -{ - return m_value_data; -} - -std::size_t view::meta_bytes() const -{ - return detail::meta_bytes(m_meta_data); -} - -std::size_t view::value_bytes() const -{ - return detail::value_bytes(m_meta_data); -} - -auto view::count() const -> uint16_t -{ - return detail::metric_count(m_meta_data); -} - -auto view::protocol_version() const -> uint8_t -{ - return detail::protocol_version(m_meta_data); -} - -auto view::is_initialized(std::size_t index) const -> bool -{ - assert(index < count()); - return detail::is_metric_initialized(m_meta_data, m_value_data, index); -} - -auto view::name(std::size_t index) const -> std::string -{ - return {detail::name(m_meta_data, index), - detail::name_size(m_meta_data, index)}; -} - -auto view::description(std::size_t index) const -> std::string -{ - return {detail::description(m_meta_data, index), - detail::description_size(m_meta_data, index)}; -} - -auto view::unit(std::size_t index) const -> std::string -{ - return {detail::unit(m_meta_data, index), - detail::unit_size(m_meta_data, index)}; -} - -auto view::type(std::size_t index) const -> abacus::type -{ - return detail::type(m_meta_data, index); -} - -auto view::kind(std::size_t index) const -> abacus::kind -{ - return detail::kind(m_meta_data, index); -} - -auto view::min(std::size_t index) const -> abacus::min -{ - switch (type(index)) - { - case abacus::type::boolean: - return detail::min_value(m_meta_data, index); - case abacus::type::uint64: - return detail::min_value(m_meta_data, index); - case abacus::type::int64: - return detail::min_value(m_meta_data, index); - case abacus::type::float64: - return detail::min_value(m_meta_data, index); - default: - assert(false && "Unknown type"); - return abacus::min{}; - } -} - -auto view::max(std::size_t index) const -> abacus::max -{ - switch (type(index)) - { - case abacus::type::boolean: - return detail::max_value(m_meta_data, index); - case abacus::type::uint64: - return detail::max_value(m_meta_data, index); - case abacus::type::int64: - return detail::max_value(m_meta_data, index); - case abacus::type::float64: - return detail::max_value(m_meta_data, index); - default: - assert(false && "Unknown type"); - return abacus::max{}; - } -} - -void view::value(std::size_t index, bool& value) const -{ - assert(is_initialized(index)); - assert(type(index) == abacus::type::boolean); - value = detail::value(m_meta_data, m_value_data, index); -} - -void view::value(std::size_t index, uint64_t& value) const -{ - assert(is_initialized(index)); - assert(type(index) == abacus::type::uint64); - value = detail::value(m_meta_data, m_value_data, index); -} - -void view::value(std::size_t index, int64_t& value) const -{ - assert(is_initialized(index)); - assert(type(index) == abacus::type::int64); - value = detail::value(m_meta_data, m_value_data, index); -} - -void view::value(std::size_t index, double& value) const -{ - assert(is_initialized(index)); - assert(type(index) == abacus::type::float64); - value = detail::value(m_meta_data, m_value_data, index); -} - -auto view::index(const std::string& name) const -> std::size_t -{ - return m_name_to_index.at(name); -} - -} -} diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index fb8f131f..26a30565 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -9,9 +9,14 @@ #include #include -#include "kind.hpp" +#include +#include +#include + +#include "detail/hash_function.hpp" #include "max.hpp" #include "min.hpp" +#include "protobuf/metrics.pb.h" #include "type.hpp" #include "version.hpp" @@ -26,8 +31,7 @@ inline namespace STEINWURF_ABACUS_VERSION /// copied to a data buffer. abacus::view can then be used to extract the /// information from the metrics-data. /// -/// The class cannot manipulate the memory, only access the -/// pointed to values +/// The class cannot manipulate the memory, only access the values. /// /// Note that this class has no constructor, so it can only be declared and /// then view.set_meta_data() can be called to initialize the view with the @@ -36,152 +40,147 @@ inline namespace STEINWURF_ABACUS_VERSION /// view.set_value_data() can be called again. class view { - public: /// Sets the meta data pointer /// @param meta_data The meta data pointer - void set_meta_data(const uint8_t* meta_data); + void set_meta_data(const uint8_t* metadata_data, std::size_t metadata_bytes) + { + assert(metadata_data != nullptr); + m_metadata_data = metadata_data; + m_metadata_bytes = metadata_bytes; + m_value_data = nullptr; + m_value_bytes = 0; + + m_metadata.ParseFromArray(metadata_data, metadata_bytes); + } /// Sets the value data pointer /// @param value_data The value data pointer - void set_value_data(const uint8_t* value_data); + /// @return true if the hash is correct otherwise false + auto set_value_data(const uint8_t* value_data, + std::size_t value_bytes) -> bool + { + assert(m_metadata_data != nullptr); + assert(value_data != nullptr); + + // Check that the hash is correct + uint32_t value_data_hash = 0; + switch (m_metadata.endianness()) + { + case protobuf::Endianness::BIG: + endian::big_endian::get(value_data_hash, value_data); + break; + case protobuf::Endianness::LITTLE: + endian::little_endian::get(value_data_hash, value_data); + break; + default: + assert(false); + } + + if (m_metadata.sync_value() != value_data_hash) + { + return false; + } + m_value_data = value_data; + m_value_bytes = value_bytes; + return true; + } /// Gets the meta data pointer /// @return The meta data pointer - const uint8_t* meta_data() const; + auto metadata_data() const -> const uint8_t* + { + return m_metadata_data; + } /// Gets the value data pointer /// @return The value data pointer - const uint8_t* value_data() const; + const uint8_t* value_data() const + { + return m_value_data; + } /// Gets the meta data size in bytes /// @return The meta data size in bytes - std::size_t meta_bytes() const; + std::size_t metadata_bytes() const + { + return m_metadata_bytes; + } /// Gets the value data size in bytes /// @return The value data size in bytes - std::size_t value_bytes() const; - - /// @return the number of metrics from in a metrics data pointer - auto count() const -> uint16_t; - - /// Gets the protocol version of the metrics - /// @return The protocol version of the metrics - auto protocol_version() const -> uint8_t; - - /// @returns true if the metric is initialized, that is if - /// initialize_metric() has been called for the given index. - /// @param index The index of the metric to check. Must be less than - /// count(). - auto is_initialized(std::size_t index) const -> bool; - - /// @returns the name of the metric at the given index. - /// The name is not written into memory until the metric is initialized with - /// either initialize_metric<>() or initialize_constant(). - /// @param index The index of the metric to check. Must be less than - /// count(). - auto name(std::size_t index) const -> std::string; - - /// @returns the description of the metric at the given index. - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto description(std::size_t index) const -> std::string; - - /// @returns the unit of the metric at the given index. - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto unit(std::size_t index) const -> std::string; - - /// @returns the type of the metric at the given index. - /// @param index The index of the metric to check. Must be less than - /// count(). - auto type(std::size_t index) const -> abacus::type; - - /// @returns true if the metric at the given index is a constant, otherwise - /// false. - /// @param index The index of the metric to check. Must be less than - /// count(). - auto kind(std::size_t index) const -> abacus::kind; - - /// @returns the minimum value of the metric at the given index. - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto min(std::size_t index) const -> abacus::min; - - /// @returns the maximum value of the metric at the given index. - /// @param index The index of the metric to check. Must be less than - /// count() and initialized with initialize_metric<>() or - /// initialize_constant(). - auto max(std::size_t index) const -> abacus::max; - - /// Copy the value of the uint64_t metric into a passed reference. This is - /// used to extract the values during runtime. - /// - /// Make sure that the type and index are correct using type() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A uint64_t reference. - void value(std::size_t index, uint64_t& value) const; - - /// Copy the value of the int64_t metric into a passed reference. This is - /// used to extract the values during runtime. - /// - /// Make sure that the type and index are correct using type() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A int64_t reference. - void value(std::size_t index, int64_t& value) const; - - /// Copy the value of the double metric into a passed reference. This is - /// used to extract the values during runtime. - /// - /// Make sure that the type and index are correct using type() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A double reference. - void value(std::size_t index, double& value) const; - - /// Copy the value of the bool metric into a passed reference. This is used - /// to extract the values during runtime. - /// - /// Make sure that the type and index are correct using type() - /// and index() to get the correct index and - /// type. Please do not hard-code these values, as this may break with - /// changes to your code. - /// - /// @param index The index of the metric to copy. Must be less than - /// count(). - /// @param value The variable to copy the value into. A bool reference. - void value(std::size_t index, bool& value) const; - - /// @param name The name of the counter to get the index of - /// @return The index of the counter with the given name - auto index(const std::string& name) const -> std::size_t; + std::size_t value_bytes() const + { + return m_value_bytes; + } + + /// Gets the meta data + /// @return The meta data + auto metadata() const -> const protobuf::MetricsMetadata& + { + return m_metadata; + } + + /// Gets the value of a metric + /// @param name The name of the metric + /// @return The value of the metric or std::nullopt if the metric has no + /// value + template + auto + value(const std::string& name) const -> std::optional + { + assert(m_value_data != nullptr); + assert(m_metadata_data != nullptr); + + auto endianness = m_metadata.endianness(); + + auto offset = metric(name).offset(); + assert(offset < m_value_bytes); + + if (m_value_data[offset] == 0) + { + return std::nullopt; + } + + typename Metric::type value; + + switch (m_metadata.endianness()) + { + case protobuf::Endianness::BIG: + endian::big_endian::get(value, m_value_data + offset + 1); + break; + case protobuf::Endianness::LITTLE: + endian::little_endian::get(value, m_value_data + offset + 1); + break; + default: + assert(false); + } + return value; + } + + /// Gets the metric + /// @param name The name of the metric + /// @return The metric + const protobuf::Metric& metric(const std::string& name) const + { + return m_metadata.metrics().at(name); + } private: /// The meta data pointer - const uint8_t* m_meta_data; + const uint8_t* m_metadata_data; + + /// The meta data size in bytes + std::size_t m_metadata_bytes; + + /// The meta data + protobuf::MetricsMetadata m_metadata; /// The value data pointer const uint8_t* m_value_data; - /// Map to get index from names - std::map m_name_to_index; + /// The value data size in bytes + std::size_t m_value_bytes; }; } } diff --git a/src/abacus/view2.hpp b/src/abacus/view2.hpp deleted file mode 100644 index 716bd955..00000000 --- a/src/abacus/view2.hpp +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include - -#include -#include -#include - -#include "detail/hash_function.hpp" -#include "max.hpp" -#include "min.hpp" -#include "protobuf/metrics.pb.h" -#include "type.hpp" -#include "type2.hpp" -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -/// This class contains utility functions used to read a metrics data -/// buffer. -/// -/// It's main use-case is for when the data of a metrics object is -/// copied to a data buffer. abacus::view can then be used to extract the -/// information from the metrics-data. -/// -/// The class cannot manipulate the memory, only access the -/// pointed to values -/// -/// Note that this class has no constructor, so it can only be declared and -/// then view.set_meta_data() can be called to initialize the view with the -/// meta data, subsequently view.set_value_data() can be called to populate -/// the view with the value data. To update the view with new value data -/// view.set_value_data() can be called again. -class view2 -{ -public: - /// Sets the meta data pointer - /// @param meta_data The meta data pointer - void set_meta_data(const uint8_t* metadata_data, std::size_t metadata_bytes) - { - assert(metadata_data != nullptr); - m_metadata_data = metadata_data; - m_metadata_bytes = metadata_bytes; - m_value_data = nullptr; - m_value_bytes = 0; - - m_metadata.ParseFromArray(metadata_data, metadata_bytes); - } - - /// Sets the value data pointer - /// @param value_data The value data pointer - /// @return true if the hash is correct otherwise false - auto set_value_data(const uint8_t* value_data, - std::size_t value_bytes) -> bool - { - assert(m_metadata_data != nullptr); - assert(value_data != nullptr); - - // Check that the hash is correct - uint32_t value_data_hash = 0; - switch (m_metadata.endianness()) - { - case protobuf::Endianness::BIG: - endian::big_endian::get(value_data_hash, value_data); - break; - case protobuf::Endianness::LITTLE: - endian::little_endian::get(value_data_hash, value_data); - break; - default: - assert(false); - } - - if (m_metadata.sync_value() != value_data_hash) - { - return false; - } - m_value_data = value_data; - m_value_bytes = value_bytes; - return true; - } - - auto metadata_data() const -> const uint8_t* - { - return m_metadata_data; - } - - /// Gets the value data pointer - /// @return The value data pointer - const uint8_t* value_data() const - { - return m_value_data; - } - - /// Gets the meta data size in bytes - /// @return The meta data size in bytes - std::size_t metadata_bytes() const - { - return m_metadata_bytes; - } - - /// Gets the value data size in bytes - /// @return The value data size in bytes - std::size_t value_bytes() const - { - return m_value_bytes; - } - - auto metadata() const -> const protobuf::MetricsMetadata& - { - return m_metadata; - } - - template - auto - value(const std::string& name) const -> std::optional - { - assert(m_value_data != nullptr); - assert(m_metadata_data != nullptr); - - auto endianness = m_metadata.endianness(); - - auto offset = metric(name).offset(); - assert(offset < m_value_bytes); - - if (m_value_data[offset] == 0) - { - return std::nullopt; - } - - typename Metric::type value; - - switch (m_metadata.endianness()) - { - case protobuf::Endianness::BIG: - endian::big_endian::get(value, m_value_data + offset + 1); - break; - case protobuf::Endianness::LITTLE: - endian::little_endian::get(value, m_value_data + offset + 1); - break; - default: - assert(false); - } - return value; - } - - const protobuf::Metric& metric(const std::string& name) const - { - return m_metadata.metrics().at(name); - } - -private: - /// The meta data pointer - const uint8_t* m_metadata_data; - std::size_t m_metadata_bytes; - - protobuf::MetricsMetadata m_metadata; - - /// The value data pointer - const uint8_t* m_value_data; - std::size_t m_value_bytes; -}; -} -} diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index ed278079..6313d104 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include TEST(test_metric, constructor) { diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index bbab6000..21633a5f 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -9,19 +9,19 @@ #include -#include +#include #include TEST(test_metrics, empty) { - abacus::metrics2 metrics; + abacus::metrics metrics; EXPECT_EQ(0U, metrics.metadata().metrics().size()); - std::map infos; - abacus::metrics2 metrics2(infos); + std::map infos; + abacus::metrics metrics2(infos); - EXPECT_EQ(0U, metrics.metadata().metrics().size()); + EXPECT_EQ(0U, metrics2.metadata().metrics().size()); } TEST(test_metrics, default_constructor) @@ -33,7 +33,7 @@ TEST(test_metrics, default_constructor) std::string name4 = "metric4"; std::string name5 = "metric5"; - std::map infos = { + std::map infos = { {name0, abacus::boolean{abacus::kind::COUNTER, "A boolean metric"}}, {name1, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", @@ -48,8 +48,8 @@ TEST(test_metrics, default_constructor) "A constant floating point metric", abacus::unit{"ms"}}}}; - abacus::metrics2 from_metrics(infos); - abacus::metrics2 metrics(std::move(from_metrics)); + abacus::metrics from_metrics(infos); + abacus::metrics metrics(std::move(from_metrics)); EXPECT_EQ(metrics.metadata().metrics().size(), 6U); EXPECT_EQ(metrics.metadata().protocol_version(), abacus::protocol_version()); @@ -151,14 +151,14 @@ TEST(test_metrics, value_and_metadata_bytes) std::string name0 = "metric0"; std::string name1 = "metric1"; - std::map infos = { + std::map infos = { {name0, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", abacus::unit{"USD"}}}}; - abacus::metrics2 metrics{infos}; + abacus::metrics metrics{infos}; metrics.initialize_metric(name0); metrics.initialize_metric(name1); @@ -175,14 +175,14 @@ TEST(test_metrics, reset_counters) std::string name0 = "metric0"; std::string name1 = "metric1"; - std::map infos = { + std::map infos = { {name0, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", abacus::unit{"USD"}}}}; - abacus::metrics2 metrics{infos}; + abacus::metrics metrics{infos}; auto uint_metric = metrics.initialize_metric(name0); auto int_metric = metrics.initialize_metric(name1); @@ -261,7 +261,7 @@ TEST(test_metrics, protocol_version) SCOPED_TRACE( ::testing::Message() << "If this test fails, you need to update the protocol version"); - std::map infos = { + std::map infos = { {"metric0", abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, @@ -273,7 +273,7 @@ TEST(test_metrics, protocol_version) abacus::unit{"ms"}}}, {"metric3", abacus::boolean{abacus::kind::GAUGE, "A boolean metric"}}}; - abacus::metrics2 metrics(infos); + abacus::metrics metrics(infos); auto uint_metric = metrics.initialize_metric("metric0", 42U); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 52f1c1d4..e15c7373 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -7,66 +7,100 @@ #include #include -#include +#include #include -#include +#include #include +static const char* expected_json_minimal = R"({ + "metric0" : 42, + "metric1" : -42, + "metric2" : true +})"; + +TEST(test_to_json, to_json_minimal) +{ + std::string name0 = "metric0"; + std::string name1 = "metric1"; + std::string name2 = "metric2"; + + std::map infos = { + {name0, + abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::max{uint64_t{100U}}}}, + {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}, abacus::min{int64_t{-100}}, + abacus::max{int64_t{100}}}}, + {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}}; + + abacus::metrics metrics(infos); + + auto m0 = metrics.initialize_metric(name0, 42); + auto m1 = metrics.initialize_metric(name1, -42); + metrics.initialize_constant(name2, true); + + abacus::view view; + view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); + view.set_value_data(metrics.value_data(), metrics.value_bytes()); + + auto json_from_view_minimal = abacus::to_json(view, true); + EXPECT_EQ(json_from_view_minimal, expected_json_minimal); +} + static const char* expected_json = R"({ "metric0" : { - "description" : "An unsigned integer metric", - "kind" : "counter", - "max" : 100, - "min" : 0, - "unit" : "bytes", + "uint64" : { + "description" : "An unsigned integer metric", + "max" : "100", + "min" : "0", + "unit" : "bytes" + }, "value" : 42 }, "metric1" : { - "description" : "A signed integer metric", - "kind" : "gauge", - "max" : 100, - "min" : -100, - "unit" : "USD", + "int64" : { + "description" : "A signed integer metric", + "kind" : "GAUGE", + "max" : "100", + "min" : "-100", + "unit" : "USD" + }, "value" : -42 }, "metric2" : { - "description" : "A boolean constant", - "kind" : "constant", + "boolean" : { + "description" : "A boolean constant", + "kind" : "CONSTANT" + }, "value" : true - }, - "protocol_version" : 2 -})"; - -static const char* expected_json_slim = R"({ - "metric0" : 42, - "metric1" : -42, - "metric2" : true + } })"; -TEST(test_to_json, api) +TEST(test_to_json, to_json) { std::string name0 = "metric0"; std::string name1 = "metric1"; std::string name2 = "metric2"; - std::map infos = { + std::map infos = { {name0, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}, abacus::min2{uint64_t{0U}}, - abacus::max2{uint64_t{100U}}}}, + abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::max{uint64_t{100U}}}}, {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}, abacus::min2{int64_t{-100}}, - abacus::max2{int64_t{100}}}}, + abacus::unit{"USD"}, abacus::min{int64_t{-100}}, + abacus::max{int64_t{100}}}}, {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}}; - abacus::metrics2 metrics(infos); + abacus::metrics metrics(infos); auto m0 = metrics.initialize_metric(name0, 42); auto m1 = metrics.initialize_metric(name1, -42); metrics.initialize_constant(name2, true); - abacus::view2 view; + abacus::view view; view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); view.set_value_data(metrics.value_data(), metrics.value_bytes()); @@ -81,8 +115,5 @@ TEST(test_to_json, api) metrics.value_data(), metrics.value_bytes()); EXPECT_EQ(json_from_view, json_from_data); - EXPECT_EQ(json_from_view, expected_json); - - auto json_from_view_slim = abacus::to_json(view, true); - EXPECT_EQ(json_from_view_slim, expected_json_slim); + EXPECT_EQ(json_from_view, expected_json) << json_from_view; } diff --git a/test/src/test_type2.cpp b/test/src/test_type2.cpp index 685cf668..c2ab6f66 100644 --- a/test/src/test_type2.cpp +++ b/test/src/test_type2.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include template void integer_test() @@ -85,7 +85,7 @@ void enum8_test() EXPECT_EQ(m.value(), 20U); } -TEST(test_metrics2, api) +TEST(test_metrics, api) { integer_test(); integer_test(); diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 41113f51..6f98e6b0 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -7,9 +7,9 @@ #include #include -#include +#include #include -#include +#include #include @@ -19,7 +19,7 @@ TEST(test_view, api) std::string name1 = "metric1"; std::string name2 = "metric3"; - std::map infos = { + std::map infos = { {name0, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, @@ -29,7 +29,7 @@ TEST(test_view, api) "A constant floating point metric", abacus::unit{"ms"}}}}; - abacus::metrics2 metrics(infos); + abacus::metrics metrics(infos); auto metric0 = metrics.initialize_metric(name0); @@ -43,7 +43,7 @@ TEST(test_view, api) metrics.metadata_bytes()); std::memcpy(value_data.data(), metrics.value_data(), metrics.value_bytes()); - abacus::view2 view; + abacus::view view; view.set_meta_data(meta_data.data(), meta_data.size()); EXPECT_EQ(view.metadata().protocol_version(), abacus::protocol_version()); From 9b16c83c39f27fa4a288c724464ad7e04e3aef19 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 8 Jan 2025 10:48:10 +0100 Subject: [PATCH 07/68] try fix docs --- docs/conf.py | 18 +++++++++++++----- docs/user_api/{metric.rst => max.rst} | 2 +- docs/user_api/metric_info.rst | 2 -- .../metric_specializations/boolean.rst | 2 -- .../metric_specializations/float64.rst | 2 -- .../user_api/metric_specializations/int64.rst | 2 -- .../metric_specializations.rst | 16 ---------------- .../metric_specializations/uint64.rst | 2 -- docs/user_api/metric_types/boolean.rst | 2 ++ docs/user_api/metric_types/enum8.rst | 2 ++ docs/user_api/metric_types/float32.rst | 2 ++ docs/user_api/metric_types/float64.rst | 2 ++ docs/user_api/metric_types/int32.rst | 2 ++ docs/user_api/metric_types/int64.rst | 2 ++ docs/user_api/metric_types/metric_types.rst | 19 +++++++++++++++++++ docs/user_api/metric_types/uint32.rst | 2 ++ docs/user_api/metric_types/uint64.rst | 2 ++ docs/user_api/min.rst | 2 ++ docs/user_api/type.rst | 2 -- docs/user_api/user_api.rst | 7 +++---- 20 files changed, 54 insertions(+), 38 deletions(-) rename docs/user_api/{metric.rst => max.rst} (51%) delete mode 100644 docs/user_api/metric_info.rst delete mode 100644 docs/user_api/metric_specializations/boolean.rst delete mode 100644 docs/user_api/metric_specializations/float64.rst delete mode 100644 docs/user_api/metric_specializations/int64.rst delete mode 100644 docs/user_api/metric_specializations/metric_specializations.rst delete mode 100644 docs/user_api/metric_specializations/uint64.rst create mode 100644 docs/user_api/metric_types/boolean.rst create mode 100644 docs/user_api/metric_types/enum8.rst create mode 100644 docs/user_api/metric_types/float32.rst create mode 100644 docs/user_api/metric_types/float64.rst create mode 100644 docs/user_api/metric_types/int32.rst create mode 100644 docs/user_api/metric_types/int64.rst create mode 100644 docs/user_api/metric_types/metric_types.rst create mode 100644 docs/user_api/metric_types/uint32.rst create mode 100644 docs/user_api/metric_types/uint64.rst create mode 100644 docs/user_api/min.rst delete mode 100644 docs/user_api/type.rst diff --git a/docs/conf.py b/docs/conf.py index b4de1ea1..c946e8d9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,14 +22,22 @@ wurfapi = { "source_paths": [ # API - "../src/abacus/type.hpp", - "../src/abacus/metric.hpp", - "../src/abacus/metric_info.hpp", + "../src/abacus/boolean.hpp", + "../src/abacus/enum8.hpp", + "../src/abacus/float32.hpp", + "../src/abacus/float64.hpp", + "../src/abacus/int32.hpp", + "../src/abacus/int64.hpp", "../src/abacus/kind.hpp", - "../src/abacus/unit.hpp", + "../src/abacus/max.hpp", "../src/abacus/metrics.hpp", - "../src/abacus/view.hpp", + "../src/abacus/min.hpp", "../src/abacus/to_json.hpp", + "../src/abacus/type.hpp", + "../src/abacus/uint32.hpp", + "../src/abacus/uint64.hpp", + "../src/abacus/unit.hpp", + "../src/abacus/view.hpp", ], "recursive": False, "include_paths": ["../src"], diff --git a/docs/user_api/metric.rst b/docs/user_api/max.rst similarity index 51% rename from docs/user_api/metric.rst rename to docs/user_api/max.rst index 02c7b076..ea8800b0 100644 --- a/docs/user_api/metric.rst +++ b/docs/user_api/max.rst @@ -1,2 +1,2 @@ .. wurfapi:: class_synopsis.rst - :selector: abacus::metric + :selector: abacus::max diff --git a/docs/user_api/metric_info.rst b/docs/user_api/metric_info.rst deleted file mode 100644 index f7317036..00000000 --- a/docs/user_api/metric_info.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: class_synopsis.rst - :selector: abacus::metric_info diff --git a/docs/user_api/metric_specializations/boolean.rst b/docs/user_api/metric_specializations/boolean.rst deleted file mode 100644 index 6a007469..00000000 --- a/docs/user_api/metric_specializations/boolean.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: class_synopsis.rst - :selector: abacus::metric diff --git a/docs/user_api/metric_specializations/float64.rst b/docs/user_api/metric_specializations/float64.rst deleted file mode 100644 index c7749e6c..00000000 --- a/docs/user_api/metric_specializations/float64.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: class_synopsis.rst - :selector: abacus::metric diff --git a/docs/user_api/metric_specializations/int64.rst b/docs/user_api/metric_specializations/int64.rst deleted file mode 100644 index b0000dce..00000000 --- a/docs/user_api/metric_specializations/int64.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: class_synopsis.rst - :selector: abacus::metric diff --git a/docs/user_api/metric_specializations/metric_specializations.rst b/docs/user_api/metric_specializations/metric_specializations.rst deleted file mode 100644 index 49f08e66..00000000 --- a/docs/user_api/metric_specializations/metric_specializations.rst +++ /dev/null @@ -1,16 +0,0 @@ - -.. _metric_specializations: - -=============================== -Metric Template Specializations -=============================== - -Overview of the metric public API. - -.. toctree:: - :maxdepth: 2 - - uint64 - int64 - float64 - boolean diff --git a/docs/user_api/metric_specializations/uint64.rst b/docs/user_api/metric_specializations/uint64.rst deleted file mode 100644 index 72b54929..00000000 --- a/docs/user_api/metric_specializations/uint64.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: class_synopsis.rst - :selector: abacus::metric diff --git a/docs/user_api/metric_types/boolean.rst b/docs/user_api/metric_types/boolean.rst new file mode 100644 index 00000000..a6046025 --- /dev/null +++ b/docs/user_api/metric_types/boolean.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::boolean diff --git a/docs/user_api/metric_types/enum8.rst b/docs/user_api/metric_types/enum8.rst new file mode 100644 index 00000000..08af2742 --- /dev/null +++ b/docs/user_api/metric_types/enum8.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::enum8 diff --git a/docs/user_api/metric_types/float32.rst b/docs/user_api/metric_types/float32.rst new file mode 100644 index 00000000..e4426844 --- /dev/null +++ b/docs/user_api/metric_types/float32.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::float32 diff --git a/docs/user_api/metric_types/float64.rst b/docs/user_api/metric_types/float64.rst new file mode 100644 index 00000000..feda15da --- /dev/null +++ b/docs/user_api/metric_types/float64.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::float64 diff --git a/docs/user_api/metric_types/int32.rst b/docs/user_api/metric_types/int32.rst new file mode 100644 index 00000000..50e5e654 --- /dev/null +++ b/docs/user_api/metric_types/int32.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::int32 diff --git a/docs/user_api/metric_types/int64.rst b/docs/user_api/metric_types/int64.rst new file mode 100644 index 00000000..56e7868e --- /dev/null +++ b/docs/user_api/metric_types/int64.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::uint64 diff --git a/docs/user_api/metric_types/metric_types.rst b/docs/user_api/metric_types/metric_types.rst new file mode 100644 index 00000000..bf448db3 --- /dev/null +++ b/docs/user_api/metric_types/metric_types.rst @@ -0,0 +1,19 @@ + +.. _metric_specializations: + +============ +Metric Types +============ + +Overview of the metric types public API. + +.. toctree:: + :maxdepth: 2 + + uint64 + uint32 + int64 + int32 + float64 + boolean + enum8 diff --git a/docs/user_api/metric_types/uint32.rst b/docs/user_api/metric_types/uint32.rst new file mode 100644 index 00000000..26026890 --- /dev/null +++ b/docs/user_api/metric_types/uint32.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::uint32 diff --git a/docs/user_api/metric_types/uint64.rst b/docs/user_api/metric_types/uint64.rst new file mode 100644 index 00000000..56e7868e --- /dev/null +++ b/docs/user_api/metric_types/uint64.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::uint64 diff --git a/docs/user_api/min.rst b/docs/user_api/min.rst new file mode 100644 index 00000000..be2fa0d8 --- /dev/null +++ b/docs/user_api/min.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::min diff --git a/docs/user_api/type.rst b/docs/user_api/type.rst deleted file mode 100644 index 66f672e9..00000000 --- a/docs/user_api/type.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: enum_synopsis.rst - :selector: abacus::type diff --git a/docs/user_api/user_api.rst b/docs/user_api/user_api.rst index 079dc24c..3e08c7e9 100644 --- a/docs/user_api/user_api.rst +++ b/docs/user_api/user_api.rst @@ -10,12 +10,11 @@ Overview of the public API. .. toctree:: :maxdepth: 3 - metric - metric_specializations/metric_specializations - metric_info - type + metric_types/metric_types kind unit + min + max metrics view functions From aad11ac2a9ed30921afdfa8877e6ade5b3f87dde Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 8 Jan 2025 11:00:30 +0100 Subject: [PATCH 08/68] try fix docs --- src/abacus/enum8.hpp | 3 +++ src/abacus/metrics.hpp | 30 +++++++++++++++++++++++++----- src/abacus/to_json.hpp | 4 +++- src/abacus/view.hpp | 4 +++- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index 835f004f..3d1da242 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -107,7 +107,10 @@ struct enum8 /// The enumeration value type struct value { + /// The name of the value std::string name; + + /// The description of the value std::string description; }; diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 70d08d82..fb59aa6b 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -307,21 +307,28 @@ class metrics return m_value_bytes; } + /// @return the pointer to the metadata data of the metrics. auto metadata_data() const -> const uint8_t* { return m_data; } - auto metadata() const -> const protobuf::MetricsMetadata& + /// @return the size of the metadata data of the metrics. + auto metadata_bytes() const -> std::size_t { - return m_metadata; + return m_metadata_bytes; } - auto metadata_bytes() const -> std::size_t + /// @return the metadata of the metrics. + auto metadata() const -> const protobuf::MetricsMetadata& { - return m_metadata_bytes; + return m_metadata; } + /// Initialize a metric + /// @param name The name of the metric + /// @param value Optional initial value of the metric + /// @return The metric object template auto initialize_metric(const std::string& name, std::optional value = @@ -350,6 +357,9 @@ class metrics } } + /// Initialize a constant metric + /// @param name The name of the metric + /// @param value The value of the metric template void initialize_constant(const std::string& name, typename Metric::type value) @@ -365,6 +375,9 @@ class metrics typename Metric::metric(m_data + m_metadata_bytes + offset, value); } + /// Check if a metric has been initialized + /// @param name The name of the metric + /// @return true if the metric has been initialized auto is_initialized(const std::string& name) const -> bool { assert(m_initialized.find(name) != m_initialized.end()); @@ -384,6 +397,8 @@ class metrics return true; } + /// Reset all metrics + /// This will set all metrics has_value() to false. void reset_metrics() { // Reset the value data @@ -405,11 +420,16 @@ class metrics /// The info of the metrics separated by byte-sizes protobuf::MetricsMetadata m_metadata; + /// The hash of the metadata uint32_t m_hash; + /// The size of the metadata in bytes std::size_t m_metadata_bytes; - std::size_t m_value_bytes = 1337; + /// The size of the value data in bytes + std::size_t m_value_bytes; + + /// A map of the metrics and whether they have been initialized std::map m_initialized; }; } diff --git a/src/abacus/to_json.hpp b/src/abacus/to_json.hpp index e08e385b..7c29ea06 100644 --- a/src/abacus/to_json.hpp +++ b/src/abacus/to_json.hpp @@ -16,8 +16,10 @@ inline namespace STEINWURF_ABACUS_VERSION { /// @return a JSON-formatted string of a metrics views data. -/// @param meta_data The meta data of the metrics view. +/// @param metadata_data The meta data of the metrics view. +/// @param metadata_bytes The size of the meta data. /// @param value_data The value data of the metrics view. +/// @param value_bytes The size of the value data. /// @param minimal If true, the JSON will be slimmed down to only contain the /// the value data. auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index 26a30565..d1c1c395 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -42,7 +42,8 @@ class view { public: /// Sets the meta data pointer - /// @param meta_data The meta data pointer + /// @param metadata_data The meta data pointer + /// @param metadata_bytes The meta data size in bytes void set_meta_data(const uint8_t* metadata_data, std::size_t metadata_bytes) { assert(metadata_data != nullptr); @@ -56,6 +57,7 @@ class view /// Sets the value data pointer /// @param value_data The value data pointer + /// @param value_bytes The value data size in bytes /// @return true if the hash is correct otherwise false auto set_value_data(const uint8_t* value_data, std::size_t value_bytes) -> bool From 9e170f421915f7200ee21f3b4da7f1a159e7af7e Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 8 Jan 2025 11:02:35 +0100 Subject: [PATCH 09/68] try fix docs --- src/abacus/metrics.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index fb59aa6b..f080b21f 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -85,9 +85,8 @@ class metrics } /// Constructor - /// @param info The info of the metrics in a pointer. - /// @param count The number of infos. - metrics(const std::map& infos) + /// @param info The info of the metrics to create. + metrics(const std::map& info) { m_metadata = protobuf::MetricsMetadata(); m_metadata.set_protocol_version(protocol_version()); From c6ae2df1f1b063a7db8ee7fcaccf34905b5c0207 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 8 Jan 2025 15:43:44 +0100 Subject: [PATCH 10/68] initial work on benchmark --- benchmark/main.cpp | 56 ++++++++++++++++++++++ examples/metrics_simple.cpp | 12 +++-- lock_version_resolve.json | 10 ++++ resolve.json | 10 ++++ src/abacus/metrics.hpp | 9 ++-- src/abacus/to_json.cpp | 7 ++- src/abacus/view.hpp | 6 +-- test/src/test_metric.cpp | 3 +- test/src/test_metrics.cpp | 44 +++++++++++++++-- test/src/test_to_json.cpp | 52 ++++++++++++++++++-- test/src/{test_type2.cpp => test_type.cpp} | 40 ++++++++-------- test/src/test_view.cpp | 47 ++++++++++++++---- wscript | 18 ++++++- 13 files changed, 258 insertions(+), 56 deletions(-) create mode 100644 benchmark/main.cpp rename test/src/{test_type2.cpp => test_type.cpp} (85%) diff --git a/benchmark/main.cpp b/benchmark/main.cpp new file mode 100644 index 00000000..f3364e90 --- /dev/null +++ b/benchmark/main.cpp @@ -0,0 +1,56 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst +// file. + +#include +#include + +static void assign_metrics(benchmark::State& state, int v) +{ + state.SetLabel("assign_metrics"); + + std::map infos = { + {"0", abacus::boolean{abacus::kind::GAUGE, ""}}, + {"1", abacus::uint64{abacus::kind::GAUGE, ""}}, + {"2", abacus::int64{abacus::kind::GAUGE, ""}}, + {"3", abacus::float64{abacus::kind::GAUGE, ""}}, + {"4", abacus::boolean{abacus::kind::GAUGE, ""}}, + {"5", abacus::float64{abacus::kind::GAUGE, ""}}, + {"6", + abacus::enum8{ + "", + {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}}}}; + abacus::metrics metrics(infos); + + auto m0 = metrics.initialize_metric("0", false); + auto m1 = metrics.initialize_metric("1", 0); + auto m2 = metrics.initialize_metric("2", 0); + auto m3 = metrics.initialize_metric("3", 0.0); + auto m4 = metrics.initialize_metric("4", true); + auto m5 = metrics.initialize_metric("5", 3.14); + auto m6 = metrics.initialize_metric("6", 1); + + for (auto _ : state) + { + m0 = true; + m1 += 1; + m2 -= 1; + ++m3; + m4 = false; + --m5; + m6 = 4; + } + + state.SetItemsProcessed(state.iterations()); +} + +static void CustomArguments(benchmark::internal::Benchmark* b) +{ + b->Unit(benchmark::kMicrosecond); +} + +BENCHMARK_CAPTURE(assign_metrics, basic, 10)->Apply(CustomArguments); + +BENCHMARK_MAIN(); diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 90de8464..7d15fb69 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -36,13 +36,19 @@ int main() car.initialize_constant("fuel_consumption", 22.3); car.initialize_constant("wheels", 4); - // The car is overdue maintenance. + // The car still has some time before maintenance. auto days_until_maintenance = - car.initialize_metric("days_until_maintenance", -10); + car.initialize_metric("days_until_maintenance", 10); // The car should be registered. auto registered = - car.initialize_metric("registered", true); + car.initialize_metric("registered", false); + + // The car has been registered. + registered = true; + + // The car has been driven for a while, and now maintenance is overdue. + days_until_maintenance = -1; /// We want to export the metrics memory, so we need a new storage std::vector meta_data(car.metadata_bytes()); diff --git a/lock_version_resolve.json b/lock_version_resolve.json index cc3e23c9..e236941d 100644 --- a/lock_version_resolve.json +++ b/lock_version_resolve.json @@ -9,6 +9,16 @@ "resolver_info": "13.0.0", "sha1": "de39fa280dabb242134e095a1473495341165b70" }, + "gbenchmark": { + "commit_id": "a01cf3aaa4e3f6ebd90d95ab6ba168d351b3ab3c", + "resolver_info": "2.1.2", + "sha1": "eba056f72a8a4ddf957ced45237720337b7c2215" + }, + "gbenchmark-source": { + "commit_id": "344117638c8ff7e239044fd0fa7085839fc03021", + "resolver_info": "v1.8.3", + "sha1": "2f70f76f52ae610b201e6738e0e76260de2a7405" + }, "gtest": { "commit_id": "da24468d2c5deb601d0f67196abe83d78a00f972", "resolver_info": "5.0.0", diff --git a/resolve.json b/resolve.json index 9776dcac..19117e37 100644 --- a/resolve.json +++ b/resolve.json @@ -44,5 +44,15 @@ "sources": [ "github.com/steinwurf/endian.git" ] + }, + { + "name": "gbenchmark", + "internal": true, + "resolver": "git", + "method": "semver", + "major": 2, + "sources": [ + "github.com/steinwurf/gbenchmark.git" + ] } ] diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index f080b21f..3d1dc111 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -97,7 +97,7 @@ class metrics // The first byte is reserved for the sync value m_value_bytes = sizeof(uint32_t); - for (auto [name, value] : infos) + for (auto [name, value] : info) { protobuf::Metric metric; metric.set_offset(m_value_bytes); @@ -329,9 +329,10 @@ class metrics /// @param value Optional initial value of the metric /// @return The metric object template - auto initialize_metric(const std::string& name, - std::optional value = - std::nullopt) -> typename Metric::metric + [[nodiscard]] auto initialize_metric( + const std::string& name, + std::optional value = std::nullopt) -> + typename Metric::metric { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index c7535ca4..54719c32 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -24,8 +24,11 @@ auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, { view v; v.set_meta_data(metadata_data, metadata_bytes); - v.set_value_data(value_data, value_bytes); - return to_json(v, minimal); + if (v.set_value_data(value_data, value_bytes)) + { + return to_json(v, minimal); + } + return ""; } } } diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index d1c1c395..2f1667ed 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -59,8 +59,8 @@ class view /// @param value_data The value data pointer /// @param value_bytes The value data size in bytes /// @return true if the hash is correct otherwise false - auto set_value_data(const uint8_t* value_data, - std::size_t value_bytes) -> bool + [[nodiscard]] auto set_value_data(const uint8_t* value_data, + std::size_t value_bytes) -> bool { assert(m_metadata_data != nullptr); assert(value_data != nullptr); @@ -134,8 +134,6 @@ class view assert(m_value_data != nullptr); assert(m_metadata_data != nullptr); - auto endianness = m_metadata.endianness(); - auto offset = metric(name).offset(); assert(offset < m_value_bytes); diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index 6313d104..ce20eb71 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -22,7 +22,7 @@ TEST(test_metric, constructor) EXPECT_TRUE(uint_metric.has_value()); EXPECT_EQ(uint_metric.value(), 42U); } -/* + TEST(test_metric, float_assignment) { uint8_t data[9] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; @@ -63,4 +63,3 @@ TEST(test_metric, float_assignment) // Check that that assignment to -Inf is not allowed EXPECT_DEATH(double_metric -= 1 / -0.0, ""); } -*/ diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 21633a5f..c4b5e6c5 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -24,7 +24,7 @@ TEST(test_metrics, empty) EXPECT_EQ(0U, metrics2.metadata().metrics().size()); } -TEST(test_metrics, default_constructor) +TEST(test_metrics, api) { std::string name0 = "metric0"; std::string name1 = "metric1"; @@ -32,6 +32,7 @@ TEST(test_metrics, default_constructor) std::string name3 = "metric3"; std::string name4 = "metric4"; std::string name5 = "metric5"; + std::string name6 = "metric6"; std::map infos = { {name0, abacus::boolean{abacus::kind::COUNTER, "A boolean metric"}}, @@ -46,11 +47,16 @@ TEST(test_metrics, default_constructor) abacus::boolean{abacus::kind::CONSTANT, "A constant boolean metric"}}, {name5, abacus::float64{abacus::kind::CONSTANT, "A constant floating point metric", - abacus::unit{"ms"}}}}; + abacus::unit{"ms"}}}, + {name6, abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics from_metrics(infos); abacus::metrics metrics(std::move(from_metrics)); - EXPECT_EQ(metrics.metadata().metrics().size(), 6U); + EXPECT_EQ(metrics.metadata().metrics().size(), 7U); EXPECT_EQ(metrics.metadata().protocol_version(), abacus::protocol_version()); @@ -92,6 +98,22 @@ TEST(test_metrics, default_constructor) "A constant floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().unit(), "ms"); + EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().description(), + "An enum metric"); + EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().values().size(), + 4U); + EXPECT_EQ( + metrics.metadata().metrics().at(name6).enum8().values().at(0).name(), + "value0"); + EXPECT_EQ(metrics.metadata() + .metrics() + .at(name6) + .enum8() + .values() + .at(0) + .description(), + "The value for 0"); + EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name1)); auto metric0 = metrics.initialize_metric(name1, 9000U); @@ -122,6 +144,11 @@ TEST(test_metrics, default_constructor) metrics.initialize_constant(name5, 42.42); EXPECT_TRUE(metrics.is_initialized(name5)); + EXPECT_FALSE(metrics.is_initialized()); + EXPECT_FALSE(metrics.is_initialized(name6)); + auto metric6 = metrics.initialize_metric(name6); + EXPECT_TRUE(metrics.is_initialized(name6)); + EXPECT_TRUE(metrics.is_initialized()); EXPECT_TRUE(metric0.has_value()); @@ -144,6 +171,11 @@ TEST(test_metrics, default_constructor) metric3 = true; EXPECT_TRUE(metric3.has_value()); EXPECT_EQ(metric3.value(), true); + + EXPECT_FALSE(metric6.has_value()); + metric6 = 2; + EXPECT_TRUE(metric6.has_value()); + EXPECT_EQ(metric6.value(), 2); } TEST(test_metrics, value_and_metadata_bytes) @@ -160,8 +192,10 @@ TEST(test_metrics, value_and_metadata_bytes) abacus::metrics metrics{infos}; - metrics.initialize_metric(name0); - metrics.initialize_metric(name1); + auto m0 = metrics.initialize_metric(name0); + auto m1 = metrics.initialize_metric(name1); + (void)m0; + (void)m1; EXPECT_EQ(metrics.metadata_bytes(), 108U); EXPECT_EQ(metrics.value_bytes(), diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index e15c7373..1814a348 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -16,7 +16,8 @@ static const char* expected_json_minimal = R"({ "metric0" : 42, "metric1" : -42, - "metric2" : true + "metric2" : true, + "metric3" : 2 })"; TEST(test_to_json, to_json_minimal) @@ -24,6 +25,7 @@ TEST(test_to_json, to_json_minimal) std::string name0 = "metric0"; std::string name1 = "metric1"; std::string name2 = "metric2"; + std::string name3 = "metric3"; std::map infos = { {name0, @@ -33,17 +35,25 @@ TEST(test_to_json, to_json_minimal) {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, - {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}}; + {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, + {name3, abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); auto m0 = metrics.initialize_metric(name0, 42); auto m1 = metrics.initialize_metric(name1, -42); metrics.initialize_constant(name2, true); + auto m3 = metrics.initialize_metric(name3, 2); abacus::view view; view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); - view.set_value_data(metrics.value_data(), metrics.value_bytes()); + auto success = + view.set_value_data(metrics.value_data(), metrics.value_bytes()); + ASSERT_TRUE(success); auto json_from_view_minimal = abacus::to_json(view, true); EXPECT_EQ(json_from_view_minimal, expected_json_minimal); @@ -75,6 +85,30 @@ static const char* expected_json = R"({ "kind" : "CONSTANT" }, "value" : true + }, + "metric3" : { + "enum8" : { + "description" : "An enum metric", + "values" : { + "0" : { + "description" : "The value for 0", + "name" : "value0" + }, + "1" : { + "description" : "The value for 1", + "name" : "value1" + }, + "2" : { + "description" : "The value for 2", + "name" : "value2" + }, + "3" : { + "description" : "The value for 3", + "name" : "value3" + } + } + }, + "value" : 2 } })"; @@ -83,6 +117,7 @@ TEST(test_to_json, to_json) std::string name0 = "metric0"; std::string name1 = "metric1"; std::string name2 = "metric2"; + std::string name3 = "metric3"; std::map infos = { {name0, @@ -92,7 +127,12 @@ TEST(test_to_json, to_json) {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, - {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}}; + {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, + {name3, abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); @@ -102,7 +142,9 @@ TEST(test_to_json, to_json) abacus::view view; view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); - view.set_value_data(metrics.value_data(), metrics.value_bytes()); + auto success = + view.set_value_data(metrics.value_data(), metrics.value_bytes()); + ASSERT_TRUE(success); auto json_from_view = abacus::to_json(view); diff --git a/test/src/test_type2.cpp b/test/src/test_type.cpp similarity index 85% rename from test/src/test_type2.cpp rename to test/src/test_type.cpp index c2ab6f66..003e298a 100644 --- a/test/src/test_type2.cpp +++ b/test/src/test_type.cpp @@ -23,17 +23,25 @@ void integer_test() EXPECT_FALSE(m.has_value()); m = 10U; EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), 10U); + EXPECT_EQ(m.value(), type{10}); m += 12; m -= 2; ++m; --m; - EXPECT_EQ(m.value(), 20U); + EXPECT_EQ(m.value(), type{20}); +} + +TEST(test_metrics, integer) +{ + integer_test(); + integer_test(); + integer_test(); + integer_test(); } template -void float_test() +void floating_point_test() { using metric = typename T::metric; using type = typename T::type; @@ -55,7 +63,14 @@ void float_test() EXPECT_EQ(m.value(), 20.0); } -void boolean_test() +TEST(test_metrics, floating_point) +{ + + floating_point_test(); + floating_point_test(); +} + +TEST(test_metrics, boolean) { uint8_t data[sizeof(bool) + 1]; abacus::boolean::metric m; @@ -70,7 +85,7 @@ void boolean_test() EXPECT_EQ(m.value(), false); } -void enum8_test() +TEST(test_metrics, enum8) { uint8_t data[sizeof(uint8_t) + 1]; abacus::enum8::metric m; @@ -84,18 +99,3 @@ void enum8_test() m = 20U; EXPECT_EQ(m.value(), 20U); } - -TEST(test_metrics, api) -{ - integer_test(); - integer_test(); - integer_test(); - integer_test(); - - float_test(); - float_test(); - - boolean_test(); - - enum8_test(); -} diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 6f98e6b0..ecfe5a93 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -17,7 +17,8 @@ TEST(test_view, api) { std::string name0 = "metric0"; std::string name1 = "metric1"; - std::string name2 = "metric3"; + std::string name2 = "metric2"; + std::string name3 = "metric3"; std::map infos = { {name0, @@ -27,7 +28,12 @@ TEST(test_view, api) abacus::unit{"USD"}}}, {name2, abacus::float64{abacus::kind::CONSTANT, "A constant floating point metric", - abacus::unit{"ms"}}}}; + abacus::unit{"ms"}}}, + {name3, abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); @@ -37,6 +43,8 @@ TEST(test_view, api) metrics.initialize_constant(name2, 3.14); + auto metric3 = metrics.initialize_metric(name3); + std::vector meta_data(metrics.metadata_bytes()); std::vector value_data(metrics.value_bytes()); std::memcpy(meta_data.data(), metrics.metadata_data(), @@ -57,16 +65,37 @@ TEST(test_view, api) auto success = view.set_value_data(value_data.data(), value_data.size()); ASSERT_TRUE(success); - std::optional view_value = view.value(name0); + std::optional view_value0 = view.value(name0); + std::optional view_value1 = view.value(name1); + std::optional view_value2 = view.value(name2); + std::optional view_value3 = view.value(name3); - EXPECT_FALSE(view_value.has_value()); + EXPECT_FALSE(view_value0.has_value()); + EXPECT_FALSE(view_value1.has_value()); + EXPECT_TRUE(view_value2.has_value()); + EXPECT_EQ(3.14, view_value2.value()); + EXPECT_FALSE(view_value3.has_value()); - // Update metric + // Update metrics metric0 = 9000U; + metric1 = -1000; + metric3 = 2; + // and provide new value data to the view - view.set_value_data(metrics.value_data(), metrics.value_bytes()); - view_value = view.value(name0); + success = view.set_value_data(metrics.value_data(), metrics.value_bytes()); + ASSERT_TRUE(success); + view_value0 = view.value(name0); + + EXPECT_TRUE(view_value0.has_value()); + EXPECT_EQ(9000U, view_value0.value()); + + view_value1 = view.value(name1); + + EXPECT_TRUE(view_value1.has_value()); + EXPECT_EQ(-1000, view_value1.value()); + + view_value3 = view.value(name3); - EXPECT_TRUE(view_value.has_value()); - EXPECT_EQ(9000U, view_value.value()); + EXPECT_TRUE(view_value3.has_value()); + EXPECT_EQ(2, view_value3.value()); } diff --git a/wscript b/wscript index 72533145..fd31edfd 100644 --- a/wscript +++ b/wscript @@ -10,6 +10,7 @@ APPNAME = "abacus" VERSION = "6.0.1" NO_RECURSE = False + def configure(conf): conf.set_cxx_std(17) @@ -42,7 +43,8 @@ def build(bld): # i.e. not when included as a dependency bld.program( features="cxx test", - source=bld.path.ant_glob("test/**/*.cpp") + bld.path.ant_glob("src/**/*.cc"), + source=bld.path.ant_glob("test/**/*.cpp") + + bld.path.ant_glob("src/**/*.cc"), target="abacus_tests", use=["abacus", "protobuf", "gtest"], ) @@ -55,6 +57,14 @@ def build(bld): use=["abacus"], ) + bld.program( + features="cxx benchmark", + source=["benchmark/main.cpp"], + target="abacus_benchmark", + install_path=None, + use=["abacus", "gbenchmark"], + ) + sourcepath = bld.path.find_node("src") bld.install_files( @@ -66,11 +76,14 @@ def build(bld): bld.install_files(dest="${PREFIX}/", files=bld.path.ant_glob("NEWS.rst")) + def protogen(ctx): # check if protec is available protoc_location = "build_current/resolve_symlinks/protobuf/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.") + ctx.fatal( + "protoc not found. Make sure to configure waf with `--with_protoc` to include protoc in build." + ) return try: shutil.rmtree("src/abacus/protobuf") @@ -86,6 +99,7 @@ def protogen(ctx): "echo 'DisableFormat: true\nSortIncludes: false' > src/abacus/protobuf/.clang-format" ) + class ReleaseContext(BuildContext): cmd = "prepare_release" fun = "prepare_release" From 63de345eafbde96ff56c7c14fa208ef5c3f69c52 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Thu, 9 Jan 2025 08:48:45 +0100 Subject: [PATCH 11/68] better bench --- benchmark/main.cpp | 95 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 83 insertions(+), 12 deletions(-) diff --git a/benchmark/main.cpp b/benchmark/main.cpp index f3364e90..bbd47fa7 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -1,17 +1,12 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst -// file. - #include #include +#include +#include -static void assign_metrics(benchmark::State& state, int v) +// Helper function to create metric definitions +std::map create_metric_infos() { - state.SetLabel("assign_metrics"); - - std::map infos = { + return { {"0", abacus::boolean{abacus::kind::GAUGE, ""}}, {"1", abacus::uint64{abacus::kind::GAUGE, ""}}, {"2", abacus::int64{abacus::kind::GAUGE, ""}}, @@ -22,8 +17,39 @@ static void assign_metrics(benchmark::State& state, int v) abacus::enum8{ "", {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}}}}; - abacus::metrics metrics(infos); +} + +// Benchmark for metric initialization +static void BM_MetricInitialization(benchmark::State& state) +{ + state.SetLabel("Metric Initialization"); + for (auto _ : state) + { + abacus::metrics metrics(create_metric_infos()); + auto m0 = metrics.initialize_metric("0", false); + auto m1 = metrics.initialize_metric("1", 0); + auto m2 = metrics.initialize_metric("2", 0); + auto m3 = metrics.initialize_metric("3", 0.0); + auto m4 = metrics.initialize_metric("4", true); + auto m5 = metrics.initialize_metric("5", 3.14); + auto m6 = metrics.initialize_metric("6", 1); + (void)m0; + (void)m1; + (void)m2; + (void)m3; + (void)m4; + (void)m5; + (void)m6; + } + state.SetItemsProcessed(state.iterations()); +} + +// Benchmark for assignment operations +static void BM_AssignMetrics(benchmark::State& state) +{ + state.SetLabel("Assign Metrics"); + abacus::metrics metrics(create_metric_infos()); auto m0 = metrics.initialize_metric("0", false); auto m1 = metrics.initialize_metric("1", 0); auto m2 = metrics.initialize_metric("2", 0); @@ -46,11 +72,56 @@ static void assign_metrics(benchmark::State& state, int v) state.SetItemsProcessed(state.iterations()); } +// Benchmark for accessing metrics +static void BM_AccessMetrics(benchmark::State& state) +{ + state.SetLabel("Access Metrics"); + abacus::metrics metrics(create_metric_infos()); + auto m0 = metrics.initialize_metric("0", false); + auto m1 = metrics.initialize_metric("1", 0); + auto m2 = metrics.initialize_metric("2", 0); + auto m3 = metrics.initialize_metric("3", 0.0); + + for (auto _ : state) + { + bool val0 = m0.value(); + uint64_t val1 = m1.value(); + int64_t val2 = m2.value(); + double val3 = m3.value(); + + benchmark::DoNotOptimize(val0); + benchmark::DoNotOptimize(val1); + benchmark::DoNotOptimize(val2); + benchmark::DoNotOptimize(val3); + } + + state.SetItemsProcessed(state.iterations()); +} + +// Benchmark for incrementing uint64 metric +static void BM_IncrementUint64(benchmark::State& state) +{ + state.SetLabel("Increment Uint64 Metric"); + abacus::metrics metrics(create_metric_infos()); + auto m1 = metrics.initialize_metric("1", 0); + + for (auto _ : state) + { + m1 += 1; + } + + state.SetItemsProcessed(state.iterations()); +} + +// Apply custom arguments to all benchmarks static void CustomArguments(benchmark::internal::Benchmark* b) { b->Unit(benchmark::kMicrosecond); } -BENCHMARK_CAPTURE(assign_metrics, basic, 10)->Apply(CustomArguments); +BENCHMARK(BM_MetricInitialization)->Apply(CustomArguments); +BENCHMARK(BM_AssignMetrics)->Apply(CustomArguments); +BENCHMARK(BM_AccessMetrics)->Apply(CustomArguments); +BENCHMARK(BM_IncrementUint64)->Apply(CustomArguments); BENCHMARK_MAIN(); From 335ee37226e1bf1dc7519e2f204cee022cd7b27c Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Thu, 9 Jan 2025 12:00:53 +0100 Subject: [PATCH 12/68] work --- CMakeLists.txt | 13 +++++++++++ docs/user_api/metric_types/int64.rst | 2 +- examples/metrics_simple.cpp | 5 +++- protobuf/kind.proto | 6 ++--- src/abacus/detail/to_json.cpp | 11 +++------ src/abacus/protobuf/kind.pb.cc | 4 ++-- src/abacus/protobuf/kind.pb.h | 6 ++--- test/src/test_metrics.cpp | 35 ++++++++++++++++------------ test/src/test_to_json.cpp | 12 ++++++++++ 9 files changed, 61 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad70043d..8267c1ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,4 +108,17 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) steinwurf::protobuf) add_test(abacus_test abacus_test) + + # Google Benchmark dependency + add_subdirectory("${STEINWURF_RESOLVE}/gbenchmark-source") + + # Build benchmark executable + file(GLOB_RECURSE abacus_benchmark_sources ./benchmark/main.cpp) + add_executable(abacus_benchmark ${abacus_benchmark_sources}) + target_link_libraries(abacus_benchmark benchmark) + target_link_libraries(abacus_benchmark + steinwurf::abacus + steinwurf::endian + steinwurf::bourne + steinwurf::protobuf) endif() diff --git a/docs/user_api/metric_types/int64.rst b/docs/user_api/metric_types/int64.rst index 56e7868e..afafd6fa 100644 --- a/docs/user_api/metric_types/int64.rst +++ b/docs/user_api/metric_types/int64.rst @@ -1,2 +1,2 @@ .. wurfapi:: class_synopsis.rst - :selector: abacus::uint64 + :selector: abacus::int64 diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 7d15fb69..038231a9 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -61,7 +61,10 @@ int main() abacus::view car_view; car_view.set_meta_data(meta_data.data(), meta_data.size()); - car_view.set_value_data(value_data.data(), value_data.size()); + auto success = + car_view.set_value_data(value_data.data(), value_data.size()); + (void)success; + assert(success); std::cout << abacus::to_json(car_view) << std::endl; diff --git a/protobuf/kind.proto b/protobuf/kind.proto index c87174ec..aeaa2cf9 100644 --- a/protobuf/kind.proto +++ b/protobuf/kind.proto @@ -4,7 +4,7 @@ option go_package = "abacus/protobuf"; // Specifies the kind of metric enum Kind { - COUNTER = 0; // Counter metric - CONSTANT = 1; // Constant metric - GAUGE = 2; // Gauge metric + GAUGE = 0; // Gauge metric + COUNTER = 1; // Counter metric + CONSTANT = 2; // Constant metric } diff --git a/src/abacus/detail/to_json.cpp b/src/abacus/detail/to_json.cpp index ea8b6a75..feaa6ce8 100644 --- a/src/abacus/detail/to_json.cpp +++ b/src/abacus/detail/to_json.cpp @@ -105,15 +105,10 @@ auto to_json(const view& view, bool minimal) -> bourne::json else { std::string metadata_json; - auto metadata = view.metadata(); - // Go through each metric and remove the offset - for (auto& [name, metric] : *metadata.mutable_metrics()) - { - metric.clear_offset(); - } - + google::protobuf::util::JsonPrintOptions options; + options.always_print_primitive_fields = true; auto status = google::protobuf::util::MessageToJsonString( - metadata, &metadata_json); + view.metadata(), &metadata_json, options); if (!status.ok()) { return json; diff --git a/src/abacus/protobuf/kind.pb.cc b/src/abacus/protobuf/kind.pb.cc index e02b1918..4229dac6 100644 --- a/src/abacus/protobuf/kind.pb.cc +++ b/src/abacus/protobuf/kind.pb.cc @@ -32,8 +32,8 @@ static constexpr ::_pbi::MigrationSchema* schemas = nullptr; static constexpr ::_pb::Message* const* file_default_instances = nullptr; const char descriptor_table_protodef_abacus_2fprotobuf_2fkind_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\032abacus/protobuf/kind.proto\022\017abacus.pro" - "tobuf*,\n\004Kind\022\013\n\007COUNTER\020\000\022\014\n\010CONSTANT\020\001" - "\022\t\n\005GAUGE\020\002B\021Z\017abacus/protobufb\006proto3" + "tobuf*,\n\004Kind\022\t\n\005GAUGE\020\000\022\013\n\007COUNTER\020\001\022\014\n" + "\010CONSTANT\020\002B\021Z\017abacus/protobufb\006proto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fkind_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fkind_2eproto = { diff --git a/src/abacus/protobuf/kind.pb.h b/src/abacus/protobuf/kind.pb.h index 5037d23c..9a8b1ff7 100644 --- a/src/abacus/protobuf/kind.pb.h +++ b/src/abacus/protobuf/kind.pb.h @@ -60,9 +60,9 @@ namespace protobuf { namespace abacus { namespace protobuf { enum Kind : int { - COUNTER = 0, - CONSTANT = 1, - GAUGE = 2, + GAUGE = 0, + COUNTER = 1, + CONSTANT = 2, Kind_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::int32_t>::min(), Kind_INT_MAX_SENTINEL_DO_NOT_USE_ = diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index c4b5e6c5..ae9c54bc 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -246,26 +246,25 @@ TEST(test_metrics, reset_counters) } static const std::vector expected_meta_data = { - 0x08, 0x02, 0x1d, 0x31, 0x5c, 0x0a, 0x3f, 0x22, 0x32, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x27, 0x08, 0x04, 0x12, 0x23, + 0x08, 0x02, 0x1d, 0x76, 0x78, 0x4e, 0x60, 0x22, 0x34, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x08, 0x04, 0x12, 0x25, 0x0a, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x1a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, - 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, 0x12, 0x24, - 0x08, 0x0d, 0x1a, 0x20, 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x10, 0x02, 0x1a, 0x03, 0x55, 0x53, 0x44, - 0x22, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, - 0x23, 0x08, 0x16, 0x32, 0x1f, 0x0a, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, + 0x74, 0x72, 0x69, 0x63, 0x10, 0x01, 0x1a, 0x05, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x22, 0x2d, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, + 0x12, 0x22, 0x08, 0x0d, 0x1a, 0x1e, 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, + 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x03, 0x55, 0x53, 0x44, + 0x22, 0x2c, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, + 0x21, 0x08, 0x16, 0x32, 0x1d, 0x0a, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x10, 0x02, 0x1a, 0x02, 0x6d, 0x73, - 0x22, 0x23, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, - 0x18, 0x08, 0x1f, 0x42, 0x14, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, - 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x10, - 0x02}; + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x02, 0x6d, 0x73, 0x22, 0x21, + 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, 0x16, 0x08, + 0x1f, 0x42, 0x12, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, + 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63}; static const std::vector expected_value_data = { - 0x31, 0x5c, 0x0a, 0x3f, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x76, 0x78, 0x4e, 0x60, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x40, 0x01, 0x01, }; @@ -316,6 +315,12 @@ TEST(test_metrics, protocol_version) metrics.initialize_metric("metric2", 142.0); auto bool_metric = metrics.initialize_metric("metric3", true); + + (void)uint_metric; + (void)int_metric; + (void)float_metric; + (void)bool_metric; + EXPECT_EQ(metrics.metadata_bytes(), expected_meta_data.size()); { // Print the metadata as hex diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 1814a348..1612d029 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -49,6 +49,10 @@ TEST(test_to_json, to_json_minimal) metrics.initialize_constant(name2, true); auto m3 = metrics.initialize_metric(name3, 2); + (void)m0; + (void)m1; + (void)m3; + abacus::view view; view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); auto success = @@ -61,8 +65,10 @@ TEST(test_to_json, to_json_minimal) static const char* expected_json = R"({ "metric0" : { + "offset" : 4, "uint64" : { "description" : "An unsigned integer metric", + "kind" : "COUNTER", "max" : "100", "min" : "0", "unit" : "bytes" @@ -77,6 +83,7 @@ static const char* expected_json = R"({ "min" : "-100", "unit" : "USD" }, + "offset" : 13, "value" : -42 }, "metric2" : { @@ -84,6 +91,7 @@ static const char* expected_json = R"({ "description" : "A boolean constant", "kind" : "CONSTANT" }, + "offset" : 22, "value" : true }, "metric3" : { @@ -108,6 +116,7 @@ static const char* expected_json = R"({ } } }, + "offset" : 24, "value" : 2 } })"; @@ -140,6 +149,9 @@ TEST(test_to_json, to_json) auto m1 = metrics.initialize_metric(name1, -42); metrics.initialize_constant(name2, true); + (void)m0; + (void)m1; + abacus::view view; view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); auto success = From 3738eb4cb2da4d0a4162e124c8b21aea7a14a390 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Thu, 9 Jan 2025 13:45:23 +0100 Subject: [PATCH 13/68] work --- src/abacus/detail/size_of_type.hpp | 29 +++ src/abacus/metrics.cpp | 296 +++++++++++++++++++++++++++++ src/abacus/metrics.hpp | 285 ++------------------------- 3 files changed, 336 insertions(+), 274 deletions(-) create mode 100644 src/abacus/detail/size_of_type.hpp create mode 100644 src/abacus/metrics.cpp diff --git a/src/abacus/detail/size_of_type.hpp b/src/abacus/detail/size_of_type.hpp new file mode 100644 index 00000000..595f0ed6 --- /dev/null +++ b/src/abacus/detail/size_of_type.hpp @@ -0,0 +1,29 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include + +#include "../version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +namespace detail +{ +/// Get the size of the primitive backing type of a metric +/// @tparam Metric The metric to get the size of +/// @return The size of the primitive backing type of the metric +template +constexpr static auto size_of_type() -> std::size_t +{ + return sizeof(typename std::remove_pointer::type::type); +} +} +} +} diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp new file mode 100644 index 00000000..c7bedbf4 --- /dev/null +++ b/src/abacus/metrics.cpp @@ -0,0 +1,296 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#include "metrics.hpp" + +#include "detail/hash_function.hpp" +#include "detail/size_of_type.hpp" + +#include "protocol_version.hpp" +#include "type.hpp" +#include "version.hpp" + +#include "protobuf/metrics.pb.h" + +#include + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +metrics::metrics(metrics&& other) noexcept : + m_data(other.m_data), m_metadata(std::move(other.m_metadata)), + m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), + m_value_bytes(other.m_value_bytes), + m_initialized(std::move(other.m_initialized)) +{ + other.m_data = nullptr; + other.m_metadata = protobuf::MetricsMetadata(); + other.m_hash = 0; + other.m_metadata_bytes = 0; + other.m_value_bytes = 0; + other.m_initialized.clear(); +} + +metrics::metrics(const std::map& info) +{ + m_metadata = protobuf::MetricsMetadata(); + m_metadata.set_protocol_version(protocol_version()); + m_metadata.set_endianness(endian::is_big_endian() + ? protobuf::Endianness::BIG + : protobuf::Endianness::LITTLE); + + // The first byte is reserved for the sync value + m_value_bytes = sizeof(uint32_t); + + for (auto [name, value] : info) + { + protobuf::Metric metric; + metric.set_offset(m_value_bytes); + + // The offset is incremented by one byte which represents whether + // the metric is set or not. + m_value_bytes += 1; + + if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_uint64()->set_description(m->description); + metric.mutable_uint64()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_uint64()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_uint64()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_uint64()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_int64()->set_description(m->description); + metric.mutable_int64()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_int64()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_int64()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_int64()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_uint32()->set_description(m->description); + metric.mutable_uint32()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_uint32()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_uint32()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_uint32()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_int32()->set_description(m->description); + metric.mutable_int32()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_int32()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_int32()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_int32()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_float64()->set_description(m->description); + metric.mutable_float64()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_float64()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_float64()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_float64()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_float32()->set_description(m->description); + metric.mutable_float32()->set_kind(m->kind); + if (!m->unit.empty()) + { + metric.mutable_float32()->set_unit(m->unit.value); + } + if (m->min.value.has_value()) + { + metric.mutable_float32()->set_min(m->min.value.value()); + } + if (m->max.value.has_value()) + { + metric.mutable_float32()->set_max(m->max.value.value()); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_boolean()->set_description(m->description); + metric.mutable_boolean()->set_kind(m->kind); + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + m_value_bytes += detail::size_of_type(); + + metric.mutable_enum8()->set_description(m->description); + for (auto [key, value] : m->values) + { + auto enum_value = protobuf::EnumValue(); + enum_value.set_name(value.name); + if (!value.description.empty()) + { + enum_value.set_description(value.description); + } + + metric.mutable_enum8()->mutable_values()->insert( + {key, enum_value}); + } + } + + m_metadata.mutable_metrics()->insert({name, metric}); + m_initialized[name] = false; + } + + // Set the sync value to 1 so that the size of the metadata is + // calculated correctly + m_metadata.set_sync_value(1); + + m_metadata_bytes = m_metadata.ByteSizeLong(); + m_data = new uint8_t[m_metadata_bytes + m_value_bytes]; + + // Serialize the metadata + m_metadata.SerializeToArray(m_data, m_metadata_bytes); + + // Calculate the hash of the metadata + m_hash = detail::hash_function(m_data, m_metadata_bytes); + + // Update the sync value + m_metadata.set_sync_value(m_hash); + + // Serialize the metadata again to include the sync value + m_metadata.SerializeToArray(m_data, m_metadata_bytes); + + // Make sure the metadata didn't change unexpectedly + assert(m_metadata.ByteSizeLong() == m_metadata_bytes); + + // Write the sync value to the first byte of the value data (this will + // be written as the endianess of the system) + // Consuming code can use the endianness field in the metadata to + // read the sync value + std::memcpy(m_data + m_metadata_bytes, &m_hash, sizeof(uint32_t)); +} + +metrics::~metrics() +{ + if (m_data != nullptr) + delete[] m_data; +} + +auto metrics::value_data() const -> const uint8_t* +{ + return m_data + m_metadata_bytes; +} + +auto metrics::value_bytes() const -> std::size_t +{ + return m_value_bytes; +} + +auto metrics::metadata_data() const -> const uint8_t* +{ + return m_data; +} + +auto metrics::metadata_bytes() const -> std::size_t +{ + return m_metadata_bytes; +} + +auto metrics::metadata() const -> const protobuf::MetricsMetadata& +{ + return m_metadata; +} + +auto metrics::is_initialized(const std::string& name) const -> bool +{ + assert(m_initialized.find(name) != m_initialized.end()); + return m_initialized.at(name); +} + +auto metrics::is_initialized() const -> bool +{ + for (auto [name, initialized] : m_initialized) + { + if (!initialized) + { + return false; + } + } + return true; +} + +void metrics::reset_metrics() +{ + // Reset the value data + std::memset(m_data + m_metadata_bytes + sizeof(uint32_t), 0, + m_value_bytes - sizeof(uint32_t)); +} + +} +} diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 3d1dc111..dccafb6d 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -6,33 +6,20 @@ #pragma once #include -#include -#include #include #include -#include -#include "detail/hash_function.hpp" -#include "protocol_version.hpp" #include "type.hpp" #include "version.hpp" #include "protobuf/metrics.pb.h" -#include - namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { namespace { -template -static auto size_of_type() -> std::size_t -{ - return sizeof(typename std::remove_pointer::type::type); -} - static inline auto get_kind(const protobuf::Metric& metric) -> std::optional { @@ -58,7 +45,6 @@ get_kind(const protobuf::Metric& metric) -> std::optional } } } - /// This class is used for creating descriptive counters that are contiguous in /// memory, to allow for fast access and arithmetic operations. class metrics @@ -70,259 +56,29 @@ class metrics /// Move constructor /// @param other The metrics to move from. - metrics(metrics&& other) noexcept : - m_data(other.m_data), m_metadata(std::move(other.m_metadata)), - m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), - m_value_bytes(other.m_value_bytes), - m_initialized(std::move(other.m_initialized)) - { - other.m_data = nullptr; - other.m_metadata = protobuf::MetricsMetadata(); - other.m_hash = 0; - other.m_metadata_bytes = 0; - other.m_value_bytes = 0; - other.m_initialized.clear(); - } + metrics(metrics&& other) noexcept; /// Constructor /// @param info The info of the metrics to create. - metrics(const std::map& info) - { - m_metadata = protobuf::MetricsMetadata(); - m_metadata.set_protocol_version(protocol_version()); - m_metadata.set_endianness(endian::is_big_endian() - ? protobuf::Endianness::BIG - : protobuf::Endianness::LITTLE); - - // The first byte is reserved for the sync value - m_value_bytes = sizeof(uint32_t); - - for (auto [name, value] : info) - { - protobuf::Metric metric; - metric.set_offset(m_value_bytes); - - // The offset is incremented by one byte which represents whether - // the metric is set or not. - m_value_bytes += 1; - - if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_uint64()->set_description(m->description); - metric.mutable_uint64()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_uint64()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_uint64()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_uint64()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_int64()->set_description(m->description); - metric.mutable_int64()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_int64()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_int64()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_int64()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_uint32()->set_description(m->description); - metric.mutable_uint32()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_uint32()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_uint32()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_uint32()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_int32()->set_description(m->description); - metric.mutable_int32()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_int32()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_int32()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_int32()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_float64()->set_description(m->description); - metric.mutable_float64()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_float64()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_float64()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_float64()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_float32()->set_description(m->description); - metric.mutable_float32()->set_kind(m->kind); - if (!m->unit.empty()) - { - metric.mutable_float32()->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - metric.mutable_float32()->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - metric.mutable_float32()->set_max(m->max.value.value()); - } - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_boolean()->set_description(m->description); - metric.mutable_boolean()->set_kind(m->kind); - } - else if (auto* m = std::get_if(&value)) - { - // The offset is incremented by the size of the type - m_value_bytes += size_of_type(); - - metric.mutable_enum8()->set_description(m->description); - for (auto [key, value] : m->values) - { - auto enum_value = protobuf::EnumValue(); - enum_value.set_name(value.name); - if (!value.description.empty()) - { - enum_value.set_description(value.description); - } - - metric.mutable_enum8()->mutable_values()->insert( - {key, enum_value}); - } - } - - m_metadata.mutable_metrics()->insert({name, metric}); - m_initialized[name] = false; - } - - // Set the sync value to 1 so that the size of the metadata is - // calculated correctly - m_metadata.set_sync_value(1); - - m_metadata_bytes = m_metadata.ByteSizeLong(); - m_data = new uint8_t[m_metadata_bytes + m_value_bytes]; - - // Serialize the metadata - m_metadata.SerializeToArray(m_data, m_metadata_bytes); - - // Calculate the hash of the metadata - m_hash = detail::hash_function(m_data, m_metadata_bytes); - - // Update the sync value - m_metadata.set_sync_value(m_hash); - - // Serialize the metadata again to include the sync value - m_metadata.SerializeToArray(m_data, m_metadata_bytes); - - // Make sure the metadata didn't change unexpectedly - assert(m_metadata.ByteSizeLong() == m_metadata_bytes); - - // Write the sync value to the first byte of the value data (this will - // be written as the endianess of the system) - // Consuming code can use the endianness field in the metadata to - // read the sync value - std::memcpy(m_data + m_metadata_bytes, &m_hash, sizeof(uint32_t)); - } + metrics(const std::map& info); /// Destructor - ~metrics() - { - if (m_data != nullptr) - delete[] m_data; - } + ~metrics(); /// @return the pointer to the value data of the metrics. - auto value_data() const -> const uint8_t* - { - return m_data + m_metadata_bytes; - } + auto value_data() const -> const uint8_t*; /// @return the size of the value data of the metrics. - auto value_bytes() const -> std::size_t - { - return m_value_bytes; - } + auto value_bytes() const -> std::size_t; /// @return the pointer to the metadata data of the metrics. - auto metadata_data() const -> const uint8_t* - { - return m_data; - } + auto metadata_data() const -> const uint8_t*; /// @return the size of the metadata data of the metrics. - auto metadata_bytes() const -> std::size_t - { - return m_metadata_bytes; - } + auto metadata_bytes() const -> std::size_t; /// @return the metadata of the metrics. - auto metadata() const -> const protobuf::MetricsMetadata& - { - return m_metadata; - } + auto metadata() const -> const protobuf::MetricsMetadata&; /// Initialize a metric /// @param name The name of the metric @@ -378,33 +134,14 @@ class metrics /// Check if a metric has been initialized /// @param name The name of the metric /// @return true if the metric has been initialized - auto is_initialized(const std::string& name) const -> bool - { - assert(m_initialized.find(name) != m_initialized.end()); - return m_initialized.at(name); - } + auto is_initialized(const std::string& name) const -> bool; /// @return true if all metrics have been initialized - auto is_initialized() const -> bool - { - for (auto [name, initialized] : m_initialized) - { - if (!initialized) - { - return false; - } - } - return true; - } + auto is_initialized() const -> bool; /// Reset all metrics /// This will set all metrics has_value() to false. - void reset_metrics() - { - // Reset the value data - std::memset(m_data + m_metadata_bytes + sizeof(uint32_t), 0, - m_value_bytes - sizeof(uint32_t)); - } + void reset_metrics(); private: /// No copy From e27e6bbe48e077236d06fc54245ad48ef20ecfd9 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Thu, 9 Jan 2025 14:13:27 +0100 Subject: [PATCH 14/68] include guarding --- src/abacus/detail/common.hpp | 1 - src/abacus/detail/to_json.cpp | 11 +++ src/abacus/metrics.cpp | 111 +++++++++++++++++++++++++ src/abacus/metrics.hpp | 65 +-------------- src/abacus/type.hpp | 11 --- src/abacus/view.cpp | 149 ++++++++++++++++++++++++++++++++++ src/abacus/view.hpp | 115 ++++---------------------- 7 files changed, 287 insertions(+), 176 deletions(-) create mode 100644 src/abacus/view.cpp diff --git a/src/abacus/detail/common.hpp b/src/abacus/detail/common.hpp index d15750e5..69efa5cc 100644 --- a/src/abacus/detail/common.hpp +++ b/src/abacus/detail/common.hpp @@ -9,7 +9,6 @@ #include #include #include -#include #include "../version.hpp" diff --git a/src/abacus/detail/to_json.cpp b/src/abacus/detail/to_json.cpp index feaa6ce8..4e4bcd84 100644 --- a/src/abacus/detail/to_json.cpp +++ b/src/abacus/detail/to_json.cpp @@ -5,6 +5,17 @@ #include "to_json.hpp" +#include "../boolean.hpp" +#include "../enum8.hpp" +#include "../float32.hpp" +#include "../float64.hpp" +#include "../int32.hpp" +#include "../int64.hpp" +#include "../uint32.hpp" +#include "../uint64.hpp" + +#include "../view.hpp" + #include #include diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index c7bedbf4..9a1f3260 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -21,6 +21,31 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { +static inline auto +get_kind(const protobuf::Metric& metric) -> std::optional +{ + switch (metric.type_case()) + { + case protobuf::Metric::kUint64: + return metric.uint64().kind(); + case protobuf::Metric::kInt64: + return metric.int64().kind(); + case protobuf::Metric::kUint32: + return metric.uint32().kind(); + case protobuf::Metric::kInt32: + return metric.int32().kind(); + case protobuf::Metric::kFloat64: + return metric.float64().kind(); + case protobuf::Metric::kFloat32: + return metric.float32().kind(); + case protobuf::Metric::kBoolean: + return metric.boolean().kind(); + case protobuf::Metric::kEnum8: + default: + return std::nullopt; + } +} + metrics::metrics(metrics&& other) noexcept : m_data(other.m_data), m_metadata(std::move(other.m_metadata)), m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), @@ -236,6 +261,92 @@ metrics::metrics(const std::map& info) std::memcpy(m_data + m_metadata_bytes, &m_hash, sizeof(uint32_t)); } +template +[[nodiscard]] auto +metrics::initialize_metric(const std::string& name, + std::optional value) -> + typename Metric::metric +{ + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + auto kind = get_kind(proto_metric); + if (kind.has_value()) + { + assert(kind.value() != protobuf::Kind::CONSTANT); + } + + auto offset = proto_metric.offset(); + + if (value.has_value()) + { + return typename Metric::metric(m_data + m_metadata_bytes + offset, + value.value()); + } + else + { + return typename Metric::metric(m_data + m_metadata_bytes + offset); + } +} + +// Explicit instantiations for the expected types + +template auto metrics::initialize_metric( + const std::string& name, + std::optional value) -> uint64::metric; +template auto metrics::initialize_metric( + const std::string& name, std::optional value) -> int64::metric; +template auto metrics::initialize_metric( + const std::string& name, + std::optional value) -> uint32::metric; +template auto metrics::initialize_metric( + const std::string& name, std::optional value) -> int32::metric; +template auto metrics::initialize_metric( + const std::string& name, + std::optional value) -> float64::metric; +template auto metrics::initialize_metric( + const std::string& name, + std::optional value) -> float32::metric; +template auto metrics::initialize_metric( + const std::string& name, + std::optional value) -> boolean::metric; +template auto metrics::initialize_metric( + const std::string& name, std::optional value) -> enum8::metric; + +template +void metrics::initialize_constant(const std::string& name, + typename Metric::type value) +{ + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; + + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + auto offset = proto_metric.offset(); + auto kind = get_kind(proto_metric); + assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); + typename Metric::metric(m_data + m_metadata_bytes + offset, value); +} + +// Explicit instantiations for the expected types +template void metrics::initialize_constant(const std::string& name, + uint64::type value); +template void metrics::initialize_constant(const std::string& name, + int64::type value); +template void metrics::initialize_constant(const std::string& name, + uint32::type value); +template void metrics::initialize_constant(const std::string& name, + int32::type value); +template void metrics::initialize_constant(const std::string& name, + float64::type value); +template void metrics::initialize_constant(const std::string& name, + float32::type value); +template void metrics::initialize_constant(const std::string& name, + boolean::type value); +template void metrics::initialize_constant(const std::string& name, + enum8::type value); + metrics::~metrics() { if (m_data != nullptr) diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index dccafb6d..0ae8b7f1 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -18,33 +18,6 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -namespace -{ -static inline auto -get_kind(const protobuf::Metric& metric) -> std::optional -{ - switch (metric.type_case()) - { - case protobuf::Metric::kUint64: - return metric.uint64().kind(); - case protobuf::Metric::kInt64: - return metric.int64().kind(); - case protobuf::Metric::kUint32: - return metric.uint32().kind(); - case protobuf::Metric::kInt32: - return metric.int32().kind(); - case protobuf::Metric::kFloat64: - return metric.float64().kind(); - case protobuf::Metric::kFloat32: - return metric.float32().kind(); - case protobuf::Metric::kBoolean: - return metric.boolean().kind(); - case protobuf::Metric::kEnum8: - default: - return std::nullopt; - } -} -} /// This class is used for creating descriptive counters that are contiguous in /// memory, to allow for fast access and arithmetic operations. class metrics @@ -88,48 +61,14 @@ class metrics [[nodiscard]] auto initialize_metric( const std::string& name, std::optional value = std::nullopt) -> - typename Metric::metric - { - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); - auto kind = get_kind(proto_metric); - if (kind.has_value()) - { - assert(kind.value() != protobuf::Kind::CONSTANT); - } - - auto offset = proto_metric.offset(); - - if (value.has_value()) - { - return typename Metric::metric(m_data + m_metadata_bytes + offset, - value.value()); - } - else - { - return typename Metric::metric(m_data + m_metadata_bytes + offset); - } - } + typename Metric::metric; /// Initialize a constant metric /// @param name The name of the metric /// @param value The value of the metric template void initialize_constant(const std::string& name, - typename Metric::type value) - { - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); - auto offset = proto_metric.offset(); - auto kind = get_kind(proto_metric); - assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); - typename Metric::metric(m_data + m_metadata_bytes + offset, value); - } + typename Metric::type value); /// Check if a metric has been initialized /// @param name The name of the metric diff --git a/src/abacus/type.hpp b/src/abacus/type.hpp index dc70c07c..a333ae5d 100644 --- a/src/abacus/type.hpp +++ b/src/abacus/type.hpp @@ -5,19 +5,8 @@ #pragma once -#include -#include -#include -#include -#include #include -#include "detail/common.hpp" -#include "kind.hpp" -#include "max.hpp" -#include "min.hpp" -#include "unit.hpp" - #include "boolean.hpp" #include "enum8.hpp" #include "float32.hpp" diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp new file mode 100644 index 00000000..326e480f --- /dev/null +++ b/src/abacus/view.cpp @@ -0,0 +1,149 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#include "view.hpp" + +#include "boolean.hpp" +#include "enum8.hpp" +#include "float32.hpp" +#include "float64.hpp" +#include "int32.hpp" +#include "int64.hpp" +#include "uint32.hpp" +#include "uint64.hpp" + +#include +#include +#include + +#include +#include +#include + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +void view::set_meta_data(const uint8_t* metadata_data, + std::size_t metadata_bytes) +{ + assert(metadata_data != nullptr); + m_metadata_data = metadata_data; + m_metadata_bytes = metadata_bytes; + m_value_data = nullptr; + m_value_bytes = 0; + + m_metadata.ParseFromArray(metadata_data, metadata_bytes); +} + +[[nodiscard]] auto view::set_value_data(const uint8_t* value_data, + std::size_t value_bytes) -> bool +{ + assert(m_metadata_data != nullptr); + assert(value_data != nullptr); + + // Check that the hash is correct + uint32_t value_data_hash = 0; + switch (m_metadata.endianness()) + { + case protobuf::Endianness::BIG: + endian::big_endian::get(value_data_hash, value_data); + break; + case protobuf::Endianness::LITTLE: + endian::little_endian::get(value_data_hash, value_data); + break; + default: + assert(false); + } + + if (m_metadata.sync_value() != value_data_hash) + { + return false; + } + m_value_data = value_data; + m_value_bytes = value_bytes; + return true; +} + +auto view::metadata_data() const -> const uint8_t* +{ + return m_metadata_data; +} + +const uint8_t* view::value_data() const +{ + return m_value_data; +} + +std::size_t view::metadata_bytes() const +{ + return m_metadata_bytes; +} + +std::size_t view::value_bytes() const +{ + return m_value_bytes; +} + +auto view::metadata() const -> const protobuf::MetricsMetadata& +{ + return m_metadata; +} + +const protobuf::Metric& view::metric(const std::string& name) const +{ + return m_metadata.metrics().at(name); +} + +template +auto view::value(const std::string& name) const + -> std::optional +{ + assert(m_value_data != nullptr); + assert(m_metadata_data != nullptr); + + auto offset = metric(name).offset(); + assert(offset < m_value_bytes); + + if (m_value_data[offset] == 0) + { + return std::nullopt; + } + + typename Metric::type value; + + switch (m_metadata.endianness()) + { + case protobuf::Endianness::BIG: + endian::big_endian::get(value, m_value_data + offset + 1); + break; + case protobuf::Endianness::LITTLE: + endian::little_endian::get(value, m_value_data + offset + 1); + break; + default: + assert(false); + } + return value; +} + +// Explicit instantiations for the expected types +template auto view::value(const std::string& name) const + -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; +} +} diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index 2f1667ed..c9d6fdfd 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -5,19 +5,11 @@ #pragma once -#include -#include -#include +#include +#include +#include -#include -#include -#include - -#include "detail/hash_function.hpp" -#include "max.hpp" -#include "min.hpp" #include "protobuf/metrics.pb.h" -#include "type.hpp" #include "version.hpp" namespace abacus @@ -44,127 +36,48 @@ class view /// Sets the meta data pointer /// @param metadata_data The meta data pointer /// @param metadata_bytes The meta data size in bytes - void set_meta_data(const uint8_t* metadata_data, std::size_t metadata_bytes) - { - assert(metadata_data != nullptr); - m_metadata_data = metadata_data; - m_metadata_bytes = metadata_bytes; - m_value_data = nullptr; - m_value_bytes = 0; - - m_metadata.ParseFromArray(metadata_data, metadata_bytes); - } + void set_meta_data(const uint8_t* metadata_data, + std::size_t metadata_bytes); /// Sets the value data pointer /// @param value_data The value data pointer /// @param value_bytes The value data size in bytes /// @return true if the hash is correct otherwise false [[nodiscard]] auto set_value_data(const uint8_t* value_data, - std::size_t value_bytes) -> bool - { - assert(m_metadata_data != nullptr); - assert(value_data != nullptr); - - // Check that the hash is correct - uint32_t value_data_hash = 0; - switch (m_metadata.endianness()) - { - case protobuf::Endianness::BIG: - endian::big_endian::get(value_data_hash, value_data); - break; - case protobuf::Endianness::LITTLE: - endian::little_endian::get(value_data_hash, value_data); - break; - default: - assert(false); - } - - if (m_metadata.sync_value() != value_data_hash) - { - return false; - } - m_value_data = value_data; - m_value_bytes = value_bytes; - return true; - } + std::size_t value_bytes) -> bool; /// Gets the meta data pointer /// @return The meta data pointer - auto metadata_data() const -> const uint8_t* - { - return m_metadata_data; - } + auto metadata_data() const -> const uint8_t*; /// Gets the value data pointer /// @return The value data pointer - const uint8_t* value_data() const - { - return m_value_data; - } + const uint8_t* value_data() const; /// Gets the meta data size in bytes /// @return The meta data size in bytes - std::size_t metadata_bytes() const - { - return m_metadata_bytes; - } + std::size_t metadata_bytes() const; /// Gets the value data size in bytes /// @return The value data size in bytes - std::size_t value_bytes() const - { - return m_value_bytes; - } + std::size_t value_bytes() const; /// Gets the meta data /// @return The meta data - auto metadata() const -> const protobuf::MetricsMetadata& - { - return m_metadata; - } + auto metadata() const -> const protobuf::MetricsMetadata&; /// Gets the value of a metric /// @param name The name of the metric /// @return The value of the metric or std::nullopt if the metric has no /// value template - auto - value(const std::string& name) const -> std::optional - { - assert(m_value_data != nullptr); - assert(m_metadata_data != nullptr); - - auto offset = metric(name).offset(); - assert(offset < m_value_bytes); - - if (m_value_data[offset] == 0) - { - return std::nullopt; - } - - typename Metric::type value; - - switch (m_metadata.endianness()) - { - case protobuf::Endianness::BIG: - endian::big_endian::get(value, m_value_data + offset + 1); - break; - case protobuf::Endianness::LITTLE: - endian::little_endian::get(value, m_value_data + offset + 1); - break; - default: - assert(false); - } - return value; - } + auto value(const std::string& name) const + -> std::optional; /// Gets the metric /// @param name The name of the metric /// @return The metric - const protobuf::Metric& metric(const std::string& name) const - { - return m_metadata.metrics().at(name); - } + const protobuf::Metric& metric(const std::string& name) const; private: /// The meta data pointer From cdcab108807d291c3ae5b88c82dbf129a9388d6f Mon Sep 17 00:00:00 2001 From: "Morten V. Pedersen" Date: Mon, 20 Jan 2025 09:03:18 +0100 Subject: [PATCH 15/68] Mvp experiment (#42) * WIP --- benchmark/main.cpp | 16 +- examples/metrics_simple.cpp | 26 ++- src/abacus/detail/common.hpp | 395 +++++++++++++++++++++++++++++++---- src/abacus/float32.hpp | 11 +- src/abacus/float64.hpp | 11 +- src/abacus/int32.hpp | 11 +- src/abacus/int64.hpp | 11 +- src/abacus/metrics.cpp | 45 +++- src/abacus/metrics.hpp | 16 +- src/abacus/name.hpp | 47 +++++ src/abacus/uint32.hpp | 11 +- src/abacus/uint64.hpp | 11 +- test/src/test_metrics.cpp | 68 +++--- test/src/test_to_json.cpp | 50 +++-- test/src/test_view.cpp | 27 +-- 15 files changed, 586 insertions(+), 170 deletions(-) create mode 100644 src/abacus/name.hpp diff --git a/benchmark/main.cpp b/benchmark/main.cpp index bbd47fa7..8574ae56 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -4,16 +4,16 @@ #include // Helper function to create metric definitions -std::map create_metric_infos() +std::map create_metric_infos() { return { - {"0", abacus::boolean{abacus::kind::GAUGE, ""}}, - {"1", abacus::uint64{abacus::kind::GAUGE, ""}}, - {"2", abacus::int64{abacus::kind::GAUGE, ""}}, - {"3", abacus::float64{abacus::kind::GAUGE, ""}}, - {"4", abacus::boolean{abacus::kind::GAUGE, ""}}, - {"5", abacus::float64{abacus::kind::GAUGE, ""}}, - {"6", + {abacus::name{"0"}, abacus::boolean{abacus::kind::GAUGE, ""}}, + {abacus::name{"1"}, abacus::uint64{abacus::kind::GAUGE, ""}}, + {abacus::name{"2"}, abacus::int64{abacus::kind::GAUGE, ""}}, + {abacus::name{"3"}, abacus::float64{abacus::kind::GAUGE, ""}}, + {abacus::name{"4"}, abacus::boolean{abacus::kind::GAUGE, ""}}, + {abacus::name{"5"}, abacus::float64{abacus::kind::GAUGE, ""}}, + {abacus::name{"6"}, abacus::enum8{ "", {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}}}}; diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 038231a9..3b4e886b 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -19,17 +19,21 @@ int main() std::string name2 = "days_until_maintenance"; std::string name3 = "registered"; - std::map infos = { - {name0, abacus::float64{abacus::kind::CONSTANT, - "Fuel consumption in kilometers per liter ", - abacus::unit{"km/l"}}}, - {name1, abacus::uint64{abacus::kind::CONSTANT, "Wheels on the car", - abacus::unit{"wheels"}}}, - {name2, abacus::int64{abacus::kind::GAUGE, - "Days until next maintenance, if less than 0, " - "maintenance is overdue", - abacus::unit{"days"}}}, - {name3, abacus::boolean{abacus::kind::GAUGE, "Is the car registered"}}}; + std::map infos = { + {abacus::name{name0}, + abacus::float64{abacus::kind::CONSTANT, + "Fuel consumption in kilometers per liter ", + abacus::unit{"km/l"}}}, + {abacus::name{name1}, + abacus::uint64{abacus::kind::CONSTANT, "Wheels on the car", + abacus::unit{"wheels"}}}, + {abacus::name{name2}, + abacus::int64{abacus::kind::GAUGE, + "Days until next maintenance, if less than 0, " + "maintenance is overdue", + abacus::unit{"days"}}}, + {abacus::name{name3}, + abacus::boolean{abacus::kind::GAUGE, "Is the car registered"}}}; abacus::metrics car(infos); diff --git a/src/abacus/detail/common.hpp b/src/abacus/detail/common.hpp index 69efa5cc..6872430e 100644 --- a/src/abacus/detail/common.hpp +++ b/src/abacus/detail/common.hpp @@ -18,33 +18,30 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace detail { -/// A common class for most metrics -template -struct common +/// A optional_metric class for most metrics +template +struct optional_metric { - /// The primitive type of the metric - using type = typename T::type; - /// The metric type - using metric = typename T::metric; + using value_type = typename Metric::type; /// Default constructor - common() = default; + optional_metric() = default; /// Constructor /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. - common(uint8_t* memory) : m_memory(memory) + optional_metric(uint8_t* memory) : m_memory(memory) { assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(type) + 1); + memset(m_memory, 0, sizeof(value_type) + 1); } /// Constructor /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. /// @param value The initial value of the metric - common(uint8_t* memory, type value) : common(memory) + optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) { set_value(value); } @@ -75,22 +72,27 @@ struct common /// Get the value of the metric /// @return The value of the metric - auto value() const -> type + auto value() const -> value_type { assert(is_initialized()); assert(has_value()); - type value; - std::memcpy(&value, m_memory + 1, sizeof(value)); + value_type value; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); return value; } /// Assign a new value to the metric /// @param value The value to assign - auto set_value(type value) -> void + auto set_value(value_type value) -> void { assert(is_initialized()); - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + m_memory[0] = 1; std::memcpy(m_memory + 1, &value, sizeof(value)); } @@ -98,62 +100,385 @@ struct common /// Assign the metric a new value /// @param value The value to assign /// @return the metric with the new value - auto operator=(type value) -> metric& + auto operator=(value_type value) -> optional_metric& { assert(is_initialized()); set_value(value); - return (metric&)*this; + return *this; } /// Increment the metric /// @param value The value to add /// @return The result of the arithmetic - auto operator+=(type value) -> metric& + auto operator+=(value_type value) -> optional_metric& { assert(has_value()); + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + auto new_value = this->value() + value; - assert(!std::isnan(new_value) && "Cannot assign a NaN"); - assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; } /// Decrement the metric /// @param value The value to subtract /// @return The result of the arithmetic - auto operator-=(type value) -> metric& + auto operator-=(value_type value) -> optional_metric& { assert(has_value()); + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + auto new_value = this->value() - value; - assert(!std::isnan(new_value) && "Cannot assign a NaN"); - assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; } /// Increment the value of the metric /// @return The result of the arithmetic - auto operator++() -> metric& + auto operator++() -> optional_metric& + { + assert(has_value()); + auto new_value = value() + 1; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + + /// Decrement the value of the metric + /// @return The result of the arithmetic + auto operator--() -> optional_metric& + { + auto new_value = value() - 1; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; + +template <> +struct optional_metric +{ + + using value_type = boolean::type; + + /// Default constructor + optional_metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + optional_metric(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(value_type) + 1); + } + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The initial value of the metric + optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) + { + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + /// Reset the metric + /// This will set the metric to an uninitialized state causing + /// has_value() to return false. + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> value_type + { + assert(is_initialized()); + assert(has_value()); + value_type value; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); + return value; + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(value_type value) -> void + { + assert(is_initialized()); + + m_memory[0] = 1; + std::memcpy(m_memory + 1, &value, sizeof(value)); + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(value_type value) -> optional_metric& + { + assert(is_initialized()); + set_value(value); + return *this; + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; + +template <> +struct optional_metric +{ + + using value_type = enum8::type; + + /// Default constructor + optional_metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + optional_metric(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memset(m_memory, 0, sizeof(value_type) + 1); + } + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The initial value of the metric + optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) + { + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1U; + } + + /// Reset the metric + /// This will set the metric to an uninitialized state causing + /// has_value() to return false. + auto reset() -> void { + assert(is_initialized()); + m_memory[0] = 0; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> value_type + { + assert(is_initialized()); assert(has_value()); + value_type value; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); + return value; + } + + auto set_value(value_type value) -> void + { + assert(is_initialized()); + + m_memory[0] = 1; + std::memcpy(m_memory + 1, &value, sizeof(value)); + } + + /// Assign a new value to the metric + /// @param value The value to assign + template + auto set_value(T value) -> void + { + assert(is_initialized()); + static_assert(std::is_enum_v, "T must be an enum type"); + + assert(value <= std::numeric_limits::max()); + + m_memory[0] = 1; + std::memcpy(m_memory + 1, &value, sizeof(value)); + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(value_type value) -> optional_metric& + { + assert(is_initialized()); + set_value(value); + return *this; + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; + +/// A required_metric class for most metrics +template +struct required_metric +{ + + using value_type = typename Metric::type; + + /// Default constructor + required_metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + required_metric(uint8_t* memory) : m_memory(memory) + { + assert(m_memory != nullptr); + memory[0] = 1; + memset(m_memory + 1, 0, sizeof(value_type)); + } + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The initial value of the metric + required_metric(uint8_t* memory, value_type value) : required_metric(memory) + { + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> value_type + { + assert(is_initialized()); + value_type value; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); + return value; + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(value_type value) -> void + { + assert(is_initialized()); + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + + std::memcpy(m_memory + 1, &value, sizeof(value_type)); + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(value_type value) -> required_metric& + { + set_value(value); + return *this; + } + + /// Increment the metric + /// @param value The value to add + /// @return The result of the arithmetic + auto operator+=(value_type value) -> required_metric& + { + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + + auto new_value = this->value() + value; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + + /// Decrement the metric + /// @param value The value to subtract + /// @return The result of the arithmetic + auto operator-=(value_type value) -> required_metric& + { + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + + auto new_value = this->value() - value; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + + /// Increment the value of the metric + /// @return The result of the arithmetic + auto operator++() -> required_metric& + { auto new_value = value() + 1; - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; } /// Decrement the value of the metric /// @return The result of the arithmetic - auto operator--() -> metric& + auto operator--() -> required_metric& { auto new_value = value() - 1; - std::memcpy(m_memory + 1, &new_value, sizeof(new_value)); - return (metric&)*this; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; } protected: /// The metric memory uint8_t* m_memory = nullptr; }; + } } } diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index bc071cbf..7a0d1a5a 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -25,14 +25,9 @@ struct float32 using type = float; /// The metric type - struct metric : public detail::common - { - /// Inherit the constructors and various operators from the common class - using detail::common::common; - - /// Inherit the assignment operator from the common class - using detail::common::operator=; - }; + using metric = detail::optional_metric; + + using required_metric = detail::required_metric; /// The metric kind abacus::kind kind; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index e9d1f9ff..94c3fc19 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -23,14 +23,9 @@ struct float64 using type = double; /// The metric type - struct metric : public detail::common - { - /// Inherit the constructors and various operators from the common class - using detail::common::common; - - /// Inherit the assignment operator from the common class - using detail::common::operator=; - }; + using metric = detail::optional_metric; + + using required_metric = detail::required_metric; /// The metric kind abacus::kind kind; diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 437daeb0..3e13d886 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -23,14 +23,9 @@ struct int32 using type = int32_t; /// The metric type - struct metric : public detail::common - { - /// Inherit the constructors and various operators from the common class - using detail::common::common; - - /// Inherit the assignment operator from the common class - using detail::common::operator=; - }; + using metric = detail::optional_metric; + + using required_metric = detail::required_metric; /// The metric kind abacus::kind kind; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 078bf418..2f8c4e5f 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -23,14 +23,9 @@ struct int64 using type = int64_t; /// The metric type - struct metric : public detail::common - { - /// Inherit the constructors and various operators from the common class - using detail::common::common; - - /// Inherit the assignment operator from the common class - using detail::common::operator=; - }; + using metric = detail::optional_metric; + + using required_metric = detail::required_metric; /// The metric kind abacus::kind kind; diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 9a1f3260..cafc6a52 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -60,7 +60,7 @@ metrics::metrics(metrics&& other) noexcept : other.m_initialized.clear(); } -metrics::metrics(const std::map& info) +metrics::metrics(const std::map& info) { m_metadata = protobuf::MetricsMetadata(); m_metadata.set_protocol_version(protocol_version()); @@ -228,8 +228,8 @@ metrics::metrics(const std::map& info) } } - m_metadata.mutable_metrics()->insert({name, metric}); - m_initialized[name] = false; + m_metadata.mutable_metrics()->insert({name.value, metric}); + m_initialized[name.value] = false; } // Set the sync value to 1 so that the size of the metadata is @@ -290,6 +290,27 @@ metrics::initialize_metric(const std::string& name, } } +template +[[nodiscard]] auto metrics::initialize_required(const std::string& name, + typename Metric::type value) -> + typename Metric::required_metric +{ + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + auto kind = get_kind(proto_metric); + if (kind.has_value()) + { + assert(kind.value() != protobuf::Kind::CONSTANT); + } + + auto offset = proto_metric.offset(); + + return typename Metric::required_metric(m_data + m_metadata_bytes + offset, + value); +} + // Explicit instantiations for the expected types template auto metrics::initialize_metric( @@ -314,6 +335,24 @@ template auto metrics::initialize_metric( template auto metrics::initialize_metric( const std::string& name, std::optional value) -> enum8::metric; +template auto metrics::initialize_required( + const std::string& name, uint64::type value) -> uint64::required_metric; +template auto metrics::initialize_required( + const std::string& name, int64::type value) -> int64::required_metric; +template auto metrics::initialize_required( + const std::string& name, uint32::type value) -> uint32::required_metric; +template auto metrics::initialize_required( + const std::string& name, int32::type value) -> int32::required_metric; +template auto metrics::initialize_required( + const std::string& name, float64::type value) -> float64::required_metric; +template auto metrics::initialize_required( + const std::string& name, float32::type value) -> float32::required_metric; +// template auto metrics::initialize_required( +// const std::string& name, boolean::type value) -> +// boolean::required_metric; +// template auto metrics::initialize_required( +// const std::string& name, enum8::type value) -> enum8::required_metric; + template void metrics::initialize_constant(const std::string& name, typename Metric::type value) diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 0ae8b7f1..dbd1e0a6 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -9,6 +9,7 @@ #include #include +#include "name.hpp" #include "type.hpp" #include "version.hpp" @@ -33,7 +34,7 @@ class metrics /// Constructor /// @param info The info of the metrics to create. - metrics(const std::map& info); + metrics(const std::map& info); /// Destructor ~metrics(); @@ -53,6 +54,10 @@ class metrics /// @return the metadata of the metrics. auto metadata() const -> const protobuf::MetricsMetadata&; + template + void initialize_optional(const std::string& name, + detail::optional_metric& metric); + /// Initialize a metric /// @param name The name of the metric /// @param value Optional initial value of the metric @@ -63,6 +68,15 @@ class metrics std::optional value = std::nullopt) -> typename Metric::metric; + /// Initialize a metric + /// @param name The name of the metric + /// @param value Optional initial value of the metric + /// @return The metric object + template + [[nodiscard]] auto initialize_required(const std::string& name, + typename Metric::type) -> + typename Metric::required_metric; + /// Initialize a constant metric /// @param name The name of the metric /// @param value The value of the metric diff --git a/src/abacus/name.hpp b/src/abacus/name.hpp new file mode 100644 index 00000000..acb6c05c --- /dev/null +++ b/src/abacus/name.hpp @@ -0,0 +1,47 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +/// Strongly typed unit for a metric +struct name +{ + /// Default constructor + name() = default; + + /// Explicit constructor + explicit name(const std::string& v) : value(v) + { + } + + /// @return True if the name is empty otherwise false + bool empty() const + { + return value.empty(); + } + + /// The name string + std::string value; +}; + +inline bool operator==(const name& lhs, const name& rhs) +{ + return lhs.value == rhs.value; +} + +inline bool operator<(const name& lhs, const name& rhs) +{ + return lhs.value < rhs.value; +} + +} +} diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 01b71f63..41b88ab3 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -23,14 +23,9 @@ struct uint32 using type = uint32_t; /// The metric type - struct metric : public detail::common - { - /// Inherit the constructors and various operators from the common class - using detail::common::common; - - /// Inherit the assignment operator from the common class - using detail::common::operator=; - }; + using metric = detail::optional_metric; + + using required_metric = detail::required_metric; /// The metric kind abacus::kind kind; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index 070497cd..d99b63c8 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -23,14 +23,9 @@ struct uint64 using type = uint64_t; /// The metric type - struct metric : public detail::common - { - /// Inherit the constructors and various operators from the common class - using detail::common::common; - - /// Inherit the assignment operator from the common class - using detail::common::operator=; - }; + using metric = detail::optional_metric; + + using required_metric = detail::required_metric; /// The metric kind abacus::kind kind; diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index ae9c54bc..cba326f2 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -18,7 +18,7 @@ TEST(test_metrics, empty) EXPECT_EQ(0U, metrics.metadata().metrics().size()); - std::map infos; + std::map infos; abacus::metrics metrics2(infos); EXPECT_EQ(0U, metrics2.metadata().metrics().size()); @@ -34,25 +34,30 @@ TEST(test_metrics, api) std::string name5 = "metric5"; std::string name6 = "metric6"; - std::map infos = { - {name0, abacus::boolean{abacus::kind::COUNTER, "A boolean metric"}}, - {name1, + std::map infos = { + {abacus::name{name0}, + abacus::boolean{abacus::kind::COUNTER, "A boolean metric"}}, + {abacus::name{name1}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, - {name2, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}, - {name3, abacus::float64{abacus::kind::GAUGE, "A floating point metric", - abacus::unit{"ms"}}}, - {name4, + {abacus::name{name2}, + abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}, + {abacus::name{name3}, + abacus::float64{abacus::kind::GAUGE, "A floating point metric", + abacus::unit{"ms"}}}, + {abacus::name{name4}, abacus::boolean{abacus::kind::CONSTANT, "A constant boolean metric"}}, - {name5, abacus::float64{abacus::kind::CONSTANT, - "A constant floating point metric", - abacus::unit{"ms"}}}, - {name6, abacus::enum8{"An enum metric", - {{0, {"value0", "The value for 0"}}, - {1, {"value1", "The value for 1"}}, - {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {abacus::name{name5}, + abacus::float64{abacus::kind::CONSTANT, + "A constant floating point metric", + abacus::unit{"ms"}}}, + {abacus::name{name6}, + abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics from_metrics(infos); abacus::metrics metrics(std::move(from_metrics)); @@ -183,12 +188,13 @@ TEST(test_metrics, value_and_metadata_bytes) std::string name0 = "metric0"; std::string name1 = "metric1"; - std::map infos = { - {name0, + std::map infos = { + {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, - {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}}; + {abacus::name{name1}, + abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; @@ -209,12 +215,13 @@ TEST(test_metrics, reset_counters) std::string name0 = "metric0"; std::string name1 = "metric1"; - std::map infos = { - {name0, + std::map infos = { + {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, - {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}}; + {abacus::name{name1}, + abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; @@ -294,17 +301,18 @@ TEST(test_metrics, protocol_version) SCOPED_TRACE( ::testing::Message() << "If this test fails, you need to update the protocol version"); - std::map infos = { - {"metric0", + std::map infos = { + {abacus::name{"metric0"}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, - {"metric1", + {abacus::name{"metric1"}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", abacus::unit{"USD"}}}, - {"metric2", + {abacus::name{"metric2"}, abacus::float64{abacus::kind::GAUGE, "A floating point metric", abacus::unit{"ms"}}}, - {"metric3", abacus::boolean{abacus::kind::GAUGE, "A boolean metric"}}}; + {abacus::name{"metric3"}, + abacus::boolean{abacus::kind::GAUGE, "A boolean metric"}}}; abacus::metrics metrics(infos); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 1612d029..223c8228 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -27,20 +27,23 @@ TEST(test_to_json, to_json_minimal) std::string name2 = "metric2"; std::string name3 = "metric3"; - std::map infos = { - {name0, + std::map infos = { + {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, - {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}, abacus::min{int64_t{-100}}, - abacus::max{int64_t{100}}}}, - {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, - {name3, abacus::enum8{"An enum metric", - {{0, {"value0", "The value for 0"}}, - {1, {"value1", "The value for 1"}}, - {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {abacus::name{name1}, + abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}, abacus::min{int64_t{-100}}, + abacus::max{int64_t{100}}}}, + {abacus::name{name2}, + abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, + {abacus::name{name3}, + abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); @@ -128,20 +131,23 @@ TEST(test_to_json, to_json) std::string name2 = "metric2"; std::string name3 = "metric3"; - std::map infos = { - {name0, + std::map infos = { + {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, - {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}, abacus::min{int64_t{-100}}, - abacus::max{int64_t{100}}}}, - {name2, abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, - {name3, abacus::enum8{"An enum metric", - {{0, {"value0", "The value for 0"}}, - {1, {"value1", "The value for 1"}}, - {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {abacus::name{name1}, + abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}, abacus::min{int64_t{-100}}, + abacus::max{int64_t{100}}}}, + {abacus::name{name2}, + abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, + {abacus::name{name3}, + abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index ecfe5a93..f0e81a72 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -20,20 +20,23 @@ TEST(test_view, api) std::string name2 = "metric2"; std::string name3 = "metric3"; - std::map infos = { - {name0, + std::map infos = { + {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", abacus::unit{"bytes"}}}, - {name1, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}, - {name2, abacus::float64{abacus::kind::CONSTANT, - "A constant floating point metric", - abacus::unit{"ms"}}}, - {name3, abacus::enum8{"An enum metric", - {{0, {"value0", "The value for 0"}}, - {1, {"value1", "The value for 1"}}, - {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {abacus::name{name1}, + abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::unit{"USD"}}}, + {abacus::name{name2}, + abacus::float64{abacus::kind::CONSTANT, + "A constant floating point metric", + abacus::unit{"ms"}}}, + {abacus::name{name3}, + abacus::enum8{"An enum metric", + {{0, {"value0", "The value for 0"}}, + {1, {"value1", "The value for 1"}}, + {2, {"value2", "The value for 2"}}, + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); From c6fabc672268505d0bb2fd08ea9afcb23e6e29db Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 21 Jan 2025 13:43:20 +0100 Subject: [PATCH 16/68] work --- benchmark/main.cpp | 66 +-- examples/metrics_simple.cpp | 15 +- protobuf/metrics.proto | 17 +- src/abacus/availability.hpp | 39 ++ src/abacus/boolean.hpp | 89 +--- src/abacus/description.hpp | 47 ++ src/abacus/detail/common.hpp | 484 ------------------ .../detail/has_arithmetic_operators.hpp | 41 ++ src/abacus/enum8.hpp | 89 +--- src/abacus/float32.hpp | 15 +- src/abacus/float64.hpp | 15 +- src/abacus/int32.hpp | 15 +- src/abacus/int64.hpp | 15 +- src/abacus/metrics.cpp | 132 +++-- src/abacus/metrics.hpp | 23 +- src/abacus/name.hpp | 2 +- src/abacus/optional_metric.hpp | 216 ++++++++ src/abacus/parse_metadata.cpp | 26 + src/abacus/parse_metadata.hpp | 22 + src/abacus/protobuf/metrics.pb.cc | 141 +++-- src/abacus/protobuf/metrics.pb.h | 100 ++-- src/abacus/required_metric.hpp | 180 +++++++ src/abacus/uint32.hpp | 15 +- src/abacus/uint64.hpp | 15 +- src/abacus/view.cpp | 6 +- test/src/test_metric.cpp | 4 +- test/src/test_metrics.cpp | 160 +++--- test/src/test_to_json.cpp | 52 +- test/src/test_type.cpp | 16 +- test/src/test_view.cpp | 15 +- 30 files changed, 1091 insertions(+), 981 deletions(-) create mode 100644 src/abacus/availability.hpp create mode 100644 src/abacus/description.hpp delete mode 100644 src/abacus/detail/common.hpp create mode 100644 src/abacus/detail/has_arithmetic_operators.hpp create mode 100644 src/abacus/optional_metric.hpp create mode 100644 src/abacus/parse_metadata.cpp create mode 100644 src/abacus/parse_metadata.hpp create mode 100644 src/abacus/required_metric.hpp diff --git a/benchmark/main.cpp b/benchmark/main.cpp index 8574ae56..375823ef 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -6,17 +6,23 @@ // Helper function to create metric definitions std::map create_metric_infos() { - return { - {abacus::name{"0"}, abacus::boolean{abacus::kind::GAUGE, ""}}, - {abacus::name{"1"}, abacus::uint64{abacus::kind::GAUGE, ""}}, - {abacus::name{"2"}, abacus::int64{abacus::kind::GAUGE, ""}}, - {abacus::name{"3"}, abacus::float64{abacus::kind::GAUGE, ""}}, - {abacus::name{"4"}, abacus::boolean{abacus::kind::GAUGE, ""}}, - {abacus::name{"5"}, abacus::float64{abacus::kind::GAUGE, ""}}, - {abacus::name{"6"}, - abacus::enum8{ - "", - {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}}}}; + return {{abacus::name{"0"}, + abacus::boolean{abacus::kind::GAUGE, "", abacus::required}}, + {abacus::name{"1"}, + abacus::uint64{abacus::kind::GAUGE, "", abacus::required}}, + {abacus::name{"2"}, + abacus::int64{abacus::kind::GAUGE, "", abacus::required}}, + {abacus::name{"3"}, + abacus::float64{abacus::kind::GAUGE, "", abacus::required}}, + {abacus::name{"4"}, + abacus::boolean{abacus::kind::GAUGE, "", abacus::required}}, + {abacus::name{"5"}, + abacus::float64{abacus::kind::GAUGE, "", abacus::required}}, + {abacus::name{"6"}, + abacus::enum8{ + "", + {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}, + abacus::required}}}; } // Benchmark for metric initialization @@ -26,13 +32,13 @@ static void BM_MetricInitialization(benchmark::State& state) for (auto _ : state) { abacus::metrics metrics(create_metric_infos()); - auto m0 = metrics.initialize_metric("0", false); - auto m1 = metrics.initialize_metric("1", 0); - auto m2 = metrics.initialize_metric("2", 0); - auto m3 = metrics.initialize_metric("3", 0.0); - auto m4 = metrics.initialize_metric("4", true); - auto m5 = metrics.initialize_metric("5", 3.14); - auto m6 = metrics.initialize_metric("6", 1); + auto m0 = metrics.initialize_required("0", false); + auto m1 = metrics.initialize_required("1", 0); + auto m2 = metrics.initialize_required("2", 0); + auto m3 = metrics.initialize_required("3", 0.0); + auto m4 = metrics.initialize_required("4", true); + auto m5 = metrics.initialize_required("5", 3.14); + auto m6 = metrics.initialize_required("6", 1); (void)m0; (void)m1; @@ -50,13 +56,13 @@ static void BM_AssignMetrics(benchmark::State& state) { state.SetLabel("Assign Metrics"); abacus::metrics metrics(create_metric_infos()); - auto m0 = metrics.initialize_metric("0", false); - auto m1 = metrics.initialize_metric("1", 0); - auto m2 = metrics.initialize_metric("2", 0); - auto m3 = metrics.initialize_metric("3", 0.0); - auto m4 = metrics.initialize_metric("4", true); - auto m5 = metrics.initialize_metric("5", 3.14); - auto m6 = metrics.initialize_metric("6", 1); + auto m0 = metrics.initialize_required("0", false); + auto m1 = metrics.initialize_required("1", 0); + auto m2 = metrics.initialize_required("2", 0); + auto m3 = metrics.initialize_required("3", 0.0); + auto m4 = metrics.initialize_required("4", true); + auto m5 = metrics.initialize_required("5", 3.14); + auto m6 = metrics.initialize_required("6", 1); for (auto _ : state) { @@ -77,10 +83,10 @@ static void BM_AccessMetrics(benchmark::State& state) { state.SetLabel("Access Metrics"); abacus::metrics metrics(create_metric_infos()); - auto m0 = metrics.initialize_metric("0", false); - auto m1 = metrics.initialize_metric("1", 0); - auto m2 = metrics.initialize_metric("2", 0); - auto m3 = metrics.initialize_metric("3", 0.0); + auto m0 = metrics.initialize_required("0", false); + auto m1 = metrics.initialize_required("1", 0); + auto m2 = metrics.initialize_required("2", 0); + auto m3 = metrics.initialize_required("3", 0.0); for (auto _ : state) { @@ -103,7 +109,7 @@ static void BM_IncrementUint64(benchmark::State& state) { state.SetLabel("Increment Uint64 Metric"); abacus::metrics metrics(create_metric_infos()); - auto m1 = metrics.initialize_metric("1", 0); + auto m1 = metrics.initialize_required("1", 0); for (auto _ : state) { diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 3b4e886b..4a62e1a2 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -22,18 +22,19 @@ int main() std::map infos = { {abacus::name{name0}, abacus::float64{abacus::kind::CONSTANT, - "Fuel consumption in kilometers per liter ", - abacus::unit{"km/l"}}}, + "Fuel consumption in kilometers per liter", + abacus::required, abacus::unit{"km/l"}}}, {abacus::name{name1}, abacus::uint64{abacus::kind::CONSTANT, "Wheels on the car", - abacus::unit{"wheels"}}}, + abacus::required, abacus::unit{"wheels"}}}, {abacus::name{name2}, abacus::int64{abacus::kind::GAUGE, "Days until next maintenance, if less than 0, " "maintenance is overdue", - abacus::unit{"days"}}}, + abacus::required, abacus::unit{"days"}}}, {abacus::name{name3}, - abacus::boolean{abacus::kind::GAUGE, "Is the car registered"}}}; + abacus::boolean{abacus::kind::GAUGE, "Is the car registered", + abacus::required}}}; abacus::metrics car(infos); @@ -42,11 +43,11 @@ int main() // The car still has some time before maintenance. auto days_until_maintenance = - car.initialize_metric("days_until_maintenance", 10); + car.initialize_required("days_until_maintenance", 10); // The car should be registered. auto registered = - car.initialize_metric("registered", false); + car.initialize_required("registered", false); // The car has been registered. registered = true; diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 9946045d..15b4f7ff 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -88,15 +88,16 @@ message Enum8Metric { message Metric { uint32 offset = 1; // Offset into packed memory for the value + bool optional = 2; // Whether the metric is optional oneof type { - UInt64Metric uint64 = 2; // Metadata for unsigned 64-bit metrics - Int64Metric int64 = 3; // Metadata for signed 64-bit metrics - UInt32Metric uint32 = 4; // Metadata for unsigned 32-bit metrics - Int32Metric int32 = 5; // Metadata for signed 32-bit metrics - Float64Metric float64 = 6; // Metadata for 64-bit floating-point metrics - Float32Metric float32 = 7; // Metadata for 32-bit floating-point metrics - BoolMetric boolean = 8; // Metadata for boolean metrics - Enum8Metric enum8 = 9; // Metadata for enumerated metrics + UInt64Metric uint64 = 3; // Metadata for unsigned 64-bit metrics + Int64Metric int64 = 4; // Metadata for signed 64-bit metrics + UInt32Metric uint32 = 5; // Metadata for unsigned 32-bit metrics + Int32Metric int32 = 6; // Metadata for signed 32-bit metrics + Float64Metric float64 = 7; // Metadata for 64-bit floating-point metrics + Float32Metric float32 = 8; // Metadata for 32-bit floating-point metrics + BoolMetric boolean = 9; // Metadata for boolean metrics + Enum8Metric enum8 = 10; // Metadata for enumerated metrics } } diff --git a/src/abacus/availability.hpp b/src/abacus/availability.hpp new file mode 100644 index 00000000..288a0c81 --- /dev/null +++ b/src/abacus/availability.hpp @@ -0,0 +1,39 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include + +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +struct required_ +{ +}; +static const required_ required; + +struct optional_ +{ +}; +static const optional_ optional; + +using availability = std::variant; + +static inline bool is_optional(const availability& a) +{ + return std::holds_alternative(a); +} + +static inline bool is_required(const availability& a) +{ + return std::holds_alternative(a); +} +} +} diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index 1484c08c..d67034cc 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -10,7 +10,10 @@ #include #include +#include "availability.hpp" #include "kind.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" namespace abacus { @@ -22,91 +25,19 @@ struct boolean /// The primitive type of the metric using type = bool; - /// The metric type - struct metric - { - /// Default constructor - metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(type) + 1); - } - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The initial value of the metric - metric(uint8_t* memory, type value) : metric(memory) - { - set_value(value); - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Check if the metric has a value - /// @return true if the metric has a value - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - /// Reset the metric - /// This will set the metric to an uninitialized state and cause - /// has_value() to return false - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> type - { - assert(is_initialized()); - return m_memory[1]; - } - - /// Assign the metric a new value - /// @param value The value to assign - auto set_value(type value) -> void - { - assert(is_initialized()); - m_memory[0] = 1; - m_memory[1] = value; - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return a metric with the new value - auto operator=(type value) -> metric& - { - assert(is_initialized()); - set_value(value); - return *this; - } - - private: - /// The metric memory - uint8_t* m_memory = nullptr; - }; + /// The optional metric type + using optional = optional_metric; + /// The required metric type + using required = required_metric; /// The kind of the metric abacus::kind kind; /// The description of the metric std::string description; + + /// The availability of the metric + abacus::availability availability; }; } } diff --git a/src/abacus/description.hpp b/src/abacus/description.hpp new file mode 100644 index 00000000..0a862717 --- /dev/null +++ b/src/abacus/description.hpp @@ -0,0 +1,47 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +/// Strongly typed description for a metric +struct description +{ + /// Default constructor + description() = default; + + /// Explicit constructor + explicit description(const std::string& v) : value(v) + { + } + + /// @return True if the description is empty otherwise false + bool empty() const + { + return value.empty(); + } + + /// The description string + std::string value; +}; + +inline bool operator==(const description& lhs, const description& rhs) +{ + return lhs.value == rhs.value; +} + +inline bool operator<(const description& lhs, const description& rhs) +{ + return lhs.value < rhs.value; +} + +} +} diff --git a/src/abacus/detail/common.hpp b/src/abacus/detail/common.hpp deleted file mode 100644 index 6872430e..00000000 --- a/src/abacus/detail/common.hpp +++ /dev/null @@ -1,484 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include - -#include "../version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -namespace detail -{ -/// A optional_metric class for most metrics -template -struct optional_metric -{ - - using value_type = typename Metric::type; - - /// Default constructor - optional_metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - optional_metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(value_type) + 1); - } - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The initial value of the metric - optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) - { - set_value(value); - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Check if the metric has a value - /// @return true if the metric has a value - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - /// Reset the metric - /// This will set the metric to an uninitialized state causing - /// has_value() to return false. - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> value_type - { - assert(is_initialized()); - assert(has_value()); - value_type value; - std::memcpy(&value, m_memory + 1, sizeof(value_type)); - return value; - } - - /// Assign a new value to the metric - /// @param value The value to assign - auto set_value(value_type value) -> void - { - assert(is_initialized()); - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } - - m_memory[0] = 1; - std::memcpy(m_memory + 1, &value, sizeof(value)); - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - auto operator=(value_type value) -> optional_metric& - { - assert(is_initialized()); - set_value(value); - return *this; - } - - /// Increment the metric - /// @param value The value to add - /// @return The result of the arithmetic - auto operator+=(value_type value) -> optional_metric& - { - assert(has_value()); - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } - - auto new_value = this->value() + value; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - - /// Decrement the metric - /// @param value The value to subtract - /// @return The result of the arithmetic - auto operator-=(value_type value) -> optional_metric& - { - assert(has_value()); - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } - - auto new_value = this->value() - value; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - - /// Increment the value of the metric - /// @return The result of the arithmetic - auto operator++() -> optional_metric& - { - assert(has_value()); - auto new_value = value() + 1; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - - /// Decrement the value of the metric - /// @return The result of the arithmetic - auto operator--() -> optional_metric& - { - auto new_value = value() - 1; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - -protected: - /// The metric memory - uint8_t* m_memory = nullptr; -}; - -template <> -struct optional_metric -{ - - using value_type = boolean::type; - - /// Default constructor - optional_metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - optional_metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(value_type) + 1); - } - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The initial value of the metric - optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) - { - set_value(value); - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Check if the metric has a value - /// @return true if the metric has a value - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - /// Reset the metric - /// This will set the metric to an uninitialized state causing - /// has_value() to return false. - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> value_type - { - assert(is_initialized()); - assert(has_value()); - value_type value; - std::memcpy(&value, m_memory + 1, sizeof(value_type)); - return value; - } - - /// Assign a new value to the metric - /// @param value The value to assign - auto set_value(value_type value) -> void - { - assert(is_initialized()); - - m_memory[0] = 1; - std::memcpy(m_memory + 1, &value, sizeof(value)); - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - auto operator=(value_type value) -> optional_metric& - { - assert(is_initialized()); - set_value(value); - return *this; - } - -protected: - /// The metric memory - uint8_t* m_memory = nullptr; -}; - -template <> -struct optional_metric -{ - - using value_type = enum8::type; - - /// Default constructor - optional_metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - optional_metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(value_type) + 1); - } - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The initial value of the metric - optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) - { - set_value(value); - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Check if the metric has a value - /// @return true if the metric has a value - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - /// Reset the metric - /// This will set the metric to an uninitialized state causing - /// has_value() to return false. - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> value_type - { - assert(is_initialized()); - assert(has_value()); - value_type value; - std::memcpy(&value, m_memory + 1, sizeof(value_type)); - return value; - } - - auto set_value(value_type value) -> void - { - assert(is_initialized()); - - m_memory[0] = 1; - std::memcpy(m_memory + 1, &value, sizeof(value)); - } - - /// Assign a new value to the metric - /// @param value The value to assign - template - auto set_value(T value) -> void - { - assert(is_initialized()); - static_assert(std::is_enum_v, "T must be an enum type"); - - assert(value <= std::numeric_limits::max()); - - m_memory[0] = 1; - std::memcpy(m_memory + 1, &value, sizeof(value)); - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - auto operator=(value_type value) -> optional_metric& - { - assert(is_initialized()); - set_value(value); - return *this; - } - -protected: - /// The metric memory - uint8_t* m_memory = nullptr; -}; - -/// A required_metric class for most metrics -template -struct required_metric -{ - - using value_type = typename Metric::type; - - /// Default constructor - required_metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - required_metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memory[0] = 1; - memset(m_memory + 1, 0, sizeof(value_type)); - } - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The initial value of the metric - required_metric(uint8_t* memory, value_type value) : required_metric(memory) - { - set_value(value); - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> value_type - { - assert(is_initialized()); - value_type value; - std::memcpy(&value, m_memory + 1, sizeof(value_type)); - return value; - } - - /// Assign a new value to the metric - /// @param value The value to assign - auto set_value(value_type value) -> void - { - assert(is_initialized()); - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } - - std::memcpy(m_memory + 1, &value, sizeof(value_type)); - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - auto operator=(value_type value) -> required_metric& - { - set_value(value); - return *this; - } - - /// Increment the metric - /// @param value The value to add - /// @return The result of the arithmetic - auto operator+=(value_type value) -> required_metric& - { - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } - - auto new_value = this->value() + value; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - - /// Decrement the metric - /// @param value The value to subtract - /// @return The result of the arithmetic - auto operator-=(value_type value) -> required_metric& - { - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } - - auto new_value = this->value() - value; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - - /// Increment the value of the metric - /// @return The result of the arithmetic - auto operator++() -> required_metric& - { - auto new_value = value() + 1; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - - /// Decrement the value of the metric - /// @return The result of the arithmetic - auto operator--() -> required_metric& - { - auto new_value = value() - 1; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); - return *this; - } - -protected: - /// The metric memory - uint8_t* m_memory = nullptr; -}; - -} -} -} diff --git a/src/abacus/detail/has_arithmetic_operators.hpp b/src/abacus/detail/has_arithmetic_operators.hpp new file mode 100644 index 00000000..56440635 --- /dev/null +++ b/src/abacus/detail/has_arithmetic_operators.hpp @@ -0,0 +1,41 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include + +#include "../version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +struct boolean; +struct enum8; +namespace detail +{ +/// Check if a metric supports arithmetic operators +template +struct has_arithmetic_operators : std::true_type +{ +}; + +template <> +struct has_arithmetic_operators : std::false_type +{ +}; + +template <> +struct has_arithmetic_operators : std::false_type +{ +}; + +} +} +} diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index 3d1da242..7511c290 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -11,6 +11,9 @@ #include #include +#include "availability.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -23,86 +26,11 @@ struct enum8 /// The primitive type of the metric using type = uint8_t; - /// The metric type - struct metric - { - /// Default constructor - metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - metric(uint8_t* memory) : m_memory(memory) - { - assert(m_memory != nullptr); - memset(m_memory, 0, sizeof(type) + 1); - } - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The initial value of the metric - metric(uint8_t* memory, type value) : metric(memory) - { - assert(m_memory != nullptr); - set_value(value); - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Check if the metric has a value - /// @return true if the metric has a value - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1U; - } - - /// Reset the metric - /// This will set the metric to an uninitialized state and cause - /// has_value() to return false - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } + /// The optional metric type + using optional = optional_metric; - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> type - { - assert(is_initialized()); - return m_memory[1]; - } - - /// Assign a new value to the metric - /// @param value The value to assign - auto set_value(type value) -> void - { - assert(is_initialized()); - m_memory[0] = 1; - m_memory[1] = value; - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return a metric with the new value - auto operator=(type value) -> metric& - { - assert(is_initialized()); - set_value(value); - return *this; - } - - private: - /// The metric memory - uint8_t* m_memory = nullptr; - }; + /// The required metric type + using required = required_metric; /// The enumeration value type struct value @@ -120,6 +48,9 @@ struct enum8 /// The enumeration values std::map values; + /// The availability of the metric + abacus::availability availability; + /// The unit of the metric abacus::unit unit{}; }; diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 7a0d1a5a..49d3ee0f 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -7,11 +7,12 @@ #include -#include "detail/common.hpp" - +#include "availability.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -24,10 +25,11 @@ struct float32 /// The primitive type of the metric using type = float; - /// The metric type - using metric = detail::optional_metric; + /// The optional metric type + using optional = optional_metric; - using required_metric = detail::required_metric; + /// The required metric type + using required = required_metric; /// The metric kind abacus::kind kind; @@ -35,6 +37,9 @@ struct float32 /// The metric description std::string description; + /// The availability of the metric + abacus::availability availability; + /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index 94c3fc19..eb49f633 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -5,11 +5,12 @@ #pragma once -#include "detail/common.hpp" - +#include "availability.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -22,10 +23,11 @@ struct float64 /// The primitive type of the metric using type = double; - /// The metric type - using metric = detail::optional_metric; + /// The optional metric type + using optional = optional_metric; - using required_metric = detail::required_metric; + /// The required metric type + using required = required_metric; /// The metric kind abacus::kind kind; @@ -33,6 +35,9 @@ struct float64 /// The metric description std::string description; + /// The availability of the metric + abacus::availability availability; + /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 3e13d886..035e2603 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -5,11 +5,12 @@ #pragma once -#include "detail/common.hpp" - +#include "availability.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -22,10 +23,11 @@ struct int32 /// The primitive type of the metric using type = int32_t; - /// The metric type - using metric = detail::optional_metric; + /// The optional metric type + using optional = optional_metric; - using required_metric = detail::required_metric; + /// The required metric type + using required = required_metric; /// The metric kind abacus::kind kind; @@ -33,6 +35,9 @@ struct int32 /// The metric description std::string description; + /// The availability of the metric + abacus::availability availability; + /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 2f8c4e5f..7a7b7803 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -5,11 +5,12 @@ #pragma once -#include "detail/common.hpp" - +#include "availability.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -22,10 +23,11 @@ struct int64 /// The primitive type of the metric using type = int64_t; - /// The metric type - using metric = detail::optional_metric; + /// The optional metric type + using optional = optional_metric; - using required_metric = detail::required_metric; + /// The required metric type + using required = required_metric; /// The metric kind abacus::kind kind; @@ -33,6 +35,9 @@ struct int64 /// The metric description std::string description; + /// The availability of the metric + abacus::availability availability; + /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index cafc6a52..c5e25bcf 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -47,12 +47,12 @@ get_kind(const protobuf::Metric& metric) -> std::optional } metrics::metrics(metrics&& other) noexcept : - m_data(other.m_data), m_metadata(std::move(other.m_metadata)), + m_data(std::move(other.m_data)), m_metadata(std::move(other.m_metadata)), m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), m_value_bytes(other.m_value_bytes), m_initialized(std::move(other.m_initialized)) { - other.m_data = nullptr; + other.m_data = std::vector(); other.m_metadata = protobuf::MetricsMetadata(); other.m_hash = 0; other.m_metadata_bytes = 0; @@ -84,6 +84,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_uint64()->set_description(m->description); metric.mutable_uint64()->set_kind(m->kind); @@ -104,6 +105,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_int64()->set_description(m->description); metric.mutable_int64()->set_kind(m->kind); @@ -124,6 +126,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_uint32()->set_description(m->description); metric.mutable_uint32()->set_kind(m->kind); @@ -144,6 +147,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_int32()->set_description(m->description); metric.mutable_int32()->set_kind(m->kind); @@ -164,6 +168,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_float64()->set_description(m->description); metric.mutable_float64()->set_kind(m->kind); @@ -184,6 +189,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_float32()->set_description(m->description); metric.mutable_float32()->set_kind(m->kind); @@ -204,6 +210,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_boolean()->set_description(m->description); metric.mutable_boolean()->set_kind(m->kind); @@ -212,6 +219,7 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); + metric.set_optional(is_optional(m->availability)); metric.mutable_enum8()->set_description(m->description); for (auto [key, value] : m->values) @@ -237,19 +245,20 @@ metrics::metrics(const std::map& info) m_metadata.set_sync_value(1); m_metadata_bytes = m_metadata.ByteSizeLong(); - m_data = new uint8_t[m_metadata_bytes + m_value_bytes]; + m_data.reserve(m_metadata_bytes + m_value_bytes); + m_data.resize(m_metadata_bytes); // Serialize the metadata - m_metadata.SerializeToArray(m_data, m_metadata_bytes); + m_metadata.SerializeToArray(m_data.data(), m_data.size()); // Calculate the hash of the metadata - m_hash = detail::hash_function(m_data, m_metadata_bytes); + m_hash = detail::hash_function(m_data.data(), m_data.size()); // Update the sync value m_metadata.set_sync_value(m_hash); // Serialize the metadata again to include the sync value - m_metadata.SerializeToArray(m_data, m_metadata_bytes); + m_metadata.SerializeToArray(m_data.data(), m_data.size()); // Make sure the metadata didn't change unexpectedly assert(m_metadata.ByteSizeLong() == m_metadata_bytes); @@ -258,19 +267,21 @@ metrics::metrics(const std::map& info) // be written as the endianess of the system) // Consuming code can use the endianness field in the metadata to // read the sync value - std::memcpy(m_data + m_metadata_bytes, &m_hash, sizeof(uint32_t)); + m_data.resize(m_metadata_bytes + m_value_bytes); + std::memcpy(m_data.data() + m_metadata_bytes, &m_hash, sizeof(uint32_t)); } template [[nodiscard]] auto -metrics::initialize_metric(const std::string& name, - std::optional value) -> - typename Metric::metric +metrics::initialize_optional(const std::string& name, + std::optional value) -> + typename Metric::optional { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); m_initialized[name] = true; const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + assert(proto_metric.optional() == true); auto kind = get_kind(proto_metric); if (kind.has_value()) { @@ -281,19 +292,20 @@ metrics::initialize_metric(const std::string& name, if (value.has_value()) { - return typename Metric::metric(m_data + m_metadata_bytes + offset, - value.value()); + return typename Metric::optional( + m_data.data() + m_metadata_bytes + offset, value.value()); } else { - return typename Metric::metric(m_data + m_metadata_bytes + offset); + return typename Metric::optional(m_data.data() + m_metadata_bytes + + offset); } } template [[nodiscard]] auto metrics::initialize_required(const std::string& name, typename Metric::type value) -> - typename Metric::required_metric + typename Metric::required { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); @@ -307,51 +319,61 @@ template auto offset = proto_metric.offset(); - return typename Metric::required_metric(m_data + m_metadata_bytes + offset, - value); + return typename Metric::required(m_data.data() + m_metadata_bytes + offset, + value); } // Explicit instantiations for the expected types -template auto metrics::initialize_metric( +template auto metrics::initialize_optional( const std::string& name, - std::optional value) -> uint64::metric; -template auto metrics::initialize_metric( - const std::string& name, std::optional value) -> int64::metric; -template auto metrics::initialize_metric( + std::optional value) -> uint64::optional; +template auto metrics::initialize_optional( const std::string& name, - std::optional value) -> uint32::metric; -template auto metrics::initialize_metric( - const std::string& name, std::optional value) -> int32::metric; -template auto metrics::initialize_metric( + std::optional value) -> int64::optional; +template auto metrics::initialize_optional( const std::string& name, - std::optional value) -> float64::metric; -template auto metrics::initialize_metric( + std::optional value) -> uint32::optional; +template auto metrics::initialize_optional( const std::string& name, - std::optional value) -> float32::metric; -template auto metrics::initialize_metric( + std::optional value) -> int32::optional; +template auto metrics::initialize_optional( const std::string& name, - std::optional value) -> boolean::metric; -template auto metrics::initialize_metric( - const std::string& name, std::optional value) -> enum8::metric; - -template auto metrics::initialize_required( - const std::string& name, uint64::type value) -> uint64::required_metric; -template auto metrics::initialize_required( - const std::string& name, int64::type value) -> int64::required_metric; -template auto metrics::initialize_required( - const std::string& name, uint32::type value) -> uint32::required_metric; -template auto metrics::initialize_required( - const std::string& name, int32::type value) -> int32::required_metric; -template auto metrics::initialize_required( - const std::string& name, float64::type value) -> float64::required_metric; -template auto metrics::initialize_required( - const std::string& name, float32::type value) -> float32::required_metric; -// template auto metrics::initialize_required( -// const std::string& name, boolean::type value) -> -// boolean::required_metric; -// template auto metrics::initialize_required( -// const std::string& name, enum8::type value) -> enum8::required_metric; + std::optional value) -> float64::optional; +template auto metrics::initialize_optional( + const std::string& name, + std::optional value) -> float32::optional; +template auto metrics::initialize_optional( + const std::string& name, + std::optional value) -> boolean::optional; +template auto metrics::initialize_optional( + const std::string& name, + std::optional value) -> enum8::optional; + +template auto +metrics::initialize_required(const std::string& name, + uint64::type value) -> uint64::required; +template auto +metrics::initialize_required(const std::string& name, + int64::type value) -> int64::required; +template auto +metrics::initialize_required(const std::string& name, + uint32::type value) -> uint32::required; +template auto +metrics::initialize_required(const std::string& name, + int32::type value) -> int32::required; +template auto +metrics::initialize_required(const std::string& name, + float64::type value) -> float64::required; +template auto +metrics::initialize_required(const std::string& name, + float32::type value) -> float32::required; +template auto +metrics::initialize_required(const std::string& name, + boolean::type value) -> boolean::required; +template auto +metrics::initialize_required(const std::string& name, + enum8::type value) -> enum8::required; template void metrics::initialize_constant(const std::string& name, @@ -365,7 +387,7 @@ void metrics::initialize_constant(const std::string& name, auto offset = proto_metric.offset(); auto kind = get_kind(proto_metric); assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); - typename Metric::metric(m_data + m_metadata_bytes + offset, value); + typename Metric::required(m_data.data() + m_metadata_bytes + offset, value); } // Explicit instantiations for the expected types @@ -388,13 +410,11 @@ template void metrics::initialize_constant(const std::string& name, metrics::~metrics() { - if (m_data != nullptr) - delete[] m_data; } auto metrics::value_data() const -> const uint8_t* { - return m_data + m_metadata_bytes; + return m_data.data() + m_metadata_bytes; } auto metrics::value_bytes() const -> std::size_t @@ -404,7 +424,7 @@ auto metrics::value_bytes() const -> std::size_t auto metrics::metadata_data() const -> const uint8_t* { - return m_data; + return m_data.data(); } auto metrics::metadata_bytes() const -> std::size_t @@ -438,7 +458,7 @@ auto metrics::is_initialized() const -> bool void metrics::reset_metrics() { // Reset the value data - std::memset(m_data + m_metadata_bytes + sizeof(uint32_t), 0, + std::memset(m_data.data() + m_metadata_bytes + sizeof(uint32_t), 0, m_value_bytes - sizeof(uint32_t)); } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index dbd1e0a6..f8d96ce8 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "name.hpp" #include "type.hpp" @@ -54,28 +55,24 @@ class metrics /// @return the metadata of the metrics. auto metadata() const -> const protobuf::MetricsMetadata&; - template - void initialize_optional(const std::string& name, - detail::optional_metric& metric); - - /// Initialize a metric + /// Initialize a required metric /// @param name The name of the metric /// @param value Optional initial value of the metric /// @return The metric object template - [[nodiscard]] auto initialize_metric( - const std::string& name, - std::optional value = std::nullopt) -> - typename Metric::metric; + [[nodiscard]] auto initialize_required(const std::string& name, + typename Metric::type value) -> + typename Metric::required; /// Initialize a metric /// @param name The name of the metric /// @param value Optional initial value of the metric /// @return The metric object template - [[nodiscard]] auto initialize_required(const std::string& name, - typename Metric::type) -> - typename Metric::required_metric; + [[nodiscard]] auto initialize_optional( + const std::string& name, + std::optional value = std::nullopt) -> + typename Metric::optional; /// Initialize a constant metric /// @param name The name of the metric @@ -105,7 +102,7 @@ class metrics private: /// The raw memory for the metadata and value data - uint8_t* m_data = nullptr; + std::vector m_data; /// The info of the metrics separated by byte-sizes protobuf::MetricsMetadata m_metadata; diff --git a/src/abacus/name.hpp b/src/abacus/name.hpp index acb6c05c..99d5913f 100644 --- a/src/abacus/name.hpp +++ b/src/abacus/name.hpp @@ -12,7 +12,7 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -/// Strongly typed unit for a metric +/// Strongly typed name for a metric struct name { /// Default constructor diff --git a/src/abacus/optional_metric.hpp b/src/abacus/optional_metric.hpp new file mode 100644 index 00000000..d3bf88ab --- /dev/null +++ b/src/abacus/optional_metric.hpp @@ -0,0 +1,216 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include + +#include "detail/has_arithmetic_operators.hpp" + +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// An optional metric class for most metrics +template +struct optional_metric +{ + using value_type = typename Metric::type; + + /// Default constructor + optional_metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(value_type) + 1 bytes long. + /// @param value The initial value of the metric + optional_metric(uint8_t* memory) + { + assert(memory != nullptr); + m_memory = memory; + } + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(value_type) + 1 bytes long. + /// @param value The initial value of the metric + optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) + { + assert(m_memory != nullptr); + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> value_type + { + assert(has_value()); + + value_type value; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); + return value; + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(value_type value) -> void + { + assert(is_initialized()); + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + m_memory[0] = 1; + std::memcpy(m_memory + 1, &value, sizeof(value_type)); + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(value_type value) -> optional_metric& + { + set_value(value); + return *this; + } + +public: + /// Arithmetic operators + + /// Increment the metric + /// @param value The value to add + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator+=(value_type value) -> optional_metric& + { + assert(has_value()); + value_type new_value = this->value() + value; + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(new_value) && "Cannot assign a NaN"); + assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); + } + + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + + /// Decrement the metric + /// @param value The value to subtract + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator-=(value_type value) -> optional_metric& + { + assert(has_value()); + value_type new_value = this->value() - value; + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(new_value) && "Cannot assign a NaN"); + assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); + } + + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + + /// Increment the value of the metric + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator++() -> optional_metric& + { + assert(has_value()); + value_type new_value = this->value() + 1; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + + /// Decrement the value of the metric + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator--() -> optional_metric& + { + assert(has_value()); + value_type new_value = this->value() - 1; + std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + return *this; + } + +public: + /// Enum specializations + + /// Constructor for enum8 + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The initial enum value of the metric + template && + std::is_same_v>> + optional_metric(uint8_t* memory, T value) : + optional_metric(memory, static_cast(value)) + { + static_assert( + sizeof(std::underlying_type_t) == sizeof(value_type), + "The underlying type of the enum must match the value_type"); + } + + template && + std::is_same_v>> + auto operator=(T value) -> optional_metric& + { + set_value(value); + return *this; + } + + /// Assign a new value to the metric + /// @param value The value to assign + template && + std::is_same_v>> + auto set_value(T value) -> void + { + assert(is_initialized()); + assert(value <= std::numeric_limits::max()); + + set_value(static_cast(value)); + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; +} +} diff --git a/src/abacus/parse_metadata.cpp b/src/abacus/parse_metadata.cpp new file mode 100644 index 00000000..72d9864d --- /dev/null +++ b/src/abacus/parse_metadata.cpp @@ -0,0 +1,26 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#include "parse_metadata.hpp" + +#include +#include +#include + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +auto parse_metadata(const uint8_t* metadata_data, + std::size_t metadata_bytes) -> protobuf::MetricsMetadata +{ + assert(metadata_data != nullptr); + assert(metadata_bytes > 0); + protobuf::MetricsMetadata metadata; + metadata.ParseFromArray(metadata_data, metadata_bytes); + return metadata; +} +} +} diff --git a/src/abacus/parse_metadata.hpp b/src/abacus/parse_metadata.hpp new file mode 100644 index 00000000..61041125 --- /dev/null +++ b/src/abacus/parse_metadata.hpp @@ -0,0 +1,22 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include + +#include "protobuf/metrics.pb.h" +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// @param metadata_data The meta data pointer +/// @param metadata_bytes The meta data size in bytes +auto parse_metadata(const uint8_t* metadata_data, + std::size_t metadata_bytes) -> protobuf::MetricsMetadata; +} +} diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index 8174b252..c3c3acc3 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -274,6 +274,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.type_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -496,6 +497,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.offset_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.optional_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -544,8 +546,8 @@ static const ::_pbi::MigrationSchema {134, 144, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, {146, 157, -1, sizeof(::abacus::protobuf::Enum8Metric)}, {160, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {178, 188, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {190, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {179, 189, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {191, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -598,25 +600,26 @@ const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTO "s\030\003 \003(\0132(.abacus.protobuf.Enum8Metric.Va" "luesEntry\032I\n\013ValuesEntry\022\013\n\003key\030\001 \001(\r\022)\n" "\005value\030\002 \001(\0132\032.abacus.protobuf.EnumValue" - ":\0028\001B\007\n\005_unit\"\245\003\n\006Metric\022\016\n\006offset\030\001 \001(\r" - "\022/\n\006uint64\030\002 \001(\0132\035.abacus.protobuf.UInt6" - "4MetricH\000\022-\n\005int64\030\003 \001(\0132\034.abacus.protob" - "uf.Int64MetricH\000\022/\n\006uint32\030\004 \001(\0132\035.abacu" - "s.protobuf.UInt32MetricH\000\022-\n\005int32\030\005 \001(\013" - "2\034.abacus.protobuf.Int32MetricH\000\0221\n\007floa" - "t64\030\006 \001(\0132\036.abacus.protobuf.Float64Metri" - "cH\000\0221\n\007float32\030\007 \001(\0132\036.abacus.protobuf.F" - "loat32MetricH\000\022.\n\007boolean\030\010 \001(\0132\033.abacus" - ".protobuf.BoolMetricH\000\022-\n\005enum8\030\t \001(\0132\034." - "abacus.protobuf.Enum8MetricH\000B\006\n\004type\"\371\001" - "\n\017MetricsMetadata\022\030\n\020protocol_version\030\001 " - "\001(\r\022/\n\nendianness\030\002 \001(\0162\033.abacus.protobu" - "f.Endianness\022\022\n\nsync_value\030\003 \001(\007\022>\n\007metr" - "ics\030\004 \003(\0132-.abacus.protobuf.MetricsMetad" - "ata.MetricsEntry\032G\n\014MetricsEntry\022\013\n\003key\030" - "\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacus.protobuf.M" - "etric:\0028\001*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007\n\003B" - "IG\020\001B\021Z\017abacus/protobufb\006proto3" + ":\0028\001B\007\n\005_unit\"\267\003\n\006Metric\022\016\n\006offset\030\001 \001(\r" + "\022\020\n\010optional\030\002 \001(\010\022/\n\006uint64\030\003 \001(\0132\035.aba" + "cus.protobuf.UInt64MetricH\000\022-\n\005int64\030\004 \001" + "(\0132\034.abacus.protobuf.Int64MetricH\000\022/\n\006ui" + "nt32\030\005 \001(\0132\035.abacus.protobuf.UInt32Metri" + "cH\000\022-\n\005int32\030\006 \001(\0132\034.abacus.protobuf.Int" + "32MetricH\000\0221\n\007float64\030\007 \001(\0132\036.abacus.pro" + "tobuf.Float64MetricH\000\0221\n\007float32\030\010 \001(\0132\036" + ".abacus.protobuf.Float32MetricH\000\022.\n\007bool" + "ean\030\t \001(\0132\033.abacus.protobuf.BoolMetricH\000" + "\022-\n\005enum8\030\n \001(\0132\034.abacus.protobuf.Enum8M" + "etricH\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030\n\020p" + "rotocol_version\030\001 \001(\r\022/\n\nendianness\030\002 \001(" + "\0162\033.abacus.protobuf.Endianness\022\022\n\nsync_v" + "alue\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus.pro" + "tobuf.MetricsMetadata.MetricsEntry\032G\n\014Me" + "tricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027" + ".abacus.protobuf.Metric:\0028\001*!\n\nEndiannes" + "s\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/protobu" + "fb\006proto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps[1] = { @@ -626,7 +629,7 @@ static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_on const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2111, + 2129, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, @@ -3750,13 +3753,16 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { (void)_this; new (&_impl_) Impl_{ decltype(_impl_.offset_){}, + decltype(_impl_.optional_){}, decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _this->_impl_.offset_ = from._impl_.offset_; + ::memcpy(&_impl_.offset_, &from._impl_.offset_, + static_cast<::size_t>(reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); clear_has_type(); switch (from.type_case()) { case kUint64: { @@ -3810,6 +3816,7 @@ inline void Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ decltype(_impl_.offset_){0u}, + decltype(_impl_.optional_){false}, decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -3896,7 +3903,9 @@ PROTOBUF_NOINLINE void Metric::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.offset_ = 0u; + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); clear_type(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3909,20 +3918,23 @@ const char* Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 9, 8, 0, 2> Metric::_table_ = { +const ::_pbi::TcParseTable<1, 10, 8, 0, 2> Metric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 9, 0, // max_field_number, fast_idx_mask + 10, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294966784, // skipmap + 4294966272, // skipmap offsetof(decltype(_table_), field_entries), - 9, // num_field_entries + 10, // num_field_entries 8, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ + // bool optional = 2; + {::_pbi::TcParser::SingularVarintNoZag1(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.optional_)}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_)}}, @@ -3932,28 +3944,31 @@ const ::_pbi::TcParseTable<0, 9, 8, 0, 2> Metric::_table_ = { // uint32 offset = 1; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // .abacus.protobuf.UInt64Metric uint64 = 2; + // bool optional = 2; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.optional_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // .abacus.protobuf.UInt64Metric uint64 = 3; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Int64Metric int64 = 3; + // .abacus.protobuf.Int64Metric int64 = 4; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int64_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.UInt32Metric uint32 = 4; + // .abacus.protobuf.UInt32Metric uint32 = 5; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint32_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Int32Metric int32 = 5; + // .abacus.protobuf.Int32Metric int32 = 6; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int32_), _Internal::kOneofCaseOffset + 0, 3, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Float64Metric float64 = 6; + // .abacus.protobuf.Float64Metric float64 = 7; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float64_), _Internal::kOneofCaseOffset + 0, 4, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Float32Metric float32 = 7; + // .abacus.protobuf.Float32Metric float32 = 8; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float32_), _Internal::kOneofCaseOffset + 0, 5, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.BoolMetric boolean = 8; + // .abacus.protobuf.BoolMetric boolean = 9; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.boolean_), _Internal::kOneofCaseOffset + 0, 6, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Enum8Metric enum8 = 9; + // .abacus.protobuf.Enum8Metric enum8 = 10; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.enum8_), _Internal::kOneofCaseOffset + 0, 7, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ @@ -3983,52 +3998,59 @@ ::uint8_t* Metric::_InternalSerialize( 1, this->_internal_offset(), target); } + // bool optional = 2; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 2, this->_internal_optional(), target); + } + switch (type_case()) { case kUint64: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::uint64(this), + InternalWriteMessage(3, _Internal::uint64(this), _Internal::uint64(this).GetCachedSize(), target, stream); break; } case kInt64: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::int64(this), + InternalWriteMessage(4, _Internal::int64(this), _Internal::int64(this).GetCachedSize(), target, stream); break; } case kUint32: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::uint32(this), + InternalWriteMessage(5, _Internal::uint32(this), _Internal::uint32(this).GetCachedSize(), target, stream); break; } case kInt32: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::int32(this), + InternalWriteMessage(6, _Internal::int32(this), _Internal::int32(this).GetCachedSize(), target, stream); break; } case kFloat64: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(6, _Internal::float64(this), + InternalWriteMessage(7, _Internal::float64(this), _Internal::float64(this).GetCachedSize(), target, stream); break; } case kFloat32: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::float32(this), + InternalWriteMessage(8, _Internal::float32(this), _Internal::float32(this).GetCachedSize(), target, stream); break; } case kBoolean: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::boolean(this), + InternalWriteMessage(9, _Internal::boolean(this), _Internal::boolean(this).GetCachedSize(), target, stream); break; } case kEnum8: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(9, _Internal::enum8(this), + InternalWriteMessage(10, _Internal::enum8(this), _Internal::enum8(this).GetCachedSize(), target, stream); break; } @@ -4058,57 +4080,62 @@ ::size_t Metric::ByteSizeLong() const { this->_internal_offset()); } + // bool optional = 2; + if (this->_internal_optional() != 0) { + total_size += 2; + } + switch (type_case()) { - // .abacus.protobuf.UInt64Metric uint64 = 2; + // .abacus.protobuf.UInt64Metric uint64 = 3; case kUint64: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.uint64_); break; } - // .abacus.protobuf.Int64Metric int64 = 3; + // .abacus.protobuf.Int64Metric int64 = 4; case kInt64: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.int64_); break; } - // .abacus.protobuf.UInt32Metric uint32 = 4; + // .abacus.protobuf.UInt32Metric uint32 = 5; case kUint32: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.uint32_); break; } - // .abacus.protobuf.Int32Metric int32 = 5; + // .abacus.protobuf.Int32Metric int32 = 6; case kInt32: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.int32_); break; } - // .abacus.protobuf.Float64Metric float64 = 6; + // .abacus.protobuf.Float64Metric float64 = 7; case kFloat64: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.float64_); break; } - // .abacus.protobuf.Float32Metric float32 = 7; + // .abacus.protobuf.Float32Metric float32 = 8; case kFloat32: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.float32_); break; } - // .abacus.protobuf.BoolMetric boolean = 8; + // .abacus.protobuf.BoolMetric boolean = 9; case kBoolean: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.boolean_); break; } - // .abacus.protobuf.Enum8Metric enum8 = 9; + // .abacus.protobuf.Enum8Metric enum8 = 10; case kEnum8: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -4140,6 +4167,9 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } switch (from.type_case()) { case kUint64: { _this->_internal_mutable_uint64()->::abacus::protobuf::UInt64Metric::MergeFrom( @@ -4202,7 +4232,12 @@ PROTOBUF_NOINLINE bool Metric::IsInitialized() const { void Metric::InternalSwap(Metric* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.offset_, other->_impl_.offset_); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Metric, _impl_.optional_) + + sizeof(Metric::_impl_.optional_) + - PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); swap(_impl_.type_, other->_impl_.type_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 1a3af02e..6e4b810f 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -2139,14 +2139,14 @@ class Metric final : return *internal_default_instance(); } enum TypeCase { - kUint64 = 2, - kInt64 = 3, - kUint32 = 4, - kInt32 = 5, - kFloat64 = 6, - kFloat32 = 7, - kBoolean = 8, - kEnum8 = 9, + kUint64 = 3, + kInt64 = 4, + kUint32 = 5, + kInt32 = 6, + kFloat64 = 7, + kFloat32 = 8, + kBoolean = 9, + kEnum8 = 10, TYPE_NOT_SET = 0, }; @@ -2228,14 +2228,15 @@ class Metric final : enum : int { kOffsetFieldNumber = 1, - kUint64FieldNumber = 2, - kInt64FieldNumber = 3, - kUint32FieldNumber = 4, - kInt32FieldNumber = 5, - kFloat64FieldNumber = 6, - kFloat32FieldNumber = 7, - kBooleanFieldNumber = 8, - kEnum8FieldNumber = 9, + kOptionalFieldNumber = 2, + kUint64FieldNumber = 3, + kInt64FieldNumber = 4, + kUint32FieldNumber = 5, + kInt32FieldNumber = 6, + kFloat64FieldNumber = 7, + kFloat32FieldNumber = 8, + kBooleanFieldNumber = 9, + kEnum8FieldNumber = 10, }; // uint32 offset = 1; void clear_offset() ; @@ -2247,7 +2248,17 @@ class Metric final : void _internal_set_offset(::uint32_t value); public: - // .abacus.protobuf.UInt64Metric uint64 = 2; + // bool optional = 2; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); + + private: + bool _internal_optional() const; + void _internal_set_optional(bool value); + + public: + // .abacus.protobuf.UInt64Metric uint64 = 3; bool has_uint64() const; private: bool _internal_has_uint64() const; @@ -2266,7 +2277,7 @@ class Metric final : ::abacus::protobuf::UInt64Metric* _internal_mutable_uint64(); public: - // .abacus.protobuf.Int64Metric int64 = 3; + // .abacus.protobuf.Int64Metric int64 = 4; bool has_int64() const; private: bool _internal_has_int64() const; @@ -2285,7 +2296,7 @@ class Metric final : ::abacus::protobuf::Int64Metric* _internal_mutable_int64(); public: - // .abacus.protobuf.UInt32Metric uint32 = 4; + // .abacus.protobuf.UInt32Metric uint32 = 5; bool has_uint32() const; private: bool _internal_has_uint32() const; @@ -2304,7 +2315,7 @@ class Metric final : ::abacus::protobuf::UInt32Metric* _internal_mutable_uint32(); public: - // .abacus.protobuf.Int32Metric int32 = 5; + // .abacus.protobuf.Int32Metric int32 = 6; bool has_int32() const; private: bool _internal_has_int32() const; @@ -2323,7 +2334,7 @@ class Metric final : ::abacus::protobuf::Int32Metric* _internal_mutable_int32(); public: - // .abacus.protobuf.Float64Metric float64 = 6; + // .abacus.protobuf.Float64Metric float64 = 7; bool has_float64() const; private: bool _internal_has_float64() const; @@ -2342,7 +2353,7 @@ class Metric final : ::abacus::protobuf::Float64Metric* _internal_mutable_float64(); public: - // .abacus.protobuf.Float32Metric float32 = 7; + // .abacus.protobuf.Float32Metric float32 = 8; bool has_float32() const; private: bool _internal_has_float32() const; @@ -2361,7 +2372,7 @@ class Metric final : ::abacus::protobuf::Float32Metric* _internal_mutable_float32(); public: - // .abacus.protobuf.BoolMetric boolean = 8; + // .abacus.protobuf.BoolMetric boolean = 9; bool has_boolean() const; private: bool _internal_has_boolean() const; @@ -2380,7 +2391,7 @@ class Metric final : ::abacus::protobuf::BoolMetric* _internal_mutable_boolean(); public: - // .abacus.protobuf.Enum8Metric enum8 = 9; + // .abacus.protobuf.Enum8Metric enum8 = 10; bool has_enum8() const; private: bool _internal_has_enum8() const; @@ -2417,12 +2428,13 @@ class Metric final : inline void clear_has_type(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 9, 8, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 10, 8, 0, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::uint32_t offset_; + bool optional_; union TypeUnion { constexpr TypeUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -4334,7 +4346,29 @@ inline void Metric::_internal_set_offset(::uint32_t value) { _impl_.offset_ = value; } -// .abacus.protobuf.UInt64Metric uint64 = 2; +// bool optional = 2; +inline void Metric::clear_optional() { + _impl_.optional_ = false; +} +inline bool Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.optional) + return _internal_optional(); +} +inline void Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.optional) +} +inline bool Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; +} +inline void Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; +} + +// .abacus.protobuf.UInt64Metric uint64 = 3; inline bool Metric::has_uint64() const { return type_case() == kUint64; } @@ -4408,7 +4442,7 @@ inline ::abacus::protobuf::UInt64Metric* Metric::mutable_uint64() { return _msg; } -// .abacus.protobuf.Int64Metric int64 = 3; +// .abacus.protobuf.Int64Metric int64 = 4; inline bool Metric::has_int64() const { return type_case() == kInt64; } @@ -4482,7 +4516,7 @@ inline ::abacus::protobuf::Int64Metric* Metric::mutable_int64() { return _msg; } -// .abacus.protobuf.UInt32Metric uint32 = 4; +// .abacus.protobuf.UInt32Metric uint32 = 5; inline bool Metric::has_uint32() const { return type_case() == kUint32; } @@ -4556,7 +4590,7 @@ inline ::abacus::protobuf::UInt32Metric* Metric::mutable_uint32() { return _msg; } -// .abacus.protobuf.Int32Metric int32 = 5; +// .abacus.protobuf.Int32Metric int32 = 6; inline bool Metric::has_int32() const { return type_case() == kInt32; } @@ -4630,7 +4664,7 @@ inline ::abacus::protobuf::Int32Metric* Metric::mutable_int32() { return _msg; } -// .abacus.protobuf.Float64Metric float64 = 6; +// .abacus.protobuf.Float64Metric float64 = 7; inline bool Metric::has_float64() const { return type_case() == kFloat64; } @@ -4704,7 +4738,7 @@ inline ::abacus::protobuf::Float64Metric* Metric::mutable_float64() { return _msg; } -// .abacus.protobuf.Float32Metric float32 = 7; +// .abacus.protobuf.Float32Metric float32 = 8; inline bool Metric::has_float32() const { return type_case() == kFloat32; } @@ -4778,7 +4812,7 @@ inline ::abacus::protobuf::Float32Metric* Metric::mutable_float32() { return _msg; } -// .abacus.protobuf.BoolMetric boolean = 8; +// .abacus.protobuf.BoolMetric boolean = 9; inline bool Metric::has_boolean() const { return type_case() == kBoolean; } @@ -4852,7 +4886,7 @@ inline ::abacus::protobuf::BoolMetric* Metric::mutable_boolean() { return _msg; } -// .abacus.protobuf.Enum8Metric enum8 = 9; +// .abacus.protobuf.Enum8Metric enum8 = 10; inline bool Metric::has_enum8() const { return type_case() == kEnum8; } diff --git a/src/abacus/required_metric.hpp b/src/abacus/required_metric.hpp new file mode 100644 index 00000000..d3338a94 --- /dev/null +++ b/src/abacus/required_metric.hpp @@ -0,0 +1,180 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include + +#include "detail/has_arithmetic_operators.hpp" +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A required_metric class for most metrics +template +struct required_metric +{ + using value_type = typename Metric::type; + + /// Default constructor + required_metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(value_type) + 1 bytes long. + /// @param value The initial value of the metric + required_metric(uint8_t* memory, value_type value) + { + assert(memory != nullptr); + m_memory = memory; + // Set the initialized flag to true as this should always be the case + // for required metrics. + m_memory[0] = 1; + set_value(value); + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> value_type + { + assert(is_initialized()); + value_type value; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); + return value; + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(value_type value) -> void + { + assert(is_initialized()); + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + + std::memcpy(m_memory + 1, &value, sizeof(value_type)); + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(value_type value) -> required_metric& + { + set_value(value); + return *this; + } + +public: + /// Arithmetic operators + + /// Increment the metric + /// @param value The value to add + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator+=(value_type value) -> required_metric& + { + set_value(this->value() + value); + return *this; + } + + /// Decrement the metric + /// @param value The value to subtract + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator-=(value_type value) -> required_metric& + { + set_value(this->value() - value); + return *this; + } + + /// Increment the value of the metric + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator++() -> required_metric& + { + set_value(value() + 1); + return *this; + } + + /// Decrement the value of the metric + /// @return The result of the arithmetic + template < + typename U = Metric, + typename = std::enable_if_t::value>> + auto operator--() -> required_metric& + { + set_value(value() - 1); + return *this; + } + +public: + /// Enum specializations + + /// Constructor for enum8 + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(value_type) + 1 bytes long. + /// @param value The initial enum value of the metric + template && + std::is_same_v>> + required_metric(uint8_t* memory, T value) : + required_metric(memory, static_cast(value)) + { + static_assert( + sizeof(std::underlying_type_t) == sizeof(value_type), + "The underlying type of the enum must match the value_type"); + } + + template && + std::is_same_v>> + auto operator=(T value) -> required_metric& + { + set_value(value); + return *this; + } + + /// Assign a new value to the metric + /// @param value The value to assign + template && + std::is_same_v>> + auto set_value(T value) -> void + { + assert(is_initialized()); + assert((typename std::underlying_type::type)value <= + std::numeric_limits::max()); + + set_value(static_cast(value)); + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; + +} +} diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 41b88ab3..3f82da61 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -5,11 +5,12 @@ #pragma once -#include "detail/common.hpp" - +#include "availability.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -22,10 +23,11 @@ struct uint32 /// The primitive type of the metric using type = uint32_t; - /// The metric type - using metric = detail::optional_metric; + /// The optional metric type + using optional = optional_metric; - using required_metric = detail::required_metric; + /// The required metric type + using required = required_metric; /// The metric kind abacus::kind kind; @@ -33,6 +35,9 @@ struct uint32 /// The metric description std::string description; + /// The availability of the metric + abacus::availability availability; + /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index d99b63c8..fe051a93 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -5,11 +5,12 @@ #pragma once -#include "detail/common.hpp" - +#include "availability.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -22,10 +23,11 @@ struct uint64 /// The primitive type of the metric using type = uint64_t; - /// The metric type - using metric = detail::optional_metric; + /// The optional metric type + using optional = optional_metric; - using required_metric = detail::required_metric; + /// The required metric type + using required = required_metric; /// The metric kind abacus::kind kind; @@ -33,6 +35,9 @@ struct uint64 /// The metric description std::string description; + /// The availability of the metric + abacus::availability availability; + /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 326e480f..337baac2 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -103,17 +103,17 @@ auto view::value(const std::string& name) const { assert(m_value_data != nullptr); assert(m_metadata_data != nullptr); - - auto offset = metric(name).offset(); + auto m = metric(name); + auto offset = m.offset(); assert(offset < m_value_bytes); if (m_value_data[offset] == 0) { + // Either the metric is unintialized or it's optional and has no value return std::nullopt; } typename Metric::type value; - switch (m_metadata.endianness()) { case protobuf::Endianness::BIG: diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index ce20eb71..b8c763d2 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -14,7 +14,7 @@ TEST(test_metric, constructor) { uint8_t data[9] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - abacus::uint64::metric uint_metric(data); + abacus::uint64::optional uint_metric(data); EXPECT_TRUE(uint_metric.is_initialized()); EXPECT_FALSE(uint_metric.has_value()); @@ -27,7 +27,7 @@ TEST(test_metric, float_assignment) { uint8_t data[9] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - abacus::float64::metric double_metric(data); + abacus::float64::optional double_metric(data); EXPECT_TRUE(double_metric.is_initialized()); EXPECT_FALSE(double_metric.has_value()); double_metric = 1123.12; diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index cba326f2..eb3dc1c5 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -7,9 +7,10 @@ #include #include -#include +#include #include +#include #include TEST(test_metrics, empty) @@ -36,28 +37,31 @@ TEST(test_metrics, api) std::map infos = { {abacus::name{name0}, - abacus::boolean{abacus::kind::COUNTER, "A boolean metric"}}, + abacus::boolean{abacus::kind::COUNTER, "A boolean metric", + abacus::optional}}, {abacus::name{name1}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}}}, + abacus::required, abacus::unit{"bytes"}}}, {abacus::name{name2}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}, + abacus::optional, abacus::unit{"USD"}}}, {abacus::name{name3}, abacus::float64{abacus::kind::GAUGE, "A floating point metric", - abacus::unit{"ms"}}}, + abacus::optional, abacus::unit{"ms"}}}, {abacus::name{name4}, - abacus::boolean{abacus::kind::CONSTANT, "A constant boolean metric"}}, + abacus::boolean{abacus::kind::CONSTANT, "A constant boolean metric", + abacus::required}}, {abacus::name{name5}, abacus::float64{abacus::kind::CONSTANT, - "A constant floating point metric", + "A constant floating point metric", abacus::required, abacus::unit{"ms"}}}, {abacus::name{name6}, abacus::enum8{"An enum metric", {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {3, {"value3", "The value for 3"}}}, + abacus::optional}}}; abacus::metrics from_metrics(infos); abacus::metrics metrics(std::move(from_metrics)); @@ -121,22 +125,22 @@ TEST(test_metrics, api) EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name1)); - auto metric0 = metrics.initialize_metric(name1, 9000U); + auto metric1 = metrics.initialize_required(name1, 9000U); EXPECT_TRUE(metrics.is_initialized(name1)); EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name2)); - auto metric1 = metrics.initialize_metric(name2); + auto metric2 = metrics.initialize_optional(name2); EXPECT_TRUE(metrics.is_initialized(name2)); EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name3)); - auto metric2 = metrics.initialize_metric(name3); + auto metric3 = metrics.initialize_optional(name3); EXPECT_TRUE(metrics.is_initialized(name3)); EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name0)); - auto metric3 = metrics.initialize_metric(name0); + auto metric0 = metrics.initialize_optional(name0); EXPECT_TRUE(metrics.is_initialized(name0)); EXPECT_FALSE(metrics.is_initialized()); @@ -151,31 +155,29 @@ TEST(test_metrics, api) EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name6)); - auto metric6 = metrics.initialize_metric(name6); + auto metric6 = metrics.initialize_optional(name6); EXPECT_TRUE(metrics.is_initialized(name6)); EXPECT_TRUE(metrics.is_initialized()); - EXPECT_TRUE(metric0.has_value()); - EXPECT_EQ(metric0.value(), 9000U); - metric0 = 4U; - EXPECT_TRUE(metric0.has_value()); - EXPECT_EQ(metric0.value(), 4U); - - EXPECT_FALSE(metric1.has_value()); - metric1 = -4; - EXPECT_TRUE(metric1.has_value()); - EXPECT_EQ(metric1.value(), -4); + EXPECT_EQ(metric1.value(), 9000U); + metric1 = 4U; + EXPECT_EQ(metric1.value(), 4U); EXPECT_FALSE(metric2.has_value()); - metric2 = 3.14; + metric2 = -4; EXPECT_TRUE(metric2.has_value()); - EXPECT_EQ(metric2.value(), 3.14); + EXPECT_EQ(metric2.value(), -4); EXPECT_FALSE(metric3.has_value()); - metric3 = true; + metric3 = 3.14; EXPECT_TRUE(metric3.has_value()); - EXPECT_EQ(metric3.value(), true); + EXPECT_EQ(metric3.value(), 3.14); + + EXPECT_FALSE(metric0.has_value()); + metric0 = true; + EXPECT_TRUE(metric0.has_value()); + EXPECT_EQ(metric0.value(), true); EXPECT_FALSE(metric6.has_value()); metric6 = 2; @@ -191,19 +193,19 @@ TEST(test_metrics, value_and_metadata_bytes) std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}}}, + abacus::optional, abacus::unit{"bytes"}}}, {abacus::name{name1}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}}; + abacus::optional, abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; - auto m0 = metrics.initialize_metric(name0); - auto m1 = metrics.initialize_metric(name1); + auto m0 = metrics.initialize_optional(name0); + auto m1 = metrics.initialize_optional(name1); (void)m0; (void)m1; - EXPECT_EQ(metrics.metadata_bytes(), 108U); + EXPECT_EQ(metrics.metadata_bytes(), 112U); EXPECT_EQ(metrics.value_bytes(), sizeof(uint32_t) + // hash 1 + sizeof(uint64_t) + // metric0 has_value + value @@ -218,15 +220,15 @@ TEST(test_metrics, reset_counters) std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}}}, + abacus::optional, abacus::unit{"bytes"}}}, {abacus::name{name1}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}}; + abacus::optional, abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; - auto uint_metric = metrics.initialize_metric(name0); - auto int_metric = metrics.initialize_metric(name1); + auto uint_metric = metrics.initialize_optional(name0); + auto int_metric = metrics.initialize_optional(name1); EXPECT_FALSE(uint_metric.has_value()); EXPECT_FALSE(int_metric.has_value()); @@ -253,48 +255,48 @@ TEST(test_metrics, reset_counters) } static const std::vector expected_meta_data = { - 0x08, 0x02, 0x1d, 0x76, 0x78, 0x4e, 0x60, 0x22, 0x34, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x08, 0x04, 0x12, 0x25, + 0x08, 0x02, 0x1d, 0x26, 0x65, 0xd9, 0x06, 0x22, 0x34, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x08, 0x04, 0x1a, 0x25, 0x0a, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x10, 0x01, 0x1a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x2d, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, - 0x12, 0x22, 0x08, 0x0d, 0x1a, 0x1e, 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, + 0x12, 0x22, 0x08, 0x0d, 0x22, 0x1e, 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x03, 0x55, 0x53, 0x44, 0x22, 0x2c, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, - 0x21, 0x08, 0x16, 0x32, 0x1d, 0x0a, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, + 0x21, 0x08, 0x16, 0x3a, 0x1d, 0x0a, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x02, 0x6d, 0x73, 0x22, 0x21, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, 0x16, 0x08, - 0x1f, 0x42, 0x12, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, + 0x1f, 0x4a, 0x12, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63}; static const std::vector expected_value_data = { - 0x76, 0x78, 0x4e, 0x60, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x40, 0x01, 0x01, + 0x01, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x40, 0x01, 0x01, }; - -namespace google::protobuf::internal -{ -// Note: This method must be named exactly MapTestForceDeterministic to be able -// to call the SetDefaultSerializationDeterministic method as a friend function. -void MapTestForceDeterministic() -{ - // This function is used to force deterministic serialization for the - // map. This is used to make the test more stable and we can compare - // the serialized metadata. - io::CodedOutputStream::SetDefaultSerializationDeterministic(); -} -} +// namespace google::protobuf::internal +// { +// // Note: This method must be named exactly MapTestForceDeterministic to be +// able +// // to call the SetDefaultSerializationDeterministic method as a friend +// function. void MapTestForceDeterministic() +// { +// // This function is used to force deterministic serialization for the +// // map. This is used to make the test more stable and we can compare +// // the serialized metadata. +// io::CodedOutputStream::SetDefaultSerializationDeterministic(); +// } +// } TEST(test_metrics, protocol_version) { // Force deterministic serialization - google::protobuf::internal::MapTestForceDeterministic(); - ASSERT_TRUE(google::protobuf::io::CodedOutputStream:: - IsDefaultSerializationDeterministic()); + // google::protobuf::internal::MapTestForceDeterministic(); + // ASSERT_TRUE(google::protobuf::io::CodedOutputStream:: + // IsDefaultSerializationDeterministic()); SCOPED_TRACE(::testing::Message() << "protocol version: " << abacus::protocol_version()); @@ -304,25 +306,27 @@ TEST(test_metrics, protocol_version) std::map infos = { {abacus::name{"metric0"}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}}}, + abacus::required, abacus::unit{"bytes"}}}, {abacus::name{"metric1"}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}, + abacus::required, abacus::unit{"USD"}}}, {abacus::name{"metric2"}, abacus::float64{abacus::kind::GAUGE, "A floating point metric", - abacus::unit{"ms"}}}, + abacus::required, abacus::unit{"ms"}}}, {abacus::name{"metric3"}, - abacus::boolean{abacus::kind::GAUGE, "A boolean metric"}}}; + abacus::boolean{abacus::kind::GAUGE, "A boolean metric", + abacus::required}}}; abacus::metrics metrics(infos); auto uint_metric = - metrics.initialize_metric("metric0", 42U); - auto int_metric = metrics.initialize_metric("metric1", -42); + metrics.initialize_required("metric0", 42U); + auto int_metric = + metrics.initialize_required("metric1", -42); auto float_metric = - metrics.initialize_metric("metric2", 142.0); + metrics.initialize_required("metric2", 142.0); auto bool_metric = - metrics.initialize_metric("metric3", true); + metrics.initialize_required("metric3", true); (void)uint_metric; (void)int_metric; @@ -341,18 +345,24 @@ TEST(test_metrics, protocol_version) } SCOPED_TRACE(::testing::Message() << "Meta data:\n" << meta_stream.str()); - EXPECT_EQ(expected_meta_data, - std::vector(metrics.metadata_data(), - metrics.metadata_data() + - metrics.metadata_bytes())); + + auto expected = abacus::parse_metadata(expected_meta_data.data(), + expected_meta_data.size()); + auto actual = metrics.metadata(); + + expected.set_sync_value(1); + actual.set_sync_value(1); + + EXPECT_TRUE(google::protobuf::util::MessageDifferencer::Equals(expected, + actual)); } - EXPECT_EQ(metrics.value_bytes(), expected_value_data.size()); + EXPECT_EQ(metrics.value_bytes() - 4U, expected_value_data.size()); { std::stringstream value_stream; value_stream << std::hex; - for (std::size_t i = 0; i < metrics.value_bytes(); ++i) + for (std::size_t i = 4; i < metrics.value_bytes(); ++i) { value_stream << "0x" << std::setw(2) << std::setfill('0') << static_cast(metrics.value_data()[i]) << ", "; @@ -361,7 +371,7 @@ TEST(test_metrics, protocol_version) << value_stream.str()); EXPECT_EQ( expected_value_data, - std::vector(metrics.value_data(), + std::vector(metrics.value_data() + 4, metrics.value_data() + metrics.value_bytes())); } } diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 223c8228..0f690a44 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -30,27 +30,30 @@ TEST(test_to_json, to_json_minimal) std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::required, abacus::unit{"bytes"}, + abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}, abacus::min{int64_t{-100}}, - abacus::max{int64_t{100}}}}, + abacus::required, abacus::unit{"USD"}, + abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, + abacus::boolean{abacus::kind::CONSTANT, "A boolean constant", + abacus::required}}, {abacus::name{name3}, abacus::enum8{"An enum metric", {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {3, {"value3", "The value for 3"}}}, + abacus::required}}}; abacus::metrics metrics(infos); - auto m0 = metrics.initialize_metric(name0, 42); - auto m1 = metrics.initialize_metric(name1, -42); + auto m0 = metrics.initialize_required(name0, 42); + auto m1 = metrics.initialize_required(name1, -42); metrics.initialize_constant(name2, true); - auto m3 = metrics.initialize_metric(name3, 2); + auto m3 = metrics.initialize_required(name3, 2); (void)m0; (void)m1; @@ -69,6 +72,7 @@ TEST(test_to_json, to_json_minimal) static const char* expected_json = R"({ "metric0" : { "offset" : 4, + "optional" : false, "uint64" : { "description" : "An unsigned integer metric", "kind" : "COUNTER", @@ -87,6 +91,7 @@ static const char* expected_json = R"({ "unit" : "USD" }, "offset" : 13, + "optional" : false, "value" : -42 }, "metric2" : { @@ -95,6 +100,7 @@ static const char* expected_json = R"({ "kind" : "CONSTANT" }, "offset" : 22, + "optional" : false, "value" : true }, "metric3" : { @@ -120,10 +126,19 @@ static const char* expected_json = R"({ } }, "offset" : 24, + "optional" : false, "value" : 2 } })"; +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; + TEST(test_to_json, to_json) { std::string name0 = "metric0"; @@ -134,26 +149,33 @@ TEST(test_to_json, to_json) std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::required, abacus::unit{"bytes"}, + abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}, abacus::min{int64_t{-100}}, - abacus::max{int64_t{100}}}}, + abacus::required, abacus::unit{"USD"}, + abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::kind::CONSTANT, "A boolean constant"}}, + abacus::boolean{abacus::kind::CONSTANT, "A boolean constant", + abacus::required}}, {abacus::name{name3}, abacus::enum8{"An enum metric", {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {3, {"value3", "The value for 3"}}}, + abacus::required}}}; abacus::metrics metrics(infos); - auto m0 = metrics.initialize_metric(name0, 42); - auto m1 = metrics.initialize_metric(name1, -42); + auto m0 = metrics.initialize_required(name0, 42); + auto m1 = metrics.initialize_required(name1, -42); metrics.initialize_constant(name2, true); + auto m3 = metrics.initialize_required( + name3, (uint8_t)test_enum::value1); + + m3 = test_enum::value2; (void)m0; (void)m1; diff --git a/test/src/test_type.cpp b/test/src/test_type.cpp index 003e298a..94bdc459 100644 --- a/test/src/test_type.cpp +++ b/test/src/test_type.cpp @@ -12,10 +12,11 @@ template void integer_test() { - using metric = typename T::metric; + using metric = typename T::optional; using type = typename T::type; uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); metric m; EXPECT_FALSE(m.is_initialized()); m = metric(data); @@ -43,10 +44,11 @@ TEST(test_metrics, integer) template void floating_point_test() { - using metric = typename T::metric; + using metric = typename T::optional; using type = typename T::type; uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); metric m; EXPECT_FALSE(m.is_initialized()); m = metric(data); @@ -73,9 +75,10 @@ TEST(test_metrics, floating_point) TEST(test_metrics, boolean) { uint8_t data[sizeof(bool) + 1]; - abacus::boolean::metric m; + std::memset(data, 0, sizeof(data)); + abacus::boolean::optional m; EXPECT_FALSE(m.is_initialized()); - m = abacus::boolean::metric(data); + m = abacus::boolean::optional(data); EXPECT_TRUE(m.is_initialized()); EXPECT_FALSE(m.has_value()); m = true; @@ -88,9 +91,10 @@ TEST(test_metrics, boolean) TEST(test_metrics, enum8) { uint8_t data[sizeof(uint8_t) + 1]; - abacus::enum8::metric m; + std::memset(data, 0, sizeof(data)); + abacus::enum8::optional m; EXPECT_FALSE(m.is_initialized()); - m = abacus::enum8::metric(data); + m = abacus::enum8::optional(data); EXPECT_TRUE(m.is_initialized()); EXPECT_FALSE(m.has_value()); m = 10U; diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index f0e81a72..c24ad6b9 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -23,30 +23,31 @@ TEST(test_view, api) std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::unit{"bytes"}}}, + abacus::optional, abacus::unit{"bytes"}}}, {abacus::name{name1}, abacus::int64{abacus::kind::GAUGE, "A signed integer metric", - abacus::unit{"USD"}}}, + abacus::optional, abacus::unit{"USD"}}}, {abacus::name{name2}, abacus::float64{abacus::kind::CONSTANT, - "A constant floating point metric", + "A constant floating point metric", abacus::optional, abacus::unit{"ms"}}}, {abacus::name{name3}, abacus::enum8{"An enum metric", {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {3, {"value3", "The value for 3"}}}, + abacus::optional}}}; abacus::metrics metrics(infos); - auto metric0 = metrics.initialize_metric(name0); + auto metric0 = metrics.initialize_optional(name0); - auto metric1 = metrics.initialize_metric(name1); + auto metric1 = metrics.initialize_optional(name1); metrics.initialize_constant(name2, 3.14); - auto metric3 = metrics.initialize_metric(name3); + auto metric3 = metrics.initialize_optional(name3); std::vector meta_data(metrics.metadata_bytes()); std::vector value_data(metrics.value_bytes()); From b30f86e6625517a509e18536858dc1d61c32da63 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 21 Jan 2025 14:38:27 +0100 Subject: [PATCH 17/68] work --- benchmark/main.cpp | 20 ++++++--- examples/metrics_simple.cpp | 48 +++++++++++++------- protobuf/metrics.proto | 2 - src/abacus/boolean.hpp | 3 +- src/abacus/description.hpp | 6 --- src/abacus/enum8.hpp | 3 +- src/abacus/float32.hpp | 3 +- src/abacus/float64.hpp | 3 +- src/abacus/int32.hpp | 3 +- src/abacus/int64.hpp | 3 +- src/abacus/kind.hpp | 41 ++++++++++++++++- src/abacus/metrics.cpp | 38 +++++++--------- src/abacus/metrics.hpp | 4 -- src/abacus/optional_metric.hpp | 7 +++ src/abacus/uint32.hpp | 3 +- src/abacus/uint64.hpp | 3 +- test/src/test_metrics.cpp | 80 ++++++++++++++++------------------ test/src/test_to_json.cpp | 32 ++++++++------ test/src/test_view.cpp | 15 ++++--- 19 files changed, 188 insertions(+), 129 deletions(-) diff --git a/benchmark/main.cpp b/benchmark/main.cpp index 375823ef..63a3a905 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -7,20 +7,26 @@ std::map create_metric_infos() { return {{abacus::name{"0"}, - abacus::boolean{abacus::kind::GAUGE, "", abacus::required}}, + abacus::boolean{abacus::gauge, abacus::description{""}, + abacus::required}}, {abacus::name{"1"}, - abacus::uint64{abacus::kind::GAUGE, "", abacus::required}}, + abacus::uint64{abacus::gauge, abacus::description{""}, + abacus::required}}, {abacus::name{"2"}, - abacus::int64{abacus::kind::GAUGE, "", abacus::required}}, + abacus::int64{abacus::gauge, abacus::description{""}, + abacus::required}}, {abacus::name{"3"}, - abacus::float64{abacus::kind::GAUGE, "", abacus::required}}, + abacus::float64{abacus::gauge, abacus::description{""}, + abacus::required}}, {abacus::name{"4"}, - abacus::boolean{abacus::kind::GAUGE, "", abacus::required}}, + abacus::boolean{abacus::gauge, abacus::description{""}, + abacus::required}}, {abacus::name{"5"}, - abacus::float64{abacus::kind::GAUGE, "", abacus::required}}, + abacus::float64{abacus::gauge, abacus::description{""}, + abacus::required}}, {abacus::name{"6"}, abacus::enum8{ - "", + abacus::description{""}, {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}, abacus::required}}}; } diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 4a62e1a2..74e463b5 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -21,20 +21,24 @@ int main() std::map infos = { {abacus::name{name0}, - abacus::float64{abacus::kind::CONSTANT, - "Fuel consumption in kilometers per liter", - abacus::required, abacus::unit{"km/l"}}}, + abacus::float64{ + abacus::constant, + abacus::description{"Fuel consumption in kilometers per liter"}, + abacus::required, abacus::unit{"km/l"}}}, {abacus::name{name1}, - abacus::uint64{abacus::kind::CONSTANT, "Wheels on the car", + abacus::uint64{abacus::constant, + abacus::description{"Wheels on the car"}, abacus::required, abacus::unit{"wheels"}}}, {abacus::name{name2}, - abacus::int64{abacus::kind::GAUGE, - "Days until next maintenance, if less than 0, " - "maintenance is overdue", - abacus::required, abacus::unit{"days"}}}, + abacus::int64{ + abacus::gauge, + abacus::description{"Days until next maintenance, if less than 0, " + "maintenance is overdue"}, + abacus::required, abacus::unit{"days"}}}, {abacus::name{name3}, - abacus::boolean{abacus::kind::GAUGE, "Is the car registered", - abacus::required}}}; + abacus::boolean{abacus::gauge, + abacus::description{"Is the car registered"}, + abacus::optional}}}; abacus::metrics car(infos); @@ -42,14 +46,28 @@ int main() car.initialize_constant("wheels", 4); // The car still has some time before maintenance. - auto days_until_maintenance = + abacus::int64::required days_until_maintenance = car.initialize_required("days_until_maintenance", 10); // The car should be registered. - auto registered = - car.initialize_required("registered", false); + abacus::boolean::optional registered = + car.initialize_optional("registered"); - // The car has been registered. + // The registration is initialized, but not set. + assert(registered.is_initialized()); + assert(!registered.has_value()); + + // The car hasn't been registered. + registered = false; + + // The registration is now set. + assert(registered.has_value()); + + // We can reset the registration. + registered.reset(); + assert(!registered.has_value()); + + // The car is now registered. registered = true; // The car has been driven for a while, and now maintenance is overdue. @@ -66,7 +84,7 @@ int main() abacus::view car_view; car_view.set_meta_data(meta_data.data(), meta_data.size()); - auto success = + bool success = car_view.set_value_data(value_data.data(), value_data.size()); (void)success; assert(success); diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 15b4f7ff..a0f7bafe 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -2,10 +2,8 @@ syntax = "proto3"; package abacus.protobuf; option go_package = "abacus/protobuf"; - import "abacus/protobuf/kind.proto"; - // Specifies the endianness for multi-byte values enum Endianness { LITTLE = 0; // Little-endian byte order diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index d67034cc..1f319557 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -11,6 +11,7 @@ #include #include "availability.hpp" +#include "description.hpp" #include "kind.hpp" #include "optional_metric.hpp" #include "required_metric.hpp" @@ -34,7 +35,7 @@ struct boolean abacus::kind kind; /// The description of the metric - std::string description; + abacus::description description; /// The availability of the metric abacus::availability availability; diff --git a/src/abacus/description.hpp b/src/abacus/description.hpp index 0a862717..a33308b4 100644 --- a/src/abacus/description.hpp +++ b/src/abacus/description.hpp @@ -23,12 +23,6 @@ struct description { } - /// @return True if the description is empty otherwise false - bool empty() const - { - return value.empty(); - } - /// The description string std::string value; }; diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index 7511c290..d533a06b 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -12,6 +12,7 @@ #include #include "availability.hpp" +#include "description.hpp" #include "optional_metric.hpp" #include "required_metric.hpp" #include "unit.hpp" @@ -43,7 +44,7 @@ struct enum8 }; /// The metric description - std::string description; + abacus::description description; /// The enumeration values std::map values; diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 49d3ee0f..93e969b3 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -8,6 +8,7 @@ #include #include "availability.hpp" +#include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" @@ -35,7 +36,7 @@ struct float32 abacus::kind kind; /// The metric description - std::string description; + abacus::description description; /// The availability of the metric abacus::availability availability; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index eb49f633..c027ca49 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -6,6 +6,7 @@ #pragma once #include "availability.hpp" +#include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" @@ -33,7 +34,7 @@ struct float64 abacus::kind kind; /// The metric description - std::string description; + abacus::description description; /// The availability of the metric abacus::availability availability; diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 035e2603..d786ef59 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -6,6 +6,7 @@ #pragma once #include "availability.hpp" +#include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" @@ -33,7 +34,7 @@ struct int32 abacus::kind kind; /// The metric description - std::string description; + abacus::description description; /// The availability of the metric abacus::availability availability; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 7a7b7803..c8ff22f6 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -6,6 +6,7 @@ #pragma once #include "availability.hpp" +#include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" @@ -33,7 +34,7 @@ struct int64 abacus::kind kind; /// The metric description - std::string description; + abacus::description description; /// The availability of the metric abacus::availability availability; diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index a27846d4..36fe2c60 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -12,7 +12,44 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -/// @brief The kind of a metric -using kind = protobuf::Kind; +struct gauge_ +{ + static constexpr protobuf::Kind value = protobuf::Kind::GAUGE; +}; +static const gauge_ gauge; + +struct counter_ +{ + static constexpr protobuf::Kind value = protobuf::Kind::COUNTER; +}; +static const counter_ counter; + +struct constant_ +{ + static constexpr protobuf::Kind value = protobuf::Kind::CONSTANT; +}; +static const constant_ constant; + +using kind = std::variant; + +static inline auto to_protobuf(const kind& k) -> protobuf::Kind +{ + if (std::holds_alternative(k)) + { + return protobuf::Kind::GAUGE; + } + else if (std::holds_alternative(k)) + { + return protobuf::Kind::COUNTER; + } + else if (std::holds_alternative(k)) + { + return protobuf::Kind::CONSTANT; + } + else + { + throw std::runtime_error("Unknown kind"); + } +} } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index c5e25bcf..589612a2 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -86,8 +86,8 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_uint64()->set_description(m->description); - metric.mutable_uint64()->set_kind(m->kind); + metric.mutable_uint64()->set_description(m->description.value); + metric.mutable_uint64()->set_kind(to_protobuf(m->kind)); if (!m->unit.empty()) { metric.mutable_uint64()->set_unit(m->unit.value); @@ -107,8 +107,8 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_int64()->set_description(m->description); - metric.mutable_int64()->set_kind(m->kind); + metric.mutable_int64()->set_description(m->description.value); + metric.mutable_int64()->set_kind(to_protobuf(m->kind)); if (!m->unit.empty()) { metric.mutable_int64()->set_unit(m->unit.value); @@ -128,8 +128,8 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_uint32()->set_description(m->description); - metric.mutable_uint32()->set_kind(m->kind); + metric.mutable_uint32()->set_description(m->description.value); + metric.mutable_uint32()->set_kind(to_protobuf(m->kind)); if (!m->unit.empty()) { metric.mutable_uint32()->set_unit(m->unit.value); @@ -149,8 +149,8 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_int32()->set_description(m->description); - metric.mutable_int32()->set_kind(m->kind); + metric.mutable_int32()->set_description(m->description.value); + metric.mutable_int32()->set_kind(to_protobuf(m->kind)); if (!m->unit.empty()) { metric.mutable_int32()->set_unit(m->unit.value); @@ -170,8 +170,8 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_float64()->set_description(m->description); - metric.mutable_float64()->set_kind(m->kind); + metric.mutable_float64()->set_description(m->description.value); + metric.mutable_float64()->set_kind(to_protobuf(m->kind)); if (!m->unit.empty()) { metric.mutable_float64()->set_unit(m->unit.value); @@ -191,8 +191,8 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_float32()->set_description(m->description); - metric.mutable_float32()->set_kind(m->kind); + metric.mutable_float32()->set_description(m->description.value); + metric.mutable_float32()->set_kind(to_protobuf(m->kind)); if (!m->unit.empty()) { metric.mutable_float32()->set_unit(m->unit.value); @@ -212,8 +212,8 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_boolean()->set_description(m->description); - metric.mutable_boolean()->set_kind(m->kind); + metric.mutable_boolean()->set_description(m->description.value); + metric.mutable_boolean()->set_kind(to_protobuf(m->kind)); } else if (auto* m = std::get_if(&value)) { @@ -221,7 +221,7 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.set_optional(is_optional(m->availability)); - metric.mutable_enum8()->set_description(m->description); + metric.mutable_enum8()->set_description(m->description.value); for (auto [key, value] : m->values) { auto enum_value = protobuf::EnumValue(); @@ -454,13 +454,5 @@ auto metrics::is_initialized() const -> bool } return true; } - -void metrics::reset_metrics() -{ - // Reset the value data - std::memset(m_data.data() + m_metadata_bytes + sizeof(uint32_t), 0, - m_value_bytes - sizeof(uint32_t)); -} - } } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index f8d96ce8..b77e2327 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -89,10 +89,6 @@ class metrics /// @return true if all metrics have been initialized auto is_initialized() const -> bool; - /// Reset all metrics - /// This will set all metrics has_value() to false. - void reset_metrics(); - private: /// No copy metrics(metrics&) = delete; diff --git a/src/abacus/optional_metric.hpp b/src/abacus/optional_metric.hpp index d3bf88ab..9e6be2ae 100644 --- a/src/abacus/optional_metric.hpp +++ b/src/abacus/optional_metric.hpp @@ -97,6 +97,13 @@ struct optional_metric return *this; } + /// Reset the metric. This will cause the metric to not have a value + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + public: /// Arithmetic operators diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 3f82da61..b7477128 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -6,6 +6,7 @@ #pragma once #include "availability.hpp" +#include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" @@ -33,7 +34,7 @@ struct uint32 abacus::kind kind; /// The metric description - std::string description; + abacus::description description; /// The availability of the metric abacus::availability availability; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index fe051a93..5d1b92ef 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -6,6 +6,7 @@ #pragma once #include "availability.hpp" +#include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" @@ -33,7 +34,7 @@ struct uint64 abacus::kind kind; /// The metric description - std::string description; + abacus::description description; /// The availability of the metric abacus::availability availability; diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index eb3dc1c5..6a9910dc 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -37,26 +37,32 @@ TEST(test_metrics, api) std::map infos = { {abacus::name{name0}, - abacus::boolean{abacus::kind::COUNTER, "A boolean metric", + abacus::boolean{abacus::counter, + abacus::description{"A boolean metric"}, abacus::optional}}, {abacus::name{name1}, - abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::uint64{abacus::counter, + abacus::description{"An unsigned integer metric"}, abacus::required, abacus::unit{"bytes"}}}, {abacus::name{name2}, - abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::int64{abacus::gauge, + abacus::description{"A signed integer metric"}, abacus::optional, abacus::unit{"USD"}}}, {abacus::name{name3}, - abacus::float64{abacus::kind::GAUGE, "A floating point metric", + abacus::float64{abacus::gauge, + abacus::description{"A floating point metric"}, abacus::optional, abacus::unit{"ms"}}}, {abacus::name{name4}, - abacus::boolean{abacus::kind::CONSTANT, "A constant boolean metric", + abacus::boolean{abacus::constant, + abacus::description{"A constant boolean metric"}, abacus::required}}, {abacus::name{name5}, - abacus::float64{abacus::kind::CONSTANT, - "A constant floating point metric", abacus::required, - abacus::unit{"ms"}}}, + abacus::float64{ + abacus::constant, + abacus::description{"A constant floating point metric"}, + abacus::required, abacus::unit{"ms"}}}, {abacus::name{name6}, - abacus::enum8{"An enum metric", + abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -70,39 +76,39 @@ TEST(test_metrics, api) abacus::protocol_version()); EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().kind(), - abacus::kind::COUNTER); + abacus::counter.value); EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().description(), "A boolean metric"); EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().unit(), ""); // empty unit EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().kind(), - abacus::kind::COUNTER); + abacus::counter.value); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().description(), "An unsigned integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().unit(), "bytes"); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().kind(), - abacus::kind::GAUGE); + abacus::gauge.value); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().description(), "A signed integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().unit(), "USD"); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().kind(), - abacus::kind::GAUGE); + abacus::gauge.value); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().description(), "A floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().unit(), "ms"); EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().kind(), - abacus::kind::CONSTANT); + abacus::constant.value); EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().description(), "A constant boolean metric"); EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().unit(), ""); // empty unit EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().kind(), - abacus::kind::CONSTANT); + abacus::constant.value); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().description(), "A constant floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().unit(), "ms"); @@ -192,10 +198,12 @@ TEST(test_metrics, value_and_metadata_bytes) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::uint64{abacus::counter, + abacus::description{"An unsigned integer metric"}, abacus::optional, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::int64{abacus::gauge, + abacus::description{"A signed integer metric"}, abacus::optional, abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; @@ -219,10 +227,12 @@ TEST(test_metrics, reset_counters) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::uint64{abacus::counter, + abacus::description{"An unsigned integer metric"}, abacus::optional, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::int64{abacus::gauge, + abacus::description{"A signed integer metric"}, abacus::optional, abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; @@ -240,7 +250,8 @@ TEST(test_metrics, reset_counters) EXPECT_EQ(uint_metric.value(), 4U); EXPECT_EQ(int_metric.value(), -4); - metrics.reset_metrics(); + uint_metric.reset(); + int_metric.reset(); EXPECT_FALSE(uint_metric.has_value()); EXPECT_FALSE(int_metric.has_value()); @@ -277,27 +288,9 @@ static const std::vector expected_value_data = { 0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x40, 0x01, 0x01, }; -// namespace google::protobuf::internal -// { -// // Note: This method must be named exactly MapTestForceDeterministic to be -// able -// // to call the SetDefaultSerializationDeterministic method as a friend -// function. void MapTestForceDeterministic() -// { -// // This function is used to force deterministic serialization for the -// // map. This is used to make the test more stable and we can compare -// // the serialized metadata. -// io::CodedOutputStream::SetDefaultSerializationDeterministic(); -// } -// } TEST(test_metrics, protocol_version) { - // Force deterministic serialization - // google::protobuf::internal::MapTestForceDeterministic(); - // ASSERT_TRUE(google::protobuf::io::CodedOutputStream:: - // IsDefaultSerializationDeterministic()); - SCOPED_TRACE(::testing::Message() << "protocol version: " << abacus::protocol_version()); SCOPED_TRACE( @@ -305,16 +298,19 @@ TEST(test_metrics, protocol_version) << "If this test fails, you need to update the protocol version"); std::map infos = { {abacus::name{"metric0"}, - abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::uint64{abacus::counter, + abacus::description{"An unsigned integer metric"}, abacus::required, abacus::unit{"bytes"}}}, {abacus::name{"metric1"}, - abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::int64{abacus::gauge, + abacus::description{"A signed integer metric"}, abacus::required, abacus::unit{"USD"}}}, {abacus::name{"metric2"}, - abacus::float64{abacus::kind::GAUGE, "A floating point metric", + abacus::float64{abacus::gauge, + abacus::description{"A floating point metric"}, abacus::required, abacus::unit{"ms"}}}, {abacus::name{"metric3"}, - abacus::boolean{abacus::kind::GAUGE, "A boolean metric", + abacus::boolean{abacus::gauge, abacus::description{"A boolean metric"}, abacus::required}}}; abacus::metrics metrics(infos); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 0f690a44..a0c0081a 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -29,19 +29,21 @@ TEST(test_to_json, to_json_minimal) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::required, abacus::unit{"bytes"}, - abacus::min{uint64_t{0U}}, - abacus::max{uint64_t{100U}}}}, + abacus::uint64{ + abacus::counter, abacus::description{"An unsigned integer metric"}, + abacus::required, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::int64{abacus::gauge, + abacus::description{"A signed integer metric"}, abacus::required, abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::kind::CONSTANT, "A boolean constant", + abacus::boolean{abacus::constant, + abacus::description{"A boolean constant"}, abacus::required}}, {abacus::name{name3}, - abacus::enum8{"An enum metric", + abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -148,19 +150,21 @@ TEST(test_to_json, to_json) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", - abacus::required, abacus::unit{"bytes"}, - abacus::min{uint64_t{0U}}, - abacus::max{uint64_t{100U}}}}, + abacus::uint64{ + abacus::counter, abacus::description{"An unsigned integer metric"}, + abacus::required, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::int64{abacus::gauge, + abacus::description{"A signed integer metric"}, abacus::required, abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::kind::CONSTANT, "A boolean constant", + abacus::boolean{abacus::constant, + abacus::description{"A boolean constant"}, abacus::required}}, {abacus::name{name3}, - abacus::enum8{"An enum metric", + abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index c24ad6b9..7fcf39e4 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -22,17 +22,20 @@ TEST(test_view, api) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::kind::COUNTER, "An unsigned integer metric", + abacus::uint64{abacus::counter, + abacus::description{"An unsigned integer metric"}, abacus::optional, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::kind::GAUGE, "A signed integer metric", + abacus::int64{abacus::gauge, + abacus::description{"A signed integer metric"}, abacus::optional, abacus::unit{"USD"}}}, {abacus::name{name2}, - abacus::float64{abacus::kind::CONSTANT, - "A constant floating point metric", abacus::optional, - abacus::unit{"ms"}}}, + abacus::float64{ + abacus::constant, + abacus::description{"A constant floating point metric"}, + abacus::optional, abacus::unit{"ms"}}}, {abacus::name{name3}, - abacus::enum8{"An enum metric", + abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, From 7ece9ec18c028ab493740dc7c24c67180ab9b35d Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 21 Jan 2025 14:57:16 +0100 Subject: [PATCH 18/68] more asserts --- src/abacus/metrics.cpp | 47 ++++++++++++++++++++++-------------------- test/src/test_view.cpp | 2 +- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 589612a2..14ce3ced 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -302,29 +302,7 @@ metrics::initialize_optional(const std::string& name, } } -template -[[nodiscard]] auto metrics::initialize_required(const std::string& name, - typename Metric::type value) -> - typename Metric::required -{ - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); - auto kind = get_kind(proto_metric); - if (kind.has_value()) - { - assert(kind.value() != protobuf::Kind::CONSTANT); - } - - auto offset = proto_metric.offset(); - - return typename Metric::required(m_data.data() + m_metadata_bytes + offset, - value); -} - // Explicit instantiations for the expected types - template auto metrics::initialize_optional( const std::string& name, std::optional value) -> uint64::optional; @@ -350,6 +328,29 @@ template auto metrics::initialize_optional( const std::string& name, std::optional value) -> enum8::optional; +template +[[nodiscard]] auto metrics::initialize_required(const std::string& name, + typename Metric::type value) -> + typename Metric::required +{ + assert(m_initialized.find(name) != m_initialized.end()); + assert(!m_initialized.at(name)); + m_initialized[name] = true; + const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + assert(proto_metric.optional() == false); + auto kind = get_kind(proto_metric); + if (kind.has_value()) + { + assert(kind.value() != protobuf::Kind::CONSTANT); + } + + auto offset = proto_metric.offset(); + + return typename Metric::required(m_data.data() + m_metadata_bytes + offset, + value); +} + +// Explicit instantiations for the expected types template auto metrics::initialize_required(const std::string& name, uint64::type value) -> uint64::required; @@ -384,6 +385,8 @@ void metrics::initialize_constant(const std::string& name, m_initialized[name] = true; const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + assert(proto_metric.optional() == false && + "Constant metrics cannot be optional"); auto offset = proto_metric.offset(); auto kind = get_kind(proto_metric); assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 7fcf39e4..6b955c28 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -33,7 +33,7 @@ TEST(test_view, api) abacus::float64{ abacus::constant, abacus::description{"A constant floating point metric"}, - abacus::optional, abacus::unit{"ms"}}}, + abacus::required, abacus::unit{"ms"}}}, {abacus::name{name3}, abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, From b19294f48e8210b987814ed9c8370e0746412656 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 21 Jan 2025 15:01:30 +0100 Subject: [PATCH 19/68] type -> info --- benchmark/main.cpp | 2 +- docs/conf.py | 2 +- examples/metrics_simple.cpp | 2 +- src/abacus/{type.hpp => info.hpp} | 4 ++-- src/abacus/metrics.cpp | 4 ++-- src/abacus/metrics.hpp | 4 ++-- test/src/test_metric.cpp | 8 +++++--- test/src/test_metrics.cpp | 10 +++++----- test/src/test_to_json.cpp | 4 ++-- test/src/test_type.cpp | 2 +- test/src/test_view.cpp | 2 +- 11 files changed, 23 insertions(+), 21 deletions(-) rename src/abacus/{type.hpp => info.hpp} (80%) diff --git a/benchmark/main.cpp b/benchmark/main.cpp index 63a3a905..7fe5c556 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -4,7 +4,7 @@ #include // Helper function to create metric definitions -std::map create_metric_infos() +std::map create_metric_infos() { return {{abacus::name{"0"}, abacus::boolean{abacus::gauge, abacus::description{""}, diff --git a/docs/conf.py b/docs/conf.py index c946e8d9..cd5231fc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,7 +33,7 @@ "../src/abacus/metrics.hpp", "../src/abacus/min.hpp", "../src/abacus/to_json.hpp", - "../src/abacus/type.hpp", + "../src/abacus/info.hpp", "../src/abacus/uint32.hpp", "../src/abacus/uint64.hpp", "../src/abacus/unit.hpp", diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 74e463b5..84143087 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -19,7 +19,7 @@ int main() std::string name2 = "days_until_maintenance"; std::string name3 = "registered"; - std::map infos = { + std::map infos = { {abacus::name{name0}, abacus::float64{ abacus::constant, diff --git a/src/abacus/type.hpp b/src/abacus/info.hpp similarity index 80% rename from src/abacus/type.hpp rename to src/abacus/info.hpp index a333ae5d..dbf5c6d4 100644 --- a/src/abacus/type.hpp +++ b/src/abacus/info.hpp @@ -19,8 +19,8 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -/// A variant type for all the supported metric types -using type = std::variant; } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 14ce3ced..a82fff64 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -8,8 +8,8 @@ #include "detail/hash_function.hpp" #include "detail/size_of_type.hpp" +#include "info.hpp" #include "protocol_version.hpp" -#include "type.hpp" #include "version.hpp" #include "protobuf/metrics.pb.h" @@ -60,7 +60,7 @@ metrics::metrics(metrics&& other) noexcept : other.m_initialized.clear(); } -metrics::metrics(const std::map& info) +metrics::metrics(const std::map& info) { m_metadata = protobuf::MetricsMetadata(); m_metadata.set_protocol_version(protocol_version()); diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index b77e2327..05f26288 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -10,8 +10,8 @@ #include #include +#include "info.hpp" #include "name.hpp" -#include "type.hpp" #include "version.hpp" #include "protobuf/metrics.pb.h" @@ -35,7 +35,7 @@ class metrics /// Constructor /// @param info The info of the metrics to create. - metrics(const std::map& info); + metrics(const std::map& info); /// Destructor ~metrics(); diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index b8c763d2..a6d04a78 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -8,11 +8,12 @@ #include #include -#include +#include TEST(test_metric, constructor) { - uint8_t data[9] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); abacus::uint64::optional uint_metric(data); @@ -25,7 +26,8 @@ TEST(test_metric, constructor) TEST(test_metric, float_assignment) { - uint8_t data[9] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); abacus::float64::optional double_metric(data); EXPECT_TRUE(double_metric.is_initialized()); diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 6a9910dc..e7c0b551 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -19,7 +19,7 @@ TEST(test_metrics, empty) EXPECT_EQ(0U, metrics.metadata().metrics().size()); - std::map infos; + std::map infos; abacus::metrics metrics2(infos); EXPECT_EQ(0U, metrics2.metadata().metrics().size()); @@ -35,7 +35,7 @@ TEST(test_metrics, api) std::string name5 = "metric5"; std::string name6 = "metric6"; - std::map infos = { + std::map infos = { {abacus::name{name0}, abacus::boolean{abacus::counter, abacus::description{"A boolean metric"}, @@ -196,7 +196,7 @@ TEST(test_metrics, value_and_metadata_bytes) std::string name0 = "metric0"; std::string name1 = "metric1"; - std::map infos = { + std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::counter, abacus::description{"An unsigned integer metric"}, @@ -225,7 +225,7 @@ TEST(test_metrics, reset_counters) std::string name0 = "metric0"; std::string name1 = "metric1"; - std::map infos = { + std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::counter, abacus::description{"An unsigned integer metric"}, @@ -296,7 +296,7 @@ TEST(test_metrics, protocol_version) SCOPED_TRACE( ::testing::Message() << "If this test fails, you need to update the protocol version"); - std::map infos = { + std::map infos = { {abacus::name{"metric0"}, abacus::uint64{abacus::counter, abacus::description{"An unsigned integer metric"}, diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index a0c0081a..4961dc16 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -27,7 +27,7 @@ TEST(test_to_json, to_json_minimal) std::string name2 = "metric2"; std::string name3 = "metric3"; - std::map infos = { + std::map infos = { {abacus::name{name0}, abacus::uint64{ abacus::counter, abacus::description{"An unsigned integer metric"}, @@ -148,7 +148,7 @@ TEST(test_to_json, to_json) std::string name2 = "metric2"; std::string name3 = "metric3"; - std::map infos = { + std::map infos = { {abacus::name{name0}, abacus::uint64{ abacus::counter, abacus::description{"An unsigned integer metric"}, diff --git a/test/src/test_type.cpp b/test/src/test_type.cpp index 94bdc459..28ab3dc7 100644 --- a/test/src/test_type.cpp +++ b/test/src/test_type.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include template void integer_test() diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 6b955c28..87910765 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -20,7 +20,7 @@ TEST(test_view, api) std::string name2 = "metric2"; std::string name3 = "metric3"; - std::map infos = { + std::map infos = { {abacus::name{name0}, abacus::uint64{abacus::counter, abacus::description{"An unsigned integer metric"}, From 92228d9975e09230f2883b9764d2902ea9f5c97d Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 21 Jan 2025 15:13:42 +0100 Subject: [PATCH 20/68] working --- src/abacus/optional_metric.hpp | 3 +- src/abacus/required_metric.hpp | 2 +- test/src/test_info.cpp | 223 +++++++++++++++++++++++++++++++++ test/src/test_to_json.cpp | 3 + test/src/test_type.cpp | 105 ---------------- 5 files changed, 229 insertions(+), 107 deletions(-) create mode 100644 test/src/test_info.cpp delete mode 100644 test/src/test_type.cpp diff --git a/src/abacus/optional_metric.hpp b/src/abacus/optional_metric.hpp index 9e6be2ae..037e17aa 100644 --- a/src/abacus/optional_metric.hpp +++ b/src/abacus/optional_metric.hpp @@ -210,7 +210,8 @@ struct optional_metric auto set_value(T value) -> void { assert(is_initialized()); - assert(value <= std::numeric_limits::max()); + assert((std::underlying_type_t)value <= + std::numeric_limits::max()); set_value(static_cast(value)); } diff --git a/src/abacus/required_metric.hpp b/src/abacus/required_metric.hpp index d3338a94..b74f4ced 100644 --- a/src/abacus/required_metric.hpp +++ b/src/abacus/required_metric.hpp @@ -165,7 +165,7 @@ struct required_metric auto set_value(T value) -> void { assert(is_initialized()); - assert((typename std::underlying_type::type)value <= + assert((std::underlying_type_t)value <= std::numeric_limits::max()); set_value(static_cast(value)); diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp new file mode 100644 index 00000000..e66d831a --- /dev/null +++ b/test/src/test_info.cpp @@ -0,0 +1,223 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst +// file. + +#include +#include + +#include + +template +void integer_test() +{ + using type = typename T::type; + + { + using optional = typename T::optional; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + optional o; + EXPECT_FALSE(o.is_initialized()); + o = optional(data); + EXPECT_TRUE(o.is_initialized()); + EXPECT_FALSE(o.has_value()); + o = 10U; + EXPECT_TRUE(o.has_value()); + EXPECT_EQ(o.value(), type{10}); + o += 12; + o -= 2; + ++o; + --o; + + EXPECT_EQ(o.value(), type{20}); + o.reset(); + EXPECT_FALSE(o.has_value()); + } + { + using required = typename T::required; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + required r; + EXPECT_FALSE(r.is_initialized()); + r = required(data, 10U); + EXPECT_TRUE(r.is_initialized()); + EXPECT_EQ(r.value(), type{10}); + r += 12; + r -= 2; + ++r; + --r; + + EXPECT_EQ(r.value(), type{20}); + } +} + +TEST(test_info, integer) +{ + integer_test(); + integer_test(); + integer_test(); + integer_test(); +} + +template +void floating_point_test() +{ + using optional = typename T::optional; + using type = typename T::type; + + { + using optional = typename T::optional; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + optional o; + EXPECT_FALSE(o.is_initialized()); + o = optional(data); + EXPECT_TRUE(o.is_initialized()); + EXPECT_FALSE(o.has_value()); + o = 10.0; + EXPECT_TRUE(o.has_value()); + EXPECT_EQ(o.value(), 10.0); + o += 12.0; + o -= 2.0; + ++o; + --o; + + EXPECT_EQ(o.value(), 20.0); + o.reset(); + EXPECT_FALSE(o.has_value()); + } + { + using required = typename T::required; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + required r; + EXPECT_FALSE(r.is_initialized()); + r = required(data, 10.0); + EXPECT_TRUE(r.is_initialized()); + EXPECT_EQ(r.value(), type{10.0}); + r += 12.0; + r -= 2.0; + ++r; + --r; + + EXPECT_EQ(r.value(), type{20.0}); + } +} + +TEST(test_info, floating_point) +{ + + floating_point_test(); + floating_point_test(); +} + +TEST(test_info, boolean) +{ + { + uint8_t data[sizeof(bool) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::boolean::optional o; + EXPECT_FALSE(o.is_initialized()); + o = abacus::boolean::optional(data); + EXPECT_TRUE(o.is_initialized()); + EXPECT_FALSE(o.has_value()); + o = true; + EXPECT_TRUE(o.has_value()); + EXPECT_EQ(o.value(), true); + o = false; + EXPECT_EQ(o.value(), false); + o.reset(); + EXPECT_FALSE(o.has_value()); + } + { + uint8_t data[sizeof(bool) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::boolean::required r; + EXPECT_FALSE(r.is_initialized()); + r = abacus::boolean::required(data, true); + EXPECT_TRUE(r.is_initialized()); + EXPECT_EQ(r.value(), true); + r = false; + EXPECT_EQ(r.value(), false); + } +} +namespace +{ +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; +} + +TEST(test_info, enum8) +{ + { + uint8_t data[sizeof(uint8_t) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::enum8::optional o; + EXPECT_FALSE(o.is_initialized()); + o = abacus::enum8::optional(data); + EXPECT_TRUE(o.is_initialized()); + EXPECT_FALSE(o.has_value()); + o = 10U; + EXPECT_TRUE(o.has_value()); + EXPECT_EQ(o.value(), 10U); + o = 20U; + EXPECT_EQ(o.value(), 20U); + o.reset(); + EXPECT_FALSE(o.has_value()); + + o.set_value(test_enum::value0); + EXPECT_EQ(o.value(), 0U); + o.set_value(test_enum::value1); + EXPECT_EQ(o.value(), 1U); + o.set_value(test_enum::value2); + EXPECT_EQ(o.value(), 2U); + o.set_value(test_enum::value3); + EXPECT_EQ(o.value(), 3U); + + o = test_enum::value0; + EXPECT_EQ(o.value(), 0U); + o = test_enum::value1; + EXPECT_EQ(o.value(), 1U); + o = test_enum::value2; + EXPECT_EQ(o.value(), 2U); + o = test_enum::value3; + EXPECT_EQ(o.value(), 3U); + } + + { + uint8_t data[sizeof(uint8_t) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::enum8::required r; + EXPECT_FALSE(r.is_initialized()); + r = abacus::enum8::required(data, 10U); + EXPECT_TRUE(r.is_initialized()); + EXPECT_EQ(r.value(), 10U); + r = 20U; + EXPECT_EQ(r.value(), 20U); + + r.set_value(test_enum::value0); + EXPECT_EQ(r.value(), 0U); + r.set_value(test_enum::value1); + EXPECT_EQ(r.value(), 1U); + r.set_value(test_enum::value2); + EXPECT_EQ(r.value(), 2U); + r.set_value(test_enum::value3); + EXPECT_EQ(r.value(), 3U); + + r = test_enum::value0; + EXPECT_EQ(r.value(), 0U); + r = test_enum::value1; + EXPECT_EQ(r.value(), 1U); + r = test_enum::value2; + EXPECT_EQ(r.value(), 2U); + r = test_enum::value3; + EXPECT_EQ(r.value(), 3U); + } +} diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 4961dc16..c97b5fbc 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -133,6 +133,8 @@ static const char* expected_json = R"({ } })"; +namespace +{ enum class test_enum { value0 = 0, @@ -140,6 +142,7 @@ enum class test_enum value2 = 2, value3 = 3 }; +} TEST(test_to_json, to_json) { diff --git a/test/src/test_type.cpp b/test/src/test_type.cpp deleted file mode 100644 index 28ab3dc7..00000000 --- a/test/src/test_type.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst -// file. - -#include -#include - -#include - -template -void integer_test() -{ - using metric = typename T::optional; - using type = typename T::type; - - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - metric m; - EXPECT_FALSE(m.is_initialized()); - m = metric(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - m = 10U; - EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), type{10}); - m += 12; - m -= 2; - ++m; - --m; - - EXPECT_EQ(m.value(), type{20}); -} - -TEST(test_metrics, integer) -{ - integer_test(); - integer_test(); - integer_test(); - integer_test(); -} - -template -void floating_point_test() -{ - using metric = typename T::optional; - using type = typename T::type; - - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - metric m; - EXPECT_FALSE(m.is_initialized()); - m = metric(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - m = 10.0; - EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), 10.0); - m += 12.0; - m -= 2.0; - ++m; - --m; - - EXPECT_EQ(m.value(), 20.0); -} - -TEST(test_metrics, floating_point) -{ - - floating_point_test(); - floating_point_test(); -} - -TEST(test_metrics, boolean) -{ - uint8_t data[sizeof(bool) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::boolean::optional m; - EXPECT_FALSE(m.is_initialized()); - m = abacus::boolean::optional(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - m = true; - EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), true); - m = false; - EXPECT_EQ(m.value(), false); -} - -TEST(test_metrics, enum8) -{ - uint8_t data[sizeof(uint8_t) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::enum8::optional m; - EXPECT_FALSE(m.is_initialized()); - m = abacus::enum8::optional(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - m = 10U; - EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), 10U); - m = 20U; - EXPECT_EQ(m.value(), 20U); -} From 53236b12e962c3aec3790245a9c97516957dc0d1 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 22 Jan 2025 11:31:33 +0100 Subject: [PATCH 21/68] fin --- src/abacus/boolean.hpp | 22 +++++++++++++++ src/abacus/enum8.hpp | 40 ++++++++++++++++++++++++-- src/abacus/float32.hpp | 27 ++++++++++++++++++ src/abacus/float64.hpp | 27 ++++++++++++++++++ src/abacus/int32.hpp | 23 +++++++++++++++ src/abacus/int64.hpp | 23 +++++++++++++++ src/abacus/metrics.cpp | 51 ++++++++++++++++++++++++++++++++++ src/abacus/metrics.hpp | 9 ++++++ src/abacus/optional_metric.hpp | 47 +++++++------------------------ src/abacus/required_metric.hpp | 29 +++++++------------ src/abacus/uint32.hpp | 23 +++++++++++++++ src/abacus/uint64.hpp | 23 +++++++++++++++ src/abacus/view.cpp | 20 ++++++------- test/src/test_info.cpp | 1 - 14 files changed, 294 insertions(+), 71 deletions(-) diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index 1f319557..fd029baa 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -31,6 +31,28 @@ struct boolean /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + memory[0] = 1; + memory[1] = value; + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + return memory[1]; + } + /// The kind of the metric abacus::kind kind; diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index d533a06b..b6733495 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -33,8 +33,42 @@ struct enum8 /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + template + static inline auto set_value(uint8_t* memory, T value) -> void + { + static_assert(std::is_enum_v, "T must be an enum"); + static_assert(sizeof(std::underlying_type_t) == sizeof(type), + "The underlying type of the enum must match the type"); + assert(memory != nullptr); + memory[1] = (std::underlying_type_t)value; + } + + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + memory[1] = value; + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + return memory[1]; + } /// The enumeration value type - struct value + struct value_info { /// The name of the value std::string name; @@ -46,8 +80,8 @@ struct enum8 /// The metric description abacus::description description; - /// The enumeration values - std::map values; + /// The enumeration value information + std::map values; /// The availability of the metric abacus::availability availability; diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 93e969b3..8edd73b5 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -32,6 +32,33 @@ struct float32 /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + + std::memcpy(memory + 1, &value, sizeof(type)); + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + type value; + std::memcpy(&value, memory + 1, sizeof(type)); + return value; + } + /// The metric kind abacus::kind kind; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index c027ca49..f939e41e 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -30,6 +30,33 @@ struct float64 /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + + std::memcpy(memory + 1, &value, sizeof(type)); + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + type value; + std::memcpy(&value, memory + 1, sizeof(type)); + return value; + } + /// The metric kind abacus::kind kind; diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index d786ef59..8835c26d 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -30,6 +30,29 @@ struct int32 /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + std::memcpy(memory + 1, &value, sizeof(type)); + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + type value; + std::memcpy(&value, memory + 1, sizeof(type)); + return value; + } + /// The metric kind abacus::kind kind; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index c8ff22f6..9b818286 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -30,6 +30,29 @@ struct int64 /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + std::memcpy(memory + 1, &value, sizeof(type)); + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + type value; + std::memcpy(&value, memory + 1, sizeof(type)); + return value; + } + /// The metric kind abacus::kind kind; diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index a82fff64..c95d970c 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -292,6 +292,7 @@ metrics::initialize_optional(const std::string& name, if (value.has_value()) { + m_initial_values[name] = value.value(); return typename Metric::optional( m_data.data() + m_metadata_bytes + offset, value.value()); } @@ -346,6 +347,7 @@ template auto offset = proto_metric.offset(); + m_initial_values[name] = value; return typename Metric::required(m_data.data() + m_metadata_bytes + offset, value); } @@ -390,6 +392,8 @@ void metrics::initialize_constant(const std::string& name, auto offset = proto_metric.offset(); auto kind = get_kind(proto_metric); assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); + + m_initial_values[name] = value; typename Metric::required(m_data.data() + m_metadata_bytes + offset, value); } @@ -457,5 +461,52 @@ auto metrics::is_initialized() const -> bool } return true; } +auto metrics::reset() -> void +{ + for (auto [name, value] : m_initial_values) + { + const protobuf::Metric& metric = m_metadata.metrics().at(name); + auto kind = get_kind(metric); + if (!kind.has_value() || kind.value() == protobuf::Kind::CONSTANT) + { + continue; + } + + auto offset = metric.offset(); + if (metric.has_boolean()) + { + auto v = std::any_cast(value); + } + else if (metric.has_enum8()) + { + auto v = std::any_cast(value); + } + else if (metric.has_float32()) + { + auto v = std::any_cast(value); + } + else if (metric.has_float64()) + { + auto v = std::any_cast(value); + } + else if (metric.has_int32()) + { + auto v = std::any_cast(value); + } + else if (metric.has_int64()) + { + auto v = std::any_cast(value); + } + else if (metric.has_uint32()) + { + auto v = std::any_cast(value); + } + else if (metric.has_uint64()) + { + auto v = std::any_cast(value); + } + } +} + } } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 05f26288..68f29932 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -89,6 +90,11 @@ class metrics /// @return true if all metrics have been initialized auto is_initialized() const -> bool; + /// Reset all metrics to their initial values + /// Optional values will be reset to std::nullopt unless they were set + /// during initialization. + auto reset() -> void; + private: /// No copy metrics(metrics&) = delete; @@ -114,6 +120,9 @@ class metrics /// A map of the metrics and whether they have been initialized std::map m_initialized; + + /// The initial values of the metrics + std::map m_initial_values; }; } } diff --git a/src/abacus/optional_metric.hpp b/src/abacus/optional_metric.hpp index 037e17aa..6dffa8f5 100644 --- a/src/abacus/optional_metric.hpp +++ b/src/abacus/optional_metric.hpp @@ -67,10 +67,7 @@ struct optional_metric auto value() const -> value_type { assert(has_value()); - - value_type value; - std::memcpy(&value, m_memory + 1, sizeof(value_type)); - return value; + return Metric::value(m_memory); } /// Assign a new value to the metric @@ -78,14 +75,8 @@ struct optional_metric auto set_value(value_type value) -> void { assert(is_initialized()); - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } m_memory[0] = 1; - std::memcpy(m_memory + 1, &value, sizeof(value_type)); + Metric::set_value(m_memory, value); } /// Assign the metric a new value @@ -108,44 +99,28 @@ struct optional_metric /// Arithmetic operators /// Increment the metric - /// @param value The value to add + /// @param increment The value to add /// @return The result of the arithmetic template < typename U = Metric, typename = std::enable_if_t::value>> - auto operator+=(value_type value) -> optional_metric& + auto operator+=(value_type increment) -> optional_metric& { assert(has_value()); - value_type new_value = this->value() + value; - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(new_value) && "Cannot assign a NaN"); - assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); - } - - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + Metric::set_value(m_memory, value() + increment); return *this; } /// Decrement the metric - /// @param value The value to subtract + /// @param decrement The value to subtract /// @return The result of the arithmetic template < typename U = Metric, typename = std::enable_if_t::value>> - auto operator-=(value_type value) -> optional_metric& + auto operator-=(value_type decrement) -> optional_metric& { assert(has_value()); - value_type new_value = this->value() - value; - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(new_value) && "Cannot assign a NaN"); - assert(!std::isinf(new_value) && "Cannot assign an Inf/-Inf value"); - } - - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + Metric::set_value(m_memory, value() - decrement); return *this; } @@ -157,8 +132,7 @@ struct optional_metric auto operator++() -> optional_metric& { assert(has_value()); - value_type new_value = this->value() + 1; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + Metric::set_value(m_memory, value() + 1); return *this; } @@ -170,8 +144,7 @@ struct optional_metric auto operator--() -> optional_metric& { assert(has_value()); - value_type new_value = this->value() - 1; - std::memcpy(m_memory + 1, &new_value, sizeof(value_type)); + Metric::set_value(m_memory, value() - 1); return *this; } diff --git a/src/abacus/required_metric.hpp b/src/abacus/required_metric.hpp index b74f4ced..bde70451 100644 --- a/src/abacus/required_metric.hpp +++ b/src/abacus/required_metric.hpp @@ -52,9 +52,7 @@ struct required_metric auto value() const -> value_type { assert(is_initialized()); - value_type value; - std::memcpy(&value, m_memory + 1, sizeof(value_type)); - return value; + return Metric::value(m_memory); } /// Assign a new value to the metric @@ -62,14 +60,7 @@ struct required_metric auto set_value(value_type value) -> void { assert(is_initialized()); - - if constexpr (std::is_floating_point_v) - { - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - } - - std::memcpy(m_memory + 1, &value, sizeof(value_type)); + Metric::set_value(m_memory, value); } /// Assign the metric a new value @@ -85,26 +76,26 @@ struct required_metric /// Arithmetic operators /// Increment the metric - /// @param value The value to add + /// @param increment The value to add /// @return The result of the arithmetic template < typename U = Metric, typename = std::enable_if_t::value>> - auto operator+=(value_type value) -> required_metric& + auto operator+=(value_type increment) -> required_metric& { - set_value(this->value() + value); + Metric::set_value(m_memory, value() + increment); return *this; } /// Decrement the metric - /// @param value The value to subtract + /// @param decrement The value to subtract /// @return The result of the arithmetic template < typename U = Metric, typename = std::enable_if_t::value>> - auto operator-=(value_type value) -> required_metric& + auto operator-=(value_type decrement) -> required_metric& { - set_value(this->value() - value); + Metric::set_value(m_memory, value() - decrement); return *this; } @@ -115,7 +106,7 @@ struct required_metric typename = std::enable_if_t::value>> auto operator++() -> required_metric& { - set_value(value() + 1); + Metric::set_value(m_memory, value() + 1); return *this; } @@ -126,7 +117,7 @@ struct required_metric typename = std::enable_if_t::value>> auto operator--() -> required_metric& { - set_value(value() - 1); + Metric::set_value(m_memory, value() - 1); return *this; } diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index b7477128..23f1a744 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -30,6 +30,29 @@ struct uint32 /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + std::memcpy(memory + 1, &value, sizeof(type)); + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + type value; + std::memcpy(&value, memory + 1, sizeof(type)); + return value; + } + /// The metric kind abacus::kind kind; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index 5d1b92ef..5108328b 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -30,6 +30,29 @@ struct uint64 /// The required metric type using required = required_metric; + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + std::memcpy(memory + 1, &value, sizeof(type)); + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + type value; + std::memcpy(&value, memory + 1, sizeof(type)); + return value; + } + /// The metric kind abacus::kind kind; diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 337baac2..3dfe8984 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -113,19 +113,17 @@ auto view::value(const std::string& name) const return std::nullopt; } - typename Metric::type value; - switch (m_metadata.endianness()) + if (m_metadata.endianness() == protobuf::Endianness::BIG) { - case protobuf::Endianness::BIG: - endian::big_endian::get(value, m_value_data + offset + 1); - break; - case protobuf::Endianness::LITTLE: - endian::little_endian::get(value, m_value_data + offset + 1); - break; - default: - assert(false); + return endian::big_endian::get(m_value_data + + offset + 1); + } + else + { + assert(m_metadata.endianness() == protobuf::Endianness::LITTLE); + return endian::little_endian::get(m_value_data + + offset + 1); } - return value; } // Explicit instantiations for the expected types diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index e66d831a..6004ae18 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -64,7 +64,6 @@ TEST(test_info, integer) template void floating_point_test() { - using optional = typename T::optional; using type = typename T::type; { From 61063915b96d914fbdd0c9b8c73979d463297f29 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 22 Jan 2025 14:13:12 +0100 Subject: [PATCH 22/68] work --- CMakeLists.txt | 8 +- NEWS.rst | 8 +- docs/conf.py | 7 +- docs/user_api/availablity.rst | 2 + docs/user_api/description.rst | 2 + .../{metric_types => metric_info}/boolean.rst | 0 .../{metric_types => metric_info}/enum8.rst | 0 .../{metric_types => metric_info}/float32.rst | 0 .../{metric_types => metric_info}/float64.rst | 0 .../{metric_types => metric_info}/int32.rst | 0 .../{metric_types => metric_info}/int64.rst | 0 .../metric_info.rst} | 8 +- .../{metric_types => metric_info}/uint32.rst | 0 .../{metric_types => metric_info}/uint64.rst | 0 docs/user_api/name.rst | 2 + docs/user_api/user_api.rst | 7 +- examples/metrics_simple.cpp | 14 +- src/abacus/availability.hpp | 14 +- src/abacus/boolean.hpp | 8 +- src/abacus/{ => detail}/optional_metric.hpp | 35 +--- src/abacus/{ => detail}/required_metric.hpp | 10 +- src/abacus/enum8.hpp | 24 ++- src/abacus/float32.hpp | 8 +- src/abacus/float64.hpp | 8 +- src/abacus/int32.hpp | 8 +- src/abacus/int64.hpp | 8 +- src/abacus/kind.hpp | 14 ++ src/abacus/metrics.cpp | 149 ++++++++++-------- src/abacus/metrics.hpp | 4 +- src/abacus/name.hpp | 6 - src/abacus/to_json.cpp | 8 +- src/abacus/uint32.hpp | 8 +- src/abacus/uint64.hpp | 8 +- src/abacus/view.cpp | 18 ++- src/abacus/view.hpp | 5 +- test/src/test_metrics.cpp | 6 + test/src/test_to_json.cpp | 14 +- test/src/test_view.cpp | 5 +- 38 files changed, 253 insertions(+), 173 deletions(-) create mode 100644 docs/user_api/availablity.rst create mode 100644 docs/user_api/description.rst rename docs/user_api/{metric_types => metric_info}/boolean.rst (100%) rename docs/user_api/{metric_types => metric_info}/enum8.rst (100%) rename docs/user_api/{metric_types => metric_info}/float32.rst (100%) rename docs/user_api/{metric_types => metric_info}/float64.rst (100%) rename docs/user_api/{metric_types => metric_info}/int32.rst (100%) rename docs/user_api/{metric_types => metric_info}/int64.rst (100%) rename docs/user_api/{metric_types/metric_types.rst => metric_info/metric_info.rst} (62%) rename docs/user_api/{metric_types => metric_info}/uint32.rst (100%) rename docs/user_api/{metric_types => metric_info}/uint64.rst (100%) create mode 100644 docs/user_api/name.rst rename src/abacus/{ => detail}/optional_metric.hpp (80%) rename src/abacus/{ => detail}/required_metric.hpp (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8267c1ae..a1c0326f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,7 +110,13 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) add_test(abacus_test abacus_test) # Google Benchmark dependency - add_subdirectory("${STEINWURF_RESOLVE}/gbenchmark-source") + set(BENCHMARK_ENABLE_TESTING + OFF + CACHE INTERNAL "Disable gbenchmark test" FORCE) + + if(NOT TARGET benchmark) + add_subdirectory("${STEINWURF_RESOLVE}/gbenchmark-source") + endif() # Build benchmark executable file(GLOB_RECURSE abacus_benchmark_sources ./benchmark/main.cpp) diff --git a/NEWS.rst b/NEWS.rst index e16066c1..debdc5ea 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -6,7 +6,13 @@ every change, see the Git log. Latest ------ -* tbd +* Minor: Added benchmark. +* Major: Changed the metadata to be specified using protobuf 3. +* Major: Changed callbacks to now use std::function rather than the custom + delegate previously used. +* Major: Changed API of how metrics are specified. All attributes are now + strongly typed, and specified using a std::map of strings to abacus::info. +* Minor: Added support for enums. 6.0.1 ----- diff --git a/docs/conf.py b/docs/conf.py index cd5231fc..b9fbe6a7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,18 +22,23 @@ wurfapi = { "source_paths": [ # API + "../src/abacus/availablity.hpp", "../src/abacus/boolean.hpp", + "../src/abacus/description.hpp", "../src/abacus/enum8.hpp", "../src/abacus/float32.hpp", "../src/abacus/float64.hpp", + "../src/abacus/info.hpp", "../src/abacus/int32.hpp", "../src/abacus/int64.hpp", "../src/abacus/kind.hpp", "../src/abacus/max.hpp", "../src/abacus/metrics.hpp", "../src/abacus/min.hpp", + "../src/abacus/name.hpp", + "../src/abacus/parse_metadata.hpp", + "../src/abacus/protocol_version.hpp", "../src/abacus/to_json.hpp", - "../src/abacus/info.hpp", "../src/abacus/uint32.hpp", "../src/abacus/uint64.hpp", "../src/abacus/unit.hpp", diff --git a/docs/user_api/availablity.rst b/docs/user_api/availablity.rst new file mode 100644 index 00000000..80e6ee83 --- /dev/null +++ b/docs/user_api/availablity.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::availablity diff --git a/docs/user_api/description.rst b/docs/user_api/description.rst new file mode 100644 index 00000000..d6a79ce9 --- /dev/null +++ b/docs/user_api/description.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::description diff --git a/docs/user_api/metric_types/boolean.rst b/docs/user_api/metric_info/boolean.rst similarity index 100% rename from docs/user_api/metric_types/boolean.rst rename to docs/user_api/metric_info/boolean.rst diff --git a/docs/user_api/metric_types/enum8.rst b/docs/user_api/metric_info/enum8.rst similarity index 100% rename from docs/user_api/metric_types/enum8.rst rename to docs/user_api/metric_info/enum8.rst diff --git a/docs/user_api/metric_types/float32.rst b/docs/user_api/metric_info/float32.rst similarity index 100% rename from docs/user_api/metric_types/float32.rst rename to docs/user_api/metric_info/float32.rst diff --git a/docs/user_api/metric_types/float64.rst b/docs/user_api/metric_info/float64.rst similarity index 100% rename from docs/user_api/metric_types/float64.rst rename to docs/user_api/metric_info/float64.rst diff --git a/docs/user_api/metric_types/int32.rst b/docs/user_api/metric_info/int32.rst similarity index 100% rename from docs/user_api/metric_types/int32.rst rename to docs/user_api/metric_info/int32.rst diff --git a/docs/user_api/metric_types/int64.rst b/docs/user_api/metric_info/int64.rst similarity index 100% rename from docs/user_api/metric_types/int64.rst rename to docs/user_api/metric_info/int64.rst diff --git a/docs/user_api/metric_types/metric_types.rst b/docs/user_api/metric_info/metric_info.rst similarity index 62% rename from docs/user_api/metric_types/metric_types.rst rename to docs/user_api/metric_info/metric_info.rst index bf448db3..f6379aa7 100644 --- a/docs/user_api/metric_types/metric_types.rst +++ b/docs/user_api/metric_info/metric_info.rst @@ -1,11 +1,11 @@ .. _metric_specializations: -============ -Metric Types -============ +=========== +Metric Info +=========== -Overview of the metric types public API. +Overview of the metric info types. .. toctree:: :maxdepth: 2 diff --git a/docs/user_api/metric_types/uint32.rst b/docs/user_api/metric_info/uint32.rst similarity index 100% rename from docs/user_api/metric_types/uint32.rst rename to docs/user_api/metric_info/uint32.rst diff --git a/docs/user_api/metric_types/uint64.rst b/docs/user_api/metric_info/uint64.rst similarity index 100% rename from docs/user_api/metric_types/uint64.rst rename to docs/user_api/metric_info/uint64.rst diff --git a/docs/user_api/name.rst b/docs/user_api/name.rst new file mode 100644 index 00000000..163f7504 --- /dev/null +++ b/docs/user_api/name.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::name diff --git a/docs/user_api/user_api.rst b/docs/user_api/user_api.rst index 3e08c7e9..895f9830 100644 --- a/docs/user_api/user_api.rst +++ b/docs/user_api/user_api.rst @@ -10,11 +10,14 @@ Overview of the public API. .. toctree:: :maxdepth: 3 - metric_types/metric_types + metrics + name + metric_info/metric_info kind + description + availablity unit min max - metrics view functions diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 84143087..33bffb60 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -71,23 +71,23 @@ int main() registered = true; // The car has been driven for a while, and now maintenance is overdue. - days_until_maintenance = -1; + days_until_maintenance = -10; - /// We want to export the metrics memory, so we need a new storage + // We want to export the metrics memory, so we need a new storage std::vector meta_data(car.metadata_bytes()); std::vector value_data(car.value_bytes()); - /// Copy the memory into the new storage + // Copy the memory into the new storage std::memcpy(meta_data.data(), car.metadata_data(), car.metadata_bytes()); std::memcpy(value_data.data(), car.value_data(), car.value_bytes()); abacus::view car_view; - car_view.set_meta_data(meta_data.data(), meta_data.size()); - bool success = - car_view.set_value_data(value_data.data(), value_data.size()); - (void)success; + auto success = car_view.set_meta_data(meta_data.data(), meta_data.size()); + assert(success); + success = car_view.set_value_data(value_data.data(), value_data.size()); assert(success); + (void)success; std::cout << abacus::to_json(car_view) << std::endl; diff --git a/src/abacus/availability.hpp b/src/abacus/availability.hpp index 288a0c81..a1a6bf53 100644 --- a/src/abacus/availability.hpp +++ b/src/abacus/availability.hpp @@ -13,24 +13,36 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { - +/// A tag type representing a required availability. struct required_ { }; + +/// A constant instance of the required_ tag type. static const required_ required; +/// A tag type representing an optional availability. struct optional_ { }; + +/// A constant instance of the optional_ tag type. static const optional_ optional; +/// A variant type that can hold either a required_ or an optional_. using availability = std::variant; +/// Check if the given availability is optional. +/// @param a The availability to check. +/// @return true if the availability is optional, false otherwise. static inline bool is_optional(const availability& a) { return std::holds_alternative(a); } +/// Check if the given availability is required. +/// @param a The availability to check. +/// @return true if the availability is required, false otherwise. static inline bool is_required(const availability& a) { return std::holds_alternative(a); diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index fd029baa..178054ac 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -12,9 +12,9 @@ #include "availability.hpp" #include "description.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "kind.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" namespace abacus { @@ -27,9 +27,9 @@ struct boolean using type = bool; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/optional_metric.hpp b/src/abacus/detail/optional_metric.hpp similarity index 80% rename from src/abacus/optional_metric.hpp rename to src/abacus/detail/optional_metric.hpp index 6dffa8f5..d6fcd41e 100644 --- a/src/abacus/optional_metric.hpp +++ b/src/abacus/detail/optional_metric.hpp @@ -10,14 +10,16 @@ #include #include -#include "detail/has_arithmetic_operators.hpp" +#include "has_arithmetic_operators.hpp" -#include "version.hpp" +#include "../version.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +namespace detail +{ /// An optional metric class for most metrics template struct optional_metric @@ -37,16 +39,6 @@ struct optional_metric m_memory = memory; } - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(value_type) + 1 bytes long. - /// @param value The initial value of the metric - optional_metric(uint8_t* memory, value_type value) : optional_metric(memory) - { - assert(m_memory != nullptr); - set_value(value); - } - /// Check if the metric is initialized /// @return true if the metric is initialized auto is_initialized() const -> bool @@ -151,21 +143,9 @@ struct optional_metric public: /// Enum specializations - /// Constructor for enum8 - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The initial enum value of the metric - template && - std::is_same_v>> - optional_metric(uint8_t* memory, T value) : - optional_metric(memory, static_cast(value)) - { - static_assert( - sizeof(std::underlying_type_t) == sizeof(value_type), - "The underlying type of the enum must match the value_type"); - } - + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value template && std::is_same_v>> @@ -195,3 +175,4 @@ struct optional_metric }; } } +} diff --git a/src/abacus/required_metric.hpp b/src/abacus/detail/required_metric.hpp similarity index 95% rename from src/abacus/required_metric.hpp rename to src/abacus/detail/required_metric.hpp index bde70451..1e2bdee1 100644 --- a/src/abacus/required_metric.hpp +++ b/src/abacus/detail/required_metric.hpp @@ -10,13 +10,15 @@ #include #include -#include "detail/has_arithmetic_operators.hpp" -#include "version.hpp" +#include "../version.hpp" +#include "has_arithmetic_operators.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +namespace detail +{ /// A required_metric class for most metrics template struct required_metric @@ -139,6 +141,9 @@ struct required_metric "The underlying type of the enum must match the value_type"); } + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value template && std::is_same_v>> @@ -169,3 +174,4 @@ struct required_metric } } +} diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index b6733495..c9c328a7 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -13,8 +13,8 @@ #include "availability.hpp" #include "description.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "unit.hpp" namespace abacus @@ -28,10 +28,10 @@ struct enum8 using type = uint8_t; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory @@ -67,6 +67,22 @@ struct enum8 assert(memory[0] == 1); return memory[1]; } + + /// Get the enumeration value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The enumeration value of the metric + template + static inline auto value(const uint8_t* memory) -> T + { + static_assert(std::is_enum_v, "T must be an enum"); + static_assert(sizeof(std::underlying_type_t) == sizeof(type), + "The underlying type of the enum must match the type"); + assert(memory != nullptr); + assert(memory[0] == 1); + return (T)memory[1]; + } + /// The enumeration value type struct value_info { diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 8edd73b5..e206c179 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -9,11 +9,11 @@ #include "availability.hpp" #include "description.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -27,10 +27,10 @@ struct float32 using type = float; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index f939e41e..119dc4fc 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -25,10 +25,10 @@ struct float64 using type = double; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 8835c26d..d47dbf4b 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -25,10 +25,10 @@ struct int32 using type = int32_t; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 9b818286..a65d497c 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -25,10 +25,10 @@ struct int64 using type = int64_t; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index 36fe2c60..9202a95e 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -12,26 +12,40 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +/// Tag type representing a gauge kind. struct gauge_ { static constexpr protobuf::Kind value = protobuf::Kind::GAUGE; }; + +/// Constant instance of the gauge_ tag type. static const gauge_ gauge; +/// Tag type representing a counter kind. struct counter_ { static constexpr protobuf::Kind value = protobuf::Kind::COUNTER; }; + +/// Constant instance of the counter_ tag type. static const counter_ counter; +/// Tag type representing a constant kind. struct constant_ { static constexpr protobuf::Kind value = protobuf::Kind::CONSTANT; }; + +/// Constant instance of the constant_ tag type. static const constant_ constant; +/// Variant type that can hold either a gauge_, counter_, or constant_. using kind = std::variant; +/// Converts the given kind to its corresponding protobuf::Kind value. +/// @param k The kind to convert. +/// @return The corresponding protobuf::Kind value. +/// @throws std::runtime_error if the kind is unknown. static inline auto to_protobuf(const kind& k) -> protobuf::Kind { if (std::holds_alternative(k)) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index c95d970c..399516b1 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -272,9 +272,7 @@ metrics::metrics(const std::map& info) } template -[[nodiscard]] auto -metrics::initialize_optional(const std::string& name, - std::optional value) -> +[[nodiscard]] auto metrics::initialize_optional(const std::string& name) -> typename Metric::optional { assert(m_initialized.find(name) != m_initialized.end()); @@ -290,44 +288,26 @@ metrics::initialize_optional(const std::string& name, auto offset = proto_metric.offset(); - if (value.has_value()) - { - m_initial_values[name] = value.value(); - return typename Metric::optional( - m_data.data() + m_metadata_bytes + offset, value.value()); - } - else - { - return typename Metric::optional(m_data.data() + m_metadata_bytes + - offset); - } + return typename Metric::optional(m_data.data() + m_metadata_bytes + offset); } // Explicit instantiations for the expected types -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> uint64::optional; -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> int64::optional; -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> uint32::optional; -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> int32::optional; -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> float64::optional; -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> float32::optional; -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> boolean::optional; -template auto metrics::initialize_optional( - const std::string& name, - std::optional value) -> enum8::optional; +template auto metrics::initialize_optional(const std::string& name) + -> uint64::optional; +template auto +metrics::initialize_optional(const std::string& name) -> int64::optional; +template auto metrics::initialize_optional(const std::string& name) + -> uint32::optional; +template auto +metrics::initialize_optional(const std::string& name) -> int32::optional; +template auto metrics::initialize_optional(const std::string& name) + -> float64::optional; +template auto metrics::initialize_optional(const std::string& name) + -> float32::optional; +template auto metrics::initialize_optional(const std::string& name) + -> boolean::optional; +template auto +metrics::initialize_optional(const std::string& name) -> enum8::optional; template [[nodiscard]] auto metrics::initialize_required(const std::string& name, @@ -393,7 +373,6 @@ void metrics::initialize_constant(const std::string& name, auto kind = get_kind(proto_metric); assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); - m_initial_values[name] = value; typename Metric::required(m_data.data() + m_metadata_bytes + offset, value); } @@ -463,47 +442,77 @@ auto metrics::is_initialized() const -> bool } auto metrics::reset() -> void { - for (auto [name, value] : m_initial_values) + for (const auto& [name, metric] : m_metadata.metrics()) { - const protobuf::Metric& metric = m_metadata.metrics().at(name); - auto kind = get_kind(metric); - if (!kind.has_value() || kind.value() == protobuf::Kind::CONSTANT) + if (!is_initialized(name)) { + // Skip metrics that have not been initialized continue; } - auto offset = metric.offset(); - if (metric.has_boolean()) - { - auto v = std::any_cast(value); - } - else if (metric.has_enum8()) - { - auto v = std::any_cast(value); - } - else if (metric.has_float32()) - { - auto v = std::any_cast(value); - } - else if (metric.has_float64()) - { - auto v = std::any_cast(value); - } - else if (metric.has_int32()) - { - auto v = std::any_cast(value); - } - else if (metric.has_int64()) + if (get_kind(metric) == protobuf::Kind::CONSTANT) { - auto v = std::any_cast(value); + // Skip constant metrics + continue; } - else if (metric.has_uint32()) + + auto offset = metric.offset(); + if (metric.optional()) { - auto v = std::any_cast(value); + // Set the has value byte to 0 + m_data[m_metadata_bytes + offset] = 0; } - else if (metric.has_uint64()) + else { - auto v = std::any_cast(value); + // Set the value to what it was initialized to + if (metric.has_uint64()) + { + uint64::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } + else if (metric.has_int64()) + { + int64::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } + else if (metric.has_uint32()) + { + uint32::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } + else if (metric.has_int32()) + { + int32::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } + else if (metric.has_float64()) + { + float64::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } + else if (metric.has_float32()) + { + float32::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } + else if (metric.has_boolean()) + { + boolean::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } + else if (metric.has_enum8()) + { + enum8::set_value( + m_data.data() + m_metadata_bytes + offset, + std::any_cast(m_initial_values.at(name))); + } } } } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 68f29932..4f57e4c0 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -70,9 +70,7 @@ class metrics /// @param value Optional initial value of the metric /// @return The metric object template - [[nodiscard]] auto initialize_optional( - const std::string& name, - std::optional value = std::nullopt) -> + [[nodiscard]] auto initialize_optional(const std::string& name) -> typename Metric::optional; /// Initialize a constant metric diff --git a/src/abacus/name.hpp b/src/abacus/name.hpp index 99d5913f..e145c54c 100644 --- a/src/abacus/name.hpp +++ b/src/abacus/name.hpp @@ -23,12 +23,6 @@ struct name { } - /// @return True if the name is empty otherwise false - bool empty() const - { - return value.empty(); - } - /// The name string std::string value; }; diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index 54719c32..8aefe15f 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -23,10 +23,12 @@ auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, bool minimal) -> std::string { view v; - v.set_meta_data(metadata_data, metadata_bytes); - if (v.set_value_data(value_data, value_bytes)) + if (v.set_meta_data(metadata_data, metadata_bytes)) { - return to_json(v, minimal); + if (v.set_value_data(value_data, value_bytes)) + { + return to_json(v, minimal); + } } return ""; } diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 23f1a744..646afd49 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -25,10 +25,10 @@ struct uint32 using type = uint32_t; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index 5108328b..4c3f811c 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -25,10 +25,10 @@ struct uint64 using type = uint64_t; /// The optional metric type - using optional = optional_metric; + using optional = detail::optional_metric; /// The required metric type - using required = required_metric; + using required = detail::required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 3dfe8984..1f173132 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -11,6 +11,7 @@ #include "float64.hpp" #include "int32.hpp" #include "int64.hpp" +#include "protocol_version.hpp" #include "uint32.hpp" #include "uint64.hpp" @@ -26,8 +27,8 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -void view::set_meta_data(const uint8_t* metadata_data, - std::size_t metadata_bytes) +[[nodiscard]] auto view::set_meta_data(const uint8_t* metadata_data, + std::size_t metadata_bytes) -> bool { assert(metadata_data != nullptr); m_metadata_data = metadata_data; @@ -35,7 +36,18 @@ void view::set_meta_data(const uint8_t* metadata_data, m_value_data = nullptr; m_value_bytes = 0; - m_metadata.ParseFromArray(metadata_data, metadata_bytes); + auto result = m_metadata.ParseFromArray(metadata_data, metadata_bytes); + if (!result) + { + return false; + } + + if (m_metadata.protocol_version() != protocol_version()) + { + return false; + } + + return true; } [[nodiscard]] auto view::set_value_data(const uint8_t* value_data, diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index c9d6fdfd..7ca1f3b4 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -36,8 +36,9 @@ class view /// Sets the meta data pointer /// @param metadata_data The meta data pointer /// @param metadata_bytes The meta data size in bytes - void set_meta_data(const uint8_t* metadata_data, - std::size_t metadata_bytes); + /// @return true if the meta data was unpacked correctly otherwise false + [[nodiscard]] auto set_meta_data(const uint8_t* metadata_data, + std::size_t metadata_bytes) -> bool; /// Sets the value data pointer /// @param value_data The value data pointer diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index e7c0b551..1fac7217 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -371,3 +371,9 @@ TEST(test_metrics, protocol_version) metrics.value_data() + metrics.value_bytes())); } } + +TEST(test_metrics, reset) +{ + ///@todo add test + ASSERT_TRUE(false); +} diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index c97b5fbc..75d6b2b2 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -62,9 +62,10 @@ TEST(test_to_json, to_json_minimal) (void)m3; abacus::view view; - view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); - auto success = - view.set_value_data(metrics.value_data(), metrics.value_bytes()); + bool success = + view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); + ASSERT_TRUE(success); + success = view.set_value_data(metrics.value_data(), metrics.value_bytes()); ASSERT_TRUE(success); auto json_from_view_minimal = abacus::to_json(view, true); @@ -188,9 +189,10 @@ TEST(test_to_json, to_json) (void)m1; abacus::view view; - view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); - auto success = - view.set_value_data(metrics.value_data(), metrics.value_bytes()); + bool success = + view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); + ASSERT_TRUE(success); + success = view.set_value_data(metrics.value_data(), metrics.value_bytes()); ASSERT_TRUE(success); auto json_from_view = abacus::to_json(view); diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 87910765..e599f553 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -60,7 +60,8 @@ TEST(test_view, api) abacus::view view; - view.set_meta_data(meta_data.data(), meta_data.size()); + bool success = view.set_meta_data(meta_data.data(), meta_data.size()); + ASSERT_TRUE(success); EXPECT_EQ(view.metadata().protocol_version(), abacus::protocol_version()); EXPECT_EQ(metrics.metadata().metrics().size(), @@ -69,7 +70,7 @@ TEST(test_view, api) EXPECT_TRUE(google::protobuf::util::MessageDifferencer::Equals( metrics.metadata(), view.metadata())); - auto success = view.set_value_data(value_data.data(), value_data.size()); + success = view.set_value_data(value_data.data(), value_data.size()); ASSERT_TRUE(success); std::optional view_value0 = view.value(name0); From 39873ec6088bd31696a3f79efd4b341bb2ade461 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 22 Jan 2025 15:42:57 +0100 Subject: [PATCH 23/68] work --- test/src/test_metrics.cpp | 287 +++++++++++++++++++++++++++++++++++++- 1 file changed, 285 insertions(+), 2 deletions(-) diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 1fac7217..43a033e8 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -12,6 +12,7 @@ #include #include #include +#include TEST(test_metrics, empty) { @@ -374,6 +375,288 @@ TEST(test_metrics, protocol_version) TEST(test_metrics, reset) { - ///@todo add test - ASSERT_TRUE(false); + // Create one of each metric both required and optional + std::map infos = { + {abacus::name{"uint64_required"}, + abacus::uint64{abacus::counter, abacus::description{""}, + abacus::required}}, + {abacus::name{"uint64_optional"}, + abacus::uint64{abacus::counter, abacus::description{""}, + abacus::optional}}, + {abacus::name{"uint32_required"}, + abacus::uint32{abacus::counter, abacus::description{""}, + abacus::required}}, + {abacus::name{"uint32_optional"}, + abacus::uint32{abacus::counter, abacus::description{""}, + abacus::optional}}, + {abacus::name{"int64_required"}, + abacus::int64{abacus::gauge, abacus::description{""}, + abacus::required}}, + {abacus::name{"int64_optional"}, + abacus::int64{abacus::gauge, abacus::description{""}, + abacus::optional}}, + {abacus::name{"int32_required"}, + abacus::int32{abacus::gauge, abacus::description{""}, + abacus::required}}, + {abacus::name{"int32_optional"}, + abacus::int32{abacus::gauge, abacus::description{""}, + abacus::optional}}, + {abacus::name{"float64_required"}, + abacus::float64{abacus::gauge, abacus::description{""}, + abacus::required}}, + {abacus::name{"float64_optional"}, + abacus::float64{abacus::gauge, abacus::description{""}, + abacus::optional}}, + {abacus::name{"float32_required"}, + abacus::float32{abacus::gauge, abacus::description{""}, + abacus::required}}, + {abacus::name{"float32_optional"}, + abacus::float32{abacus::gauge, abacus::description{""}, + abacus::optional}}, + {abacus::name{"boolean_required"}, + abacus::boolean{abacus::gauge, abacus::description{""}, + abacus::required}}, + {abacus::name{"boolean_optional"}, + abacus::boolean{abacus::gauge, abacus::description{""}, + abacus::optional}}, + {abacus::name{"enum8_required"}, abacus::enum8{abacus::description{""}, + {{0, {"", ""}}}, + abacus::required}}, + {abacus::name{"enum8_optional"}, abacus::enum8{abacus::description{""}, + {{0, {"", ""}}}, + abacus::optional}}, + {abacus::name{"uint64_constant"}, + abacus::uint64{abacus::constant, abacus::description{""}, + abacus::required}}, + {abacus::name{"uint32_constant"}, + abacus::uint32{abacus::constant, abacus::description{""}, + abacus::required}}, + {abacus::name{"int64_constant"}, + abacus::int64{abacus::constant, abacus::description{""}, + abacus::required}}, + {abacus::name{"int32_constant"}, + abacus::int32{abacus::constant, abacus::description{""}, + abacus::required}}, + {abacus::name{"float64_constant"}, + abacus::float64{abacus::constant, abacus::description{""}, + abacus::required}}, + {abacus::name{"float32_constant"}, + abacus::float32{abacus::constant, abacus::description{""}, + abacus::required}}, + {abacus::name{"boolean_constant"}, + abacus::boolean{abacus::constant, abacus::description{""}, + abacus::required}}, + + // Finally a metric that we do not initialize + {abacus::name{"not_initialized_required"}, + abacus::uint64{abacus::counter, abacus::description{""}, + abacus::required}}, + {abacus::name{"not_initialized_optional"}, + abacus::uint64{abacus::counter, abacus::description{""}, + abacus::optional}}}; + + abacus::metrics metrics(infos); + + // Inirialize metrics + auto uint64_required = + metrics.initialize_required("uint64_required", 1U); + auto uint64_optional = + metrics.initialize_optional("uint64_optional"); + auto uint32_required = + metrics.initialize_required("uint32_required", 2U); + auto uint32_optional = + metrics.initialize_optional("uint32_optional"); + auto int64_required = + metrics.initialize_required("int64_required", 3); + auto int64_optional = + metrics.initialize_optional("int64_optional"); + auto int32_required = + metrics.initialize_required("int32_required", 4); + auto int32_optional = + metrics.initialize_optional("int32_optional"); + auto float64_required = + metrics.initialize_required("float64_required", 5.0); + auto float64_optional = + metrics.initialize_optional("float64_optional"); + auto float32_required = + metrics.initialize_required("float32_required", 6.0); + auto float32_optional = + metrics.initialize_optional("float32_optional"); + auto boolean_required = + metrics.initialize_required("boolean_required", true); + auto boolean_optional = + metrics.initialize_optional("boolean_optional"); + auto enum8_required = + metrics.initialize_required("enum8_required", 0U); + auto enum8_optional = + metrics.initialize_optional("enum8_optional"); + + // Initialize constant metrics + metrics.initialize_constant("uint64_constant", 1111U); + metrics.initialize_constant("uint32_constant", 2222U); + metrics.initialize_constant("int64_constant", 3333); + metrics.initialize_constant("int32_constant", 4444); + metrics.initialize_constant("float64_constant", 5555.0); + metrics.initialize_constant("float32_constant", 6666.0); + metrics.initialize_constant("boolean_constant", true); + + // Check all required values + EXPECT_EQ(uint64_required.value(), 1U); + EXPECT_EQ(uint32_required.value(), 2U); + EXPECT_EQ(int64_required.value(), 3); + EXPECT_EQ(int32_required.value(), 4); + EXPECT_EQ(float64_required.value(), 5.0); + EXPECT_EQ(float32_required.value(), 6.0); + EXPECT_EQ(boolean_required.value(), true); + EXPECT_EQ(enum8_required.value(), 0U); + + // Check all optional values returns false for has_value + EXPECT_FALSE(uint64_optional.has_value()); + EXPECT_FALSE(uint32_optional.has_value()); + EXPECT_FALSE(int64_optional.has_value()); + EXPECT_FALSE(int32_optional.has_value()); + EXPECT_FALSE(float64_optional.has_value()); + EXPECT_FALSE(float32_optional.has_value()); + EXPECT_FALSE(boolean_optional.has_value()); + EXPECT_FALSE(enum8_optional.has_value()); + + // Set all optional values to some value + uint64_optional = 11U; + uint32_optional = 22U; + int64_optional = 33; + int32_optional = 44; + float64_optional = 55.0; + float32_optional = 66.0; + boolean_optional = false; + enum8_optional = 1U; + + // Check all optional values + EXPECT_EQ(uint64_optional.value(), 11U); + EXPECT_EQ(uint32_optional.value(), 22U); + EXPECT_EQ(int64_optional.value(), 33); + EXPECT_EQ(int32_optional.value(), 44); + EXPECT_EQ(float64_optional.value(), 55.0); + EXPECT_EQ(float32_optional.value(), 66.0); + EXPECT_EQ(boolean_optional.value(), false); + EXPECT_EQ(enum8_optional.value(), 1U); + + // Change and check all required values + uint64_required = 111U; + uint32_required = 222U; + int64_required = 333; + int32_required = 444; + float64_required = 555.0; + float32_required = 666.0; + boolean_required = false; + enum8_required = 2; + + EXPECT_EQ(uint64_required.value(), 111U); + EXPECT_EQ(uint32_required.value(), 222U); + EXPECT_EQ(int64_required.value(), 333); + EXPECT_EQ(int32_required.value(), 444); + EXPECT_EQ(float64_required.value(), 555.0); + EXPECT_EQ(float32_required.value(), 666.0); + EXPECT_EQ(boolean_required.value(), false); + EXPECT_EQ(enum8_required.value(), 2U); + + // Create a view to see the constants + abacus::view view; + ASSERT_TRUE( + view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes())); + ASSERT_TRUE( + view.set_value_data(metrics.value_data(), metrics.value_bytes())); + + // Check all constant values + EXPECT_EQ(view.value("uint64_constant").value(), 1111U); + EXPECT_EQ(view.value("uint32_constant").value(), 2222U); + EXPECT_EQ(view.value("int64_constant").value(), 3333); + EXPECT_EQ(view.value("int32_constant").value(), 4444); + EXPECT_EQ(view.value("float64_constant").value(), 5555.0); + EXPECT_EQ(view.value("float32_constant").value(), 6666.0); + EXPECT_EQ(view.value("boolean_constant").value(), true); + + // While we are at it, let's check the other values as well + EXPECT_EQ(view.value("uint64_required").value(), 111U); + EXPECT_EQ(view.value("uint32_required").value(), 222U); + EXPECT_EQ(view.value("int64_required").value(), 333); + EXPECT_EQ(view.value("int32_required").value(), 444); + EXPECT_EQ(view.value("float64_required").value(), 555.0); + EXPECT_EQ(view.value("float32_required").value(), 666.0); + EXPECT_EQ(view.value("boolean_required").value(), false); + EXPECT_EQ(view.value("enum8_required").value(), 2U); + + EXPECT_EQ(view.value("uint64_optional").value(), 11U); + EXPECT_EQ(view.value("uint32_optional").value(), 22U); + EXPECT_EQ(view.value("int64_optional").value(), 33); + EXPECT_EQ(view.value("int32_optional").value(), 44); + EXPECT_EQ(view.value("float64_optional").value(), 55.0); + EXPECT_EQ(view.value("float32_optional").value(), 66.0); + EXPECT_EQ(view.value("boolean_optional").value(), false); + EXPECT_EQ(view.value("enum8_optional").value(), 1U); + + // And finally the not initialized value + EXPECT_FALSE( + view.value("not_initialized_required").has_value()); + EXPECT_FALSE( + view.value("not_initialized_optional").has_value()); + + // Reset all values + metrics.reset(); + + // Check all required values + EXPECT_EQ(uint64_required.value(), 1U); + EXPECT_EQ(uint32_required.value(), 2U); + EXPECT_EQ(int64_required.value(), 3); + EXPECT_EQ(int32_required.value(), 4); + EXPECT_EQ(float64_required.value(), 5.0); + EXPECT_EQ(float32_required.value(), 6.0); + EXPECT_EQ(boolean_required.value(), true); + EXPECT_EQ(enum8_required.value(), 0U); + + // Check all optional values returns false for has_value + EXPECT_FALSE(uint64_optional.has_value()); + EXPECT_FALSE(uint32_optional.has_value()); + EXPECT_FALSE(int64_optional.has_value()); + EXPECT_FALSE(int32_optional.has_value()); + EXPECT_FALSE(float64_optional.has_value()); + EXPECT_FALSE(float32_optional.has_value()); + EXPECT_FALSE(boolean_optional.has_value()); + EXPECT_FALSE(enum8_optional.has_value()); + + // Update view and check all constant values + ASSERT_TRUE( + view.set_value_data(metrics.value_data(), metrics.value_bytes())); + + // Check all constant values + EXPECT_EQ(view.value("uint64_constant"), 1111U); + EXPECT_EQ(view.value("uint32_constant"), 2222U); + EXPECT_EQ(view.value("int64_constant"), 3333); + EXPECT_EQ(view.value("int32_constant"), 4444); + EXPECT_EQ(view.value("float64_constant"), 5555.0); + EXPECT_EQ(view.value("float32_constant"), 6666.0); + EXPECT_EQ(view.value("boolean_constant"), true); + EXPECT_EQ(view.value("enum8_constant"), 42U); + + EXPECT_EQ(view.value("uint64_required").value(), 1U); + EXPECT_EQ(view.value("uint32_required").value(), 2U); + EXPECT_EQ(view.value("int64_required").value(), 3); + EXPECT_EQ(view.value("int32_required").value(), 4); + EXPECT_EQ(view.value("float64_required").value(), 5.0); + EXPECT_EQ(view.value("float32_required").value(), 6.0); + EXPECT_EQ(view.value("boolean_required").value(), true); + EXPECT_EQ(view.value("enum8_required").value(), 0U); + + EXPECT_FALSE(view.value("uint64_optional").has_value()); + EXPECT_FALSE(view.value("uint32_optional").has_value()); + EXPECT_FALSE(view.value("int64_optional").has_value()); + EXPECT_FALSE(view.value("int32_optional").has_value()); + EXPECT_FALSE(view.value("float64_optional").has_value()); + EXPECT_FALSE(view.value("float32_optional").has_value()); + EXPECT_FALSE(view.value("boolean_optional").has_value()); + EXPECT_FALSE(view.value("enum8_optional").has_value()); + + EXPECT_FALSE( + view.value("not_initialized_required").has_value()); + EXPECT_FALSE( + view.value("not_initialized_optional").has_value()); } From 42e97201f80f23b37b10fcd92d77c270feae422b Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 22 Jan 2025 20:28:02 +0100 Subject: [PATCH 24/68] work --- src/abacus/view.cpp | 1 + test/abacus_tests.cpp | 12 ++++++- test/src/test_metric.cpp | 74 +++++++++++++++++++-------------------- test/src/test_metrics.cpp | 1 - 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 1f173132..3a14a700 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -106,6 +106,7 @@ auto view::metadata() const -> const protobuf::MetricsMetadata& const protobuf::Metric& view::metric(const std::string& name) const { + assert(m_metadata.metrics().count(name) != 0); return m_metadata.metrics().at(name); } diff --git a/test/abacus_tests.cpp b/test/abacus_tests.cpp index 444ad72c..abb547f9 100644 --- a/test/abacus_tests.cpp +++ b/test/abacus_tests.cpp @@ -6,12 +6,22 @@ #include #include +#include #include GTEST_API_ int main(int argc, char** argv) { + // Verify that the version of the library that we linked against is + // compatible with the version of the headers we compiled against. + GOOGLE_PROTOBUF_VERIFY_VERSION; + srand(static_cast(time(0))); testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + auto result = RUN_ALL_TESTS(); + + // Delete all global objects allocated by libprotobuf. + google::protobuf::ShutdownProtobufLibrary(); + + return result; } diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index a6d04a78..a5ede2b1 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -24,44 +24,44 @@ TEST(test_metric, constructor) EXPECT_EQ(uint_metric.value(), 42U); } -TEST(test_metric, float_assignment) -{ - uint8_t data[9]; - std::memset(data, 0, sizeof(data)); +// TEST(test_metric, float_assignment) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); - abacus::float64::optional double_metric(data); - EXPECT_TRUE(double_metric.is_initialized()); - EXPECT_FALSE(double_metric.has_value()); - double_metric = 1123.12; - EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); +// abacus::float64::optional double_metric(data); +// EXPECT_TRUE(double_metric.is_initialized()); +// EXPECT_FALSE(double_metric.has_value()); +// double_metric = 1123.12; +// EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); - // Assignment - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric = 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric = 1 / -0.0, ""); +// // Assignment +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / -0.0, ""); - // Add and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric += 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric += 1 / -0.0, ""); +// // Add and Assign +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric += 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric += 1 / -0.0, ""); - // Subtract and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / -0.0, ""); -} +// // Subtract and Assign +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +// } diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 43a033e8..6fb70e29 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -635,7 +635,6 @@ TEST(test_metrics, reset) EXPECT_EQ(view.value("float64_constant"), 5555.0); EXPECT_EQ(view.value("float32_constant"), 6666.0); EXPECT_EQ(view.value("boolean_constant"), true); - EXPECT_EQ(view.value("enum8_constant"), 42U); EXPECT_EQ(view.value("uint64_required").value(), 1U); EXPECT_EQ(view.value("uint32_required").value(), 2U); From f7f846aa0f33e52795a15de436ae234aa72efe3b Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Thu, 23 Jan 2025 11:35:43 +0100 Subject: [PATCH 25/68] fix memory leak --- lock_version_resolve.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lock_version_resolve.json b/lock_version_resolve.json index e236941d..fa4667d4 100644 --- a/lock_version_resolve.json +++ b/lock_version_resolve.json @@ -1,7 +1,7 @@ { "bourne": { - "commit_id": "97a913859ef89817f97ab5fb59d82989319cd33f", - "resolver_info": "10.0.1", + "commit_id": "1288fa220b92e6910d9e09643b92ccf8f7f99b4e", + "resolver_info": "10.1.0", "sha1": "9c4ea9c707dda31fbd3e0c7b326ab97263e06ca3" }, "endian": { From 8d9034c417aa4fd224213471a3985d6db43cf866 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 24 Jan 2025 13:59:18 +0100 Subject: [PATCH 26/68] Value data in protobuf (#43) --- .github/workflows/clang-format.yml | 21 +- .github/workflows/cppcheck.yml | 14 +- .github/workflows/linux_cmake.yml | 75 +++- .github/workflows/linux_mkspecs.yml | 63 ++- .github/workflows/macos_cmake.yml | 41 +- .github/workflows/macos_mkspecs.yml | 38 +- .github/workflows/nodebug.yml | 22 -- .github/workflows/raspberry_pi.yml | 72 +++- .github/workflows/valgrind.yml | 33 +- .github/workflows/windows_cmake.yml | 32 +- .github/workflows/windows_mkspecs.yml | 26 +- NEWS.rst | 1 + benchmark/main.cpp | 1 + examples/metrics_simple.cpp | 5 +- protobuf/metrics.proto | 19 +- src/abacus/enum8.hpp | 3 + src/abacus/metrics.cpp | 131 +++---- src/abacus/metrics.hpp | 41 +- src/abacus/protobuf/metrics.pb.cc | 525 +++++++++++++++++++------ src/abacus/protobuf/metrics.pb.h | 527 ++++++++++++++++++++++---- src/abacus/to_json.cpp | 13 +- src/abacus/to_json.hpp | 14 +- src/abacus/view.cpp | 40 +- src/abacus/view.hpp | 40 +- test/src/test_metrics.cpp | 39 +- test/src/test_to_json.cpp | 22 +- test/src/test_view.cpp | 15 +- 27 files changed, 1426 insertions(+), 447 deletions(-) delete mode 100644 .github/workflows/nodebug.yml diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 42ad4f27..008d301d 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,19 +1,30 @@ name: Clang-Format -'on': +"on": workflow_dispatch: inputs: extra_resolve_options: description: Extra Resolve Options required: false schedule: - - cron: 0 1 * * * + - cron: 0 1 * * * push: branches: - - master + - master pull_request: jobs: - Clang-Format: - uses: steinwurf/clang-format-action/.github/workflows/action.yml@4.0.0 + clang-format: + timeout-minutes: 45 + name: Clang-Format + runs-on: [self-hosted, vm, ubuntu-current] + steps: + - name: Ensure correct owner of repository + run: sudo chown -R actions-runner:actions-runner . + - name: Clang format version + run: clang-format --version + - name: Checkout source code + uses: actions/checkout@v3 + - name: Run Clang-format + run: find ./ -iname *.hpp -o -iname *.cpp -o -iname *.c -o -iname *.h | xargs clang-format --dry-run --Werror concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index c214fc7d..2cc1a1c5 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -10,10 +10,20 @@ name: Cppcheck push: branches: - master + pull_request: jobs: - docker_check: + cpp_check: + runs-on: [self-hosted, vm, ubuntu-current] name: Cppcheck - uses: steinwurf/cppcheck-action/.github/workflows/action.yml@2.0.0 + steps: + - name: Ensure correct owner of repository + run: sudo chown -R actions-runner:actions-runner . + - name: Checkout + uses: actions/checkout@v3 + - name: Get Compile Commands + run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSTEINWURF_RESOLVE_OPTIONS="--git_protocol=git@" -B cmake_build + - name: Cppcheck + run: cppcheck --project=cmake_build/compile_commands.json -j$(nproc) -i resolve_symlinks/ -i test -i cmake_build/_deps --suppress=unknownMacro --suppress="preprocessorErrorDirective" concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/linux_cmake.yml b/.github/workflows/linux_cmake.yml index 9c8f7b76..f1834d81 100644 --- a/.github/workflows/linux_cmake.yml +++ b/.github/workflows/linux_cmake.yml @@ -2,6 +2,11 @@ name: Linux Cmake 'on': workflow_dispatch: inputs: + preparation_commands: + description: "Commands to run to prepare the build" + required: false + type: string + default: '' extra_resolve_options: description: Extra Resolve Options required: false @@ -14,11 +19,71 @@ name: Linux Cmake env: EXTRA_RESOLVE_OPTIONS: ${{ github.event.inputs.extra_resolve_options }} jobs: - Linux-cmake: - name: Linux Cmake - uses: steinwurf/linux-cmake-action/.github/workflows/action.yml@5.0.0 - with: - extra_resolve_options: $EXTRA_RESOLVE_OPTIONS + docker_builds: + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + config: + - name: Cmake (GCC) Latest + cxx: g++ + cc: gcc + cxxflags: '' + env: + - name: Cmake (Clang) Latest + cxx: clang++ + cc: clang + cxxflags: '' + env: + - name: Clang Address Sanitizer Latest + cxx: clang++ + cc: clang + cxxflags: '-fsanitize=address -fno-omit-frame-pointer -g' + env: + runner: ubuntu-current + - name: Clang Thread Sanitizer Latest + CXX: clang++ + cc: clang + cxxflags: '-fsanitize=thread -fPIE -g' + env: TSAN_OPTIONS="suppressions=../tsan_suppression.txt" + runner: ubuntu-current + - name: Clang Undefined Sanitizer Latest + CXX: clang++ + cc: clang + cxxflags: '-fsanitize=undefined -g' + env: UBSAN_OPTIONS="abort_on_error=1:print_stacktrace=1" + runner: ubuntu-current + runs-on: + - self-hosted + - vm + - ubuntu-current + name: ${{ matrix.config.name }} + steps: + - name: Ensure correct owner of repository + run: sudo chown -R actions-runner:actions-runner . + - name: Checkout + uses: actions/checkout@v4 + - name: Preparation Commands + if: inputs.preparation_commands != '' + run: ${{ inputs.preparation_commands }} + - name: CMake Cleanup + run: cmake -E remove_directory build + - name: CMake Setup + run: cmake -E make_directory build + - name: CMake Configure + uses: nick-fields/retry@v3 + env: + GIT_SSH_COMMAND: "${{ 'ssh -i /opt/actions-runner/.ssh/id_25519 -o IdentitiesOnly=yes' }}" + with: + max_attempts: 3 + timeout_minutes: 15 + command: cd build && cmake ../ -DSTEINWURF_RESOLVE_OPTIONS="--git_protocol=git@ $EXTRA_RESOLVE_OPTIONS" -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_FLAGS="${{ matrix.config.cxxflags }}" -GNinja + - name: CMake Build + working-directory: ${{github.workspace}}/build + run: cmake --build . -j$(( ( $(nproc) + 1 ) / 2 )) --config Debug + - name: Run Tests + working-directory: ${{github.workspace}}/build + run: ${{ matrix.config.env }} ./abacus_tests concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/linux_mkspecs.yml b/.github/workflows/linux_mkspecs.yml index 7c9d4abb..006a9bb1 100644 --- a/.github/workflows/linux_mkspecs.yml +++ b/.github/workflows/linux_mkspecs.yml @@ -1,21 +1,70 @@ name: Linux C++ make-specs -'on': +"on": workflow_dispatch: inputs: extra_resolve_options: description: Extra Resolve Options required: false schedule: - - cron: 0 1 * * * + - cron: 0 1 * * * push: branches: - - master + - master pull_request: jobs: - Linux-mkspecs: - uses: steinwurf/linux-mkspecs-action/.github/workflows/action.yml@7.0.0 - with: - extra_resolve_options: ${{ github.event.inputs.extra_resolve_options }} + docker_builds: + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + config: + - CXX: g++ + name: GCC Latest + cxxflags: + env: + runner: ubuntu-current + - name: Clang Latest + CXX: clang++ + cxxflags: + env: + runner: ubuntu-current + - name: GCC Old + CXX: g++ + cxxflags: + env: + runner: ubuntu-old + - name: Clang Old + CXX: clang++ + cxxflags: + env: + runner: ubuntu-old + runs-on: + - self-hosted + - vm + - ${{ matrix.config.runner }} + name: ${{ matrix.config.name }} + steps: + - name: Ensure correct owner of repository + run: sudo chown -R actions-runner:actions-runner . + - name: Checkout source code + uses: actions/checkout@v4 + - name: Waf Configure + env: + GIT_SSH_COMMAND: "${{ 'ssh -i /opt/actions-runner/.ssh/id_25519 -o IdentitiesOnly=yes' }}" + EXTRA_RESOLVE_OPTIONS: ${{ inputs.extra_resolve_options }} + CXX: ${{ matrix.config.CXX }} + CXXFLAGS: ${{ matrix.config.cxxflags }} + uses: nick-fields/retry@v3 + with: + max_attempts: 3 + timeout_minutes: 15 + command: python3 waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} --ninja + - name: Waf Build + run: | + echo "::add-matcher::.github/gcc-problem-matcher.json" + python3 waf + - name: Waf Test + run: ${{ matrix.config.env }} ./build_current/abacus_tests concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/macos_cmake.yml b/.github/workflows/macos_cmake.yml index d4eb7c19..6d799494 100644 --- a/.github/workflows/macos_cmake.yml +++ b/.github/workflows/macos_cmake.yml @@ -14,11 +14,42 @@ name: MacOS Cmake env: EXTRA_RESOLVE_OPTIONS: ${{ github.event.inputs.extra_resolve_options }} jobs: - MacOS-cmake: - name: MacOS Cmake - uses: steinwurf/macos-cmake-action/.github/workflows/action.yml@7.0.0 - with: - extra_resolve_options: $EXTRA_RESOLVE_OPTIONS + macos_cmake: + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + config: + - arch: ARM64 + name: Apple (ARM) + + runs-on: [self-hosted, macOS, "${{ matrix.config.arch }}", cmake, builder] + name: ${{ matrix.config.name }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: CMake & Clang versions + run: | + cmake --version + clang --version + - name: CMake Cleanup + run: cmake -E remove_directory ${{github.workspace}}/build + - name: CMake Setup + run: cmake -E make_directory ${{github.workspace}}/build + - name: CMake Configure + env: + GIT_SSH_COMMAND: "${{ 'ssh -i /home/buildbot/.ssh/id_ed25519 -o IdentitiesOnly=yes' }}" + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 15 + command: cd build && cmake ${{github.workspace}} -DSTEINWURF_RESOLVE_OPTIONS="--git_protocol=git@ $EXTRA_RESOLVE_OPTIONS" + - name: CMake Build + working-directory: ${{github.workspace}}/build + run: cmake --build . -j$(( (`sysctl -n hw.physicalcpu` - 1) / 2 )) + - name: CTest + working-directory: ${{github.workspace}}/build + run: ctest -V concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/macos_mkspecs.yml b/.github/workflows/macos_mkspecs.yml index 44fb1dfe..d3d19175 100644 --- a/.github/workflows/macos_mkspecs.yml +++ b/.github/workflows/macos_mkspecs.yml @@ -1,21 +1,47 @@ name: MacOS C++ make-specs -'on': +"on": workflow_dispatch: inputs: extra_resolve_options: description: Extra Resolve Options required: false schedule: - - cron: 0 1 * * * + - cron: 0 1 * * * push: branches: - - master + - master pull_request: jobs: MacOS-mkspecs: - uses: steinwurf/macos-mkspecs-action/.github/workflows/action.yml@7.0.0 - with: - extra_resolve_options: ${{ github.event.inputs.extra_resolve_options }} + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + config: + - arch: ARM64 + name: Apple (ARM) + runs-on: [self-hosted, macOS, "${{ matrix.config.arch }}", builder] + name: ${{ matrix.config.name }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Clang Version + run: clang --version + - name: Configure + env: + GIT_SSH_COMMAND: "ssh" + EXTRA_RESOLVE_OPTIONS: ${{ inputs.extra_resolve_options }} + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 15 + command: python3 waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} + - name: Build + run: | + echo "::add-matcher::.github/gcc-problem-matcher.json" + python3 waf + - name: Test + run: ./build_current/abacus_tests concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/nodebug.yml b/.github/workflows/nodebug.yml deleted file mode 100644 index 5b876c33..00000000 --- a/.github/workflows/nodebug.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: No Assertions -'on': - workflow_dispatch: - inputs: - extra_resolve_options: - description: Extra Resolve Options - required: false - schedule: - - cron: 0 1 * * * - push: - branches: - - master - pull_request: -jobs: - ndebug: - name: No Assertions - uses: steinwurf/nodebug-action/.github/workflows/action.yml@8.0.0 - with: - extra_resolve_options: ${{ github.event.inputs.extra_resolve_options }} -concurrency: - group: ${{ github.workflow }}-${{ github.ref || github.run_id }} - cancel-in-progress: true diff --git a/.github/workflows/raspberry_pi.yml b/.github/workflows/raspberry_pi.yml index b8d27a09..111e9dc9 100644 --- a/.github/workflows/raspberry_pi.yml +++ b/.github/workflows/raspberry_pi.yml @@ -1,5 +1,5 @@ -name: Raspberry Pi -'on': +name: Aarch64 Linux Musl +on: workflow_dispatch: inputs: extra_resolve_options: @@ -12,16 +12,64 @@ name: Raspberry Pi - master pull_request: jobs: - RaspberryPi: - uses: steinwurf/cross-compile-action/.github/workflows/action.yml@6.0.0 - with: - extra_resolve_options: ${{ github.event.inputs.extra_resolve_options }} - name: Raspberry Pi - cxx_mkspec: cxx_raspberry_gxx83_armv7 - image: ghcr.io/steinwurf/gcc-8.3.0-raspberrypi-armv7:1.0.0 - test_runner: raspberry_pi - test_binary_name: abacus_tests - test_binary_directory: build/cxx_raspberry_gxx83_armv7 + cross-compile: + timeout-minutes: 45 + strategy: + fail-fast: false + runs-on: [self-hosted, vm, ubuntu-current] + name: Raspberry Pi Cross-compile + steps: + - name: Ensure correct owner of repository + run: sudo chown -R actions-runner:actions-runner . + - name: Checkout source code + uses: actions/checkout@v4 + - name: Clone toolchains + run: rm -rf ~/toolchains && git clone --depth 1 git@github.com:steinwurf/cmake-toolchains.git ~/toolchains + - name: CMake Cleanup + run: cmake -E remove_directory cmake_build + - name: CMake Configure + uses: nick-fields/retry@v3 + with: + max_attempts: 3 + timeout_minutes: 15 + command: cmake -B cmake_build -DSTEINWURF_RESOLVE_OPTIONS="--git_protocol=git@ $EXTRA_RESOLVE_OPTIONS" -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_BUILD_TYPE=WurfRelease -DCMAKE_TOOLCHAIN_FILE=~/toolchains/zig-toolchain-aarch64-linux-musl.cmake -GNinja + - name: CMake Build + run: cmake --build cmake_build -j$(( ( $(nproc) + 1 ) / 2 )) + - name: Gather Test Binary and Input files + run: | + mkdir artifact + mv cmake_build/abacus_tests ./artifact + - name: Upload Test Binary Artifact + uses: actions/upload-artifact@v4 + with: + name: abacus_tests + path: artifact + retention-days: 1 + tests: + needs: cross-compile + strategy: + fail-fast: false + runs-on: [self-hosted, raspberry_pi_4] + name: Run Tests on Raspberry Pi + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: Download Test Binary Artifact + uses: actions/download-artifact@v4 + with: + name: abacus_tests + - name: List files + run: ls -l + - name: Run all tests + run: chmod +x abacus_tests + - name: Get backtrace on failure if available + run: | + if ! ./abacus_tests; then + echo "Test failed, getting backtrace" + gdb -batch -ex "r" -ex "thread apply all backtrace full" -ex "quit" ./abacus_tests + exit 1 + fi + concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 83c50331..f8ca271d 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -1,22 +1,41 @@ name: Valgrind -'on': +"on": workflow_dispatch: inputs: extra_resolve_options: description: Extra Resolve Options required: false schedule: - - cron: 0 1 * * * + - cron: 0 1 * * * push: branches: - - master + - master pull_request: jobs: valgrind: - name: Valgrind - uses: steinwurf/valgrind-action/.github/workflows/action.yml@5.0.0 - with: - extra_resolve_options: ${{ github.event.inputs.extra_resolve_options }} + timeout-minutes: 45 + name: Valgrind 3.19.0 + runs-on: [self-hosted, vm, ubuntu-current] + steps: + - name: Ensure correct owner of repository + run: sudo chown -R actions-runner:actions-runner . + - name: Checkout + uses: actions/checkout@v3 + - name: Configure + env: + EXTRA_RESOLVE_OPTIONS: ${{ inputs.extra_resolve_options }} + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 15 + command: python3 waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} --ninja + - name: Build + run: | + echo "::add-matcher::.github/gcc-problem-matcher.json" + python3 waf + - name: Valgrind Test + run: valgrind --suppressions=valgrind_suppressions.txt --leak-check=full --error-exitcode=1 build_current/abacus_tests + concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/windows_cmake.yml b/.github/workflows/windows_cmake.yml index 32483082..09e92d65 100644 --- a/.github/workflows/windows_cmake.yml +++ b/.github/workflows/windows_cmake.yml @@ -14,11 +14,33 @@ name: Windows Cmake env: EXTRA_RESOLVE_OPTIONS: ${{ github.event.inputs.extra_resolve_options }} jobs: - Windows-cmake: - name: Windows Cmake - uses: steinwurf/windows-cmake-action/.github/workflows/action.yml@5.0.0 - with: - extra_resolve_options: $EXTRA_RESOLVE_OPTIONS + windows_cmake: + timeout-minutes: 45 + strategy: + fail-fast: false + runs-on: [self-hosted, windows, vm, windows-current] + name: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: CMake Cleanup + run: cmake -E remove_directory ${{github.workspace}}/build + - name: CMake Setup + run: cmake -E make_directory ${{github.workspace}}/build + - name: CMake Configure + env: + GIT_SSH_COMMAND: "${{ 'ssh -i /home/buildbot/.ssh/id_ed25519 -o IdentitiesOnly=yes' }}" + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 15 + command: cd build | cmake ${{github.workspace}} -DSTEINWURF_RESOLVE_OPTIONS="--git_protocol=git@ $EXTRA_RESOLVE_OPTIONS" + - name: CMake Build + working-directory: ${{github.workspace}}/build + run: cmake --build . -j + - name: CTest + working-directory: ${{github.workspace}}/build + run: ctest -V concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/windows_mkspecs.yml b/.github/workflows/windows_mkspecs.yml index 3b2318dd..50ad4ccb 100644 --- a/.github/workflows/windows_mkspecs.yml +++ b/.github/workflows/windows_mkspecs.yml @@ -13,9 +13,29 @@ name: Windows C++ make-specs pull_request: jobs: Windows-mkspecs: - uses: steinwurf/windows-mkspecs-action/.github/workflows/action.yml@6.1.0 - with: - extra_resolve_options: ${{ github.event.inputs.extra_resolve_options }} + timeout-minutes: 45 + strategy: + fail-fast: false + runs-on: [self-hosted, windows, vm, windows-current] + name: Windows 11 VM + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Configure + env: + GIT_SSH_COMMAND: "${{ 'ssh -i /home/buildbot/.ssh/id_ed25519 -o IdentitiesOnly=yes' }}" + EXTRA_RESOLVE_OPTIONS: ${{ inputs.extra_resolve_options }} + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 15 + command: python waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} + - name: Build + run: | + echo "::add-matcher::.github/gcc-problem-matcher.json" + python waf + - name: Test + run: ./build_current/abacus_tests.exe concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true diff --git a/NEWS.rst b/NEWS.rst index debdc5ea..32a76f7e 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -13,6 +13,7 @@ Latest * Major: Changed API of how metrics are specified. All attributes are now strongly typed, and specified using a std::map of strings to abacus::info. * Minor: Added support for enums. +* Minor: Added support for more metric types: int32, uint32, float32, and enum8. 6.0.1 ----- diff --git a/benchmark/main.cpp b/benchmark/main.cpp index 7fe5c556..f47753b5 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -26,6 +26,7 @@ std::map create_metric_infos() abacus::required}}, {abacus::name{"6"}, abacus::enum8{ + abacus::gauge, abacus::description{""}, {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}, abacus::required}}}; diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 33bffb60..e12002e6 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -74,16 +74,15 @@ int main() days_until_maintenance = -10; // We want to export the metrics memory, so we need a new storage - std::vector meta_data(car.metadata_bytes()); + auto metadata = car.metadata(); std::vector value_data(car.value_bytes()); // Copy the memory into the new storage - std::memcpy(meta_data.data(), car.metadata_data(), car.metadata_bytes()); std::memcpy(value_data.data(), car.value_data(), car.value_bytes()); abacus::view car_view; - auto success = car_view.set_meta_data(meta_data.data(), meta_data.size()); + auto success = car_view.set_metadata(metadata); assert(success); success = car_view.set_value_data(value_data.data(), value_data.size()); assert(success); diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index a0f7bafe..19c0f04f 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -71,16 +71,16 @@ message BoolMetric { optional string unit = 3; // Unit of measurement } -message EnumValue { - string name = 1; // Enum name - optional string description = 2; // Enum description -} - // Metadata for enumerated metrics message Enum8Metric { + message EnumValue { + string name = 1; // Enum name + optional string description = 2; // Enum description + } string description = 1; // Metric description - optional string unit = 2; // Unit of measurement - map values = 3; // Mapping from packed index to enum info + Kind kind = 2; // Kind of metric + optional string unit = 3; // Unit of measurement + map values = 4; // Mapping from packed index to enum info } message Metric @@ -106,3 +106,8 @@ message MetricsMetadata { fixed32 sync_value = 3; // Synchronization value map metrics = 4; // Mapping from metric name to metadata } + +message Metrics { + optional MetricsMetadata metadata = 1; // Metadata for all metrics + bytes values = 2; // Packed memory for all metrics +} diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index c9c328a7..f9a74f1c 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -93,6 +93,9 @@ struct enum8 std::string description; }; + /// The metric kind + abacus::kind kind; + /// The metric description abacus::description description; diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 399516b1..49b88a8e 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -21,9 +21,9 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -static inline auto -get_kind(const protobuf::Metric& metric) -> std::optional +static inline auto get_kind(const protobuf::Metric& metric) -> protobuf::Kind { + assert(metric.type_case() != protobuf::Metric::TYPE_NOT_SET); switch (metric.type_case()) { case protobuf::Metric::kUint64: @@ -41,32 +41,33 @@ get_kind(const protobuf::Metric& metric) -> std::optional case protobuf::Metric::kBoolean: return metric.boolean().kind(); case protobuf::Metric::kEnum8: + return metric.enum8().kind(); default: - return std::nullopt; + // This should never be reached + assert(false); + return protobuf::Kind::CONSTANT; } } metrics::metrics(metrics&& other) noexcept : - m_data(std::move(other.m_data)), m_metadata(std::move(other.m_metadata)), - m_hash(other.m_hash), m_metadata_bytes(other.m_metadata_bytes), + m_proto_metrics(std::move(other.m_proto_metrics)), m_hash(other.m_hash), m_value_bytes(other.m_value_bytes), m_initialized(std::move(other.m_initialized)) { - other.m_data = std::vector(); - other.m_metadata = protobuf::MetricsMetadata(); + other.m_proto_metrics = protobuf::Metrics(); other.m_hash = 0; - other.m_metadata_bytes = 0; other.m_value_bytes = 0; other.m_initialized.clear(); } metrics::metrics(const std::map& info) { - m_metadata = protobuf::MetricsMetadata(); - m_metadata.set_protocol_version(protocol_version()); - m_metadata.set_endianness(endian::is_big_endian() - ? protobuf::Endianness::BIG - : protobuf::Endianness::LITTLE); + m_proto_metrics = protobuf::Metrics(); + m_proto_metrics.mutable_metadata()->set_protocol_version( + protocol_version()); + m_proto_metrics.mutable_metadata()->set_endianness( + endian::is_big_endian() ? protobuf::Endianness::BIG + : protobuf::Endianness::LITTLE); // The first byte is reserved for the sync value m_value_bytes = sizeof(uint32_t); @@ -87,7 +88,7 @@ metrics::metrics(const std::map& info) metric.set_optional(is_optional(m->availability)); metric.mutable_uint64()->set_description(m->description.value); - metric.mutable_uint64()->set_kind(to_protobuf(m->kind)); + metric.mutable_uint64()->set_kind(abacus::to_protobuf(m->kind)); if (!m->unit.empty()) { metric.mutable_uint64()->set_unit(m->unit.value); @@ -222,9 +223,10 @@ metrics::metrics(const std::map& info) metric.set_optional(is_optional(m->availability)); metric.mutable_enum8()->set_description(m->description.value); + metric.mutable_enum8()->set_kind(abacus::to_protobuf(m->kind)); for (auto [key, value] : m->values) { - auto enum_value = protobuf::EnumValue(); + auto enum_value = protobuf::Enum8Metric::EnumValue(); enum_value.set_name(value.name); if (!value.description.empty()) { @@ -236,39 +238,43 @@ metrics::metrics(const std::map& info) } } - m_metadata.mutable_metrics()->insert({name.value, metric}); + m_proto_metrics.mutable_metadata()->mutable_metrics()->insert( + {name.value, metric}); m_initialized[name.value] = false; } // Set the sync value to 1 so that the size of the metadata is // calculated correctly - m_metadata.set_sync_value(1); + m_proto_metrics.mutable_metadata()->set_sync_value(1); - m_metadata_bytes = m_metadata.ByteSizeLong(); - m_data.reserve(m_metadata_bytes + m_value_bytes); - m_data.resize(m_metadata_bytes); + auto metadata_bytes = metadata().ByteSizeLong(); + + std::vector data(metadata_bytes); // Serialize the metadata - m_metadata.SerializeToArray(m_data.data(), m_data.size()); + metadata().SerializeToArray(data.data(), data.size()); // Calculate the hash of the metadata - m_hash = detail::hash_function(m_data.data(), m_data.size()); + m_hash = detail::hash_function(data.data(), data.size()); // Update the sync value - m_metadata.set_sync_value(m_hash); + m_proto_metrics.mutable_metadata()->set_sync_value(m_hash); - // Serialize the metadata again to include the sync value - m_metadata.SerializeToArray(m_data.data(), m_data.size()); + // // Serialize the metadata again to include the sync value + // metadata().SerializeToArray(data.data(), data.size()); // Make sure the metadata didn't change unexpectedly - assert(m_metadata.ByteSizeLong() == m_metadata_bytes); + assert(metadata().ByteSizeLong() == metadata_bytes); // Write the sync value to the first byte of the value data (this will // be written as the endianess of the system) // Consuming code can use the endianness field in the metadata to // read the sync value - m_data.resize(m_metadata_bytes + m_value_bytes); - std::memcpy(m_data.data() + m_metadata_bytes, &m_hash, sizeof(uint32_t)); + + m_proto_metrics.mutable_values()->resize(m_value_bytes); + + std::memcpy(m_proto_metrics.mutable_values()->data(), &m_hash, + sizeof(uint32_t)); } template @@ -278,17 +284,13 @@ template assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); m_initialized[name] = true; - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + const protobuf::Metric& proto_metric = metadata().metrics().at(name); assert(proto_metric.optional() == true); - auto kind = get_kind(proto_metric); - if (kind.has_value()) - { - assert(kind.value() != protobuf::Kind::CONSTANT); - } + assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); auto offset = proto_metric.offset(); - return typename Metric::optional(m_data.data() + m_metadata_bytes + offset); + return typename Metric::optional(value_data(offset)); } // Explicit instantiations for the expected types @@ -317,19 +319,14 @@ template assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); m_initialized[name] = true; - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + const protobuf::Metric& proto_metric = metadata().metrics().at(name); assert(proto_metric.optional() == false); - auto kind = get_kind(proto_metric); - if (kind.has_value()) - { - assert(kind.value() != protobuf::Kind::CONSTANT); - } + assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); auto offset = proto_metric.offset(); m_initial_values[name] = value; - return typename Metric::required(m_data.data() + m_metadata_bytes + offset, - value); + return typename Metric::required(value_data(offset), value); } // Explicit instantiations for the expected types @@ -366,14 +363,13 @@ void metrics::initialize_constant(const std::string& name, assert(!m_initialized.at(name)); m_initialized[name] = true; - const protobuf::Metric& proto_metric = m_metadata.metrics().at(name); + const protobuf::Metric& proto_metric = metadata().metrics().at(name); assert(proto_metric.optional() == false && "Constant metrics cannot be optional"); auto offset = proto_metric.offset(); - auto kind = get_kind(proto_metric); - assert(kind.has_value() && kind.value() == protobuf::Kind::CONSTANT); + assert(get_kind(proto_metric) == protobuf::Kind::CONSTANT); - typename Metric::required(m_data.data() + m_metadata_bytes + offset, value); + typename Metric::required(value_data(offset), value); } // Explicit instantiations for the expected types @@ -400,27 +396,22 @@ metrics::~metrics() auto metrics::value_data() const -> const uint8_t* { - return m_data.data() + m_metadata_bytes; -} - -auto metrics::value_bytes() const -> std::size_t -{ - return m_value_bytes; + return (const uint8_t*)m_proto_metrics.values().data(); } -auto metrics::metadata_data() const -> const uint8_t* +auto metrics::value_data(std::size_t offset) -> uint8_t* { - return m_data.data(); + return (uint8_t*)m_proto_metrics.mutable_values()->data() + offset; } -auto metrics::metadata_bytes() const -> std::size_t +auto metrics::value_bytes() const -> std::size_t { - return m_metadata_bytes; + return m_value_bytes; } auto metrics::metadata() const -> const protobuf::MetricsMetadata& { - return m_metadata; + return m_proto_metrics.metadata(); } auto metrics::is_initialized(const std::string& name) const -> bool @@ -442,7 +433,7 @@ auto metrics::is_initialized() const -> bool } auto metrics::reset() -> void { - for (const auto& [name, metric] : m_metadata.metrics()) + for (const auto& [name, metric] : metadata().metrics()) { if (!is_initialized(name)) { @@ -460,7 +451,7 @@ auto metrics::reset() -> void if (metric.optional()) { // Set the has value byte to 0 - m_data[m_metadata_bytes + offset] = 0; + value_data(offset)[0] = 0; } else { @@ -468,54 +459,58 @@ auto metrics::reset() -> void if (metric.has_uint64()) { uint64::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } else if (metric.has_int64()) { int64::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } else if (metric.has_uint32()) { uint32::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } else if (metric.has_int32()) { int32::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } else if (metric.has_float64()) { float64::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } else if (metric.has_float32()) { float32::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } else if (metric.has_boolean()) { boolean::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } else if (metric.has_enum8()) { enum8::set_value( - m_data.data() + m_metadata_bytes + offset, + value_data(offset), std::any_cast(m_initial_values.at(name))); } } } } +auto metrics::protobuf() const -> const protobuf::Metrics& +{ + return m_proto_metrics; +} } } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 4f57e4c0..95e91686 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -41,21 +41,6 @@ class metrics /// Destructor ~metrics(); - /// @return the pointer to the value data of the metrics. - auto value_data() const -> const uint8_t*; - - /// @return the size of the value data of the metrics. - auto value_bytes() const -> std::size_t; - - /// @return the pointer to the metadata data of the metrics. - auto metadata_data() const -> const uint8_t*; - - /// @return the size of the metadata data of the metrics. - auto metadata_bytes() const -> std::size_t; - - /// @return the metadata of the metrics. - auto metadata() const -> const protobuf::MetricsMetadata&; - /// Initialize a required metric /// @param name The name of the metric /// @param value Optional initial value of the metric @@ -93,7 +78,25 @@ class metrics /// during initialization. auto reset() -> void; + /// @return the const pointer to the value data of the metrics. + auto value_data() const -> const uint8_t*; + + /// @return the size of the value data of the metrics. + auto value_bytes() const -> std::size_t; + + /// @return the metadata part of the metrics. + auto metadata() const -> const protobuf::MetricsMetadata&; + + /// Get the protobuf representation of the metrics including both metadata + /// and value data + /// @return The protobuf representation of the metrics + auto protobuf() const -> const protobuf::Metrics&; + private: + /// @param offset The offset of the value data + /// @return the pointer to the value data of the metrics. + auto value_data(std::size_t offset) -> uint8_t*; + /// No copy metrics(metrics&) = delete; @@ -101,18 +104,12 @@ class metrics metrics& operator=(metrics&) = delete; private: - /// The raw memory for the metadata and value data - std::vector m_data; - /// The info of the metrics separated by byte-sizes - protobuf::MetricsMetadata m_metadata; + protobuf::Metrics m_proto_metrics; /// The hash of the metadata uint32_t m_hash; - /// The size of the metadata in bytes - std::size_t m_metadata_bytes; - /// The size of the value data in bytes std::size_t m_value_bytes; diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index c3c3acc3..097d8e00 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -210,7 +210,7 @@ struct BoolMetricDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BoolMetricDefaultTypeInternal _BoolMetric_default_instance_; template -PROTOBUF_CONSTEXPR EnumValue::EnumValue(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Enum8Metric_EnumValue::Enum8Metric_EnumValue(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, @@ -223,16 +223,16 @@ PROTOBUF_CONSTEXPR EnumValue::EnumValue(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, } {} -struct EnumValueDefaultTypeInternal { - PROTOBUF_CONSTEXPR EnumValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~EnumValueDefaultTypeInternal() {} +struct Enum8Metric_EnumValueDefaultTypeInternal { + PROTOBUF_CONSTEXPR Enum8Metric_EnumValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Enum8Metric_EnumValueDefaultTypeInternal() {} union { - EnumValue _instance; + Enum8Metric_EnumValue _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumValueDefaultTypeInternal _EnumValue_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Enum8Metric_EnumValueDefaultTypeInternal _Enum8Metric_EnumValue_default_instance_; template PROTOBUF_CONSTEXPR Enum8Metric_ValuesEntry_DoNotUse::Enum8Metric_ValuesEntry_DoNotUse(::_pbi::ConstantInitialized) {} struct Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal { @@ -259,6 +259,7 @@ PROTOBUF_CONSTEXPR Enum8Metric::Enum8Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.kind_)*/ 0, } {} struct Enum8MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Enum8MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -320,9 +321,30 @@ struct MetricsMetadataDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; + template +PROTOBUF_CONSTEXPR Metrics::Metrics(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.values_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.metadata_)*/ nullptr, + } {} +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 } // namespace abacus -static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]; +static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; @@ -450,16 +472,16 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, 0, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumValue, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumValue, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _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(::abacus::protobuf::EnumValue, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::EnumValue, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _impl_.description_), ~0u, 0, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse, _has_bits_), @@ -483,9 +505,11 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.values_), ~0u, + ~0u, 0, ~0u, ~0u, // no _has_bits_ @@ -531,6 +555,18 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.endianness_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.sync_value_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.metrics_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metrics, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::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(::abacus::protobuf::Metrics, _impl_.metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metrics, _impl_.values_), + 0, + ~0u, }; static const ::_pbi::MigrationSchema @@ -542,12 +578,13 @@ static const ::_pbi::MigrationSchema {72, 85, -1, sizeof(::abacus::protobuf::Float64Metric)}, {90, 103, -1, sizeof(::abacus::protobuf::Float32Metric)}, {108, 119, -1, sizeof(::abacus::protobuf::BoolMetric)}, - {122, 132, -1, sizeof(::abacus::protobuf::EnumValue)}, + {122, 132, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, {134, 144, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, - {146, 157, -1, sizeof(::abacus::protobuf::Enum8Metric)}, - {160, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {179, 189, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {191, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {146, 158, -1, sizeof(::abacus::protobuf::Enum8Metric)}, + {162, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {181, 191, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {193, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {205, 215, -1, sizeof(::abacus::protobuf::Metrics)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -558,12 +595,13 @@ static const ::_pb::Message* const file_default_instances[] = { &::abacus::protobuf::_Float64Metric_default_instance_._instance, &::abacus::protobuf::_Float32Metric_default_instance_._instance, &::abacus::protobuf::_BoolMetric_default_instance_._instance, - &::abacus::protobuf::_EnumValue_default_instance_._instance, + &::abacus::protobuf::_Enum8Metric_EnumValue_default_instance_._instance, &::abacus::protobuf::_Enum8Metric_ValuesEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_Enum8Metric_default_instance_._instance, &::abacus::protobuf::_Metric_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_MetricsEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_default_instance_._instance, + &::abacus::protobuf::_Metrics_default_instance_._instance, }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." @@ -593,33 +631,36 @@ const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTO "\210\001\001\022\020\n\003max\030\005 \001(\002H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006" "\n\004_max\"b\n\nBoolMetric\022\023\n\013description\030\001 \001(" "\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021" - "\n\004unit\030\003 \001(\tH\000\210\001\001B\007\n\005_unit\"C\n\tEnumValue\022" - "\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001\001B" - "\016\n\014_description\"\303\001\n\013Enum8Metric\022\023\n\013descr" - "iption\030\001 \001(\t\022\021\n\004unit\030\002 \001(\tH\000\210\001\001\0228\n\006value" - "s\030\003 \003(\0132(.abacus.protobuf.Enum8Metric.Va" - "luesEntry\032I\n\013ValuesEntry\022\013\n\003key\030\001 \001(\r\022)\n" - "\005value\030\002 \001(\0132\032.abacus.protobuf.EnumValue" - ":\0028\001B\007\n\005_unit\"\267\003\n\006Metric\022\016\n\006offset\030\001 \001(\r" - "\022\020\n\010optional\030\002 \001(\010\022/\n\006uint64\030\003 \001(\0132\035.aba" - "cus.protobuf.UInt64MetricH\000\022-\n\005int64\030\004 \001" - "(\0132\034.abacus.protobuf.Int64MetricH\000\022/\n\006ui" - "nt32\030\005 \001(\0132\035.abacus.protobuf.UInt32Metri" - "cH\000\022-\n\005int32\030\006 \001(\0132\034.abacus.protobuf.Int" - "32MetricH\000\0221\n\007float64\030\007 \001(\0132\036.abacus.pro" - "tobuf.Float64MetricH\000\0221\n\007float32\030\010 \001(\0132\036" - ".abacus.protobuf.Float32MetricH\000\022.\n\007bool" - "ean\030\t \001(\0132\033.abacus.protobuf.BoolMetricH\000" - "\022-\n\005enum8\030\n \001(\0132\034.abacus.protobuf.Enum8M" - "etricH\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030\n\020p" - "rotocol_version\030\001 \001(\r\022/\n\nendianness\030\002 \001(" - "\0162\033.abacus.protobuf.Endianness\022\022\n\nsync_v" - "alue\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus.pro" - "tobuf.MetricsMetadata.MetricsEntry\032G\n\014Me" - "tricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027" - ".abacus.protobuf.Metric:\0028\001*!\n\nEndiannes" - "s\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/protobu" - "fb\006proto3" + "\n\004unit\030\003 \001(\tH\000\210\001\001B\007\n\005_unit\"\271\002\n\013Enum8Metr" + "ic\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025." + "abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022" + "8\n\006values\030\004 \003(\0132(.abacus.protobuf.Enum8M" + "etric.ValuesEntry\032C\n\tEnumValue\022\014\n\004name\030\001" + " \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001\001B\016\n\014_descr" + "iption\032U\n\013ValuesEntry\022\013\n\003key\030\001 \001(\r\0225\n\005va" + "lue\030\002 \001(\0132&.abacus.protobuf.Enum8Metric." + "EnumValue:\0028\001B\007\n\005_unit\"\267\003\n\006Metric\022\016\n\006off" + "set\030\001 \001(\r\022\020\n\010optional\030\002 \001(\010\022/\n\006uint64\030\003 " + "\001(\0132\035.abacus.protobuf.UInt64MetricH\000\022-\n\005" + "int64\030\004 \001(\0132\034.abacus.protobuf.Int64Metri" + "cH\000\022/\n\006uint32\030\005 \001(\0132\035.abacus.protobuf.UI" + "nt32MetricH\000\022-\n\005int32\030\006 \001(\0132\034.abacus.pro" + "tobuf.Int32MetricH\000\0221\n\007float64\030\007 \001(\0132\036.a" + "bacus.protobuf.Float64MetricH\000\0221\n\007float3" + "2\030\010 \001(\0132\036.abacus.protobuf.Float32MetricH" + "\000\022.\n\007boolean\030\t \001(\0132\033.abacus.protobuf.Boo" + "lMetricH\000\022-\n\005enum8\030\n \001(\0132\034.abacus.protob" + "uf.Enum8MetricH\000B\006\n\004type\"\371\001\n\017MetricsMeta" + "data\022\030\n\020protocol_version\030\001 \001(\r\022/\n\nendian" + "ness\030\002 \001(\0162\033.abacus.protobuf.Endianness\022" + "\022\n\nsync_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.a" + "bacus.protobuf.MetricsMetadata.MetricsEn" + "try\032G\n\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005valu" + "e\030\002 \001(\0132\027.abacus.protobuf.Metric:\0028\001\"_\n\007" + "Metrics\0227\n\010metadata\030\001 \001(\0132 .abacus.proto" + "buf.MetricsMetadataH\000\210\001\001\022\016\n\006values\030\002 \001(\014" + "B\013\n\t_metadata*!\n\nEndianness\022\n\n\006LITTLE\020\000\022" + "\007\n\003BIG\020\001B\021Z\017abacus/protobufb\006proto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps[1] = { @@ -629,13 +670,13 @@ static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_on const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2129, + 2275, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps, 1, - 13, + 14, schemas, file_default_instances, TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets, @@ -3043,23 +3084,23 @@ ::google::protobuf::Metadata BoolMetric::GetMetadata() const { } // =================================================================== -class EnumValue::_Internal { +class Enum8Metric_EnumValue::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); + using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(EnumValue, _impl_._has_bits_); + 8 * PROTOBUF_FIELD_OFFSET(Enum8Metric_EnumValue, _impl_._has_bits_); static void set_has_description(HasBits* has_bits) { (*has_bits)[0] |= 1u; } }; -EnumValue::EnumValue(::google::protobuf::Arena* arena) +Enum8Metric_EnumValue::Enum8Metric_EnumValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.EnumValue) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Enum8Metric.EnumValue) } -EnumValue::EnumValue(const EnumValue& from) : ::google::protobuf::Message() { - EnumValue* const _this = this; +Enum8Metric_EnumValue::Enum8Metric_EnumValue(const Enum8Metric_EnumValue& from) : ::google::protobuf::Message() { + Enum8Metric_EnumValue* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_}, @@ -3084,9 +3125,9 @@ EnumValue::EnumValue(const EnumValue& from) : ::google::protobuf::Message() { _this->_impl_.description_.Set(from._internal_description(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.EnumValue) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Enum8Metric.EnumValue) } -inline void EnumValue::SharedCtor(::_pb::Arena* arena) { +inline void Enum8Metric_EnumValue::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){}, @@ -3103,22 +3144,22 @@ inline void EnumValue::SharedCtor(::_pb::Arena* arena) { _impl_.description_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -EnumValue::~EnumValue() { - // @@protoc_insertion_point(destructor:abacus.protobuf.EnumValue) +Enum8Metric_EnumValue::~Enum8Metric_EnumValue() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Enum8Metric.EnumValue) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void EnumValue::SharedDtor() { +inline void Enum8Metric_EnumValue::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.name_.Destroy(); _impl_.description_.Destroy(); } -void EnumValue::SetCachedSize(int size) const { +void Enum8Metric_EnumValue::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void EnumValue::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.EnumValue) +PROTOBUF_NOINLINE void Enum8Metric_EnumValue::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Enum8Metric.EnumValue) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3132,7 +3173,7 @@ PROTOBUF_NOINLINE void EnumValue::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* EnumValue::_InternalParse( +const char* Enum8Metric_EnumValue::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -3140,9 +3181,9 @@ const char* EnumValue::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 49, 2> EnumValue::_table_ = { +const ::_pbi::TcParseTable<1, 2, 0, 61, 2> Enum8Metric_EnumValue::_table_ = { { - PROTOBUF_FIELD_OFFSET(EnumValue, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(Enum8Metric_EnumValue, _impl_._has_bits_), 0, // no _extensions_ 2, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), @@ -3151,38 +3192,38 @@ const ::_pbi::TcParseTable<1, 2, 0, 49, 2> EnumValue::_table_ = { 2, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_EnumValue_default_instance_._instance, + &_Enum8Metric_EnumValue_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ // optional string description = 2; {::_pbi::TcParser::FastUS1, - {18, 0, 0, PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.description_)}}, + {18, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric_EnumValue, _impl_.description_)}}, // string name = 1; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.name_)}}, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric_EnumValue, _impl_.name_)}}, }}, {{ 65535, 65535 }}, {{ // string name = 1; - {PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.name_), -1, 0, + {PROTOBUF_FIELD_OFFSET(Enum8Metric_EnumValue, _impl_.name_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, // optional string description = 2; - {PROTOBUF_FIELD_OFFSET(EnumValue, _impl_.description_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(Enum8Metric_EnumValue, _impl_.description_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, }}, // no aux_entries {{ - "\31\4\13\0\0\0\0\0" - "abacus.protobuf.EnumValue" + "\45\4\13\0\0\0\0\0" + "abacus.protobuf.Enum8Metric.EnumValue" "name" "description" }}, }; -::uint8_t* EnumValue::_InternalSerialize( +::uint8_t* Enum8Metric_EnumValue::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.EnumValue) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Enum8Metric.EnumValue) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3190,7 +3231,7 @@ ::uint8_t* EnumValue::_InternalSerialize( 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, "abacus.protobuf.EnumValue.name"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.EnumValue.name"); target = stream->WriteStringMaybeAliased(1, _s, target); } @@ -3199,7 +3240,7 @@ ::uint8_t* EnumValue::_InternalSerialize( if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_description(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.EnumValue.description"); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.EnumValue.description"); target = stream->WriteStringMaybeAliased(2, _s, target); } @@ -3208,12 +3249,12 @@ ::uint8_t* EnumValue::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.EnumValue) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Enum8Metric.EnumValue) return target; } -::size_t EnumValue::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.EnumValue) +::size_t Enum8Metric_EnumValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Enum8Metric.EnumValue) ::size_t total_size = 0; ::uint32_t cached_has_bits = 0; @@ -3236,17 +3277,17 @@ ::size_t EnumValue::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData EnumValue::_class_data_ = { +const ::google::protobuf::Message::ClassData Enum8Metric_EnumValue::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - EnumValue::MergeImpl + Enum8Metric_EnumValue::MergeImpl }; -const ::google::protobuf::Message::ClassData*EnumValue::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Enum8Metric_EnumValue::GetClassData() const { return &_class_data_; } -void EnumValue::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:abacus.protobuf.EnumValue) +void Enum8Metric_EnumValue::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:abacus.protobuf.Enum8Metric.EnumValue) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -3260,18 +3301,18 @@ void EnumValue::MergeImpl(::google::protobuf::Message& to_msg, const ::google::p _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void EnumValue::CopyFrom(const EnumValue& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.EnumValue) +void Enum8Metric_EnumValue::CopyFrom(const Enum8Metric_EnumValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Enum8Metric.EnumValue) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool EnumValue::IsInitialized() const { +PROTOBUF_NOINLINE bool Enum8Metric_EnumValue::IsInitialized() const { return true; } -void EnumValue::InternalSwap(EnumValue* other) { +void Enum8Metric_EnumValue::InternalSwap(Enum8Metric_EnumValue* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); @@ -3283,7 +3324,7 @@ void EnumValue::InternalSwap(EnumValue* other) { &other->_impl_.description_, rhs_arena); } -::google::protobuf::Metadata EnumValue::GetMetadata() const { +::google::protobuf::Metadata Enum8Metric_EnumValue::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); @@ -3327,6 +3368,7 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( /* decltype(_impl_.values_) */ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.kind_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -3345,6 +3387,7 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } + _this->_impl_.kind_ = from._impl_.kind_; // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Enum8Metric) } @@ -3356,6 +3399,7 @@ inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { /* decltype(_impl_.values_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.kind_){0}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -3393,6 +3437,7 @@ PROTOBUF_NOINLINE void Enum8Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + _impl_.kind_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3405,43 +3450,50 @@ const char* Enum8Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 3, 2, 51, 2> Enum8Metric::_table_ = { +const ::_pbi::TcParseTable<2, 4, 2, 51, 2> Enum8Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_), 0, // no _extensions_ - 3, 8, // max_field_number, fast_idx_mask + 4, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap + 4294967280, // skipmap offsetof(decltype(_table_), field_entries), - 3, // num_field_entries + 4, // num_field_entries 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Enum8Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional string unit = 2; - {::_pbi::TcParser::FastUS1, - {18, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_)}}, + {::_pbi::TcParser::MiniParse, {}}, // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_)}}, + // .abacus.protobuf.Kind kind = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Enum8Metric, _impl_.kind_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional string unit = 2; + // .abacus.protobuf.Kind kind = 2; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 3; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // map values = 3; + // map values = 4; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, }}, {{ {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, - {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::EnumValue>}, + {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Enum8Metric_EnumValue>}, }}, {{ - "\33\13\4\0\0\0\0\0" + "\33\13\0\4\0\0\0\0" "abacus.protobuf.Enum8Metric" "description" "unit" @@ -3463,30 +3515,37 @@ ::uint8_t* Enum8Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_kind(), target); + } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 2; + // optional string unit = 3; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.unit"); - target = stream->WriteStringMaybeAliased(2, _s, target); + target = stream->WriteStringMaybeAliased(3, _s, target); } - // map values = 3; + // map values = 4; if (!_internal_values().empty()) { - using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>; + using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>; using WireHelper = Enum8Metric_ValuesEntry_DoNotUse::Funcs; const auto& field = _internal_values(); if (stream->IsSerializationDeterministic() && field.size() > 1) { for (const auto& entry : ::google::protobuf::internal::MapSorterFlat(field)) { target = WireHelper::InternalSerialize( - 3, entry.first, entry.second, target, stream); + 4, entry.first, entry.second, target, stream); } } else { for (const auto& entry : field) { target = WireHelper::InternalSerialize( - 3, entry.first, entry.second, target, stream); + 4, entry.first, entry.second, target, stream); } } } @@ -3508,7 +3567,7 @@ ::size_t Enum8Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // map values = 3; + // map values = 4; total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_values_size()); for (const auto& entry : _internal_values()) { total_size += Enum8Metric_ValuesEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); @@ -3519,13 +3578,19 @@ ::size_t Enum8Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 2; + // optional string unit = 3; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } + // .abacus.protobuf.Kind kind = 2; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3551,6 +3616,9 @@ void Enum8Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -3576,6 +3644,7 @@ void Enum8Metric::InternalSwap(Enum8Metric* other) { &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); + swap(_impl_.kind_, other->_impl_.kind_); } ::google::protobuf::Metadata Enum8Metric::GetMetadata() const { @@ -4534,6 +4603,244 @@ ::google::protobuf::Metadata MetricsMetadata::GetMetadata() const { &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); } +// =================================================================== + +class Metrics::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Metrics, _impl_._has_bits_); + static const ::abacus::protobuf::MetricsMetadata& metadata(const Metrics* msg); + static void set_has_metadata(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +const ::abacus::protobuf::MetricsMetadata& Metrics::_Internal::metadata(const Metrics* msg) { + return *msg->_impl_.metadata_; +} +Metrics::Metrics(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Metrics) +} +Metrics::Metrics(const Metrics& from) : ::google::protobuf::Message() { + Metrics* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.values_){}, + decltype(_impl_.metadata_){nullptr}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _impl_.values_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.values_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_values().empty()) { + _this->_impl_.values_.Set(from._internal_values(), _this->GetArenaForAllocation()); + } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.metadata_ = new ::abacus::protobuf::MetricsMetadata(*from._impl_.metadata_); + } + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Metrics) +} +inline void Metrics::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.values_){}, + decltype(_impl_.metadata_){nullptr}, + }; + _impl_.values_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.values_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +Metrics::~Metrics() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Metrics) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Metrics::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.values_.Destroy(); + if (this != internal_default_instance()) delete _impl_.metadata_; +} +void Metrics::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void Metrics::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Metrics) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.values_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.metadata_ != nullptr); + _impl_.metadata_->Clear(); + } + _impl_._has_bits_.Clear(); + _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_ = { + { + PROTOBUF_FIELD_OFFSET(Metrics, _impl_._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 + }, {{ + // bytes values = 2; + {::_pbi::TcParser::FastBS1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Metrics, _impl_.values_)}}, + // optional .abacus.protobuf.MetricsMetadata metadata = 1; + {::_pbi::TcParser::FastMtS1, + {10, 0, 0, PROTOBUF_FIELD_OFFSET(Metrics, _impl_.metadata_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional .abacus.protobuf.MetricsMetadata metadata = 1; + {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.metadata_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // bytes values = 2; + {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.values_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::MetricsMetadata>()}, + }}, {{ + }}, +}; + +::uint8_t* Metrics::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Metrics) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // optional .abacus.protobuf.MetricsMetadata metadata = 1; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::metadata(this), + _Internal::metadata(this).GetCachedSize(), target, stream); + } + + // bytes values = 2; + if (!this->_internal_values().empty()) { + const std::string& _s = this->_internal_values(); + target = stream->WriteBytesMaybeAliased(2, _s, target); + } + + 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:abacus.protobuf.Metrics) + return target; +} + +::size_t Metrics::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.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; + + // bytes values = 2; + if (!this->_internal_values().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->_internal_values()); + } + + // optional .abacus.protobuf.MetricsMetadata metadata = 1; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.metadata_); + } + + 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:abacus.protobuf.Metrics) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_values().empty()) { + _this->_internal_set_values(from._internal_values()); + } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_mutable_metadata()->::abacus::protobuf::MetricsMetadata::MergeFrom( + from._internal_metadata()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Metrics::CopyFrom(const Metrics& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.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; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.values_, lhs_arena, + &other->_impl_.values_, rhs_arena); + swap(_impl_.metadata_, other->_impl_.metadata_); +} + +::google::protobuf::Metadata Metrics::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); +} // @@protoc_insertion_point(namespace_scope) } // namespace protobuf } // namespace abacus diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 6e4b810f..98dfe0d8 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -66,12 +66,12 @@ extern BoolMetricDefaultTypeInternal _BoolMetric_default_instance_; class Enum8Metric; struct Enum8MetricDefaultTypeInternal; extern Enum8MetricDefaultTypeInternal _Enum8Metric_default_instance_; +class Enum8Metric_EnumValue; +struct Enum8Metric_EnumValueDefaultTypeInternal; +extern Enum8Metric_EnumValueDefaultTypeInternal _Enum8Metric_EnumValue_default_instance_; class Enum8Metric_ValuesEntry_DoNotUse; struct Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal; extern Enum8Metric_ValuesEntry_DoNotUseDefaultTypeInternal _Enum8Metric_ValuesEntry_DoNotUse_default_instance_; -class EnumValue; -struct EnumValueDefaultTypeInternal; -extern EnumValueDefaultTypeInternal _EnumValue_default_instance_; class Float32Metric; struct Float32MetricDefaultTypeInternal; extern Float32MetricDefaultTypeInternal _Float32Metric_default_instance_; @@ -87,6 +87,9 @@ extern Int64MetricDefaultTypeInternal _Int64Metric_default_instance_; class Metric; struct MetricDefaultTypeInternal; extern MetricDefaultTypeInternal _Metric_default_instance_; +class Metrics; +struct MetricsDefaultTypeInternal; +extern MetricsDefaultTypeInternal _Metrics_default_instance_; class MetricsMetadata; struct MetricsMetadataDefaultTypeInternal; extern MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; @@ -1674,25 +1677,25 @@ class BoolMetric final : friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class EnumValue final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.EnumValue) */ { +class Enum8Metric_EnumValue final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Enum8Metric.EnumValue) */ { public: - inline EnumValue() : EnumValue(nullptr) {} - ~EnumValue() override; + inline Enum8Metric_EnumValue() : Enum8Metric_EnumValue(nullptr) {} + ~Enum8Metric_EnumValue() override; template - explicit PROTOBUF_CONSTEXPR EnumValue(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Enum8Metric_EnumValue(::google::protobuf::internal::ConstantInitialized); - EnumValue(const EnumValue& from); - EnumValue(EnumValue&& from) noexcept - : EnumValue() { + Enum8Metric_EnumValue(const Enum8Metric_EnumValue& from); + Enum8Metric_EnumValue(Enum8Metric_EnumValue&& from) noexcept + : Enum8Metric_EnumValue() { *this = ::std::move(from); } - inline EnumValue& operator=(const EnumValue& from) { + inline Enum8Metric_EnumValue& operator=(const Enum8Metric_EnumValue& from) { CopyFrom(from); return *this; } - inline EnumValue& operator=(EnumValue&& from) noexcept { + inline Enum8Metric_EnumValue& operator=(Enum8Metric_EnumValue&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1722,20 +1725,20 @@ class EnumValue final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const EnumValue& default_instance() { + static const Enum8Metric_EnumValue& default_instance() { return *internal_default_instance(); } - static inline const EnumValue* internal_default_instance() { - return reinterpret_cast( - &_EnumValue_default_instance_); + static inline const Enum8Metric_EnumValue* internal_default_instance() { + return reinterpret_cast( + &_Enum8Metric_EnumValue_default_instance_); } static constexpr int kIndexInFileMessages = 7; - friend void swap(EnumValue& a, EnumValue& b) { + friend void swap(Enum8Metric_EnumValue& a, Enum8Metric_EnumValue& b) { a.Swap(&b); } - inline void Swap(EnumValue* other) { + inline void Swap(Enum8Metric_EnumValue* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1748,7 +1751,7 @@ class EnumValue final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(EnumValue* other) { + void UnsafeArenaSwap(Enum8Metric_EnumValue* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1756,14 +1759,14 @@ class EnumValue final : // implements Message ---------------------------------------------- - EnumValue* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Enum8Metric_EnumValue* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const EnumValue& from); + void CopyFrom(const Enum8Metric_EnumValue& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const EnumValue& from) { - EnumValue::MergeImpl(*this, from); + void MergeFrom( const Enum8Metric_EnumValue& from) { + Enum8Metric_EnumValue::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1781,15 +1784,15 @@ class EnumValue final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(EnumValue* other); + void InternalSwap(Enum8Metric_EnumValue* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.EnumValue"; + return "abacus.protobuf.Enum8Metric.EnumValue"; } protected: - explicit EnumValue(::google::protobuf::Arena* arena); + explicit Enum8Metric_EnumValue(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1838,12 +1841,12 @@ class EnumValue final : std::string* _internal_mutable_description(); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.EnumValue) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric.EnumValue) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 49, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 61, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1859,12 +1862,12 @@ class EnumValue final : };// ------------------------------------------------------------------- class Enum8Metric_ValuesEntry_DoNotUse final : public ::google::protobuf::internal::MapEntry { public: typedef ::google::protobuf::internal::MapEntry SuperType; Enum8Metric_ValuesEntry_DoNotUse(); @@ -2007,27 +2010,29 @@ class Enum8Metric final : // nested types ---------------------------------------------------- + typedef Enum8Metric_EnumValue EnumValue; // accessors ------------------------------------------------------- enum : int { - kValuesFieldNumber = 3, + kValuesFieldNumber = 4, kDescriptionFieldNumber = 1, - kUnitFieldNumber = 2, + kUnitFieldNumber = 3, + kKindFieldNumber = 2, }; - // map values = 3; + // map values = 4; int values_size() const; private: int _internal_values_size() const; public: void clear_values() ; - const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& values() const; - ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* mutable_values(); + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& values() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* mutable_values(); private: - const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& _internal_values() const; - ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* _internal_mutable_values(); + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& _internal_values() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* _internal_mutable_values(); public: // string description = 1; @@ -2046,7 +2051,7 @@ class Enum8Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 2; + // optional string unit = 3; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -2062,25 +2067,36 @@ class Enum8Metric final : const std::string& value); std::string* _internal_mutable_unit(); + public: + // .abacus.protobuf.Kind kind = 2; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + public: // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 3, 2, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 4, 2, 51, 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_; - ::google::protobuf::internal::MapField values_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; + int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -2683,6 +2699,188 @@ class MetricsMetadata final : }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class Metrics final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.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 = + 13; + + 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 "abacus.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 { + kValuesFieldNumber = 2, + kMetadataFieldNumber = 1, + }; + // bytes values = 2; + void clear_values() ; + const std::string& values() const; + template + void set_values(Arg_&& arg, Args_... args); + std::string* mutable_values(); + PROTOBUF_NODISCARD std::string* release_values(); + void set_allocated_values(std::string* ptr); + + private: + const std::string& _internal_values() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_values( + const std::string& value); + std::string* _internal_mutable_values(); + + public: + // optional .abacus.protobuf.MetricsMetadata metadata = 1; + bool has_metadata() const; + void clear_metadata() ; + const ::abacus::protobuf::MetricsMetadata& metadata() const; + PROTOBUF_NODISCARD ::abacus::protobuf::MetricsMetadata* release_metadata(); + ::abacus::protobuf::MetricsMetadata* mutable_metadata(); + void set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value); + void unsafe_arena_set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value); + ::abacus::protobuf::MetricsMetadata* unsafe_arena_release_metadata(); + + private: + const ::abacus::protobuf::MetricsMetadata& _internal_metadata() const; + ::abacus::protobuf::MetricsMetadata* _internal_mutable_metadata(); + + public: + // @@protoc_insertion_point(class_scope:abacus.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::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr values_; + ::abacus::protobuf::MetricsMetadata* metadata_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; }; // =================================================================== @@ -4045,49 +4243,49 @@ inline void BoolMetric::set_allocated_unit(std::string* value) { // ------------------------------------------------------------------- -// EnumValue +// Enum8Metric_EnumValue // string name = 1; -inline void EnumValue::clear_name() { +inline void Enum8Metric_EnumValue::clear_name() { _impl_.name_.ClearToEmpty(); } -inline const std::string& EnumValue::name() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.EnumValue.name) +inline const std::string& Enum8Metric_EnumValue::name() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.EnumValue.name) return _internal_name(); } template -inline PROTOBUF_ALWAYS_INLINE void EnumValue::set_name(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric_EnumValue::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:abacus.protobuf.EnumValue.name) + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.EnumValue.name) } -inline std::string* EnumValue::mutable_name() { +inline std::string* Enum8Metric_EnumValue::mutable_name() { std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumValue.name) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.EnumValue.name) return _s; } -inline const std::string& EnumValue::_internal_name() const { +inline const std::string& Enum8Metric_EnumValue::_internal_name() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.name_.Get(); } -inline void EnumValue::_internal_set_name(const std::string& value) { +inline void Enum8Metric_EnumValue::_internal_set_name(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* EnumValue::_internal_mutable_name() { +inline std::string* Enum8Metric_EnumValue::_internal_mutable_name() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; return _impl_.name_.Mutable( GetArenaForAllocation()); } -inline std::string* EnumValue::release_name() { +inline std::string* Enum8Metric_EnumValue::release_name() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.EnumValue.name) + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.EnumValue.name) return _impl_.name_.Release(); } -inline void EnumValue::set_allocated_name(std::string* value) { +inline void Enum8Metric_EnumValue::set_allocated_name(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_.name_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -4095,52 +4293,52 @@ inline void EnumValue::set_allocated_name(std::string* value) { _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.EnumValue.name) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.EnumValue.name) } // optional string description = 2; -inline bool EnumValue::has_description() const { +inline bool Enum8Metric_EnumValue::has_description() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline void EnumValue::clear_description() { +inline void Enum8Metric_EnumValue::clear_description() { _impl_.description_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& EnumValue::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.EnumValue.description) +inline const std::string& Enum8Metric_EnumValue::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.EnumValue.description) return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void EnumValue::set_description(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric_EnumValue::set_description(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.EnumValue.description) + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.EnumValue.description) } -inline std::string* EnumValue::mutable_description() { +inline std::string* Enum8Metric_EnumValue::mutable_description() { std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.EnumValue.description) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.EnumValue.description) return _s; } -inline const std::string& EnumValue::_internal_description() const { +inline const std::string& Enum8Metric_EnumValue::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.description_.Get(); } -inline void EnumValue::_internal_set_description(const std::string& value) { +inline void Enum8Metric_EnumValue::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* EnumValue::_internal_mutable_description() { +inline std::string* Enum8Metric_EnumValue::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* EnumValue::release_description() { +inline std::string* Enum8Metric_EnumValue::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.EnumValue.description) + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.EnumValue.description) if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } @@ -4151,7 +4349,7 @@ inline std::string* EnumValue::release_description() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return released; } -inline void EnumValue::set_allocated_description(std::string* value) { +inline void Enum8Metric_EnumValue::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); if (value != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; @@ -4164,7 +4362,7 @@ inline void EnumValue::set_allocated_description(std::string* value) { _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.EnumValue.description) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.EnumValue.description) } // ------------------------------------------------------------------- @@ -4224,7 +4422,29 @@ inline void Enum8Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.description) } -// optional string unit = 2; +// .abacus.protobuf.Kind kind = 2; +inline void Enum8Metric::clear_kind() { + _impl_.kind_ = 0; +} +inline ::abacus::protobuf::Kind Enum8Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.kind) + return _internal_kind(); +} +inline void Enum8Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.kind) +} +inline ::abacus::protobuf::Kind Enum8Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void Enum8Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// optional string unit = 3; inline bool Enum8Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4293,7 +4513,7 @@ inline void Enum8Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.unit) } -// map values = 3; +// map values = 4; inline int Enum8Metric::_internal_values_size() const { return _internal_values().size(); } @@ -4303,19 +4523,19 @@ inline int Enum8Metric::values_size() const { inline void Enum8Metric::clear_values() { _impl_.values_.Clear(); } -inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& Enum8Metric::_internal_values() const { +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& Enum8Metric::_internal_values() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.values_.GetMap(); } -inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>& Enum8Metric::values() const { +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& Enum8Metric::values() const { // @@protoc_insertion_point(field_map:abacus.protobuf.Enum8Metric.values) return _internal_values(); } -inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* Enum8Metric::_internal_mutable_values() { +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* Enum8Metric::_internal_mutable_values() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); return _impl_.values_.MutableMap(); } -inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::EnumValue>* Enum8Metric::mutable_values() { +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* Enum8Metric::mutable_values() { // @@protoc_insertion_point(field_mutable_map:abacus.protobuf.Enum8Metric.values) return _internal_mutable_values(); } @@ -5068,6 +5288,157 @@ inline ::google::protobuf::Map* Metrics return _internal_mutable_metrics(); } +// ------------------------------------------------------------------- + +// Metrics + +// optional .abacus.protobuf.MetricsMetadata metadata = 1; +inline bool Metrics::has_metadata() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.metadata_ != nullptr); + return value; +} +inline void Metrics::clear_metadata() { + if (_impl_.metadata_ != nullptr) _impl_.metadata_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::abacus::protobuf::MetricsMetadata& Metrics::_internal_metadata() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + const ::abacus::protobuf::MetricsMetadata* p = _impl_.metadata_; + return p != nullptr ? *p : reinterpret_cast(::abacus::protobuf::_MetricsMetadata_default_instance_); +} +inline const ::abacus::protobuf::MetricsMetadata& Metrics::metadata() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metrics.metadata) + return _internal_metadata(); +} +inline void Metrics::unsafe_arena_set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.metadata_); + } + _impl_.metadata_ = reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metrics.metadata) +} +inline ::abacus::protobuf::MetricsMetadata* Metrics::release_metadata() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::abacus::protobuf::MetricsMetadata* released = _impl_.metadata_; + _impl_.metadata_ = 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 ::abacus::protobuf::MetricsMetadata* Metrics::unsafe_arena_release_metadata() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Metrics.metadata) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::abacus::protobuf::MetricsMetadata* temp = _impl_.metadata_; + _impl_.metadata_ = nullptr; + return temp; +} +inline ::abacus::protobuf::MetricsMetadata* Metrics::_internal_mutable_metadata() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.metadata_ == nullptr) { + auto* p = CreateMaybeMessage<::abacus::protobuf::MetricsMetadata>(GetArenaForAllocation()); + _impl_.metadata_ = reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(p); + } + return _impl_.metadata_; +} +inline ::abacus::protobuf::MetricsMetadata* Metrics::mutable_metadata() { + ::abacus::protobuf::MetricsMetadata* _msg = _internal_mutable_metadata(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metrics.metadata) + return _msg; +} +inline void Metrics::set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(_impl_.metadata_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(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_.metadata_ = reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(value); + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metrics.metadata) +} + +// bytes values = 2; +inline void Metrics::clear_values() { + _impl_.values_.ClearToEmpty(); +} +inline const std::string& Metrics::values() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metrics.values) + return _internal_values(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Metrics::set_values(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.values_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Metrics.values) +} +inline std::string* Metrics::mutable_values() { + std::string* _s = _internal_mutable_values(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metrics.values) + return _s; +} +inline const std::string& Metrics::_internal_values() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.values_.Get(); +} +inline void Metrics::_internal_set_values(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.values_.Set(value, GetArenaForAllocation()); +} +inline std::string* Metrics::_internal_mutable_values() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.values_.Mutable( GetArenaForAllocation()); +} +inline std::string* Metrics::release_values() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Metrics.values) + return _impl_.values_.Release(); +} +inline void Metrics::set_allocated_values(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.values_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.values_.IsDefault()) { + _impl_.values_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metrics.values) +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index 8aefe15f..cfb6902d 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -6,24 +6,33 @@ #include #include "detail/to_json.hpp" +#include "protobuf/metrics.pb.h" #include "to_json.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { + +auto to_json(const protobuf::Metrics& metrics, bool minimal) -> std::string +{ + const auto& values = metrics.values(); + return to_json(metrics.metadata(), (const uint8_t*)values.data(), + values.size(), minimal); +} + auto to_json(const view& view, bool minimal) -> std::string { bourne::json json = detail::to_json(view, minimal); return json.dump(); } -auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, +auto to_json(const protobuf::MetricsMetadata& metadata, const uint8_t* value_data, std::size_t value_bytes, bool minimal) -> std::string { view v; - if (v.set_meta_data(metadata_data, metadata_bytes)) + if (v.set_metadata(metadata)) { if (v.set_value_data(value_data, value_bytes)) { diff --git a/src/abacus/to_json.hpp b/src/abacus/to_json.hpp index 7c29ea06..69adb51a 100644 --- a/src/abacus/to_json.hpp +++ b/src/abacus/to_json.hpp @@ -16,13 +16,19 @@ inline namespace STEINWURF_ABACUS_VERSION { /// @return a JSON-formatted string of a metrics views data. -/// @param metadata_data The meta data of the metrics view. -/// @param metadata_bytes The size of the meta data. -/// @param value_data The value data of the metrics view. +/// @param metrics The metrics. +/// @param minimal If true, the JSON will be slimmed down to only contain the +/// the value data. +auto to_json(const protobuf::Metrics& metrics, + bool minimal = false) -> std::string; + +/// @return a JSON-formatted string of a metrics views data. +/// @param metadata The metadata of the metrics. +/// @param value_data The value data of the metrics. /// @param value_bytes The size of the value data. /// @param minimal If true, the JSON will be slimmed down to only contain the /// the value data. -auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, +auto to_json(const protobuf::MetricsMetadata& metadata, const uint8_t* value_data, std::size_t value_bytes, bool minimal = false) -> std::string; diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 3a14a700..b1f0162e 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -27,33 +27,35 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -[[nodiscard]] auto view::set_meta_data(const uint8_t* metadata_data, - std::size_t metadata_bytes) -> bool +[[nodiscard]] auto view::set_metrics(const protobuf::Metrics& metrics) -> bool { - assert(metadata_data != nullptr); - m_metadata_data = metadata_data; - m_metadata_bytes = metadata_bytes; - m_value_data = nullptr; - m_value_bytes = 0; - - auto result = m_metadata.ParseFromArray(metadata_data, metadata_bytes); - if (!result) + assert(metrics.IsInitialized()); + if (set_metadata(metrics.metadata())) { - return false; + return set_value_data((const uint8_t*)metrics.values().data(), + metrics.values().size()); } + return false; +} + +[[nodiscard]] auto +view::set_metadata(const protobuf::MetricsMetadata& metadata) -> bool +{ + assert(metadata.IsInitialized()); + m_metadata = metadata; if (m_metadata.protocol_version() != protocol_version()) { + m_metadata.Clear(); return false; } - return true; } [[nodiscard]] auto view::set_value_data(const uint8_t* value_data, std::size_t value_bytes) -> bool { - assert(m_metadata_data != nullptr); + assert(m_metadata.IsInitialized()); assert(value_data != nullptr); // Check that the hash is correct @@ -79,21 +81,11 @@ inline namespace STEINWURF_ABACUS_VERSION return true; } -auto view::metadata_data() const -> const uint8_t* -{ - return m_metadata_data; -} - const uint8_t* view::value_data() const { return m_value_data; } -std::size_t view::metadata_bytes() const -{ - return m_metadata_bytes; -} - std::size_t view::value_bytes() const { return m_value_bytes; @@ -114,8 +106,8 @@ template auto view::value(const std::string& name) const -> std::optional { + assert(m_metadata.IsInitialized()); assert(m_value_data != nullptr); - assert(m_metadata_data != nullptr); auto m = metric(name); auto offset = m.offset(); assert(offset < m_value_bytes); diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index 7ca1f3b4..d3fd1780 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -26,19 +26,23 @@ inline namespace STEINWURF_ABACUS_VERSION /// The class cannot manipulate the memory, only access the values. /// /// Note that this class has no constructor, so it can only be declared and -/// then view.set_meta_data() can be called to initialize the view with the +/// then view.set_metadata() can be called to initialize the view with the /// meta data, subsequently view.set_value_data() can be called to populate /// the view with the value data. To update the view with new value data /// view.set_value_data() can be called again. class view { public: - /// Sets the meta data pointer - /// @param metadata_data The meta data pointer - /// @param metadata_bytes The meta data size in bytes + /// Sets the metrics + /// @param metrics The metrics + /// @return true if the metrics were unpacked correctly otherwise false + [[nodiscard]] auto set_metrics(const protobuf::Metrics& metrics) -> bool; + + /// Sets the meta data + /// @param metadata The meta data /// @return true if the meta data was unpacked correctly otherwise false - [[nodiscard]] auto set_meta_data(const uint8_t* metadata_data, - std::size_t metadata_bytes) -> bool; + [[nodiscard]] + auto set_metadata(const protobuf::MetricsMetadata& metadata) -> bool; /// Sets the value data pointer /// @param value_data The value data pointer @@ -47,22 +51,19 @@ class view [[nodiscard]] auto set_value_data(const uint8_t* value_data, std::size_t value_bytes) -> bool; - /// Gets the meta data pointer - /// @return The meta data pointer - auto metadata_data() const -> const uint8_t*; - /// Gets the value data pointer /// @return The value data pointer const uint8_t* value_data() const; - /// Gets the meta data size in bytes - /// @return The meta data size in bytes - std::size_t metadata_bytes() const; - /// Gets the value data size in bytes /// @return The value data size in bytes std::size_t value_bytes() const; + /// Gets the metric + /// @param name The name of the metric + /// @return The metric + const protobuf::Metric& metric(const std::string& name) const; + /// Gets the meta data /// @return The meta data auto metadata() const -> const protobuf::MetricsMetadata&; @@ -75,18 +76,7 @@ class view auto value(const std::string& name) const -> std::optional; - /// Gets the metric - /// @param name The name of the metric - /// @return The metric - const protobuf::Metric& metric(const std::string& name) const; - private: - /// The meta data pointer - const uint8_t* m_metadata_data; - - /// The meta data size in bytes - std::size_t m_metadata_bytes; - /// The meta data protobuf::MetricsMetadata m_metadata; diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 6fb70e29..f27a8d33 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -63,7 +63,8 @@ TEST(test_metrics, api) abacus::description{"A constant floating point metric"}, abacus::required, abacus::unit{"ms"}}}, {abacus::name{name6}, - abacus::enum8{abacus::description{"An enum metric"}, + abacus::enum8{abacus::gauge, + abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -114,6 +115,8 @@ TEST(test_metrics, api) "A constant floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().unit(), "ms"); + EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().kind(), + abacus::gauge.value); EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().description(), "An enum metric"); EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().values().size(), @@ -214,7 +217,7 @@ TEST(test_metrics, value_and_metadata_bytes) (void)m0; (void)m1; - EXPECT_EQ(metrics.metadata_bytes(), 112U); + EXPECT_EQ(metrics.metadata().ByteSizeLong(), 112U); EXPECT_EQ(metrics.value_bytes(), sizeof(uint32_t) + // hash 1 + sizeof(uint64_t) + // metric0 has_value + value @@ -266,7 +269,7 @@ TEST(test_metrics, reset_counters) EXPECT_EQ(int_metric.value(), -4); } -static const std::vector expected_meta_data = { +static const std::vector expected_metadata = { 0x08, 0x02, 0x1d, 0x26, 0x65, 0xd9, 0x06, 0x22, 0x34, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x08, 0x04, 0x1a, 0x25, 0x0a, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, @@ -330,21 +333,26 @@ TEST(test_metrics, protocol_version) (void)float_metric; (void)bool_metric; - EXPECT_EQ(metrics.metadata_bytes(), expected_meta_data.size()); + EXPECT_EQ(metrics.metadata().ByteSizeLong(), expected_metadata.size()); { // Print the metadata as hex std::stringstream meta_stream; meta_stream << std::hex; - for (std::size_t i = 0; i < metrics.metadata_bytes(); ++i) + + auto metadata = metrics.metadata(); + std::vector metadata_data(metadata.ByteSizeLong()); + metadata.SerializeToArray(metadata_data.data(), metadata_data.size()); + + for (auto byte : metadata_data) { meta_stream << "0x" << std::setw(2) << std::setfill('0') - << static_cast(metrics.metadata_data()[i]) << ", "; + << static_cast(byte) << ", "; } SCOPED_TRACE(::testing::Message() << "Meta data:\n" << meta_stream.str()); - auto expected = abacus::parse_metadata(expected_meta_data.data(), - expected_meta_data.size()); + auto expected = abacus::parse_metadata(expected_metadata.data(), + expected_metadata.size()); auto actual = metrics.metadata(); expected.set_sync_value(1); @@ -419,10 +427,12 @@ TEST(test_metrics, reset) {abacus::name{"boolean_optional"}, abacus::boolean{abacus::gauge, abacus::description{""}, abacus::optional}}, - {abacus::name{"enum8_required"}, abacus::enum8{abacus::description{""}, + {abacus::name{"enum8_required"}, abacus::enum8{abacus::gauge, + abacus::description{""}, {{0, {"", ""}}}, abacus::required}}, - {abacus::name{"enum8_optional"}, abacus::enum8{abacus::description{""}, + {abacus::name{"enum8_optional"}, abacus::enum8{abacus::gauge, + abacus::description{""}, {{0, {"", ""}}}, abacus::optional}}, {abacus::name{"uint64_constant"}, @@ -446,6 +456,10 @@ TEST(test_metrics, reset) {abacus::name{"boolean_constant"}, abacus::boolean{abacus::constant, abacus::description{""}, abacus::required}}, + {abacus::name{"enum8_constant"}, abacus::enum8{abacus::constant, + abacus::description{""}, + {{0, {"", ""}}}, + abacus::required}}, // Finally a metric that we do not initialize {abacus::name{"not_initialized_required"}, @@ -499,6 +513,7 @@ TEST(test_metrics, reset) metrics.initialize_constant("float64_constant", 5555.0); metrics.initialize_constant("float32_constant", 6666.0); metrics.initialize_constant("boolean_constant", true); + metrics.initialize_constant("enum8_constant", 77U); // Check all required values EXPECT_EQ(uint64_required.value(), 1U); @@ -561,8 +576,7 @@ TEST(test_metrics, reset) // Create a view to see the constants abacus::view view; - ASSERT_TRUE( - view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes())); + ASSERT_TRUE(view.set_metadata(metrics.metadata())); ASSERT_TRUE( view.set_value_data(metrics.value_data(), metrics.value_bytes())); @@ -574,6 +588,7 @@ TEST(test_metrics, reset) EXPECT_EQ(view.value("float64_constant").value(), 5555.0); EXPECT_EQ(view.value("float32_constant").value(), 6666.0); EXPECT_EQ(view.value("boolean_constant").value(), true); + EXPECT_EQ(view.value("enum8_constant").value(), 77U); // While we are at it, let's check the other values as well EXPECT_EQ(view.value("uint64_required").value(), 111U); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 75d6b2b2..f845663f 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -43,7 +43,8 @@ TEST(test_to_json, to_json_minimal) abacus::description{"A boolean constant"}, abacus::required}}, {abacus::name{name3}, - abacus::enum8{abacus::description{"An enum metric"}, + abacus::enum8{abacus::gauge, + abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -62,8 +63,7 @@ TEST(test_to_json, to_json_minimal) (void)m3; abacus::view view; - bool success = - view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); + bool success = view.set_metadata(metrics.metadata()); ASSERT_TRUE(success); success = view.set_value_data(metrics.value_data(), metrics.value_bytes()); ASSERT_TRUE(success); @@ -109,6 +109,7 @@ static const char* expected_json = R"({ "metric3" : { "enum8" : { "description" : "An enum metric", + "kind" : "GAUGE", "values" : { "0" : { "description" : "The value for 0", @@ -168,7 +169,8 @@ TEST(test_to_json, to_json) abacus::description{"A boolean constant"}, abacus::required}}, {abacus::name{name3}, - abacus::enum8{abacus::description{"An enum metric"}, + abacus::enum8{abacus::gauge, + abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -189,8 +191,7 @@ TEST(test_to_json, to_json) (void)m1; abacus::view view; - bool success = - view.set_meta_data(metrics.metadata_data(), metrics.metadata_bytes()); + bool success = view.set_metadata(metrics.metadata()); ASSERT_TRUE(success); success = view.set_value_data(metrics.value_data(), metrics.value_bytes()); ASSERT_TRUE(success); @@ -201,10 +202,13 @@ TEST(test_to_json, to_json) bourne::json::parse(json_from_view, error); EXPECT_FALSE(error); - auto json_from_data = - abacus::to_json(metrics.metadata_data(), metrics.metadata_bytes(), - metrics.value_data(), metrics.value_bytes()); + auto json_from_data = abacus::to_json( + metrics.metadata(), metrics.value_data(), metrics.value_bytes()); EXPECT_EQ(json_from_view, json_from_data); EXPECT_EQ(json_from_view, expected_json) << json_from_view; + + auto to_json_from_metrics = abacus::to_json(metrics.protobuf()); + EXPECT_EQ(to_json_from_metrics, json_from_data); + EXPECT_EQ(to_json_from_metrics, expected_json) << json_from_view; } diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index e599f553..970042e1 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -35,7 +35,8 @@ TEST(test_view, api) abacus::description{"A constant floating point metric"}, abacus::required, abacus::unit{"ms"}}}, {abacus::name{name3}, - abacus::enum8{abacus::description{"An enum metric"}, + abacus::enum8{abacus::gauge, + abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -52,15 +53,12 @@ TEST(test_view, api) auto metric3 = metrics.initialize_optional(name3); - std::vector meta_data(metrics.metadata_bytes()); std::vector value_data(metrics.value_bytes()); - std::memcpy(meta_data.data(), metrics.metadata_data(), - metrics.metadata_bytes()); std::memcpy(value_data.data(), metrics.value_data(), metrics.value_bytes()); abacus::view view; - bool success = view.set_meta_data(meta_data.data(), meta_data.size()); + bool success = view.set_metadata(metrics.metadata()); ASSERT_TRUE(success); EXPECT_EQ(view.metadata().protocol_version(), abacus::protocol_version()); @@ -89,6 +87,13 @@ TEST(test_view, api) metric1 = -1000; metric3 = 2; + // Check that the view is not updated + EXPECT_FALSE(view_value0.has_value()); + EXPECT_FALSE(view_value1.has_value()); + EXPECT_TRUE(view_value2.has_value()); + EXPECT_EQ(3.14, view_value2.value()); + EXPECT_FALSE(view_value3.has_value()); + // and provide new value data to the view success = view.set_value_data(metrics.value_data(), metrics.value_bytes()); ASSERT_TRUE(success); From e377dbc0deb207ac81766e7053f992833ba96268 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 24 Jan 2025 14:03:34 +0100 Subject: [PATCH 27/68] fix docs --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index b9fbe6a7..3720ab24 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ wurfapi = { "source_paths": [ # API - "../src/abacus/availablity.hpp", + "../src/abacus/availability.hpp", "../src/abacus/boolean.hpp", "../src/abacus/description.hpp", "../src/abacus/enum8.hpp", From 39f8fa04401c7546a10e955ae0fac8dfd7f36284 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 24 Jan 2025 14:05:38 +0100 Subject: [PATCH 28/68] fix docs --- src/abacus/metrics.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 95e91686..e090bde6 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -52,7 +52,6 @@ class metrics /// Initialize a metric /// @param name The name of the metric - /// @param value Optional initial value of the metric /// @return The metric object template [[nodiscard]] auto initialize_optional(const std::string& name) -> From b5e102d3a5b7e9b6ea44b4ff3fdc393058dfaed0 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 24 Jan 2025 14:07:38 +0100 Subject: [PATCH 29/68] fix docs --- src/abacus/kind.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index 9202a95e..c79b61ec 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -15,6 +15,7 @@ inline namespace STEINWURF_ABACUS_VERSION /// Tag type representing a gauge kind. struct gauge_ { + /// The protobuf kind value for the gauge kind. static constexpr protobuf::Kind value = protobuf::Kind::GAUGE; }; @@ -24,6 +25,7 @@ static const gauge_ gauge; /// Tag type representing a counter kind. struct counter_ { + /// The protobuf kind value for the counter kind. static constexpr protobuf::Kind value = protobuf::Kind::COUNTER; }; @@ -33,6 +35,7 @@ static const counter_ counter; /// Tag type representing a constant kind. struct constant_ { + /// The protobuf kind value for the constant kind. static constexpr protobuf::Kind value = protobuf::Kind::CONSTANT; }; From 2bc772873c1c3f478d5ae0a5e3dcfc11c61756a6 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 24 Jan 2025 14:13:29 +0100 Subject: [PATCH 30/68] availablity -> availability --- docs/user_api/availablity.rst | 2 -- docs/user_api/user_api.rst | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 docs/user_api/availablity.rst diff --git a/docs/user_api/availablity.rst b/docs/user_api/availablity.rst deleted file mode 100644 index 80e6ee83..00000000 --- a/docs/user_api/availablity.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: class_synopsis.rst - :selector: abacus::availablity diff --git a/docs/user_api/user_api.rst b/docs/user_api/user_api.rst index 895f9830..508a1fc3 100644 --- a/docs/user_api/user_api.rst +++ b/docs/user_api/user_api.rst @@ -15,7 +15,7 @@ Overview of the public API. metric_info/metric_info kind description - availablity + availability unit min max From 4a8e7ad52091ba025f7d0973ff6d023e434f0c04 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 24 Jan 2025 14:13:39 +0100 Subject: [PATCH 31/68] availablity -> availability --- docs/user_api/availability.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/user_api/availability.rst diff --git a/docs/user_api/availability.rst b/docs/user_api/availability.rst new file mode 100644 index 00000000..d8afdd88 --- /dev/null +++ b/docs/user_api/availability.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::availability From 490c9bf79b4e5d51a3cbecff01ecbfefe0edd1a4 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 24 Jan 2025 14:45:47 +0100 Subject: [PATCH 32/68] fix docs --- docs/requirements.txt | 2 +- docs/user_api/availability.rst | 2 +- docs/user_api/kind.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index e93cf4fb..02d30f30 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -115,5 +115,5 @@ versjon==2.3.0 # via -r docs/requirements.in virtualenv==20.17.1 # via giit -wurfapi==9.0.0 +wurfapi==9.1.1 # via -r docs/requirements.in diff --git a/docs/user_api/availability.rst b/docs/user_api/availability.rst index d8afdd88..9e05d16a 100644 --- a/docs/user_api/availability.rst +++ b/docs/user_api/availability.rst @@ -1,2 +1,2 @@ -.. wurfapi:: class_synopsis.rst +.. wurfapi:: type_alias_synopsis.rst :selector: abacus::availability diff --git a/docs/user_api/kind.rst b/docs/user_api/kind.rst index aa114956..548d8766 100644 --- a/docs/user_api/kind.rst +++ b/docs/user_api/kind.rst @@ -1,2 +1,2 @@ -.. wurfapi:: enum_synopsis.rst +.. wurfapi:: type_alias_synopsis.rst :selector: abacus::kind From 1403970d0f6190db713b5732b0fa97baabefa7c4 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 09:25:22 +0100 Subject: [PATCH 33/68] work --- NEWS.rst | 1 + test/src/test_metric.cpp | 74 ++++++++++++++++++++-------------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 32a76f7e..96391a07 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -6,6 +6,7 @@ every change, see the Git log. Latest ------ +* Major: Changed protocol format to version 2. * Minor: Added benchmark. * Major: Changed the metadata to be specified using protobuf 3. * Major: Changed callbacks to now use std::function rather than the custom diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index a5ede2b1..a6d04a78 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -24,44 +24,44 @@ TEST(test_metric, constructor) EXPECT_EQ(uint_metric.value(), 42U); } -// TEST(test_metric, float_assignment) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); +TEST(test_metric, float_assignment) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); -// abacus::float64::optional double_metric(data); -// EXPECT_TRUE(double_metric.is_initialized()); -// EXPECT_FALSE(double_metric.has_value()); -// double_metric = 1123.12; -// EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); + abacus::float64::optional double_metric(data); + EXPECT_TRUE(double_metric.is_initialized()); + EXPECT_FALSE(double_metric.has_value()); + double_metric = 1123.12; + EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); -// // Assignment -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / -0.0, ""); + // Assignment + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric = 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric = 1 / -0.0, ""); -// // Add and Assign -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric += 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric += 1 / -0.0, ""); + // Add and Assign + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric += 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric += 1 / -0.0, ""); -// // Subtract and Assign -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); -// } + // Subtract and Assign + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +} From 77cedfce58aa199f7dc3c7504aa3167b70bbad64 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 11:14:36 +0100 Subject: [PATCH 34/68] add parser for Metrics --- docs/conf.py | 2 +- docs/user_api/parse.rst | 2 ++ src/abacus/{parse_metadata.cpp => parse.cpp} | 16 +++++++-- src/abacus/parse.hpp | 36 ++++++++++++++++++++ src/abacus/parse_metadata.hpp | 22 ------------ test/src/test_metrics.cpp | 6 ++-- 6 files changed, 55 insertions(+), 29 deletions(-) create mode 100644 docs/user_api/parse.rst rename src/abacus/{parse_metadata.cpp => parse.cpp} (50%) create mode 100644 src/abacus/parse.hpp delete mode 100644 src/abacus/parse_metadata.hpp diff --git a/docs/conf.py b/docs/conf.py index 3720ab24..584e2a8c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,7 +36,7 @@ "../src/abacus/metrics.hpp", "../src/abacus/min.hpp", "../src/abacus/name.hpp", - "../src/abacus/parse_metadata.hpp", + "../src/abacus/parse.hpp", "../src/abacus/protocol_version.hpp", "../src/abacus/to_json.hpp", "../src/abacus/uint32.hpp", diff --git a/docs/user_api/parse.rst b/docs/user_api/parse.rst new file mode 100644 index 00000000..25583316 --- /dev/null +++ b/docs/user_api/parse.rst @@ -0,0 +1,2 @@ +.. wurfapi:: class_synopsis.rst + :selector: abacus::parse diff --git a/src/abacus/parse_metadata.cpp b/src/abacus/parse.cpp similarity index 50% rename from src/abacus/parse_metadata.cpp rename to src/abacus/parse.cpp index 72d9864d..b2817f8a 100644 --- a/src/abacus/parse_metadata.cpp +++ b/src/abacus/parse.cpp @@ -3,7 +3,7 @@ // // Distributed under the "BSD License". See the accompanying LICENSE.rst file. -#include "parse_metadata.hpp" +#include "parse.hpp" #include #include @@ -13,8 +13,8 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -auto parse_metadata(const uint8_t* metadata_data, - std::size_t metadata_bytes) -> protobuf::MetricsMetadata +auto parse::metadata(const uint8_t* metadata_data, + std::size_t metadata_bytes) -> protobuf::MetricsMetadata { assert(metadata_data != nullptr); assert(metadata_bytes > 0); @@ -22,5 +22,15 @@ auto parse_metadata(const uint8_t* metadata_data, metadata.ParseFromArray(metadata_data, metadata_bytes); return metadata; } + +auto parse::metrics(const uint8_t* metrics_data, + std::size_t metrics_bytes) -> protobuf::Metrics +{ + assert(metrics_data != nullptr); + assert(metrics_bytes > 0); + protobuf::Metrics metrics; + metrics.ParseFromArray(metrics_data, metrics_bytes); + return metrics; +} } } diff --git a/src/abacus/parse.hpp b/src/abacus/parse.hpp new file mode 100644 index 00000000..339ed181 --- /dev/null +++ b/src/abacus/parse.hpp @@ -0,0 +1,36 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include + +#include "protobuf/metrics.pb.h" +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +struct parse +{ +private: + /// Private constructor to prevent instantiation of this class + parse() = delete; + +public: + /// @param metadata_data The meta data pointer + /// @param metadata_bytes The meta data size in bytes + static auto + metadata(const uint8_t* metadata_data, + std::size_t metadata_bytes) -> protobuf::MetricsMetadata; + + /// @param metrics_data The metrics pointer + /// @param metrics_bytes The metrics size in bytes + static auto metrics(const uint8_t* metrics_data, + std::size_t metrics_bytes) -> protobuf::Metrics; +}; +} +} diff --git a/src/abacus/parse_metadata.hpp b/src/abacus/parse_metadata.hpp deleted file mode 100644 index 61041125..00000000 --- a/src/abacus/parse_metadata.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include - -#include "protobuf/metrics.pb.h" -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -/// @param metadata_data The meta data pointer -/// @param metadata_bytes The meta data size in bytes -auto parse_metadata(const uint8_t* metadata_data, - std::size_t metadata_bytes) -> protobuf::MetricsMetadata; -} -} diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index f27a8d33..583d07f8 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -351,8 +351,8 @@ TEST(test_metrics, protocol_version) SCOPED_TRACE(::testing::Message() << "Meta data:\n" << meta_stream.str()); - auto expected = abacus::parse_metadata(expected_metadata.data(), - expected_metadata.size()); + auto expected = abacus::parse::metadata(expected_metadata.data(), + expected_metadata.size()); auto actual = metrics.metadata(); expected.set_sync_value(1); From c1ab0fc33697ac61ffb73397f535d91827d92c53 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 11:58:40 +0100 Subject: [PATCH 35/68] fix build --- .github/workflows/linux_cmake.yml | 2 +- .github/workflows/linux_mkspecs.yml | 2 +- .github/workflows/valgrind.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux_cmake.yml b/.github/workflows/linux_cmake.yml index f1834d81..5279bbc4 100644 --- a/.github/workflows/linux_cmake.yml +++ b/.github/workflows/linux_cmake.yml @@ -45,7 +45,7 @@ jobs: CXX: clang++ cc: clang cxxflags: '-fsanitize=thread -fPIE -g' - env: TSAN_OPTIONS="suppressions=../tsan_suppression.txt" + env: runner: ubuntu-current - name: Clang Undefined Sanitizer Latest CXX: clang++ diff --git a/.github/workflows/linux_mkspecs.yml b/.github/workflows/linux_mkspecs.yml index 006a9bb1..e3ee555c 100644 --- a/.github/workflows/linux_mkspecs.yml +++ b/.github/workflows/linux_mkspecs.yml @@ -58,7 +58,7 @@ jobs: with: max_attempts: 3 timeout_minutes: 15 - command: python3 waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} --ninja + command: python3 waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} - name: Waf Build run: | echo "::add-matcher::.github/gcc-problem-matcher.json" diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index f8ca271d..0acad224 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -28,13 +28,13 @@ jobs: with: max_attempts: 3 timeout_minutes: 15 - command: python3 waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} --ninja + command: python3 waf configure --git_protocol=git@ ${{ env.EXTRA_RESOLVE_OPTIONS }} - name: Build run: | echo "::add-matcher::.github/gcc-problem-matcher.json" python3 waf - name: Valgrind Test - run: valgrind --suppressions=valgrind_suppressions.txt --leak-check=full --error-exitcode=1 build_current/abacus_tests + run: valgrind --leak-check=full --error-exitcode=1 build_current/abacus_tests concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} From 533c0dfe13e8db01f705b1c0af030bd2c9bccadc Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 16:13:29 +0100 Subject: [PATCH 36/68] work --- examples/metrics_simple.cpp | 13 +- protobuf/kind.proto | 36 +++- protobuf/metrics.proto | 5 - src/abacus/metrics.cpp | 66 +++--- src/abacus/metrics.hpp | 19 +- src/abacus/parse.cpp | 10 - src/abacus/parse.hpp | 5 - src/abacus/protobuf/metrics.pb.cc | 287 +------------------------ src/abacus/protobuf/metrics.pb.h | 336 ------------------------------ src/abacus/to_json.cpp | 20 +- src/abacus/to_json.hpp | 8 - src/abacus/view.cpp | 12 -- src/abacus/view.hpp | 5 - test/src/test_to_json.cpp | 4 - 14 files changed, 96 insertions(+), 730 deletions(-) diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index e12002e6..86922f72 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -14,28 +14,23 @@ // Simple example of metrics on a car. int main() { - std::string name0 = "fuel_consumption"; - std::string name1 = "wheels"; - std::string name2 = "days_until_maintenance"; - std::string name3 = "registered"; - std::map infos = { - {abacus::name{name0}, + {abacus::name{"fuel_consumption"}, abacus::float64{ abacus::constant, abacus::description{"Fuel consumption in kilometers per liter"}, abacus::required, abacus::unit{"km/l"}}}, - {abacus::name{name1}, + {abacus::name{"wheels"}, abacus::uint64{abacus::constant, abacus::description{"Wheels on the car"}, abacus::required, abacus::unit{"wheels"}}}, - {abacus::name{name2}, + {abacus::name{"days_until_maintenance"}, abacus::int64{ abacus::gauge, abacus::description{"Days until next maintenance, if less than 0, " "maintenance is overdue"}, abacus::required, abacus::unit{"days"}}}, - {abacus::name{name3}, + {abacus::name{"registered"}, abacus::boolean{abacus::gauge, abacus::description{"Is the car registered"}, abacus::optional}}}; diff --git a/protobuf/kind.proto b/protobuf/kind.proto index aeaa2cf9..b6e32d20 100644 --- a/protobuf/kind.proto +++ b/protobuf/kind.proto @@ -2,9 +2,37 @@ syntax = "proto3"; package abacus.protobuf; option go_package = "abacus/protobuf"; -// Specifies the kind of metric enum Kind { - GAUGE = 0; // Gauge metric - COUNTER = 1; // Counter metric - CONSTANT = 2; // Constant metric + GAUGE = 0; + COUNTER = 1; + CONSTANT = 2; } + +// // A gauge metric +// message Gauge{ + +// // Whether the metric is optional +// bool optional = 1; +// } + +// // A counter metric +// message Counter{ + +// // Whether the metric is optional +// bool optional = 1; +// } + +// // A constant metric +// message Constant{ +// } + +// // A metric kind +// message Kind { + +// // The kind of metric +// oneof value { +// Gauge gauge = 1; // Gauge metric +// Counter counter = 2; // Counter metric +// Constant constant = 3; // Constant metric +// } +// } diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 19c0f04f..3e01ca1a 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -106,8 +106,3 @@ message MetricsMetadata { fixed32 sync_value = 3; // Synchronization value map metrics = 4; // Mapping from metric name to metadata } - -message Metrics { - optional MetricsMetadata metadata = 1; // Metadata for all metrics - bytes values = 2; // Packed memory for all metrics -} diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 49b88a8e..323aba34 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -50,11 +50,14 @@ static inline auto get_kind(const protobuf::Metric& metric) -> protobuf::Kind } metrics::metrics(metrics&& other) noexcept : - m_proto_metrics(std::move(other.m_proto_metrics)), m_hash(other.m_hash), + m_metadata(std::move(other.m_metadata)), m_data(std::move(other.m_data)), + m_metadata_bytes(other.m_metadata_bytes), m_hash(other.m_hash), m_value_bytes(other.m_value_bytes), m_initialized(std::move(other.m_initialized)) { - other.m_proto_metrics = protobuf::Metrics(); + other.m_metadata = protobuf::MetricsMetadata(); + other.m_data.clear(); + other.m_metadata_bytes = 0; other.m_hash = 0; other.m_value_bytes = 0; other.m_initialized.clear(); @@ -62,12 +65,11 @@ metrics::metrics(metrics&& other) noexcept : metrics::metrics(const std::map& info) { - m_proto_metrics = protobuf::Metrics(); - m_proto_metrics.mutable_metadata()->set_protocol_version( - protocol_version()); - m_proto_metrics.mutable_metadata()->set_endianness( - endian::is_big_endian() ? protobuf::Endianness::BIG - : protobuf::Endianness::LITTLE); + m_metadata = protobuf::MetricsMetadata(); + m_metadata.set_protocol_version(protocol_version()); + m_metadata.set_endianness(endian::is_big_endian() + ? protobuf::Endianness::BIG + : protobuf::Endianness::LITTLE); // The first byte is reserved for the sync value m_value_bytes = sizeof(uint32_t); @@ -238,43 +240,38 @@ metrics::metrics(const std::map& info) } } - m_proto_metrics.mutable_metadata()->mutable_metrics()->insert( - {name.value, metric}); + m_metadata.mutable_metrics()->insert({name.value, metric}); m_initialized[name.value] = false; } // Set the sync value to 1 so that the size of the metadata is // calculated correctly - m_proto_metrics.mutable_metadata()->set_sync_value(1); + m_metadata.set_sync_value(1); - auto metadata_bytes = metadata().ByteSizeLong(); + m_metadata_bytes = metadata().ByteSizeLong(); - std::vector data(metadata_bytes); + m_data.resize(m_metadata_bytes + m_value_bytes); // Serialize the metadata - metadata().SerializeToArray(data.data(), data.size()); + metadata().SerializeToArray(m_data.data(), m_metadata_bytes); // Calculate the hash of the metadata - m_hash = detail::hash_function(data.data(), data.size()); + m_hash = detail::hash_function(m_data.data(), m_metadata_bytes); // Update the sync value - m_proto_metrics.mutable_metadata()->set_sync_value(m_hash); + m_metadata.set_sync_value(m_hash); - // // Serialize the metadata again to include the sync value - // metadata().SerializeToArray(data.data(), data.size()); + // Serialize the metadata again to include the sync value + metadata().SerializeToArray(m_data.data(), m_metadata_bytes); // Make sure the metadata didn't change unexpectedly - assert(metadata().ByteSizeLong() == metadata_bytes); + assert(metadata().ByteSizeLong() == m_metadata_bytes); // Write the sync value to the first byte of the value data (this will // be written as the endianess of the system) // Consuming code can use the endianness field in the metadata to // read the sync value - - m_proto_metrics.mutable_values()->resize(m_value_bytes); - - std::memcpy(m_proto_metrics.mutable_values()->data(), &m_hash, - sizeof(uint32_t)); + std::memcpy(value_data(0), &m_hash, sizeof(uint32_t)); } template @@ -396,12 +393,12 @@ metrics::~metrics() auto metrics::value_data() const -> const uint8_t* { - return (const uint8_t*)m_proto_metrics.values().data(); + return m_data.data() + m_metadata_bytes; } auto metrics::value_data(std::size_t offset) -> uint8_t* { - return (uint8_t*)m_proto_metrics.mutable_values()->data() + offset; + return m_data.data() + offset + m_metadata_bytes; } auto metrics::value_bytes() const -> std::size_t @@ -411,7 +408,17 @@ auto metrics::value_bytes() const -> std::size_t auto metrics::metadata() const -> const protobuf::MetricsMetadata& { - return m_proto_metrics.metadata(); + return m_metadata; +} + +auto metrics::metadata_data() const -> const uint8_t* +{ + return m_data.data(); +} + +auto metrics::metadata_bytes() const -> std::size_t +{ + return m_metadata.ByteSizeLong(); } auto metrics::is_initialized(const std::string& name) const -> bool @@ -507,10 +514,5 @@ auto metrics::reset() -> void } } } - -auto metrics::protobuf() const -> const protobuf::Metrics& -{ - return m_proto_metrics; -} } } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index e090bde6..2a487606 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -77,6 +77,12 @@ class metrics /// during initialization. auto reset() -> void; + /// @return the pointer to the metadata part of the metrics. + auto metadata_data() const -> const uint8_t*; + + /// @return the size of the metadata part of the metrics. + auto metadata_bytes() const -> std::size_t; + /// @return the const pointer to the value data of the metrics. auto value_data() const -> const uint8_t*; @@ -86,11 +92,6 @@ class metrics /// @return the metadata part of the metrics. auto metadata() const -> const protobuf::MetricsMetadata&; - /// Get the protobuf representation of the metrics including both metadata - /// and value data - /// @return The protobuf representation of the metrics - auto protobuf() const -> const protobuf::Metrics&; - private: /// @param offset The offset of the value data /// @return the pointer to the value data of the metrics. @@ -104,7 +105,13 @@ class metrics private: /// The info of the metrics separated by byte-sizes - protobuf::Metrics m_proto_metrics; + protobuf::MetricsMetadata m_metadata; + + /// Data of the metrics, both metadata and values + std::vector m_data; + + /// The size of the metadata in bytes + std::size_t m_metadata_bytes; /// The hash of the metadata uint32_t m_hash; diff --git a/src/abacus/parse.cpp b/src/abacus/parse.cpp index b2817f8a..14b38827 100644 --- a/src/abacus/parse.cpp +++ b/src/abacus/parse.cpp @@ -22,15 +22,5 @@ auto parse::metadata(const uint8_t* metadata_data, metadata.ParseFromArray(metadata_data, metadata_bytes); return metadata; } - -auto parse::metrics(const uint8_t* metrics_data, - std::size_t metrics_bytes) -> protobuf::Metrics -{ - assert(metrics_data != nullptr); - assert(metrics_bytes > 0); - protobuf::Metrics metrics; - metrics.ParseFromArray(metrics_data, metrics_bytes); - return metrics; -} } } diff --git a/src/abacus/parse.hpp b/src/abacus/parse.hpp index 339ed181..a1c6ab31 100644 --- a/src/abacus/parse.hpp +++ b/src/abacus/parse.hpp @@ -26,11 +26,6 @@ struct parse static auto metadata(const uint8_t* metadata_data, std::size_t metadata_bytes) -> protobuf::MetricsMetadata; - - /// @param metrics_data The metrics pointer - /// @param metrics_bytes The metrics size in bytes - static auto metrics(const uint8_t* metrics_data, - std::size_t metrics_bytes) -> protobuf::Metrics; }; } } diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index 097d8e00..5927cab7 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -321,30 +321,9 @@ struct MetricsMetadataDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; - template -PROTOBUF_CONSTEXPR Metrics::Metrics(::_pbi::ConstantInitialized) - : _impl_{ - /*decltype(_impl_._has_bits_)*/ {}, - /*decltype(_impl_._cached_size_)*/ {}, - /*decltype(_impl_.values_)*/ { - &::_pbi::fixed_address_empty_string, - ::_pbi::ConstantInitialized{}, - }, - /*decltype(_impl_.metadata_)*/ nullptr, - } {} -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 } // namespace abacus -static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]; +static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; @@ -555,18 +534,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.endianness_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.sync_value_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata, _impl_.metrics_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metrics, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::abacus::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(::abacus::protobuf::Metrics, _impl_.metadata_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metrics, _impl_.values_), - 0, - ~0u, }; static const ::_pbi::MigrationSchema @@ -584,7 +551,6 @@ static const ::_pbi::MigrationSchema {162, -1, -1, sizeof(::abacus::protobuf::Metric)}, {181, 191, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, {193, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, - {205, 215, -1, sizeof(::abacus::protobuf::Metrics)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -601,7 +567,6 @@ static const ::_pb::Message* const file_default_instances[] = { &::abacus::protobuf::_Metric_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_MetricsEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_default_instance_._instance, - &::abacus::protobuf::_Metrics_default_instance_._instance, }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." @@ -656,11 +621,9 @@ const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTO "\022\n\nsync_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.a" "bacus.protobuf.MetricsMetadata.MetricsEn" "try\032G\n\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005valu" - "e\030\002 \001(\0132\027.abacus.protobuf.Metric:\0028\001\"_\n\007" - "Metrics\0227\n\010metadata\030\001 \001(\0132 .abacus.proto" - "buf.MetricsMetadataH\000\210\001\001\022\016\n\006values\030\002 \001(\014" - "B\013\n\t_metadata*!\n\nEndianness\022\n\n\006LITTLE\020\000\022" - "\007\n\003BIG\020\001B\021Z\017abacus/protobufb\006proto3" + "e\030\002 \001(\0132\027.abacus.protobuf.Metric:\0028\001*!\n\n" + "Endianness\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacu" + "s/protobufb\006proto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps[1] = { @@ -670,13 +633,13 @@ static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_on const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2275, + 2178, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps, 1, - 14, + 13, schemas, file_default_instances, TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets, @@ -4603,244 +4566,6 @@ ::google::protobuf::Metadata MetricsMetadata::GetMetadata() const { &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); } -// =================================================================== - -class Metrics::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(Metrics, _impl_._has_bits_); - static const ::abacus::protobuf::MetricsMetadata& metadata(const Metrics* msg); - static void set_has_metadata(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::abacus::protobuf::MetricsMetadata& Metrics::_Internal::metadata(const Metrics* msg) { - return *msg->_impl_.metadata_; -} -Metrics::Metrics(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Metrics) -} -Metrics::Metrics(const Metrics& from) : ::google::protobuf::Message() { - Metrics* const _this = this; - (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){from._impl_._has_bits_}, - /*decltype(_impl_._cached_size_)*/ {}, - decltype(_impl_.values_){}, - decltype(_impl_.metadata_){nullptr}, - }; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - _impl_.values_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.values_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_values().empty()) { - _this->_impl_.values_.Set(from._internal_values(), _this->GetArenaForAllocation()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_impl_.metadata_ = new ::abacus::protobuf::MetricsMetadata(*from._impl_.metadata_); - } - - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Metrics) -} -inline void Metrics::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){}, - /*decltype(_impl_._cached_size_)*/ {}, - decltype(_impl_.values_){}, - decltype(_impl_.metadata_){nullptr}, - }; - _impl_.values_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.values_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} -Metrics::~Metrics() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Metrics) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Metrics::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.values_.Destroy(); - if (this != internal_default_instance()) delete _impl_.metadata_; -} -void Metrics::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -PROTOBUF_NOINLINE void Metrics::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Metrics) - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.values_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.metadata_ != nullptr); - _impl_.metadata_->Clear(); - } - _impl_._has_bits_.Clear(); - _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_ = { - { - PROTOBUF_FIELD_OFFSET(Metrics, _impl_._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 - }, {{ - // bytes values = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(Metrics, _impl_.values_)}}, - // optional .abacus.protobuf.MetricsMetadata metadata = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(Metrics, _impl_.metadata_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // optional .abacus.protobuf.MetricsMetadata metadata = 1; - {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.metadata_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes values = 2; - {PROTOBUF_FIELD_OFFSET(Metrics, _impl_.values_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::MetricsMetadata>()}, - }}, {{ - }}, -}; - -::uint8_t* Metrics::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Metrics) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // optional .abacus.protobuf.MetricsMetadata metadata = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::metadata(this), - _Internal::metadata(this).GetCachedSize(), target, stream); - } - - // bytes values = 2; - if (!this->_internal_values().empty()) { - const std::string& _s = this->_internal_values(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - 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:abacus.protobuf.Metrics) - return target; -} - -::size_t Metrics::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.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; - - // bytes values = 2; - if (!this->_internal_values().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_values()); - } - - // optional .abacus.protobuf.MetricsMetadata metadata = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.metadata_); - } - - 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:abacus.protobuf.Metrics) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_values().empty()) { - _this->_internal_set_values(from._internal_values()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_metadata()->::abacus::protobuf::MetricsMetadata::MergeFrom( - from._internal_metadata()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Metrics::CopyFrom(const Metrics& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.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; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.values_, lhs_arena, - &other->_impl_.values_, rhs_arena); - swap(_impl_.metadata_, other->_impl_.metadata_); -} - -::google::protobuf::Metadata Metrics::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); -} // @@protoc_insertion_point(namespace_scope) } // namespace protobuf } // namespace abacus diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 98dfe0d8..24aecc91 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -87,9 +87,6 @@ extern Int64MetricDefaultTypeInternal _Int64Metric_default_instance_; class Metric; struct MetricDefaultTypeInternal; extern MetricDefaultTypeInternal _Metric_default_instance_; -class Metrics; -struct MetricsDefaultTypeInternal; -extern MetricsDefaultTypeInternal _Metrics_default_instance_; class MetricsMetadata; struct MetricsMetadataDefaultTypeInternal; extern MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; @@ -2699,188 +2696,6 @@ class MetricsMetadata final : }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -};// ------------------------------------------------------------------- - -class Metrics final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.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 = - 13; - - 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 "abacus.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 { - kValuesFieldNumber = 2, - kMetadataFieldNumber = 1, - }; - // bytes values = 2; - void clear_values() ; - const std::string& values() const; - template - void set_values(Arg_&& arg, Args_... args); - std::string* mutable_values(); - PROTOBUF_NODISCARD std::string* release_values(); - void set_allocated_values(std::string* ptr); - - private: - const std::string& _internal_values() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_values( - const std::string& value); - std::string* _internal_mutable_values(); - - public: - // optional .abacus.protobuf.MetricsMetadata metadata = 1; - bool has_metadata() const; - void clear_metadata() ; - const ::abacus::protobuf::MetricsMetadata& metadata() const; - PROTOBUF_NODISCARD ::abacus::protobuf::MetricsMetadata* release_metadata(); - ::abacus::protobuf::MetricsMetadata* mutable_metadata(); - void set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value); - void unsafe_arena_set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value); - ::abacus::protobuf::MetricsMetadata* unsafe_arena_release_metadata(); - - private: - const ::abacus::protobuf::MetricsMetadata& _internal_metadata() const; - ::abacus::protobuf::MetricsMetadata* _internal_mutable_metadata(); - - public: - // @@protoc_insertion_point(class_scope:abacus.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::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr values_; - ::abacus::protobuf::MetricsMetadata* metadata_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; }; // =================================================================== @@ -5288,157 +5103,6 @@ inline ::google::protobuf::Map* Metrics return _internal_mutable_metrics(); } -// ------------------------------------------------------------------- - -// Metrics - -// optional .abacus.protobuf.MetricsMetadata metadata = 1; -inline bool Metrics::has_metadata() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.metadata_ != nullptr); - return value; -} -inline void Metrics::clear_metadata() { - if (_impl_.metadata_ != nullptr) _impl_.metadata_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::abacus::protobuf::MetricsMetadata& Metrics::_internal_metadata() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::abacus::protobuf::MetricsMetadata* p = _impl_.metadata_; - return p != nullptr ? *p : reinterpret_cast(::abacus::protobuf::_MetricsMetadata_default_instance_); -} -inline const ::abacus::protobuf::MetricsMetadata& Metrics::metadata() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metrics.metadata) - return _internal_metadata(); -} -inline void Metrics::unsafe_arena_set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.metadata_); - } - _impl_.metadata_ = reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metrics.metadata) -} -inline ::abacus::protobuf::MetricsMetadata* Metrics::release_metadata() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::abacus::protobuf::MetricsMetadata* released = _impl_.metadata_; - _impl_.metadata_ = 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 ::abacus::protobuf::MetricsMetadata* Metrics::unsafe_arena_release_metadata() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Metrics.metadata) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::abacus::protobuf::MetricsMetadata* temp = _impl_.metadata_; - _impl_.metadata_ = nullptr; - return temp; -} -inline ::abacus::protobuf::MetricsMetadata* Metrics::_internal_mutable_metadata() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.metadata_ == nullptr) { - auto* p = CreateMaybeMessage<::abacus::protobuf::MetricsMetadata>(GetArenaForAllocation()); - _impl_.metadata_ = reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(p); - } - return _impl_.metadata_; -} -inline ::abacus::protobuf::MetricsMetadata* Metrics::mutable_metadata() { - ::abacus::protobuf::MetricsMetadata* _msg = _internal_mutable_metadata(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metrics.metadata) - return _msg; -} -inline void Metrics::set_allocated_metadata(::abacus::protobuf::MetricsMetadata* value) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(_impl_.metadata_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(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_.metadata_ = reinterpret_cast<::abacus::protobuf::MetricsMetadata*>(value); - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metrics.metadata) -} - -// bytes values = 2; -inline void Metrics::clear_values() { - _impl_.values_.ClearToEmpty(); -} -inline const std::string& Metrics::values() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metrics.values) - return _internal_values(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Metrics::set_values(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.values_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metrics.values) -} -inline std::string* Metrics::mutable_values() { - std::string* _s = _internal_mutable_values(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metrics.values) - return _s; -} -inline const std::string& Metrics::_internal_values() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.values_.Get(); -} -inline void Metrics::_internal_set_values(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.values_.Set(value, GetArenaForAllocation()); -} -inline std::string* Metrics::_internal_mutable_values() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.values_.Mutable( GetArenaForAllocation()); -} -inline std::string* Metrics::release_values() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Metrics.values) - return _impl_.values_.Release(); -} -inline void Metrics::set_allocated_values(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.values_.SetAllocated(value, GetArenaForAllocation()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.values_.IsDefault()) { - _impl_.values_.Set("", GetArenaForAllocation()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metrics.values) -} - #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index cfb6902d..3b45d996 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -14,19 +14,6 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -auto to_json(const protobuf::Metrics& metrics, bool minimal) -> std::string -{ - const auto& values = metrics.values(); - return to_json(metrics.metadata(), (const uint8_t*)values.data(), - values.size(), minimal); -} - -auto to_json(const view& view, bool minimal) -> std::string -{ - bourne::json json = detail::to_json(view, minimal); - return json.dump(); -} - auto to_json(const protobuf::MetricsMetadata& metadata, const uint8_t* value_data, std::size_t value_bytes, bool minimal) -> std::string @@ -41,5 +28,12 @@ auto to_json(const protobuf::MetricsMetadata& metadata, } return ""; } + +auto to_json(const view& view, bool minimal) -> std::string +{ + bourne::json json = detail::to_json(view, minimal); + return json.dump(); +} + } } diff --git a/src/abacus/to_json.hpp b/src/abacus/to_json.hpp index 69adb51a..d9115963 100644 --- a/src/abacus/to_json.hpp +++ b/src/abacus/to_json.hpp @@ -14,14 +14,6 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { - -/// @return a JSON-formatted string of a metrics views data. -/// @param metrics The metrics. -/// @param minimal If true, the JSON will be slimmed down to only contain the -/// the value data. -auto to_json(const protobuf::Metrics& metrics, - bool minimal = false) -> std::string; - /// @return a JSON-formatted string of a metrics views data. /// @param metadata The metadata of the metrics. /// @param value_data The value data of the metrics. diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index b1f0162e..1e776561 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -27,18 +27,6 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -[[nodiscard]] auto view::set_metrics(const protobuf::Metrics& metrics) -> bool -{ - assert(metrics.IsInitialized()); - if (set_metadata(metrics.metadata())) - { - return set_value_data((const uint8_t*)metrics.values().data(), - metrics.values().size()); - } - - return false; -} - [[nodiscard]] auto view::set_metadata(const protobuf::MetricsMetadata& metadata) -> bool { diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index d3fd1780..6dd6af79 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -33,11 +33,6 @@ inline namespace STEINWURF_ABACUS_VERSION class view { public: - /// Sets the metrics - /// @param metrics The metrics - /// @return true if the metrics were unpacked correctly otherwise false - [[nodiscard]] auto set_metrics(const protobuf::Metrics& metrics) -> bool; - /// Sets the meta data /// @param metadata The meta data /// @return true if the meta data was unpacked correctly otherwise false diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index f845663f..ca13da46 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -207,8 +207,4 @@ TEST(test_to_json, to_json) EXPECT_EQ(json_from_view, json_from_data); EXPECT_EQ(json_from_view, expected_json) << json_from_view; - - auto to_json_from_metrics = abacus::to_json(metrics.protobuf()); - EXPECT_EQ(to_json_from_metrics, json_from_data); - EXPECT_EQ(to_json_from_metrics, expected_json) << json_from_view; } From 021cd2b0aff16c63341e37473ce7ea959a52d9f4 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 21:02:21 +0100 Subject: [PATCH 37/68] work --- src/abacus/metrics.cpp | 74 +++++++++++++++++++++--------------------- src/abacus/metrics.hpp | 6 ++-- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 323aba34..c276b38c 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -276,7 +276,7 @@ metrics::metrics(const std::map& info) template [[nodiscard]] auto metrics::initialize_optional(const std::string& name) -> - typename Metric::optional + typename detail::optional_metric { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); @@ -292,26 +292,26 @@ template // Explicit instantiations for the expected types template auto metrics::initialize_optional(const std::string& name) - -> uint64::optional; -template auto -metrics::initialize_optional(const std::string& name) -> int64::optional; + -> detail::optional_metric; +template auto metrics::initialize_optional(const std::string& name) + -> detail::optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> uint32::optional; -template auto -metrics::initialize_optional(const std::string& name) -> int32::optional; + -> detail::optional_metric; +template auto metrics::initialize_optional(const std::string& name) + -> detail::optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> float64::optional; + -> detail::optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> float32::optional; + -> detail::optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> boolean::optional; -template auto -metrics::initialize_optional(const std::string& name) -> enum8::optional; + -> detail::optional_metric; +template auto metrics::initialize_optional(const std::string& name) + -> detail::optional_metric; template [[nodiscard]] auto metrics::initialize_required(const std::string& name, typename Metric::type value) -> - typename Metric::required + typename detail::required_metric { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); @@ -327,30 +327,30 @@ template } // Explicit instantiations for the expected types -template auto -metrics::initialize_required(const std::string& name, - uint64::type value) -> uint64::required; -template auto -metrics::initialize_required(const std::string& name, - int64::type value) -> int64::required; -template auto -metrics::initialize_required(const std::string& name, - uint32::type value) -> uint32::required; -template auto -metrics::initialize_required(const std::string& name, - int32::type value) -> int32::required; -template auto -metrics::initialize_required(const std::string& name, - float64::type value) -> float64::required; -template auto -metrics::initialize_required(const std::string& name, - float32::type value) -> float32::required; -template auto -metrics::initialize_required(const std::string& name, - boolean::type value) -> boolean::required; -template auto -metrics::initialize_required(const std::string& name, - enum8::type value) -> enum8::required; +template auto metrics::initialize_required(const std::string& name, + uint64::type value) + -> detail::required_metric; +template auto metrics::initialize_required(const std::string& name, + int64::type value) + -> detail::required_metric; +template auto metrics::initialize_required(const std::string& name, + uint32::type value) + -> detail::required_metric; +template auto metrics::initialize_required(const std::string& name, + int32::type value) + -> detail::required_metric; +template auto metrics::initialize_required(const std::string& name, + float64::type value) + -> detail::required_metric; +template auto metrics::initialize_required(const std::string& name, + float32::type value) + -> detail::required_metric; +template auto metrics::initialize_required(const std::string& name, + boolean::type value) + -> detail::required_metric; +template auto metrics::initialize_required(const std::string& name, + enum8::type value) + -> detail::required_metric; template void metrics::initialize_constant(const std::string& name, diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 2a487606..aa327a6e 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -15,6 +15,8 @@ #include "name.hpp" #include "version.hpp" +#include "detail/optional_metric.hpp" +#include "detail/required_metric.hpp" #include "protobuf/metrics.pb.h" namespace abacus @@ -48,14 +50,14 @@ class metrics template [[nodiscard]] auto initialize_required(const std::string& name, typename Metric::type value) -> - typename Metric::required; + typename detail::required_metric; /// Initialize a metric /// @param name The name of the metric /// @return The metric object template [[nodiscard]] auto initialize_optional(const std::string& name) -> - typename Metric::optional; + typename detail::optional_metric; /// Initialize a constant metric /// @param name The name of the metric From 03095ccd5c8e86321ce920a03979a2aacd4a222e Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 21:06:19 +0100 Subject: [PATCH 38/68] work --- src/abacus/boolean.hpp | 4 +- src/abacus/detail/optional_metric.hpp | 3 -- src/abacus/detail/required_metric.hpp | 3 -- src/abacus/enum8.hpp | 4 +- src/abacus/float32.hpp | 4 +- src/abacus/float64.hpp | 4 +- src/abacus/int32.hpp | 4 +- src/abacus/int64.hpp | 4 +- src/abacus/metrics.cpp | 68 ++++++++++++--------------- src/abacus/metrics.hpp | 10 ++-- src/abacus/uint32.hpp | 4 +- src/abacus/uint64.hpp | 4 +- 12 files changed, 51 insertions(+), 65 deletions(-) diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index 178054ac..f91a969e 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -27,9 +27,9 @@ struct boolean using type = bool; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/detail/optional_metric.hpp b/src/abacus/detail/optional_metric.hpp index d6fcd41e..51bb3723 100644 --- a/src/abacus/detail/optional_metric.hpp +++ b/src/abacus/detail/optional_metric.hpp @@ -18,8 +18,6 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -namespace detail -{ /// An optional metric class for most metrics template struct optional_metric @@ -175,4 +173,3 @@ struct optional_metric }; } } -} diff --git a/src/abacus/detail/required_metric.hpp b/src/abacus/detail/required_metric.hpp index 1e2bdee1..26d5666e 100644 --- a/src/abacus/detail/required_metric.hpp +++ b/src/abacus/detail/required_metric.hpp @@ -17,8 +17,6 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -namespace detail -{ /// A required_metric class for most metrics template struct required_metric @@ -174,4 +172,3 @@ struct required_metric } } -} diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index f9a74f1c..0bfe6d28 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -28,10 +28,10 @@ struct enum8 using type = uint8_t; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index e206c179..07721240 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -27,10 +27,10 @@ struct float32 using type = float; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index 119dc4fc..7f6af704 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -25,10 +25,10 @@ struct float64 using type = double; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index d47dbf4b..acaee063 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -25,10 +25,10 @@ struct int32 using type = int32_t; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index a65d497c..4a01c749 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -25,10 +25,10 @@ struct int64 using type = int64_t; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index c276b38c..a2ed355b 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -275,8 +275,8 @@ metrics::metrics(const std::map& info) } template -[[nodiscard]] auto metrics::initialize_optional(const std::string& name) -> - typename detail::optional_metric +[[nodiscard]] auto +metrics::initialize_optional(const std::string& name) -> optional_metric { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); @@ -287,31 +287,31 @@ template auto offset = proto_metric.offset(); - return typename Metric::optional(value_data(offset)); + return {value_data(offset)}; } // Explicit instantiations for the expected types template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template auto metrics::initialize_optional(const std::string& name) - -> detail::optional_metric; + -> optional_metric; template [[nodiscard]] auto metrics::initialize_required(const std::string& name, - typename Metric::type value) -> - typename detail::required_metric + typename Metric::type value) + -> required_metric { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); @@ -323,34 +323,26 @@ template auto offset = proto_metric.offset(); m_initial_values[name] = value; - return typename Metric::required(value_data(offset), value); + return {value_data(offset), value}; } // Explicit instantiations for the expected types -template auto metrics::initialize_required(const std::string& name, - uint64::type value) - -> detail::required_metric; -template auto metrics::initialize_required(const std::string& name, - int64::type value) - -> detail::required_metric; -template auto metrics::initialize_required(const std::string& name, - uint32::type value) - -> detail::required_metric; -template auto metrics::initialize_required(const std::string& name, - int32::type value) - -> detail::required_metric; -template auto metrics::initialize_required(const std::string& name, - float64::type value) - -> detail::required_metric; -template auto metrics::initialize_required(const std::string& name, - float32::type value) - -> detail::required_metric; -template auto metrics::initialize_required(const std::string& name, - boolean::type value) - -> detail::required_metric; -template auto metrics::initialize_required(const std::string& name, - enum8::type value) - -> detail::required_metric; +template auto metrics::initialize_required( + const std::string& name, uint64::type value) -> required_metric; +template auto metrics::initialize_required( + const std::string& name, int64::type value) -> required_metric; +template auto metrics::initialize_required( + const std::string& name, uint32::type value) -> required_metric; +template auto metrics::initialize_required( + const std::string& name, int32::type value) -> required_metric; +template auto metrics::initialize_required( + const std::string& name, float64::type value) -> required_metric; +template auto metrics::initialize_required( + const std::string& name, float32::type value) -> required_metric; +template auto metrics::initialize_required( + const std::string& name, boolean::type value) -> required_metric; +template auto metrics::initialize_required( + const std::string& name, enum8::type value) -> required_metric; template void metrics::initialize_constant(const std::string& name, diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index aa327a6e..6060eb09 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -48,16 +48,16 @@ class metrics /// @param value Optional initial value of the metric /// @return The metric object template - [[nodiscard]] auto initialize_required(const std::string& name, - typename Metric::type value) -> - typename detail::required_metric; + [[nodiscard]] auto + initialize_required(const std::string& name, + typename Metric::type value) -> required_metric; /// Initialize a metric /// @param name The name of the metric /// @return The metric object template - [[nodiscard]] auto initialize_optional(const std::string& name) -> - typename detail::optional_metric; + [[nodiscard]] auto + initialize_optional(const std::string& name) -> optional_metric; /// Initialize a constant metric /// @param name The name of the metric diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 646afd49..965aa521 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -25,10 +25,10 @@ struct uint32 using type = uint32_t; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index 4c3f811c..6a4bbad6 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -25,10 +25,10 @@ struct uint64 using type = uint64_t; /// The optional metric type - using optional = detail::optional_metric; + using optional = optional_metric; /// The required metric type - using required = detail::required_metric; + using required = required_metric; /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory From 1525128edbcb9bc7de27b1aa8aae126655acb1bc Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 21:08:33 +0100 Subject: [PATCH 39/68] work --- src/abacus/boolean.hpp | 4 ++-- src/abacus/enum8.hpp | 4 ++-- src/abacus/float32.hpp | 4 ++-- src/abacus/float64.hpp | 4 ++-- src/abacus/int32.hpp | 4 ++-- src/abacus/int64.hpp | 4 ++-- src/abacus/metrics.hpp | 4 ++-- src/abacus/{detail => }/optional_metric.hpp | 4 ++-- src/abacus/{detail => }/required_metric.hpp | 4 ++-- src/abacus/uint32.hpp | 4 ++-- src/abacus/uint64.hpp | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) rename src/abacus/{detail => }/optional_metric.hpp (98%) rename src/abacus/{detail => }/required_metric.hpp (98%) diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index f91a969e..fd029baa 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -12,9 +12,9 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" #include "kind.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" namespace abacus { diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index 0bfe6d28..21187948 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -13,8 +13,8 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 07721240..8edd73b5 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -9,11 +9,11 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index 7f6af704..f939e41e 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index acaee063..8835c26d 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 4a01c749..9b818286 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 6060eb09..a994fe1f 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -15,9 +15,9 @@ #include "name.hpp" #include "version.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" +#include "optional_metric.hpp" #include "protobuf/metrics.pb.h" +#include "required_metric.hpp" namespace abacus { diff --git a/src/abacus/detail/optional_metric.hpp b/src/abacus/optional_metric.hpp similarity index 98% rename from src/abacus/detail/optional_metric.hpp rename to src/abacus/optional_metric.hpp index 51bb3723..aaadee3a 100644 --- a/src/abacus/detail/optional_metric.hpp +++ b/src/abacus/optional_metric.hpp @@ -10,9 +10,9 @@ #include #include -#include "has_arithmetic_operators.hpp" +#include "detail/has_arithmetic_operators.hpp" -#include "../version.hpp" +#include "version.hpp" namespace abacus { diff --git a/src/abacus/detail/required_metric.hpp b/src/abacus/required_metric.hpp similarity index 98% rename from src/abacus/detail/required_metric.hpp rename to src/abacus/required_metric.hpp index 26d5666e..45489f6d 100644 --- a/src/abacus/detail/required_metric.hpp +++ b/src/abacus/required_metric.hpp @@ -10,8 +10,8 @@ #include #include -#include "../version.hpp" -#include "has_arithmetic_operators.hpp" +#include "detail/has_arithmetic_operators.hpp" +#include "version.hpp" namespace abacus { diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 965aa521..23f1a744 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index 6a4bbad6..5108328b 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -7,11 +7,11 @@ #include "availability.hpp" #include "description.hpp" -#include "detail/optional_metric.hpp" -#include "detail/required_metric.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" #include "unit.hpp" namespace abacus From f6435d70b21583e37794b5fc6a05c0e855e2b478 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Mon, 27 Jan 2025 21:10:51 +0100 Subject: [PATCH 40/68] work --- src/abacus/metrics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index a2ed355b..e1f05b2e 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -358,7 +358,7 @@ void metrics::initialize_constant(const std::string& name, auto offset = proto_metric.offset(); assert(get_kind(proto_metric) == protobuf::Kind::CONSTANT); - typename Metric::required(value_data(offset), value); + required_metric(value_data(offset), value); } // Explicit instantiations for the expected types From f50241036793baaae88ebb3dc73a6e027f0039aa Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 28 Jan 2025 13:18:32 +0100 Subject: [PATCH 41/68] is this ub? --- benchmark/main.cpp | 42 +- docs/user_api/kind.rst | 2 - examples/metrics_simple.cpp | 21 +- protobuf/kind.proto | 38 - protobuf/metrics.proto | 118 +- src/abacus/boolean.hpp | 10 +- src/abacus/detail/helpers.hpp | 124 ++ src/abacus/enum8.hpp | 11 +- src/abacus/float32.hpp | 11 +- src/abacus/float64.hpp | 11 +- src/abacus/int32.hpp | 11 +- src/abacus/int64.hpp | 11 +- src/abacus/kind.hpp | 52 +- src/abacus/metrics.cpp | 243 ++- src/abacus/protobuf/kind.pb.cc | 98 - src/abacus/protobuf/kind.pb.h | 138 -- src/abacus/protobuf/metrics.pb.cc | 3207 ++++++++++++++++++++++------- src/abacus/protobuf/metrics.pb.h | 3194 +++++++++++++++++++++++++--- src/abacus/uint32.hpp | 11 +- src/abacus/uint64.hpp | 11 +- test/src/test_info.cpp | 32 +- test/src/test_metric.cpp | 76 +- test/src/test_metrics.cpp | 233 +-- test/src/test_to_json.cpp | 72 +- test/src/test_view.cpp | 17 +- 25 files changed, 6005 insertions(+), 1789 deletions(-) delete mode 100644 docs/user_api/kind.rst delete mode 100644 protobuf/kind.proto create mode 100644 src/abacus/detail/helpers.hpp delete mode 100644 src/abacus/protobuf/kind.pb.cc delete mode 100644 src/abacus/protobuf/kind.pb.h diff --git a/benchmark/main.cpp b/benchmark/main.cpp index f47753b5..b787e598 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -6,30 +6,24 @@ // Helper function to create metric definitions std::map create_metric_infos() { - return {{abacus::name{"0"}, - abacus::boolean{abacus::gauge, abacus::description{""}, - abacus::required}}, - {abacus::name{"1"}, - abacus::uint64{abacus::gauge, abacus::description{""}, - abacus::required}}, - {abacus::name{"2"}, - abacus::int64{abacus::gauge, abacus::description{""}, - abacus::required}}, - {abacus::name{"3"}, - abacus::float64{abacus::gauge, abacus::description{""}, - abacus::required}}, - {abacus::name{"4"}, - abacus::boolean{abacus::gauge, abacus::description{""}, - abacus::required}}, - {abacus::name{"5"}, - abacus::float64{abacus::gauge, abacus::description{""}, - abacus::required}}, - {abacus::name{"6"}, - abacus::enum8{ - abacus::gauge, - abacus::description{""}, - {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}, - abacus::required}}}; + return { + {abacus::name{"0"}, abacus::boolean{abacus::gauge{abacus::required}, + abacus::description{""}}}, + {abacus::name{"1"}, abacus::uint64{abacus::gauge{abacus::required}, + abacus::description{""}}}, + {abacus::name{"2"}, abacus::int64{abacus::gauge{abacus::required}, + abacus::description{""}}}, + {abacus::name{"3"}, abacus::float64{abacus::gauge{abacus::required}, + abacus::description{""}}}, + {abacus::name{"4"}, abacus::boolean{abacus::gauge{abacus::required}, + abacus::description{""}}}, + {abacus::name{"5"}, abacus::float64{abacus::gauge{abacus::required}, + abacus::description{""}}}, + {abacus::name{"6"}, + abacus::enum8{ + abacus::gauge{abacus::required}, + abacus::description{""}, + {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}}}}; } // Benchmark for metric initialization diff --git a/docs/user_api/kind.rst b/docs/user_api/kind.rst deleted file mode 100644 index 548d8766..00000000 --- a/docs/user_api/kind.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: type_alias_synopsis.rst - :selector: abacus::kind diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 86922f72..bf6a8a63 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -17,23 +17,22 @@ int main() std::map infos = { {abacus::name{"fuel_consumption"}, abacus::float64{ - abacus::constant, + abacus::constant{}, abacus::description{"Fuel consumption in kilometers per liter"}, - abacus::required, abacus::unit{"km/l"}}}, + abacus::unit{"km/l"}}}, {abacus::name{"wheels"}, - abacus::uint64{abacus::constant, + abacus::uint64{abacus::constant{}, abacus::description{"Wheels on the car"}, - abacus::required, abacus::unit{"wheels"}}}, + abacus::unit{"wheels"}}}, {abacus::name{"days_until_maintenance"}, abacus::int64{ - abacus::gauge, + abacus::gauge{abacus::required}, abacus::description{"Days until next maintenance, if less than 0, " "maintenance is overdue"}, - abacus::required, abacus::unit{"days"}}}, + abacus::unit{"days"}}}, {abacus::name{"registered"}, - abacus::boolean{abacus::gauge, - abacus::description{"Is the car registered"}, - abacus::optional}}}; + abacus::boolean{abacus::gauge{abacus::optional}, + abacus::description{"Is the car registered"}}}}; abacus::metrics car(infos); @@ -41,11 +40,11 @@ int main() car.initialize_constant("wheels", 4); // The car still has some time before maintenance. - abacus::int64::required days_until_maintenance = + abacus::required_metric days_until_maintenance = car.initialize_required("days_until_maintenance", 10); // The car should be registered. - abacus::boolean::optional registered = + abacus::optional_metric registered = car.initialize_optional("registered"); // The registration is initialized, but not set. diff --git a/protobuf/kind.proto b/protobuf/kind.proto deleted file mode 100644 index b6e32d20..00000000 --- a/protobuf/kind.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; -package abacus.protobuf; -option go_package = "abacus/protobuf"; - -enum Kind { - GAUGE = 0; - COUNTER = 1; - CONSTANT = 2; -} - -// // A gauge metric -// message Gauge{ - -// // Whether the metric is optional -// bool optional = 1; -// } - -// // A counter metric -// message Counter{ - -// // Whether the metric is optional -// bool optional = 1; -// } - -// // A constant metric -// message Constant{ -// } - -// // A metric kind -// message Kind { - -// // The kind of metric -// oneof value { -// Gauge gauge = 1; // Gauge metric -// Counter counter = 2; // Counter metric -// Constant constant = 3; // Constant metric -// } -// } diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 3e01ca1a..67a6a4f5 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -2,73 +2,124 @@ syntax = "proto3"; package abacus.protobuf; option go_package = "abacus/protobuf"; -import "abacus/protobuf/kind.proto"; - // Specifies the endianness for multi-byte values enum Endianness { LITTLE = 0; // Little-endian byte order BIG = 1; // Big-endian byte order } +// A gauge used when the value can increase or decrease +message Gauge{ + + // Whether the metric is optional + bool optional = 1; +} + +// A counter used when the value is ever-increasing +message Counter{ + + // Whether the metric is optional + bool optional = 1; +} + +// A constant used when the value is fixed +message Constant{ +} + + // Metadata for unsigned 64-bit metrics message UInt64Metric { string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement - optional uint64 min = 4; // Minimum allowable value - optional uint64 max = 5; // Maximum allowable value + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Counter counter = 3; // Counter metric + Constant constant = 4; // Constant metric + } + optional string unit = 5; // Unit of measurement + optional uint64 min = 6; // Minimum allowable value + optional uint64 max = 7; // Maximum allowable value } // Metadata for signed 64-bit metrics message Int64Metric { string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement - optional int64 min = 4; // Minimum allowable value - optional int64 max = 5; // Maximum allowable value + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Counter counter = 3; // Counter metric + Constant constant = 4; // Constant metric + } + optional string unit = 5; // Unit of measurement + optional int64 min = 6; // Minimum allowable value + optional int64 max = 7; // Maximum allowable value } // Metadata for unsigned 32-bit metrics message UInt32Metric { string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement - optional uint32 min = 4; // Minimum allowable value - optional uint32 max = 5; // Maximum allowable value + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Counter counter = 3; // Counter metric + Constant constant = 4; // Constant metric + } + optional string unit = 5; // Unit of measurement + optional uint32 min = 6; // Minimum allowable value + optional uint32 max = 7; // Maximum allowable value } // Metadata for signed 32-bit metrics message Int32Metric { string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement - optional int32 min = 4; // Minimum allowable value - optional int32 max = 5; // Maximum allowable value + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Counter counter = 3; // Counter metric + Constant constant = 4; // Constant metric + } + optional string unit = 5; // Unit of measurement + optional int32 min = 6; // Minimum allowable value + optional int32 max = 7; // Maximum allowable value } // Metadata for 64-bit floating-point metrics message Float64Metric { string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement - optional double min = 4; // Minimum allowable value - optional double max = 5; // Maximum allowable value + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Counter counter = 3; // Counter metric + Constant constant = 4; // Constant metric + } + optional string unit = 5; // Unit of measurement + optional double min = 6; // Minimum allowable value + optional double max = 7; // Maximum allowable value } // Metadata for 32-bit floating-point metrics message Float32Metric { string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement - optional float min = 4; // Minimum allowable value - optional float max = 5; // Maximum allowable value + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Counter counter = 3; // Counter metric + Constant constant = 4; // Constant metric + } + optional string unit = 5; // Unit of measurement + optional float min = 6; // Minimum allowable value + optional float max = 7; // Maximum allowable value } // Metadata for boolean metrics message BoolMetric { string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Constant constant = 3; // Constant metric + } + optional string unit = 4; // Unit of measurement } // Metadata for enumerated metrics @@ -78,15 +129,18 @@ message Enum8Metric { optional string description = 2; // Enum description } string description = 1; // Metric description - Kind kind = 2; // Kind of metric - optional string unit = 3; // Unit of measurement - map values = 4; // Mapping from packed index to enum info + // The kind of metric + oneof kind { + Gauge gauge = 2; // Gauge metric + Constant constant = 3; // Constant metric + } + optional string unit = 4; // Unit of measurement + map values = 5; // Mapping from packed index to enum info } message Metric { uint32 offset = 1; // Offset into packed memory for the value - bool optional = 2; // Whether the metric is optional oneof type { UInt64Metric uint64 = 3; // Metadata for unsigned 64-bit metrics Int64Metric int64 = 4; // Metadata for signed 64-bit metrics diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index fd029baa..efa7840d 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -26,11 +26,6 @@ struct boolean /// The primitive type of the metric using type = bool; - /// The optional metric type - using optional = optional_metric; - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -54,13 +49,10 @@ struct boolean } /// The kind of the metric - abacus::kind kind; + std::variant kind; /// The description of the metric abacus::description description; - - /// The availability of the metric - abacus::availability availability; }; } } diff --git a/src/abacus/detail/helpers.hpp b/src/abacus/detail/helpers.hpp new file mode 100644 index 00000000..175bdb55 --- /dev/null +++ b/src/abacus/detail/helpers.hpp @@ -0,0 +1,124 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include + +#include "../version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +namespace detail +{ + +// Helper to detect the presence of mutable_gauge function +template +struct has_mutable_gauge : std::false_type +{ +}; + +template +struct has_mutable_gauge< + T, std::void_t().mutable_gauge())>> + : std::true_type +{ +}; + +template +inline constexpr bool has_mutable_gauge_v = has_mutable_gauge::value; + +// Helper to detect the presence of counter function +template +struct has_mutable_counter : std::false_type +{ +}; + +template +struct has_mutable_counter< + T, std::void_t().mutable_counter())>> + : std::true_type +{ +}; + +template +inline constexpr bool has_mutable_counter_v = has_mutable_counter::value; + +// Helper to detect the presence of mutable_constant function +template +struct has_mutable_constant : std::false_type +{ +}; + +template +struct has_mutable_constant< + T, std::void_t().mutable_constant())>> + : std::true_type +{ +}; + +template +inline constexpr bool has_mutable_constant_v = has_mutable_constant::value; + +// Helper to check if a type is in the variant +template +struct is_in_variant; + +template +struct is_in_variant> + : std::disjunction...> +{ +}; + +template +constexpr bool is_in_variant_v = is_in_variant::value; + +// Helper to detect the presence of kGauge in an enum +template +struct has_kGauge : std::false_type +{ +}; + +template +struct has_kGauge> : std::true_type +{ +}; + +template +inline constexpr bool has_kGauge_v = has_kGauge::value; + +// Helper to detect the presence of kCounter in an enum +template +struct has_kCounter : std::false_type +{ +}; + +template +struct has_kCounter> : std::true_type +{ +}; + +template +inline constexpr bool has_kCounter_v = has_kCounter::value; + +// Helper to detect the presence of kConstant in an enum +template +struct has_kConstant : std::false_type +{ +}; + +template +struct has_kConstant> : std::true_type +{ +}; + +template +inline constexpr bool has_kConstant_v = has_kConstant::value; +} +} +} diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index 21187948..4ad314ad 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -27,12 +27,6 @@ struct enum8 /// The primitive type of the metric using type = uint8_t; - /// The optional metric type - using optional = optional_metric; - - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -94,7 +88,7 @@ struct enum8 }; /// The metric kind - abacus::kind kind; + std::variant kind; /// The metric description abacus::description description; @@ -102,9 +96,6 @@ struct enum8 /// The enumeration value information std::map values; - /// The availability of the metric - abacus::availability availability; - /// The unit of the metric abacus::unit unit{}; }; diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 8edd73b5..2296918c 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -26,12 +26,6 @@ struct float32 /// The primitive type of the metric using type = float; - /// The optional metric type - using optional = optional_metric; - - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -60,14 +54,11 @@ struct float32 } /// The metric kind - abacus::kind kind; + std::variant kind; /// The metric description abacus::description description; - /// The availability of the metric - abacus::availability availability; - /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index f939e41e..e1de0fa0 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -24,12 +24,6 @@ struct float64 /// The primitive type of the metric using type = double; - /// The optional metric type - using optional = optional_metric; - - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -58,14 +52,11 @@ struct float64 } /// The metric kind - abacus::kind kind; + std::variant kind; /// The metric description abacus::description description; - /// The availability of the metric - abacus::availability availability; - /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 8835c26d..058e0d50 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -24,12 +24,6 @@ struct int32 /// The primitive type of the metric using type = int32_t; - /// The optional metric type - using optional = optional_metric; - - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -54,14 +48,11 @@ struct int32 } /// The metric kind - abacus::kind kind; + std::variant kind; /// The metric description abacus::description description; - /// The availability of the metric - abacus::availability availability; - /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 9b818286..170eebfa 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -24,12 +24,6 @@ struct int64 /// The primitive type of the metric using type = int64_t; - /// The optional metric type - using optional = optional_metric; - - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -54,14 +48,11 @@ struct int64 } /// The metric kind - abacus::kind kind; + std::variant kind; /// The metric description abacus::description description; - /// The availability of the metric - abacus::availability availability; - /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index c79b61ec..bcf5d71b 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -5,7 +5,7 @@ #pragma once -#include "protobuf/kind.pb.h" +#include "availability.hpp" #include "version.hpp" namespace abacus @@ -13,60 +13,20 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { /// Tag type representing a gauge kind. -struct gauge_ +struct gauge { - /// The protobuf kind value for the gauge kind. - static constexpr protobuf::Kind value = protobuf::Kind::GAUGE; + abacus::availability availability; }; -/// Constant instance of the gauge_ tag type. -static const gauge_ gauge; - /// Tag type representing a counter kind. -struct counter_ +struct counter { - /// The protobuf kind value for the counter kind. - static constexpr protobuf::Kind value = protobuf::Kind::COUNTER; + abacus::availability availability; }; -/// Constant instance of the counter_ tag type. -static const counter_ counter; - /// Tag type representing a constant kind. -struct constant_ +struct constant { - /// The protobuf kind value for the constant kind. - static constexpr protobuf::Kind value = protobuf::Kind::CONSTANT; }; - -/// Constant instance of the constant_ tag type. -static const constant_ constant; - -/// Variant type that can hold either a gauge_, counter_, or constant_. -using kind = std::variant; - -/// Converts the given kind to its corresponding protobuf::Kind value. -/// @param k The kind to convert. -/// @return The corresponding protobuf::Kind value. -/// @throws std::runtime_error if the kind is unknown. -static inline auto to_protobuf(const kind& k) -> protobuf::Kind -{ - if (std::holds_alternative(k)) - { - return protobuf::Kind::GAUGE; - } - else if (std::holds_alternative(k)) - { - return protobuf::Kind::COUNTER; - } - else if (std::holds_alternative(k)) - { - return protobuf::Kind::CONSTANT; - } - else - { - throw std::runtime_error("Unknown kind"); - } -} } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index e1f05b2e..f0f7ae60 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -12,40 +12,188 @@ #include "protocol_version.hpp" #include "version.hpp" +#include "detail/helpers.hpp" #include "protobuf/metrics.pb.h" #include +#include + namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -static inline auto get_kind(const protobuf::Metric& metric) -> protobuf::Kind +template +static inline auto call_specific(const protobuf::Metric& metric, + const Func& func) -> bool { - assert(metric.type_case() != protobuf::Metric::TYPE_NOT_SET); switch (metric.type_case()) { case protobuf::Metric::kUint64: - return metric.uint64().kind(); + return func(metric.uint64()); case protobuf::Metric::kInt64: - return metric.int64().kind(); + return func(metric.int64()); case protobuf::Metric::kUint32: - return metric.uint32().kind(); + return func(metric.uint32()); case protobuf::Metric::kInt32: - return metric.int32().kind(); + return func(metric.int32()); case protobuf::Metric::kFloat64: - return metric.float64().kind(); + return func(metric.float64()); case protobuf::Metric::kFloat32: - return metric.float32().kind(); + return func(metric.float32()); case protobuf::Metric::kBoolean: - return metric.boolean().kind(); + return func(metric.boolean()); case protobuf::Metric::kEnum8: - return metric.enum8().kind(); + return func(metric.enum8()); default: // This should never be reached assert(false); - return protobuf::Kind::CONSTANT; + return false; + } +} + +template +bool is_constant_impl(const Metric& metric) +{ + if constexpr (detail::has_kConstant_v) + { + return metric.kind_case() == Metric::KindCase::kConstant; + } + return false; +} + +static inline bool is_constant(const protobuf::Metric& metric) +{ + return call_specific(metric, [](const auto& metric) + { return is_constant_impl(metric); }); + // switch (metric.type_case()) + // { + // case protobuf::Metric::kUint64: + // return metric.uint64().kind_case() == + // protobuf::UInt64Metric::KindCase::kConstant; + // case protobuf::Metric::kInt64: + // return metric.int64().kind_case() == + // protobuf::Int64Metric::KindCase::kConstant; + // case protobuf::Metric::kUint32: + // return metric.uint32().kind_case() == + // protobuf::UInt32Metric::KindCase::kConstant; + // case protobuf::Metric::kInt32: + // return metric.int32().kind_case() == + // protobuf::Int32Metric::KindCase::kConstant; + // case protobuf::Metric::kFloat64: + // return metric.float64().kind_case() == + // protobuf::Float64Metric::KindCase::kConstant; + // case protobuf::Metric::kFloat32: + // return metric.float32().kind_case() == + // protobuf::Float32Metric::KindCase::kConstant; + // case protobuf::Metric::kBoolean: + // return metric.boolean().kind_case() == + // protobuf::BoolMetric::KindCase::kConstant; + // case protobuf::Metric::kEnum8: + // return metric.enum8().kind_case() == + // protobuf::Enum8Metric::KindCase::kConstant; + // case protobuf::Metric::TYPE_NOT_SET: + // // This should never be reached + // assert(false); + // return false; + // default: + // // This should never be reached + // assert(false); + // return false; + // } +} + +template +bool is_optional_impl(const Metric& metric) +{ + if constexpr (detail::has_kGauge_v) + { + if (metric.kind_case() == Metric::KindCase::kGauge) + { + return metric.gauge().optional(); + } + } + if constexpr (detail::has_kCounter_v) + + { + if (metric.kind_case() == Metric::KindCase::kCounter) + { + return metric.counter().optional(); + } + } + + return false; +} + +static inline auto is_optional(const protobuf::Metric& metric) -> bool +{ + return call_specific(metric, [](const auto& metric) + { return is_optional_impl(metric); }); + // switch (metric.type_case()) + // { + // case protobuf::Metric::kUint64: + // return is_optional_impl(metric.uint64()); + // case protobuf::Metric::kInt64: + // return is_optional_impl(metric.int64()); + // case protobuf::Metric::kUint32: + // return is_optional_impl(metric.uint32()); + // case protobuf::Metric::kInt32: + // return is_optional_impl(metric.int32()); + // case protobuf::Metric::kFloat64: + // return is_optional_impl(metric.float64()); + // case protobuf::Metric::kFloat32: + // return is_optional_impl(metric.float32()); + // case protobuf::Metric::kBoolean: + // return is_optional_impl(metric.boolean()); + // case protobuf::Metric::kEnum8: + // return is_optional_impl(metric.enum8()); + // case protobuf::Metric::TYPE_NOT_SET: + // // This should never be reached + // assert(false); + // return false; + // default: + // // This should never be reached + // assert(false); + // return false; + // } +} + +template +static inline auto set_kind(Protobuf& protobuf, const Kind& kind) +{ + // Check if the Protobuf message has a function called mutable_gauge + if constexpr (detail::has_mutable_gauge_v && + detail::is_in_variant_v) + { + if (auto* g = std::get_if(&kind)) + { + protobuf.mutable_gauge()->set_optional( + std::holds_alternative(g->availability)); + return; + } + } + // Check if the Protobuf message has a function called mutable_counter + if constexpr (detail::has_mutable_counter_v && + detail::is_in_variant_v) + { + if (auto* c = std::get_if(&kind)) + { + protobuf.mutable_counter()->set_optional( + std::holds_alternative(c->availability)); + return; + } + } + + if constexpr (detail::has_mutable_constant_v && + detail::is_in_variant_v) + { + if (auto* c = std::get_if(&kind)) + { + + protobuf.mutable_constant(); + return; + } } } @@ -76,21 +224,22 @@ metrics::metrics(const std::map& info) for (auto [name, value] : info) { + protobuf::Metric metric; metric.set_offset(m_value_bytes); - // The offset is incremented by one byte which represents whether - // the metric is set or not. + // The offset is incremented by one byte which represents + // whether the metric is set or not. m_value_bytes += 1; if (auto* m = std::get_if(&value)) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); - metric.mutable_uint64()->set_description(m->description.value); - metric.mutable_uint64()->set_kind(abacus::to_protobuf(m->kind)); + + set_kind(*metric.mutable_uint64(), m->kind); + if (!m->unit.empty()) { metric.mutable_uint64()->set_unit(m->unit.value); @@ -108,10 +257,10 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); - metric.mutable_int64()->set_description(m->description.value); - metric.mutable_int64()->set_kind(to_protobuf(m->kind)); + + set_kind(*metric.mutable_int64(), m->kind); + if (!m->unit.empty()) { metric.mutable_int64()->set_unit(m->unit.value); @@ -129,10 +278,10 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); - metric.mutable_uint32()->set_description(m->description.value); - metric.mutable_uint32()->set_kind(to_protobuf(m->kind)); + + set_kind(*metric.mutable_uint32(), m->kind); + if (!m->unit.empty()) { metric.mutable_uint32()->set_unit(m->unit.value); @@ -150,10 +299,10 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); - metric.mutable_int32()->set_description(m->description.value); - metric.mutable_int32()->set_kind(to_protobuf(m->kind)); + + set_kind(*metric.mutable_int32(), m->kind); + if (!m->unit.empty()) { metric.mutable_int32()->set_unit(m->unit.value); @@ -171,10 +320,11 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); metric.mutable_float64()->set_description(m->description.value); - metric.mutable_float64()->set_kind(to_protobuf(m->kind)); + + set_kind(*metric.mutable_float64(), m->kind); + if (!m->unit.empty()) { metric.mutable_float64()->set_unit(m->unit.value); @@ -192,10 +342,11 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); metric.mutable_float32()->set_description(m->description.value); - metric.mutable_float32()->set_kind(to_protobuf(m->kind)); + + set_kind(*metric.mutable_float32(), m->kind); + if (!m->unit.empty()) { metric.mutable_float32()->set_unit(m->unit.value); @@ -213,19 +364,19 @@ metrics::metrics(const std::map& info) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); - metric.mutable_boolean()->set_description(m->description.value); - metric.mutable_boolean()->set_kind(to_protobuf(m->kind)); + + set_kind(*metric.mutable_boolean(), m->kind); } else if (auto* m = std::get_if(&value)) { // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.set_optional(is_optional(m->availability)); metric.mutable_enum8()->set_description(m->description.value); - metric.mutable_enum8()->set_kind(abacus::to_protobuf(m->kind)); + + set_kind(*metric.mutable_enum8(), m->kind); + for (auto [key, value] : m->values) { auto enum_value = protobuf::Enum8Metric::EnumValue(); @@ -267,10 +418,10 @@ metrics::metrics(const std::map& info) // Make sure the metadata didn't change unexpectedly assert(metadata().ByteSizeLong() == m_metadata_bytes); - // Write the sync value to the first byte of the value data (this will - // be written as the endianess of the system) - // Consuming code can use the endianness field in the metadata to - // read the sync value + // Write the sync value to the first byte of the value data (this + // will be written as the endianess of the system) Consuming code + // can use the endianness field in the metadata to read the sync + // value std::memcpy(value_data(0), &m_hash, sizeof(uint32_t)); } @@ -282,8 +433,8 @@ metrics::initialize_optional(const std::string& name) -> optional_metric assert(!m_initialized.at(name)); m_initialized[name] = true; const protobuf::Metric& proto_metric = metadata().metrics().at(name); - assert(proto_metric.optional() == true); - assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); + assert(is_optional(proto_metric)); + // assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); auto offset = proto_metric.offset(); @@ -317,8 +468,8 @@ template assert(!m_initialized.at(name)); m_initialized[name] = true; const protobuf::Metric& proto_metric = metadata().metrics().at(name); - assert(proto_metric.optional() == false); - assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); + assert(!is_optional(proto_metric)); + // assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); auto offset = proto_metric.offset(); @@ -353,10 +504,8 @@ void metrics::initialize_constant(const std::string& name, m_initialized[name] = true; const protobuf::Metric& proto_metric = metadata().metrics().at(name); - assert(proto_metric.optional() == false && - "Constant metrics cannot be optional"); auto offset = proto_metric.offset(); - assert(get_kind(proto_metric) == protobuf::Kind::CONSTANT); + // assert(get_kind(proto_metric) == protobuf::Kind::CONSTANT); required_metric(value_data(offset), value); } @@ -440,14 +589,14 @@ auto metrics::reset() -> void continue; } - if (get_kind(metric) == protobuf::Kind::CONSTANT) + if (is_constant(metric)) { // Skip constant metrics continue; } auto offset = metric.offset(); - if (metric.optional()) + if (is_optional(metric)) { // Set the has value byte to 0 value_data(offset)[0] = 0; diff --git a/src/abacus/protobuf/kind.pb.cc b/src/abacus/protobuf/kind.pb.cc deleted file mode 100644 index 4229dac6..00000000 --- a/src/abacus/protobuf/kind.pb.cc +++ /dev/null @@ -1,98 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: abacus/protobuf/kind.proto - -#include "abacus/protobuf/kind.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 abacus { -namespace protobuf { -} // namespace protobuf -} // namespace abacus -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fkind_2eproto[1]; -static constexpr const ::_pb::ServiceDescriptor** - file_level_service_descriptors_abacus_2fprotobuf_2fkind_2eproto = nullptr; -const ::uint32_t TableStruct_abacus_2fprotobuf_2fkind_2eproto::offsets[1] = {}; -static constexpr ::_pbi::MigrationSchema* schemas = nullptr; -static constexpr ::_pb::Message* const* file_default_instances = nullptr; -const char descriptor_table_protodef_abacus_2fprotobuf_2fkind_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\032abacus/protobuf/kind.proto\022\017abacus.pro" - "tobuf*,\n\004Kind\022\t\n\005GAUGE\020\000\022\013\n\007COUNTER\020\001\022\014\n" - "\010CONSTANT\020\002B\021Z\017abacus/protobufb\006proto3" -}; -static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fkind_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fkind_2eproto = { - false, - false, - 118, - descriptor_table_protodef_abacus_2fprotobuf_2fkind_2eproto, - "abacus/protobuf/kind.proto", - &descriptor_table_abacus_2fprotobuf_2fkind_2eproto_once, - nullptr, - 0, - 0, - schemas, - file_default_instances, - TableStruct_abacus_2fprotobuf_2fkind_2eproto::offsets, - nullptr, - file_level_enum_descriptors_abacus_2fprotobuf_2fkind_2eproto, - file_level_service_descriptors_abacus_2fprotobuf_2fkind_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_abacus_2fprotobuf_2fkind_2eproto_getter() { - return &descriptor_table_abacus_2fprotobuf_2fkind_2eproto; -} -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 -static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_abacus_2fprotobuf_2fkind_2eproto(&descriptor_table_abacus_2fprotobuf_2fkind_2eproto); -namespace abacus { -namespace protobuf { -const ::google::protobuf::EnumDescriptor* Kind_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_abacus_2fprotobuf_2fkind_2eproto); - return file_level_enum_descriptors_abacus_2fprotobuf_2fkind_2eproto[0]; -} -bool Kind_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; - } -} -// @@protoc_insertion_point(namespace_scope) -} // namespace protobuf -} // namespace abacus -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google -// @@protoc_insertion_point(global_scope) -#include "google/protobuf/port_undef.inc" diff --git a/src/abacus/protobuf/kind.pb.h b/src/abacus/protobuf/kind.pb.h deleted file mode 100644 index 9a8b1ff7..00000000 --- a/src/abacus/protobuf/kind.pb.h +++ /dev/null @@ -1,138 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: abacus/protobuf/kind.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_abacus_2fprotobuf_2fkind_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_abacus_2fprotobuf_2fkind_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/repeated_field.h" // IWYU pragma: export -#include "google/protobuf/extension_set.h" // IWYU pragma: export -#include "google/protobuf/generated_enum_reflection.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" - -#define PROTOBUF_INTERNAL_EXPORT_abacus_2fprotobuf_2fkind_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_abacus_2fprotobuf_2fkind_2eproto { - static const ::uint32_t offsets[]; -}; -extern const ::google::protobuf::internal::DescriptorTable - descriptor_table_abacus_2fprotobuf_2fkind_2eproto; -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google - -namespace abacus { -namespace protobuf { -enum Kind : int { - GAUGE = 0, - COUNTER = 1, - CONSTANT = 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); -} - -// =================================================================== - - - -// =================================================================== - - - - -// =================================================================== - - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) -} // namespace protobuf -} // namespace abacus - - -namespace google { -namespace protobuf { - -template <> -struct is_proto_enum<::abacus::protobuf::Kind> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Kind>() { - return ::abacus::protobuf::Kind_descriptor(); -} - -} // namespace protobuf -} // namespace google - -// @@protoc_insertion_point(global_scope) - -#include "google/protobuf/port_undef.inc" - -#endif // GOOGLE_PROTOBUF_INCLUDED_abacus_2fprotobuf_2fkind_2eproto_2epb_2eh diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index 5927cab7..e520a859 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -23,6 +23,50 @@ namespace _fl = ::google::protobuf::internal::field_layout; namespace abacus { namespace protobuf { template +PROTOBUF_CONSTEXPR Gauge::Gauge(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct GaugeDefaultTypeInternal { + PROTOBUF_CONSTEXPR GaugeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~GaugeDefaultTypeInternal() {} + union { + Gauge _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GaugeDefaultTypeInternal _Gauge_default_instance_; + template +PROTOBUF_CONSTEXPR Counter::Counter(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct CounterDefaultTypeInternal { + PROTOBUF_CONSTEXPR CounterDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~CounterDefaultTypeInternal() {} + union { + Counter _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CounterDefaultTypeInternal _Counter_default_instance_; + template +PROTOBUF_CONSTEXPR Constant::Constant(::_pbi::ConstantInitialized) {} +struct ConstantDefaultTypeInternal { + PROTOBUF_CONSTEXPR ConstantDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ConstantDefaultTypeInternal() {} + union { + Constant _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConstantDefaultTypeInternal _Constant_default_instance_; + template PROTOBUF_CONSTEXPR UInt64Metric::UInt64Metric(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._has_bits_)*/ {}, @@ -37,7 +81,8 @@ PROTOBUF_CONSTEXPR UInt64Metric::UInt64Metric(::_pbi::ConstantInitialized) }, /*decltype(_impl_.min_)*/ ::uint64_t{0u}, /*decltype(_impl_.max_)*/ ::uint64_t{0u}, - /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct UInt64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR UInt64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -64,7 +109,8 @@ PROTOBUF_CONSTEXPR Int64Metric::Int64Metric(::_pbi::ConstantInitialized) }, /*decltype(_impl_.min_)*/ ::int64_t{0}, /*decltype(_impl_.max_)*/ ::int64_t{0}, - /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct Int64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Int64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -89,9 +135,10 @@ PROTOBUF_CONSTEXPR UInt32Metric::UInt32Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0u, /*decltype(_impl_.max_)*/ 0u, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct UInt32MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR UInt32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -116,9 +163,10 @@ PROTOBUF_CONSTEXPR Int32Metric::Int32Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct Int32MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Int32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -145,7 +193,8 @@ PROTOBUF_CONSTEXPR Float64Metric::Float64Metric(::_pbi::ConstantInitialized) }, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, - /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct Float64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Float64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -170,9 +219,10 @@ PROTOBUF_CONSTEXPR Float32Metric::Float32Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct Float32MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Float32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -197,7 +247,8 @@ PROTOBUF_CONSTEXPR BoolMetric::BoolMetric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct BoolMetricDefaultTypeInternal { PROTOBUF_CONSTEXPR BoolMetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -259,7 +310,8 @@ PROTOBUF_CONSTEXPR Enum8Metric::Enum8Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.kind_)*/ 0, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, } {} struct Enum8MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Enum8MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -275,7 +327,6 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.type_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -323,25 +374,56 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; } // namespace protobuf } // namespace abacus -static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]; +static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[16]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Gauge, _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(::abacus::protobuf::Gauge, _impl_.optional_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Counter, _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(::abacus::protobuf::Counter, _impl_.optional_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _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(::abacus::protobuf::UInt64Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.max_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.kind_), + ~0u, + ~0u, ~0u, ~0u, 0, @@ -350,16 +432,21 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.max_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.kind_), + ~0u, + ~0u, ~0u, ~0u, 0, @@ -368,16 +455,21 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.max_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.kind_), + ~0u, + ~0u, ~0u, ~0u, 0, @@ -386,16 +478,21 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.max_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.kind_), + ~0u, + ~0u, ~0u, ~0u, 0, @@ -404,16 +501,21 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.max_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.kind_), + ~0u, + ~0u, ~0u, ~0u, 0, @@ -422,16 +524,21 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.max_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.kind_), + ~0u, + ~0u, ~0u, ~0u, 0, @@ -440,14 +547,17 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.kind_), + ~0u, ~0u, ~0u, 0, @@ -478,15 +588,18 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.values_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.kind_), + ~0u, ~0u, ~0u, 0, @@ -500,7 +613,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.offset_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.optional_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -538,22 +650,28 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, 13, -1, sizeof(::abacus::protobuf::UInt64Metric)}, - {18, 31, -1, sizeof(::abacus::protobuf::Int64Metric)}, - {36, 49, -1, sizeof(::abacus::protobuf::UInt32Metric)}, - {54, 67, -1, sizeof(::abacus::protobuf::Int32Metric)}, - {72, 85, -1, sizeof(::abacus::protobuf::Float64Metric)}, - {90, 103, -1, sizeof(::abacus::protobuf::Float32Metric)}, - {108, 119, -1, sizeof(::abacus::protobuf::BoolMetric)}, - {122, 132, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, - {134, 144, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, - {146, 158, -1, sizeof(::abacus::protobuf::Enum8Metric)}, - {162, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {181, 191, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {193, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {0, -1, -1, sizeof(::abacus::protobuf::Gauge)}, + {9, -1, -1, sizeof(::abacus::protobuf::Counter)}, + {18, -1, -1, sizeof(::abacus::protobuf::Constant)}, + {26, 42, -1, sizeof(::abacus::protobuf::UInt64Metric)}, + {49, 65, -1, sizeof(::abacus::protobuf::Int64Metric)}, + {72, 88, -1, sizeof(::abacus::protobuf::UInt32Metric)}, + {95, 111, -1, sizeof(::abacus::protobuf::Int32Metric)}, + {118, 134, -1, sizeof(::abacus::protobuf::Float64Metric)}, + {141, 157, -1, sizeof(::abacus::protobuf::Float32Metric)}, + {164, 177, -1, sizeof(::abacus::protobuf::BoolMetric)}, + {181, 191, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, + {193, 203, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, + {205, 219, -1, sizeof(::abacus::protobuf::Enum8Metric)}, + {224, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {242, 252, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {254, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::abacus::protobuf::_Gauge_default_instance_._instance, + &::abacus::protobuf::_Counter_default_instance_._instance, + &::abacus::protobuf::_Constant_default_instance_._instance, &::abacus::protobuf::_UInt64Metric_default_instance_._instance, &::abacus::protobuf::_Int64Metric_default_instance_._instance, &::abacus::protobuf::_UInt32Metric_default_instance_._instance, @@ -570,76 +688,91 @@ static const ::_pb::Message* const file_default_instances[] = { }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." - "protobuf\032\032abacus/protobuf/kind.proto\"\230\001\n" - "\014UInt64Metric\022\023\n\013description\030\001 \001(\t\022#\n\004ki" - "nd\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030" - "\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\004H\001\210\001\001\022\020\n\003max\030\005 \001(" - "\004H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\227\001\n\013Int6" - "4Metric\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001" - "(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH" - "\000\210\001\001\022\020\n\003min\030\004 \001(\003H\001\210\001\001\022\020\n\003max\030\005 \001(\003H\002\210\001\001" - "B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\230\001\n\014UInt32Metr" - "ic\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025." - "abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022" - "\020\n\003min\030\004 \001(\rH\001\210\001\001\022\020\n\003max\030\005 \001(\rH\002\210\001\001B\007\n\005_" - "unitB\006\n\004_minB\006\n\004_max\"\227\001\n\013Int32Metric\022\023\n\013" - "description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus" - ".protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min" - "\030\004 \001(\005H\001\210\001\001\022\020\n\003max\030\005 \001(\005H\002\210\001\001B\007\n\005_unitB\006" - "\n\004_minB\006\n\004_max\"\231\001\n\rFloat64Metric\022\023\n\013desc" - "ription\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.pro" - "tobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001" - "(\001H\001\210\001\001\022\020\n\003max\030\005 \001(\001H\002\210\001\001B\007\n\005_unitB\006\n\004_m" - "inB\006\n\004_max\"\231\001\n\rFloat32Metric\022\023\n\013descript" - "ion\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobu" - "f.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022\020\n\003min\030\004 \001(\002H\001" - "\210\001\001\022\020\n\003max\030\005 \001(\002H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006" - "\n\004_max\"b\n\nBoolMetric\022\023\n\013description\030\001 \001(" - "\t\022#\n\004kind\030\002 \001(\0162\025.abacus.protobuf.Kind\022\021" - "\n\004unit\030\003 \001(\tH\000\210\001\001B\007\n\005_unit\"\271\002\n\013Enum8Metr" - "ic\022\023\n\013description\030\001 \001(\t\022#\n\004kind\030\002 \001(\0162\025." - "abacus.protobuf.Kind\022\021\n\004unit\030\003 \001(\tH\000\210\001\001\022" - "8\n\006values\030\004 \003(\0132(.abacus.protobuf.Enum8M" - "etric.ValuesEntry\032C\n\tEnumValue\022\014\n\004name\030\001" - " \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001\001B\016\n\014_descr" - "iption\032U\n\013ValuesEntry\022\013\n\003key\030\001 \001(\r\0225\n\005va" - "lue\030\002 \001(\0132&.abacus.protobuf.Enum8Metric." - "EnumValue:\0028\001B\007\n\005_unit\"\267\003\n\006Metric\022\016\n\006off" - "set\030\001 \001(\r\022\020\n\010optional\030\002 \001(\010\022/\n\006uint64\030\003 " - "\001(\0132\035.abacus.protobuf.UInt64MetricH\000\022-\n\005" - "int64\030\004 \001(\0132\034.abacus.protobuf.Int64Metri" - "cH\000\022/\n\006uint32\030\005 \001(\0132\035.abacus.protobuf.UI" - "nt32MetricH\000\022-\n\005int32\030\006 \001(\0132\034.abacus.pro" - "tobuf.Int32MetricH\000\0221\n\007float64\030\007 \001(\0132\036.a" - "bacus.protobuf.Float64MetricH\000\0221\n\007float3" - "2\030\010 \001(\0132\036.abacus.protobuf.Float32MetricH" - "\000\022.\n\007boolean\030\t \001(\0132\033.abacus.protobuf.Boo" - "lMetricH\000\022-\n\005enum8\030\n \001(\0132\034.abacus.protob" - "uf.Enum8MetricH\000B\006\n\004type\"\371\001\n\017MetricsMeta" - "data\022\030\n\020protocol_version\030\001 \001(\r\022/\n\nendian" - "ness\030\002 \001(\0162\033.abacus.protobuf.Endianness\022" - "\022\n\nsync_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.a" - "bacus.protobuf.MetricsMetadata.MetricsEn" - "try\032G\n\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005valu" - "e\030\002 \001(\0132\027.abacus.protobuf.Metric:\0028\001*!\n\n" - "Endianness\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacu" - "s/protobufb\006proto3" -}; -static const ::_pbi::DescriptorTable* const descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps[1] = - { - &::descriptor_table_abacus_2fprotobuf_2fkind_2eproto, + "protobuf\"\031\n\005Gauge\022\020\n\010optional\030\001 \001(\010\"\033\n\007C" + "ounter\022\020\n\010optional\030\001 \001(\010\"\n\n\010Constant\"\200\002\n" + "\014UInt64Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005ga" + "uge\030\002 \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007c" + "ounter\030\003 \001(\0132\030.abacus.protobuf.CounterH\000" + "\022-\n\010constant\030\004 \001(\0132\031.abacus.protobuf.Con" + "stantH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\022\020\n\003min\030\006 \001(\004H" + "\002\210\001\001\022\020\n\003max\030\007 \001(\004H\003\210\001\001B\006\n\004kindB\007\n\005_unitB" + "\006\n\004_minB\006\n\004_max\"\377\001\n\013Int64Metric\022\023\n\013descr" + "iption\030\001 \001(\t\022\'\n\005gauge\030\002 \001(\0132\026.abacus.pro" + "tobuf.GaugeH\000\022+\n\007counter\030\003 \001(\0132\030.abacus." + "protobuf.CounterH\000\022-\n\010constant\030\004 \001(\0132\031.a" + "bacus.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\tH" + "\001\210\001\001\022\020\n\003min\030\006 \001(\003H\002\210\001\001\022\020\n\003max\030\007 \001(\003H\003\210\001\001" + "B\006\n\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\200\002\n\014UI" + "nt32Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge" + "\030\002 \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007coun" + "ter\030\003 \001(\0132\030.abacus.protobuf.CounterH\000\022-\n" + "\010constant\030\004 \001(\0132\031.abacus.protobuf.Consta" + "ntH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\022\020\n\003min\030\006 \001(\rH\002\210\001" + "\001\022\020\n\003max\030\007 \001(\rH\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004" + "_minB\006\n\004_max\"\377\001\n\013Int32Metric\022\023\n\013descript" + "ion\030\001 \001(\t\022\'\n\005gauge\030\002 \001(\0132\026.abacus.protob" + "uf.GaugeH\000\022+\n\007counter\030\003 \001(\0132\030.abacus.pro" + "tobuf.CounterH\000\022-\n\010constant\030\004 \001(\0132\031.abac" + "us.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001" + "\001\022\020\n\003min\030\006 \001(\005H\002\210\001\001\022\020\n\003max\030\007 \001(\005H\003\210\001\001B\006\n" + "\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\201\002\n\rFloat" + "64Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge\030\002" + " \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007counte" + "r\030\003 \001(\0132\030.abacus.protobuf.CounterH\000\022-\n\010c" + "onstant\030\004 \001(\0132\031.abacus.protobuf.Constant" + "H\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\022\020\n\003min\030\006 \001(\001H\002\210\001\001\022" + "\020\n\003max\030\007 \001(\001H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004_m" + "inB\006\n\004_max\"\201\002\n\rFloat32Metric\022\023\n\013descript" + "ion\030\001 \001(\t\022\'\n\005gauge\030\002 \001(\0132\026.abacus.protob" + "uf.GaugeH\000\022+\n\007counter\030\003 \001(\0132\030.abacus.pro" + "tobuf.CounterH\000\022-\n\010constant\030\004 \001(\0132\031.abac" + "us.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001" + "\001\022\020\n\003min\030\006 \001(\002H\002\210\001\001\022\020\n\003max\030\007 \001(\002H\003\210\001\001B\006\n" + "\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\235\001\n\nBoolM" + "etric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge\030\002 \001(" + "\0132\026.abacus.protobuf.GaugeH\000\022-\n\010constant\030" + "\003 \001(\0132\031.abacus.protobuf.ConstantH\000\022\021\n\004un" + "it\030\004 \001(\tH\001\210\001\001B\006\n\004kindB\007\n\005_unit\"\364\002\n\013Enum8" + "Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge\030\002 \001" + "(\0132\026.abacus.protobuf.GaugeH\000\022-\n\010constant" + "\030\003 \001(\0132\031.abacus.protobuf.ConstantH\000\022\021\n\004u" + "nit\030\004 \001(\tH\001\210\001\001\0228\n\006values\030\005 \003(\0132(.abacus." + "protobuf.Enum8Metric.ValuesEntry\032C\n\tEnum" + "Value\022\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\t" + "H\000\210\001\001B\016\n\014_description\032U\n\013ValuesEntry\022\013\n\003" + "key\030\001 \001(\r\0225\n\005value\030\002 \001(\0132&.abacus.protob" + "uf.Enum8Metric.EnumValue:\0028\001B\006\n\004kindB\007\n\005" + "_unit\"\245\003\n\006Metric\022\016\n\006offset\030\001 \001(\r\022/\n\006uint" + "64\030\003 \001(\0132\035.abacus.protobuf.UInt64MetricH" + "\000\022-\n\005int64\030\004 \001(\0132\034.abacus.protobuf.Int64" + "MetricH\000\022/\n\006uint32\030\005 \001(\0132\035.abacus.protob" + "uf.UInt32MetricH\000\022-\n\005int32\030\006 \001(\0132\034.abacu" + "s.protobuf.Int32MetricH\000\0221\n\007float64\030\007 \001(" + "\0132\036.abacus.protobuf.Float64MetricH\000\0221\n\007f" + "loat32\030\010 \001(\0132\036.abacus.protobuf.Float32Me" + "tricH\000\022.\n\007boolean\030\t \001(\0132\033.abacus.protobu" + "f.BoolMetricH\000\022-\n\005enum8\030\n \001(\0132\034.abacus.p" + "rotobuf.Enum8MetricH\000B\006\n\004type\"\371\001\n\017Metric" + "sMetadata\022\030\n\020protocol_version\030\001 \001(\r\022/\n\ne" + "ndianness\030\002 \001(\0162\033.abacus.protobuf.Endian" + "ness\022\022\n\nsync_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(" + "\0132-.abacus.protobuf.MetricsMetadata.Metr" + "icsEntry\032G\n\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n" + "\005value\030\002 \001(\0132\027.abacus.protobuf.Metric:\0028" + "\001*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017" + "abacus/protobufb\006proto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2178, + 2943, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_deps, - 1, - 13, + nullptr, + 0, + 16, schemas, file_default_instances, TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets, @@ -682,117 +815,51 @@ bool Endianness_IsValid(int value) { } // =================================================================== -class UInt64Metric::_Internal { +class Gauge::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_); - static void set_has_unit(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_min(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_max(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } }; -UInt64Metric::UInt64Metric(::google::protobuf::Arena* arena) +Gauge::Gauge(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt64Metric) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Gauge) } -UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Message() { - UInt64Metric* const _this = this; - (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){from._impl_._has_bits_}, - /*decltype(_impl_._cached_size_)*/ {}, - decltype(_impl_.description_){}, - decltype(_impl_.unit_){}, - decltype(_impl_.min_){}, - decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, - }; +Gauge::Gauge(const Gauge& from) + : ::google::protobuf::Message(), _impl_(from._impl_) { _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _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._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); - } - ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); - - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Metric) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Gauge) } -inline void UInt64Metric::SharedCtor(::_pb::Arena* arena) { +inline void Gauge::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){}, + decltype(_impl_.optional_){false}, /*decltype(_impl_._cached_size_)*/ {}, - decltype(_impl_.description_){}, - decltype(_impl_.unit_){}, - decltype(_impl_.min_){::uint64_t{0u}}, - decltype(_impl_.max_){::uint64_t{0u}}, - decltype(_impl_.kind_){0}, }; - _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 } -UInt64Metric::~UInt64Metric() { - // @@protoc_insertion_point(destructor:abacus.protobuf.UInt64Metric) +Gauge::~Gauge() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Gauge) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void UInt64Metric::SharedDtor() { +inline void Gauge::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.description_.Destroy(); - _impl_.unit_.Destroy(); } -void UInt64Metric::SetCachedSize(int size) const { +void Gauge::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void UInt64Metric::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt64Metric) +PROTOBUF_NOINLINE void Gauge::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Gauge) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.description_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - _impl_.unit_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000006u) { - ::memset(&_impl_.min_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); - } - _impl_.kind_ = 0; - _impl_._has_bits_.Clear(); + _impl_.optional_ = false; _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* UInt64Metric::_InternalParse( +const char* Gauge::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -800,109 +867,680 @@ const char* UInt64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 52, 2> UInt64Metric::_table_ = { +const ::_pbi::TcParseTable<0, 1, 0, 0, 2> Gauge::_table_ = { { - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_), + 0, // no _has_bits_ 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 1, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967294, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries + 1, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_UInt64Metric_default_instance_._instance, + &_Gauge_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; - {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Metric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_)}}, - // optional string unit = 3; - {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, - // optional uint64 min = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.min_), 1>(), - {32, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, - // optional uint64 max = 5; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), - {40, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + // bool optional = 1; + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Gauge, _impl_.optional_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint64 min = 4; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - // optional uint64 max = 5; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // bool optional = 1; + {PROTOBUF_FIELD_OFFSET(Gauge, _impl_.optional_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, }}, // no aux_entries {{ - "\34\13\0\4\0\0\0\0" - "abacus.protobuf.UInt64Metric" - "description" - "unit" }}, }; -::uint8_t* UInt64Metric::_InternalSerialize( +::uint8_t* Gauge::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt64Metric) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Gauge) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; - 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, "abacus.protobuf.UInt64Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); - } - - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); - } - - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; - if (cached_has_bits & 0x00000001u) { - const std::string& _s = this->_internal_unit(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt64Metric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); - } - - // optional uint64 min = 4; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 4, this->_internal_min(), target); - } - - // optional uint64 max = 5; - if (cached_has_bits & 0x00000004u) { + // bool optional = 1; + if (this->_internal_optional() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 5, this->_internal_max(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 1, this->_internal_optional(), target); + } + + 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:abacus.protobuf.Gauge) + return target; +} + +::size_t Gauge::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Gauge) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool optional = 1; + if (this->_internal_optional() != 0) { + total_size += 2; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Gauge::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Gauge::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Gauge::GetClassData() const { return &_class_data_; } + + +void Gauge::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:abacus.protobuf.Gauge) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Gauge::CopyFrom(const Gauge& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Gauge) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Gauge::IsInitialized() const { + return true; +} + +void Gauge::InternalSwap(Gauge* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.optional_, other->_impl_.optional_); +} + +::google::protobuf::Metadata Gauge::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); +} +// =================================================================== + +class Counter::_Internal { + public: +}; + +Counter::Counter(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Counter) +} +Counter::Counter(const Counter& from) + : ::google::protobuf::Message(), _impl_(from._impl_) { + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Counter) +} +inline void Counter::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.optional_){false}, + /*decltype(_impl_._cached_size_)*/ {}, + }; +} +Counter::~Counter() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Counter) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Counter::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); +} +void Counter::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void Counter::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Counter) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.optional_ = false; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* Counter::_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, 1, 0, 0, 2> Counter::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_Counter_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // bool optional = 1; + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Counter, _impl_.optional_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // bool optional = 1; + {PROTOBUF_FIELD_OFFSET(Counter, _impl_.optional_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + }}, + // no aux_entries + {{ + }}, +}; + +::uint8_t* Counter::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Counter) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // bool optional = 1; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 1, this->_internal_optional(), target); + } + + 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:abacus.protobuf.Counter) + return target; +} + +::size_t Counter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Counter) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool optional = 1; + if (this->_internal_optional() != 0) { + total_size += 2; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData Counter::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + Counter::MergeImpl +}; +const ::google::protobuf::Message::ClassData*Counter::GetClassData() const { return &_class_data_; } + + +void Counter::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:abacus.protobuf.Counter) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Counter::CopyFrom(const Counter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Counter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool Counter::IsInitialized() const { + return true; +} + +void Counter::InternalSwap(Counter* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.optional_, other->_impl_.optional_); +} + +::google::protobuf::Metadata Counter::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); +} +// =================================================================== + +class Constant::_Internal { + public: +}; + +Constant::Constant(::google::protobuf::Arena* arena) + : ::google::protobuf::internal::ZeroFieldsBase(arena) { + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Constant) +} +Constant::Constant(const Constant& from) : ::google::protobuf::internal::ZeroFieldsBase() { + Constant* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Constant) +} + + + + +const ::google::protobuf::Message::ClassData Constant::_class_data_ = { + ::google::protobuf::internal::ZeroFieldsBase::CopyImpl, + ::google::protobuf::internal::ZeroFieldsBase::MergeImpl, +}; +const ::google::protobuf::Message::ClassData*Constant::GetClassData() const { return &_class_data_; } + + + + + + + +::google::protobuf::Metadata Constant::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); +} +// =================================================================== + +class UInt64Metric::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const UInt64Metric* msg); + static const ::abacus::protobuf::Counter& counter(const UInt64Metric* msg); + static const ::abacus::protobuf::Constant& constant(const UInt64Metric* msg); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } +}; + +const ::abacus::protobuf::Gauge& UInt64Metric::_Internal::gauge(const UInt64Metric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Counter& UInt64Metric::_Internal::counter(const UInt64Metric* msg) { + return *msg->_impl_.kind_.counter_; +} +const ::abacus::protobuf::Constant& UInt64Metric::_Internal::constant(const UInt64Metric* msg) { + return *msg->_impl_.kind_.constant_; +} +void UInt64Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.gauge) +} +void UInt64Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (counter) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(counter); + if (message_arena != submessage_arena) { + counter = ::google::protobuf::internal::GetOwnedMessage( + message_arena, counter, submessage_arena); + } + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.counter) +} +void UInt64Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.constant) +} +UInt64Metric::UInt64Metric(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt64Metric) +} +UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Message() { + UInt64Metric* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.min_, &from._impl_.min_, + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Metric) +} +inline void UInt64Metric::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.min_){::uint64_t{0u}}, + decltype(_impl_.max_){::uint64_t{0u}}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + _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_kind(); +} +UInt64Metric::~UInt64Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.UInt64Metric) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void UInt64Metric::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); + _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } +} +void UInt64Metric::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void UInt64Metric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.UInt64Metric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kCounter: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + +PROTOBUF_NOINLINE void UInt64Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt64Metric) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + clear_kind(); + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* UInt64Metric::_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, 7, 3, 52, 2> UInt64Metric::_table_ = { + { + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_), + 0, // no _extensions_ + 7, 56, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967168, // skipmap + offsetof(decltype(_table_), field_entries), + 7, // num_field_entries + 3, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_UInt64Metric_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string description = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; + {::_pbi::TcParser::FastUS1, + {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, + // optional uint64 min = 6; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.min_), 1>(), + {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, + // optional uint64 max = 7; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), + {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string description = 1; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Counter counter = 3; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 4; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 5; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional uint64 min = 6; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // optional uint64 max = 7; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\34\13\0\0\0\4\0\0" + "abacus.protobuf.UInt64Metric" + "description" + "unit" + }}, +}; + +::uint8_t* UInt64Metric::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.UInt64Metric) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string description = 1; + 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, "abacus.protobuf.UInt64Metric.description"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kCounter: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::counter(this), + _Internal::counter(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; + } + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 5; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt64Metric.unit"); + target = stream->WriteStringMaybeAliased(5, _s, target); + } + + // optional uint64 min = 6; + if (cached_has_bits & 0x00000002u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 6, this->_internal_min(), target); + } + + // optional uint64 max = 7; + if (cached_has_bits & 0x00000004u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -930,31 +1568,51 @@ ::size_t UInt64Metric::ByteSizeLong() const { cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // optional uint64 min = 4; + // optional uint64 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_min()); } - // optional uint64 max = 5; + // optional uint64 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_max()); } } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Counter counter = 3; + case kCounter: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.counter_); + break; + } + // .abacus.protobuf.Constant constant = 4; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -989,8 +1647,25 @@ void UInt64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -1017,17 +1692,19 @@ void UInt64Metric::InternalSwap(UInt64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_) - + sizeof(UInt64Metric::_impl_.kind_) + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_) + + sizeof(UInt64Metric::_impl_.max_) - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); + swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata UInt64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]); } // =================================================================== @@ -1036,6 +1713,11 @@ class Int64Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const Int64Metric* msg); + static const ::abacus::protobuf::Counter& counter(const Int64Metric* msg); + static const ::abacus::protobuf::Constant& constant(const Int64Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -1047,6 +1729,60 @@ class Int64Metric::_Internal { } }; +const ::abacus::protobuf::Gauge& Int64Metric::_Internal::gauge(const Int64Metric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Counter& Int64Metric::_Internal::counter(const Int64Metric* msg) { + return *msg->_impl_.kind_.counter_; +} +const ::abacus::protobuf::Constant& Int64Metric::_Internal::constant(const Int64Metric* msg) { + return *msg->_impl_.kind_.constant_; +} +void Int64Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.gauge) +} +void Int64Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (counter) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(counter); + if (message_arena != submessage_arena) { + counter = ::google::protobuf::internal::GetOwnedMessage( + message_arena, counter, submessage_arena); + } + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.counter) +} +void Int64Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.constant) +} Int64Metric::Int64Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -1063,6 +1799,7 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( decltype(_impl_.min_){}, decltype(_impl_.max_){}, decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -1081,8 +1818,29 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int64Metric) } @@ -1095,7 +1853,8 @@ inline void Int64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.unit_){}, decltype(_impl_.min_){::int64_t{0}}, decltype(_impl_.max_){::int64_t{0}}, - decltype(_impl_.kind_){0}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -1105,6 +1864,7 @@ inline void Int64Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); } Int64Metric::~Int64Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Int64Metric) @@ -1115,11 +1875,43 @@ inline void Int64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } } void Int64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } +void Int64Metric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Int64Metric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kCounter: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + PROTOBUF_NOINLINE void Int64Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int64Metric) ::uint32_t cached_has_bits = 0; @@ -1136,7 +1928,7 @@ PROTOBUF_NOINLINE void Int64Metric::Clear() { reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - _impl_.kind_ = 0; + clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -1149,17 +1941,17 @@ const char* Int64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 51, 2> Int64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 3, 51, 2> Int64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_), 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 7, // num_field_entries + 3, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_Int64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ @@ -1167,42 +1959,48 @@ const ::_pbi::TcParseTable<3, 5, 0, 51, 2> Int64Metric::_table_ = { // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Metric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_)}}, - // optional string unit = 3; + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, - // optional int64 min = 4; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, + // optional int64 min = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.min_), 1>(), - {32, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, - // optional int64 max = 5; + {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, + // optional int64 max = 7; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.max_), 2>(), - {40, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Counter counter = 3; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 4; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int64 min = 4; + // optional int64 min = 6; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, - // optional int64 max = 5; + // optional int64 max = 7; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, - }}, - // no aux_entries - {{ - "\33\13\0\4\0\0\0\0" + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\33\13\0\0\0\4\0\0" "abacus.protobuf.Int64Metric" "description" "unit" @@ -1224,33 +2022,48 @@ ::uint8_t* Int64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kCounter: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::counter(this), + _Internal::counter(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int64Metric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional int64 min = 4; + // optional int64 min = 6; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<4>( + WriteInt64ToArrayWithField<6>( stream, this->_internal_min(), target); } - // optional int64 max = 5; + // optional int64 max = 7; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<5>( + WriteInt64ToArrayWithField<7>( stream, this->_internal_max(), target); } @@ -1279,31 +2092,51 @@ ::size_t Int64Metric::ByteSizeLong() const { cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // optional int64 min = 4; + // optional int64 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_min()); } - // optional int64 max = 5; + // optional int64 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_max()); } } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Counter counter = 3; + case kCounter: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.counter_); + break; + } + // .abacus.protobuf.Constant constant = 4; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1338,8 +2171,25 @@ void Int64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -1366,17 +2216,19 @@ void Int64Metric::InternalSwap(Int64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_) - + sizeof(Int64Metric::_impl_.kind_) + PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_) + + sizeof(Int64Metric::_impl_.max_) - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); + swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata Int64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[4]); } // =================================================================== @@ -1385,6 +2237,11 @@ class UInt32Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const UInt32Metric* msg); + static const ::abacus::protobuf::Counter& counter(const UInt32Metric* msg); + static const ::abacus::protobuf::Constant& constant(const UInt32Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -1396,6 +2253,60 @@ class UInt32Metric::_Internal { } }; +const ::abacus::protobuf::Gauge& UInt32Metric::_Internal::gauge(const UInt32Metric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Counter& UInt32Metric::_Internal::counter(const UInt32Metric* msg) { + return *msg->_impl_.kind_.counter_; +} +const ::abacus::protobuf::Constant& UInt32Metric::_Internal::constant(const UInt32Metric* msg) { + return *msg->_impl_.kind_.constant_; +} +void UInt32Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.gauge) +} +void UInt32Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (counter) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(counter); + if (message_arena != submessage_arena) { + counter = ::google::protobuf::internal::GetOwnedMessage( + message_arena, counter, submessage_arena); + } + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.counter) +} +void UInt32Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.constant) +} UInt32Metric::UInt32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -1409,9 +2320,10 @@ UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Messa /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -1429,9 +2341,30 @@ UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Messa if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.kind_, &from._impl_.kind_, + ::memcpy(&_impl_.min_, &from._impl_.min_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt32Metric) } @@ -1442,9 +2375,10 @@ inline void UInt32Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){0}, decltype(_impl_.min_){0u}, decltype(_impl_.max_){0u}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -1454,6 +2388,7 @@ inline void UInt32Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); } UInt32Metric::~UInt32Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.UInt32Metric) @@ -1464,11 +2399,43 @@ inline void UInt32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } } void UInt32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } +void UInt32Metric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.UInt32Metric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kCounter: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + PROTOBUF_NOINLINE void UInt32Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt32Metric) ::uint32_t cached_has_bits = 0; @@ -1480,12 +2447,12 @@ PROTOBUF_NOINLINE void UInt32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.kind_ = 0; if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } + clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -1498,17 +2465,17 @@ const char* UInt32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 52, 2> UInt32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 3, 52, 2> UInt32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_), 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 7, // num_field_entries + 3, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_UInt32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ @@ -1516,42 +2483,48 @@ const ::_pbi::TcParseTable<3, 5, 0, 52, 2> UInt32Metric::_table_ = { // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_)}}, - // optional string unit = 3; + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, - // optional uint32 min = 4; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, + // optional uint32 min = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.min_), 1>(), - {32, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, - // optional uint32 max = 5; + {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, + // optional uint32 max = 7; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.max_), 2>(), - {40, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Counter counter = 3; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 4; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint32 min = 4; + // optional uint32 min = 6; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, - // optional uint32 max = 5; + // optional uint32 max = 7; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, - }}, - // no aux_entries - {{ - "\34\13\0\4\0\0\0\0" + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\34\13\0\0\0\4\0\0" "abacus.protobuf.UInt32Metric" "description" "unit" @@ -1573,34 +2546,49 @@ ::uint8_t* UInt32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kCounter: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::counter(this), + _Internal::counter(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt32Metric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional uint32 min = 4; + // optional uint32 min = 6; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 4, this->_internal_min(), target); + 6, this->_internal_min(), target); } - // optional uint32 max = 5; + // optional uint32 max = 7; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 5, this->_internal_max(), target); + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1626,33 +2614,53 @@ ::size_t UInt32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 3; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } - - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - } + if (cached_has_bits & 0x00000007u) { + // optional string unit = 5; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } - if (cached_has_bits & 0x00000006u) { - // optional uint32 min = 4; + // optional uint32 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_min()); } - // optional uint32 max = 5; + // optional uint32 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_max()); } } + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Counter counter = 3; + case kCounter: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.counter_); + break; + } + // .abacus.protobuf.Constant constant = 4; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1674,14 +2682,11 @@ void UInt32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_set_unit(from._internal_unit()); - } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); - } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000006u) { + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_unit(from._internal_unit()); + } if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -1690,6 +2695,26 @@ void UInt32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google } _this->_impl_._has_bits_[0] |= cached_has_bits; } + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -1717,15 +2742,17 @@ void UInt32Metric::InternalSwap(UInt32Metric* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_) + sizeof(UInt32Metric::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_)>( - reinterpret_cast(&_impl_.kind_), - reinterpret_cast(&other->_impl_.kind_)); + - PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)>( + reinterpret_cast(&_impl_.min_), + reinterpret_cast(&other->_impl_.min_)); + swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata UInt32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[5]); } // =================================================================== @@ -1734,6 +2761,11 @@ class Int32Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const Int32Metric* msg); + static const ::abacus::protobuf::Counter& counter(const Int32Metric* msg); + static const ::abacus::protobuf::Constant& constant(const Int32Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -1745,6 +2777,60 @@ class Int32Metric::_Internal { } }; +const ::abacus::protobuf::Gauge& Int32Metric::_Internal::gauge(const Int32Metric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Counter& Int32Metric::_Internal::counter(const Int32Metric* msg) { + return *msg->_impl_.kind_.counter_; +} +const ::abacus::protobuf::Constant& Int32Metric::_Internal::constant(const Int32Metric* msg) { + return *msg->_impl_.kind_.constant_; +} +void Int32Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.gauge) +} +void Int32Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (counter) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(counter); + if (message_arena != submessage_arena) { + counter = ::google::protobuf::internal::GetOwnedMessage( + message_arena, counter, submessage_arena); + } + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.counter) +} +void Int32Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.constant) +} Int32Metric::Int32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -1758,9 +2844,10 @@ Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message( /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -1778,9 +2865,30 @@ Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.kind_, &from._impl_.kind_, + ::memcpy(&_impl_.min_, &from._impl_.min_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int32Metric) } @@ -1791,9 +2899,10 @@ inline void Int32Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -1803,6 +2912,7 @@ inline void Int32Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); } Int32Metric::~Int32Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Int32Metric) @@ -1813,11 +2923,43 @@ inline void Int32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } } void Int32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } +void Int32Metric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Int32Metric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kCounter: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + PROTOBUF_NOINLINE void Int32Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int32Metric) ::uint32_t cached_has_bits = 0; @@ -1829,12 +2971,12 @@ PROTOBUF_NOINLINE void Int32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.kind_ = 0; if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } + clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -1847,17 +2989,17 @@ const char* Int32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 51, 2> Int32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 3, 51, 2> Int32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_), 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 7, // num_field_entries + 3, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_Int32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ @@ -1865,42 +3007,48 @@ const ::_pbi::TcParseTable<3, 5, 0, 51, 2> Int32Metric::_table_ = { // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_)}}, - // optional string unit = 3; + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, - // optional int32 min = 4; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, + // optional int32 min = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.min_), 1>(), - {32, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, - // optional int32 max = 5; + {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, + // optional int32 max = 7; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.max_), 2>(), - {40, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Counter counter = 3; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 4; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int32 min = 4; + // optional int32 min = 6; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - // optional int32 max = 5; + // optional int32 max = 7; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - }}, - // no aux_entries - {{ - "\33\13\0\4\0\0\0\0" + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\33\13\0\0\0\4\0\0" "abacus.protobuf.Int32Metric" "description" "unit" @@ -1922,33 +3070,48 @@ ::uint8_t* Int32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kCounter: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::counter(this), + _Internal::counter(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int32Metric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional int32 min = 4; + // optional int32 min = 6; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<4>( + WriteInt32ToArrayWithField<6>( stream, this->_internal_min(), target); } - // optional int32 max = 5; + // optional int32 max = 7; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<5>( + WriteInt32ToArrayWithField<7>( stream, this->_internal_max(), target); } @@ -1975,33 +3138,53 @@ ::size_t Int32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 3; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } - - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - } + if (cached_has_bits & 0x00000007u) { + // optional string unit = 5; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } - if (cached_has_bits & 0x00000006u) { - // optional int32 min = 4; + // optional int32 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_min()); } - // optional int32 max = 5; + // optional int32 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_max()); } } + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Counter counter = 3; + case kCounter: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.counter_); + break; + } + // .abacus.protobuf.Constant constant = 4; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2023,14 +3206,11 @@ void Int32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_set_unit(from._internal_unit()); - } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); - } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000006u) { + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_unit(from._internal_unit()); + } if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -2039,6 +3219,26 @@ void Int32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: } _this->_impl_._has_bits_[0] |= cached_has_bits; } + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -2066,15 +3266,17 @@ void Int32Metric::InternalSwap(Int32Metric* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_) + sizeof(Int32Metric::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_)>( - reinterpret_cast(&_impl_.kind_), - reinterpret_cast(&other->_impl_.kind_)); + - PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)>( + reinterpret_cast(&_impl_.min_), + reinterpret_cast(&other->_impl_.min_)); + swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata Int32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[6]); } // =================================================================== @@ -2083,6 +3285,11 @@ class Float64Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const Float64Metric* msg); + static const ::abacus::protobuf::Counter& counter(const Float64Metric* msg); + static const ::abacus::protobuf::Constant& constant(const Float64Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -2094,6 +3301,60 @@ class Float64Metric::_Internal { } }; +const ::abacus::protobuf::Gauge& Float64Metric::_Internal::gauge(const Float64Metric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Counter& Float64Metric::_Internal::counter(const Float64Metric* msg) { + return *msg->_impl_.kind_.counter_; +} +const ::abacus::protobuf::Constant& Float64Metric::_Internal::constant(const Float64Metric* msg) { + return *msg->_impl_.kind_.constant_; +} +void Float64Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.gauge) +} +void Float64Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (counter) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(counter); + if (message_arena != submessage_arena) { + counter = ::google::protobuf::internal::GetOwnedMessage( + message_arena, counter, submessage_arena); + } + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.counter) +} +void Float64Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.constant) +} Float64Metric::Float64Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -2110,6 +3371,7 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me decltype(_impl_.min_){}, decltype(_impl_.max_){}, decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -2128,8 +3390,29 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.kind_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float64Metric) } @@ -2142,7 +3425,8 @@ inline void Float64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.unit_){}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, - decltype(_impl_.kind_){0}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -2152,6 +3436,7 @@ inline void Float64Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); } Float64Metric::~Float64Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Float64Metric) @@ -2162,11 +3447,43 @@ inline void Float64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } } void Float64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } +void Float64Metric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Float64Metric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kCounter: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + PROTOBUF_NOINLINE void Float64Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float64Metric) ::uint32_t cached_has_bits = 0; @@ -2183,7 +3500,7 @@ PROTOBUF_NOINLINE void Float64Metric::Clear() { reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - _impl_.kind_ = 0; + clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -2196,17 +3513,17 @@ const char* Float64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 53, 2> Float64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 3, 53, 2> Float64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_), 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 7, // num_field_entries + 3, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_Float64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ @@ -2214,42 +3531,48 @@ const ::_pbi::TcParseTable<3, 5, 0, 53, 2> Float64Metric::_table_ = { // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Metric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_)}}, - // optional string unit = 3; + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, - // optional double min = 4; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, + // optional double min = 6; {::_pbi::TcParser::FastF64S1, - {33, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, - // optional double max = 5; + {49, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, + // optional double max = 7; {::_pbi::TcParser::FastF64S1, - {41, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + {57, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Counter counter = 3; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 4; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional double min = 4; + // optional double min = 6; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, - // optional double max = 5; + // optional double max = 7; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, - }}, - // no aux_entries - {{ - "\35\13\0\4\0\0\0\0" + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\35\13\0\0\0\4\0\0" "abacus.protobuf.Float64Metric" "description" "unit" @@ -2271,34 +3594,49 @@ ::uint8_t* Float64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kCounter: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::counter(this), + _Internal::counter(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float64Metric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional double min = 4; + // optional double min = 6; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 4, this->_internal_min(), target); + 6, this->_internal_min(), target); } - // optional double max = 5; + // optional double max = 7; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 5, this->_internal_max(), target); + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2326,29 +3664,49 @@ ::size_t Float64Metric::ByteSizeLong() const { cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // optional double min = 4; + // optional double min = 6; if (cached_has_bits & 0x00000002u) { total_size += 9; } - // optional double max = 5; + // optional double max = 7; if (cached_has_bits & 0x00000004u) { total_size += 9; } } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Counter counter = 3; + case kCounter: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.counter_); + break; + } + // .abacus.protobuf.Constant constant = 4; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2383,8 +3741,25 @@ void Float64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -2411,17 +3786,19 @@ void Float64Metric::InternalSwap(Float64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_) - + sizeof(Float64Metric::_impl_.kind_) + PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_) + + sizeof(Float64Metric::_impl_.max_) - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); + swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata Float64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[4]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); } // =================================================================== @@ -2430,6 +3807,11 @@ class Float32Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const Float32Metric* msg); + static const ::abacus::protobuf::Counter& counter(const Float32Metric* msg); + static const ::abacus::protobuf::Constant& constant(const Float32Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -2441,6 +3823,60 @@ class Float32Metric::_Internal { } }; +const ::abacus::protobuf::Gauge& Float32Metric::_Internal::gauge(const Float32Metric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Counter& Float32Metric::_Internal::counter(const Float32Metric* msg) { + return *msg->_impl_.kind_.counter_; +} +const ::abacus::protobuf::Constant& Float32Metric::_Internal::constant(const Float32Metric* msg) { + return *msg->_impl_.kind_.constant_; +} +void Float32Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.gauge) +} +void Float32Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (counter) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(counter); + if (message_arena != submessage_arena) { + counter = ::google::protobuf::internal::GetOwnedMessage( + message_arena, counter, submessage_arena); + } + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.counter) +} +void Float32Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.constant) +} Float32Metric::Float32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -2454,9 +3890,10 @@ Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Me /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -2474,9 +3911,30 @@ Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Me if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.kind_, &from._impl_.kind_, + ::memcpy(&_impl_.min_, &from._impl_.min_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_)); + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float32Metric) } @@ -2487,9 +3945,10 @@ inline void Float32Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -2499,6 +3958,7 @@ inline void Float32Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); } Float32Metric::~Float32Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Float32Metric) @@ -2509,11 +3969,43 @@ inline void Float32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } } void Float32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } +void Float32Metric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Float32Metric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kCounter: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + PROTOBUF_NOINLINE void Float32Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float32Metric) ::uint32_t cached_has_bits = 0; @@ -2525,12 +4017,12 @@ PROTOBUF_NOINLINE void Float32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.kind_ = 0; if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } + clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -2543,17 +4035,17 @@ const char* Float32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 53, 2> Float32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 3, 53, 2> Float32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_), 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 7, // num_field_entries + 3, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_Float32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ @@ -2561,42 +4053,48 @@ const ::_pbi::TcParseTable<3, 5, 0, 53, 2> Float32Metric::_table_ = { // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Metric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_)}}, - // optional string unit = 3; + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, - // optional float min = 4; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, + // optional float min = 6; {::_pbi::TcParser::FastF32S1, - {37, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, - // optional float max = 5; + {53, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, + // optional float max = 7; {::_pbi::TcParser::FastF32S1, - {45, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + {61, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Counter counter = 3; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 4; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional float min = 4; + // optional float min = 6; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, - // optional float max = 5; + // optional float max = 7; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, - }}, - // no aux_entries - {{ - "\35\13\0\4\0\0\0\0" + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\35\13\0\0\0\4\0\0" "abacus.protobuf.Float32Metric" "description" "unit" @@ -2618,34 +4116,49 @@ ::uint8_t* Float32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kCounter: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::counter(this), + _Internal::counter(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float32Metric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional float min = 4; + // optional float min = 6; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 4, this->_internal_min(), target); + 6, this->_internal_min(), target); } - // optional float max = 5; + // optional float max = 7; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 5, this->_internal_max(), target); + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2671,31 +4184,51 @@ ::size_t Float32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 3; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } - - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - } + if (cached_has_bits & 0x00000007u) { + // optional string unit = 5; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } - if (cached_has_bits & 0x00000006u) { - // optional float min = 4; + // optional float min = 6; if (cached_has_bits & 0x00000002u) { total_size += 5; } - // optional float max = 5; + // optional float max = 7; if (cached_has_bits & 0x00000004u) { total_size += 5; } } + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Counter counter = 3; + case kCounter: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.counter_); + break; + } + // .abacus.protobuf.Constant constant = 4; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2717,14 +4250,11 @@ void Float32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_set_unit(from._internal_unit()); - } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); - } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000006u) { + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_unit(from._internal_unit()); + } if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -2733,6 +4263,26 @@ void Float32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl } _this->_impl_._has_bits_[0] |= cached_has_bits; } + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kCounter: { + _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( + from._internal_counter()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -2760,15 +4310,17 @@ void Float32Metric::InternalSwap(Float32Metric* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_) + sizeof(Float32Metric::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_)>( - reinterpret_cast(&_impl_.kind_), - reinterpret_cast(&other->_impl_.kind_)); + - PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)>( + reinterpret_cast(&_impl_.min_), + reinterpret_cast(&other->_impl_.min_)); + swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata Float32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[5]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[8]); } // =================================================================== @@ -2777,11 +4329,51 @@ class BoolMetric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const BoolMetric* msg); + static const ::abacus::protobuf::Constant& constant(const BoolMetric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } }; +const ::abacus::protobuf::Gauge& BoolMetric::_Internal::gauge(const BoolMetric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Constant& BoolMetric::_Internal::constant(const BoolMetric* msg) { + return *msg->_impl_.kind_.constant_; +} +void BoolMetric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.gauge) +} +void BoolMetric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.constant) +} BoolMetric::BoolMetric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -2796,6 +4388,7 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -2813,7 +4406,22 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - _this->_impl_.kind_ = from._impl_.kind_; + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.BoolMetric) } @@ -2824,7 +4432,8 @@ inline void BoolMetric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){0}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -2834,6 +4443,7 @@ inline void BoolMetric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); } BoolMetric::~BoolMetric() { // @@protoc_insertion_point(destructor:abacus.protobuf.BoolMetric) @@ -2844,11 +4454,37 @@ inline void BoolMetric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } } void BoolMetric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } +void BoolMetric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.BoolMetric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + PROTOBUF_NOINLINE void BoolMetric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.BoolMetric) ::uint32_t cached_has_bits = 0; @@ -2860,7 +4496,7 @@ PROTOBUF_NOINLINE void BoolMetric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.kind_ = 0; + clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -2873,46 +4509,46 @@ const char* BoolMetric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 3, 0, 50, 2> BoolMetric::_table_ = { +const ::_pbi::TcParseTable<1, 4, 2, 50, 2> BoolMetric::_table_ = { { PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_), 0, // no _extensions_ - 3, 24, // max_field_number, fast_idx_mask + 4, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap + 4294967280, // skipmap offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 4, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_BoolMetric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 4; + {::_pbi::TcParser::FastUS1, + {34, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(BoolMetric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_)}}, - // optional string unit = 3; - {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 3; + {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, - // no aux_entries - {{ - "\32\13\0\4\0\0\0\0" + }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\32\13\0\0\4\0\0\0" "abacus.protobuf.BoolMetric" "description" "unit" @@ -2934,20 +4570,29 @@ ::uint8_t* BoolMetric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.BoolMetric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2973,19 +4618,32 @@ ::size_t BoolMetric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 3; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Constant constant = 3; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3010,8 +4668,20 @@ void BoolMetric::MergeImpl(::google::protobuf::Message& to_msg, const ::google:: if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -3038,12 +4708,13 @@ void BoolMetric::InternalSwap(BoolMetric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata BoolMetric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[6]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[9]); } // =================================================================== @@ -3290,7 +4961,7 @@ void Enum8Metric_EnumValue::InternalSwap(Enum8Metric_EnumValue* other) { ::google::protobuf::Metadata Enum8Metric_EnumValue::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[10]); } // =================================================================== @@ -3303,7 +4974,7 @@ void Enum8Metric_ValuesEntry_DoNotUse::MergeFrom(const Enum8Metric_ValuesEntry_D ::google::protobuf::Metadata Enum8Metric_ValuesEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[8]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[11]); } // =================================================================== @@ -3312,11 +4983,51 @@ class Enum8Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Gauge& gauge(const Enum8Metric* msg); + static const ::abacus::protobuf::Constant& constant(const Enum8Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } }; +const ::abacus::protobuf::Gauge& Enum8Metric::_Internal::gauge(const Enum8Metric* msg) { + return *msg->_impl_.kind_.gauge_; +} +const ::abacus::protobuf::Constant& Enum8Metric::_Internal::constant(const Enum8Metric* msg) { + return *msg->_impl_.kind_.constant_; +} +void Enum8Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (gauge) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(gauge); + if (message_arena != submessage_arena) { + gauge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gauge, submessage_arena); + } + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.gauge) +} +void Enum8Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.constant) +} Enum8Metric::Enum8Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -3332,6 +5043,7 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -3350,7 +5062,22 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - _this->_impl_.kind_ = from._impl_.kind_; + clear_has_kind(); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Enum8Metric) } @@ -3362,7 +5089,8 @@ inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { /* decltype(_impl_.values_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, - decltype(_impl_.kind_){0}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -3372,6 +5100,7 @@ inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); } Enum8Metric::~Enum8Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Enum8Metric) @@ -3383,11 +5112,37 @@ inline void Enum8Metric::SharedDtor() { _impl_.values_.~MapField(); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); + if (has_kind()) { + clear_kind(); + } } void Enum8Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } +void Enum8Metric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Enum8Metric) + switch (kind_case()) { + case kGauge: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + break; + } + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + PROTOBUF_NOINLINE void Enum8Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Enum8Metric) ::uint32_t cached_has_bits = 0; @@ -3400,7 +5155,7 @@ PROTOBUF_NOINLINE void Enum8Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.kind_ = 0; + clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3413,50 +5168,51 @@ const char* Enum8Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 2, 51, 2> Enum8Metric::_table_ = { +const ::_pbi::TcParseTable<1, 5, 4, 51, 2> Enum8Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 5, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 2, // num_aux_entries + 5, // num_field_entries + 4, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Enum8Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 4; + {::_pbi::TcParser::FastUS1, + {34, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_)}}, // string description = 1; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_)}}, - // .abacus.protobuf.Kind kind = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Enum8Metric, _impl_.kind_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_)}}, - // optional string unit = 3; - {::_pbi::TcParser::FastUS1, - {26, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_)}}, }}, {{ 65535, 65535 }}, {{ // string description = 1; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Kind kind = 2; - {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 3; + // .abacus.protobuf.Gauge gauge = 2; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.Constant constant = 3; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 1, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // map values = 4; - {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 0, + // map values = 5; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 2, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Enum8Metric_EnumValue>}, }}, {{ - "\33\13\0\4\0\0\0\0" + "\33\13\0\0\4\0\0\0" "abacus.protobuf.Enum8Metric" "description" "unit" @@ -3478,23 +5234,32 @@ ::uint8_t* Enum8Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_kind(), target); + switch (kind_case()) { + case kGauge: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::gauge(this), + _Internal::gauge(this).GetCachedSize(), target, stream); + break; + } + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } + default: + break; } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 3; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.unit"); - target = stream->WriteStringMaybeAliased(3, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } - // map values = 4; + // map values = 5; if (!_internal_values().empty()) { using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>; using WireHelper = Enum8Metric_ValuesEntry_DoNotUse::Funcs; @@ -3503,12 +5268,12 @@ ::uint8_t* Enum8Metric::_InternalSerialize( if (stream->IsSerializationDeterministic() && field.size() > 1) { for (const auto& entry : ::google::protobuf::internal::MapSorterFlat(field)) { target = WireHelper::InternalSerialize( - 4, entry.first, entry.second, target, stream); + 5, entry.first, entry.second, target, stream); } } else { for (const auto& entry : field) { target = WireHelper::InternalSerialize( - 4, entry.first, entry.second, target, stream); + 5, entry.first, entry.second, target, stream); } } } @@ -3530,7 +5295,7 @@ ::size_t Enum8Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // map values = 4; + // map values = 5; total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_values_size()); for (const auto& entry : _internal_values()) { total_size += Enum8Metric_ValuesEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); @@ -3541,19 +5306,32 @@ ::size_t Enum8Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 3; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // .abacus.protobuf.Kind kind = 2; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + switch (kind_case()) { + // .abacus.protobuf.Gauge gauge = 2; + case kGauge: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.gauge_); + break; + } + // .abacus.protobuf.Constant constant = 3; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3579,8 +5357,20 @@ void Enum8Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); + switch (from.kind_case()) { + case kGauge: { + _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( + from._internal_gauge()); + break; + } + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -3608,12 +5398,13 @@ void Enum8Metric::InternalSwap(Enum8Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata Enum8Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[9]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); } // =================================================================== @@ -3785,16 +5576,13 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { (void)_this; new (&_impl_) Impl_{ decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - ::memcpy(&_impl_.offset_, &from._impl_.offset_, - static_cast<::size_t>(reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + _this->_impl_.offset_ = from._impl_.offset_; clear_has_type(); switch (from.type_case()) { case kUint64: { @@ -3848,7 +5636,6 @@ inline void Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -3935,9 +5722,7 @@ PROTOBUF_NOINLINE void Metric::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.offset_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + _impl_.offset_ = 0u; clear_type(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3950,23 +5735,20 @@ const char* Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 10, 8, 0, 2> Metric::_table_ = { +const ::_pbi::TcParseTable<0, 9, 8, 0, 2> Metric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 10, 8, // max_field_number, fast_idx_mask + 10, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294966272, // skipmap + 4294966274, // skipmap offsetof(decltype(_table_), field_entries), - 10, // num_field_entries + 9, // num_field_entries 8, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // bool optional = 2; - {::_pbi::TcParser::SingularVarintNoZag1(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.optional_)}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_)}}, @@ -3976,9 +5758,6 @@ const ::_pbi::TcParseTable<1, 10, 8, 0, 2> Metric::_table_ = { // uint32 offset = 1; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // bool optional = 2; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.optional_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, // .abacus.protobuf.UInt64Metric uint64 = 3; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, @@ -4030,13 +5809,6 @@ ::uint8_t* Metric::_InternalSerialize( 1, this->_internal_offset(), target); } - // bool optional = 2; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 2, this->_internal_optional(), target); - } - switch (type_case()) { case kUint64: { target = ::google::protobuf::internal::WireFormatLite:: @@ -4112,11 +5884,6 @@ ::size_t Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 2; - if (this->_internal_optional() != 0) { - total_size += 2; - } - switch (type_case()) { // .abacus.protobuf.UInt64Metric uint64 = 3; case kUint64: { @@ -4199,9 +5966,6 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } switch (from.type_case()) { case kUint64: { _this->_internal_mutable_uint64()->::abacus::protobuf::UInt64Metric::MergeFrom( @@ -4264,12 +6028,7 @@ PROTOBUF_NOINLINE bool Metric::IsInitialized() const { void Metric::InternalSwap(Metric* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Metric, _impl_.optional_) - + sizeof(Metric::_impl_.optional_) - - PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_)>( - reinterpret_cast(&_impl_.offset_), - reinterpret_cast(&other->_impl_.offset_)); + swap(_impl_.offset_, other->_impl_.offset_); swap(_impl_.type_, other->_impl_.type_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -4277,7 +6036,7 @@ void Metric::InternalSwap(Metric* other) { ::google::protobuf::Metadata Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[10]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); } // =================================================================== @@ -4290,7 +6049,7 @@ void MetricsMetadata_MetricsEntry_DoNotUse::MergeFrom(const MetricsMetadata_Metr ::google::protobuf::Metadata MetricsMetadata_MetricsEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[11]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]); } // =================================================================== @@ -4564,7 +6323,7 @@ void MetricsMetadata::InternalSwap(MetricsMetadata* other) { ::google::protobuf::Metadata MetricsMetadata::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[15]); } // @@protoc_insertion_point(namespace_scope) } // namespace protobuf diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 24aecc91..9f84242d 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -24,6 +24,7 @@ #include "google/protobuf/io/coded_stream.h" #include "google/protobuf/arena.h" #include "google/protobuf/arenastring.h" +#include "google/protobuf/generated_message_bases.h" #include "google/protobuf/generated_message_tctable_decl.h" #include "google/protobuf/generated_message_util.h" #include "google/protobuf/metadata_lite.h" @@ -36,7 +37,6 @@ #include "google/protobuf/map_field_inl.h" #include "google/protobuf/generated_enum_reflection.h" #include "google/protobuf/unknown_field_set.h" -#include "abacus/protobuf/kind.pb.h" // @@protoc_insertion_point(includes) // Must be included last. @@ -63,6 +63,12 @@ namespace protobuf { class BoolMetric; struct BoolMetricDefaultTypeInternal; extern BoolMetricDefaultTypeInternal _BoolMetric_default_instance_; +class Constant; +struct ConstantDefaultTypeInternal; +extern ConstantDefaultTypeInternal _Constant_default_instance_; +class Counter; +struct CounterDefaultTypeInternal; +extern CounterDefaultTypeInternal _Counter_default_instance_; class Enum8Metric; struct Enum8MetricDefaultTypeInternal; extern Enum8MetricDefaultTypeInternal _Enum8Metric_default_instance_; @@ -78,6 +84,9 @@ extern Float32MetricDefaultTypeInternal _Float32Metric_default_instance_; class Float64Metric; struct Float64MetricDefaultTypeInternal; extern Float64MetricDefaultTypeInternal _Float64Metric_default_instance_; +class Gauge; +struct GaugeDefaultTypeInternal; +extern GaugeDefaultTypeInternal _Gauge_default_instance_; class Int32Metric; struct Int32MetricDefaultTypeInternal; extern Int32MetricDefaultTypeInternal _Int32Metric_default_instance_; @@ -146,6 +155,447 @@ inline bool Endianness_Parse(absl::string_view name, Endianness* value) { // ------------------------------------------------------------------- +class Gauge final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Gauge) */ { + public: + inline Gauge() : Gauge(nullptr) {} + ~Gauge() override; + template + explicit PROTOBUF_CONSTEXPR Gauge(::google::protobuf::internal::ConstantInitialized); + + Gauge(const Gauge& from); + Gauge(Gauge&& from) noexcept + : Gauge() { + *this = ::std::move(from); + } + + inline Gauge& operator=(const Gauge& from) { + CopyFrom(from); + return *this; + } + inline Gauge& operator=(Gauge&& 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 Gauge& default_instance() { + return *internal_default_instance(); + } + static inline const Gauge* internal_default_instance() { + return reinterpret_cast( + &_Gauge_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Gauge& a, Gauge& b) { + a.Swap(&b); + } + inline void Swap(Gauge* 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(Gauge* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Gauge* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Gauge& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Gauge& from) { + Gauge::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(Gauge* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.Gauge"; + } + protected: + explicit Gauge(::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 { + kOptionalFieldNumber = 1, + }; + // bool optional = 1; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); + + private: + bool _internal_optional() const; + void _internal_set_optional(bool value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.Gauge) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, 0, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool optional_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class Counter final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Counter) */ { + public: + inline Counter() : Counter(nullptr) {} + ~Counter() override; + template + explicit PROTOBUF_CONSTEXPR Counter(::google::protobuf::internal::ConstantInitialized); + + Counter(const Counter& from); + Counter(Counter&& from) noexcept + : Counter() { + *this = ::std::move(from); + } + + inline Counter& operator=(const Counter& from) { + CopyFrom(from); + return *this; + } + inline Counter& operator=(Counter&& 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 Counter& default_instance() { + return *internal_default_instance(); + } + static inline const Counter* internal_default_instance() { + return reinterpret_cast( + &_Counter_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(Counter& a, Counter& b) { + a.Swap(&b); + } + inline void Swap(Counter* 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(Counter* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Counter* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Counter& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const Counter& from) { + Counter::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(Counter* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.Counter"; + } + protected: + explicit Counter(::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 { + kOptionalFieldNumber = 1, + }; + // bool optional = 1; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); + + private: + bool _internal_optional() const; + void _internal_set_optional(bool value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.Counter) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, 0, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool optional_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + +class Constant final : + public ::google::protobuf::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:abacus.protobuf.Constant) */ { + public: + inline Constant() : Constant(nullptr) {} + template + explicit PROTOBUF_CONSTEXPR Constant(::google::protobuf::internal::ConstantInitialized); + + Constant(const Constant& from); + Constant(Constant&& from) noexcept + : Constant() { + *this = ::std::move(from); + } + + inline Constant& operator=(const Constant& from) { + CopyFrom(from); + return *this; + } + inline Constant& operator=(Constant&& 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 Constant& default_instance() { + return *internal_default_instance(); + } + static inline const Constant* internal_default_instance() { + return reinterpret_cast( + &_Constant_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(Constant& a, Constant& b) { + a.Swap(&b); + } + inline void Swap(Constant* 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(Constant* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Constant* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const Constant& from) { + ::google::protobuf::internal::ZeroFieldsBase::CopyImpl(*this, from); + } + using ::google::protobuf::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const Constant& from) { + ::google::protobuf::internal::ZeroFieldsBase::MergeImpl(*this, from); + } + public: + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.Constant"; + } + protected: + explicit Constant(::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 ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:abacus.protobuf.Constant) + private: + class _Internal; + + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + PROTOBUF_TSAN_DECLARE_MEMBER + }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + class UInt64Metric final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt64Metric) */ { public: @@ -197,12 +647,19 @@ class UInt64Metric final : static const UInt64Metric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kCounter = 3, + kConstant = 4, + KIND_NOT_SET = 0, + }; + static inline const UInt64Metric* internal_default_instance() { return reinterpret_cast( &_UInt64Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 3; friend void swap(UInt64Metric& a, UInt64Metric& b) { a.Swap(&b); @@ -275,10 +732,12 @@ class UInt64Metric final : enum : int { kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kMinFieldNumber = 4, - kMaxFieldNumber = 5, - kKindFieldNumber = 2, + kUnitFieldNumber = 5, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kGaugeFieldNumber = 2, + kCounterFieldNumber = 3, + kConstantFieldNumber = 4, }; // string description = 1; void clear_description() ; @@ -296,7 +755,7 @@ class UInt64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -313,7 +772,7 @@ class UInt64Metric final : std::string* _internal_mutable_unit(); public: - // optional uint64 min = 4; + // optional uint64 min = 6; bool has_min() const; void clear_min() ; ::uint64_t min() const; @@ -324,7 +783,7 @@ class UInt64Metric final : void _internal_set_min(::uint64_t value); public: - // optional uint64 max = 5; + // optional uint64 max = 7; bool has_max() const; void clear_max() ; ::uint64_t max() const; @@ -335,22 +794,77 @@ class UInt64Metric final : void _internal_set_max(::uint64_t value); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + + private: + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + + public: + // .abacus.protobuf.Counter counter = 3; + bool has_counter() const; + private: + bool _internal_has_counter() const; + + public: + void clear_counter() ; + const ::abacus::protobuf::Counter& counter() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); + ::abacus::protobuf::Counter* mutable_counter(); + void set_allocated_counter(::abacus::protobuf::Counter* value); + void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); + ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + + private: + const ::abacus::protobuf::Counter& _internal_counter() const; + ::abacus::protobuf::Counter* _internal_mutable_counter(); + + public: + // .abacus.protobuf.Constant constant = 4; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt64Metric) private: class _Internal; + void set_has_gauge(); + void set_has_counter(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 52, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 52, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -361,7 +875,15 @@ class UInt64Metric final : ::google::protobuf::internal::ArenaStringPtr unit_; ::uint64_t min_; ::uint64_t max_; - int kind_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Counter* counter_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -419,12 +941,19 @@ class Int64Metric final : static const Int64Metric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kCounter = 3, + kConstant = 4, + KIND_NOT_SET = 0, + }; + static inline const Int64Metric* internal_default_instance() { return reinterpret_cast( &_Int64Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 4; friend void swap(Int64Metric& a, Int64Metric& b) { a.Swap(&b); @@ -497,10 +1026,12 @@ class Int64Metric final : enum : int { kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kMinFieldNumber = 4, - kMaxFieldNumber = 5, - kKindFieldNumber = 2, + kUnitFieldNumber = 5, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kGaugeFieldNumber = 2, + kCounterFieldNumber = 3, + kConstantFieldNumber = 4, }; // string description = 1; void clear_description() ; @@ -518,7 +1049,7 @@ class Int64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -535,7 +1066,7 @@ class Int64Metric final : std::string* _internal_mutable_unit(); public: - // optional int64 min = 4; + // optional int64 min = 6; bool has_min() const; void clear_min() ; ::int64_t min() const; @@ -546,7 +1077,7 @@ class Int64Metric final : void _internal_set_min(::int64_t value); public: - // optional int64 max = 5; + // optional int64 max = 7; bool has_max() const; void clear_max() ; ::int64_t max() const; @@ -557,22 +1088,77 @@ class Int64Metric final : void _internal_set_max(::int64_t value); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + + private: + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + + public: + // .abacus.protobuf.Counter counter = 3; + bool has_counter() const; + private: + bool _internal_has_counter() const; + + public: + void clear_counter() ; + const ::abacus::protobuf::Counter& counter() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); + ::abacus::protobuf::Counter* mutable_counter(); + void set_allocated_counter(::abacus::protobuf::Counter* value); + void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); + ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + + private: + const ::abacus::protobuf::Counter& _internal_counter() const; + ::abacus::protobuf::Counter* _internal_mutable_counter(); + + public: + // .abacus.protobuf.Constant constant = 4; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.Int64Metric) private: class _Internal; + void set_has_gauge(); + void set_has_counter(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -583,7 +1169,15 @@ class Int64Metric final : ::google::protobuf::internal::ArenaStringPtr unit_; ::int64_t min_; ::int64_t max_; - int kind_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Counter* counter_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -641,12 +1235,19 @@ class UInt32Metric final : static const UInt32Metric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kCounter = 3, + kConstant = 4, + KIND_NOT_SET = 0, + }; + static inline const UInt32Metric* internal_default_instance() { return reinterpret_cast( &_UInt32Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 2; + 5; friend void swap(UInt32Metric& a, UInt32Metric& b) { a.Swap(&b); @@ -719,10 +1320,12 @@ class UInt32Metric final : enum : int { kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kKindFieldNumber = 2, - kMinFieldNumber = 4, - kMaxFieldNumber = 5, + kUnitFieldNumber = 5, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kGaugeFieldNumber = 2, + kCounterFieldNumber = 3, + kConstantFieldNumber = 4, }; // string description = 1; void clear_description() ; @@ -740,7 +1343,7 @@ class UInt32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -757,17 +1360,7 @@ class UInt32Metric final : std::string* _internal_mutable_unit(); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); - - private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); - - public: - // optional uint32 min = 4; + // optional uint32 min = 6; bool has_min() const; void clear_min() ; ::uint32_t min() const; @@ -778,7 +1371,7 @@ class UInt32Metric final : void _internal_set_min(::uint32_t value); public: - // optional uint32 max = 5; + // optional uint32 max = 7; bool has_max() const; void clear_max() ; ::uint32_t max() const; @@ -789,12 +1382,77 @@ class UInt32Metric final : void _internal_set_max(::uint32_t value); public: + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + + private: + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + + public: + // .abacus.protobuf.Counter counter = 3; + bool has_counter() const; + private: + bool _internal_has_counter() const; + + public: + void clear_counter() ; + const ::abacus::protobuf::Counter& counter() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); + ::abacus::protobuf::Counter* mutable_counter(); + void set_allocated_counter(::abacus::protobuf::Counter* value); + void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); + ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + + private: + const ::abacus::protobuf::Counter& _internal_counter() const; + ::abacus::protobuf::Counter* _internal_mutable_counter(); + + public: + // .abacus.protobuf.Constant constant = 4; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + + private: + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); + + public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt32Metric) private: class _Internal; + void set_has_gauge(); + void set_has_counter(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 52, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 52, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -803,9 +1461,17 @@ class UInt32Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - int kind_; ::uint32_t min_; ::uint32_t max_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Counter* counter_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -863,12 +1529,19 @@ class Int32Metric final : static const Int32Metric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kCounter = 3, + kConstant = 4, + KIND_NOT_SET = 0, + }; + static inline const Int32Metric* internal_default_instance() { return reinterpret_cast( &_Int32Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 6; friend void swap(Int32Metric& a, Int32Metric& b) { a.Swap(&b); @@ -941,10 +1614,12 @@ class Int32Metric final : enum : int { kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kKindFieldNumber = 2, - kMinFieldNumber = 4, - kMaxFieldNumber = 5, + kUnitFieldNumber = 5, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kGaugeFieldNumber = 2, + kCounterFieldNumber = 3, + kConstantFieldNumber = 4, }; // string description = 1; void clear_description() ; @@ -962,7 +1637,7 @@ class Int32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -979,17 +1654,7 @@ class Int32Metric final : std::string* _internal_mutable_unit(); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); - - private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); - - public: - // optional int32 min = 4; + // optional int32 min = 6; bool has_min() const; void clear_min() ; ::int32_t min() const; @@ -1000,7 +1665,7 @@ class Int32Metric final : void _internal_set_min(::int32_t value); public: - // optional int32 max = 5; + // optional int32 max = 7; bool has_max() const; void clear_max() ; ::int32_t max() const; @@ -1011,12 +1676,77 @@ class Int32Metric final : void _internal_set_max(::int32_t value); public: + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + + private: + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + + public: + // .abacus.protobuf.Counter counter = 3; + bool has_counter() const; + private: + bool _internal_has_counter() const; + + public: + void clear_counter() ; + const ::abacus::protobuf::Counter& counter() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); + ::abacus::protobuf::Counter* mutable_counter(); + void set_allocated_counter(::abacus::protobuf::Counter* value); + void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); + ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + + private: + const ::abacus::protobuf::Counter& _internal_counter() const; + ::abacus::protobuf::Counter* _internal_mutable_counter(); + + public: + // .abacus.protobuf.Constant constant = 4; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + + private: + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); + + public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.Int32Metric) private: class _Internal; + void set_has_gauge(); + void set_has_counter(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1025,9 +1755,17 @@ class Int32Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - int kind_; ::int32_t min_; ::int32_t max_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Counter* counter_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -1085,12 +1823,19 @@ class Float64Metric final : static const Float64Metric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kCounter = 3, + kConstant = 4, + KIND_NOT_SET = 0, + }; + static inline const Float64Metric* internal_default_instance() { return reinterpret_cast( &_Float64Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 7; friend void swap(Float64Metric& a, Float64Metric& b) { a.Swap(&b); @@ -1163,10 +1908,12 @@ class Float64Metric final : enum : int { kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kMinFieldNumber = 4, - kMaxFieldNumber = 5, - kKindFieldNumber = 2, + kUnitFieldNumber = 5, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kGaugeFieldNumber = 2, + kCounterFieldNumber = 3, + kConstantFieldNumber = 4, }; // string description = 1; void clear_description() ; @@ -1184,7 +1931,7 @@ class Float64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1201,7 +1948,7 @@ class Float64Metric final : std::string* _internal_mutable_unit(); public: - // optional double min = 4; + // optional double min = 6; bool has_min() const; void clear_min() ; double min() const; @@ -1212,7 +1959,7 @@ class Float64Metric final : void _internal_set_min(double value); public: - // optional double max = 5; + // optional double max = 7; bool has_max() const; void clear_max() ; double max() const; @@ -1223,22 +1970,77 @@ class Float64Metric final : void _internal_set_max(double value); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + + private: + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + + public: + // .abacus.protobuf.Counter counter = 3; + bool has_counter() const; + private: + bool _internal_has_counter() const; + + public: + void clear_counter() ; + const ::abacus::protobuf::Counter& counter() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); + ::abacus::protobuf::Counter* mutable_counter(); + void set_allocated_counter(::abacus::protobuf::Counter* value); + void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); + ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + + private: + const ::abacus::protobuf::Counter& _internal_counter() const; + ::abacus::protobuf::Counter* _internal_mutable_counter(); + + public: + // .abacus.protobuf.Constant constant = 4; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.Float64Metric) private: class _Internal; + void set_has_gauge(); + void set_has_counter(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 53, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 53, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1249,7 +2051,15 @@ class Float64Metric final : ::google::protobuf::internal::ArenaStringPtr unit_; double min_; double max_; - int kind_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Counter* counter_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -1307,12 +2117,19 @@ class Float32Metric final : static const Float32Metric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kCounter = 3, + kConstant = 4, + KIND_NOT_SET = 0, + }; + static inline const Float32Metric* internal_default_instance() { return reinterpret_cast( &_Float32Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 8; friend void swap(Float32Metric& a, Float32Metric& b) { a.Swap(&b); @@ -1385,10 +2202,12 @@ class Float32Metric final : enum : int { kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kKindFieldNumber = 2, - kMinFieldNumber = 4, - kMaxFieldNumber = 5, + kUnitFieldNumber = 5, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kGaugeFieldNumber = 2, + kCounterFieldNumber = 3, + kConstantFieldNumber = 4, }; // string description = 1; void clear_description() ; @@ -1406,7 +2225,7 @@ class Float32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1423,17 +2242,7 @@ class Float32Metric final : std::string* _internal_mutable_unit(); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); - - private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); - - public: - // optional float min = 4; + // optional float min = 6; bool has_min() const; void clear_min() ; float min() const; @@ -1444,23 +2253,88 @@ class Float32Metric final : void _internal_set_min(float value); public: - // optional float max = 5; + // optional float max = 7; bool has_max() const; void clear_max() ; float max() const; void set_max(float value); private: - float _internal_max() const; - void _internal_set_max(float value); + float _internal_max() const; + void _internal_set_max(float value); + + public: + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + + private: + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + + public: + // .abacus.protobuf.Counter counter = 3; + bool has_counter() const; + private: + bool _internal_has_counter() const; + + public: + void clear_counter() ; + const ::abacus::protobuf::Counter& counter() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); + ::abacus::protobuf::Counter* mutable_counter(); + void set_allocated_counter(::abacus::protobuf::Counter* value); + void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); + ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + + private: + const ::abacus::protobuf::Counter& _internal_counter() const; + ::abacus::protobuf::Counter* _internal_mutable_counter(); + + public: + // .abacus.protobuf.Constant constant = 4; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + + private: + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.Float32Metric) private: class _Internal; + void set_has_gauge(); + void set_has_counter(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 53, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 53, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1469,9 +2343,17 @@ class Float32Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - int kind_; float min_; float max_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Counter* counter_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -1529,12 +2411,18 @@ class BoolMetric final : static const BoolMetric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kConstant = 3, + KIND_NOT_SET = 0, + }; + static inline const BoolMetric* internal_default_instance() { return reinterpret_cast( &_BoolMetric_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 9; friend void swap(BoolMetric& a, BoolMetric& b) { a.Swap(&b); @@ -1607,8 +2495,9 @@ class BoolMetric final : enum : int { kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kKindFieldNumber = 2, + kUnitFieldNumber = 4, + kGaugeFieldNumber = 2, + kConstantFieldNumber = 3, }; // string description = 1; void clear_description() ; @@ -1626,7 +2515,7 @@ class BoolMetric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1643,22 +2532,57 @@ class BoolMetric final : std::string* _internal_mutable_unit(); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: + // .abacus.protobuf.Constant constant = 3; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + + private: + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); + + public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.BoolMetric) private: class _Internal; + void set_has_gauge(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 3, 0, 50, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 4, 2, 50, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1667,7 +2591,14 @@ class BoolMetric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - int kind_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -1730,7 +2661,7 @@ class Enum8Metric_EnumValue final : &_Enum8Metric_EnumValue_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 10; friend void swap(Enum8Metric_EnumValue& a, Enum8Metric_EnumValue& b) { a.Swap(&b); @@ -1933,12 +2864,18 @@ class Enum8Metric final : static const Enum8Metric& default_instance() { return *internal_default_instance(); } + enum KindCase { + kGauge = 2, + kConstant = 3, + KIND_NOT_SET = 0, + }; + static inline const Enum8Metric* internal_default_instance() { return reinterpret_cast( &_Enum8Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 12; friend void swap(Enum8Metric& a, Enum8Metric& b) { a.Swap(&b); @@ -2012,12 +2949,13 @@ class Enum8Metric final : // accessors ------------------------------------------------------- enum : int { - kValuesFieldNumber = 4, + kValuesFieldNumber = 5, kDescriptionFieldNumber = 1, - kUnitFieldNumber = 3, - kKindFieldNumber = 2, + kUnitFieldNumber = 4, + kGaugeFieldNumber = 2, + kConstantFieldNumber = 3, }; - // map values = 4; + // map values = 5; int values_size() const; private: int _internal_values_size() const; @@ -2048,7 +2986,7 @@ class Enum8Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 3; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -2065,22 +3003,57 @@ class Enum8Metric final : std::string* _internal_mutable_unit(); public: - // .abacus.protobuf.Kind kind = 2; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); + // .abacus.protobuf.Gauge gauge = 2; + bool has_gauge() const; + private: + bool _internal_has_gauge() const; + + public: + void clear_gauge() ; + const ::abacus::protobuf::Gauge& gauge() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); + ::abacus::protobuf::Gauge* mutable_gauge(); + void set_allocated_gauge(::abacus::protobuf::Gauge* value); + void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); + ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + + private: + const ::abacus::protobuf::Gauge& _internal_gauge() const; + ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + + public: + // .abacus.protobuf.Constant constant = 3; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); public: + void clear_kind(); + KindCase kind_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric) private: class _Internal; + void set_has_gauge(); + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 2, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 5, 4, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2093,7 +3066,14 @@ class Enum8Metric final : values_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - int kind_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Gauge* gauge_; + ::abacus::protobuf::Constant* constant_; + } kind_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -2168,7 +3148,7 @@ class Metric final : &_Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 13; friend void swap(Metric& a, Metric& b) { a.Swap(&b); @@ -2241,7 +3221,6 @@ class Metric final : enum : int { kOffsetFieldNumber = 1, - kOptionalFieldNumber = 2, kUint64FieldNumber = 3, kInt64FieldNumber = 4, kUint32FieldNumber = 5, @@ -2260,16 +3239,6 @@ class Metric final : ::uint32_t _internal_offset() const; void _internal_set_offset(::uint32_t value); - public: - // bool optional = 2; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); - - private: - bool _internal_optional() const; - void _internal_set_optional(bool value); - public: // .abacus.protobuf.UInt64Metric uint64 = 3; bool has_uint64() const; @@ -2441,13 +3410,12 @@ class Metric final : inline void clear_has_type(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 10, 8, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<0, 9, 8, 0, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::uint32_t offset_; - bool optional_; union TypeUnion { constexpr TypeUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -2551,7 +3519,7 @@ class MetricsMetadata final : &_MetricsMetadata_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 15; friend void swap(MetricsMetadata& a, MetricsMetadata& b) { a.Swap(&b); @@ -2712,6 +3680,62 @@ class MetricsMetadata final : #endif // __GNUC__ // ------------------------------------------------------------------- +// Gauge + +// bool optional = 1; +inline void Gauge::clear_optional() { + _impl_.optional_ = false; +} +inline bool Gauge::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Gauge.optional) + return _internal_optional(); +} +inline void Gauge::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Gauge.optional) +} +inline bool Gauge::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; +} +inline void Gauge::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; +} + +// ------------------------------------------------------------------- + +// Counter + +// bool optional = 1; +inline void Counter::clear_optional() { + _impl_.optional_ = false; +} +inline bool Counter::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Counter.optional) + return _internal_optional(); +} +inline void Counter::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Counter.optional) +} +inline bool Counter::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; +} +inline void Counter::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; +} + +// ------------------------------------------------------------------- + +// Constant + +// ------------------------------------------------------------------- + // UInt64Metric // string description = 1; @@ -2765,29 +3789,229 @@ inline void UInt64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.description) } -// .abacus.protobuf.Kind kind = 2; -inline void UInt64Metric::clear_kind() { - _impl_.kind_ = 0; +// .abacus.protobuf.Gauge gauge = 2; +inline bool UInt64Metric::has_gauge() const { + return kind_case() == kGauge; } -inline ::abacus::protobuf::Kind UInt64Metric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.kind) - return _internal_kind(); +inline bool UInt64Metric::_internal_has_gauge() const { + return kind_case() == kGauge; } -inline void UInt64Metric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.kind) +inline void UInt64Metric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; } -inline ::abacus::protobuf::Kind UInt64Metric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void UInt64Metric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } } -inline void UInt64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Gauge* UInt64Metric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& UInt64Metric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& UInt64Metric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* UInt64Metric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt64Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void UInt64Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt64Metric.gauge) +} +inline ::abacus::protobuf::Gauge* UInt64Metric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* UInt64Metric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.gauge) + return _msg; +} + +// .abacus.protobuf.Counter counter = 3; +inline bool UInt64Metric::has_counter() const { + return kind_case() == kCounter; +} +inline bool UInt64Metric::_internal_has_counter() const { + return kind_case() == kCounter; +} +inline void UInt64Metric::set_has_counter() { + _impl_._oneof_case_[0] = kCounter; +} +inline void UInt64Metric::clear_counter() { + if (kind_case() == kCounter) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Counter* UInt64Metric::release_counter() { + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Counter& UInt64Metric::_internal_counter() const { + return kind_case() == kCounter + ? *_impl_.kind_.counter_ + : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +} +inline const ::abacus::protobuf::Counter& UInt64Metric::counter() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.counter) + return _internal_counter(); +} +inline ::abacus::protobuf::Counter* UInt64Metric::unsafe_arena_release_counter() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt64Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void UInt64Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { + clear_kind(); + if (counter) { + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt64Metric.counter) +} +inline ::abacus::protobuf::Counter* UInt64Metric::_internal_mutable_counter() { + if (kind_case() != kCounter) { + clear_kind(); + set_has_counter(); + _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); + } + return _impl_.kind_.counter_; +} +inline ::abacus::protobuf::Counter* UInt64Metric::mutable_counter() { + ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.counter) + return _msg; +} + +// .abacus.protobuf.Constant constant = 4; +inline bool UInt64Metric::has_constant() const { + return kind_case() == kConstant; +} +inline bool UInt64Metric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void UInt64Metric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void UInt64Metric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* UInt64Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& UInt64Metric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& UInt64Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* UInt64Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt64Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void UInt64Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt64Metric.constant) +} +inline ::abacus::protobuf::Constant* UInt64Metric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* UInt64Metric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 5; inline bool UInt64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -2856,7 +4080,7 @@ inline void UInt64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.unit) } -// optional uint64 min = 4; +// optional uint64 min = 6; inline bool UInt64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -2883,7 +4107,7 @@ inline void UInt64Metric::_internal_set_min(::uint64_t value) { _impl_.min_ = value; } -// optional uint64 max = 5; +// optional uint64 max = 7; inline bool UInt64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -2910,6 +4134,15 @@ inline void UInt64Metric::_internal_set_max(::uint64_t value) { _impl_.max_ = value; } +inline bool UInt64Metric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void UInt64Metric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline UInt64Metric::KindCase UInt64Metric::kind_case() const { + return UInt64Metric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // Int64Metric @@ -2964,30 +4197,230 @@ inline void Int64Metric::set_allocated_description(std::string* value) { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.description) } - -// .abacus.protobuf.Kind kind = 2; -inline void Int64Metric::clear_kind() { - _impl_.kind_ = 0; + +// .abacus.protobuf.Gauge gauge = 2; +inline bool Int64Metric::has_gauge() const { + return kind_case() == kGauge; +} +inline bool Int64Metric::_internal_has_gauge() const { + return kind_case() == kGauge; +} +inline void Int64Metric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; +} +inline void Int64Metric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Gauge* Int64Metric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& Int64Metric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& Int64Metric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* Int64Metric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int64Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Int64Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int64Metric.gauge) +} +inline ::abacus::protobuf::Gauge* Int64Metric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* Int64Metric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.gauge) + return _msg; +} + +// .abacus.protobuf.Counter counter = 3; +inline bool Int64Metric::has_counter() const { + return kind_case() == kCounter; +} +inline bool Int64Metric::_internal_has_counter() const { + return kind_case() == kCounter; +} +inline void Int64Metric::set_has_counter() { + _impl_._oneof_case_[0] = kCounter; +} +inline void Int64Metric::clear_counter() { + if (kind_case() == kCounter) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Counter* Int64Metric::release_counter() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Counter& Int64Metric::_internal_counter() const { + return kind_case() == kCounter + ? *_impl_.kind_.counter_ + : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +} +inline const ::abacus::protobuf::Counter& Int64Metric::counter() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.counter) + return _internal_counter(); +} +inline ::abacus::protobuf::Counter* Int64Metric::unsafe_arena_release_counter() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int64Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Int64Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { + clear_kind(); + if (counter) { + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int64Metric.counter) +} +inline ::abacus::protobuf::Counter* Int64Metric::_internal_mutable_counter() { + if (kind_case() != kCounter) { + clear_kind(); + set_has_counter(); + _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); + } + return _impl_.kind_.counter_; +} +inline ::abacus::protobuf::Counter* Int64Metric::mutable_counter() { + ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.counter) + return _msg; +} + +// .abacus.protobuf.Constant constant = 4; +inline bool Int64Metric::has_constant() const { + return kind_case() == kConstant; +} +inline bool Int64Metric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void Int64Metric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void Int64Metric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* Int64Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& Int64Metric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); } -inline ::abacus::protobuf::Kind Int64Metric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.kind) - return _internal_kind(); +inline const ::abacus::protobuf::Constant& Int64Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.constant) + return _internal_constant(); } -inline void Int64Metric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.kind) +inline ::abacus::protobuf::Constant* Int64Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int64Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } } -inline ::abacus::protobuf::Kind Int64Metric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void Int64Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int64Metric.constant) } -inline void Int64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Constant* Int64Metric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* Int64Metric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 5; inline bool Int64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3056,7 +4489,7 @@ inline void Int64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.unit) } -// optional int64 min = 4; +// optional int64 min = 6; inline bool Int64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3083,7 +4516,7 @@ inline void Int64Metric::_internal_set_min(::int64_t value) { _impl_.min_ = value; } -// optional int64 max = 5; +// optional int64 max = 7; inline bool Int64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -3110,6 +4543,15 @@ inline void Int64Metric::_internal_set_max(::int64_t value) { _impl_.max_ = value; } +inline bool Int64Metric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void Int64Metric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline Int64Metric::KindCase Int64Metric::kind_case() const { + return Int64Metric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // UInt32Metric @@ -3165,29 +4607,229 @@ inline void UInt32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.description) } -// .abacus.protobuf.Kind kind = 2; -inline void UInt32Metric::clear_kind() { - _impl_.kind_ = 0; +// .abacus.protobuf.Gauge gauge = 2; +inline bool UInt32Metric::has_gauge() const { + return kind_case() == kGauge; } -inline ::abacus::protobuf::Kind UInt32Metric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.kind) - return _internal_kind(); +inline bool UInt32Metric::_internal_has_gauge() const { + return kind_case() == kGauge; } -inline void UInt32Metric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.kind) +inline void UInt32Metric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; } -inline ::abacus::protobuf::Kind UInt32Metric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void UInt32Metric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } } -inline void UInt32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Gauge* UInt32Metric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& UInt32Metric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& UInt32Metric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* UInt32Metric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt32Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void UInt32Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt32Metric.gauge) +} +inline ::abacus::protobuf::Gauge* UInt32Metric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* UInt32Metric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.gauge) + return _msg; +} + +// .abacus.protobuf.Counter counter = 3; +inline bool UInt32Metric::has_counter() const { + return kind_case() == kCounter; +} +inline bool UInt32Metric::_internal_has_counter() const { + return kind_case() == kCounter; +} +inline void UInt32Metric::set_has_counter() { + _impl_._oneof_case_[0] = kCounter; +} +inline void UInt32Metric::clear_counter() { + if (kind_case() == kCounter) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Counter* UInt32Metric::release_counter() { + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Counter& UInt32Metric::_internal_counter() const { + return kind_case() == kCounter + ? *_impl_.kind_.counter_ + : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +} +inline const ::abacus::protobuf::Counter& UInt32Metric::counter() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.counter) + return _internal_counter(); +} +inline ::abacus::protobuf::Counter* UInt32Metric::unsafe_arena_release_counter() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt32Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void UInt32Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { + clear_kind(); + if (counter) { + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt32Metric.counter) +} +inline ::abacus::protobuf::Counter* UInt32Metric::_internal_mutable_counter() { + if (kind_case() != kCounter) { + clear_kind(); + set_has_counter(); + _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); + } + return _impl_.kind_.counter_; +} +inline ::abacus::protobuf::Counter* UInt32Metric::mutable_counter() { + ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.counter) + return _msg; +} + +// .abacus.protobuf.Constant constant = 4; +inline bool UInt32Metric::has_constant() const { + return kind_case() == kConstant; +} +inline bool UInt32Metric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void UInt32Metric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void UInt32Metric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* UInt32Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& UInt32Metric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& UInt32Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* UInt32Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt32Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void UInt32Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt32Metric.constant) +} +inline ::abacus::protobuf::Constant* UInt32Metric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* UInt32Metric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 5; inline bool UInt32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3256,7 +4898,7 @@ inline void UInt32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.unit) } -// optional uint32 min = 4; +// optional uint32 min = 6; inline bool UInt32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3283,7 +4925,7 @@ inline void UInt32Metric::_internal_set_min(::uint32_t value) { _impl_.min_ = value; } -// optional uint32 max = 5; +// optional uint32 max = 7; inline bool UInt32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -3310,6 +4952,15 @@ inline void UInt32Metric::_internal_set_max(::uint32_t value) { _impl_.max_ = value; } +inline bool UInt32Metric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void UInt32Metric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline UInt32Metric::KindCase UInt32Metric::kind_case() const { + return UInt32Metric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // Int32Metric @@ -3365,29 +5016,229 @@ inline void Int32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.description) } -// .abacus.protobuf.Kind kind = 2; -inline void Int32Metric::clear_kind() { - _impl_.kind_ = 0; +// .abacus.protobuf.Gauge gauge = 2; +inline bool Int32Metric::has_gauge() const { + return kind_case() == kGauge; } -inline ::abacus::protobuf::Kind Int32Metric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.kind) - return _internal_kind(); +inline bool Int32Metric::_internal_has_gauge() const { + return kind_case() == kGauge; } -inline void Int32Metric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.kind) +inline void Int32Metric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; } -inline ::abacus::protobuf::Kind Int32Metric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void Int32Metric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } } -inline void Int32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Gauge* Int32Metric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& Int32Metric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& Int32Metric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* Int32Metric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int32Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Int32Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int32Metric.gauge) +} +inline ::abacus::protobuf::Gauge* Int32Metric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* Int32Metric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.gauge) + return _msg; +} + +// .abacus.protobuf.Counter counter = 3; +inline bool Int32Metric::has_counter() const { + return kind_case() == kCounter; +} +inline bool Int32Metric::_internal_has_counter() const { + return kind_case() == kCounter; +} +inline void Int32Metric::set_has_counter() { + _impl_._oneof_case_[0] = kCounter; +} +inline void Int32Metric::clear_counter() { + if (kind_case() == kCounter) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Counter* Int32Metric::release_counter() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Counter& Int32Metric::_internal_counter() const { + return kind_case() == kCounter + ? *_impl_.kind_.counter_ + : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +} +inline const ::abacus::protobuf::Counter& Int32Metric::counter() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.counter) + return _internal_counter(); +} +inline ::abacus::protobuf::Counter* Int32Metric::unsafe_arena_release_counter() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int32Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Int32Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { + clear_kind(); + if (counter) { + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int32Metric.counter) +} +inline ::abacus::protobuf::Counter* Int32Metric::_internal_mutable_counter() { + if (kind_case() != kCounter) { + clear_kind(); + set_has_counter(); + _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); + } + return _impl_.kind_.counter_; +} +inline ::abacus::protobuf::Counter* Int32Metric::mutable_counter() { + ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.counter) + return _msg; +} + +// .abacus.protobuf.Constant constant = 4; +inline bool Int32Metric::has_constant() const { + return kind_case() == kConstant; +} +inline bool Int32Metric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void Int32Metric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void Int32Metric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* Int32Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& Int32Metric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& Int32Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* Int32Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int32Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Int32Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int32Metric.constant) +} +inline ::abacus::protobuf::Constant* Int32Metric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* Int32Metric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 5; inline bool Int32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3456,7 +5307,7 @@ inline void Int32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.unit) } -// optional int32 min = 4; +// optional int32 min = 6; inline bool Int32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3483,7 +5334,7 @@ inline void Int32Metric::_internal_set_min(::int32_t value) { _impl_.min_ = value; } -// optional int32 max = 5; +// optional int32 max = 7; inline bool Int32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -3510,6 +5361,15 @@ inline void Int32Metric::_internal_set_max(::int32_t value) { _impl_.max_ = value; } +inline bool Int32Metric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void Int32Metric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline Int32Metric::KindCase Int32Metric::kind_case() const { + return Int32Metric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // Float64Metric @@ -3554,40 +5414,240 @@ inline std::string* Float64Metric::release_description() { // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.description) return _impl_.description_.Release(); } -inline void Float64Metric::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:abacus.protobuf.Float64Metric.description) +inline void Float64Metric::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:abacus.protobuf.Float64Metric.description) +} + +// .abacus.protobuf.Gauge gauge = 2; +inline bool Float64Metric::has_gauge() const { + return kind_case() == kGauge; +} +inline bool Float64Metric::_internal_has_gauge() const { + return kind_case() == kGauge; +} +inline void Float64Metric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; +} +inline void Float64Metric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Gauge* Float64Metric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& Float64Metric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& Float64Metric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* Float64Metric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float64Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Float64Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float64Metric.gauge) +} +inline ::abacus::protobuf::Gauge* Float64Metric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* Float64Metric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.gauge) + return _msg; +} + +// .abacus.protobuf.Counter counter = 3; +inline bool Float64Metric::has_counter() const { + return kind_case() == kCounter; +} +inline bool Float64Metric::_internal_has_counter() const { + return kind_case() == kCounter; +} +inline void Float64Metric::set_has_counter() { + _impl_._oneof_case_[0] = kCounter; +} +inline void Float64Metric::clear_counter() { + if (kind_case() == kCounter) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Counter* Float64Metric::release_counter() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Counter& Float64Metric::_internal_counter() const { + return kind_case() == kCounter + ? *_impl_.kind_.counter_ + : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +} +inline const ::abacus::protobuf::Counter& Float64Metric::counter() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.counter) + return _internal_counter(); +} +inline ::abacus::protobuf::Counter* Float64Metric::unsafe_arena_release_counter() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float64Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Float64Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { + clear_kind(); + if (counter) { + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float64Metric.counter) +} +inline ::abacus::protobuf::Counter* Float64Metric::_internal_mutable_counter() { + if (kind_case() != kCounter) { + clear_kind(); + set_has_counter(); + _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); + } + return _impl_.kind_.counter_; +} +inline ::abacus::protobuf::Counter* Float64Metric::mutable_counter() { + ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.counter) + return _msg; } -// .abacus.protobuf.Kind kind = 2; -inline void Float64Metric::clear_kind() { - _impl_.kind_ = 0; +// .abacus.protobuf.Constant constant = 4; +inline bool Float64Metric::has_constant() const { + return kind_case() == kConstant; } -inline ::abacus::protobuf::Kind Float64Metric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.kind) - return _internal_kind(); +inline bool Float64Metric::_internal_has_constant() const { + return kind_case() == kConstant; } -inline void Float64Metric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.kind) +inline void Float64Metric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; } -inline ::abacus::protobuf::Kind Float64Metric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void Float64Metric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } } -inline void Float64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Constant* Float64Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& Float64Metric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& Float64Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* Float64Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float64Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Float64Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float64Metric.constant) +} +inline ::abacus::protobuf::Constant* Float64Metric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* Float64Metric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 5; inline bool Float64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3656,7 +5716,7 @@ inline void Float64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.unit) } -// optional double min = 4; +// optional double min = 6; inline bool Float64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3683,7 +5743,7 @@ inline void Float64Metric::_internal_set_min(double value) { _impl_.min_ = value; } -// optional double max = 5; +// optional double max = 7; inline bool Float64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -3710,6 +5770,15 @@ inline void Float64Metric::_internal_set_max(double value) { _impl_.max_ = value; } +inline bool Float64Metric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void Float64Metric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline Float64Metric::KindCase Float64Metric::kind_case() const { + return Float64Metric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // Float32Metric @@ -3765,29 +5834,229 @@ inline void Float32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.description) } -// .abacus.protobuf.Kind kind = 2; -inline void Float32Metric::clear_kind() { - _impl_.kind_ = 0; +// .abacus.protobuf.Gauge gauge = 2; +inline bool Float32Metric::has_gauge() const { + return kind_case() == kGauge; } -inline ::abacus::protobuf::Kind Float32Metric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.kind) - return _internal_kind(); +inline bool Float32Metric::_internal_has_gauge() const { + return kind_case() == kGauge; } -inline void Float32Metric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.kind) +inline void Float32Metric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; } -inline ::abacus::protobuf::Kind Float32Metric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void Float32Metric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } } -inline void Float32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Gauge* Float32Metric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& Float32Metric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& Float32Metric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* Float32Metric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float32Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Float32Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float32Metric.gauge) +} +inline ::abacus::protobuf::Gauge* Float32Metric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* Float32Metric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.gauge) + return _msg; +} + +// .abacus.protobuf.Counter counter = 3; +inline bool Float32Metric::has_counter() const { + return kind_case() == kCounter; +} +inline bool Float32Metric::_internal_has_counter() const { + return kind_case() == kCounter; +} +inline void Float32Metric::set_has_counter() { + _impl_._oneof_case_[0] = kCounter; +} +inline void Float32Metric::clear_counter() { + if (kind_case() == kCounter) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.counter_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Counter* Float32Metric::release_counter() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Counter& Float32Metric::_internal_counter() const { + return kind_case() == kCounter + ? *_impl_.kind_.counter_ + : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +} +inline const ::abacus::protobuf::Counter& Float32Metric::counter() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.counter) + return _internal_counter(); +} +inline ::abacus::protobuf::Counter* Float32Metric::unsafe_arena_release_counter() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float32Metric.counter) + if (kind_case() == kCounter) { + clear_has_kind(); + ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; + _impl_.kind_.counter_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Float32Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { + clear_kind(); + if (counter) { + set_has_counter(); + _impl_.kind_.counter_ = counter; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float32Metric.counter) +} +inline ::abacus::protobuf::Counter* Float32Metric::_internal_mutable_counter() { + if (kind_case() != kCounter) { + clear_kind(); + set_has_counter(); + _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); + } + return _impl_.kind_.counter_; +} +inline ::abacus::protobuf::Counter* Float32Metric::mutable_counter() { + ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.counter) + return _msg; +} + +// .abacus.protobuf.Constant constant = 4; +inline bool Float32Metric::has_constant() const { + return kind_case() == kConstant; +} +inline bool Float32Metric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void Float32Metric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void Float32Metric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* Float32Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& Float32Metric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& Float32Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* Float32Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float32Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Float32Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float32Metric.constant) +} +inline ::abacus::protobuf::Constant* Float32Metric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* Float32Metric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 5; inline bool Float32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3856,7 +6125,7 @@ inline void Float32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.unit) } -// optional float min = 4; +// optional float min = 6; inline bool Float32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3883,7 +6152,7 @@ inline void Float32Metric::_internal_set_min(float value) { _impl_.min_ = value; } -// optional float max = 5; +// optional float max = 7; inline bool Float32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -3910,6 +6179,15 @@ inline void Float32Metric::_internal_set_max(float value) { _impl_.max_ = value; } +inline bool Float32Metric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void Float32Metric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline Float32Metric::KindCase Float32Metric::kind_case() const { + return Float32Metric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // BoolMetric @@ -3965,29 +6243,155 @@ inline void BoolMetric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.description) } -// .abacus.protobuf.Kind kind = 2; -inline void BoolMetric::clear_kind() { - _impl_.kind_ = 0; +// .abacus.protobuf.Gauge gauge = 2; +inline bool BoolMetric::has_gauge() const { + return kind_case() == kGauge; } -inline ::abacus::protobuf::Kind BoolMetric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.kind) - return _internal_kind(); +inline bool BoolMetric::_internal_has_gauge() const { + return kind_case() == kGauge; } -inline void BoolMetric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.kind) +inline void BoolMetric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; } -inline ::abacus::protobuf::Kind BoolMetric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void BoolMetric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } } -inline void BoolMetric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Gauge* BoolMetric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& BoolMetric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& BoolMetric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* BoolMetric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.BoolMetric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void BoolMetric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.BoolMetric.gauge) +} +inline ::abacus::protobuf::Gauge* BoolMetric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* BoolMetric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.gauge) + return _msg; +} + +// .abacus.protobuf.Constant constant = 3; +inline bool BoolMetric::has_constant() const { + return kind_case() == kConstant; +} +inline bool BoolMetric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void BoolMetric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void BoolMetric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* BoolMetric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& BoolMetric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& BoolMetric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* BoolMetric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.BoolMetric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void BoolMetric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.BoolMetric.constant) +} +inline ::abacus::protobuf::Constant* BoolMetric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* BoolMetric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 4; inline bool BoolMetric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4056,6 +6460,15 @@ inline void BoolMetric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.unit) } +inline bool BoolMetric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void BoolMetric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline BoolMetric::KindCase BoolMetric::kind_case() const { + return BoolMetric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // Enum8Metric_EnumValue @@ -4237,29 +6650,155 @@ inline void Enum8Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.description) } -// .abacus.protobuf.Kind kind = 2; -inline void Enum8Metric::clear_kind() { - _impl_.kind_ = 0; +// .abacus.protobuf.Gauge gauge = 2; +inline bool Enum8Metric::has_gauge() const { + return kind_case() == kGauge; } -inline ::abacus::protobuf::Kind Enum8Metric::kind() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.kind) - return _internal_kind(); +inline bool Enum8Metric::_internal_has_gauge() const { + return kind_case() == kGauge; } -inline void Enum8Metric::set_kind(::abacus::protobuf::Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.kind) +inline void Enum8Metric::set_has_gauge() { + _impl_._oneof_case_[0] = kGauge; } -inline ::abacus::protobuf::Kind Enum8Metric::_internal_kind() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +inline void Enum8Metric::clear_gauge() { + if (kind_case() == kGauge) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.gauge_; + } + clear_has_kind(); + } } -inline void Enum8Metric::_internal_set_kind(::abacus::protobuf::Kind value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.kind_ = value; +inline ::abacus::protobuf::Gauge* Enum8Metric::release_gauge() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Gauge& Enum8Metric::_internal_gauge() const { + return kind_case() == kGauge + ? *_impl_.kind_.gauge_ + : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); +} +inline const ::abacus::protobuf::Gauge& Enum8Metric::gauge() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.gauge) + return _internal_gauge(); +} +inline ::abacus::protobuf::Gauge* Enum8Metric::unsafe_arena_release_gauge() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Enum8Metric.gauge) + if (kind_case() == kGauge) { + clear_has_kind(); + ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; + _impl_.kind_.gauge_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Enum8Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { + clear_kind(); + if (gauge) { + set_has_gauge(); + _impl_.kind_.gauge_ = gauge; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Enum8Metric.gauge) +} +inline ::abacus::protobuf::Gauge* Enum8Metric::_internal_mutable_gauge() { + if (kind_case() != kGauge) { + clear_kind(); + set_has_gauge(); + _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); + } + return _impl_.kind_.gauge_; +} +inline ::abacus::protobuf::Gauge* Enum8Metric::mutable_gauge() { + ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.gauge) + return _msg; +} + +// .abacus.protobuf.Constant constant = 3; +inline bool Enum8Metric::has_constant() const { + return kind_case() == kConstant; +} +inline bool Enum8Metric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void Enum8Metric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void Enum8Metric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* Enum8Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& Enum8Metric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& Enum8Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* Enum8Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Enum8Metric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Enum8Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Enum8Metric.constant) +} +inline ::abacus::protobuf::Constant* Enum8Metric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* Enum8Metric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.constant) + return _msg; } -// optional string unit = 3; +// optional string unit = 4; inline bool Enum8Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4328,7 +6867,7 @@ inline void Enum8Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.unit) } -// map values = 4; +// map values = 5; inline int Enum8Metric::_internal_values_size() const { return _internal_values().size(); } @@ -4355,6 +6894,15 @@ inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumV return _internal_mutable_values(); } +inline bool Enum8Metric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void Enum8Metric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline Enum8Metric::KindCase Enum8Metric::kind_case() const { + return Enum8Metric::KindCase(_impl_._oneof_case_[0]); +} // ------------------------------------------------------------------- // Metric @@ -4381,28 +6929,6 @@ inline void Metric::_internal_set_offset(::uint32_t value) { _impl_.offset_ = value; } -// bool optional = 2; -inline void Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.optional) - return _internal_optional(); -} -inline void Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.optional) -} -inline bool Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - // .abacus.protobuf.UInt64Metric uint64 = 3; inline bool Metric::has_uint64() const { return type_case() == kUint64; diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 23f1a744..5b26db3d 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -24,12 +24,6 @@ struct uint32 /// The primitive type of the metric using type = uint32_t; - /// The optional metric type - using optional = optional_metric; - - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -54,14 +48,11 @@ struct uint32 } /// The metric kind - abacus::kind kind; + std::variant kind; /// The metric description abacus::description description; - /// The availability of the metric - abacus::availability availability; - /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index 5108328b..f1eea7d6 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -24,12 +24,6 @@ struct uint64 /// The primitive type of the metric using type = uint64_t; - /// The optional metric type - using optional = optional_metric; - - /// The required metric type - using required = required_metric; - /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. @@ -54,14 +48,11 @@ struct uint64 } /// The metric kind - abacus::kind kind; + std::variant kind; /// The metric description abacus::description description; - /// The availability of the metric - abacus::availability availability; - /// The unit of the metric abacus::unit unit{}; diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index 6004ae18..ab3547cb 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -8,6 +8,8 @@ #include #include +#include +#include template void integer_test() @@ -15,7 +17,7 @@ void integer_test() using type = typename T::type; { - using optional = typename T::optional; + using optional = abacus::optional_metric; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); optional o; @@ -36,7 +38,7 @@ void integer_test() EXPECT_FALSE(o.has_value()); } { - using required = typename T::required; + using required = abacus::required_metric; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); required r; @@ -67,7 +69,7 @@ void floating_point_test() using type = typename T::type; { - using optional = typename T::optional; + using optional = abacus::optional_metric; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); optional o; @@ -88,7 +90,7 @@ void floating_point_test() EXPECT_FALSE(o.has_value()); } { - using required = typename T::required; + using required = abacus::required_metric; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); required r; @@ -115,11 +117,12 @@ TEST(test_info, floating_point) TEST(test_info, boolean) { { + using optional = abacus::optional_metric; uint8_t data[sizeof(bool) + 1]; std::memset(data, 0, sizeof(data)); - abacus::boolean::optional o; + optional o; EXPECT_FALSE(o.is_initialized()); - o = abacus::boolean::optional(data); + o = optional(data); EXPECT_TRUE(o.is_initialized()); EXPECT_FALSE(o.has_value()); o = true; @@ -131,11 +134,12 @@ TEST(test_info, boolean) EXPECT_FALSE(o.has_value()); } { + using required = abacus::required_metric; uint8_t data[sizeof(bool) + 1]; std::memset(data, 0, sizeof(data)); - abacus::boolean::required r; + required r; EXPECT_FALSE(r.is_initialized()); - r = abacus::boolean::required(data, true); + r = required(data, true); EXPECT_TRUE(r.is_initialized()); EXPECT_EQ(r.value(), true); r = false; @@ -156,11 +160,13 @@ enum class test_enum TEST(test_info, enum8) { { + using optional = abacus::optional_metric; + uint8_t data[sizeof(uint8_t) + 1]; std::memset(data, 0, sizeof(data)); - abacus::enum8::optional o; + optional o; EXPECT_FALSE(o.is_initialized()); - o = abacus::enum8::optional(data); + o = optional(data); EXPECT_TRUE(o.is_initialized()); EXPECT_FALSE(o.has_value()); o = 10U; @@ -191,11 +197,13 @@ TEST(test_info, enum8) } { + using required = abacus::required_metric; + uint8_t data[sizeof(uint8_t) + 1]; std::memset(data, 0, sizeof(data)); - abacus::enum8::required r; + required r; EXPECT_FALSE(r.is_initialized()); - r = abacus::enum8::required(data, 10U); + r = required(data, 10U); EXPECT_TRUE(r.is_initialized()); EXPECT_EQ(r.value(), 10U); r = 20U; diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index a6d04a78..f7d4de79 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -15,7 +15,7 @@ TEST(test_metric, constructor) uint8_t data[9]; std::memset(data, 0, sizeof(data)); - abacus::uint64::optional uint_metric(data); + abacus::optional_metric uint_metric(data); EXPECT_TRUE(uint_metric.is_initialized()); EXPECT_FALSE(uint_metric.has_value()); @@ -24,44 +24,44 @@ TEST(test_metric, constructor) EXPECT_EQ(uint_metric.value(), 42U); } -TEST(test_metric, float_assignment) -{ - uint8_t data[9]; - std::memset(data, 0, sizeof(data)); +// TEST(test_metric, float_assignment) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); - abacus::float64::optional double_metric(data); - EXPECT_TRUE(double_metric.is_initialized()); - EXPECT_FALSE(double_metric.has_value()); - double_metric = 1123.12; - EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); +// abacus::optional_metric double_metric(data); +// EXPECT_TRUE(double_metric.is_initialized()); +// EXPECT_FALSE(double_metric.has_value()); +// double_metric = 1123.12; +// EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); - // Assignment - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric = 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric = 1 / -0.0, ""); +// // Assignment +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / -0.0, ""); - // Add and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric += 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric += 1 / -0.0, ""); +// // Add and Assign +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric += 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric += 1 / -0.0, ""); - // Subtract and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / -0.0, ""); -} +// // Subtract and Assign +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +// } diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 583d07f8..12ee383c 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -38,38 +38,35 @@ TEST(test_metrics, api) std::map infos = { {abacus::name{name0}, - abacus::boolean{abacus::counter, - abacus::description{"A boolean metric"}, - abacus::optional}}, + abacus::boolean{abacus::gauge{abacus::optional}, + abacus::description{"A boolean metric"}}}, {abacus::name{name1}, - abacus::uint64{abacus::counter, + abacus::uint64{abacus::counter{abacus::required}, abacus::description{"An unsigned integer metric"}, - abacus::required, abacus::unit{"bytes"}}}, + abacus::unit{"bytes"}}}, {abacus::name{name2}, - abacus::int64{abacus::gauge, + abacus::int64{abacus::gauge{abacus::optional}, abacus::description{"A signed integer metric"}, - abacus::optional, abacus::unit{"USD"}}}, + abacus::unit{"USD"}}}, {abacus::name{name3}, - abacus::float64{abacus::gauge, + abacus::float64{abacus::gauge{abacus::optional}, abacus::description{"A floating point metric"}, - abacus::optional, abacus::unit{"ms"}}}, + abacus::unit{"ms"}}}, {abacus::name{name4}, - abacus::boolean{abacus::constant, - abacus::description{"A constant boolean metric"}, - abacus::required}}, + abacus::boolean{abacus::constant{}, + abacus::description{"A constant boolean metric"}}}, {abacus::name{name5}, abacus::float64{ - abacus::constant, + abacus::constant{}, abacus::description{"A constant floating point metric"}, - abacus::required, abacus::unit{"ms"}}}, + abacus::unit{"ms"}}}, {abacus::name{name6}, - abacus::enum8{abacus::gauge, + abacus::enum8{abacus::gauge{abacus::optional}, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}, - abacus::optional}}}; + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics from_metrics(infos); abacus::metrics metrics(std::move(from_metrics)); @@ -77,46 +74,46 @@ TEST(test_metrics, api) EXPECT_EQ(metrics.metadata().protocol_version(), abacus::protocol_version()); - EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().kind(), - abacus::counter.value); + EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().kind_case(), + abacus::protobuf::BoolMetric::KindCase::kGauge); EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().description(), "A boolean metric"); EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().unit(), ""); // empty unit - EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().kind(), - abacus::counter.value); + EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().kind_case(), + abacus::protobuf::UInt64Metric::KindCase::kCounter); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().description(), "An unsigned integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().unit(), "bytes"); - EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().kind(), - abacus::gauge.value); + EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().kind_case(), + abacus::protobuf::Int64Metric::KindCase::kGauge); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().description(), "A signed integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().unit(), "USD"); - EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().kind(), - abacus::gauge.value); + EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().kind_case(), + abacus::protobuf::Float64Metric::KindCase::kGauge); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().description(), "A floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().unit(), "ms"); - EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().kind(), - abacus::constant.value); + EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().kind_case(), + abacus::protobuf::BoolMetric::KindCase::kConstant); EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().description(), "A constant boolean metric"); EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().unit(), ""); // empty unit + EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().kind_case(), + abacus::protobuf::Float64Metric::KindCase::kConstant); - EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().kind(), - abacus::constant.value); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().description(), "A constant floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().unit(), "ms"); - EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().kind(), - abacus::gauge.value); + EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().kind_case(), + abacus::protobuf::Enum8Metric::KindCase::kGauge); EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().description(), "An enum metric"); EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().values().size(), @@ -202,13 +199,13 @@ TEST(test_metrics, value_and_metadata_bytes) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, + abacus::uint64{abacus::counter{abacus::optional}, abacus::description{"An unsigned integer metric"}, - abacus::optional, abacus::unit{"bytes"}}}, + abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, + abacus::int64{abacus::gauge{abacus::optional}, abacus::description{"A signed integer metric"}, - abacus::optional, abacus::unit{"USD"}}}}; + abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; @@ -217,13 +214,14 @@ TEST(test_metrics, value_and_metadata_bytes) (void)m0; (void)m1; - EXPECT_EQ(metrics.metadata().ByteSizeLong(), 112U); + EXPECT_EQ(metrics.metadata().ByteSizeLong(), 114U); EXPECT_EQ(metrics.value_bytes(), sizeof(uint32_t) + // hash 1 + sizeof(uint64_t) + // metric0 has_value + value 1 + sizeof(int64_t) // metric1 has_value + value ); } + TEST(test_metrics, reset_counters) { std::string name0 = "metric0"; @@ -231,13 +229,13 @@ TEST(test_metrics, reset_counters) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, + abacus::uint64{abacus::counter{abacus::optional}, abacus::description{"An unsigned integer metric"}, - abacus::optional, abacus::unit{"bytes"}}}, + abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, + abacus::int64{abacus::gauge{abacus::optional}, abacus::description{"A signed integer metric"}, - abacus::optional, abacus::unit{"USD"}}}}; + abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; @@ -270,22 +268,23 @@ TEST(test_metrics, reset_counters) } static const std::vector expected_metadata = { - 0x08, 0x02, 0x1d, 0x26, 0x65, 0xd9, 0x06, 0x22, 0x34, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x08, 0x04, 0x1a, 0x25, - 0x0a, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x10, 0x01, 0x1a, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x2d, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, - 0x12, 0x22, 0x08, 0x0d, 0x22, 0x1e, 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, - 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x03, 0x55, 0x53, 0x44, - 0x22, 0x2c, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, - 0x21, 0x08, 0x16, 0x3a, 0x1d, 0x0a, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, - 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x02, 0x6d, 0x73, 0x22, 0x21, - 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, 0x16, 0x08, - 0x1f, 0x4a, 0x12, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, - 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63}; + 0x08, 0x02, 0x1d, 0x57, 0x84, 0xe9, 0x44, 0x22, 0x2f, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, 0x12, 0x24, 0x08, 0x0d, 0x22, 0x20, + 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, + 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x12, 0x00, 0x2a, 0x03, 0x55, 0x53, 0x44, 0x22, 0x23, 0x0a, 0x07, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, 0x18, 0x08, 0x1f, 0x4a, + 0x14, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, + 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x00, 0x22, 0x34, 0x0a, + 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x08, 0x04, + 0x1a, 0x25, 0x0a, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x00, 0x2a, 0x05, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x32, 0x12, 0x23, 0x08, 0x16, 0x3a, 0x1f, 0x0a, 0x17, 0x41, 0x20, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x00, 0x2a, + 0x02, 0x6d, 0x73}; static const std::vector expected_value_data = { 0x01, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, @@ -302,20 +301,20 @@ TEST(test_metrics, protocol_version) << "If this test fails, you need to update the protocol version"); std::map infos = { {abacus::name{"metric0"}, - abacus::uint64{abacus::counter, + abacus::uint64{abacus::counter{abacus::required}, abacus::description{"An unsigned integer metric"}, - abacus::required, abacus::unit{"bytes"}}}, + abacus::unit{"bytes"}}}, {abacus::name{"metric1"}, - abacus::int64{abacus::gauge, + abacus::int64{abacus::gauge{abacus::required}, abacus::description{"A signed integer metric"}, - abacus::required, abacus::unit{"USD"}}}, + abacus::unit{"USD"}}}, {abacus::name{"metric2"}, - abacus::float64{abacus::gauge, + abacus::float64{abacus::gauge{abacus::required}, abacus::description{"A floating point metric"}, - abacus::required, abacus::unit{"ms"}}}, + abacus::unit{"ms"}}}, {abacus::name{"metric3"}, - abacus::boolean{abacus::gauge, abacus::description{"A boolean metric"}, - abacus::required}}}; + abacus::boolean{abacus::gauge{abacus::required}, + abacus::description{"A boolean metric"}}}}; abacus::metrics metrics(infos); @@ -386,88 +385,80 @@ TEST(test_metrics, reset) // Create one of each metric both required and optional std::map infos = { {abacus::name{"uint64_required"}, - abacus::uint64{abacus::counter, abacus::description{""}, - abacus::required}}, + abacus::uint64{abacus::counter{abacus::required}, + abacus::description{""}}}, {abacus::name{"uint64_optional"}, - abacus::uint64{abacus::counter, abacus::description{""}, - abacus::optional}}, + abacus::uint64{abacus::counter{abacus::optional}, + abacus::description{""}}}, {abacus::name{"uint32_required"}, - abacus::uint32{abacus::counter, abacus::description{""}, - abacus::required}}, + abacus::uint32{abacus::counter{abacus::required}, + abacus::description{""}}}, {abacus::name{"uint32_optional"}, - abacus::uint32{abacus::counter, abacus::description{""}, - abacus::optional}}, + abacus::uint32{abacus::counter{abacus::optional}, + abacus::description{""}}}, {abacus::name{"int64_required"}, - abacus::int64{abacus::gauge, abacus::description{""}, - abacus::required}}, + abacus::int64{abacus::gauge{abacus::required}, + abacus::description{""}}}, {abacus::name{"int64_optional"}, - abacus::int64{abacus::gauge, abacus::description{""}, - abacus::optional}}, + abacus::int64{abacus::gauge{abacus::optional}, + abacus::description{""}}}, {abacus::name{"int32_required"}, - abacus::int32{abacus::gauge, abacus::description{""}, - abacus::required}}, + abacus::int32{abacus::gauge{abacus::required}, + abacus::description{""}}}, {abacus::name{"int32_optional"}, - abacus::int32{abacus::gauge, abacus::description{""}, - abacus::optional}}, + abacus::int32{abacus::gauge{abacus::optional}, + abacus::description{""}}}, {abacus::name{"float64_required"}, - abacus::float64{abacus::gauge, abacus::description{""}, - abacus::required}}, + abacus::float64{abacus::gauge{abacus::required}, + abacus::description{""}}}, {abacus::name{"float64_optional"}, - abacus::float64{abacus::gauge, abacus::description{""}, - abacus::optional}}, + abacus::float64{abacus::gauge{abacus::optional}, + abacus::description{""}}}, {abacus::name{"float32_required"}, - abacus::float32{abacus::gauge, abacus::description{""}, - abacus::required}}, + abacus::float32{abacus::gauge{abacus::required}, + abacus::description{""}}}, {abacus::name{"float32_optional"}, - abacus::float32{abacus::gauge, abacus::description{""}, - abacus::optional}}, + abacus::float32{abacus::gauge{abacus::optional}, + abacus::description{""}}}, {abacus::name{"boolean_required"}, - abacus::boolean{abacus::gauge, abacus::description{""}, - abacus::required}}, + abacus::boolean{abacus::gauge{abacus::required}, + abacus::description{""}}}, {abacus::name{"boolean_optional"}, - abacus::boolean{abacus::gauge, abacus::description{""}, - abacus::optional}}, - {abacus::name{"enum8_required"}, abacus::enum8{abacus::gauge, - abacus::description{""}, - {{0, {"", ""}}}, - abacus::required}}, - {abacus::name{"enum8_optional"}, abacus::enum8{abacus::gauge, - abacus::description{""}, - {{0, {"", ""}}}, - abacus::optional}}, + abacus::boolean{abacus::gauge{abacus::optional}, + abacus::description{""}}}, + {abacus::name{"enum8_required"}, + abacus::enum8{abacus::gauge{abacus::required}, + abacus::description{""}, + {{0, {"", ""}}}}}, + {abacus::name{"enum8_optional"}, + abacus::enum8{abacus::gauge{abacus::optional}, + abacus::description{""}, + {{0, {"", ""}}}}}, {abacus::name{"uint64_constant"}, - abacus::uint64{abacus::constant, abacus::description{""}, - abacus::required}}, + abacus::uint64{abacus::constant{}, abacus::description{""}}}, {abacus::name{"uint32_constant"}, - abacus::uint32{abacus::constant, abacus::description{""}, - abacus::required}}, + abacus::uint32{abacus::constant{}, abacus::description{""}}}, {abacus::name{"int64_constant"}, - abacus::int64{abacus::constant, abacus::description{""}, - abacus::required}}, + abacus::int64{abacus::constant{}, abacus::description{""}}}, {abacus::name{"int32_constant"}, - abacus::int32{abacus::constant, abacus::description{""}, - abacus::required}}, + abacus::int32{abacus::constant{}, abacus::description{""}}}, {abacus::name{"float64_constant"}, - abacus::float64{abacus::constant, abacus::description{""}, - abacus::required}}, + abacus::float64{abacus::constant{}, abacus::description{""}}}, {abacus::name{"float32_constant"}, - abacus::float32{abacus::constant, abacus::description{""}, - abacus::required}}, + abacus::float32{abacus::constant{}, abacus::description{""}}}, {abacus::name{"boolean_constant"}, - abacus::boolean{abacus::constant, abacus::description{""}, - abacus::required}}, - {abacus::name{"enum8_constant"}, abacus::enum8{abacus::constant, + abacus::boolean{abacus::constant{}, abacus::description{""}}}, + {abacus::name{"enum8_constant"}, abacus::enum8{abacus::constant{}, abacus::description{""}, - {{0, {"", ""}}}, - abacus::required}}, + {{0, {"", ""}}}}}, // Finally a metric that we do not initialize {abacus::name{"not_initialized_required"}, - abacus::uint64{abacus::counter, abacus::description{""}, - abacus::required}}, + abacus::uint64{abacus::counter{abacus::required}, + abacus::description{""}}}, {abacus::name{"not_initialized_optional"}, - abacus::uint64{abacus::counter, abacus::description{""}, - abacus::optional}}}; + abacus::uint64{abacus::counter{abacus::optional}, + abacus::description{""}}}}; abacus::metrics metrics(infos); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index ca13da46..193f7d32 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -29,27 +29,25 @@ TEST(test_to_json, to_json_minimal) std::map infos = { {abacus::name{name0}, - abacus::uint64{ - abacus::counter, abacus::description{"An unsigned integer metric"}, - abacus::required, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, - abacus::max{uint64_t{100U}}}}, + abacus::uint64{abacus::counter{abacus::required}, + abacus::description{"An unsigned integer metric"}, + abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, + abacus::int64{abacus::gauge{abacus::required}, abacus::description{"A signed integer metric"}, - abacus::required, abacus::unit{"USD"}, - abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, + abacus::unit{"USD"}, abacus::min{int64_t{-100}}, + abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::constant, - abacus::description{"A boolean constant"}, - abacus::required}}, + abacus::boolean{abacus::constant{}, + abacus::description{"A boolean constant"}}}, {abacus::name{name3}, - abacus::enum8{abacus::gauge, + abacus::enum8{abacus::gauge{abacus::required}, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}, - abacus::required}}}; + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); @@ -75,10 +73,11 @@ TEST(test_to_json, to_json_minimal) static const char* expected_json = R"({ "metric0" : { "offset" : 4, - "optional" : false, "uint64" : { + "counter" : { + "optional" : false + }, "description" : "An unsigned integer metric", - "kind" : "COUNTER", "max" : "100", "min" : "0", "unit" : "bytes" @@ -88,28 +87,32 @@ static const char* expected_json = R"({ "metric1" : { "int64" : { "description" : "A signed integer metric", - "kind" : "GAUGE", + "gauge" : { + "optional" : false + }, "max" : "100", "min" : "-100", "unit" : "USD" }, "offset" : 13, - "optional" : false, "value" : -42 }, "metric2" : { "boolean" : { - "description" : "A boolean constant", - "kind" : "CONSTANT" + "constant" : { + + }, + "description" : "A boolean constant" }, "offset" : 22, - "optional" : false, "value" : true }, "metric3" : { "enum8" : { "description" : "An enum metric", - "kind" : "GAUGE", + "gauge" : { + "optional" : false + }, "values" : { "0" : { "description" : "The value for 0", @@ -130,7 +133,6 @@ static const char* expected_json = R"({ } }, "offset" : 24, - "optional" : false, "value" : 2 } })"; @@ -155,27 +157,25 @@ TEST(test_to_json, to_json) std::map infos = { {abacus::name{name0}, - abacus::uint64{ - abacus::counter, abacus::description{"An unsigned integer metric"}, - abacus::required, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, - abacus::max{uint64_t{100U}}}}, + abacus::uint64{abacus::counter{abacus::required}, + abacus::description{"An unsigned integer metric"}, + abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, + abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, + abacus::int64{abacus::gauge{abacus::required}, abacus::description{"A signed integer metric"}, - abacus::required, abacus::unit{"USD"}, - abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, + abacus::unit{"USD"}, abacus::min{int64_t{-100}}, + abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::constant, - abacus::description{"A boolean constant"}, - abacus::required}}, + abacus::boolean{abacus::constant{}, + abacus::description{"A boolean constant"}}}, {abacus::name{name3}, - abacus::enum8{abacus::gauge, + abacus::enum8{abacus::gauge{abacus::required}, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}, - abacus::required}}}; + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); @@ -206,5 +206,5 @@ TEST(test_to_json, to_json) metrics.metadata(), metrics.value_data(), metrics.value_bytes()); EXPECT_EQ(json_from_view, json_from_data); - EXPECT_EQ(json_from_view, expected_json) << json_from_view; + EXPECT_EQ(expected_json, json_from_view) << json_from_view; } diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 970042e1..b621606e 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -22,26 +22,25 @@ TEST(test_view, api) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, + abacus::uint64{abacus::counter{abacus::optional}, abacus::description{"An unsigned integer metric"}, - abacus::optional, abacus::unit{"bytes"}}}, + abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, + abacus::int64{abacus::gauge{abacus::optional}, abacus::description{"A signed integer metric"}, - abacus::optional, abacus::unit{"USD"}}}, + abacus::unit{"USD"}}}, {abacus::name{name2}, abacus::float64{ - abacus::constant, + abacus::constant{}, abacus::description{"A constant floating point metric"}, - abacus::required, abacus::unit{"ms"}}}, + abacus::unit{"ms"}}}, {abacus::name{name3}, - abacus::enum8{abacus::gauge, + abacus::enum8{abacus::gauge{abacus::optional}, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}, - abacus::optional}}}; + {3, {"value3", "The value for 3"}}}}}}; abacus::metrics metrics(infos); From cd8c6e3228331bfc1dfedc09bbfa93c72464ad62 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 28 Jan 2025 13:22:09 +0100 Subject: [PATCH 42/68] work --- src/abacus/metrics.cpp | 82 ++++++------------------------------------ 1 file changed, 10 insertions(+), 72 deletions(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index f0f7ae60..fc62d42d 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -25,8 +25,8 @@ inline namespace STEINWURF_ABACUS_VERSION { template -static inline auto call_specific(const protobuf::Metric& metric, - const Func& func) -> bool +static inline auto call_type(const protobuf::Metric& metric, + const Func& func) -> bool { switch (metric.type_case()) { @@ -63,47 +63,6 @@ bool is_constant_impl(const Metric& metric) return false; } -static inline bool is_constant(const protobuf::Metric& metric) -{ - return call_specific(metric, [](const auto& metric) - { return is_constant_impl(metric); }); - // switch (metric.type_case()) - // { - // case protobuf::Metric::kUint64: - // return metric.uint64().kind_case() == - // protobuf::UInt64Metric::KindCase::kConstant; - // case protobuf::Metric::kInt64: - // return metric.int64().kind_case() == - // protobuf::Int64Metric::KindCase::kConstant; - // case protobuf::Metric::kUint32: - // return metric.uint32().kind_case() == - // protobuf::UInt32Metric::KindCase::kConstant; - // case protobuf::Metric::kInt32: - // return metric.int32().kind_case() == - // protobuf::Int32Metric::KindCase::kConstant; - // case protobuf::Metric::kFloat64: - // return metric.float64().kind_case() == - // protobuf::Float64Metric::KindCase::kConstant; - // case protobuf::Metric::kFloat32: - // return metric.float32().kind_case() == - // protobuf::Float32Metric::KindCase::kConstant; - // case protobuf::Metric::kBoolean: - // return metric.boolean().kind_case() == - // protobuf::BoolMetric::KindCase::kConstant; - // case protobuf::Metric::kEnum8: - // return metric.enum8().kind_case() == - // protobuf::Enum8Metric::KindCase::kConstant; - // case protobuf::Metric::TYPE_NOT_SET: - // // This should never be reached - // assert(false); - // return false; - // default: - // // This should never be reached - // assert(false); - // return false; - // } -} - template bool is_optional_impl(const Metric& metric) { @@ -128,35 +87,14 @@ bool is_optional_impl(const Metric& metric) static inline auto is_optional(const protobuf::Metric& metric) -> bool { - return call_specific(metric, [](const auto& metric) - { return is_optional_impl(metric); }); - // switch (metric.type_case()) - // { - // case protobuf::Metric::kUint64: - // return is_optional_impl(metric.uint64()); - // case protobuf::Metric::kInt64: - // return is_optional_impl(metric.int64()); - // case protobuf::Metric::kUint32: - // return is_optional_impl(metric.uint32()); - // case protobuf::Metric::kInt32: - // return is_optional_impl(metric.int32()); - // case protobuf::Metric::kFloat64: - // return is_optional_impl(metric.float64()); - // case protobuf::Metric::kFloat32: - // return is_optional_impl(metric.float32()); - // case protobuf::Metric::kBoolean: - // return is_optional_impl(metric.boolean()); - // case protobuf::Metric::kEnum8: - // return is_optional_impl(metric.enum8()); - // case protobuf::Metric::TYPE_NOT_SET: - // // This should never be reached - // assert(false); - // return false; - // default: - // // This should never be reached - // assert(false); - // return false; - // } + return call_type(metric, [](const auto& metric) + { return is_optional_impl(metric); }); +} + +static inline bool is_constant(const protobuf::Metric& metric) +{ + return call_type(metric, [](const auto& metric) + { return is_constant_impl(metric); }); } template From 63fa6a02664fc4e459c398c917722381a3ea9c84 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 28 Jan 2025 14:14:27 +0100 Subject: [PATCH 43/68] work --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e51eb7a..976d97ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,7 +107,7 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) steinwurf::bourne steinwurf::protobuf) - add_test(abacus_test abacus_test) + add_test(abacus_tests abacus_tests) # Google Benchmark dependency set(BENCHMARK_ENABLE_TESTING From ed5b08277ca6bb3e2d2ec8f952212eb4a04a7b23 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 28 Jan 2025 14:21:09 +0100 Subject: [PATCH 44/68] pynte --- src/abacus/detail/helpers.hpp | 30 +++++++++++ src/abacus/metrics.cpp | 96 ++++++++++++----------------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/abacus/detail/helpers.hpp b/src/abacus/detail/helpers.hpp index 175bdb55..98bcfb33 100644 --- a/src/abacus/detail/helpers.hpp +++ b/src/abacus/detail/helpers.hpp @@ -119,6 +119,36 @@ struct has_kConstant> : std::true_type template inline constexpr bool has_kConstant_v = has_kConstant::value; + +template +static inline auto call_type(const protobuf::Metric& metric, const Func& func) + -> decltype(func(metric.uint64())) +{ + switch (metric.type_case()) + { + case protobuf::Metric::kUint64: + return func(metric.uint64()); + case protobuf::Metric::kInt64: + return func(metric.int64()); + case protobuf::Metric::kUint32: + return func(metric.uint32()); + case protobuf::Metric::kInt32: + return func(metric.int32()); + case protobuf::Metric::kFloat64: + return func(metric.float64()); + case protobuf::Metric::kFloat32: + return func(metric.float32()); + case protobuf::Metric::kBoolean: + return func(metric.boolean()); + case protobuf::Metric::kEnum8: + return func(metric.enum8()); + default: + // This should never be reached + assert(false); + using ReturnType = decltype(func(metric.uint64())); + return ReturnType(); + } +} } } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index fc62d42d..b65d4e4e 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -24,77 +24,47 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -template -static inline auto call_type(const protobuf::Metric& metric, - const Func& func) -> bool -{ - switch (metric.type_case()) - { - case protobuf::Metric::kUint64: - return func(metric.uint64()); - case protobuf::Metric::kInt64: - return func(metric.int64()); - case protobuf::Metric::kUint32: - return func(metric.uint32()); - case protobuf::Metric::kInt32: - return func(metric.int32()); - case protobuf::Metric::kFloat64: - return func(metric.float64()); - case protobuf::Metric::kFloat32: - return func(metric.float32()); - case protobuf::Metric::kBoolean: - return func(metric.boolean()); - case protobuf::Metric::kEnum8: - return func(metric.enum8()); - default: - // This should never be reached - assert(false); - return false; - } -} - -template -bool is_constant_impl(const Metric& metric) -{ - if constexpr (detail::has_kConstant_v) - { - return metric.kind_case() == Metric::KindCase::kConstant; - } - return false; -} - -template -bool is_optional_impl(const Metric& metric) +static inline auto is_optional(const protobuf::Metric& metric) -> bool { - if constexpr (detail::has_kGauge_v) - { - if (metric.kind_case() == Metric::KindCase::kGauge) + return detail::call_type( + metric, + [](const auto& metric) { - return metric.gauge().optional(); - } - } - if constexpr (detail::has_kCounter_v) - - { - if (metric.kind_case() == Metric::KindCase::kCounter) - { - return metric.counter().optional(); - } - } + using Metric = std::decay_t; + if constexpr (detail::has_kGauge_v) + { + if (metric.kind_case() == Metric::KindCase::kGauge) + { + return metric.gauge().optional(); + } + } + if constexpr (detail::has_kCounter_v) - return false; -} + { + if (metric.kind_case() == Metric::KindCase::kCounter) + { + return metric.counter().optional(); + } + } -static inline auto is_optional(const protobuf::Metric& metric) -> bool -{ - return call_type(metric, [](const auto& metric) - { return is_optional_impl(metric); }); + return false; + }); } static inline bool is_constant(const protobuf::Metric& metric) { - return call_type(metric, [](const auto& metric) - { return is_constant_impl(metric); }); + return detail::call_type( + metric, + [](const auto& metric) + { + using Metric = std::decay_t; + + if constexpr (detail::has_kConstant_v) + { + return metric.kind_case() == Metric::KindCase::kConstant; + } + return false; + }); } template From 0c529a11d1ed6383f2929b171bb9a49ca1a72209 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 28 Jan 2025 15:15:54 +0100 Subject: [PATCH 45/68] wokr --- src/abacus/metrics.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index b65d4e4e..c864f3ae 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -98,7 +98,6 @@ static inline auto set_kind(Protobuf& protobuf, const Kind& kind) { if (auto* c = std::get_if(&kind)) { - protobuf.mutable_constant(); return; } @@ -132,7 +131,6 @@ metrics::metrics(const std::map& info) for (auto [name, value] : info) { - protobuf::Metric metric; metric.set_offset(m_value_bytes); From c36971b0d2cdcccf0fe3b3f0d0c3d0c393d2c83c Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 29 Jan 2025 08:57:40 +0100 Subject: [PATCH 46/68] work --- src/abacus/metrics.cpp | 4 +-- test/src/test_metric.cpp | 74 ++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index c864f3ae..b51509b0 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -445,7 +445,7 @@ auto metrics::value_data() const -> const uint8_t* auto metrics::value_data(std::size_t offset) -> uint8_t* { - return m_data.data() + offset + m_metadata_bytes; + return m_data.data() + m_metadata_bytes + offset; } auto metrics::value_bytes() const -> std::size_t @@ -465,7 +465,7 @@ auto metrics::metadata_data() const -> const uint8_t* auto metrics::metadata_bytes() const -> std::size_t { - return m_metadata.ByteSizeLong(); + return m_metadata_bytes; } auto metrics::is_initialized(const std::string& name) const -> bool diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index f7d4de79..73122e2d 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -24,44 +24,44 @@ TEST(test_metric, constructor) EXPECT_EQ(uint_metric.value(), 42U); } -// TEST(test_metric, float_assignment) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); +TEST(test_metric, float_assignment) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); -// abacus::optional_metric double_metric(data); -// EXPECT_TRUE(double_metric.is_initialized()); -// EXPECT_FALSE(double_metric.has_value()); -// double_metric = 1123.12; -// EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); + abacus::optional_metric double_metric(data); + EXPECT_TRUE(double_metric.is_initialized()); + EXPECT_FALSE(double_metric.has_value()); + double_metric = 1123.12; + EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); -// // Assignment -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / -0.0, ""); + // Assignment + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric = 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric = 1 / -0.0, ""); -// // Add and Assign -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric += 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric += 1 / -0.0, ""); + // Add and Assign + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric += 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric += 1 / -0.0, ""); -// // Subtract and Assign -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); -// } + // Subtract and Assign + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / 0.0, ""); + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +} From 69877b49042c0df34b90e4c529444a049838ce78 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 29 Jan 2025 09:28:08 +0100 Subject: [PATCH 47/68] work --- examples/metrics_simple.cpp | 4 +- src/abacus/boolean.hpp | 6 +++ src/abacus/enum8.hpp | 6 +++ src/abacus/float32.hpp | 6 +++ src/abacus/float64.hpp | 6 +++ src/abacus/int32.hpp | 6 +++ src/abacus/int64.hpp | 6 +++ src/abacus/metrics.cpp | 75 +++++++++++++++++++++---------------- src/abacus/metrics.hpp | 10 ++--- src/abacus/uint32.hpp | 6 +++ src/abacus/uint64.hpp | 6 +++ test/src/test_info.cpp | 30 ++++++--------- test/src/test_metric.cpp | 4 +- 13 files changed, 111 insertions(+), 60 deletions(-) diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index bf6a8a63..bcabb61a 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -40,11 +40,11 @@ int main() car.initialize_constant("wheels", 4); // The car still has some time before maintenance. - abacus::required_metric days_until_maintenance = + abacus::int64::required days_until_maintenance = car.initialize_required("days_until_maintenance", 10); // The car should be registered. - abacus::optional_metric registered = + abacus::boolean::optional registered = car.initialize_optional("registered"); // The registration is initialized, but not set. diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index efa7840d..c5c0e7fa 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -26,6 +26,12 @@ struct boolean /// The primitive type of the metric using type = bool; + /// Required boolean metric + using required = required_metric; + + /// Optional boolean metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index 4ad314ad..a1c20ccf 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -27,6 +27,12 @@ struct enum8 /// The primitive type of the metric using type = uint8_t; + /// Required enum8 metric + using required = required_metric; + + /// Optional enum8 metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 2296918c..d0fe07bb 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -26,6 +26,12 @@ struct float32 /// The primitive type of the metric using type = float; + /// Required float32 metric + using required = required_metric; + + /// Optional float32 metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index e1de0fa0..5330bc5c 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -24,6 +24,12 @@ struct float64 /// The primitive type of the metric using type = double; + /// Required float64 metric + using required = required_metric; + + /// Optional float64 metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 058e0d50..b08aeb92 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -24,6 +24,12 @@ struct int32 /// The primitive type of the metric using type = int32_t; + /// Required int32 metric + using required = required_metric; + + /// Optional int32 metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 170eebfa..95bbdbd7 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -24,6 +24,12 @@ struct int64 /// The primitive type of the metric using type = int64_t; + /// Required int64 metric + using required = required_metric; + + /// Optional int64 metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index b51509b0..5b464ac5 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -332,8 +332,8 @@ metrics::metrics(const std::map& info) } template -[[nodiscard]] auto -metrics::initialize_optional(const std::string& name) -> optional_metric +[[nodiscard]] auto metrics::initialize_optional(const std::string& name) -> + typename Metric::optional { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); @@ -349,26 +349,26 @@ metrics::initialize_optional(const std::string& name) -> optional_metric // Explicit instantiations for the expected types template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; -template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; + -> uint64::optional; +template auto +metrics::initialize_optional(const std::string& name) -> int64::optional; template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; -template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; + -> uint32::optional; +template auto +metrics::initialize_optional(const std::string& name) -> int32::optional; template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; + -> float64::optional; template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; + -> float32::optional; template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; -template auto metrics::initialize_optional(const std::string& name) - -> optional_metric; + -> boolean::optional; +template auto +metrics::initialize_optional(const std::string& name) -> enum8::optional; template [[nodiscard]] auto metrics::initialize_required(const std::string& name, - typename Metric::type value) - -> required_metric + typename Metric::type value) -> + typename Metric::required { assert(m_initialized.find(name) != m_initialized.end()); assert(!m_initialized.at(name)); @@ -384,22 +384,30 @@ template } // Explicit instantiations for the expected types -template auto metrics::initialize_required( - const std::string& name, uint64::type value) -> required_metric; -template auto metrics::initialize_required( - const std::string& name, int64::type value) -> required_metric; -template auto metrics::initialize_required( - const std::string& name, uint32::type value) -> required_metric; -template auto metrics::initialize_required( - const std::string& name, int32::type value) -> required_metric; -template auto metrics::initialize_required( - const std::string& name, float64::type value) -> required_metric; -template auto metrics::initialize_required( - const std::string& name, float32::type value) -> required_metric; -template auto metrics::initialize_required( - const std::string& name, boolean::type value) -> required_metric; -template auto metrics::initialize_required( - const std::string& name, enum8::type value) -> required_metric; +template auto +metrics::initialize_required(const std::string& name, + uint64::type value) -> uint64::required; +template auto +metrics::initialize_required(const std::string& name, + int64::type value) -> int64::required; +template auto +metrics::initialize_required(const std::string& name, + uint32::type value) -> uint32::required; +template auto +metrics::initialize_required(const std::string& name, + int32::type value) -> int32::required; +template auto +metrics::initialize_required(const std::string& name, + float64::type value) -> float64::required; +template auto +metrics::initialize_required(const std::string& name, + float32::type value) -> float32::required; +template auto +metrics::initialize_required(const std::string& name, + boolean::type value) -> boolean::required; +template auto +metrics::initialize_required(const std::string& name, + enum8::type value) -> enum8::required; template void metrics::initialize_constant(const std::string& name, @@ -411,9 +419,10 @@ void metrics::initialize_constant(const std::string& name, const protobuf::Metric& proto_metric = metadata().metrics().at(name); auto offset = proto_metric.offset(); - // assert(get_kind(proto_metric) == protobuf::Kind::CONSTANT); + assert(is_constant(proto_metric)); - required_metric(value_data(offset), value); + value_data(offset)[0] = 1; + Metric::set_value(value_data(offset), value); } // Explicit instantiations for the expected types diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index a994fe1f..b2fbbc98 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -48,16 +48,16 @@ class metrics /// @param value Optional initial value of the metric /// @return The metric object template - [[nodiscard]] auto - initialize_required(const std::string& name, - typename Metric::type value) -> required_metric; + [[nodiscard]] auto initialize_required(const std::string& name, + typename Metric::type value) -> + typename Metric::required; /// Initialize a metric /// @param name The name of the metric /// @return The metric object template - [[nodiscard]] auto - initialize_optional(const std::string& name) -> optional_metric; + [[nodiscard]] auto initialize_optional(const std::string& name) -> + typename Metric::optional; /// Initialize a constant metric /// @param name The name of the metric diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 5b26db3d..74e19001 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -24,6 +24,12 @@ struct uint32 /// The primitive type of the metric using type = uint32_t; + /// Required uint32 metric + using required = required_metric; + + /// Optional uint32 metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index f1eea7d6..d5a98c17 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -24,6 +24,12 @@ struct uint64 /// The primitive type of the metric using type = uint64_t; + /// Required uint64 metric + using required = required_metric; + + /// Optional uint64 metric + using optional = optional_metric; + /// Set the value of the metric /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(type) + 1 bytes long. diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index ab3547cb..f640b703 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -17,7 +17,7 @@ void integer_test() using type = typename T::type; { - using optional = abacus::optional_metric; + using optional = typename T::optional; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); optional o; @@ -38,7 +38,7 @@ void integer_test() EXPECT_FALSE(o.has_value()); } { - using required = abacus::required_metric; + using required = typename T::required; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); required r; @@ -69,7 +69,7 @@ void floating_point_test() using type = typename T::type; { - using optional = abacus::optional_metric; + using optional = typename T::optional; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); optional o; @@ -90,7 +90,7 @@ void floating_point_test() EXPECT_FALSE(o.has_value()); } { - using required = abacus::required_metric; + using required = typename T::required; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); required r; @@ -117,12 +117,11 @@ TEST(test_info, floating_point) TEST(test_info, boolean) { { - using optional = abacus::optional_metric; uint8_t data[sizeof(bool) + 1]; std::memset(data, 0, sizeof(data)); - optional o; + abacus::boolean::optional o; EXPECT_FALSE(o.is_initialized()); - o = optional(data); + o = abacus::boolean::optional(data); EXPECT_TRUE(o.is_initialized()); EXPECT_FALSE(o.has_value()); o = true; @@ -134,12 +133,11 @@ TEST(test_info, boolean) EXPECT_FALSE(o.has_value()); } { - using required = abacus::required_metric; uint8_t data[sizeof(bool) + 1]; std::memset(data, 0, sizeof(data)); - required r; + abacus::boolean::required r; EXPECT_FALSE(r.is_initialized()); - r = required(data, true); + r = abacus::boolean::required(data, true); EXPECT_TRUE(r.is_initialized()); EXPECT_EQ(r.value(), true); r = false; @@ -160,13 +158,11 @@ enum class test_enum TEST(test_info, enum8) { { - using optional = abacus::optional_metric; - uint8_t data[sizeof(uint8_t) + 1]; std::memset(data, 0, sizeof(data)); - optional o; + abacus::enum8::optional o; EXPECT_FALSE(o.is_initialized()); - o = optional(data); + o = abacus::enum8::optional(data); EXPECT_TRUE(o.is_initialized()); EXPECT_FALSE(o.has_value()); o = 10U; @@ -197,13 +193,11 @@ TEST(test_info, enum8) } { - using required = abacus::required_metric; - uint8_t data[sizeof(uint8_t) + 1]; std::memset(data, 0, sizeof(data)); - required r; + abacus::enum8::required r; EXPECT_FALSE(r.is_initialized()); - r = required(data, 10U); + r = abacus::enum8::required(data, 10U); EXPECT_TRUE(r.is_initialized()); EXPECT_EQ(r.value(), 10U); r = 20U; diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index 73122e2d..a6d04a78 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -15,7 +15,7 @@ TEST(test_metric, constructor) uint8_t data[9]; std::memset(data, 0, sizeof(data)); - abacus::optional_metric uint_metric(data); + abacus::uint64::optional uint_metric(data); EXPECT_TRUE(uint_metric.is_initialized()); EXPECT_FALSE(uint_metric.has_value()); @@ -29,7 +29,7 @@ TEST(test_metric, float_assignment) uint8_t data[9]; std::memset(data, 0, sizeof(data)); - abacus::optional_metric double_metric(data); + abacus::float64::optional double_metric(data); EXPECT_TRUE(double_metric.is_initialized()); EXPECT_FALSE(double_metric.has_value()); double_metric = 1123.12; From 8c6937a956081501335ffb3bc983e39afbdc4081 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 31 Jan 2025 14:07:36 +0100 Subject: [PATCH 48/68] work --- examples/metrics_simple.cpp | 7 +- protobuf/metrics.proto | 12 +- src/abacus/boolean.hpp | 2 +- src/abacus/detail/helpers.hpp | 2 + src/abacus/enum8.hpp | 2 +- src/abacus/float32.hpp | 2 +- src/abacus/float64.hpp | 2 +- src/abacus/info.hpp | 3 +- src/abacus/int32.hpp | 2 +- src/abacus/int64.hpp | 2 +- src/abacus/kind.hpp | 10 + src/abacus/metrics.cpp | 139 ++++++---- src/abacus/metrics.hpp | 7 - src/abacus/protobuf/metrics.pb.cc | 440 ++++++++++++++++++++++++++--- src/abacus/protobuf/metrics.pb.h | 446 +++++++++++++++++++++++++++++- src/abacus/string.hpp | 56 ++++ src/abacus/to_json.cpp | 16 ++ src/abacus/to_json.hpp | 11 + src/abacus/uint32.hpp | 2 +- src/abacus/uint64.hpp | 2 +- test/src/test_info.cpp | 11 + test/src/test_metrics.cpp | 57 ++-- test/src/test_to_json.cpp | 6 +- test/src/test_view.cpp | 4 +- 24 files changed, 1100 insertions(+), 143 deletions(-) create mode 100644 src/abacus/string.hpp diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index bcabb61a..8fa7ec8a 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -17,11 +17,11 @@ int main() std::map infos = { {abacus::name{"fuel_consumption"}, abacus::float64{ - abacus::constant{}, + abacus::constant{22.3}, abacus::description{"Fuel consumption in kilometers per liter"}, abacus::unit{"km/l"}}}, {abacus::name{"wheels"}, - abacus::uint64{abacus::constant{}, + abacus::uint64{abacus::constant{4UL}, abacus::description{"Wheels on the car"}, abacus::unit{"wheels"}}}, {abacus::name{"days_until_maintenance"}, @@ -36,9 +36,6 @@ int main() abacus::metrics car(infos); - car.initialize_constant("fuel_consumption", 22.3); - car.initialize_constant("wheels", 4); - // The car still has some time before maintenance. abacus::int64::required days_until_maintenance = car.initialize_required("days_until_maintenance", 10); diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 67a6a4f5..1411b4df 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -26,7 +26,6 @@ message Counter{ message Constant{ } - // Metadata for unsigned 64-bit metrics message UInt64Metric { string description = 1; // Metric description @@ -138,6 +137,16 @@ message Enum8Metric { map values = 5; // Mapping from packed index to enum info } +// Metadata for a string metric +message StringMetric { + string description = 1; // Metric description + // The kind of metric + oneof kind { + Constant constant = 2; // Constant metric + } +} + +// Metadata for a single metric message Metric { uint32 offset = 1; // Offset into packed memory for the value @@ -150,6 +159,7 @@ message Metric Float32Metric float32 = 8; // Metadata for 32-bit floating-point metrics BoolMetric boolean = 9; // Metadata for boolean metrics Enum8Metric enum8 = 10; // Metadata for enumerated metrics + StringMetric string = 11; // Metadata for a string metric } } diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index c5c0e7fa..df08c7a0 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -55,7 +55,7 @@ struct boolean } /// The kind of the metric - std::variant kind; + std::variant> kind; /// The description of the metric abacus::description description; diff --git a/src/abacus/detail/helpers.hpp b/src/abacus/detail/helpers.hpp index 98bcfb33..f088d336 100644 --- a/src/abacus/detail/helpers.hpp +++ b/src/abacus/detail/helpers.hpp @@ -142,6 +142,8 @@ static inline auto call_type(const protobuf::Metric& metric, const Func& func) return func(metric.boolean()); case protobuf::Metric::kEnum8: return func(metric.enum8()); + case protobuf::Metric::kString: + return func(metric.string()); default: // This should never be reached assert(false); diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index a1c20ccf..d27fcc67 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -94,7 +94,7 @@ struct enum8 }; /// The metric kind - std::variant kind; + std::variant> kind; /// The metric description abacus::description description; diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index d0fe07bb..6ef93624 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -60,7 +60,7 @@ struct float32 } /// The metric kind - std::variant kind; + std::variant> kind; /// The metric description abacus::description description; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index 5330bc5c..3b3c45c3 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -58,7 +58,7 @@ struct float64 } /// The metric kind - std::variant kind; + std::variant> kind; /// The metric description abacus::description description; diff --git a/src/abacus/info.hpp b/src/abacus/info.hpp index dbf5c6d4..320d3d87 100644 --- a/src/abacus/info.hpp +++ b/src/abacus/info.hpp @@ -13,6 +13,7 @@ #include "float64.hpp" #include "int32.hpp" #include "int64.hpp" +#include "string.hpp" #include "uint32.hpp" #include "uint64.hpp" namespace abacus @@ -21,6 +22,6 @@ inline namespace STEINWURF_ABACUS_VERSION { /// A variant for all the supported metrics using info = std::variant; + boolean, enum8, string>; } } diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index b08aeb92..0a01e508 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -54,7 +54,7 @@ struct int32 } /// The metric kind - std::variant kind; + std::variant> kind; /// The metric description abacus::description description; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 95bbdbd7..faab4253 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -54,7 +54,7 @@ struct int64 } /// The metric kind - std::variant kind; + std::variant> kind; /// The metric description abacus::description description; diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index bcf5d71b..927995dc 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -25,8 +25,18 @@ struct counter }; /// Tag type representing a constant kind. +template struct constant { + T value; }; + +// Enable class template argument deduction (CTAD) +template +constant(T) -> constant; + +// Special deduction guide for string literals to deduce std::string +constant(const char*) -> constant; + } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 5b464ac5..45fb0a31 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -67,7 +67,7 @@ static inline bool is_constant(const protobuf::Metric& metric) }); } -template +template static inline auto set_kind(Protobuf& protobuf, const Kind& kind) { // Check if the Protobuf message has a function called mutable_gauge @@ -94,9 +94,9 @@ static inline auto set_kind(Protobuf& protobuf, const Kind& kind) } if constexpr (detail::has_mutable_constant_v && - detail::is_in_variant_v) + detail::is_in_variant_v, Kind>) { - if (auto* c = std::get_if(&kind)) + if (auto* c = std::get_if>(&kind)) { protobuf.mutable_constant(); return; @@ -129,6 +129,8 @@ metrics::metrics(const std::map& info) // The first byte is reserved for the sync value m_value_bytes = sizeof(uint32_t); + std::vector constants; + for (auto [name, value] : info) { protobuf::Metric metric; @@ -144,7 +146,7 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.mutable_uint64()->set_description(m->description.value); - set_kind(*metric.mutable_uint64(), m->kind); + set_kind(*metric.mutable_uint64(), m->kind); if (!m->unit.empty()) { @@ -158,6 +160,11 @@ metrics::metrics(const std::map& info) { metric.mutable_uint64()->set_max(m->max.value.value()); } + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } else if (auto* m = std::get_if(&value)) { @@ -165,7 +172,7 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.mutable_int64()->set_description(m->description.value); - set_kind(*metric.mutable_int64(), m->kind); + set_kind(*metric.mutable_int64(), m->kind); if (!m->unit.empty()) { @@ -179,6 +186,11 @@ metrics::metrics(const std::map& info) { metric.mutable_int64()->set_max(m->max.value.value()); } + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } else if (auto* m = std::get_if(&value)) { @@ -186,7 +198,7 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.mutable_uint32()->set_description(m->description.value); - set_kind(*metric.mutable_uint32(), m->kind); + set_kind(*metric.mutable_uint32(), m->kind); if (!m->unit.empty()) { @@ -200,6 +212,11 @@ metrics::metrics(const std::map& info) { metric.mutable_uint32()->set_max(m->max.value.value()); } + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } else if (auto* m = std::get_if(&value)) { @@ -207,7 +224,7 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.mutable_int32()->set_description(m->description.value); - set_kind(*metric.mutable_int32(), m->kind); + set_kind(*metric.mutable_int32(), m->kind); if (!m->unit.empty()) { @@ -221,6 +238,11 @@ metrics::metrics(const std::map& info) { metric.mutable_int32()->set_max(m->max.value.value()); } + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } else if (auto* m = std::get_if(&value)) { @@ -229,7 +251,7 @@ metrics::metrics(const std::map& info) metric.mutable_float64()->set_description(m->description.value); - set_kind(*metric.mutable_float64(), m->kind); + set_kind(*metric.mutable_float64(), m->kind); if (!m->unit.empty()) { @@ -243,6 +265,11 @@ metrics::metrics(const std::map& info) { metric.mutable_float64()->set_max(m->max.value.value()); } + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } else if (auto* m = std::get_if(&value)) { @@ -251,7 +278,7 @@ metrics::metrics(const std::map& info) metric.mutable_float32()->set_description(m->description.value); - set_kind(*metric.mutable_float32(), m->kind); + set_kind(*metric.mutable_float32(), m->kind); if (!m->unit.empty()) { @@ -265,6 +292,11 @@ metrics::metrics(const std::map& info) { metric.mutable_float32()->set_max(m->max.value.value()); } + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } else if (auto* m = std::get_if(&value)) { @@ -272,7 +304,12 @@ metrics::metrics(const std::map& info) m_value_bytes += detail::size_of_type(); metric.mutable_boolean()->set_description(m->description.value); - set_kind(*metric.mutable_boolean(), m->kind); + set_kind(*metric.mutable_boolean(), m->kind); + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } else if (auto* m = std::get_if(&value)) { @@ -281,7 +318,7 @@ metrics::metrics(const std::map& info) metric.mutable_enum8()->set_description(m->description.value); - set_kind(*metric.mutable_enum8(), m->kind); + set_kind(*metric.mutable_enum8(), m->kind); for (auto [key, value] : m->values) { @@ -295,6 +332,29 @@ metrics::metrics(const std::map& info) metric.mutable_enum8()->mutable_values()->insert( {key, enum_value}); } + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } + } + else if (auto* m = std::get_if(&value)) + { + // The offset is incremented by the size of the type + + metric.mutable_string()->set_description(m->description.value); + set_kind(*metric.mutable_string(), m->kind); + + // The string metric is known to always be constant + auto value = std::get>(m->kind).value; + m_value_bytes += value.size(); + // The string is stored as a null-terminated string + m_value_bytes += 1; + + if (std::holds_alternative>(m->kind)) + { + constants.push_back(name); + } } m_metadata.mutable_metrics()->insert({name.value, metric}); @@ -329,6 +389,25 @@ metrics::metrics(const std::map& info) // can use the endianness field in the metadata to read the sync // value std::memcpy(value_data(0), &m_hash, sizeof(uint32_t)); + + // Initialize constants + for (auto name : constants) + { + auto& metric = info.at(name); + std::visit( + [this, &name](auto&& metric) + { + using Metric = std::decay_t; + auto value = + std::get>(metric.kind) + .value; + m_initialized[name.value] = true; + auto offset = metadata().metrics().at(name.value).offset(); + value_data(offset)[0] = 1; + Metric::set_value(value_data(offset), value); + }, + metric); + } } template @@ -340,7 +419,7 @@ template m_initialized[name] = true; const protobuf::Metric& proto_metric = metadata().metrics().at(name); assert(is_optional(proto_metric)); - // assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); + assert(!is_constant(proto_metric)); auto offset = proto_metric.offset(); @@ -375,7 +454,7 @@ template m_initialized[name] = true; const protobuf::Metric& proto_metric = metadata().metrics().at(name); assert(!is_optional(proto_metric)); - // assert(get_kind(proto_metric) != protobuf::Kind::CONSTANT); + assert(!is_constant(proto_metric)); auto offset = proto_metric.offset(); @@ -409,40 +488,6 @@ template auto metrics::initialize_required(const std::string& name, enum8::type value) -> enum8::required; -template -void metrics::initialize_constant(const std::string& name, - typename Metric::type value) -{ - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - - const protobuf::Metric& proto_metric = metadata().metrics().at(name); - auto offset = proto_metric.offset(); - assert(is_constant(proto_metric)); - - value_data(offset)[0] = 1; - Metric::set_value(value_data(offset), value); -} - -// Explicit instantiations for the expected types -template void metrics::initialize_constant(const std::string& name, - uint64::type value); -template void metrics::initialize_constant(const std::string& name, - int64::type value); -template void metrics::initialize_constant(const std::string& name, - uint32::type value); -template void metrics::initialize_constant(const std::string& name, - int32::type value); -template void metrics::initialize_constant(const std::string& name, - float64::type value); -template void metrics::initialize_constant(const std::string& name, - float32::type value); -template void metrics::initialize_constant(const std::string& name, - boolean::type value); -template void metrics::initialize_constant(const std::string& name, - enum8::type value); - metrics::~metrics() { } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index b2fbbc98..d163a769 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -59,13 +59,6 @@ class metrics [[nodiscard]] auto initialize_optional(const std::string& name) -> typename Metric::optional; - /// Initialize a constant metric - /// @param name The name of the metric - /// @param value The value of the metric - template - void initialize_constant(const std::string& name, - typename Metric::type value); - /// Check if a metric has been initialized /// @param name The name of the metric /// @return true if the metric has been initialized diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index e520a859..88e516a1 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -324,6 +324,27 @@ struct Enum8MetricDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Enum8MetricDefaultTypeInternal _Enum8Metric_default_instance_; template +PROTOBUF_CONSTEXPR StringMetric::StringMetric(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.description_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.kind_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, + } {} +struct StringMetricDefaultTypeInternal { + PROTOBUF_CONSTEXPR StringMetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~StringMetricDefaultTypeInternal() {} + union { + StringMetric _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StringMetricDefaultTypeInternal _StringMetric_default_instance_; + template PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_.offset_)*/ 0u, @@ -374,7 +395,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; } // namespace protobuf } // namespace abacus -static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[16]; +static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[17]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; @@ -605,6 +626,17 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT 0, ~0u, ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.description_), + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.kind_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _internal_metadata_), ~0u, // no _extensions_ PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._oneof_case_[0]), @@ -621,6 +653,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.type_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, _has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse, _internal_metadata_), @@ -663,9 +696,10 @@ static const ::_pbi::MigrationSchema {181, 191, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, {193, 203, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, {205, 219, -1, sizeof(::abacus::protobuf::Enum8Metric)}, - {224, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {242, 252, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {254, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {224, -1, -1, sizeof(::abacus::protobuf::StringMetric)}, + {235, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {254, 264, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {266, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -682,6 +716,7 @@ static const ::_pb::Message* const file_default_instances[] = { &::abacus::protobuf::_Enum8Metric_EnumValue_default_instance_._instance, &::abacus::protobuf::_Enum8Metric_ValuesEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_Enum8Metric_default_instance_._instance, + &::abacus::protobuf::_StringMetric_default_instance_._instance, &::abacus::protobuf::_Metric_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_MetricsEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_default_instance_._instance, @@ -742,37 +777,41 @@ const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTO "H\000\210\001\001B\016\n\014_description\032U\n\013ValuesEntry\022\013\n\003" "key\030\001 \001(\r\0225\n\005value\030\002 \001(\0132&.abacus.protob" "uf.Enum8Metric.EnumValue:\0028\001B\006\n\004kindB\007\n\005" - "_unit\"\245\003\n\006Metric\022\016\n\006offset\030\001 \001(\r\022/\n\006uint" - "64\030\003 \001(\0132\035.abacus.protobuf.UInt64MetricH" - "\000\022-\n\005int64\030\004 \001(\0132\034.abacus.protobuf.Int64" - "MetricH\000\022/\n\006uint32\030\005 \001(\0132\035.abacus.protob" - "uf.UInt32MetricH\000\022-\n\005int32\030\006 \001(\0132\034.abacu" - "s.protobuf.Int32MetricH\000\0221\n\007float64\030\007 \001(" - "\0132\036.abacus.protobuf.Float64MetricH\000\0221\n\007f" - "loat32\030\010 \001(\0132\036.abacus.protobuf.Float32Me" - "tricH\000\022.\n\007boolean\030\t \001(\0132\033.abacus.protobu" - "f.BoolMetricH\000\022-\n\005enum8\030\n \001(\0132\034.abacus.p" - "rotobuf.Enum8MetricH\000B\006\n\004type\"\371\001\n\017Metric" - "sMetadata\022\030\n\020protocol_version\030\001 \001(\r\022/\n\ne" - "ndianness\030\002 \001(\0162\033.abacus.protobuf.Endian" - "ness\022\022\n\nsync_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(" - "\0132-.abacus.protobuf.MetricsMetadata.Metr" - "icsEntry\032G\n\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n" - "\005value\030\002 \001(\0132\027.abacus.protobuf.Metric:\0028" - "\001*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017" - "abacus/protobufb\006proto3" + "_unit\"Z\n\014StringMetric\022\023\n\013description\030\001 \001" + "(\t\022-\n\010constant\030\002 \001(\0132\031.abacus.protobuf.C" + "onstantH\000B\006\n\004kind\"\326\003\n\006Metric\022\016\n\006offset\030\001" + " \001(\r\022/\n\006uint64\030\003 \001(\0132\035.abacus.protobuf.U" + "Int64MetricH\000\022-\n\005int64\030\004 \001(\0132\034.abacus.pr" + "otobuf.Int64MetricH\000\022/\n\006uint32\030\005 \001(\0132\035.a" + "bacus.protobuf.UInt32MetricH\000\022-\n\005int32\030\006" + " \001(\0132\034.abacus.protobuf.Int32MetricH\000\0221\n\007" + "float64\030\007 \001(\0132\036.abacus.protobuf.Float64M" + "etricH\000\0221\n\007float32\030\010 \001(\0132\036.abacus.protob" + "uf.Float32MetricH\000\022.\n\007boolean\030\t \001(\0132\033.ab" + "acus.protobuf.BoolMetricH\000\022-\n\005enum8\030\n \001(" + "\0132\034.abacus.protobuf.Enum8MetricH\000\022/\n\006str" + "ing\030\013 \001(\0132\035.abacus.protobuf.StringMetric" + "H\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030\n\020protoc" + "ol_version\030\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.a" + "bacus.protobuf.Endianness\022\022\n\nsync_value\030" + "\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus.protobuf" + ".MetricsMetadata.MetricsEntry\032G\n\014Metrics" + "Entry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abac" + "us.protobuf.Metric:\0028\001*!\n\nEndianness\022\n\n\006" + "LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/protobufb\006pr" + "oto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2943, + 3084, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, nullptr, 0, - 16, + 17, schemas, file_default_instances, TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets, @@ -5408,6 +5447,289 @@ ::google::protobuf::Metadata Enum8Metric::GetMetadata() const { } // =================================================================== +class StringMetric::_Internal { + public: + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_._oneof_case_); + static const ::abacus::protobuf::Constant& constant(const StringMetric* msg); +}; + +const ::abacus::protobuf::Constant& StringMetric::_Internal::constant(const StringMetric* msg) { + return *msg->_impl_.kind_.constant_; +} +void StringMetric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_kind(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.StringMetric.constant) +} +StringMetric::StringMetric(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.StringMetric) +} +StringMetric::StringMetric(const StringMetric& from) : ::google::protobuf::Message() { + StringMetric* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.description_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _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()); + } + clear_has_kind(); + switch (from.kind_case()) { + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.StringMetric) +} +inline void StringMetric::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.description_){}, + decltype(_impl_.kind_){}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_._oneof_case_)*/ {}, + }; + _impl_.description_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.description_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_kind(); +} +StringMetric::~StringMetric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.StringMetric) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void StringMetric::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); + if (has_kind()) { + clear_kind(); + } +} +void StringMetric::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void StringMetric::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.StringMetric) + switch (kind_case()) { + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = KIND_NOT_SET; +} + + +PROTOBUF_NOINLINE void StringMetric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.StringMetric) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.description_.ClearToEmpty(); + clear_kind(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* StringMetric::_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, 2, 1, 48, 2> StringMetric::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 2, 0, // 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), + &_StringMetric_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // string description = 1; + {::_pbi::TcParser::FastUS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.description_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string description = 1; + {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.description_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .abacus.protobuf.Constant constant = 2; + {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + }}, {{ + {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, + }}, {{ + "\34\13\0\0\0\0\0\0" + "abacus.protobuf.StringMetric" + "description" + }}, +}; + +::uint8_t* StringMetric::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.StringMetric) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // string description = 1; + 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, "abacus.protobuf.StringMetric.description"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // .abacus.protobuf.Constant constant = 2; + if (kind_case() == kConstant) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::constant(this), + _Internal::constant(this).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:abacus.protobuf.StringMetric) + return target; +} + +::size_t StringMetric::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.StringMetric) + ::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 description = 1; + if (!this->_internal_description().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_description()); + } + + switch (kind_case()) { + // .abacus.protobuf.Constant constant = 2; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.kind_.constant_); + break; + } + case KIND_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData StringMetric::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + StringMetric::MergeImpl +}; +const ::google::protobuf::Message::ClassData*StringMetric::GetClassData() const { return &_class_data_; } + + +void StringMetric::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:abacus.protobuf.StringMetric) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_description().empty()) { + _this->_internal_set_description(from._internal_description()); + } + switch (from.kind_case()) { + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } + case KIND_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void StringMetric::CopyFrom(const StringMetric& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.StringMetric) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool StringMetric::IsInitialized() const { + return true; +} + +void StringMetric::InternalSwap(StringMetric* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, + &other->_impl_.description_, rhs_arena); + swap(_impl_.kind_, other->_impl_.kind_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::google::protobuf::Metadata StringMetric::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); +} +// =================================================================== + class Metric::_Internal { public: static constexpr ::int32_t kOneofCaseOffset = @@ -5420,6 +5742,7 @@ class Metric::_Internal { static const ::abacus::protobuf::Float32Metric& float32(const Metric* msg); static const ::abacus::protobuf::BoolMetric& boolean(const Metric* msg); static const ::abacus::protobuf::Enum8Metric& enum8(const Metric* msg); + static const ::abacus::protobuf::StringMetric& string(const Metric* msg); }; const ::abacus::protobuf::UInt64Metric& Metric::_Internal::uint64(const Metric* msg) { @@ -5446,6 +5769,9 @@ const ::abacus::protobuf::BoolMetric& Metric::_Internal::boolean(const Metric* m const ::abacus::protobuf::Enum8Metric& Metric::_Internal::enum8(const Metric* msg) { return *msg->_impl_.type_.enum8_; } +const ::abacus::protobuf::StringMetric& Metric::_Internal::string(const Metric* msg) { + return *msg->_impl_.type_.string_; +} void Metric::set_allocated_uint64(::abacus::protobuf::UInt64Metric* uint64) { ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); clear_type(); @@ -5566,6 +5892,21 @@ void Metric::set_allocated_enum8(::abacus::protobuf::Enum8Metric* enum8) { } // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.enum8) } +void Metric::set_allocated_string(::abacus::protobuf::StringMetric* string) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (string) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(string); + if (message_arena != submessage_arena) { + string = ::google::protobuf::internal::GetOwnedMessage( + message_arena, string, submessage_arena); + } + set_has_string(); + _impl_.type_.string_ = string; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.string) +} Metric::Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -5625,6 +5966,11 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { from._internal_enum8()); break; } + case kString: { + _this->_internal_mutable_string()->::abacus::protobuf::StringMetric::MergeFrom( + from._internal_string()); + break; + } case TYPE_NOT_SET: { break; } @@ -5708,6 +6054,12 @@ void Metric::clear_type() { } break; } + case kString: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.string_; + } + break; + } case TYPE_NOT_SET: { break; } @@ -5735,16 +6087,16 @@ const char* Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 9, 8, 0, 2> Metric::_table_ = { +const ::_pbi::TcParseTable<0, 10, 9, 0, 2> Metric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 10, 0, // max_field_number, fast_idx_mask + 11, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294966274, // skipmap + 4294965250, // skipmap offsetof(decltype(_table_), field_entries), - 9, // num_field_entries - 8, // num_aux_entries + 10, // num_field_entries + 9, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback @@ -5782,6 +6134,9 @@ const ::_pbi::TcParseTable<0, 9, 8, 0, 2> Metric::_table_ = { // .abacus.protobuf.Enum8Metric enum8 = 10; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.enum8_), _Internal::kOneofCaseOffset + 0, 7, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .abacus.protobuf.StringMetric string = 11; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.string_), _Internal::kOneofCaseOffset + 0, 8, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt64Metric>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::Int64Metric>()}, @@ -5791,6 +6146,7 @@ const ::_pbi::TcParseTable<0, 9, 8, 0, 2> Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Float32Metric>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::BoolMetric>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::Enum8Metric>()}, + {::_pbi::TcParser::GetTable<::abacus::protobuf::StringMetric>()}, }}, {{ }}, }; @@ -5858,6 +6214,12 @@ ::uint8_t* Metric::_InternalSerialize( _Internal::enum8(this).GetCachedSize(), target, stream); break; } + case kString: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(11, _Internal::string(this), + _Internal::string(this).GetCachedSize(), target, stream); + break; + } default: break; } @@ -5941,6 +6303,13 @@ ::size_t Metric::ByteSizeLong() const { *_impl_.type_.enum8_); break; } + // .abacus.protobuf.StringMetric string = 11; + case kString: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.string_); + break; + } case TYPE_NOT_SET: { break; } @@ -6007,6 +6376,11 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot from._internal_enum8()); break; } + case kString: { + _this->_internal_mutable_string()->::abacus::protobuf::StringMetric::MergeFrom( + from._internal_string()); + break; + } case TYPE_NOT_SET: { break; } @@ -6036,7 +6410,7 @@ void Metric::InternalSwap(Metric* other) { ::google::protobuf::Metadata Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]); } // =================================================================== @@ -6049,7 +6423,7 @@ void MetricsMetadata_MetricsEntry_DoNotUse::MergeFrom(const MetricsMetadata_Metr ::google::protobuf::Metadata MetricsMetadata_MetricsEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[15]); } // =================================================================== @@ -6323,7 +6697,7 @@ void MetricsMetadata::InternalSwap(MetricsMetadata* other) { ::google::protobuf::Metadata MetricsMetadata::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[15]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[16]); } // @@protoc_insertion_point(namespace_scope) } // namespace protobuf diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 9f84242d..ebf77f31 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -102,6 +102,9 @@ extern MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; class MetricsMetadata_MetricsEntry_DoNotUse; struct MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal; extern MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal _MetricsMetadata_MetricsEntry_DoNotUse_default_instance_; +class StringMetric; +struct StringMetricDefaultTypeInternal; +extern StringMetricDefaultTypeInternal _StringMetric_default_instance_; class UInt32Metric; struct UInt32MetricDefaultTypeInternal; extern UInt32MetricDefaultTypeInternal _UInt32Metric_default_instance_; @@ -3080,6 +3083,208 @@ class Enum8Metric final : friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- +class StringMetric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.StringMetric) */ { + public: + inline StringMetric() : StringMetric(nullptr) {} + ~StringMetric() override; + template + explicit PROTOBUF_CONSTEXPR StringMetric(::google::protobuf::internal::ConstantInitialized); + + StringMetric(const StringMetric& from); + StringMetric(StringMetric&& from) noexcept + : StringMetric() { + *this = ::std::move(from); + } + + inline StringMetric& operator=(const StringMetric& from) { + CopyFrom(from); + return *this; + } + inline StringMetric& operator=(StringMetric&& 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 StringMetric& default_instance() { + return *internal_default_instance(); + } + enum KindCase { + kConstant = 2, + KIND_NOT_SET = 0, + }; + + static inline const StringMetric* internal_default_instance() { + return reinterpret_cast( + &_StringMetric_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + friend void swap(StringMetric& a, StringMetric& b) { + a.Swap(&b); + } + inline void Swap(StringMetric* 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(StringMetric* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + StringMetric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const StringMetric& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const StringMetric& from) { + StringMetric::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(StringMetric* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "abacus.protobuf.StringMetric"; + } + protected: + explicit StringMetric(::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 { + kDescriptionFieldNumber = 1, + kConstantFieldNumber = 2, + }; + // string description = 1; + 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: + // .abacus.protobuf.Constant constant = 2; + bool has_constant() const; + private: + bool _internal_has_constant() const; + + public: + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + + private: + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); + + public: + void clear_kind(); + KindCase kind_case() const; + // @@protoc_insertion_point(class_scope:abacus.protobuf.StringMetric) + private: + class _Internal; + void set_has_constant(); + + inline bool has_kind() const; + inline void clear_has_kind(); + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 2, 1, 48, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr description_; + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Constant* constant_; + } kind_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t _oneof_case_[1]; + + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +};// ------------------------------------------------------------------- + class Metric final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Metric) */ { public: @@ -3140,6 +3345,7 @@ class Metric final : kFloat32 = 8, kBoolean = 9, kEnum8 = 10, + kString = 11, TYPE_NOT_SET = 0, }; @@ -3148,7 +3354,7 @@ class Metric final : &_Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 14; friend void swap(Metric& a, Metric& b) { a.Swap(&b); @@ -3229,6 +3435,7 @@ class Metric final : kFloat32FieldNumber = 8, kBooleanFieldNumber = 9, kEnum8FieldNumber = 10, + kStringFieldNumber = 11, }; // uint32 offset = 1; void clear_offset() ; @@ -3391,6 +3598,25 @@ class Metric final : const ::abacus::protobuf::Enum8Metric& _internal_enum8() const; ::abacus::protobuf::Enum8Metric* _internal_mutable_enum8(); + public: + // .abacus.protobuf.StringMetric string = 11; + bool has_string() const; + private: + bool _internal_has_string() const; + + public: + void clear_string() ; + const ::abacus::protobuf::StringMetric& string() const; + PROTOBUF_NODISCARD ::abacus::protobuf::StringMetric* release_string(); + ::abacus::protobuf::StringMetric* mutable_string(); + void set_allocated_string(::abacus::protobuf::StringMetric* value); + void unsafe_arena_set_allocated_string(::abacus::protobuf::StringMetric* value); + ::abacus::protobuf::StringMetric* unsafe_arena_release_string(); + + private: + const ::abacus::protobuf::StringMetric& _internal_string() const; + ::abacus::protobuf::StringMetric* _internal_mutable_string(); + public: void clear_type(); TypeCase type_case() const; @@ -3405,12 +3631,13 @@ class Metric final : void set_has_float32(); void set_has_boolean(); void set_has_enum8(); + void set_has_string(); inline bool has_type() const; inline void clear_has_type(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 9, 8, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<0, 10, 9, 0, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -3427,6 +3654,7 @@ class Metric final : ::abacus::protobuf::Float32Metric* float32_; ::abacus::protobuf::BoolMetric* boolean_; ::abacus::protobuf::Enum8Metric* enum8_; + ::abacus::protobuf::StringMetric* string_; } type_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::uint32_t _oneof_case_[1]; @@ -3519,7 +3747,7 @@ class MetricsMetadata final : &_MetricsMetadata_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 16; friend void swap(MetricsMetadata& a, MetricsMetadata& b) { a.Swap(&b); @@ -6905,6 +7133,144 @@ inline Enum8Metric::KindCase Enum8Metric::kind_case() const { } // ------------------------------------------------------------------- +// StringMetric + +// string description = 1; +inline void StringMetric::clear_description() { + _impl_.description_.ClearToEmpty(); +} +inline const std::string& StringMetric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.StringMetric.description) + return _internal_description(); +} +template +inline PROTOBUF_ALWAYS_INLINE void StringMetric::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:abacus.protobuf.StringMetric.description) +} +inline std::string* StringMetric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.StringMetric.description) + return _s; +} +inline const std::string& StringMetric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); +} +inline void StringMetric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); +} +inline std::string* StringMetric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); +} +inline std::string* StringMetric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.StringMetric.description) + return _impl_.description_.Release(); +} +inline void StringMetric::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:abacus.protobuf.StringMetric.description) +} + +// .abacus.protobuf.Constant constant = 2; +inline bool StringMetric::has_constant() const { + return kind_case() == kConstant; +} +inline bool StringMetric::_internal_has_constant() const { + return kind_case() == kConstant; +} +inline void StringMetric::set_has_constant() { + _impl_._oneof_case_[0] = kConstant; +} +inline void StringMetric::clear_constant() { + if (kind_case() == kConstant) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.kind_.constant_; + } + clear_has_kind(); + } +} +inline ::abacus::protobuf::Constant* StringMetric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.StringMetric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::Constant& StringMetric::_internal_constant() const { + return kind_case() == kConstant + ? *_impl_.kind_.constant_ + : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +} +inline const ::abacus::protobuf::Constant& StringMetric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.StringMetric.constant) + return _internal_constant(); +} +inline ::abacus::protobuf::Constant* StringMetric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.StringMetric.constant) + if (kind_case() == kConstant) { + clear_has_kind(); + ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; + _impl_.kind_.constant_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void StringMetric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_kind(); + if (constant) { + set_has_constant(); + _impl_.kind_.constant_ = constant; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.StringMetric.constant) +} +inline ::abacus::protobuf::Constant* StringMetric::_internal_mutable_constant() { + if (kind_case() != kConstant) { + clear_kind(); + set_has_constant(); + _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + } + return _impl_.kind_.constant_; +} +inline ::abacus::protobuf::Constant* StringMetric::mutable_constant() { + ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.StringMetric.constant) + return _msg; +} + +inline bool StringMetric::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void StringMetric::clear_has_kind() { + _impl_._oneof_case_[0] = KIND_NOT_SET; +} +inline StringMetric::KindCase StringMetric::kind_case() const { + return StringMetric::KindCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + // Metric // uint32 offset = 1; @@ -7521,6 +7887,80 @@ inline ::abacus::protobuf::Enum8Metric* Metric::mutable_enum8() { return _msg; } +// .abacus.protobuf.StringMetric string = 11; +inline bool Metric::has_string() const { + return type_case() == kString; +} +inline bool Metric::_internal_has_string() const { + return type_case() == kString; +} +inline void Metric::set_has_string() { + _impl_._oneof_case_[0] = kString; +} +inline void Metric::clear_string() { + if (type_case() == kString) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.string_; + } + clear_has_type(); + } +} +inline ::abacus::protobuf::StringMetric* Metric::release_string() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.string) + if (type_case() == kString) { + clear_has_type(); + ::abacus::protobuf::StringMetric* temp = _impl_.type_.string_; + if (GetArenaForAllocation() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.type_.string_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::abacus::protobuf::StringMetric& Metric::_internal_string() const { + return type_case() == kString + ? *_impl_.type_.string_ + : reinterpret_cast<::abacus::protobuf::StringMetric&>(::abacus::protobuf::_StringMetric_default_instance_); +} +inline const ::abacus::protobuf::StringMetric& Metric::string() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.string) + return _internal_string(); +} +inline ::abacus::protobuf::StringMetric* Metric::unsafe_arena_release_string() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.string) + if (type_case() == kString) { + clear_has_type(); + ::abacus::protobuf::StringMetric* temp = _impl_.type_.string_; + _impl_.type_.string_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Metric::unsafe_arena_set_allocated_string(::abacus::protobuf::StringMetric* string) { + clear_type(); + if (string) { + set_has_string(); + _impl_.type_.string_ = string; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.string) +} +inline ::abacus::protobuf::StringMetric* Metric::_internal_mutable_string() { + if (type_case() != kString) { + clear_type(); + set_has_string(); + _impl_.type_.string_ = CreateMaybeMessage< ::abacus::protobuf::StringMetric >(GetArenaForAllocation()); + } + return _impl_.type_.string_; +} +inline ::abacus::protobuf::StringMetric* Metric::mutable_string() { + ::abacus::protobuf::StringMetric* _msg = _internal_mutable_string(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.string) + return _msg; +} + inline bool Metric::has_type() const { return type_case() != TYPE_NOT_SET; } diff --git a/src/abacus/string.hpp b/src/abacus/string.hpp new file mode 100644 index 00000000..5173a22b --- /dev/null +++ b/src/abacus/string.hpp @@ -0,0 +1,56 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "availability.hpp" +#include "description.hpp" +#include "kind.hpp" +#include "max.hpp" +#include "min.hpp" +#include "optional_metric.hpp" +#include "required_metric.hpp" +#include "unit.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +/// A 32-bit integer metric +struct string +{ + /// The primitive type of the metric + using type = std::string_view; + + /// Set the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @param value The value to set + static inline auto set_value(uint8_t* memory, type value) -> void + { + assert(memory != nullptr); + std::memcpy(memory + 1, value.data(), value.size()); + } + + /// Get the value of the metric + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(type) + 1 bytes long. + /// @return The value of the metric + static inline auto value(const uint8_t* memory) -> type + { + assert(memory != nullptr); + assert(memory[0] == 1); + + return std::string_view(reinterpret_cast(memory + 1)); + } + + /// The metric kind + std::variant> kind; + + /// The metric description + abacus::description description; +}; +} +} diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index 3b45d996..464448bf 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -6,6 +6,7 @@ #include #include "detail/to_json.hpp" +#include "parse.hpp" #include "protobuf/metrics.pb.h" #include "to_json.hpp" @@ -14,6 +15,21 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { +auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, + const uint8_t* value_data, std::size_t value_bytes, + bool minimal) -> std::string +{ + view v; + if (v.set_metadata(parse::metadata(metadata_data, metadata_bytes))) + { + if (v.set_value_data(value_data, value_bytes)) + { + return to_json(v, minimal); + } + } + return ""; +} + auto to_json(const protobuf::MetricsMetadata& metadata, const uint8_t* value_data, std::size_t value_bytes, bool minimal) -> std::string diff --git a/src/abacus/to_json.hpp b/src/abacus/to_json.hpp index d9115963..342905b6 100644 --- a/src/abacus/to_json.hpp +++ b/src/abacus/to_json.hpp @@ -14,6 +14,17 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +/// @return a JSON-formatted string of a metrics views data. +/// @param metadata_data The metadata data of the metrics. +/// @param metadata_bytes The size of the metadata data. +/// @param value_data The value data of the metrics. +/// @param value_bytes The size of the value data. +/// @param minimal If true, the JSON will be slimmed down to only contain the +/// the value data. +auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, + const uint8_t* value_data, std::size_t value_bytes, + bool minimal = false) -> std::string; + /// @return a JSON-formatted string of a metrics views data. /// @param metadata The metadata of the metrics. /// @param value_data The value data of the metrics. diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index 74e19001..b2b87746 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -54,7 +54,7 @@ struct uint32 } /// The metric kind - std::variant kind; + std::variant> kind; /// The metric description abacus::description description; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index d5a98c17..a73adb1d 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -54,7 +54,7 @@ struct uint64 } /// The metric kind - std::variant kind; + std::variant> kind; /// The metric description abacus::description description; diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index f640b703..bb41cb2b 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -222,3 +222,14 @@ TEST(test_info, enum8) EXPECT_EQ(r.value(), 3U); } } + +TEST(test_info, string) +{ + { + uint8_t data[6]; + std::memset(data, 0, sizeof(data)); + data[0] = 1; + abacus::string::set_value(data, "hello"); + EXPECT_EQ(abacus::string::value(data), "hello"); + } +} diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 12ee383c..d553262c 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -35,6 +35,7 @@ TEST(test_metrics, api) std::string name4 = "metric4"; std::string name5 = "metric5"; std::string name6 = "metric6"; + std::string name7 = "metric7"; std::map infos = { {abacus::name{name0}, @@ -53,11 +54,11 @@ TEST(test_metrics, api) abacus::description{"A floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name4}, - abacus::boolean{abacus::constant{}, + abacus::boolean{abacus::constant{true}, abacus::description{"A constant boolean metric"}}}, {abacus::name{name5}, abacus::float64{ - abacus::constant{}, + abacus::constant{42.42}, abacus::description{"A constant floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name6}, @@ -66,11 +67,14 @@ TEST(test_metrics, api) {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {3, {"value3", "The value for 3"}}}}}, + {abacus::name{name7}, + abacus::string{abacus::constant{"hello"}, + abacus::description{"A string metric"}}}}; abacus::metrics from_metrics(infos); abacus::metrics metrics(std::move(from_metrics)); - EXPECT_EQ(metrics.metadata().metrics().size(), 7U); + EXPECT_EQ(metrics.metadata().metrics().size(), 8U); EXPECT_EQ(metrics.metadata().protocol_version(), abacus::protocol_version()); @@ -130,6 +134,11 @@ TEST(test_metrics, api) .description(), "The value for 0"); + EXPECT_EQ(metrics.metadata().metrics().at(name7).string().kind_case(), + abacus::protobuf::StringMetric::KindCase::kConstant); + EXPECT_EQ(metrics.metadata().metrics().at(name7).string().description(), + "A string metric"); + EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name1)); auto metric1 = metrics.initialize_required(name1, 9000U); @@ -150,14 +159,7 @@ TEST(test_metrics, api) auto metric0 = metrics.initialize_optional(name0); EXPECT_TRUE(metrics.is_initialized(name0)); - EXPECT_FALSE(metrics.is_initialized()); - EXPECT_FALSE(metrics.is_initialized(name4)); - metrics.initialize_constant(name4, true); EXPECT_TRUE(metrics.is_initialized(name4)); - - EXPECT_FALSE(metrics.is_initialized()); - EXPECT_FALSE(metrics.is_initialized(name5)); - metrics.initialize_constant(name5, 42.42); EXPECT_TRUE(metrics.is_initialized(name5)); EXPECT_FALSE(metrics.is_initialized()); @@ -165,6 +167,8 @@ TEST(test_metrics, api) auto metric6 = metrics.initialize_optional(name6); EXPECT_TRUE(metrics.is_initialized(name6)); + EXPECT_TRUE(metrics.is_initialized(name7)); + EXPECT_TRUE(metrics.is_initialized()); EXPECT_EQ(metric1.value(), 9000U); @@ -435,22 +439,23 @@ TEST(test_metrics, reset) abacus::description{""}, {{0, {"", ""}}}}}, {abacus::name{"uint64_constant"}, - abacus::uint64{abacus::constant{}, abacus::description{""}}}, + abacus::uint64{abacus::constant{1111UL}, abacus::description{""}}}, {abacus::name{"uint32_constant"}, - abacus::uint32{abacus::constant{}, abacus::description{""}}}, + abacus::uint32{abacus::constant{2222U}, abacus::description{""}}}, {abacus::name{"int64_constant"}, - abacus::int64{abacus::constant{}, abacus::description{""}}}, + abacus::int64{abacus::constant{3333L}, abacus::description{""}}}, {abacus::name{"int32_constant"}, - abacus::int32{abacus::constant{}, abacus::description{""}}}, + abacus::int32{abacus::constant{4444}, abacus::description{""}}}, {abacus::name{"float64_constant"}, - abacus::float64{abacus::constant{}, abacus::description{""}}}, + abacus::float64{abacus::constant{5555.0}, abacus::description{""}}}, {abacus::name{"float32_constant"}, - abacus::float32{abacus::constant{}, abacus::description{""}}}, + abacus::float32{abacus::constant{6666.0f}, abacus::description{""}}}, {abacus::name{"boolean_constant"}, - abacus::boolean{abacus::constant{}, abacus::description{""}}}, - {abacus::name{"enum8_constant"}, abacus::enum8{abacus::constant{}, - abacus::description{""}, - {{0, {"", ""}}}}}, + abacus::boolean{abacus::constant{true}, abacus::description{""}}}, + {abacus::name{"enum8_constant"}, + abacus::enum8{abacus::constant{(uint8_t)77}, + abacus::description{""}, + {{0, {"", ""}}}}}, // Finally a metric that we do not initialize {abacus::name{"not_initialized_required"}, @@ -496,16 +501,6 @@ TEST(test_metrics, reset) auto enum8_optional = metrics.initialize_optional("enum8_optional"); - // Initialize constant metrics - metrics.initialize_constant("uint64_constant", 1111U); - metrics.initialize_constant("uint32_constant", 2222U); - metrics.initialize_constant("int64_constant", 3333); - metrics.initialize_constant("int32_constant", 4444); - metrics.initialize_constant("float64_constant", 5555.0); - metrics.initialize_constant("float32_constant", 6666.0); - metrics.initialize_constant("boolean_constant", true); - metrics.initialize_constant("enum8_constant", 77U); - // Check all required values EXPECT_EQ(uint64_required.value(), 1U); EXPECT_EQ(uint32_required.value(), 2U); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 193f7d32..f93c4588 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -39,7 +39,7 @@ TEST(test_to_json, to_json_minimal) abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::constant{}, + abacus::boolean{abacus::constant{true}, abacus::description{"A boolean constant"}}}, {abacus::name{name3}, abacus::enum8{abacus::gauge{abacus::required}, @@ -53,7 +53,6 @@ TEST(test_to_json, to_json_minimal) auto m0 = metrics.initialize_required(name0, 42); auto m1 = metrics.initialize_required(name1, -42); - metrics.initialize_constant(name2, true); auto m3 = metrics.initialize_required(name3, 2); (void)m0; @@ -167,7 +166,7 @@ TEST(test_to_json, to_json) abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::constant{}, + abacus::boolean{abacus::constant{true}, abacus::description{"A boolean constant"}}}, {abacus::name{name3}, abacus::enum8{abacus::gauge{abacus::required}, @@ -181,7 +180,6 @@ TEST(test_to_json, to_json) auto m0 = metrics.initialize_required(name0, 42); auto m1 = metrics.initialize_required(name1, -42); - metrics.initialize_constant(name2, true); auto m3 = metrics.initialize_required( name3, (uint8_t)test_enum::value1); diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index b621606e..2fc875cb 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -31,7 +31,7 @@ TEST(test_view, api) abacus::unit{"USD"}}}, {abacus::name{name2}, abacus::float64{ - abacus::constant{}, + abacus::constant{3.14}, abacus::description{"A constant floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name3}, @@ -48,8 +48,6 @@ TEST(test_view, api) auto metric1 = metrics.initialize_optional(name1); - metrics.initialize_constant(name2, 3.14); - auto metric3 = metrics.initialize_optional(name3); std::vector value_data(metrics.value_bytes()); From 99a923e96c84edc25a3f59d507a2a3763a683fb9 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 31 Jan 2025 15:32:10 +0100 Subject: [PATCH 49/68] move offset --- protobuf/metrics.proto | 116 +-- src/abacus/detail/helpers.hpp | 30 + src/abacus/metrics.cpp | 31 +- src/abacus/parse.cpp | 13 +- src/abacus/parse.hpp | 6 +- src/abacus/protobuf/metrics.pb.cc | 1200 +++++++++++++++++------------ src/abacus/protobuf/metrics.pb.h | 724 +++++++++++------ src/abacus/string.hpp | 2 + src/abacus/to_json.cpp | 8 +- src/abacus/view.cpp | 3 +- test/src/test_info.cpp | 2 +- test/src/test_metrics.cpp | 44 +- test/src/test_to_json.cpp | 10 +- 13 files changed, 1379 insertions(+), 810 deletions(-) diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index 1411b4df..e3fa91a9 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -28,97 +28,104 @@ message Constant{ // Metadata for unsigned 64-bit metrics message UInt64Metric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Counter counter = 3; // Counter metric - Constant constant = 4; // Constant metric + Gauge gauge = 3; // Gauge metric + Counter counter = 4; // Counter metric + Constant constant = 5; // Constant metric } - optional string unit = 5; // Unit of measurement - optional uint64 min = 6; // Minimum allowable value - optional uint64 max = 7; // Maximum allowable value + optional string unit = 6; // Unit of measurement + optional uint64 min = 7; // Minimum allowable value + optional uint64 max = 8; // Maximum allowable value } // Metadata for signed 64-bit metrics message Int64Metric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Counter counter = 3; // Counter metric - Constant constant = 4; // Constant metric + Gauge gauge = 3; // Gauge metric + Counter counter = 4; // Counter metric + Constant constant = 5; // Constant metric } - optional string unit = 5; // Unit of measurement - optional int64 min = 6; // Minimum allowable value - optional int64 max = 7; // Maximum allowable value + optional string unit = 6; // Unit of measurement + optional int64 min = 7; // Minimum allowable value + optional int64 max = 8; // Maximum allowable value } // Metadata for unsigned 32-bit metrics message UInt32Metric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Counter counter = 3; // Counter metric - Constant constant = 4; // Constant metric + Gauge gauge = 3; // Gauge metric + Counter counter = 4; // Counter metric + Constant constant = 5; // Constant metric } - optional string unit = 5; // Unit of measurement - optional uint32 min = 6; // Minimum allowable value - optional uint32 max = 7; // Maximum allowable value + optional string unit = 6; // Unit of measurement + optional uint32 min = 7; // Minimum allowable value + optional uint32 max = 8; // Maximum allowable value } // Metadata for signed 32-bit metrics message Int32Metric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Counter counter = 3; // Counter metric - Constant constant = 4; // Constant metric + Gauge gauge = 3; // Gauge metric + Counter counter = 4; // Counter metric + Constant constant = 5; // Constant metric } - optional string unit = 5; // Unit of measurement - optional int32 min = 6; // Minimum allowable value - optional int32 max = 7; // Maximum allowable value + optional string unit = 6; // Unit of measurement + optional int32 min = 7; // Minimum allowable value + optional int32 max = 8; // Maximum allowable value } // Metadata for 64-bit floating-point metrics message Float64Metric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Counter counter = 3; // Counter metric - Constant constant = 4; // Constant metric + Gauge gauge = 3; // Gauge metric + Counter counter = 4; // Counter metric + Constant constant = 5; // Constant metric } - optional string unit = 5; // Unit of measurement - optional double min = 6; // Minimum allowable value - optional double max = 7; // Maximum allowable value + optional string unit = 6; // Unit of measurement + optional double min = 7; // Minimum allowable value + optional double max = 8; // Maximum allowable value } // Metadata for 32-bit floating-point metrics message Float32Metric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Counter counter = 3; // Counter metric - Constant constant = 4; // Constant metric + Gauge gauge = 3; // Gauge metric + Counter counter = 4; // Counter metric + Constant constant = 5; // Constant metric } - optional string unit = 5; // Unit of measurement - optional float min = 6; // Minimum allowable value - optional float max = 7; // Maximum allowable value + optional string unit = 6; // Unit of measurement + optional float min = 7; // Minimum allowable value + optional float max = 8; // Maximum allowable value } // Metadata for boolean metrics message BoolMetric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Constant constant = 3; // Constant metric + Gauge gauge = 3; // Gauge metric + Constant constant = 4; // Constant metric } - optional string unit = 4; // Unit of measurement + optional string unit = 5; // Unit of measurement } // Metadata for enumerated metrics @@ -127,29 +134,30 @@ message Enum8Metric { string name = 1; // Enum name optional string description = 2; // Enum description } - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Gauge gauge = 2; // Gauge metric - Constant constant = 3; // Constant metric + Gauge gauge = 3; // Gauge metric + Constant constant = 4; // Constant metric } - optional string unit = 4; // Unit of measurement - map values = 5; // Mapping from packed index to enum info + optional string unit = 5; // Unit of measurement + map values = 6; // Mapping from packed index to enum info } // Metadata for a string metric message StringMetric { - string description = 1; // Metric description + uint32 offset = 1; // Offset into packed memory for the value + string description = 2; // Metric description // The kind of metric oneof kind { - Constant constant = 2; // Constant metric + Constant constant = 3; // Constant metric } } // Metadata for a single metric message Metric { - uint32 offset = 1; // Offset into packed memory for the value oneof type { UInt64Metric uint64 = 3; // Metadata for unsigned 64-bit metrics Int64Metric int64 = 4; // Metadata for signed 64-bit metrics diff --git a/src/abacus/detail/helpers.hpp b/src/abacus/detail/helpers.hpp index f088d336..f840c3aa 100644 --- a/src/abacus/detail/helpers.hpp +++ b/src/abacus/detail/helpers.hpp @@ -65,6 +65,21 @@ struct has_mutable_constant< template inline constexpr bool has_mutable_constant_v = has_mutable_constant::value; +// Helper to detect the presence of offset function +template +struct has_offset : std::false_type +{ +}; + +template +struct has_offset().offset())>> + : std::true_type +{ +}; + +template +inline constexpr bool has_offset_v = has_offset::value; + // Helper to check if a type is in the variant template struct is_in_variant; @@ -151,6 +166,21 @@ static inline auto call_type(const protobuf::Metric& metric, const Func& func) return ReturnType(); } } + +static inline std::size_t get_offset(const protobuf::Metric& m) +{ + return call_type(m, + [](const auto& metric) + { + using Metric = std::decay_t; + if constexpr (has_offset_v) + { + return metric.offset(); + } + return 0U; + }); +} + } } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 45fb0a31..7372ced0 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -134,15 +134,11 @@ metrics::metrics(const std::map& info) for (auto [name, value] : info) { protobuf::Metric metric; - metric.set_offset(m_value_bytes); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; if (auto* m = std::get_if(&value)) { // The offset is incremented by the size of the type + metric.mutable_uint64()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); metric.mutable_uint64()->set_description(m->description.value); @@ -169,6 +165,7 @@ metrics::metrics(const std::map& info) else if (auto* m = std::get_if(&value)) { // The offset is incremented by the size of the type + metric.mutable_int64()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); metric.mutable_int64()->set_description(m->description.value); @@ -195,6 +192,7 @@ metrics::metrics(const std::map& info) else if (auto* m = std::get_if(&value)) { // The offset is incremented by the size of the type + metric.mutable_uint32()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); metric.mutable_uint32()->set_description(m->description.value); @@ -221,6 +219,7 @@ metrics::metrics(const std::map& info) else if (auto* m = std::get_if(&value)) { // The offset is incremented by the size of the type + metric.mutable_int32()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); metric.mutable_int32()->set_description(m->description.value); @@ -247,6 +246,7 @@ metrics::metrics(const std::map& info) else if (auto* m = std::get_if(&value)) { // The offset is incremented by the size of the type + metric.mutable_float64()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); metric.mutable_float64()->set_description(m->description.value); @@ -273,6 +273,7 @@ metrics::metrics(const std::map& info) } else if (auto* m = std::get_if(&value)) { + metric.mutable_float32()->set_offset(m_value_bytes); // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); @@ -300,6 +301,7 @@ metrics::metrics(const std::map& info) } else if (auto* m = std::get_if(&value)) { + metric.mutable_boolean()->set_offset(m_value_bytes); // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); metric.mutable_boolean()->set_description(m->description.value); @@ -313,6 +315,7 @@ metrics::metrics(const std::map& info) } else if (auto* m = std::get_if(&value)) { + metric.mutable_enum8()->set_offset(m_value_bytes); // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); @@ -340,13 +343,13 @@ metrics::metrics(const std::map& info) } else if (auto* m = std::get_if(&value)) { - // The offset is incremented by the size of the type - + metric.mutable_string()->set_offset(m_value_bytes); metric.mutable_string()->set_description(m->description.value); set_kind(*metric.mutable_string(), m->kind); - // The string metric is known to always be constant + // The offset is incremented by the size of the type auto value = std::get>(m->kind).value; + // The string metric is known to always be constant m_value_bytes += value.size(); // The string is stored as a null-terminated string m_value_bytes += 1; @@ -356,6 +359,9 @@ metrics::metrics(const std::map& info) constants.push_back(name); } } + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; m_metadata.mutable_metrics()->insert({name.value, metric}); m_initialized[name.value] = false; @@ -402,7 +408,8 @@ metrics::metrics(const std::map& info) std::get>(metric.kind) .value; m_initialized[name.value] = true; - auto offset = metadata().metrics().at(name.value).offset(); + auto offset = + detail::get_offset(metadata().metrics().at(name.value)); value_data(offset)[0] = 1; Metric::set_value(value_data(offset), value); }, @@ -421,7 +428,7 @@ template assert(is_optional(proto_metric)); assert(!is_constant(proto_metric)); - auto offset = proto_metric.offset(); + auto offset = detail::get_offset(proto_metric); return {value_data(offset)}; } @@ -456,7 +463,7 @@ template assert(!is_optional(proto_metric)); assert(!is_constant(proto_metric)); - auto offset = proto_metric.offset(); + auto offset = detail::get_offset(proto_metric); m_initial_values[name] = value; return {value_data(offset), value}; @@ -555,7 +562,7 @@ auto metrics::reset() -> void continue; } - auto offset = metric.offset(); + auto offset = detail::get_offset(metric); if (is_optional(metric)) { // Set the has value byte to 0 diff --git a/src/abacus/parse.cpp b/src/abacus/parse.cpp index 14b38827..3cabe0b0 100644 --- a/src/abacus/parse.cpp +++ b/src/abacus/parse.cpp @@ -6,20 +6,23 @@ #include "parse.hpp" #include -#include -#include +#include namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -auto parse::metadata(const uint8_t* metadata_data, - std::size_t metadata_bytes) -> protobuf::MetricsMetadata +auto parse::metadata(const uint8_t* metadata_data, std::size_t metadata_bytes) + -> std::optional { assert(metadata_data != nullptr); assert(metadata_bytes > 0); protobuf::MetricsMetadata metadata; - metadata.ParseFromArray(metadata_data, metadata_bytes); + auto result = metadata.ParseFromArray(metadata_data, metadata_bytes); + if (!result) + { + return std::nullopt; + } return metadata; } } diff --git a/src/abacus/parse.hpp b/src/abacus/parse.hpp index a1c6ab31..8b597eb7 100644 --- a/src/abacus/parse.hpp +++ b/src/abacus/parse.hpp @@ -23,9 +23,9 @@ struct parse public: /// @param metadata_data The meta data pointer /// @param metadata_bytes The meta data size in bytes - static auto - metadata(const uint8_t* metadata_data, - std::size_t metadata_bytes) -> protobuf::MetricsMetadata; + static auto metadata(const uint8_t* metadata_data, + std::size_t metadata_bytes) + -> std::optional; }; } } diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index 88e516a1..99849b1e 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -81,6 +81,7 @@ PROTOBUF_CONSTEXPR UInt64Metric::UInt64Metric(::_pbi::ConstantInitialized) }, /*decltype(_impl_.min_)*/ ::uint64_t{0u}, /*decltype(_impl_.max_)*/ ::uint64_t{0u}, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.kind_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, } {} @@ -109,6 +110,7 @@ PROTOBUF_CONSTEXPR Int64Metric::Int64Metric(::_pbi::ConstantInitialized) }, /*decltype(_impl_.min_)*/ ::int64_t{0}, /*decltype(_impl_.max_)*/ ::int64_t{0}, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.kind_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, } {} @@ -135,6 +137,7 @@ PROTOBUF_CONSTEXPR UInt32Metric::UInt32Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.min_)*/ 0u, /*decltype(_impl_.max_)*/ 0u, /*decltype(_impl_.kind_)*/ {}, @@ -163,6 +166,7 @@ PROTOBUF_CONSTEXPR Int32Metric::Int32Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, /*decltype(_impl_.kind_)*/ {}, @@ -193,6 +197,7 @@ PROTOBUF_CONSTEXPR Float64Metric::Float64Metric(::_pbi::ConstantInitialized) }, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.kind_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, } {} @@ -219,6 +224,7 @@ PROTOBUF_CONSTEXPR Float32Metric::Float32Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, /*decltype(_impl_.kind_)*/ {}, @@ -247,6 +253,7 @@ PROTOBUF_CONSTEXPR BoolMetric::BoolMetric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.kind_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, } {} @@ -310,6 +317,7 @@ PROTOBUF_CONSTEXPR Enum8Metric::Enum8Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.kind_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, } {} @@ -330,6 +338,7 @@ PROTOBUF_CONSTEXPR StringMetric::StringMetric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.kind_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -347,7 +356,6 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT template PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) : _impl_{ - /*decltype(_impl_.offset_)*/ 0u, /*decltype(_impl_.type_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -435,6 +443,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -447,6 +456,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, 1, 2, @@ -458,6 +468,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -470,6 +481,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, 1, 2, @@ -481,6 +493,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -493,6 +506,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, 1, 2, @@ -504,6 +518,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -516,6 +531,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, 1, 2, @@ -527,6 +543,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -539,6 +556,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, 1, 2, @@ -550,6 +568,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -562,6 +581,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, 1, 2, @@ -573,6 +593,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -581,6 +602,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _internal_metadata_), @@ -614,6 +636,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -623,6 +646,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, + ~0u, 0, ~0u, ~0u, // no _has_bits_ @@ -633,6 +657,7 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.kind_), @@ -644,7 +669,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_.offset_), ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, @@ -686,20 +710,20 @@ static const ::_pbi::MigrationSchema {0, -1, -1, sizeof(::abacus::protobuf::Gauge)}, {9, -1, -1, sizeof(::abacus::protobuf::Counter)}, {18, -1, -1, sizeof(::abacus::protobuf::Constant)}, - {26, 42, -1, sizeof(::abacus::protobuf::UInt64Metric)}, - {49, 65, -1, sizeof(::abacus::protobuf::Int64Metric)}, - {72, 88, -1, sizeof(::abacus::protobuf::UInt32Metric)}, - {95, 111, -1, sizeof(::abacus::protobuf::Int32Metric)}, - {118, 134, -1, sizeof(::abacus::protobuf::Float64Metric)}, - {141, 157, -1, sizeof(::abacus::protobuf::Float32Metric)}, - {164, 177, -1, sizeof(::abacus::protobuf::BoolMetric)}, - {181, 191, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, - {193, 203, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, - {205, 219, -1, sizeof(::abacus::protobuf::Enum8Metric)}, - {224, -1, -1, sizeof(::abacus::protobuf::StringMetric)}, - {235, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {254, 264, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {266, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {26, 43, -1, sizeof(::abacus::protobuf::UInt64Metric)}, + {51, 68, -1, sizeof(::abacus::protobuf::Int64Metric)}, + {76, 93, -1, sizeof(::abacus::protobuf::UInt32Metric)}, + {101, 118, -1, sizeof(::abacus::protobuf::Int32Metric)}, + {126, 143, -1, sizeof(::abacus::protobuf::Float64Metric)}, + {151, 168, -1, sizeof(::abacus::protobuf::Float32Metric)}, + {176, 190, -1, sizeof(::abacus::protobuf::BoolMetric)}, + {195, 205, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, + {207, 217, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, + {219, 234, -1, sizeof(::abacus::protobuf::Enum8Metric)}, + {240, -1, -1, sizeof(::abacus::protobuf::StringMetric)}, + {252, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {270, 280, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {282, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -724,88 +748,91 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." "protobuf\"\031\n\005Gauge\022\020\n\010optional\030\001 \001(\010\"\033\n\007C" - "ounter\022\020\n\010optional\030\001 \001(\010\"\n\n\010Constant\"\200\002\n" - "\014UInt64Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005ga" - "uge\030\002 \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007c" - "ounter\030\003 \001(\0132\030.abacus.protobuf.CounterH\000" - "\022-\n\010constant\030\004 \001(\0132\031.abacus.protobuf.Con" - "stantH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\022\020\n\003min\030\006 \001(\004H" - "\002\210\001\001\022\020\n\003max\030\007 \001(\004H\003\210\001\001B\006\n\004kindB\007\n\005_unitB" - "\006\n\004_minB\006\n\004_max\"\377\001\n\013Int64Metric\022\023\n\013descr" - "iption\030\001 \001(\t\022\'\n\005gauge\030\002 \001(\0132\026.abacus.pro" - "tobuf.GaugeH\000\022+\n\007counter\030\003 \001(\0132\030.abacus." - "protobuf.CounterH\000\022-\n\010constant\030\004 \001(\0132\031.a" - "bacus.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\tH" - "\001\210\001\001\022\020\n\003min\030\006 \001(\003H\002\210\001\001\022\020\n\003max\030\007 \001(\003H\003\210\001\001" - "B\006\n\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\200\002\n\014UI" - "nt32Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge" - "\030\002 \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007coun" - "ter\030\003 \001(\0132\030.abacus.protobuf.CounterH\000\022-\n" - "\010constant\030\004 \001(\0132\031.abacus.protobuf.Consta" - "ntH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\022\020\n\003min\030\006 \001(\rH\002\210\001" - "\001\022\020\n\003max\030\007 \001(\rH\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004" - "_minB\006\n\004_max\"\377\001\n\013Int32Metric\022\023\n\013descript" - "ion\030\001 \001(\t\022\'\n\005gauge\030\002 \001(\0132\026.abacus.protob" - "uf.GaugeH\000\022+\n\007counter\030\003 \001(\0132\030.abacus.pro" - "tobuf.CounterH\000\022-\n\010constant\030\004 \001(\0132\031.abac" - "us.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001" - "\001\022\020\n\003min\030\006 \001(\005H\002\210\001\001\022\020\n\003max\030\007 \001(\005H\003\210\001\001B\006\n" - "\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\201\002\n\rFloat" - "64Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge\030\002" + "ounter\022\020\n\010optional\030\001 \001(\010\"\n\n\010Constant\"\220\002\n" + "\014UInt64Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descrip" + "tion\030\002 \001(\t\022\'\n\005gauge\030\003 \001(\0132\026.abacus.proto" + "buf.GaugeH\000\022+\n\007counter\030\004 \001(\0132\030.abacus.pr" + "otobuf.CounterH\000\022-\n\010constant\030\005 \001(\0132\031.aba" + "cus.protobuf.ConstantH\000\022\021\n\004unit\030\006 \001(\tH\001\210" + "\001\001\022\020\n\003min\030\007 \001(\004H\002\210\001\001\022\020\n\003max\030\010 \001(\004H\003\210\001\001B\006" + "\n\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\217\002\n\013Int6" + "4Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030\002" + " \001(\t\022\'\n\005gauge\030\003 \001(\0132\026.abacus.protobuf.Ga" + "ugeH\000\022+\n\007counter\030\004 \001(\0132\030.abacus.protobuf" + ".CounterH\000\022-\n\010constant\030\005 \001(\0132\031.abacus.pr" + "otobuf.ConstantH\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003" + "min\030\007 \001(\003H\002\210\001\001\022\020\n\003max\030\010 \001(\003H\003\210\001\001B\006\n\004kind" + "B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\220\002\n\014UInt32Metr" + "ic\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022" + "\'\n\005gauge\030\003 \001(\0132\026.abacus.protobuf.GaugeH\000" + "\022+\n\007counter\030\004 \001(\0132\030.abacus.protobuf.Coun" + "terH\000\022-\n\010constant\030\005 \001(\0132\031.abacus.protobu" + "f.ConstantH\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007" + " \001(\rH\002\210\001\001\022\020\n\003max\030\010 \001(\rH\003\210\001\001B\006\n\004kindB\007\n\005_" + "unitB\006\n\004_minB\006\n\004_max\"\217\002\n\013Int32Metric\022\016\n\006" + "offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005gau" + "ge\030\003 \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007co" + "unter\030\004 \001(\0132\030.abacus.protobuf.CounterH\000\022" + "-\n\010constant\030\005 \001(\0132\031.abacus.protobuf.Cons" + "tantH\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007 \001(\005H\002" + "\210\001\001\022\020\n\003max\030\010 \001(\005H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006" + "\n\004_minB\006\n\004_max\"\221\002\n\rFloat64Metric\022\016\n\006offs" + "et\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005gauge\030\003" " \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007counte" - "r\030\003 \001(\0132\030.abacus.protobuf.CounterH\000\022-\n\010c" - "onstant\030\004 \001(\0132\031.abacus.protobuf.Constant" - "H\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\022\020\n\003min\030\006 \001(\001H\002\210\001\001\022" - "\020\n\003max\030\007 \001(\001H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004_m" - "inB\006\n\004_max\"\201\002\n\rFloat32Metric\022\023\n\013descript" - "ion\030\001 \001(\t\022\'\n\005gauge\030\002 \001(\0132\026.abacus.protob" - "uf.GaugeH\000\022+\n\007counter\030\003 \001(\0132\030.abacus.pro" - "tobuf.CounterH\000\022-\n\010constant\030\004 \001(\0132\031.abac" - "us.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001" - "\001\022\020\n\003min\030\006 \001(\002H\002\210\001\001\022\020\n\003max\030\007 \001(\002H\003\210\001\001B\006\n" - "\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\235\001\n\nBoolM" - "etric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge\030\002 \001(" - "\0132\026.abacus.protobuf.GaugeH\000\022-\n\010constant\030" - "\003 \001(\0132\031.abacus.protobuf.ConstantH\000\022\021\n\004un" - "it\030\004 \001(\tH\001\210\001\001B\006\n\004kindB\007\n\005_unit\"\364\002\n\013Enum8" - "Metric\022\023\n\013description\030\001 \001(\t\022\'\n\005gauge\030\002 \001" - "(\0132\026.abacus.protobuf.GaugeH\000\022-\n\010constant" - "\030\003 \001(\0132\031.abacus.protobuf.ConstantH\000\022\021\n\004u" - "nit\030\004 \001(\tH\001\210\001\001\0228\n\006values\030\005 \003(\0132(.abacus." - "protobuf.Enum8Metric.ValuesEntry\032C\n\tEnum" - "Value\022\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\t" - "H\000\210\001\001B\016\n\014_description\032U\n\013ValuesEntry\022\013\n\003" - "key\030\001 \001(\r\0225\n\005value\030\002 \001(\0132&.abacus.protob" - "uf.Enum8Metric.EnumValue:\0028\001B\006\n\004kindB\007\n\005" - "_unit\"Z\n\014StringMetric\022\023\n\013description\030\001 \001" - "(\t\022-\n\010constant\030\002 \001(\0132\031.abacus.protobuf.C" - "onstantH\000B\006\n\004kind\"\326\003\n\006Metric\022\016\n\006offset\030\001" - " \001(\r\022/\n\006uint64\030\003 \001(\0132\035.abacus.protobuf.U" - "Int64MetricH\000\022-\n\005int64\030\004 \001(\0132\034.abacus.pr" - "otobuf.Int64MetricH\000\022/\n\006uint32\030\005 \001(\0132\035.a" - "bacus.protobuf.UInt32MetricH\000\022-\n\005int32\030\006" - " \001(\0132\034.abacus.protobuf.Int32MetricH\000\0221\n\007" - "float64\030\007 \001(\0132\036.abacus.protobuf.Float64M" - "etricH\000\0221\n\007float32\030\010 \001(\0132\036.abacus.protob" - "uf.Float32MetricH\000\022.\n\007boolean\030\t \001(\0132\033.ab" - "acus.protobuf.BoolMetricH\000\022-\n\005enum8\030\n \001(" - "\0132\034.abacus.protobuf.Enum8MetricH\000\022/\n\006str" - "ing\030\013 \001(\0132\035.abacus.protobuf.StringMetric" - "H\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030\n\020protoc" - "ol_version\030\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.a" - "bacus.protobuf.Endianness\022\022\n\nsync_value\030" - "\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus.protobuf" - ".MetricsMetadata.MetricsEntry\032G\n\014Metrics" - "Entry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abac" - "us.protobuf.Metric:\0028\001*!\n\nEndianness\022\n\n\006" - "LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/protobufb\006pr" - "oto3" + "r\030\004 \001(\0132\030.abacus.protobuf.CounterH\000\022-\n\010c" + "onstant\030\005 \001(\0132\031.abacus.protobuf.Constant" + "H\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007 \001(\001H\002\210\001\001\022" + "\020\n\003max\030\010 \001(\001H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004_m" + "inB\006\n\004_max\"\221\002\n\rFloat32Metric\022\016\n\006offset\030\001" + " \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005gauge\030\003 \001(\013" + "2\026.abacus.protobuf.GaugeH\000\022+\n\007counter\030\004 " + "\001(\0132\030.abacus.protobuf.CounterH\000\022-\n\010const" + "ant\030\005 \001(\0132\031.abacus.protobuf.ConstantH\000\022\021" + "\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007 \001(\002H\002\210\001\001\022\020\n\003m" + "ax\030\010 \001(\002H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004_minB\006" + "\n\004_max\"\255\001\n\nBoolMetric\022\016\n\006offset\030\001 \001(\r\022\023\n" + "\013description\030\002 \001(\t\022\'\n\005gauge\030\003 \001(\0132\026.abac" + "us.protobuf.GaugeH\000\022-\n\010constant\030\004 \001(\0132\031." + "abacus.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\t" + "H\001\210\001\001B\006\n\004kindB\007\n\005_unit\"\204\003\n\013Enum8Metric\022\016" + "\n\006offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005g" + "auge\030\003 \001(\0132\026.abacus.protobuf.GaugeH\000\022-\n\010" + "constant\030\004 \001(\0132\031.abacus.protobuf.Constan" + "tH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\0228\n\006values\030\006 \003(\0132(" + ".abacus.protobuf.Enum8Metric.ValuesEntry" + "\032C\n\tEnumValue\022\014\n\004name\030\001 \001(\t\022\030\n\013descripti" + "on\030\002 \001(\tH\000\210\001\001B\016\n\014_description\032U\n\013ValuesE" + "ntry\022\013\n\003key\030\001 \001(\r\0225\n\005value\030\002 \001(\0132&.abacu" + "s.protobuf.Enum8Metric.EnumValue:\0028\001B\006\n\004" + "kindB\007\n\005_unit\"j\n\014StringMetric\022\016\n\006offset\030" + "\001 \001(\r\022\023\n\013description\030\002 \001(\t\022-\n\010constant\030\003" + " \001(\0132\031.abacus.protobuf.ConstantH\000B\006\n\004kin" + "d\"\306\003\n\006Metric\022/\n\006uint64\030\003 \001(\0132\035.abacus.pr" + "otobuf.UInt64MetricH\000\022-\n\005int64\030\004 \001(\0132\034.a" + "bacus.protobuf.Int64MetricH\000\022/\n\006uint32\030\005" + " \001(\0132\035.abacus.protobuf.UInt32MetricH\000\022-\n" + "\005int32\030\006 \001(\0132\034.abacus.protobuf.Int32Metr" + "icH\000\0221\n\007float64\030\007 \001(\0132\036.abacus.protobuf." + "Float64MetricH\000\0221\n\007float32\030\010 \001(\0132\036.abacu" + "s.protobuf.Float32MetricH\000\022.\n\007boolean\030\t " + "\001(\0132\033.abacus.protobuf.BoolMetricH\000\022-\n\005en" + "um8\030\n \001(\0132\034.abacus.protobuf.Enum8MetricH" + "\000\022/\n\006string\030\013 \001(\0132\035.abacus.protobuf.Stri" + "ngMetricH\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030" + "\n\020protocol_version\030\001 \001(\r\022/\n\nendianness\030\002" + " \001(\0162\033.abacus.protobuf.Endianness\022\022\n\nsyn" + "c_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus." + "protobuf.MetricsMetadata.MetricsEntry\032G\n" + "\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(" + "\0132\027.abacus.protobuf.Metric:\0028\001*!\n\nEndian" + "ness\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/prot" + "obufb\006proto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 3084, + 3212, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, @@ -1313,6 +1340,7 @@ UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Messa decltype(_impl_.unit_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, + decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -1333,8 +1361,8 @@ UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Messa _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.offset_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.offset_)); clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -1368,6 +1396,7 @@ inline void UInt64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.unit_){}, decltype(_impl_.min_){::uint64_t{0u}}, decltype(_impl_.max_){::uint64_t{0u}}, + decltype(_impl_.offset_){0u}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -1443,6 +1472,7 @@ PROTOBUF_NOINLINE void UInt64Metric::Clear() { reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } + _impl_.offset_ = 0u; clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -1456,58 +1486,63 @@ const char* UInt64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 3, 52, 2> UInt64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 8, 3, 60, 2> UInt64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 8, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967040, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 8, // num_field_entries 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_UInt64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; + // optional uint64 max = 8; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), + {64, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 5; + // optional string unit = 6; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, - // optional uint64 min = 6; + {50, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, + // optional uint64 min = 7; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, - // optional uint64 max = 7; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, + {56, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 5; + // optional string unit = 6; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint64 min = 6; + // optional uint64 min = 7; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - // optional uint64 max = 7; + // optional uint64 max = 8; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, }}, {{ @@ -1515,7 +1550,7 @@ const ::_pbi::TcParseTable<3, 7, 3, 52, 2> UInt64Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\34\13\0\0\0\4\0\0" + "\34\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" "abacus.protobuf.UInt64Metric" "description" "unit" @@ -1529,30 +1564,37 @@ ::uint8_t* UInt64Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.UInt64Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kCounter: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::counter(this), + InternalWriteMessage(4, _Internal::counter(this), _Internal::counter(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), + InternalWriteMessage(5, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -1560,26 +1602,26 @@ ::uint8_t* UInt64Metric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt64Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(6, _s, target); } - // optional uint64 min = 6; + // optional uint64 min = 7; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 6, this->_internal_min(), target); + 7, this->_internal_min(), target); } - // optional uint64 max = 7; + // optional uint64 max = 8; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 7, this->_internal_max(), target); + 8, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1599,7 +1641,7 @@ ::size_t UInt64Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); @@ -1607,41 +1649,47 @@ ::size_t UInt64Metric::ByteSizeLong() const { cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // optional uint64 min = 6; + // optional uint64 min = 7; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_min()); } - // optional uint64 max = 7; + // optional uint64 max = 8; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_max()); } } + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; case kCounter: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.counter_); break; } - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -1686,6 +1734,9 @@ void UInt64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google } _this->_impl_._has_bits_[0] |= cached_has_bits; } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } switch (from.kind_case()) { case kGauge: { _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( @@ -1731,8 +1782,8 @@ void UInt64Metric::InternalSwap(UInt64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_) - + sizeof(UInt64Metric::_impl_.max_) + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.offset_) + + sizeof(UInt64Metric::_impl_.offset_) - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); @@ -1837,6 +1888,7 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( decltype(_impl_.unit_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, + decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -1857,8 +1909,8 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.offset_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.offset_)); clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -1892,6 +1944,7 @@ inline void Int64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.unit_){}, decltype(_impl_.min_){::int64_t{0}}, decltype(_impl_.max_){::int64_t{0}}, + decltype(_impl_.offset_){0u}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -1967,6 +2020,7 @@ PROTOBUF_NOINLINE void Int64Metric::Clear() { reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } + _impl_.offset_ = 0u; clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -1980,58 +2034,63 @@ const char* Int64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 3, 51, 2> Int64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 8, 3, 59, 2> Int64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 8, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967040, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 8, // num_field_entries 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Int64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; + // optional int64 max = 8; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.max_), 2>(), + {64, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 5; + // optional string unit = 6; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, - // optional int64 min = 6; + {50, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, + // optional int64 min = 7; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, - // optional int64 max = 7; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, + {56, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 5; + // optional string unit = 6; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int64 min = 6; + // optional int64 min = 7; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, - // optional int64 max = 7; + // optional int64 max = 8; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, }}, {{ @@ -2039,7 +2098,7 @@ const ::_pbi::TcParseTable<3, 7, 3, 51, 2> Int64Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\33\13\0\0\0\4\0\0" + "\33\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" "abacus.protobuf.Int64Metric" "description" "unit" @@ -2053,30 +2112,37 @@ ::uint8_t* Int64Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.Int64Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kCounter: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::counter(this), + InternalWriteMessage(4, _Internal::counter(this), _Internal::counter(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), + InternalWriteMessage(5, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -2084,25 +2150,25 @@ ::uint8_t* Int64Metric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int64Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(6, _s, target); } - // optional int64 min = 6; + // optional int64 min = 7; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<6>( + WriteInt64ToArrayWithField<7>( stream, this->_internal_min(), target); } - // optional int64 max = 7; + // optional int64 max = 8; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<7>( + WriteInt64ToArrayWithField<8>( stream, this->_internal_max(), target); } @@ -2123,7 +2189,7 @@ ::size_t Int64Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); @@ -2131,41 +2197,47 @@ ::size_t Int64Metric::ByteSizeLong() const { cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // optional int64 min = 6; + // optional int64 min = 7; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_min()); } - // optional int64 max = 7; + // optional int64 max = 8; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_max()); } } + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; case kCounter: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.counter_); break; } - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -2210,6 +2282,9 @@ void Int64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: } _this->_impl_._has_bits_[0] |= cached_has_bits; } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } switch (from.kind_case()) { case kGauge: { _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( @@ -2255,8 +2330,8 @@ void Int64Metric::InternalSwap(Int64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_) - + sizeof(Int64Metric::_impl_.max_) + PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.offset_) + + sizeof(Int64Metric::_impl_.offset_) - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); @@ -2359,6 +2434,7 @@ UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Messa /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, decltype(_impl_.kind_){}, @@ -2380,9 +2456,9 @@ UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Messa if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.min_, &from._impl_.min_, + ::memcpy(&_impl_.offset_, &from._impl_.offset_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -2414,6 +2490,7 @@ inline void UInt32Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, decltype(_impl_.min_){0u}, decltype(_impl_.max_){0u}, decltype(_impl_.kind_){}, @@ -2486,6 +2563,7 @@ PROTOBUF_NOINLINE void UInt32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + _impl_.offset_ = 0u; if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - @@ -2504,58 +2582,63 @@ const char* UInt32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 3, 52, 2> UInt32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 8, 3, 60, 2> UInt32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 8, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967040, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 8, // num_field_entries 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_UInt32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; + // optional uint32 max = 8; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.max_), 2>(), + {64, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 5; + // optional string unit = 6; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, - // optional uint32 min = 6; + {50, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, + // optional uint32 min = 7; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, - // optional uint32 max = 7; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, + {56, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 5; + // optional string unit = 6; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint32 min = 6; + // optional uint32 min = 7; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, - // optional uint32 max = 7; + // optional uint32 max = 8; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, }}, {{ @@ -2563,7 +2646,7 @@ const ::_pbi::TcParseTable<3, 7, 3, 52, 2> UInt32Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\34\13\0\0\0\4\0\0" + "\34\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" "abacus.protobuf.UInt32Metric" "description" "unit" @@ -2577,30 +2660,37 @@ ::uint8_t* UInt32Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.UInt32Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kCounter: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::counter(this), + InternalWriteMessage(4, _Internal::counter(this), _Internal::counter(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), + InternalWriteMessage(5, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -2608,26 +2698,26 @@ ::uint8_t* UInt32Metric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt32Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(6, _s, target); } - // optional uint32 min = 6; + // optional uint32 min = 7; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 6, this->_internal_min(), target); + 7, this->_internal_min(), target); } - // optional uint32 max = 7; + // optional uint32 max = 8; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 7, this->_internal_max(), target); + 8, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2647,27 +2737,33 @@ ::size_t UInt32Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); } + // optional string unit = 6; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional string unit = 5; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } - // optional uint32 min = 6; + if (cached_has_bits & 0x00000006u) { + // optional uint32 min = 7; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_min()); } - // optional uint32 max = 7; + // optional uint32 max = 8; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_max()); @@ -2675,21 +2771,21 @@ ::size_t UInt32Metric::ByteSizeLong() const { } switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; case kCounter: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.counter_); break; } - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -2721,11 +2817,14 @@ void UInt32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_unit(from._internal_unit()); - } + if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -2781,9 +2880,9 @@ void UInt32Metric::InternalSwap(UInt32Metric* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_) + sizeof(UInt32Metric::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)>( - reinterpret_cast(&_impl_.min_), - reinterpret_cast(&other->_impl_.min_)); + - PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); swap(_impl_.kind_, other->_impl_.kind_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -2883,6 +2982,7 @@ Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message( /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, decltype(_impl_.kind_){}, @@ -2904,9 +3004,9 @@ Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.min_, &from._impl_.min_, + ::memcpy(&_impl_.offset_, &from._impl_.offset_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -2938,6 +3038,7 @@ inline void Int32Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, decltype(_impl_.kind_){}, @@ -3010,6 +3111,7 @@ PROTOBUF_NOINLINE void Int32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + _impl_.offset_ = 0u; if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - @@ -3028,58 +3130,63 @@ const char* Int32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 3, 51, 2> Int32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 8, 3, 59, 2> Int32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 8, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967040, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 8, // num_field_entries 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Int32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; + // optional int32 max = 8; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.max_), 2>(), + {64, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 5; + // optional string unit = 6; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, - // optional int32 min = 6; + {50, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, + // optional int32 min = 7; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, - // optional int32 max = 7; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, + {56, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 5; + // optional string unit = 6; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int32 min = 6; + // optional int32 min = 7; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - // optional int32 max = 7; + // optional int32 max = 8; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, }}, {{ @@ -3087,7 +3194,7 @@ const ::_pbi::TcParseTable<3, 7, 3, 51, 2> Int32Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\33\13\0\0\0\4\0\0" + "\33\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" "abacus.protobuf.Int32Metric" "description" "unit" @@ -3101,30 +3208,37 @@ ::uint8_t* Int32Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.Int32Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kCounter: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::counter(this), + InternalWriteMessage(4, _Internal::counter(this), _Internal::counter(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), + InternalWriteMessage(5, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -3132,25 +3246,25 @@ ::uint8_t* Int32Metric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int32Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(6, _s, target); } - // optional int32 min = 6; + // optional int32 min = 7; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<6>( + WriteInt32ToArrayWithField<7>( stream, this->_internal_min(), target); } - // optional int32 max = 7; + // optional int32 max = 8; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<7>( + WriteInt32ToArrayWithField<8>( stream, this->_internal_max(), target); } @@ -3171,27 +3285,33 @@ ::size_t Int32Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); } + // optional string unit = 6; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional string unit = 5; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } - // optional int32 min = 6; + if (cached_has_bits & 0x00000006u) { + // optional int32 min = 7; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_min()); } - // optional int32 max = 7; + // optional int32 max = 8; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_max()); @@ -3199,21 +3319,21 @@ ::size_t Int32Metric::ByteSizeLong() const { } switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; case kCounter: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.counter_); break; } - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -3245,11 +3365,14 @@ void Int32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_unit(from._internal_unit()); - } + if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -3305,9 +3428,9 @@ void Int32Metric::InternalSwap(Int32Metric* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_) + sizeof(Int32Metric::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)>( - reinterpret_cast(&_impl_.min_), - reinterpret_cast(&other->_impl_.min_)); + - PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); swap(_impl_.kind_, other->_impl_.kind_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -3409,6 +3532,7 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me decltype(_impl_.unit_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, + decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -3429,8 +3553,8 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.offset_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.offset_)); clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -3464,6 +3588,7 @@ inline void Float64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.unit_){}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, + decltype(_impl_.offset_){0u}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -3539,6 +3664,7 @@ PROTOBUF_NOINLINE void Float64Metric::Clear() { reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } + _impl_.offset_ = 0u; clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -3552,58 +3678,63 @@ const char* Float64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 3, 53, 2> Float64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 8, 3, 61, 2> Float64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 8, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967040, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 8, // num_field_entries 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Float64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; + // optional double max = 8; + {::_pbi::TcParser::FastF64S1, + {65, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 5; + // optional string unit = 6; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, - // optional double min = 6; - {::_pbi::TcParser::FastF64S1, - {49, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, - // optional double max = 7; + {50, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, + // optional double min = 7; {::_pbi::TcParser::FastF64S1, - {57, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, + {57, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 5; + // optional string unit = 6; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional double min = 6; + // optional double min = 7; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, - // optional double max = 7; + // optional double max = 8; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, }}, {{ @@ -3611,7 +3742,7 @@ const ::_pbi::TcParseTable<3, 7, 3, 53, 2> Float64Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\35\13\0\0\0\4\0\0" + "\35\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" "abacus.protobuf.Float64Metric" "description" "unit" @@ -3625,30 +3756,37 @@ ::uint8_t* Float64Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.Float64Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kCounter: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::counter(this), + InternalWriteMessage(4, _Internal::counter(this), _Internal::counter(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), + InternalWriteMessage(5, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -3656,26 +3794,26 @@ ::uint8_t* Float64Metric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float64Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(6, _s, target); } - // optional double min = 6; + // optional double min = 7; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 6, this->_internal_min(), target); + 7, this->_internal_min(), target); } - // optional double max = 7; + // optional double max = 8; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 7, this->_internal_max(), target); + 8, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -3695,7 +3833,7 @@ ::size_t Float64Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); @@ -3703,39 +3841,45 @@ ::size_t Float64Metric::ByteSizeLong() const { cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } - // optional double min = 6; + // optional double min = 7; if (cached_has_bits & 0x00000002u) { total_size += 9; } - // optional double max = 7; + // optional double max = 8; if (cached_has_bits & 0x00000004u) { total_size += 9; } } + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; case kCounter: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.counter_); break; } - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -3780,6 +3924,9 @@ void Float64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl } _this->_impl_._has_bits_[0] |= cached_has_bits; } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } switch (from.kind_case()) { case kGauge: { _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( @@ -3825,8 +3972,8 @@ void Float64Metric::InternalSwap(Float64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_) - + sizeof(Float64Metric::_impl_.max_) + PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.offset_) + + sizeof(Float64Metric::_impl_.offset_) - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)>( reinterpret_cast(&_impl_.min_), reinterpret_cast(&other->_impl_.min_)); @@ -3929,6 +4076,7 @@ Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Me /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, decltype(_impl_.kind_){}, @@ -3950,9 +4098,9 @@ Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Me if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.min_, &from._impl_.min_, + ::memcpy(&_impl_.offset_, &from._impl_.offset_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -3984,6 +4132,7 @@ inline void Float32Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, decltype(_impl_.kind_){}, @@ -4056,6 +4205,7 @@ PROTOBUF_NOINLINE void Float32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + _impl_.offset_ = 0u; if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - @@ -4074,58 +4224,63 @@ const char* Float32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 3, 53, 2> Float32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 8, 3, 61, 2> Float32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 8, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967040, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 8, // num_field_entries 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Float32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string description = 1; + // optional float max = 8; + {::_pbi::TcParser::FastF32S1, + {69, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 5; + // optional string unit = 6; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, - // optional float min = 6; - {::_pbi::TcParser::FastF32S1, - {53, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, - // optional float max = 7; + {50, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, + // optional float min = 7; {::_pbi::TcParser::FastF32S1, - {61, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, + {61, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 5; + // optional string unit = 6; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional float min = 6; + // optional float min = 7; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, - // optional float max = 7; + // optional float max = 8; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, }}, {{ @@ -4133,7 +4288,7 @@ const ::_pbi::TcParseTable<3, 7, 3, 53, 2> Float32Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\35\13\0\0\0\4\0\0" + "\35\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" "abacus.protobuf.Float32Metric" "description" "unit" @@ -4147,30 +4302,37 @@ ::uint8_t* Float32Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.Float32Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kCounter: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::counter(this), + InternalWriteMessage(4, _Internal::counter(this), _Internal::counter(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), + InternalWriteMessage(5, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -4178,26 +4340,26 @@ ::uint8_t* Float32Metric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 6; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float32Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(6, _s, target); } - // optional float min = 6; + // optional float min = 7; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 6, this->_internal_min(), target); + 7, this->_internal_min(), target); } - // optional float max = 7; + // optional float max = 8; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 7, this->_internal_max(), target); + 8, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -4217,47 +4379,53 @@ ::size_t Float32Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); } + // optional string unit = 6; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional string unit = 5; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } - // optional float min = 6; + if (cached_has_bits & 0x00000006u) { + // optional float min = 7; if (cached_has_bits & 0x00000002u) { total_size += 5; } - // optional float max = 7; + // optional float max = 8; if (cached_has_bits & 0x00000004u) { total_size += 5; } } switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; case kCounter: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.counter_); break; } - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -4289,11 +4457,14 @@ void Float32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_unit(from._internal_unit()); - } + if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -4349,9 +4520,9 @@ void Float32Metric::InternalSwap(Float32Metric* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_) + sizeof(Float32Metric::_impl_.max_) - - PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)>( - reinterpret_cast(&_impl_.min_), - reinterpret_cast(&other->_impl_.min_)); + - PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); swap(_impl_.kind_, other->_impl_.kind_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -4426,6 +4597,7 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -4445,6 +4617,7 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } + _this->_impl_.offset_ = from._impl_.offset_; clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -4471,6 +4644,7 @@ inline void BoolMetric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -4535,6 +4709,7 @@ PROTOBUF_NOINLINE void BoolMetric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + _impl_.offset_ = 0u; clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -4548,46 +4723,57 @@ const char* BoolMetric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 4, 2, 50, 2> BoolMetric::_table_ = { +const ::_pbi::TcParseTable<3, 5, 2, 50, 2> BoolMetric::_table_ = { { PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_), 0, // no _extensions_ - 4, 8, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 5, // num_field_entries 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_BoolMetric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional string unit = 4; + {::_pbi::TcParser::MiniParse, {}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(BoolMetric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {34, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, - // string description = 1; + {18, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_)}}, + {42, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 3; + // .abacus.protobuf.Constant constant = 4; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 4; + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, }}, {{ {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\32\13\0\0\4\0\0\0" + "\32\0\13\0\0\4\0\0" "abacus.protobuf.BoolMetric" "description" "unit" @@ -4601,24 +4787,31 @@ ::uint8_t* BoolMetric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.BoolMetric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::constant(this), + InternalWriteMessage(4, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -4626,12 +4819,12 @@ ::uint8_t* BoolMetric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 4; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.BoolMetric.unit"); - target = stream->WriteStringMaybeAliased(4, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -4651,28 +4844,34 @@ ::size_t BoolMetric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); } - // optional string unit = 4; + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Constant constant = 3; + // .abacus.protobuf.Constant constant = 4; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -4707,6 +4906,9 @@ void BoolMetric::MergeImpl(::google::protobuf::Message& to_msg, const ::google:: if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } switch (from.kind_case()) { case kGauge: { _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( @@ -4746,6 +4948,7 @@ void BoolMetric::InternalSwap(BoolMetric* other) { &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); + swap(_impl_.offset_, other->_impl_.offset_); swap(_impl_.kind_, other->_impl_.kind_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -5081,6 +5284,7 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( /* decltype(_impl_.values_) */ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -5101,6 +5305,7 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } + _this->_impl_.offset_ = from._impl_.offset_; clear_has_kind(); switch (from.kind_case()) { case kGauge: { @@ -5128,6 +5333,7 @@ inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { /* decltype(_impl_.values_) */ {::google::protobuf::internal::ArenaInitialized(), arena}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, decltype(_impl_.kind_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; @@ -5194,6 +5400,7 @@ PROTOBUF_NOINLINE void Enum8Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + _impl_.offset_ = 0u; clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -5207,42 +5414,53 @@ const char* Enum8Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 5, 4, 51, 2> Enum8Metric::_table_ = { +const ::_pbi::TcParseTable<3, 6, 4, 51, 2> Enum8Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_), 0, // no _extensions_ - 5, 8, // max_field_number, fast_idx_mask + 6, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967232, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries + 6, // num_field_entries 4, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Enum8Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional string unit = 4; + {::_pbi::TcParser::MiniParse, {}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Enum8Metric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {34, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_)}}, - // string description = 1; + {18, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_)}}, + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.offset_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 3; + // .abacus.protobuf.Constant constant = 4; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 4; + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // map values = 5; + // map values = 6; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 2, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, }}, {{ @@ -5251,7 +5469,7 @@ const ::_pbi::TcParseTable<1, 5, 4, 51, 2> Enum8Metric::_table_ = { {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Enum8Metric_EnumValue>}, }}, {{ - "\33\13\0\0\4\0\0\0" + "\33\0\13\0\0\4\0\0" "abacus.protobuf.Enum8Metric" "description" "unit" @@ -5265,24 +5483,31 @@ ::uint8_t* Enum8Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.Enum8Metric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } switch (kind_case()) { case kGauge: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::gauge(this), + InternalWriteMessage(3, _Internal::gauge(this), _Internal::gauge(this).GetCachedSize(), target, stream); break; } case kConstant: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::constant(this), + InternalWriteMessage(4, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); break; } @@ -5290,15 +5515,15 @@ ::uint8_t* Enum8Metric::_InternalSerialize( break; } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 4; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.unit"); - target = stream->WriteStringMaybeAliased(4, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // map values = 5; + // map values = 6; if (!_internal_values().empty()) { using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>; using WireHelper = Enum8Metric_ValuesEntry_DoNotUse::Funcs; @@ -5307,12 +5532,12 @@ ::uint8_t* Enum8Metric::_InternalSerialize( if (stream->IsSerializationDeterministic() && field.size() > 1) { for (const auto& entry : ::google::protobuf::internal::MapSorterFlat(field)) { target = WireHelper::InternalSerialize( - 5, entry.first, entry.second, target, stream); + 6, entry.first, entry.second, target, stream); } } else { for (const auto& entry : field) { target = WireHelper::InternalSerialize( - 5, entry.first, entry.second, target, stream); + 6, entry.first, entry.second, target, stream); } } } @@ -5334,33 +5559,39 @@ ::size_t Enum8Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // map values = 5; + // map values = 6; total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_values_size()); for (const auto& entry : _internal_values()) { total_size += Enum8Metric_ValuesEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); } - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); } - // optional string unit = 4; + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_unit()); } + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; case kGauge: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.kind_.gauge_); break; } - // .abacus.protobuf.Constant constant = 3; + // .abacus.protobuf.Constant constant = 4; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -5396,6 +5627,9 @@ void Enum8Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_internal_set_unit(from._internal_unit()); } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } switch (from.kind_case()) { case kGauge: { _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( @@ -5436,6 +5670,7 @@ void Enum8Metric::InternalSwap(Enum8Metric* other) { &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); + swap(_impl_.offset_, other->_impl_.offset_); swap(_impl_.kind_, other->_impl_.kind_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -5482,6 +5717,7 @@ StringMetric::StringMetric(const StringMetric& from) : ::google::protobuf::Messa (void)_this; new (&_impl_) Impl_{ decltype(_impl_.description_){}, + decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -5495,6 +5731,7 @@ StringMetric::StringMetric(const StringMetric& from) : ::google::protobuf::Messa if (!from._internal_description().empty()) { _this->_impl_.description_.Set(from._internal_description(), _this->GetArenaForAllocation()); } + _this->_impl_.offset_ = from._impl_.offset_; clear_has_kind(); switch (from.kind_case()) { case kConstant: { @@ -5513,6 +5750,7 @@ inline void StringMetric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ decltype(_impl_.description_){}, + decltype(_impl_.offset_){0u}, decltype(_impl_.kind_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -5563,6 +5801,7 @@ PROTOBUF_NOINLINE void StringMetric::Clear() { (void) cached_has_bits; _impl_.description_.ClearToEmpty(); + _impl_.offset_ = 0u; clear_kind(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -5575,36 +5814,42 @@ const char* StringMetric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 2, 1, 48, 2> StringMetric::_table_ = { +const ::_pbi::TcParseTable<1, 3, 1, 48, 2> StringMetric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 2, 0, // max_field_number, fast_idx_mask + 3, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 2, // num_field_entries + 3, // num_field_entries 1, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_StringMetric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // string description = 1; + // string description = 2; {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.description_)}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.description_)}}, + // uint32 offset = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(StringMetric, _impl_.offset_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.offset_)}}, }}, {{ 65535, 65535 }}, {{ - // string description = 1; + // uint32 offset = 1; + {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.offset_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, + // string description = 2; {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.description_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Constant constant = 2; + // .abacus.protobuf.Constant constant = 3; {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, }}, {{ {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, }}, {{ - "\34\13\0\0\0\0\0\0" + "\34\0\13\0\0\0\0\0" "abacus.protobuf.StringMetric" "description" }}, @@ -5617,18 +5862,25 @@ ::uint8_t* StringMetric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // string description = 1; + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 1, this->_internal_offset(), 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, "abacus.protobuf.StringMetric.description"); - target = stream->WriteStringMaybeAliased(1, _s, target); + target = stream->WriteStringMaybeAliased(2, _s, target); } - // .abacus.protobuf.Constant constant = 2; + // .abacus.protobuf.Constant constant = 3; if (kind_case() == kConstant) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::constant(this), + InternalWriteMessage(3, _Internal::constant(this), _Internal::constant(this).GetCachedSize(), target, stream); } @@ -5649,14 +5901,20 @@ ::size_t StringMetric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string description = 1; + // string description = 2; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); } + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + switch (kind_case()) { - // .abacus.protobuf.Constant constant = 2; + // .abacus.protobuf.Constant constant = 3; case kConstant: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( @@ -5688,6 +5946,9 @@ void StringMetric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } switch (from.kind_case()) { case kConstant: { _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( @@ -5719,6 +5980,7 @@ void StringMetric::InternalSwap(StringMetric* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, &other->_impl_.description_, rhs_arena); + swap(_impl_.offset_, other->_impl_.offset_); swap(_impl_.kind_, other->_impl_.kind_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -5916,14 +6178,12 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { Metric* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.offset_){}, decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _this->_impl_.offset_ = from._impl_.offset_; clear_has_type(); switch (from.type_case()) { case kUint64: { @@ -5981,7 +6241,6 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { inline void Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.offset_){0u}, decltype(_impl_.type_){}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, @@ -6074,7 +6333,6 @@ PROTOBUF_NOINLINE void Metric::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.offset_ = 0u; clear_type(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -6087,29 +6345,24 @@ const char* Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 10, 9, 0, 2> Metric::_table_ = { +const ::_pbi::TcParseTable<0, 9, 9, 0, 2> Metric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ 11, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294965250, // skipmap + 4294965251, // skipmap offsetof(decltype(_table_), field_entries), - 10, // num_field_entries + 9, // num_field_entries 9, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // uint32 offset = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Metric, _impl_.offset_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // uint32 offset = 1; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.offset_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, // .abacus.protobuf.UInt64Metric uint64 = 3; {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, @@ -6158,13 +6411,6 @@ ::uint8_t* Metric::_InternalSerialize( ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // uint32 offset = 1; - if (this->_internal_offset() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 1, this->_internal_offset(), target); - } - switch (type_case()) { case kUint64: { target = ::google::protobuf::internal::WireFormatLite:: @@ -6240,12 +6486,6 @@ ::size_t Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // uint32 offset = 1; - if (this->_internal_offset() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_offset()); - } - switch (type_case()) { // .abacus.protobuf.UInt64Metric uint64 = 3; case kUint64: { @@ -6332,9 +6572,6 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_offset() != 0) { - _this->_internal_set_offset(from._internal_offset()); - } switch (from.type_case()) { case kUint64: { _this->_internal_mutable_uint64()->::abacus::protobuf::UInt64Metric::MergeFrom( @@ -6402,7 +6639,6 @@ PROTOBUF_NOINLINE bool Metric::IsInitialized() const { void Metric::InternalSwap(Metric* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.offset_, other->_impl_.offset_); swap(_impl_.type_, other->_impl_.type_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index ebf77f31..35d49e3d 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -651,9 +651,9 @@ class UInt64Metric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kCounter = 3, - kConstant = 4, + kGauge = 3, + kCounter = 4, + kConstant = 5, KIND_NOT_SET = 0, }; @@ -734,15 +734,16 @@ class UInt64Metric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 5, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kGaugeFieldNumber = 2, - kCounterFieldNumber = 3, - kConstantFieldNumber = 4, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 6, + kMinFieldNumber = 7, + kMaxFieldNumber = 8, + kOffsetFieldNumber = 1, + kGaugeFieldNumber = 3, + kCounterFieldNumber = 4, + kConstantFieldNumber = 5, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -758,7 +759,7 @@ class UInt64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 6; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -775,7 +776,7 @@ class UInt64Metric final : std::string* _internal_mutable_unit(); public: - // optional uint64 min = 6; + // optional uint64 min = 7; bool has_min() const; void clear_min() ; ::uint64_t min() const; @@ -786,7 +787,7 @@ class UInt64Metric final : void _internal_set_min(::uint64_t value); public: - // optional uint64 max = 7; + // optional uint64 max = 8; bool has_max() const; void clear_max() ; ::uint64_t max() const; @@ -797,7 +798,17 @@ class UInt64Metric final : void _internal_set_max(::uint64_t value); public: - // .abacus.protobuf.Gauge gauge = 2; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -816,7 +827,7 @@ class UInt64Metric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; bool has_counter() const; private: bool _internal_has_counter() const; @@ -835,7 +846,7 @@ class UInt64Metric final : ::abacus::protobuf::Counter* _internal_mutable_counter(); public: - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; bool has_constant() const; private: bool _internal_has_constant() const; @@ -867,7 +878,7 @@ class UInt64Metric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 52, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 60, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -878,6 +889,7 @@ class UInt64Metric final : ::google::protobuf::internal::ArenaStringPtr unit_; ::uint64_t min_; ::uint64_t max_; + ::uint32_t offset_; union KindUnion { constexpr KindUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -945,9 +957,9 @@ class Int64Metric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kCounter = 3, - kConstant = 4, + kGauge = 3, + kCounter = 4, + kConstant = 5, KIND_NOT_SET = 0, }; @@ -1028,15 +1040,16 @@ class Int64Metric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 5, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kGaugeFieldNumber = 2, - kCounterFieldNumber = 3, - kConstantFieldNumber = 4, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 6, + kMinFieldNumber = 7, + kMaxFieldNumber = 8, + kOffsetFieldNumber = 1, + kGaugeFieldNumber = 3, + kCounterFieldNumber = 4, + kConstantFieldNumber = 5, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -1052,7 +1065,7 @@ class Int64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 6; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1069,7 +1082,7 @@ class Int64Metric final : std::string* _internal_mutable_unit(); public: - // optional int64 min = 6; + // optional int64 min = 7; bool has_min() const; void clear_min() ; ::int64_t min() const; @@ -1080,7 +1093,7 @@ class Int64Metric final : void _internal_set_min(::int64_t value); public: - // optional int64 max = 7; + // optional int64 max = 8; bool has_max() const; void clear_max() ; ::int64_t max() const; @@ -1091,7 +1104,17 @@ class Int64Metric final : void _internal_set_max(::int64_t value); public: - // .abacus.protobuf.Gauge gauge = 2; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -1110,7 +1133,7 @@ class Int64Metric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; bool has_counter() const; private: bool _internal_has_counter() const; @@ -1129,7 +1152,7 @@ class Int64Metric final : ::abacus::protobuf::Counter* _internal_mutable_counter(); public: - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; bool has_constant() const; private: bool _internal_has_constant() const; @@ -1161,7 +1184,7 @@ class Int64Metric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 59, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1172,6 +1195,7 @@ class Int64Metric final : ::google::protobuf::internal::ArenaStringPtr unit_; ::int64_t min_; ::int64_t max_; + ::uint32_t offset_; union KindUnion { constexpr KindUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -1239,9 +1263,9 @@ class UInt32Metric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kCounter = 3, - kConstant = 4, + kGauge = 3, + kCounter = 4, + kConstant = 5, KIND_NOT_SET = 0, }; @@ -1322,15 +1346,16 @@ class UInt32Metric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 5, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kGaugeFieldNumber = 2, - kCounterFieldNumber = 3, - kConstantFieldNumber = 4, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 6, + kOffsetFieldNumber = 1, + kMinFieldNumber = 7, + kMaxFieldNumber = 8, + kGaugeFieldNumber = 3, + kCounterFieldNumber = 4, + kConstantFieldNumber = 5, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -1346,7 +1371,7 @@ class UInt32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 6; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1363,7 +1388,17 @@ class UInt32Metric final : std::string* _internal_mutable_unit(); public: - // optional uint32 min = 6; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // optional uint32 min = 7; bool has_min() const; void clear_min() ; ::uint32_t min() const; @@ -1374,7 +1409,7 @@ class UInt32Metric final : void _internal_set_min(::uint32_t value); public: - // optional uint32 max = 7; + // optional uint32 max = 8; bool has_max() const; void clear_max() ; ::uint32_t max() const; @@ -1385,7 +1420,7 @@ class UInt32Metric final : void _internal_set_max(::uint32_t value); public: - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -1404,7 +1439,7 @@ class UInt32Metric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; bool has_counter() const; private: bool _internal_has_counter() const; @@ -1423,7 +1458,7 @@ class UInt32Metric final : ::abacus::protobuf::Counter* _internal_mutable_counter(); public: - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; bool has_constant() const; private: bool _internal_has_constant() const; @@ -1455,7 +1490,7 @@ class UInt32Metric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 52, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 60, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1464,6 +1499,7 @@ class UInt32Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; ::uint32_t min_; ::uint32_t max_; union KindUnion { @@ -1533,9 +1569,9 @@ class Int32Metric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kCounter = 3, - kConstant = 4, + kGauge = 3, + kCounter = 4, + kConstant = 5, KIND_NOT_SET = 0, }; @@ -1616,15 +1652,16 @@ class Int32Metric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 5, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kGaugeFieldNumber = 2, - kCounterFieldNumber = 3, - kConstantFieldNumber = 4, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 6, + kOffsetFieldNumber = 1, + kMinFieldNumber = 7, + kMaxFieldNumber = 8, + kGaugeFieldNumber = 3, + kCounterFieldNumber = 4, + kConstantFieldNumber = 5, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -1640,7 +1677,7 @@ class Int32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 6; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1657,7 +1694,17 @@ class Int32Metric final : std::string* _internal_mutable_unit(); public: - // optional int32 min = 6; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // optional int32 min = 7; bool has_min() const; void clear_min() ; ::int32_t min() const; @@ -1668,7 +1715,7 @@ class Int32Metric final : void _internal_set_min(::int32_t value); public: - // optional int32 max = 7; + // optional int32 max = 8; bool has_max() const; void clear_max() ; ::int32_t max() const; @@ -1679,7 +1726,7 @@ class Int32Metric final : void _internal_set_max(::int32_t value); public: - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -1698,7 +1745,7 @@ class Int32Metric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; bool has_counter() const; private: bool _internal_has_counter() const; @@ -1717,7 +1764,7 @@ class Int32Metric final : ::abacus::protobuf::Counter* _internal_mutable_counter(); public: - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; bool has_constant() const; private: bool _internal_has_constant() const; @@ -1749,7 +1796,7 @@ class Int32Metric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 59, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1758,6 +1805,7 @@ class Int32Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; ::int32_t min_; ::int32_t max_; union KindUnion { @@ -1827,9 +1875,9 @@ class Float64Metric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kCounter = 3, - kConstant = 4, + kGauge = 3, + kCounter = 4, + kConstant = 5, KIND_NOT_SET = 0, }; @@ -1910,15 +1958,16 @@ class Float64Metric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 5, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kGaugeFieldNumber = 2, - kCounterFieldNumber = 3, - kConstantFieldNumber = 4, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 6, + kMinFieldNumber = 7, + kMaxFieldNumber = 8, + kOffsetFieldNumber = 1, + kGaugeFieldNumber = 3, + kCounterFieldNumber = 4, + kConstantFieldNumber = 5, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -1934,7 +1983,7 @@ class Float64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 6; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1951,7 +2000,7 @@ class Float64Metric final : std::string* _internal_mutable_unit(); public: - // optional double min = 6; + // optional double min = 7; bool has_min() const; void clear_min() ; double min() const; @@ -1962,7 +2011,7 @@ class Float64Metric final : void _internal_set_min(double value); public: - // optional double max = 7; + // optional double max = 8; bool has_max() const; void clear_max() ; double max() const; @@ -1973,7 +2022,17 @@ class Float64Metric final : void _internal_set_max(double value); public: - // .abacus.protobuf.Gauge gauge = 2; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -1992,7 +2051,7 @@ class Float64Metric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; bool has_counter() const; private: bool _internal_has_counter() const; @@ -2011,7 +2070,7 @@ class Float64Metric final : ::abacus::protobuf::Counter* _internal_mutable_counter(); public: - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; bool has_constant() const; private: bool _internal_has_constant() const; @@ -2043,7 +2102,7 @@ class Float64Metric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 53, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 61, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2054,6 +2113,7 @@ class Float64Metric final : ::google::protobuf::internal::ArenaStringPtr unit_; double min_; double max_; + ::uint32_t offset_; union KindUnion { constexpr KindUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -2121,9 +2181,9 @@ class Float32Metric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kCounter = 3, - kConstant = 4, + kGauge = 3, + kCounter = 4, + kConstant = 5, KIND_NOT_SET = 0, }; @@ -2204,15 +2264,16 @@ class Float32Metric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 5, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kGaugeFieldNumber = 2, - kCounterFieldNumber = 3, - kConstantFieldNumber = 4, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 6, + kOffsetFieldNumber = 1, + kMinFieldNumber = 7, + kMaxFieldNumber = 8, + kGaugeFieldNumber = 3, + kCounterFieldNumber = 4, + kConstantFieldNumber = 5, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -2228,7 +2289,7 @@ class Float32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 6; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -2245,7 +2306,17 @@ class Float32Metric final : std::string* _internal_mutable_unit(); public: - // optional float min = 6; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // optional float min = 7; bool has_min() const; void clear_min() ; float min() const; @@ -2256,7 +2327,7 @@ class Float32Metric final : void _internal_set_min(float value); public: - // optional float max = 7; + // optional float max = 8; bool has_max() const; void clear_max() ; float max() const; @@ -2267,7 +2338,7 @@ class Float32Metric final : void _internal_set_max(float value); public: - // .abacus.protobuf.Gauge gauge = 2; + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -2286,7 +2357,7 @@ class Float32Metric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Counter counter = 3; + // .abacus.protobuf.Counter counter = 4; bool has_counter() const; private: bool _internal_has_counter() const; @@ -2305,7 +2376,7 @@ class Float32Metric final : ::abacus::protobuf::Counter* _internal_mutable_counter(); public: - // .abacus.protobuf.Constant constant = 4; + // .abacus.protobuf.Constant constant = 5; bool has_constant() const; private: bool _internal_has_constant() const; @@ -2337,7 +2408,7 @@ class Float32Metric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 3, 53, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 61, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2346,6 +2417,7 @@ class Float32Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; float min_; float max_; union KindUnion { @@ -2415,8 +2487,8 @@ class BoolMetric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kConstant = 3, + kGauge = 3, + kConstant = 4, KIND_NOT_SET = 0, }; @@ -2497,12 +2569,13 @@ class BoolMetric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 4, - kGaugeFieldNumber = 2, - kConstantFieldNumber = 3, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 5, + kOffsetFieldNumber = 1, + kGaugeFieldNumber = 3, + kConstantFieldNumber = 4, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -2518,7 +2591,7 @@ class BoolMetric final : std::string* _internal_mutable_description(); public: - // optional string unit = 4; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -2535,7 +2608,17 @@ class BoolMetric final : std::string* _internal_mutable_unit(); public: - // .abacus.protobuf.Gauge gauge = 2; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -2554,7 +2637,7 @@ class BoolMetric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Constant constant = 3; + // .abacus.protobuf.Constant constant = 4; bool has_constant() const; private: bool _internal_has_constant() const; @@ -2585,7 +2668,7 @@ class BoolMetric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 4, 2, 50, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 2, 50, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2594,6 +2677,7 @@ class BoolMetric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; union KindUnion { constexpr KindUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -2868,8 +2952,8 @@ class Enum8Metric final : return *internal_default_instance(); } enum KindCase { - kGauge = 2, - kConstant = 3, + kGauge = 3, + kConstant = 4, KIND_NOT_SET = 0, }; @@ -2952,13 +3036,14 @@ class Enum8Metric final : // accessors ------------------------------------------------------- enum : int { - kValuesFieldNumber = 5, - kDescriptionFieldNumber = 1, - kUnitFieldNumber = 4, - kGaugeFieldNumber = 2, - kConstantFieldNumber = 3, + kValuesFieldNumber = 6, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 5, + kOffsetFieldNumber = 1, + kGaugeFieldNumber = 3, + kConstantFieldNumber = 4, }; - // map values = 5; + // map values = 6; int values_size() const; private: int _internal_values_size() const; @@ -2973,7 +3058,7 @@ class Enum8Metric final : ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* _internal_mutable_values(); public: - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -2989,7 +3074,7 @@ class Enum8Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 4; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -3006,7 +3091,17 @@ class Enum8Metric final : std::string* _internal_mutable_unit(); public: - // .abacus.protobuf.Gauge gauge = 2; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // .abacus.protobuf.Gauge gauge = 3; bool has_gauge() const; private: bool _internal_has_gauge() const; @@ -3025,7 +3120,7 @@ class Enum8Metric final : ::abacus::protobuf::Gauge* _internal_mutable_gauge(); public: - // .abacus.protobuf.Constant constant = 3; + // .abacus.protobuf.Constant constant = 4; bool has_constant() const; private: bool _internal_has_constant() const; @@ -3056,7 +3151,7 @@ class Enum8Metric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 5, 4, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 6, 4, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -3069,6 +3164,7 @@ class Enum8Metric final : values_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; union KindUnion { constexpr KindUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -3135,7 +3231,7 @@ class StringMetric final : return *internal_default_instance(); } enum KindCase { - kConstant = 2, + kConstant = 3, KIND_NOT_SET = 0, }; @@ -3216,10 +3312,11 @@ class StringMetric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 1, - kConstantFieldNumber = 2, + kDescriptionFieldNumber = 2, + kOffsetFieldNumber = 1, + kConstantFieldNumber = 3, }; - // string description = 1; + // string description = 2; void clear_description() ; const std::string& description() const; template @@ -3235,7 +3332,17 @@ class StringMetric final : std::string* _internal_mutable_description(); public: - // .abacus.protobuf.Constant constant = 2; + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // .abacus.protobuf.Constant constant = 3; bool has_constant() const; private: bool _internal_has_constant() const; @@ -3265,12 +3372,13 @@ class StringMetric final : inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 2, 1, 48, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 3, 1, 48, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::google::protobuf::internal::ArenaStringPtr description_; + ::uint32_t offset_; union KindUnion { constexpr KindUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -3426,7 +3534,6 @@ class Metric final : // accessors ------------------------------------------------------- enum : int { - kOffsetFieldNumber = 1, kUint64FieldNumber = 3, kInt64FieldNumber = 4, kUint32FieldNumber = 5, @@ -3437,16 +3544,6 @@ class Metric final : kEnum8FieldNumber = 10, kStringFieldNumber = 11, }; - // uint32 offset = 1; - void clear_offset() ; - ::uint32_t offset() const; - void set_offset(::uint32_t value); - - private: - ::uint32_t _internal_offset() const; - void _internal_set_offset(::uint32_t value); - - public: // .abacus.protobuf.UInt64Metric uint64 = 3; bool has_uint64() const; private: @@ -3637,12 +3734,11 @@ class Metric final : inline void clear_has_type(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 10, 9, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<0, 9, 9, 0, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::uint32_t offset_; union TypeUnion { constexpr TypeUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; @@ -3966,7 +4062,29 @@ inline void Counter::_internal_set_optional(bool value) { // UInt64Metric -// string description = 1; +// uint32 offset = 1; +inline void UInt64Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t UInt64Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.offset) + return _internal_offset(); +} +inline void UInt64Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.offset) +} +inline ::uint32_t UInt64Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void UInt64Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void UInt64Metric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -4017,7 +4135,7 @@ inline void UInt64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool UInt64Metric::has_gauge() const { return kind_case() == kGauge; } @@ -4091,7 +4209,7 @@ inline ::abacus::protobuf::Gauge* UInt64Metric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Counter counter = 3; +// .abacus.protobuf.Counter counter = 4; inline bool UInt64Metric::has_counter() const { return kind_case() == kCounter; } @@ -4165,7 +4283,7 @@ inline ::abacus::protobuf::Counter* UInt64Metric::mutable_counter() { return _msg; } -// .abacus.protobuf.Constant constant = 4; +// .abacus.protobuf.Constant constant = 5; inline bool UInt64Metric::has_constant() const { return kind_case() == kConstant; } @@ -4239,7 +4357,7 @@ inline ::abacus::protobuf::Constant* UInt64Metric::mutable_constant() { return _msg; } -// optional string unit = 5; +// optional string unit = 6; inline bool UInt64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4308,7 +4426,7 @@ inline void UInt64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.unit) } -// optional uint64 min = 6; +// optional uint64 min = 7; inline bool UInt64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -4335,7 +4453,7 @@ inline void UInt64Metric::_internal_set_min(::uint64_t value) { _impl_.min_ = value; } -// optional uint64 max = 7; +// optional uint64 max = 8; inline bool UInt64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4375,7 +4493,29 @@ inline UInt64Metric::KindCase UInt64Metric::kind_case() const { // Int64Metric -// string description = 1; +// uint32 offset = 1; +inline void Int64Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t Int64Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.offset) + return _internal_offset(); +} +inline void Int64Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.offset) +} +inline ::uint32_t Int64Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void Int64Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void Int64Metric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -4426,7 +4566,7 @@ inline void Int64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool Int64Metric::has_gauge() const { return kind_case() == kGauge; } @@ -4500,7 +4640,7 @@ inline ::abacus::protobuf::Gauge* Int64Metric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Counter counter = 3; +// .abacus.protobuf.Counter counter = 4; inline bool Int64Metric::has_counter() const { return kind_case() == kCounter; } @@ -4574,7 +4714,7 @@ inline ::abacus::protobuf::Counter* Int64Metric::mutable_counter() { return _msg; } -// .abacus.protobuf.Constant constant = 4; +// .abacus.protobuf.Constant constant = 5; inline bool Int64Metric::has_constant() const { return kind_case() == kConstant; } @@ -4648,7 +4788,7 @@ inline ::abacus::protobuf::Constant* Int64Metric::mutable_constant() { return _msg; } -// optional string unit = 5; +// optional string unit = 6; inline bool Int64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4717,7 +4857,7 @@ inline void Int64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.unit) } -// optional int64 min = 6; +// optional int64 min = 7; inline bool Int64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -4744,7 +4884,7 @@ inline void Int64Metric::_internal_set_min(::int64_t value) { _impl_.min_ = value; } -// optional int64 max = 7; +// optional int64 max = 8; inline bool Int64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4784,7 +4924,29 @@ inline Int64Metric::KindCase Int64Metric::kind_case() const { // UInt32Metric -// string description = 1; +// uint32 offset = 1; +inline void UInt32Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t UInt32Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.offset) + return _internal_offset(); +} +inline void UInt32Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.offset) +} +inline ::uint32_t UInt32Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void UInt32Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void UInt32Metric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -4835,7 +4997,7 @@ inline void UInt32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool UInt32Metric::has_gauge() const { return kind_case() == kGauge; } @@ -4909,7 +5071,7 @@ inline ::abacus::protobuf::Gauge* UInt32Metric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Counter counter = 3; +// .abacus.protobuf.Counter counter = 4; inline bool UInt32Metric::has_counter() const { return kind_case() == kCounter; } @@ -4983,7 +5145,7 @@ inline ::abacus::protobuf::Counter* UInt32Metric::mutable_counter() { return _msg; } -// .abacus.protobuf.Constant constant = 4; +// .abacus.protobuf.Constant constant = 5; inline bool UInt32Metric::has_constant() const { return kind_case() == kConstant; } @@ -5057,7 +5219,7 @@ inline ::abacus::protobuf::Constant* UInt32Metric::mutable_constant() { return _msg; } -// optional string unit = 5; +// optional string unit = 6; inline bool UInt32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -5126,7 +5288,7 @@ inline void UInt32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.unit) } -// optional uint32 min = 6; +// optional uint32 min = 7; inline bool UInt32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -5153,7 +5315,7 @@ inline void UInt32Metric::_internal_set_min(::uint32_t value) { _impl_.min_ = value; } -// optional uint32 max = 7; +// optional uint32 max = 8; inline bool UInt32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -5193,7 +5355,29 @@ inline UInt32Metric::KindCase UInt32Metric::kind_case() const { // Int32Metric -// string description = 1; +// uint32 offset = 1; +inline void Int32Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t Int32Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.offset) + return _internal_offset(); +} +inline void Int32Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.offset) +} +inline ::uint32_t Int32Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void Int32Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void Int32Metric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -5244,7 +5428,7 @@ inline void Int32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool Int32Metric::has_gauge() const { return kind_case() == kGauge; } @@ -5318,7 +5502,7 @@ inline ::abacus::protobuf::Gauge* Int32Metric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Counter counter = 3; +// .abacus.protobuf.Counter counter = 4; inline bool Int32Metric::has_counter() const { return kind_case() == kCounter; } @@ -5392,7 +5576,7 @@ inline ::abacus::protobuf::Counter* Int32Metric::mutable_counter() { return _msg; } -// .abacus.protobuf.Constant constant = 4; +// .abacus.protobuf.Constant constant = 5; inline bool Int32Metric::has_constant() const { return kind_case() == kConstant; } @@ -5466,7 +5650,7 @@ inline ::abacus::protobuf::Constant* Int32Metric::mutable_constant() { return _msg; } -// optional string unit = 5; +// optional string unit = 6; inline bool Int32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -5535,7 +5719,7 @@ inline void Int32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.unit) } -// optional int32 min = 6; +// optional int32 min = 7; inline bool Int32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -5562,7 +5746,7 @@ inline void Int32Metric::_internal_set_min(::int32_t value) { _impl_.min_ = value; } -// optional int32 max = 7; +// optional int32 max = 8; inline bool Int32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -5602,7 +5786,29 @@ inline Int32Metric::KindCase Int32Metric::kind_case() const { // Float64Metric -// string description = 1; +// uint32 offset = 1; +inline void Float64Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t Float64Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.offset) + return _internal_offset(); +} +inline void Float64Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.offset) +} +inline ::uint32_t Float64Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void Float64Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void Float64Metric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -5653,7 +5859,7 @@ inline void Float64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool Float64Metric::has_gauge() const { return kind_case() == kGauge; } @@ -5727,7 +5933,7 @@ inline ::abacus::protobuf::Gauge* Float64Metric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Counter counter = 3; +// .abacus.protobuf.Counter counter = 4; inline bool Float64Metric::has_counter() const { return kind_case() == kCounter; } @@ -5801,7 +6007,7 @@ inline ::abacus::protobuf::Counter* Float64Metric::mutable_counter() { return _msg; } -// .abacus.protobuf.Constant constant = 4; +// .abacus.protobuf.Constant constant = 5; inline bool Float64Metric::has_constant() const { return kind_case() == kConstant; } @@ -5875,7 +6081,7 @@ inline ::abacus::protobuf::Constant* Float64Metric::mutable_constant() { return _msg; } -// optional string unit = 5; +// optional string unit = 6; inline bool Float64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -5944,7 +6150,7 @@ inline void Float64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.unit) } -// optional double min = 6; +// optional double min = 7; inline bool Float64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -5971,7 +6177,7 @@ inline void Float64Metric::_internal_set_min(double value) { _impl_.min_ = value; } -// optional double max = 7; +// optional double max = 8; inline bool Float64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -6011,7 +6217,29 @@ inline Float64Metric::KindCase Float64Metric::kind_case() const { // Float32Metric -// string description = 1; +// uint32 offset = 1; +inline void Float32Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t Float32Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.offset) + return _internal_offset(); +} +inline void Float32Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.offset) +} +inline ::uint32_t Float32Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void Float32Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void Float32Metric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -6062,7 +6290,7 @@ inline void Float32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool Float32Metric::has_gauge() const { return kind_case() == kGauge; } @@ -6136,7 +6364,7 @@ inline ::abacus::protobuf::Gauge* Float32Metric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Counter counter = 3; +// .abacus.protobuf.Counter counter = 4; inline bool Float32Metric::has_counter() const { return kind_case() == kCounter; } @@ -6210,7 +6438,7 @@ inline ::abacus::protobuf::Counter* Float32Metric::mutable_counter() { return _msg; } -// .abacus.protobuf.Constant constant = 4; +// .abacus.protobuf.Constant constant = 5; inline bool Float32Metric::has_constant() const { return kind_case() == kConstant; } @@ -6284,7 +6512,7 @@ inline ::abacus::protobuf::Constant* Float32Metric::mutable_constant() { return _msg; } -// optional string unit = 5; +// optional string unit = 6; inline bool Float32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -6353,7 +6581,7 @@ inline void Float32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.unit) } -// optional float min = 6; +// optional float min = 7; inline bool Float32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -6380,7 +6608,7 @@ inline void Float32Metric::_internal_set_min(float value) { _impl_.min_ = value; } -// optional float max = 7; +// optional float max = 8; inline bool Float32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -6420,7 +6648,29 @@ inline Float32Metric::KindCase Float32Metric::kind_case() const { // BoolMetric -// string description = 1; +// uint32 offset = 1; +inline void BoolMetric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t BoolMetric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.offset) + return _internal_offset(); +} +inline void BoolMetric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.offset) +} +inline ::uint32_t BoolMetric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void BoolMetric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void BoolMetric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -6471,7 +6721,7 @@ inline void BoolMetric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool BoolMetric::has_gauge() const { return kind_case() == kGauge; } @@ -6545,7 +6795,7 @@ inline ::abacus::protobuf::Gauge* BoolMetric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Constant constant = 3; +// .abacus.protobuf.Constant constant = 4; inline bool BoolMetric::has_constant() const { return kind_case() == kConstant; } @@ -6619,7 +6869,7 @@ inline ::abacus::protobuf::Constant* BoolMetric::mutable_constant() { return _msg; } -// optional string unit = 4; +// optional string unit = 5; inline bool BoolMetric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -6827,7 +7077,29 @@ inline void Enum8Metric_EnumValue::set_allocated_description(std::string* value) // Enum8Metric -// string description = 1; +// uint32 offset = 1; +inline void Enum8Metric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t Enum8Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.offset) + return _internal_offset(); +} +inline void Enum8Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.offset) +} +inline ::uint32_t Enum8Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void Enum8Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void Enum8Metric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -6878,7 +7150,7 @@ inline void Enum8Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.description) } -// .abacus.protobuf.Gauge gauge = 2; +// .abacus.protobuf.Gauge gauge = 3; inline bool Enum8Metric::has_gauge() const { return kind_case() == kGauge; } @@ -6952,7 +7224,7 @@ inline ::abacus::protobuf::Gauge* Enum8Metric::mutable_gauge() { return _msg; } -// .abacus.protobuf.Constant constant = 3; +// .abacus.protobuf.Constant constant = 4; inline bool Enum8Metric::has_constant() const { return kind_case() == kConstant; } @@ -7026,7 +7298,7 @@ inline ::abacus::protobuf::Constant* Enum8Metric::mutable_constant() { return _msg; } -// optional string unit = 4; +// optional string unit = 5; inline bool Enum8Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -7095,7 +7367,7 @@ inline void Enum8Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.unit) } -// map values = 5; +// map values = 6; inline int Enum8Metric::_internal_values_size() const { return _internal_values().size(); } @@ -7135,7 +7407,29 @@ inline Enum8Metric::KindCase Enum8Metric::kind_case() const { // StringMetric -// string description = 1; +// uint32 offset = 1; +inline void StringMetric::clear_offset() { + _impl_.offset_ = 0u; +} +inline ::uint32_t StringMetric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.StringMetric.offset) + return _internal_offset(); +} +inline void StringMetric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.StringMetric.offset) +} +inline ::uint32_t StringMetric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; +} +inline void StringMetric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; +} + +// string description = 2; inline void StringMetric::clear_description() { _impl_.description_.ClearToEmpty(); } @@ -7186,7 +7480,7 @@ inline void StringMetric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.StringMetric.description) } -// .abacus.protobuf.Constant constant = 2; +// .abacus.protobuf.Constant constant = 3; inline bool StringMetric::has_constant() const { return kind_case() == kConstant; } @@ -7273,28 +7567,6 @@ inline StringMetric::KindCase StringMetric::kind_case() const { // Metric -// uint32 offset = 1; -inline void Metric::clear_offset() { - _impl_.offset_ = 0u; -} -inline ::uint32_t Metric::offset() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.offset) - return _internal_offset(); -} -inline void Metric::set_offset(::uint32_t value) { - _internal_set_offset(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Metric.offset) -} -inline ::uint32_t Metric::_internal_offset() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.offset_; -} -inline void Metric::_internal_set_offset(::uint32_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.offset_ = value; -} - // .abacus.protobuf.UInt64Metric uint64 = 3; inline bool Metric::has_uint64() const { return type_case() == kUint64; diff --git a/src/abacus/string.hpp b/src/abacus/string.hpp index 5173a22b..b08a0d19 100644 --- a/src/abacus/string.hpp +++ b/src/abacus/string.hpp @@ -32,6 +32,8 @@ struct string { assert(memory != nullptr); std::memcpy(memory + 1, value.data(), value.size()); + // Set the null terminator + memory[1 + value.size()] = '\0'; } /// Get the value of the metric diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index 464448bf..24b94c73 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -20,7 +20,13 @@ auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, bool minimal) -> std::string { view v; - if (v.set_metadata(parse::metadata(metadata_data, metadata_bytes))) + auto parsed = parse::metadata(metadata_data, metadata_bytes); + if (!parsed.has_value()) + { + return ""; + } + + if (v.set_metadata(parsed.value())) { if (v.set_value_data(value_data, value_bytes)) { diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 1e776561..308aaa0b 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -6,6 +6,7 @@ #include "view.hpp" #include "boolean.hpp" +#include "detail/helpers.hpp" #include "enum8.hpp" #include "float32.hpp" #include "float64.hpp" @@ -97,7 +98,7 @@ auto view::value(const std::string& name) const assert(m_metadata.IsInitialized()); assert(m_value_data != nullptr); auto m = metric(name); - auto offset = m.offset(); + auto offset = detail::get_offset(m); assert(offset < m_value_bytes); if (m_value_data[offset] == 0) diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index bb41cb2b..41ea8c05 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -226,7 +226,7 @@ TEST(test_info, enum8) TEST(test_info, string) { { - uint8_t data[6]; + uint8_t data[7]; std::memset(data, 0, sizeof(data)); data[0] = 1; abacus::string::set_value(data, "hello"); diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index d553262c..75487b06 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -272,23 +272,24 @@ TEST(test_metrics, reset_counters) } static const std::vector expected_metadata = { - 0x08, 0x02, 0x1d, 0x57, 0x84, 0xe9, 0x44, 0x22, 0x2f, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, 0x12, 0x24, 0x08, 0x0d, 0x22, 0x20, - 0x0a, 0x17, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x12, 0x00, 0x2a, 0x03, 0x55, 0x53, 0x44, 0x22, 0x23, 0x0a, 0x07, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, 0x18, 0x08, 0x1f, 0x4a, - 0x14, 0x0a, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, - 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x00, 0x22, 0x34, 0x0a, - 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x08, 0x04, - 0x1a, 0x25, 0x0a, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x00, 0x2a, 0x05, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x32, 0x12, 0x23, 0x08, 0x16, 0x3a, 0x1f, 0x0a, 0x17, 0x41, 0x20, - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x00, 0x2a, - 0x02, 0x6d, 0x73}; + 0x08, 0x02, 0x1d, 0x8d, 0x25, 0xed, 0x54, 0x22, 0x2e, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, 0x23, 0x3a, 0x21, 0x08, 0x16, + 0x12, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, + 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x1a, 0x00, 0x32, 0x02, 0x6d, 0x73, 0x22, 0x34, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x1a, 0x27, 0x08, 0x04, + 0x12, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x22, 0x00, 0x32, 0x05, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x22, 0x23, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, + 0x12, 0x18, 0x4a, 0x16, 0x08, 0x1f, 0x12, 0x10, 0x41, 0x20, 0x62, 0x6f, + 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x1a, 0x00, 0x22, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x31, 0x12, 0x24, 0x22, 0x22, 0x08, 0x0d, 0x12, 0x17, 0x41, 0x20, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, + 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x00, 0x32, 0x03, + 0x55, 0x53, 0x44, +}; static const std::vector expected_value_data = { 0x01, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, @@ -356,13 +357,16 @@ TEST(test_metrics, protocol_version) auto expected = abacus::parse::metadata(expected_metadata.data(), expected_metadata.size()); + ASSERT_TRUE(expected.has_value()); auto actual = metrics.metadata(); - expected.set_sync_value(1); + expected.value().set_sync_value(1); actual.set_sync_value(1); - EXPECT_TRUE(google::protobuf::util::MessageDifferencer::Equals(expected, - actual)); + ASSERT_TRUE(expected.value().IsInitialized()); + ASSERT_TRUE(actual.IsInitialized()); + EXPECT_TRUE(google::protobuf::util::MessageDifferencer::Equals( + expected.value(), actual)); } EXPECT_EQ(metrics.value_bytes() - 4U, expected_value_data.size()); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index f93c4588..5ced8d14 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -71,7 +71,6 @@ TEST(test_to_json, to_json_minimal) static const char* expected_json = R"({ "metric0" : { - "offset" : 4, "uint64" : { "counter" : { "optional" : false @@ -79,6 +78,7 @@ static const char* expected_json = R"({ "description" : "An unsigned integer metric", "max" : "100", "min" : "0", + "offset" : 4, "unit" : "bytes" }, "value" : 42 @@ -91,9 +91,9 @@ static const char* expected_json = R"({ }, "max" : "100", "min" : "-100", + "offset" : 13, "unit" : "USD" }, - "offset" : 13, "value" : -42 }, "metric2" : { @@ -101,9 +101,9 @@ static const char* expected_json = R"({ "constant" : { }, - "description" : "A boolean constant" + "description" : "A boolean constant", + "offset" : 22 }, - "offset" : 22, "value" : true }, "metric3" : { @@ -112,6 +112,7 @@ static const char* expected_json = R"({ "gauge" : { "optional" : false }, + "offset" : 24, "values" : { "0" : { "description" : "The value for 0", @@ -131,7 +132,6 @@ static const char* expected_json = R"({ } } }, - "offset" : 24, "value" : 2 } })"; From f8f6e2dc13da34886bae0f68db6da8fb3e469165 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Fri, 31 Jan 2025 22:02:11 +0100 Subject: [PATCH 50/68] working on it --- examples/metrics_simple.cpp | 18 +- protobuf/metrics.proto | 161 +- src/abacus/boolean.hpp | 4 +- src/abacus/constant.hpp | 56 + src/abacus/detail/helpers.hpp | 119 +- src/abacus/enum8.hpp | 4 +- src/abacus/float32.hpp | 5 +- src/abacus/float64.hpp | 5 +- src/abacus/info.hpp | 6 +- src/abacus/int32.hpp | 5 +- src/abacus/int64.hpp | 5 +- src/abacus/kind.hpp | 29 +- src/abacus/metrics.cpp | 464 +-- src/abacus/protobuf/metrics.pb.cc | 4139 +++++++------------ src/abacus/protobuf/metrics.pb.h | 6195 ++++++++++------------------- src/abacus/string.hpp | 58 - src/abacus/uint32.hpp | 5 +- src/abacus/uint64.hpp | 5 +- 18 files changed, 3914 insertions(+), 7369 deletions(-) create mode 100644 src/abacus/constant.hpp delete mode 100644 src/abacus/string.hpp diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 8fa7ec8a..38491acd 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -16,23 +16,25 @@ int main() { std::map infos = { {abacus::name{"fuel_consumption"}, - abacus::float64{ - abacus::constant{22.3}, + abacus::constant{ + abacus::value{22.3}, abacus::description{"Fuel consumption in kilometers per liter"}, abacus::unit{"km/l"}}}, {abacus::name{"wheels"}, - abacus::uint64{abacus::constant{4UL}, - abacus::description{"Wheels on the car"}, - abacus::unit{"wheels"}}}, + abacus::constant{abacus::value{4UL}, + abacus::description{"Wheels on the car"}, + abacus::unit{"wheels"}}}, {abacus::name{"days_until_maintenance"}, abacus::int64{ - abacus::gauge{abacus::required}, + abacus::kind::gauge, abacus::required, abacus::description{"Days until next maintenance, if less than 0, " "maintenance is overdue"}, abacus::unit{"days"}}}, {abacus::name{"registered"}, - abacus::boolean{abacus::gauge{abacus::optional}, - abacus::description{"Is the car registered"}}}}; + abacus::boolean{abacus::optional, + abacus::description{"Is the car registered"}}}, + {abacus::name{"license_plate"}, + abacus::constant{abacus::value{"ABC-1234"}}}}; abacus::metrics car(infos); diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index e3fa91a9..ed0945cb 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -8,124 +8,83 @@ enum Endianness { BIG = 1; // Big-endian byte order } -// A gauge used when the value can increase or decrease -message Gauge{ - - // Whether the metric is optional - bool optional = 1; -} - -// A counter used when the value is ever-increasing -message Counter{ - - // Whether the metric is optional - bool optional = 1; -} - -// A constant used when the value is fixed -message Constant{ +enum Kind { + GAUGE = 0; // Gauge metric + COUNTER = 1; // Counter metric } // Metadata for unsigned 64-bit metrics message UInt64Metric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Counter counter = 4; // Counter metric - Constant constant = 5; // Constant metric - } - optional string unit = 6; // Unit of measurement - optional uint64 min = 7; // Minimum allowable value - optional uint64 max = 8; // Maximum allowable value + bool optional = 3; // Whether the metric is optional + Kind kind = 4; // The kind of metric + optional string unit = 5; // Unit of measurement + optional uint64 min = 6; // Minimum allowable value + optional uint64 max = 7; // Maximum allowable value } // Metadata for signed 64-bit metrics message Int64Metric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Counter counter = 4; // Counter metric - Constant constant = 5; // Constant metric - } - optional string unit = 6; // Unit of measurement - optional int64 min = 7; // Minimum allowable value - optional int64 max = 8; // Maximum allowable value + bool optional = 3; // Whether the metric is optional + Kind kind = 4; // The kind of metric + optional string unit = 5; // Unit of measurement + optional int64 min = 6; // Minimum allowable value + optional int64 max = 7; // Maximum allowable value } // Metadata for unsigned 32-bit metrics message UInt32Metric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Counter counter = 4; // Counter metric - Constant constant = 5; // Constant metric - } - optional string unit = 6; // Unit of measurement - optional uint32 min = 7; // Minimum allowable value - optional uint32 max = 8; // Maximum allowable value + bool optional = 3; // Whether the metric is optional + Kind kind = 4; // The kind of metric + optional string unit = 5; // Unit of measurement + optional uint32 min = 6; // Minimum allowable value + optional uint32 max = 7; // Maximum allowable value } // Metadata for signed 32-bit metrics message Int32Metric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Counter counter = 4; // Counter metric - Constant constant = 5; // Constant metric - } - optional string unit = 6; // Unit of measurement - optional int32 min = 7; // Minimum allowable value - optional int32 max = 8; // Maximum allowable value + bool optional = 3; // Whether the metric is optional + Kind kind = 4; // The kind of metric + optional string unit = 5; // Unit of measurement + optional int32 min = 6; // Minimum allowable value + optional int32 max = 7; // Maximum allowable value } // Metadata for 64-bit floating-point metrics message Float64Metric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Counter counter = 4; // Counter metric - Constant constant = 5; // Constant metric - } - optional string unit = 6; // Unit of measurement - optional double min = 7; // Minimum allowable value - optional double max = 8; // Maximum allowable value + bool optional = 3; // Whether the metric is optional + Kind kind = 4; // The kind of metric + optional string unit = 5; // Unit of measurement + optional double min = 6; // Minimum allowable value + optional double max = 7; // Maximum allowable value } // Metadata for 32-bit floating-point metrics message Float32Metric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Counter counter = 4; // Counter metric - Constant constant = 5; // Constant metric - } - optional string unit = 6; // Unit of measurement - optional float min = 7; // Minimum allowable value - optional float max = 8; // Maximum allowable value + bool optional = 3; // Whether the metric is optional + Kind kind = 4; // The kind of metric + optional string unit = 5; // Unit of measurement + optional float min = 6; // Minimum allowable value + optional float max = 7; // Maximum allowable value } // Metadata for boolean metrics message BoolMetric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Constant constant = 4; // Constant metric - } - optional string unit = 5; // Unit of measurement + bool optional = 3; // Whether the metric is optional + optional string unit = 4; // Unit of measurement } // Metadata for enumerated metrics @@ -134,40 +93,44 @@ message Enum8Metric { string name = 1; // Enum name optional string description = 2; // Enum description } - uint32 offset = 1; // Offset into packed memory for the value + uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - // The kind of metric - oneof kind { - Gauge gauge = 3; // Gauge metric - Constant constant = 4; // Constant metric - } + bool optional = 3; // Whether the metric is optional + map values = 4; // Mapping from packed index to enum info optional string unit = 5; // Unit of measurement - map values = 6; // Mapping from packed index to enum info } -// Metadata for a string metric -message StringMetric { - uint32 offset = 1; // Offset into packed memory for the value - string description = 2; // Metric description - // The kind of metric - oneof kind { - Constant constant = 3; // Constant metric + +// A constant used when the value is fixed +message Constant{ + oneof value { + uint64 uint64 = 1; // Unsigned 64-bit constant value + int64 int64 = 2; // Signed 64-bit constant value + uint32 uint32 = 3; // Unsigned 32-bit constant value + int32 int32 = 4; // Signed 32-bit constant value + float float32 = 5; // 32-bit floating-point constant value + double float64 = 6; // 64-bit floating-point constant value + bool boolean = 7; // Boolean constant value + uint32 enum8 = 8; // Enumerated constant value + string string = 9; // String constant value } + string description = 10; // Metric description + optional string unit = 11; // Unit of measurement } // Metadata for a single metric message Metric { oneof type { - UInt64Metric uint64 = 3; // Metadata for unsigned 64-bit metrics - Int64Metric int64 = 4; // Metadata for signed 64-bit metrics - UInt32Metric uint32 = 5; // Metadata for unsigned 32-bit metrics - Int32Metric int32 = 6; // Metadata for signed 32-bit metrics - Float64Metric float64 = 7; // Metadata for 64-bit floating-point metrics - Float32Metric float32 = 8; // Metadata for 32-bit floating-point metrics - BoolMetric boolean = 9; // Metadata for boolean metrics - Enum8Metric enum8 = 10; // Metadata for enumerated metrics - StringMetric string = 11; // Metadata for a string metric + Constant constant = 1; // Metadata for constant metrics + UInt64Metric uint64 = 2; // Metadata for unsigned 64-bit metrics + Int64Metric int64 = 3; // Metadata for signed 64-bit metrics + UInt32Metric uint32 = 4; // Metadata for unsigned 32-bit metrics + Int32Metric int32 = 5; // Metadata for signed 32-bit metrics + Float64Metric float64 = 6; // Metadata for 64-bit floating-point metrics + Float32Metric float32 = 7; // Metadata for 32-bit floating-point metrics + BoolMetric boolean = 8; // Metadata for boolean metrics + Enum8Metric enum8 = 9; // Metadata for enumerated metrics } } diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index df08c7a0..3aed333e 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -54,8 +54,8 @@ struct boolean return memory[1]; } - /// The kind of the metric - std::variant> kind; + /// The availability of the metric + abacus::availability availability; /// The description of the metric abacus::description description; diff --git a/src/abacus/constant.hpp b/src/abacus/constant.hpp new file mode 100644 index 00000000..c1aad9c6 --- /dev/null +++ b/src/abacus/constant.hpp @@ -0,0 +1,56 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include "description.hpp" +#include "unit.hpp" +#include "version.hpp" + +#include "boolean.hpp" +#include "enum8.hpp" +#include "float32.hpp" +#include "float64.hpp" +#include "int32.hpp" +#include "int64.hpp" +#include "uint32.hpp" +#include "uint64.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +template +struct value +{ + // The value of the constant + T value; +}; + +// Enable class template argument deduction (CTAD) +template +value(T) -> value; + +// Special deduction guide for string literals to deduce std::string +value(const char*) -> value; + +/// Tag type representing a constant kind. +struct constant +{ + // The value of the constant + std::variant, abacus::value, + abacus::value, abacus::value, + abacus::value, abacus::value, + abacus::value, abacus::value, + abacus::value> + value; + // The description of the constant + abacus::description description; + // The unit of the constant + abacus::unit unit{}; +}; +} +} diff --git a/src/abacus/detail/helpers.hpp b/src/abacus/detail/helpers.hpp index f840c3aa..caf9813d 100644 --- a/src/abacus/detail/helpers.hpp +++ b/src/abacus/detail/helpers.hpp @@ -16,70 +16,6 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace detail { - -// Helper to detect the presence of mutable_gauge function -template -struct has_mutable_gauge : std::false_type -{ -}; - -template -struct has_mutable_gauge< - T, std::void_t().mutable_gauge())>> - : std::true_type -{ -}; - -template -inline constexpr bool has_mutable_gauge_v = has_mutable_gauge::value; - -// Helper to detect the presence of counter function -template -struct has_mutable_counter : std::false_type -{ -}; - -template -struct has_mutable_counter< - T, std::void_t().mutable_counter())>> - : std::true_type -{ -}; - -template -inline constexpr bool has_mutable_counter_v = has_mutable_counter::value; - -// Helper to detect the presence of mutable_constant function -template -struct has_mutable_constant : std::false_type -{ -}; - -template -struct has_mutable_constant< - T, std::void_t().mutable_constant())>> - : std::true_type -{ -}; - -template -inline constexpr bool has_mutable_constant_v = has_mutable_constant::value; - -// Helper to detect the presence of offset function -template -struct has_offset : std::false_type -{ -}; - -template -struct has_offset().offset())>> - : std::true_type -{ -}; - -template -inline constexpr bool has_offset_v = has_offset::value; - // Helper to check if a type is in the variant template struct is_in_variant; @@ -93,48 +29,6 @@ struct is_in_variant> template constexpr bool is_in_variant_v = is_in_variant::value; -// Helper to detect the presence of kGauge in an enum -template -struct has_kGauge : std::false_type -{ -}; - -template -struct has_kGauge> : std::true_type -{ -}; - -template -inline constexpr bool has_kGauge_v = has_kGauge::value; - -// Helper to detect the presence of kCounter in an enum -template -struct has_kCounter : std::false_type -{ -}; - -template -struct has_kCounter> : std::true_type -{ -}; - -template -inline constexpr bool has_kCounter_v = has_kCounter::value; - -// Helper to detect the presence of kConstant in an enum -template -struct has_kConstant : std::false_type -{ -}; - -template -struct has_kConstant> : std::true_type -{ -}; - -template -inline constexpr bool has_kConstant_v = has_kConstant::value; - template static inline auto call_type(const protobuf::Metric& metric, const Func& func) -> decltype(func(metric.uint64())) @@ -157,8 +51,6 @@ static inline auto call_type(const protobuf::Metric& metric, const Func& func) return func(metric.boolean()); case protobuf::Metric::kEnum8: return func(metric.enum8()); - case protobuf::Metric::kString: - return func(metric.string()); default: // This should never be reached assert(false); @@ -169,16 +61,7 @@ static inline auto call_type(const protobuf::Metric& metric, const Func& func) static inline std::size_t get_offset(const protobuf::Metric& m) { - return call_type(m, - [](const auto& metric) - { - using Metric = std::decay_t; - if constexpr (has_offset_v) - { - return metric.offset(); - } - return 0U; - }); + return call_type(m, [](const auto& metric) { return metric.offset(); }); } } diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index d27fcc67..d9d25cc2 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -93,8 +93,8 @@ struct enum8 std::string description; }; - /// The metric kind - std::variant> kind; + /// The availability of the metric + abacus::availability availability; /// The metric description abacus::description description; diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index 6ef93624..fd69461e 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -60,7 +60,10 @@ struct float32 } /// The metric kind - std::variant> kind; + abacus::kind kind; + + /// The availability of the metric + abacus::availability availability; /// The metric description abacus::description description; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index 3b3c45c3..1703a9e7 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -58,7 +58,10 @@ struct float64 } /// The metric kind - std::variant> kind; + abacus::kind kind; + + /// The availability of the metric + abacus::availability availability; /// The metric description abacus::description description; diff --git a/src/abacus/info.hpp b/src/abacus/info.hpp index 320d3d87..00f488f6 100644 --- a/src/abacus/info.hpp +++ b/src/abacus/info.hpp @@ -8,12 +8,12 @@ #include #include "boolean.hpp" +#include "constant.hpp" #include "enum8.hpp" #include "float32.hpp" #include "float64.hpp" #include "int32.hpp" #include "int64.hpp" -#include "string.hpp" #include "uint32.hpp" #include "uint64.hpp" namespace abacus @@ -21,7 +21,7 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { /// A variant for all the supported metrics -using info = std::variant; +using info = std::variant; } } diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 0a01e508..63a80e6f 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -54,7 +54,10 @@ struct int32 } /// The metric kind - std::variant> kind; + abacus::kind kind; + + /// The availability of the metric + abacus::availability availability; /// The metric description abacus::description description; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index faab4253..59c86c12 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -54,7 +54,10 @@ struct int64 } /// The metric kind - std::variant> kind; + abacus::kind kind; + + /// The availability of the metric + abacus::availability availability; /// The metric description abacus::description description; diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index 927995dc..ec6c6a57 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -5,38 +5,17 @@ #pragma once -#include "availability.hpp" +#include "protobuf/metrics.pb.h" #include "version.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -/// Tag type representing a gauge kind. -struct gauge +enum class kind { - abacus::availability availability; + gauge = protobuf::Kind::GAUGE, + counter = protobuf::Kind::COUNTER }; - -/// Tag type representing a counter kind. -struct counter -{ - abacus::availability availability; -}; - -/// Tag type representing a constant kind. -template -struct constant -{ - T value; -}; - -// Enable class template argument deduction (CTAD) -template -constant(T) -> constant; - -// Special deduction guide for string literals to deduce std::string -constant(const char*) -> constant; - } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 7372ced0..8298ecdf 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -26,82 +26,8 @@ inline namespace STEINWURF_ABACUS_VERSION static inline auto is_optional(const protobuf::Metric& metric) -> bool { - return detail::call_type( - metric, - [](const auto& metric) - { - using Metric = std::decay_t; - if constexpr (detail::has_kGauge_v) - { - if (metric.kind_case() == Metric::KindCase::kGauge) - { - return metric.gauge().optional(); - } - } - if constexpr (detail::has_kCounter_v) - - { - if (metric.kind_case() == Metric::KindCase::kCounter) - { - return metric.counter().optional(); - } - } - - return false; - }); -} - -static inline bool is_constant(const protobuf::Metric& metric) -{ - return detail::call_type( - metric, - [](const auto& metric) - { - using Metric = std::decay_t; - - if constexpr (detail::has_kConstant_v) - { - return metric.kind_case() == Metric::KindCase::kConstant; - } - return false; - }); -} - -template -static inline auto set_kind(Protobuf& protobuf, const Kind& kind) -{ - // Check if the Protobuf message has a function called mutable_gauge - if constexpr (detail::has_mutable_gauge_v && - detail::is_in_variant_v) - { - if (auto* g = std::get_if(&kind)) - { - protobuf.mutable_gauge()->set_optional( - std::holds_alternative(g->availability)); - return; - } - } - // Check if the Protobuf message has a function called mutable_counter - if constexpr (detail::has_mutable_counter_v && - detail::is_in_variant_v) - { - if (auto* c = std::get_if(&kind)) - { - protobuf.mutable_counter()->set_optional( - std::holds_alternative(c->availability)); - return; - } - } - - if constexpr (detail::has_mutable_constant_v && - detail::is_in_variant_v, Kind>) - { - if (auto* c = std::get_if>(&kind)) - { - protobuf.mutable_constant(); - return; - } - } + return detail::call_type(metric, [](const auto& metric) + { return metric.optional(); }); } metrics::metrics(metrics&& other) noexcept : @@ -118,7 +44,7 @@ metrics::metrics(metrics&& other) noexcept : other.m_initialized.clear(); } -metrics::metrics(const std::map& info) +metrics::metrics(const std::map& infos) { m_metadata = protobuf::MetricsMetadata(); m_metadata.set_protocol_version(protocol_version()); @@ -129,200 +55,190 @@ metrics::metrics(const std::map& info) // The first byte is reserved for the sync value m_value_bytes = sizeof(uint32_t); - std::vector constants; - - for (auto [name, value] : info) + for (auto [name, info] : infos) { protobuf::Metric metric; - - if (auto* m = std::get_if(&value)) + m_initialized[name.value] = false; + if (auto* m = std::get_if(&info)) { - // The offset is incremented by the size of the type - metric.mutable_uint64()->set_offset(m_value_bytes); - m_value_bytes += detail::size_of_type(); - metric.mutable_uint64()->set_description(m->description.value); - - set_kind(*metric.mutable_uint64(), m->kind); + auto* typed_metric = metric.mutable_uint64(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); + typed_metric->set_kind(static_cast(m->kind)); if (!m->unit.empty()) { - metric.mutable_uint64()->set_unit(m->unit.value); + typed_metric->set_unit(m->unit.value); } if (m->min.value.has_value()) { - metric.mutable_uint64()->set_min(m->min.value.value()); + typed_metric->set_min(m->min.value.value()); } if (m->max.value.has_value()) { - metric.mutable_uint64()->set_max(m->max.value.value()); - } - - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); + typed_metric->set_max(m->max.value.value()); } - } - else if (auto* m = std::get_if(&value)) - { // The offset is incremented by the size of the type - metric.mutable_int64()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); - metric.mutable_int64()->set_description(m->description.value); - set_kind(*metric.mutable_int64(), m->kind); + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; + } + else if (auto* m = std::get_if(&info)) + { + auto* typed_metric = metric.mutable_int64(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); + typed_metric->set_kind(static_cast(m->kind)); if (!m->unit.empty()) { - metric.mutable_int64()->set_unit(m->unit.value); + typed_metric->set_unit(m->unit.value); } if (m->min.value.has_value()) { - metric.mutable_int64()->set_min(m->min.value.value()); + typed_metric->set_min(m->min.value.value()); } if (m->max.value.has_value()) { - metric.mutable_int64()->set_max(m->max.value.value()); - } - - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); + typed_metric->set_max(m->max.value.value()); } - } - else if (auto* m = std::get_if(&value)) - { // The offset is incremented by the size of the type - metric.mutable_uint32()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); - metric.mutable_uint32()->set_description(m->description.value); - set_kind(*metric.mutable_uint32(), m->kind); + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; + } + else if (auto* m = std::get_if(&info)) + { + auto* typed_metric = metric.mutable_uint32(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); + typed_metric->set_kind(static_cast(m->kind)); if (!m->unit.empty()) { - metric.mutable_uint32()->set_unit(m->unit.value); + typed_metric->set_unit(m->unit.value); } if (m->min.value.has_value()) { - metric.mutable_uint32()->set_min(m->min.value.value()); + typed_metric->set_min(m->min.value.value()); } if (m->max.value.has_value()) { - metric.mutable_uint32()->set_max(m->max.value.value()); - } - - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); + typed_metric->set_max(m->max.value.value()); } - } - else if (auto* m = std::get_if(&value)) - { // The offset is incremented by the size of the type - metric.mutable_int32()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); - metric.mutable_int32()->set_description(m->description.value); - set_kind(*metric.mutable_int32(), m->kind); + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; + } + else if (auto* m = std::get_if(&info)) + { + auto* typed_metric = metric.mutable_int32(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); + typed_metric->set_kind(static_cast(m->kind)); if (!m->unit.empty()) { - metric.mutable_int32()->set_unit(m->unit.value); + typed_metric->set_unit(m->unit.value); } if (m->min.value.has_value()) { - metric.mutable_int32()->set_min(m->min.value.value()); + typed_metric->set_min(m->min.value.value()); } if (m->max.value.has_value()) { - metric.mutable_int32()->set_max(m->max.value.value()); + typed_metric->set_max(m->max.value.value()); } - - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); - } - } - else if (auto* m = std::get_if(&value)) - { // The offset is incremented by the size of the type - metric.mutable_float64()->set_offset(m_value_bytes); m_value_bytes += detail::size_of_type(); - metric.mutable_float64()->set_description(m->description.value); - - set_kind(*metric.mutable_float64(), m->kind); + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; + } + else if (auto* m = std::get_if(&info)) + { + auto* typed_metric = metric.mutable_float64(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); + typed_metric->set_kind(static_cast(m->kind)); if (!m->unit.empty()) { - metric.mutable_float64()->set_unit(m->unit.value); + typed_metric->set_unit(m->unit.value); } if (m->min.value.has_value()) { - metric.mutable_float64()->set_min(m->min.value.value()); + typed_metric->set_min(m->min.value.value()); } if (m->max.value.has_value()) { - metric.mutable_float64()->set_max(m->max.value.value()); - } - - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); + typed_metric->set_max(m->max.value.value()); } - } - else if (auto* m = std::get_if(&value)) - { - metric.mutable_float32()->set_offset(m_value_bytes); // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.mutable_float32()->set_description(m->description.value); - - set_kind(*metric.mutable_float32(), m->kind); + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; + } + else if (auto* m = std::get_if(&info)) + { + auto* typed_metric = metric.mutable_float32(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); + typed_metric->set_kind(static_cast(m->kind)); if (!m->unit.empty()) { - metric.mutable_float32()->set_unit(m->unit.value); + typed_metric->set_unit(m->unit.value); } if (m->min.value.has_value()) { - metric.mutable_float32()->set_min(m->min.value.value()); + typed_metric->set_min(m->min.value.value()); } if (m->max.value.has_value()) { - metric.mutable_float32()->set_max(m->max.value.value()); + typed_metric->set_max(m->max.value.value()); } - - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); - } - } - else if (auto* m = std::get_if(&value)) - { - metric.mutable_boolean()->set_offset(m_value_bytes); // The offset is incremented by the size of the type m_value_bytes += detail::size_of_type(); - metric.mutable_boolean()->set_description(m->description.value); - set_kind(*metric.mutable_boolean(), m->kind); - - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); - } + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; } - else if (auto* m = std::get_if(&value)) + else if (auto* m = std::get_if(&info)) { - metric.mutable_enum8()->set_offset(m_value_bytes); - // The offset is incremented by the size of the type + auto* typed_metric = metric.mutable_boolean(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); m_value_bytes += detail::size_of_type(); - metric.mutable_enum8()->set_description(m->description.value); - - set_kind(*metric.mutable_enum8(), m->kind); - + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; + } + else if (auto* m = std::get_if(&info)) + { + auto* typed_metric = metric.mutable_enum8(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m->description.value); + typed_metric->set_optional(is_optional(m->availability)); for (auto [key, value] : m->values) { auto enum_value = protobuf::Enum8Metric::EnumValue(); @@ -332,39 +248,78 @@ metrics::metrics(const std::map& info) enum_value.set_description(value.description); } - metric.mutable_enum8()->mutable_values()->insert( - {key, enum_value}); + typed_metric->mutable_values()->insert({key, enum_value}); } + m_value_bytes += detail::size_of_type(); - if (std::holds_alternative>(m->kind)) - { - constants.push_back(name); - } + // The offset is incremented by one byte which represents + // whether the metric is set or not. + m_value_bytes += 1; } - else if (auto* m = std::get_if(&value)) + else if (auto* m = std::get_if(&info)) { - metric.mutable_string()->set_offset(m_value_bytes); - metric.mutable_string()->set_description(m->description.value); - set_kind(*metric.mutable_string(), m->kind); - - // The offset is incremented by the size of the type - auto value = std::get>(m->kind).value; - // The string metric is known to always be constant - m_value_bytes += value.size(); - // The string is stored as a null-terminated string - m_value_bytes += 1; - - if (std::holds_alternative>(m->kind)) + auto* typed_metric = metric.mutable_constant(); + typed_metric->set_description(m->description.value); + if (!m->unit.empty()) { - constants.push_back(name); + typed_metric->set_unit(m->unit.value); } + // We expect the metric to be a constant + std::visit( + [&typed_metric](auto&& value) + { + using Type = decltype(value.value); + if constexpr (std::is_same_v) + { + typed_metric->set_uint64(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_int64(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_uint32(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_int32(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_float64(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_float32(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_boolean(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_enum8(value.value); + return; + } + if constexpr (std::is_same_v) + { + typed_metric->set_string(value.value); + return; + } + assert(false && "Unknown type"); + }, + m->value); } - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; m_metadata.mutable_metrics()->insert({name.value, metric}); - m_initialized[name.value] = false; } // Set the sync value to 1 so that the size of the metadata is @@ -395,26 +350,6 @@ metrics::metrics(const std::map& info) // can use the endianness field in the metadata to read the sync // value std::memcpy(value_data(0), &m_hash, sizeof(uint32_t)); - - // Initialize constants - for (auto name : constants) - { - auto& metric = info.at(name); - std::visit( - [this, &name](auto&& metric) - { - using Metric = std::decay_t; - auto value = - std::get>(metric.kind) - .value; - m_initialized[name.value] = true; - auto offset = - detail::get_offset(metadata().metrics().at(name.value)); - value_data(offset)[0] = 1; - Metric::set_value(value_data(offset), value); - }, - metric); - } } template @@ -426,7 +361,6 @@ template m_initialized[name] = true; const protobuf::Metric& proto_metric = metadata().metrics().at(name); assert(is_optional(proto_metric)); - assert(!is_constant(proto_metric)); auto offset = detail::get_offset(proto_metric); @@ -436,20 +370,20 @@ template // Explicit instantiations for the expected types template auto metrics::initialize_optional(const std::string& name) -> uint64::optional; -template auto -metrics::initialize_optional(const std::string& name) -> int64::optional; +template auto metrics::initialize_optional(const std::string& name) + -> int64::optional; template auto metrics::initialize_optional(const std::string& name) -> uint32::optional; -template auto -metrics::initialize_optional(const std::string& name) -> int32::optional; +template auto metrics::initialize_optional(const std::string& name) + -> int32::optional; template auto metrics::initialize_optional(const std::string& name) -> float64::optional; template auto metrics::initialize_optional(const std::string& name) -> float32::optional; template auto metrics::initialize_optional(const std::string& name) -> boolean::optional; -template auto -metrics::initialize_optional(const std::string& name) -> enum8::optional; +template auto metrics::initialize_optional(const std::string& name) + -> enum8::optional; template [[nodiscard]] auto metrics::initialize_required(const std::string& name, @@ -461,7 +395,6 @@ template m_initialized[name] = true; const protobuf::Metric& proto_metric = metadata().metrics().at(name); assert(!is_optional(proto_metric)); - assert(!is_constant(proto_metric)); auto offset = detail::get_offset(proto_metric); @@ -470,30 +403,30 @@ template } // Explicit instantiations for the expected types -template auto -metrics::initialize_required(const std::string& name, - uint64::type value) -> uint64::required; -template auto -metrics::initialize_required(const std::string& name, - int64::type value) -> int64::required; -template auto -metrics::initialize_required(const std::string& name, - uint32::type value) -> uint32::required; -template auto -metrics::initialize_required(const std::string& name, - int32::type value) -> int32::required; -template auto -metrics::initialize_required(const std::string& name, - float64::type value) -> float64::required; -template auto -metrics::initialize_required(const std::string& name, - float32::type value) -> float32::required; -template auto -metrics::initialize_required(const std::string& name, - boolean::type value) -> boolean::required; -template auto -metrics::initialize_required(const std::string& name, - enum8::type value) -> enum8::required; +template auto metrics::initialize_required(const std::string& name, + uint64::type value) + -> uint64::required; +template auto metrics::initialize_required(const std::string& name, + int64::type value) + -> int64::required; +template auto metrics::initialize_required(const std::string& name, + uint32::type value) + -> uint32::required; +template auto metrics::initialize_required(const std::string& name, + int32::type value) + -> int32::required; +template auto metrics::initialize_required(const std::string& name, + float64::type value) + -> float64::required; +template auto metrics::initialize_required(const std::string& name, + float32::type value) + -> float32::required; +template auto metrics::initialize_required(const std::string& name, + boolean::type value) + -> boolean::required; +template auto metrics::initialize_required(const std::string& name, + enum8::type value) + -> enum8::required; metrics::~metrics() { @@ -550,15 +483,14 @@ auto metrics::reset() -> void { for (const auto& [name, metric] : metadata().metrics()) { - if (!is_initialized(name)) + if (metric.has_constant()) { - // Skip metrics that have not been initialized continue; } - if (is_constant(metric)) + if (!is_initialized(name)) { - // Skip constant metrics + // Skip metrics that have not been initialized continue; } diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index 99849b1e..ee205267 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -23,50 +23,6 @@ namespace _fl = ::google::protobuf::internal::field_layout; namespace abacus { namespace protobuf { template -PROTOBUF_CONSTEXPR Gauge::Gauge(::_pbi::ConstantInitialized) - : _impl_{ - /*decltype(_impl_.optional_)*/ false, - /*decltype(_impl_._cached_size_)*/ {}, - } {} -struct GaugeDefaultTypeInternal { - PROTOBUF_CONSTEXPR GaugeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~GaugeDefaultTypeInternal() {} - union { - Gauge _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GaugeDefaultTypeInternal _Gauge_default_instance_; - template -PROTOBUF_CONSTEXPR Counter::Counter(::_pbi::ConstantInitialized) - : _impl_{ - /*decltype(_impl_.optional_)*/ false, - /*decltype(_impl_._cached_size_)*/ {}, - } {} -struct CounterDefaultTypeInternal { - PROTOBUF_CONSTEXPR CounterDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~CounterDefaultTypeInternal() {} - union { - Counter _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CounterDefaultTypeInternal _Counter_default_instance_; - template -PROTOBUF_CONSTEXPR Constant::Constant(::_pbi::ConstantInitialized) {} -struct ConstantDefaultTypeInternal { - PROTOBUF_CONSTEXPR ConstantDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~ConstantDefaultTypeInternal() {} - union { - Constant _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConstantDefaultTypeInternal _Constant_default_instance_; - template PROTOBUF_CONSTEXPR UInt64Metric::UInt64Metric(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._has_bits_)*/ {}, @@ -79,11 +35,11 @@ PROTOBUF_CONSTEXPR UInt64Metric::UInt64Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.min_)*/ ::uint64_t{0u}, /*decltype(_impl_.max_)*/ ::uint64_t{0u}, - /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, + /*decltype(_impl_.kind_)*/ 0, } {} struct UInt64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR UInt64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -108,11 +64,11 @@ PROTOBUF_CONSTEXPR Int64Metric::Int64Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.min_)*/ ::int64_t{0}, /*decltype(_impl_.max_)*/ ::int64_t{0}, - /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, + /*decltype(_impl_.kind_)*/ 0, } {} struct Int64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Int64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -138,10 +94,10 @@ PROTOBUF_CONSTEXPR UInt32Metric::UInt32Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0u, /*decltype(_impl_.max_)*/ 0u, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, } {} struct UInt32MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR UInt32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -167,10 +123,10 @@ PROTOBUF_CONSTEXPR Int32Metric::Int32Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, } {} struct Int32MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Int32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -195,11 +151,11 @@ PROTOBUF_CONSTEXPR Float64Metric::Float64Metric(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, - /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, + /*decltype(_impl_.kind_)*/ 0, } {} struct Float64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Float64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -225,10 +181,10 @@ PROTOBUF_CONSTEXPR Float32Metric::Float32Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, + /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, } {} struct Float32MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Float32MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -254,8 +210,7 @@ PROTOBUF_CONSTEXPR BoolMetric::BoolMetric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, + /*decltype(_impl_.optional_)*/ false, } {} struct BoolMetricDefaultTypeInternal { PROTOBUF_CONSTEXPR BoolMetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -318,8 +273,7 @@ PROTOBUF_CONSTEXPR Enum8Metric::Enum8Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._oneof_case_)*/ {}, + /*decltype(_impl_.optional_)*/ false, } {} struct Enum8MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Enum8MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -332,27 +286,31 @@ struct Enum8MetricDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Enum8MetricDefaultTypeInternal _Enum8Metric_default_instance_; template -PROTOBUF_CONSTEXPR StringMetric::StringMetric(::_pbi::ConstantInitialized) +PROTOBUF_CONSTEXPR Constant::Constant(::_pbi::ConstantInitialized) : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.description_)*/ { &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, - /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.kind_)*/ {}, - /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.unit_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.value_)*/ {}, /*decltype(_impl_._oneof_case_)*/ {}, } {} -struct StringMetricDefaultTypeInternal { - PROTOBUF_CONSTEXPR StringMetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~StringMetricDefaultTypeInternal() {} +struct ConstantDefaultTypeInternal { + PROTOBUF_CONSTEXPR ConstantDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ConstantDefaultTypeInternal() {} union { - StringMetric _instance; + Constant _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StringMetricDefaultTypeInternal _StringMetric_default_instance_; + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConstantDefaultTypeInternal _Constant_default_instance_; template PROTOBUF_CONSTEXPR Metric::Metric(::_pbi::ConstantInitialized) : _impl_{ @@ -403,56 +361,27 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; } // namespace protobuf } // namespace abacus -static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[17]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; +static ::_pb::Metadata file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[2]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_abacus_2fprotobuf_2fmetrics_2eproto = nullptr; const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Gauge, _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(::abacus::protobuf::Gauge, _impl_.optional_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Counter, _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(::abacus::protobuf::Counter, _impl_.optional_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _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(::abacus::protobuf::UInt64Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.optional_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.max_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.kind_), - ~0u, ~0u, ~0u, ~0u, @@ -463,21 +392,18 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.optional_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.max_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.kind_), - ~0u, ~0u, ~0u, ~0u, @@ -488,21 +414,18 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.optional_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.max_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.kind_), - ~0u, ~0u, ~0u, ~0u, @@ -513,21 +436,18 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.optional_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.max_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.kind_), - ~0u, ~0u, ~0u, ~0u, @@ -538,21 +458,18 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.optional_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.max_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.kind_), - ~0u, ~0u, ~0u, ~0u, @@ -563,21 +480,18 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.optional_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.min_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.max_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.kind_), - ~0u, ~0u, ~0u, ~0u, @@ -588,18 +502,15 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.unit_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.kind_), - ~0u, ~0u, ~0u, ~0u, @@ -631,36 +542,52 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_._oneof_case_[0]), + ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.description_), - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.values_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.unit_), ~0u, ~0u, ~0u, ~0u, 0, - ~0u, - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.offset_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.description_), ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_.kind_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_.description_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_.unit_), + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_.value_), + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + 0, ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _internal_metadata_), ~0u, // no _extensions_ @@ -707,29 +634,23 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::abacus::protobuf::Gauge)}, - {9, -1, -1, sizeof(::abacus::protobuf::Counter)}, - {18, -1, -1, sizeof(::abacus::protobuf::Constant)}, - {26, 43, -1, sizeof(::abacus::protobuf::UInt64Metric)}, - {51, 68, -1, sizeof(::abacus::protobuf::Int64Metric)}, - {76, 93, -1, sizeof(::abacus::protobuf::UInt32Metric)}, - {101, 118, -1, sizeof(::abacus::protobuf::Int32Metric)}, - {126, 143, -1, sizeof(::abacus::protobuf::Float64Metric)}, - {151, 168, -1, sizeof(::abacus::protobuf::Float32Metric)}, - {176, 190, -1, sizeof(::abacus::protobuf::BoolMetric)}, - {195, 205, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, - {207, 217, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, - {219, 234, -1, sizeof(::abacus::protobuf::Enum8Metric)}, - {240, -1, -1, sizeof(::abacus::protobuf::StringMetric)}, - {252, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {270, 280, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {282, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {0, 15, -1, sizeof(::abacus::protobuf::UInt64Metric)}, + {22, 37, -1, sizeof(::abacus::protobuf::Int64Metric)}, + {44, 59, -1, sizeof(::abacus::protobuf::UInt32Metric)}, + {66, 81, -1, sizeof(::abacus::protobuf::Int32Metric)}, + {88, 103, -1, sizeof(::abacus::protobuf::Float64Metric)}, + {110, 125, -1, sizeof(::abacus::protobuf::Float32Metric)}, + {132, 144, -1, sizeof(::abacus::protobuf::BoolMetric)}, + {148, 158, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, + {160, 170, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, + {172, 185, -1, sizeof(::abacus::protobuf::Enum8Metric)}, + {190, 210, -1, sizeof(::abacus::protobuf::Constant)}, + {221, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {239, 249, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {251, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, }; static const ::_pb::Message* const file_default_instances[] = { - &::abacus::protobuf::_Gauge_default_instance_._instance, - &::abacus::protobuf::_Counter_default_instance_._instance, - &::abacus::protobuf::_Constant_default_instance_._instance, &::abacus::protobuf::_UInt64Metric_default_instance_._instance, &::abacus::protobuf::_Int64Metric_default_instance_._instance, &::abacus::protobuf::_UInt32Metric_default_instance_._instance, @@ -740,105 +661,90 @@ static const ::_pb::Message* const file_default_instances[] = { &::abacus::protobuf::_Enum8Metric_EnumValue_default_instance_._instance, &::abacus::protobuf::_Enum8Metric_ValuesEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_Enum8Metric_default_instance_._instance, - &::abacus::protobuf::_StringMetric_default_instance_._instance, + &::abacus::protobuf::_Constant_default_instance_._instance, &::abacus::protobuf::_Metric_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_MetricsEntry_DoNotUse_default_instance_._instance, &::abacus::protobuf::_MetricsMetadata_default_instance_._instance, }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." - "protobuf\"\031\n\005Gauge\022\020\n\010optional\030\001 \001(\010\"\033\n\007C" - "ounter\022\020\n\010optional\030\001 \001(\010\"\n\n\010Constant\"\220\002\n" - "\014UInt64Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descrip" - "tion\030\002 \001(\t\022\'\n\005gauge\030\003 \001(\0132\026.abacus.proto" - "buf.GaugeH\000\022+\n\007counter\030\004 \001(\0132\030.abacus.pr" - "otobuf.CounterH\000\022-\n\010constant\030\005 \001(\0132\031.aba" - "cus.protobuf.ConstantH\000\022\021\n\004unit\030\006 \001(\tH\001\210" - "\001\001\022\020\n\003min\030\007 \001(\004H\002\210\001\001\022\020\n\003max\030\010 \001(\004H\003\210\001\001B\006" - "\n\004kindB\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\217\002\n\013Int6" - "4Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030\002" - " \001(\t\022\'\n\005gauge\030\003 \001(\0132\026.abacus.protobuf.Ga" - "ugeH\000\022+\n\007counter\030\004 \001(\0132\030.abacus.protobuf" - ".CounterH\000\022-\n\010constant\030\005 \001(\0132\031.abacus.pr" - "otobuf.ConstantH\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003" - "min\030\007 \001(\003H\002\210\001\001\022\020\n\003max\030\010 \001(\003H\003\210\001\001B\006\n\004kind" - "B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\220\002\n\014UInt32Metr" + "protobuf\"\272\001\n\014UInt64Metric\022\016\n\006offset\030\001 \001(" + "\r\022\023\n\013description\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010" + "\022#\n\004kind\030\004 \001(\0162\025.abacus.protobuf.Kind\022\021\n" + "\004unit\030\005 \001(\tH\000\210\001\001\022\020\n\003min\030\006 \001(\004H\001\210\001\001\022\020\n\003ma" + "x\030\007 \001(\004H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\271\001" + "\n\013Int64Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descrip" + "tion\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\022#\n\004kind\030\004 \001" + "(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030\005 \001(\tH" + "\000\210\001\001\022\020\n\003min\030\006 \001(\003H\001\210\001\001\022\020\n\003max\030\007 \001(\003H\002\210\001\001" + "B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\272\001\n\014UInt32Metr" "ic\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022" - "\'\n\005gauge\030\003 \001(\0132\026.abacus.protobuf.GaugeH\000" - "\022+\n\007counter\030\004 \001(\0132\030.abacus.protobuf.Coun" - "terH\000\022-\n\010constant\030\005 \001(\0132\031.abacus.protobu" - "f.ConstantH\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007" - " \001(\rH\002\210\001\001\022\020\n\003max\030\010 \001(\rH\003\210\001\001B\006\n\004kindB\007\n\005_" - "unitB\006\n\004_minB\006\n\004_max\"\217\002\n\013Int32Metric\022\016\n\006" - "offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005gau" - "ge\030\003 \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007co" - "unter\030\004 \001(\0132\030.abacus.protobuf.CounterH\000\022" - "-\n\010constant\030\005 \001(\0132\031.abacus.protobuf.Cons" - "tantH\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007 \001(\005H\002" - "\210\001\001\022\020\n\003max\030\010 \001(\005H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006" - "\n\004_minB\006\n\004_max\"\221\002\n\rFloat64Metric\022\016\n\006offs" - "et\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005gauge\030\003" - " \001(\0132\026.abacus.protobuf.GaugeH\000\022+\n\007counte" - "r\030\004 \001(\0132\030.abacus.protobuf.CounterH\000\022-\n\010c" - "onstant\030\005 \001(\0132\031.abacus.protobuf.Constant" - "H\000\022\021\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007 \001(\001H\002\210\001\001\022" - "\020\n\003max\030\010 \001(\001H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004_m" - "inB\006\n\004_max\"\221\002\n\rFloat32Metric\022\016\n\006offset\030\001" - " \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005gauge\030\003 \001(\013" - "2\026.abacus.protobuf.GaugeH\000\022+\n\007counter\030\004 " - "\001(\0132\030.abacus.protobuf.CounterH\000\022-\n\010const" - "ant\030\005 \001(\0132\031.abacus.protobuf.ConstantH\000\022\021" - "\n\004unit\030\006 \001(\tH\001\210\001\001\022\020\n\003min\030\007 \001(\002H\002\210\001\001\022\020\n\003m" - "ax\030\010 \001(\002H\003\210\001\001B\006\n\004kindB\007\n\005_unitB\006\n\004_minB\006" - "\n\004_max\"\255\001\n\nBoolMetric\022\016\n\006offset\030\001 \001(\r\022\023\n" - "\013description\030\002 \001(\t\022\'\n\005gauge\030\003 \001(\0132\026.abac" - "us.protobuf.GaugeH\000\022-\n\010constant\030\004 \001(\0132\031." - "abacus.protobuf.ConstantH\000\022\021\n\004unit\030\005 \001(\t" - "H\001\210\001\001B\006\n\004kindB\007\n\005_unit\"\204\003\n\013Enum8Metric\022\016" - "\n\006offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\'\n\005g" - "auge\030\003 \001(\0132\026.abacus.protobuf.GaugeH\000\022-\n\010" - "constant\030\004 \001(\0132\031.abacus.protobuf.Constan" - "tH\000\022\021\n\004unit\030\005 \001(\tH\001\210\001\001\0228\n\006values\030\006 \003(\0132(" - ".abacus.protobuf.Enum8Metric.ValuesEntry" - "\032C\n\tEnumValue\022\014\n\004name\030\001 \001(\t\022\030\n\013descripti" - "on\030\002 \001(\tH\000\210\001\001B\016\n\014_description\032U\n\013ValuesE" - "ntry\022\013\n\003key\030\001 \001(\r\0225\n\005value\030\002 \001(\0132&.abacu" - "s.protobuf.Enum8Metric.EnumValue:\0028\001B\006\n\004" - "kindB\007\n\005_unit\"j\n\014StringMetric\022\016\n\006offset\030" - "\001 \001(\r\022\023\n\013description\030\002 \001(\t\022-\n\010constant\030\003" - " \001(\0132\031.abacus.protobuf.ConstantH\000B\006\n\004kin" - "d\"\306\003\n\006Metric\022/\n\006uint64\030\003 \001(\0132\035.abacus.pr" - "otobuf.UInt64MetricH\000\022-\n\005int64\030\004 \001(\0132\034.a" - "bacus.protobuf.Int64MetricH\000\022/\n\006uint32\030\005" - " \001(\0132\035.abacus.protobuf.UInt32MetricH\000\022-\n" - "\005int32\030\006 \001(\0132\034.abacus.protobuf.Int32Metr" - "icH\000\0221\n\007float64\030\007 \001(\0132\036.abacus.protobuf." - "Float64MetricH\000\0221\n\007float32\030\010 \001(\0132\036.abacu" - "s.protobuf.Float32MetricH\000\022.\n\007boolean\030\t " - "\001(\0132\033.abacus.protobuf.BoolMetricH\000\022-\n\005en" - "um8\030\n \001(\0132\034.abacus.protobuf.Enum8MetricH" - "\000\022/\n\006string\030\013 \001(\0132\035.abacus.protobuf.Stri" - "ngMetricH\000B\006\n\004type\"\371\001\n\017MetricsMetadata\022\030" - "\n\020protocol_version\030\001 \001(\r\022/\n\nendianness\030\002" - " \001(\0162\033.abacus.protobuf.Endianness\022\022\n\nsyn" - "c_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-.abacus." - "protobuf.MetricsMetadata.MetricsEntry\032G\n" - "\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(" - "\0132\027.abacus.protobuf.Metric:\0028\001*!\n\nEndian" - "ness\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001B\021Z\017abacus/prot" - "obufb\006proto3" + "\020\n\010optional\030\003 \001(\010\022#\n\004kind\030\004 \001(\0162\025.abacus" + ".protobuf.Kind\022\021\n\004unit\030\005 \001(\tH\000\210\001\001\022\020\n\003min" + "\030\006 \001(\rH\001\210\001\001\022\020\n\003max\030\007 \001(\rH\002\210\001\001B\007\n\005_unitB\006" + "\n\004_minB\006\n\004_max\"\271\001\n\013Int32Metric\022\016\n\006offset" + "\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\020\n\010optional\030" + "\003 \001(\010\022#\n\004kind\030\004 \001(\0162\025.abacus.protobuf.Ki" + "nd\022\021\n\004unit\030\005 \001(\tH\000\210\001\001\022\020\n\003min\030\006 \001(\005H\001\210\001\001\022" + "\020\n\003max\030\007 \001(\005H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_m" + "ax\"\273\001\n\rFloat64Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013" + "description\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\022#\n\004k" + "ind\030\004 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit" + "\030\005 \001(\tH\000\210\001\001\022\020\n\003min\030\006 \001(\001H\001\210\001\001\022\020\n\003max\030\007 \001" + "(\001H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\273\001\n\rFlo" + "at32Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descriptio" + "n\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\022#\n\004kind\030\004 \001(\0162" + "\025.abacus.protobuf.Kind\022\021\n\004unit\030\005 \001(\tH\000\210\001" + "\001\022\020\n\003min\030\006 \001(\002H\001\210\001\001\022\020\n\003max\030\007 \001(\002H\002\210\001\001B\007\n" + "\005_unitB\006\n\004_minB\006\n\004_max\"_\n\nBoolMetric\022\016\n\006" + "offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\020\n\010opt" + "ional\030\003 \001(\010\022\021\n\004unit\030\004 \001(\tH\000\210\001\001B\007\n\005_unit\"" + "\266\002\n\013Enum8Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descr" + "iption\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\0228\n\006values" + "\030\004 \003(\0132(.abacus.protobuf.Enum8Metric.Val" + "uesEntry\022\021\n\004unit\030\005 \001(\tH\000\210\001\001\032C\n\tEnumValue" + "\022\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001\001" + "B\016\n\014_description\032U\n\013ValuesEntry\022\013\n\003key\030\001" + " \001(\r\0225\n\005value\030\002 \001(\0132&.abacus.protobuf.En" + "um8Metric.EnumValue:\0028\001B\007\n\005_unit\"\346\001\n\010Con" + "stant\022\020\n\006uint64\030\001 \001(\004H\000\022\017\n\005int64\030\002 \001(\003H\000" + "\022\020\n\006uint32\030\003 \001(\rH\000\022\017\n\005int32\030\004 \001(\005H\000\022\021\n\007f" + "loat32\030\005 \001(\002H\000\022\021\n\007float64\030\006 \001(\001H\000\022\021\n\007boo" + "lean\030\007 \001(\010H\000\022\017\n\005enum8\030\010 \001(\rH\000\022\020\n\006string\030" + "\t \001(\tH\000\022\023\n\013description\030\n \001(\t\022\021\n\004unit\030\013 \001" + "(\tH\001\210\001\001B\007\n\005valueB\007\n\005_unit\"\304\003\n\006Metric\022-\n\010" + "constant\030\001 \001(\0132\031.abacus.protobuf.Constan" + "tH\000\022/\n\006uint64\030\002 \001(\0132\035.abacus.protobuf.UI" + "nt64MetricH\000\022-\n\005int64\030\003 \001(\0132\034.abacus.pro" + "tobuf.Int64MetricH\000\022/\n\006uint32\030\004 \001(\0132\035.ab" + "acus.protobuf.UInt32MetricH\000\022-\n\005int32\030\005 " + "\001(\0132\034.abacus.protobuf.Int32MetricH\000\0221\n\007f" + "loat64\030\006 \001(\0132\036.abacus.protobuf.Float64Me" + "tricH\000\0221\n\007float32\030\007 \001(\0132\036.abacus.protobu" + "f.Float32MetricH\000\022.\n\007boolean\030\010 \001(\0132\033.aba" + "cus.protobuf.BoolMetricH\000\022-\n\005enum8\030\t \001(\013" + "2\034.abacus.protobuf.Enum8MetricH\000B\006\n\004type" + "\"\371\001\n\017MetricsMetadata\022\030\n\020protocol_version" + "\030\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.abacus.prot" + "obuf.Endianness\022\022\n\nsync_value\030\003 \001(\007\022>\n\007m" + "etrics\030\004 \003(\0132-.abacus.protobuf.MetricsMe" + "tadata.MetricsEntry\032G\n\014MetricsEntry\022\013\n\003k" + "ey\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacus.protobu" + "f.Metric:\0028\001*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007" + "\n\003BIG\020\001*\036\n\004Kind\022\t\n\005GAUGE\020\000\022\013\n\007COUNTER\020\001B" + "\021Z\017abacus/protobufb\006proto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 3212, + 2626, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, nullptr, 0, - 17, + 14, schemas, file_default_instances, TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets, @@ -879,53 +785,139 @@ bool Endianness_IsValid(int value) { return false; } } +const ::google::protobuf::EnumDescriptor* Kind_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto); + return file_level_enum_descriptors_abacus_2fprotobuf_2fmetrics_2eproto[1]; +} +bool Kind_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} // =================================================================== -class Gauge::_Internal { +class UInt64Metric::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_min(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_max(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; -Gauge::Gauge(::google::protobuf::Arena* arena) +UInt64Metric::UInt64Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Gauge) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt64Metric) } -Gauge::Gauge(const Gauge& from) - : ::google::protobuf::Message(), _impl_(from._impl_) { +UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Message() { + UInt64Metric* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, + decltype(_impl_.optional_){}, + decltype(_impl_.min_){}, + decltype(_impl_.max_){}, + decltype(_impl_.kind_){}, + }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Gauge) + _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._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.offset_, &from._impl_.offset_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); + + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Metric) } -inline void Gauge::SharedCtor(::_pb::Arena* arena) { +inline void UInt64Metric::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.optional_){false}, + decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, + decltype(_impl_.optional_){false}, + decltype(_impl_.min_){::uint64_t{0u}}, + decltype(_impl_.max_){::uint64_t{0u}}, + decltype(_impl_.kind_){0}, }; + _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 } -Gauge::~Gauge() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Gauge) +UInt64Metric::~UInt64Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.UInt64Metric) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void Gauge::SharedDtor() { +inline void UInt64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); + _impl_.unit_.Destroy(); } -void Gauge::SetCachedSize(int size) const { +void UInt64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -PROTOBUF_NOINLINE void Gauge::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Gauge) +PROTOBUF_NOINLINE void UInt64Metric::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt64Metric) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.optional_ = false; + _impl_.description_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.min_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); + } + _impl_.kind_ = 0; + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Gauge::_InternalParse( +const char* UInt64Metric::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -933,591 +925,42 @@ const char* Gauge::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 1, 0, 0, 2> Gauge::_table_ = { +const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt64Metric::_table_ = { { - 0, // no _has_bits_ - 0, // no _extensions_ - 1, 0, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967294, // skipmap - offsetof(decltype(_table_), field_entries), - 1, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_Gauge_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bool optional = 1; - {::_pbi::TcParser::SingularVarintNoZag1(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Gauge, _impl_.optional_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // bool optional = 1; - {PROTOBUF_FIELD_OFFSET(Gauge, _impl_.optional_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* Gauge::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Gauge) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // bool optional = 1; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 1, this->_internal_optional(), target); - } - - 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:abacus.protobuf.Gauge) - return target; -} - -::size_t Gauge::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Gauge) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bool optional = 1; - if (this->_internal_optional() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Gauge::_class_data_ = { - ::google::protobuf::Message::CopyWithSourceCheck, - Gauge::MergeImpl -}; -const ::google::protobuf::Message::ClassData*Gauge::GetClassData() const { return &_class_data_; } - - -void Gauge::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:abacus.protobuf.Gauge) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Gauge::CopyFrom(const Gauge& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Gauge) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Gauge::IsInitialized() const { - return true; -} - -void Gauge::InternalSwap(Gauge* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.optional_, other->_impl_.optional_); -} - -::google::protobuf::Metadata Gauge::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); -} -// =================================================================== - -class Counter::_Internal { - public: -}; - -Counter::Counter(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Counter) -} -Counter::Counter(const Counter& from) - : ::google::protobuf::Message(), _impl_(from._impl_) { - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Counter) -} -inline void Counter::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ - decltype(_impl_.optional_){false}, - /*decltype(_impl_._cached_size_)*/ {}, - }; -} -Counter::~Counter() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Counter) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Counter::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); -} -void Counter::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -PROTOBUF_NOINLINE void Counter::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Counter) - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.optional_ = false; - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Counter::_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, 1, 0, 0, 2> Counter::_table_ = { - { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_), 0, // no _extensions_ - 1, 0, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967294, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 1, // num_field_entries + 7, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries - &_Counter_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bool optional = 1; - {::_pbi::TcParser::SingularVarintNoZag1(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Counter, _impl_.optional_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // bool optional = 1; - {PROTOBUF_FIELD_OFFSET(Counter, _impl_.optional_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* Counter::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Counter) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // bool optional = 1; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 1, this->_internal_optional(), target); - } - - 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:abacus.protobuf.Counter) - return target; -} - -::size_t Counter::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Counter) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bool optional = 1; - if (this->_internal_optional() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Counter::_class_data_ = { - ::google::protobuf::Message::CopyWithSourceCheck, - Counter::MergeImpl -}; -const ::google::protobuf::Message::ClassData*Counter::GetClassData() const { return &_class_data_; } - - -void Counter::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:abacus.protobuf.Counter) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Counter::CopyFrom(const Counter& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Counter) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Counter::IsInitialized() const { - return true; -} - -void Counter::InternalSwap(Counter* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.optional_, other->_impl_.optional_); -} - -::google::protobuf::Metadata Counter::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); -} -// =================================================================== - -class Constant::_Internal { - public: -}; - -Constant::Constant(::google::protobuf::Arena* arena) - : ::google::protobuf::internal::ZeroFieldsBase(arena) { - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Constant) -} -Constant::Constant(const Constant& from) : ::google::protobuf::internal::ZeroFieldsBase() { - Constant* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Constant) -} - - - - -const ::google::protobuf::Message::ClassData Constant::_class_data_ = { - ::google::protobuf::internal::ZeroFieldsBase::CopyImpl, - ::google::protobuf::internal::ZeroFieldsBase::MergeImpl, -}; -const ::google::protobuf::Message::ClassData*Constant::GetClassData() const { return &_class_data_; } - - - - - - - -::google::protobuf::Metadata Constant::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); -} -// =================================================================== - -class UInt64Metric::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const UInt64Metric* msg); - static const ::abacus::protobuf::Counter& counter(const UInt64Metric* msg); - static const ::abacus::protobuf::Constant& constant(const UInt64Metric* msg); - static void set_has_unit(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_min(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_max(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } -}; - -const ::abacus::protobuf::Gauge& UInt64Metric::_Internal::gauge(const UInt64Metric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Counter& UInt64Metric::_Internal::counter(const UInt64Metric* msg) { - return *msg->_impl_.kind_.counter_; -} -const ::abacus::protobuf::Constant& UInt64Metric::_Internal::constant(const UInt64Metric* msg) { - return *msg->_impl_.kind_.constant_; -} -void UInt64Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.gauge) -} -void UInt64Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (counter) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(counter); - if (message_arena != submessage_arena) { - counter = ::google::protobuf::internal::GetOwnedMessage( - message_arena, counter, submessage_arena); - } - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.counter) -} -void UInt64Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.constant) -} -UInt64Metric::UInt64Metric(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.UInt64Metric) -} -UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Message() { - UInt64Metric* const _this = this; - (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){from._impl_._has_bits_}, - /*decltype(_impl_._cached_size_)*/ {}, - decltype(_impl_.description_){}, - decltype(_impl_.unit_){}, - decltype(_impl_.min_){}, - decltype(_impl_.max_){}, - decltype(_impl_.offset_){}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, - }; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - _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._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); - } - ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.offset_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.offset_)); - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } - - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Metric) -} -inline void UInt64Metric::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){}, - /*decltype(_impl_._cached_size_)*/ {}, - decltype(_impl_.description_){}, - decltype(_impl_.unit_){}, - decltype(_impl_.min_){::uint64_t{0u}}, - decltype(_impl_.max_){::uint64_t{0u}}, - decltype(_impl_.offset_){0u}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, - }; - _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_kind(); -} -UInt64Metric::~UInt64Metric() { - // @@protoc_insertion_point(destructor:abacus.protobuf.UInt64Metric) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void UInt64Metric::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.description_.Destroy(); - _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } -} -void UInt64Metric::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void UInt64Metric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.UInt64Metric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kCounter: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; -} - - -PROTOBUF_NOINLINE void UInt64Metric::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt64Metric) - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.description_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - _impl_.unit_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000006u) { - ::memset(&_impl_.min_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.max_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); - } - _impl_.offset_ = 0u; - clear_kind(); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* UInt64Metric::_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, 8, 3, 60, 2> UInt64Metric::_table_ = { - { - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_), - 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap - offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 3, // num_aux_entries - offsetof(decltype(_table_), aux_entries), &_UInt64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional uint64 max = 8; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), - {64, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.offset_)}}, // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 6; + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.optional_)}}, + // .abacus.protobuf.Kind kind = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Metric, _impl_.kind_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_)}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {50, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, - // optional uint64 min = 7; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, + // optional uint64 min = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.min_), 1>(), - {56, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, + {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, + // optional uint64 max = 7; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), + {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ @@ -1527,30 +970,25 @@ const ::_pbi::TcParseTable<3, 8, 3, 60, 2> UInt64Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 4; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 5; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 6; + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // .abacus.protobuf.Kind kind = 4; + {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint64 min = 7; + // optional uint64 min = 6; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - // optional uint64 max = 8; + // optional uint64 max = 7; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\34\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" + }}, + // no aux_entries + {{ + "\34\0\13\0\0\4\0\0" "abacus.protobuf.UInt64Metric" "description" "unit" @@ -1579,49 +1017,41 @@ ::uint8_t* UInt64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kCounter: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::counter(this), - _Internal::counter(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_kind(), target); } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 6; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt64Metric.unit"); - target = stream->WriteStringMaybeAliased(6, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional uint64 min = 7; + // optional uint64 min = 6; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 7, this->_internal_min(), target); + 6, this->_internal_min(), target); } - // optional uint64 max = 8; + // optional uint64 max = 7; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 8, this->_internal_max(), target); + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1647,59 +1077,44 @@ ::size_t UInt64Metric::ByteSizeLong() const { this->_internal_description()); } + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional string unit = 6; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; + } - // optional uint64 min = 7; + if (cached_has_bits & 0x00000006u) { + // optional uint64 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_min()); } - // optional uint64 max = 8; + // optional uint64 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_max()); } } - // uint32 offset = 1; - if (this->_internal_offset() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_offset()); + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Counter counter = 4; - case kCounter: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.counter_); - break; - } - // .abacus.protobuf.Constant constant = 5; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; - } - case KIND_NOT_SET: { - break; - } - } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1721,11 +1136,17 @@ void UInt64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_unit(from._internal_unit()); - } + if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -1734,28 +1155,8 @@ void UInt64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_offset() != 0) { - _this->_internal_set_offset(from._internal_offset()); - } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -1782,19 +1183,17 @@ void UInt64Metric::InternalSwap(UInt64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.offset_) - + sizeof(UInt64Metric::_impl_.offset_) - - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)>( - reinterpret_cast(&_impl_.min_), - reinterpret_cast(&other->_impl_.min_)); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_) + + sizeof(UInt64Metric::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); } ::google::protobuf::Metadata UInt64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[0]); } // =================================================================== @@ -1803,11 +1202,6 @@ class Int64Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const Int64Metric* msg); - static const ::abacus::protobuf::Counter& counter(const Int64Metric* msg); - static const ::abacus::protobuf::Constant& constant(const Int64Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -1819,60 +1213,6 @@ class Int64Metric::_Internal { } }; -const ::abacus::protobuf::Gauge& Int64Metric::_Internal::gauge(const Int64Metric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Counter& Int64Metric::_Internal::counter(const Int64Metric* msg) { - return *msg->_impl_.kind_.counter_; -} -const ::abacus::protobuf::Constant& Int64Metric::_Internal::constant(const Int64Metric* msg) { - return *msg->_impl_.kind_.constant_; -} -void Int64Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.gauge) -} -void Int64Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (counter) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(counter); - if (message_arena != submessage_arena) { - counter = ::google::protobuf::internal::GetOwnedMessage( - message_arena, counter, submessage_arena); - } - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.counter) -} -void Int64Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.constant) -} Int64Metric::Int64Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -1886,11 +1226,11 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, + decltype(_impl_.optional_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -1908,30 +1248,9 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.offset_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.offset_)); - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } + ::memcpy(&_impl_.offset_, &from._impl_.offset_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int64Metric) } @@ -1942,11 +1261,11 @@ inline void Int64Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, + decltype(_impl_.optional_){false}, decltype(_impl_.min_){::int64_t{0}}, decltype(_impl_.max_){::int64_t{0}}, - decltype(_impl_.offset_){0u}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, + decltype(_impl_.kind_){0}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -1956,7 +1275,6 @@ inline void Int64Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_kind(); } Int64Metric::~Int64Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Int64Metric) @@ -1967,43 +1285,11 @@ inline void Int64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } } void Int64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Int64Metric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Int64Metric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kCounter: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; -} - - PROTOBUF_NOINLINE void Int64Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int64Metric) ::uint32_t cached_has_bits = 0; @@ -2015,13 +1301,15 @@ PROTOBUF_NOINLINE void Int64Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - _impl_.offset_ = 0u; - clear_kind(); + _impl_.kind_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -2034,38 +1322,42 @@ const char* Int64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 8, 3, 59, 2> Int64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_), 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 3, // num_aux_entries - offsetof(decltype(_table_), aux_entries), + 7, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries &_Int64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional int64 max = 8; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.max_), 2>(), - {64, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.offset_)}}, // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 6; + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.optional_)}}, + // .abacus.protobuf.Kind kind = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Metric, _impl_.kind_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_)}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {50, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, - // optional int64 min = 7; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, + // optional int64 min = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.min_), 1>(), - {56, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, + {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, + // optional int64 max = 7; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.max_), 2>(), + {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ @@ -2075,30 +1367,25 @@ const ::_pbi::TcParseTable<3, 8, 3, 59, 2> Int64Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 4; - {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 5; - {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 6; + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // .abacus.protobuf.Kind kind = 4; + {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int64 min = 7; + // optional int64 min = 6; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, - // optional int64 max = 8; + // optional int64 max = 7; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\33\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" + }}, + // no aux_entries + {{ + "\33\0\13\0\0\4\0\0" "abacus.protobuf.Int64Metric" "description" "unit" @@ -2127,48 +1414,40 @@ ::uint8_t* Int64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kCounter: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::counter(this), - _Internal::counter(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_kind(), target); } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 6; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int64Metric.unit"); - target = stream->WriteStringMaybeAliased(6, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional int64 min = 7; + // optional int64 min = 6; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<7>( + WriteInt64ToArrayWithField<6>( stream, this->_internal_min(), target); } - // optional int64 max = 8; + // optional int64 max = 7; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<8>( + WriteInt64ToArrayWithField<7>( stream, this->_internal_max(), target); } @@ -2195,59 +1474,44 @@ ::size_t Int64Metric::ByteSizeLong() const { this->_internal_description()); } + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional string unit = 6; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); + } + + // uint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_offset()); + } + + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; + } - // optional int64 min = 7; + if (cached_has_bits & 0x00000006u) { + // optional int64 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_min()); } - // optional int64 max = 8; + // optional int64 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_max()); } } - // uint32 offset = 1; - if (this->_internal_offset() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_offset()); + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Counter counter = 4; - case kCounter: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.counter_); - break; - } - // .abacus.protobuf.Constant constant = 5; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; - } - case KIND_NOT_SET: { - break; - } - } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2269,11 +1533,17 @@ void Int64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_unit(from._internal_unit()); - } + if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -2282,28 +1552,8 @@ void Int64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_offset() != 0) { - _this->_internal_set_offset(from._internal_offset()); - } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -2330,19 +1580,17 @@ void Int64Metric::InternalSwap(Int64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.offset_) - + sizeof(Int64Metric::_impl_.offset_) - - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)>( - reinterpret_cast(&_impl_.min_), - reinterpret_cast(&other->_impl_.min_)); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_) + + sizeof(Int64Metric::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); } ::google::protobuf::Metadata Int64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[4]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[1]); } // =================================================================== @@ -2351,11 +1599,6 @@ class UInt32Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const UInt32Metric* msg); - static const ::abacus::protobuf::Counter& counter(const UInt32Metric* msg); - static const ::abacus::protobuf::Constant& constant(const UInt32Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -2367,60 +1610,6 @@ class UInt32Metric::_Internal { } }; -const ::abacus::protobuf::Gauge& UInt32Metric::_Internal::gauge(const UInt32Metric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Counter& UInt32Metric::_Internal::counter(const UInt32Metric* msg) { - return *msg->_impl_.kind_.counter_; -} -const ::abacus::protobuf::Constant& UInt32Metric::_Internal::constant(const UInt32Metric* msg) { - return *msg->_impl_.kind_.constant_; -} -void UInt32Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.gauge) -} -void UInt32Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (counter) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(counter); - if (message_arena != submessage_arena) { - counter = ::google::protobuf::internal::GetOwnedMessage( - message_arena, counter, submessage_arena); - } - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.counter) -} -void UInt32Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.constant) -} UInt32Metric::UInt32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -2435,10 +1624,10 @@ UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Messa decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, + decltype(_impl_.optional_){}, + decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -2459,27 +1648,6 @@ UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Messa ::memcpy(&_impl_.offset_, &from._impl_.offset_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt32Metric) } @@ -2491,10 +1659,10 @@ inline void UInt32Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, + decltype(_impl_.optional_){false}, + decltype(_impl_.kind_){0}, decltype(_impl_.min_){0u}, decltype(_impl_.max_){0u}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -2504,7 +1672,6 @@ inline void UInt32Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_kind(); } UInt32Metric::~UInt32Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.UInt32Metric) @@ -2515,43 +1682,11 @@ inline void UInt32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } } void UInt32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void UInt32Metric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.UInt32Metric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kCounter: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; -} - - PROTOBUF_NOINLINE void UInt32Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.UInt32Metric) ::uint32_t cached_has_bits = 0; @@ -2563,13 +1698,14 @@ PROTOBUF_NOINLINE void UInt32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.offset_ = 0u; + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -2582,38 +1718,42 @@ const char* UInt32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 8, 3, 60, 2> UInt32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_), 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 3, // num_aux_entries - offsetof(decltype(_table_), aux_entries), + 7, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries &_UInt32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional uint32 max = 8; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.max_), 2>(), - {64, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.offset_)}}, // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 6; + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.optional_)}}, + // .abacus.protobuf.Kind kind = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.kind_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_)}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {50, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, - // optional uint32 min = 7; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, + // optional uint32 min = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.min_), 1>(), - {56, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, + {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, + // optional uint32 max = 7; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.max_), 2>(), + {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ @@ -2623,30 +1763,25 @@ const ::_pbi::TcParseTable<3, 8, 3, 60, 2> UInt32Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 4; - {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 5; - {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 6; + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // .abacus.protobuf.Kind kind = 4; + {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint32 min = 7; + // optional uint32 min = 6; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, - // optional uint32 max = 8; + // optional uint32 max = 7; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\34\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" + }}, + // no aux_entries + {{ + "\34\0\13\0\0\4\0\0" "abacus.protobuf.UInt32Metric" "description" "unit" @@ -2675,49 +1810,41 @@ ::uint8_t* UInt32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kCounter: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::counter(this), - _Internal::counter(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_kind(), target); } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 6; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt32Metric.unit"); - target = stream->WriteStringMaybeAliased(6, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional uint32 min = 7; + // optional uint32 min = 6; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 7, this->_internal_min(), target); + 6, this->_internal_min(), target); } - // optional uint32 max = 8; + // optional uint32 max = 7; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 8, this->_internal_max(), target); + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2743,7 +1870,7 @@ ::size_t UInt32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 6; + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -2756,46 +1883,31 @@ ::size_t UInt32Metric::ByteSizeLong() const { this->_internal_offset()); } + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + if (cached_has_bits & 0x00000006u) { - // optional uint32 min = 7; + // optional uint32 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_min()); } - // optional uint32 max = 8; + // optional uint32 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_max()); } } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Counter counter = 4; - case kCounter: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.counter_); - break; - } - // .abacus.protobuf.Constant constant = 5; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; - } - case KIND_NOT_SET: { - break; - } - } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2823,6 +1935,12 @@ void UInt32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { @@ -2833,26 +1951,6 @@ void UInt32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google } _this->_impl_._has_bits_[0] |= cached_has_bits; } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -2883,14 +1981,12 @@ void UInt32Metric::InternalSwap(UInt32Metric* other) { - PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.offset_)>( reinterpret_cast(&_impl_.offset_), reinterpret_cast(&other->_impl_.offset_)); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata UInt32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[5]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[2]); } // =================================================================== @@ -2899,11 +1995,6 @@ class Int32Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const Int32Metric* msg); - static const ::abacus::protobuf::Counter& counter(const Int32Metric* msg); - static const ::abacus::protobuf::Constant& constant(const Int32Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -2915,60 +2006,6 @@ class Int32Metric::_Internal { } }; -const ::abacus::protobuf::Gauge& Int32Metric::_Internal::gauge(const Int32Metric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Counter& Int32Metric::_Internal::counter(const Int32Metric* msg) { - return *msg->_impl_.kind_.counter_; -} -const ::abacus::protobuf::Constant& Int32Metric::_Internal::constant(const Int32Metric* msg) { - return *msg->_impl_.kind_.constant_; -} -void Int32Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.gauge) -} -void Int32Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (counter) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(counter); - if (message_arena != submessage_arena) { - counter = ::google::protobuf::internal::GetOwnedMessage( - message_arena, counter, submessage_arena); - } - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.counter) -} -void Int32Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.constant) -} Int32Metric::Int32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -2983,10 +2020,10 @@ Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message( decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, + decltype(_impl_.optional_){}, + decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -3007,27 +2044,6 @@ Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message( ::memcpy(&_impl_.offset_, &from._impl_.offset_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int32Metric) } @@ -3039,66 +2055,33 @@ inline void Int32Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, + decltype(_impl_.optional_){false}, + decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _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_kind(); -} -Int32Metric::~Int32Metric() { - // @@protoc_insertion_point(destructor:abacus.protobuf.Int32Metric) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Int32Metric::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.description_.Destroy(); - _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } -} -void Int32Metric::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void Int32Metric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Int32Metric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kCounter: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +Int32Metric::~Int32Metric() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Int32Metric) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void Int32Metric::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.description_.Destroy(); + _impl_.unit_.Destroy(); +} +void Int32Metric::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); } - PROTOBUF_NOINLINE void Int32Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Int32Metric) @@ -3111,13 +2094,14 @@ PROTOBUF_NOINLINE void Int32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.offset_ = 0u; + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3130,38 +2114,42 @@ const char* Int32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 8, 3, 59, 2> Int32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_), 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 3, // num_aux_entries - offsetof(decltype(_table_), aux_entries), + 7, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries &_Int32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional int32 max = 8; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.max_), 2>(), - {64, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.offset_)}}, // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 6; + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.optional_)}}, + // .abacus.protobuf.Kind kind = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.kind_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_)}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {50, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, - // optional int32 min = 7; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, + // optional int32 min = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.min_), 1>(), - {56, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, + {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, + // optional int32 max = 7; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.max_), 2>(), + {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ @@ -3171,30 +2159,25 @@ const ::_pbi::TcParseTable<3, 8, 3, 59, 2> Int32Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 4; - {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 5; - {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 6; + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // .abacus.protobuf.Kind kind = 4; + {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int32 min = 7; + // optional int32 min = 6; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - // optional int32 max = 8; + // optional int32 max = 7; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\33\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" + }}, + // no aux_entries + {{ + "\33\0\13\0\0\4\0\0" "abacus.protobuf.Int32Metric" "description" "unit" @@ -3223,48 +2206,40 @@ ::uint8_t* Int32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kCounter: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::counter(this), - _Internal::counter(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_kind(), target); } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 6; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int32Metric.unit"); - target = stream->WriteStringMaybeAliased(6, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional int32 min = 7; + // optional int32 min = 6; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<7>( + WriteInt32ToArrayWithField<6>( stream, this->_internal_min(), target); } - // optional int32 max = 8; + // optional int32 max = 7; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<8>( + WriteInt32ToArrayWithField<7>( stream, this->_internal_max(), target); } @@ -3291,7 +2266,7 @@ ::size_t Int32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 6; + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -3304,46 +2279,31 @@ ::size_t Int32Metric::ByteSizeLong() const { this->_internal_offset()); } + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + if (cached_has_bits & 0x00000006u) { - // optional int32 min = 7; + // optional int32 min = 6; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_min()); } - // optional int32 max = 8; + // optional int32 max = 7; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_max()); } } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Counter counter = 4; - case kCounter: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.counter_); - break; - } - // .abacus.protobuf.Constant constant = 5; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; - } - case KIND_NOT_SET: { - break; - } - } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3371,6 +2331,12 @@ void Int32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { @@ -3381,26 +2347,6 @@ void Int32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: } _this->_impl_._has_bits_[0] |= cached_has_bits; } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -3431,14 +2377,12 @@ void Int32Metric::InternalSwap(Int32Metric* other) { - PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.offset_)>( reinterpret_cast(&_impl_.offset_), reinterpret_cast(&other->_impl_.offset_)); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata Int32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[6]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[3]); } // =================================================================== @@ -3447,11 +2391,6 @@ class Float64Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const Float64Metric* msg); - static const ::abacus::protobuf::Counter& counter(const Float64Metric* msg); - static const ::abacus::protobuf::Constant& constant(const Float64Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -3463,60 +2402,6 @@ class Float64Metric::_Internal { } }; -const ::abacus::protobuf::Gauge& Float64Metric::_Internal::gauge(const Float64Metric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Counter& Float64Metric::_Internal::counter(const Float64Metric* msg) { - return *msg->_impl_.kind_.counter_; -} -const ::abacus::protobuf::Constant& Float64Metric::_Internal::constant(const Float64Metric* msg) { - return *msg->_impl_.kind_.constant_; -} -void Float64Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.gauge) -} -void Float64Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (counter) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(counter); - if (message_arena != submessage_arena) { - counter = ::google::protobuf::internal::GetOwnedMessage( - message_arena, counter, submessage_arena); - } - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.counter) -} -void Float64Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.constant) -} Float64Metric::Float64Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -3530,11 +2415,11 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){}, + decltype(_impl_.optional_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.offset_){}, decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -3552,30 +2437,9 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.min_, &from._impl_.min_, - static_cast<::size_t>(reinterpret_cast(&_impl_.offset_) - - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.offset_)); - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } + ::memcpy(&_impl_.offset_, &from._impl_.offset_, + static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float64Metric) } @@ -3586,11 +2450,11 @@ inline void Float64Metric::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.description_){}, decltype(_impl_.unit_){}, + decltype(_impl_.offset_){0u}, + decltype(_impl_.optional_){false}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, - decltype(_impl_.offset_){0u}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, + decltype(_impl_.kind_){0}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -3600,7 +2464,6 @@ inline void Float64Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_kind(); } Float64Metric::~Float64Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Float64Metric) @@ -3611,43 +2474,11 @@ inline void Float64Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } } void Float64Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Float64Metric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Float64Metric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kCounter: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; -} - - PROTOBUF_NOINLINE void Float64Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float64Metric) ::uint32_t cached_has_bits = 0; @@ -3659,13 +2490,15 @@ PROTOBUF_NOINLINE void Float64Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - _impl_.offset_ = 0u; - clear_kind(); + _impl_.kind_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3678,38 +2511,42 @@ const char* Float64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 8, 3, 61, 2> Float64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_), 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 3, // num_aux_entries - offsetof(decltype(_table_), aux_entries), + 7, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries &_Float64Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional double max = 8; - {::_pbi::TcParser::FastF64S1, - {65, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.offset_)}}, // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 6; + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.optional_)}}, + // .abacus.protobuf.Kind kind = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Metric, _impl_.kind_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_)}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {50, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, - // optional double min = 7; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, + // optional double min = 6; + {::_pbi::TcParser::FastF64S1, + {49, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, + // optional double max = 7; {::_pbi::TcParser::FastF64S1, - {57, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, + {57, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ @@ -3719,30 +2556,25 @@ const ::_pbi::TcParseTable<3, 8, 3, 61, 2> Float64Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 4; - {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 5; - {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 6; + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // .abacus.protobuf.Kind kind = 4; + {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional double min = 7; + // optional double min = 6; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, - // optional double max = 8; + // optional double max = 7; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\35\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" + }}, + // no aux_entries + {{ + "\35\0\13\0\0\4\0\0" "abacus.protobuf.Float64Metric" "description" "unit" @@ -3771,49 +2603,41 @@ ::uint8_t* Float64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kCounter: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::counter(this), - _Internal::counter(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_kind(), target); } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 6; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float64Metric.unit"); - target = stream->WriteStringMaybeAliased(6, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional double min = 7; + // optional double min = 6; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 7, this->_internal_min(), target); + 6, this->_internal_min(), target); } - // optional double max = 8; + // optional double max = 7; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 8, this->_internal_max(), target); + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -3839,57 +2663,42 @@ ::size_t Float64Metric::ByteSizeLong() const { this->_internal_description()); } + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional string unit = 6; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_unit()); - } - - // optional double min = 7; - if (cached_has_bits & 0x00000002u) { - total_size += 9; - } - - // optional double max = 8; - if (cached_has_bits & 0x00000004u) { - total_size += 9; - } - + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); } + // uint32 offset = 1; if (this->_internal_offset() != 0) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_offset()); } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Counter counter = 4; - case kCounter: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.counter_); - break; - } - // .abacus.protobuf.Constant constant = 5; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; + } + + if (cached_has_bits & 0x00000006u) { + // optional double min = 6; + if (cached_has_bits & 0x00000002u) { + total_size += 9; } - case KIND_NOT_SET: { - break; + + // optional double max = 7; + if (cached_has_bits & 0x00000004u) { + total_size += 9; } + + } + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3911,11 +2720,17 @@ void Float64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); + } + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); + } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_unit(from._internal_unit()); - } + if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { _this->_impl_.min_ = from._impl_.min_; } @@ -3924,28 +2739,8 @@ void Float64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_offset() != 0) { - _this->_internal_set_offset(from._internal_offset()); - } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -3972,19 +2767,17 @@ void Float64Metric::InternalSwap(Float64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.offset_) - + sizeof(Float64Metric::_impl_.offset_) - - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)>( - reinterpret_cast(&_impl_.min_), - reinterpret_cast(&other->_impl_.min_)); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_) + + sizeof(Float64Metric::_impl_.kind_) + - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); } ::google::protobuf::Metadata Float64Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[4]); } // =================================================================== @@ -3993,11 +2786,6 @@ class Float32Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const Float32Metric* msg); - static const ::abacus::protobuf::Counter& counter(const Float32Metric* msg); - static const ::abacus::protobuf::Constant& constant(const Float32Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } @@ -4009,60 +2797,6 @@ class Float32Metric::_Internal { } }; -const ::abacus::protobuf::Gauge& Float32Metric::_Internal::gauge(const Float32Metric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Counter& Float32Metric::_Internal::counter(const Float32Metric* msg) { - return *msg->_impl_.kind_.counter_; -} -const ::abacus::protobuf::Constant& Float32Metric::_Internal::constant(const Float32Metric* msg) { - return *msg->_impl_.kind_.constant_; -} -void Float32Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.gauge) -} -void Float32Metric::set_allocated_counter(::abacus::protobuf::Counter* counter) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (counter) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(counter); - if (message_arena != submessage_arena) { - counter = ::google::protobuf::internal::GetOwnedMessage( - message_arena, counter, submessage_arena); - } - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.counter) -} -void Float32Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.constant) -} Float32Metric::Float32Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -4077,10 +2811,10 @@ Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Me decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, + decltype(_impl_.optional_){}, + decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -4101,27 +2835,6 @@ Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Me ::memcpy(&_impl_.offset_, &from._impl_.offset_, static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float32Metric) } @@ -4133,10 +2846,10 @@ inline void Float32Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, + decltype(_impl_.optional_){false}, + decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -4146,7 +2859,6 @@ inline void Float32Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_kind(); } Float32Metric::~Float32Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Float32Metric) @@ -4157,43 +2869,11 @@ inline void Float32Metric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } } void Float32Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Float32Metric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Float32Metric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kCounter: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; -} - - PROTOBUF_NOINLINE void Float32Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Float32Metric) ::uint32_t cached_has_bits = 0; @@ -4205,13 +2885,14 @@ PROTOBUF_NOINLINE void Float32Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.offset_ = 0u; + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - clear_kind(); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -4224,38 +2905,42 @@ const char* Float32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 8, 3, 61, 2> Float32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_), 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask + 7, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap + 4294967168, // skipmap offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 3, // num_aux_entries - offsetof(decltype(_table_), aux_entries), + 7, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries &_Float32Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional float max = 8; - {::_pbi::TcParser::FastF32S1, - {69, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Metric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.offset_)}}, // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 6; + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.optional_)}}, + // .abacus.protobuf.Kind kind = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Metric, _impl_.kind_), 63>(), + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_)}}, + // optional string unit = 5; {::_pbi::TcParser::FastUS1, - {50, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, - // optional float min = 7; + {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, + // optional float min = 6; {::_pbi::TcParser::FastF32S1, - {61, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, + {53, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, + // optional float max = 7; + {::_pbi::TcParser::FastF32S1, + {61, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, }}, {{ 65535, 65535 }}, {{ @@ -4265,30 +2950,25 @@ const ::_pbi::TcParseTable<3, 8, 3, 61, 2> Float32Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Counter counter = 4; - {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.counter_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 5; - {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 2, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 6; + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // .abacus.protobuf.Kind kind = 4; + {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional float min = 7; + // optional float min = 6; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, - // optional float max = 8; + // optional float max = 7; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::Counter>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\35\0\13\0\0\0\4\0\0\0\0\0\0\0\0\0" + }}, + // no aux_entries + {{ + "\35\0\13\0\0\4\0\0" "abacus.protobuf.Float32Metric" "description" "unit" @@ -4317,49 +2997,41 @@ ::uint8_t* Float32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kCounter: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::counter(this), - _Internal::counter(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_kind(), target); } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 6; + // optional string unit = 5; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float32Metric.unit"); - target = stream->WriteStringMaybeAliased(6, _s, target); + target = stream->WriteStringMaybeAliased(5, _s, target); } - // optional float min = 7; + // optional float min = 6; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 7, this->_internal_min(), target); + 6, this->_internal_min(), target); } - // optional float max = 8; + // optional float max = 7; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 8, this->_internal_max(), target); + 7, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -4385,7 +3057,7 @@ ::size_t Float32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 6; + // optional string unit = 5; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -4398,44 +3070,29 @@ ::size_t Float32Metric::ByteSizeLong() const { this->_internal_offset()); } + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; + } + + // .abacus.protobuf.Kind kind = 4; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + if (cached_has_bits & 0x00000006u) { - // optional float min = 7; + // optional float min = 6; if (cached_has_bits & 0x00000002u) { total_size += 5; } - // optional float max = 8; + // optional float max = 7; if (cached_has_bits & 0x00000004u) { total_size += 5; } } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Counter counter = 4; - case kCounter: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.counter_); - break; - } - // .abacus.protobuf.Constant constant = 5; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; - } - case KIND_NOT_SET: { - break; - } - } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -4463,6 +3120,12 @@ void Float32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); + } + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); + } cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000006u) { if (cached_has_bits & 0x00000002u) { @@ -4473,26 +3136,6 @@ void Float32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl } _this->_impl_._has_bits_[0] |= cached_has_bits; } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kCounter: { - _this->_internal_mutable_counter()->::abacus::protobuf::Counter::MergeFrom( - from._internal_counter()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -4523,14 +3166,12 @@ void Float32Metric::InternalSwap(Float32Metric* other) { - PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.offset_)>( reinterpret_cast(&_impl_.offset_), reinterpret_cast(&other->_impl_.offset_)); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } ::google::protobuf::Metadata Float32Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[8]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[5]); } // =================================================================== @@ -4539,51 +3180,11 @@ class BoolMetric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const BoolMetric* msg); - static const ::abacus::protobuf::Constant& constant(const BoolMetric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } }; -const ::abacus::protobuf::Gauge& BoolMetric::_Internal::gauge(const BoolMetric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Constant& BoolMetric::_Internal::constant(const BoolMetric* msg) { - return *msg->_impl_.kind_.constant_; -} -void BoolMetric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.gauge) -} -void BoolMetric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.constant) -} BoolMetric::BoolMetric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -4598,8 +3199,7 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, + decltype(_impl_.optional_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -4617,23 +3217,9 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - _this->_impl_.offset_ = from._impl_.offset_; - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } + ::memcpy(&_impl_.offset_, &from._impl_.offset_, + static_cast<::size_t>(reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); // @@protoc_insertion_point(copy_constructor:abacus.protobuf.BoolMetric) } @@ -4645,8 +3231,7 @@ inline void BoolMetric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, + decltype(_impl_.optional_){false}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -4656,7 +3241,6 @@ inline void BoolMetric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_kind(); } BoolMetric::~BoolMetric() { // @@protoc_insertion_point(destructor:abacus.protobuf.BoolMetric) @@ -4667,37 +3251,11 @@ inline void BoolMetric::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } } void BoolMetric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void BoolMetric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.BoolMetric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; -} - - PROTOBUF_NOINLINE void BoolMetric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.BoolMetric) ::uint32_t cached_has_bits = 0; @@ -4709,8 +3267,9 @@ PROTOBUF_NOINLINE void BoolMetric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.offset_ = 0u; - clear_kind(); + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -4723,34 +3282,32 @@ const char* BoolMetric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 2, 50, 2> BoolMetric::_table_ = { +const ::_pbi::TcParseTable<2, 4, 0, 50, 2> BoolMetric::_table_ = { { PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_), 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 4, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967280, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries &_BoolMetric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - {::_pbi::TcParser::MiniParse, {}}, + // optional string unit = 4; + {::_pbi::TcParser::FastUS1, + {34, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(BoolMetric, _impl_.offset_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.offset_)}}, - // string description = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - // optional string unit = 5; + {8, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.offset_)}}, + // string description = 2; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_)}}, + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.optional_)}}, }}, {{ 65535, 65535 }}, {{ @@ -4760,20 +3317,16 @@ const ::_pbi::TcParseTable<3, 5, 2, 50, 2> BoolMetric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; - {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - // optional string unit = 5; + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\32\0\13\0\0\4\0\0" + }}, + // no aux_entries + {{ + "\32\0\13\0\4\0\0\0" "abacus.protobuf.BoolMetric" "description" "unit" @@ -4802,29 +3355,20 @@ ::uint8_t* BoolMetric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); } + cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.BoolMetric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -4850,7 +3394,7 @@ ::size_t BoolMetric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 5; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -4863,25 +3407,11 @@ ::size_t BoolMetric::ByteSizeLong() const { this->_internal_offset()); } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Constant constant = 4; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; - } - case KIND_NOT_SET: { - break; - } + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -4909,20 +3439,8 @@ void BoolMetric::MergeImpl(::google::protobuf::Message& to_msg, const ::google:: if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -4948,15 +3466,18 @@ void BoolMetric::InternalSwap(BoolMetric* other) { &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); - swap(_impl_.offset_, other->_impl_.offset_); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.optional_) + + sizeof(BoolMetric::_impl_.optional_) + - PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); } ::google::protobuf::Metadata BoolMetric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[9]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[6]); } // =================================================================== @@ -5203,7 +3724,7 @@ void Enum8Metric_EnumValue::InternalSwap(Enum8Metric_EnumValue* other) { ::google::protobuf::Metadata Enum8Metric_EnumValue::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[10]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[7]); } // =================================================================== @@ -5216,7 +3737,7 @@ void Enum8Metric_ValuesEntry_DoNotUse::MergeFrom(const Enum8Metric_ValuesEntry_D ::google::protobuf::Metadata Enum8Metric_ValuesEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[11]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[8]); } // =================================================================== @@ -5225,51 +3746,11 @@ class Enum8Metric::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_); - static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_._oneof_case_); - static const ::abacus::protobuf::Gauge& gauge(const Enum8Metric* msg); - static const ::abacus::protobuf::Constant& constant(const Enum8Metric* msg); static void set_has_unit(HasBits* has_bits) { (*has_bits)[0] |= 1u; } }; -const ::abacus::protobuf::Gauge& Enum8Metric::_Internal::gauge(const Enum8Metric* msg) { - return *msg->_impl_.kind_.gauge_; -} -const ::abacus::protobuf::Constant& Enum8Metric::_Internal::constant(const Enum8Metric* msg) { - return *msg->_impl_.kind_.constant_; -} -void Enum8Metric::set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (gauge) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(gauge); - if (message_arena != submessage_arena) { - gauge = ::google::protobuf::internal::GetOwnedMessage( - message_arena, gauge, submessage_arena); - } - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.gauge) -} -void Enum8Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.constant) -} Enum8Metric::Enum8Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -5285,8 +3766,7 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, + decltype(_impl_.optional_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -5305,23 +3785,9 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - _this->_impl_.offset_ = from._impl_.offset_; - clear_has_kind(); - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } - } + ::memcpy(&_impl_.offset_, &from._impl_.offset_, + static_cast<::size_t>(reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Enum8Metric) } @@ -5334,8 +3800,7 @@ inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.kind_){}, - /*decltype(_impl_._oneof_case_)*/ {}, + decltype(_impl_.optional_){false}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -5345,7 +3810,6 @@ inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.unit_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_kind(); } Enum8Metric::~Enum8Metric() { // @@protoc_insertion_point(destructor:abacus.protobuf.Enum8Metric) @@ -5357,37 +3821,11 @@ inline void Enum8Metric::SharedDtor() { _impl_.values_.~MapField(); _impl_.description_.Destroy(); _impl_.unit_.Destroy(); - if (has_kind()) { - clear_kind(); - } } void Enum8Metric::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Enum8Metric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Enum8Metric) - switch (kind_case()) { - case kGauge: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - break; - } - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - break; - } - case KIND_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = KIND_NOT_SET; -} - - PROTOBUF_NOINLINE void Enum8Metric::Clear() { // @@protoc_insertion_point(message_clear_start:abacus.protobuf.Enum8Metric) ::uint32_t cached_has_bits = 0; @@ -5400,8 +3838,9 @@ PROTOBUF_NOINLINE void Enum8Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - _impl_.offset_ = 0u; - clear_kind(); + ::memset(&_impl_.offset_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.optional_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -5414,16 +3853,16 @@ const char* Enum8Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 6, 4, 51, 2> Enum8Metric::_table_ = { +const ::_pbi::TcParseTable<3, 5, 2, 51, 2> Enum8Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_), 0, // no _extensions_ - 6, 56, // max_field_number, fast_idx_mask + 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967232, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 6, // num_field_entries - 4, // num_aux_entries + 5, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Enum8Metric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback @@ -5435,7 +3874,9 @@ const ::_pbi::TcParseTable<3, 6, 4, 51, 2> Enum8Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_)}}, - {::_pbi::TcParser::MiniParse, {}}, + // bool optional = 3; + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.optional_)}}, {::_pbi::TcParser::MiniParse, {}}, // optional string unit = 5; {::_pbi::TcParser::FastUS1, @@ -5451,21 +3892,16 @@ const ::_pbi::TcParseTable<3, 6, 4, 51, 2> Enum8Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Gauge gauge = 3; - {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_.gauge_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Constant constant = 4; - {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 1, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, + // bool optional = 3; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.optional_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBool)}, + // map values = 4; + {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, // optional string unit = 5; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // map values = 6; - {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 2, - (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, }}, {{ - {::_pbi::TcParser::GetTable<::abacus::protobuf::Gauge>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Enum8Metric_EnumValue>}, }}, {{ @@ -5498,32 +3934,14 @@ ::uint8_t* Enum8Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - switch (kind_case()) { - case kGauge: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::gauge(this), - _Internal::gauge(this).GetCachedSize(), target, stream); - break; - } - case kConstant: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); - break; - } - default: - break; - } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; - if (cached_has_bits & 0x00000001u) { - const std::string& _s = this->_internal_unit(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + // bool optional = 3; + if (this->_internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 3, this->_internal_optional(), target); } - // map values = 6; + // map values = 4; if (!_internal_values().empty()) { using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>; using WireHelper = Enum8Metric_ValuesEntry_DoNotUse::Funcs; @@ -5532,16 +3950,25 @@ ::uint8_t* Enum8Metric::_InternalSerialize( if (stream->IsSerializationDeterministic() && field.size() > 1) { for (const auto& entry : ::google::protobuf::internal::MapSorterFlat(field)) { target = WireHelper::InternalSerialize( - 6, entry.first, entry.second, target, stream); + 4, entry.first, entry.second, target, stream); } } else { for (const auto& entry : field) { target = WireHelper::InternalSerialize( - 6, entry.first, entry.second, target, stream); + 4, entry.first, entry.second, target, stream); } } } + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 5; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Enum8Metric.unit"); + target = stream->WriteStringMaybeAliased(5, _s, target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -5559,7 +3986,7 @@ ::size_t Enum8Metric::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // map values = 6; + // map values = 4; total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_values_size()); for (const auto& entry : _internal_values()) { total_size += Enum8Metric_ValuesEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second); @@ -5583,25 +4010,11 @@ ::size_t Enum8Metric::ByteSizeLong() const { this->_internal_offset()); } - switch (kind_case()) { - // .abacus.protobuf.Gauge gauge = 3; - case kGauge: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.gauge_); - break; - } - // .abacus.protobuf.Constant constant = 4; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); - break; - } - case KIND_NOT_SET: { - break; - } + // bool optional = 3; + if (this->_internal_optional() != 0) { + total_size += 2; } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -5630,20 +4043,8 @@ void Enum8Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - switch (from.kind_case()) { - case kGauge: { - _this->_internal_mutable_gauge()->::abacus::protobuf::Gauge::MergeFrom( - from._internal_gauge()); - break; - } - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); - break; - } - case KIND_NOT_SET: { - break; - } + if (from._internal_optional() != 0) { + _this->_internal_set_optional(from._internal_optional()); } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -5670,56 +4071,47 @@ void Enum8Metric::InternalSwap(Enum8Metric* other) { &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); - swap(_impl_.offset_, other->_impl_.offset_); - swap(_impl_.kind_, other->_impl_.kind_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.optional_) + + sizeof(Enum8Metric::_impl_.optional_) + - PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); } ::google::protobuf::Metadata Enum8Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[9]); } // =================================================================== -class StringMetric::_Internal { +class Constant::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Constant, _impl_._has_bits_); static constexpr ::int32_t kOneofCaseOffset = - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::StringMetric, _impl_._oneof_case_); - static const ::abacus::protobuf::Constant& constant(const StringMetric* msg); + PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_._oneof_case_); + static void set_has_unit(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; -const ::abacus::protobuf::Constant& StringMetric::_Internal::constant(const StringMetric* msg) { - return *msg->_impl_.kind_.constant_; -} -void StringMetric::set_allocated_constant(::abacus::protobuf::Constant* constant) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_kind(); - if (constant) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(constant); - if (message_arena != submessage_arena) { - constant = ::google::protobuf::internal::GetOwnedMessage( - message_arena, constant, submessage_arena); - } - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.StringMetric.constant) -} -StringMetric::StringMetric(::google::protobuf::Arena* arena) +Constant::Constant(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:abacus.protobuf.StringMetric) + // @@protoc_insertion_point(arena_constructor:abacus.protobuf.Constant) } -StringMetric::StringMetric(const StringMetric& from) : ::google::protobuf::Message() { - StringMetric* const _this = this; +Constant::Constant(const Constant& from) : ::google::protobuf::Message() { + Constant* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.description_){}, - decltype(_impl_.offset_){}, - decltype(_impl_.kind_){}, + decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.value_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( @@ -5731,82 +4123,159 @@ StringMetric::StringMetric(const StringMetric& from) : ::google::protobuf::Messa if (!from._internal_description().empty()) { _this->_impl_.description_.Set(from._internal_description(), _this->GetArenaForAllocation()); } - _this->_impl_.offset_ = from._impl_.offset_; - clear_has_kind(); - switch (from.kind_case()) { - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); + } + clear_has_value(); + switch (from.value_case()) { + case kUint64: { + _this->_internal_set_uint64(from._internal_uint64()); + break; + } + case kInt64: { + _this->_internal_set_int64(from._internal_int64()); + break; + } + case kUint32: { + _this->_internal_set_uint32(from._internal_uint32()); + break; + } + case kInt32: { + _this->_internal_set_int32(from._internal_int32()); + break; + } + case kFloat32: { + _this->_internal_set_float32(from._internal_float32()); + break; + } + case kFloat64: { + _this->_internal_set_float64(from._internal_float64()); + break; + } + case kBoolean: { + _this->_internal_set_boolean(from._internal_boolean()); + break; + } + case kEnum8: { + _this->_internal_set_enum8(from._internal_enum8()); + break; + } + case kString: { + _this->_internal_set_string(from._internal_string()); break; } - case KIND_NOT_SET: { + case VALUE_NOT_SET: { break; } } - // @@protoc_insertion_point(copy_constructor:abacus.protobuf.StringMetric) + // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Constant) } -inline void StringMetric::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ - decltype(_impl_.description_){}, - decltype(_impl_.offset_){0u}, - decltype(_impl_.kind_){}, +inline void Constant::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.description_){}, + decltype(_impl_.unit_){}, + decltype(_impl_.value_){}, /*decltype(_impl_._oneof_case_)*/ {}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.description_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - clear_has_kind(); + _impl_.unit_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + clear_has_value(); } -StringMetric::~StringMetric() { - // @@protoc_insertion_point(destructor:abacus.protobuf.StringMetric) +Constant::~Constant() { + // @@protoc_insertion_point(destructor:abacus.protobuf.Constant) _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } -inline void StringMetric::SharedDtor() { +inline void Constant::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_.description_.Destroy(); - if (has_kind()) { - clear_kind(); + _impl_.unit_.Destroy(); + if (has_value()) { + clear_value(); } } -void StringMetric::SetCachedSize(int size) const { +void Constant::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void StringMetric::clear_kind() { -// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.StringMetric) - switch (kind_case()) { - case kConstant: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } +void Constant::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Constant) + switch (value_case()) { + case kUint64: { + // No need to clear + break; + } + case kInt64: { + // No need to clear + break; + } + case kUint32: { + // No need to clear + break; + } + case kInt32: { + // No need to clear + break; + } + case kFloat32: { + // No need to clear + break; + } + case kFloat64: { + // No need to clear + break; + } + case kBoolean: { + // No need to clear break; } - case KIND_NOT_SET: { + case kEnum8: { + // No need to clear + break; + } + case kString: { + _impl_.value_.string_.Destroy(); + break; + } + case VALUE_NOT_SET: { break; } } - _impl_._oneof_case_[0] = KIND_NOT_SET; + _impl_._oneof_case_[0] = VALUE_NOT_SET; } -PROTOBUF_NOINLINE void StringMetric::Clear() { -// @@protoc_insertion_point(message_clear_start:abacus.protobuf.StringMetric) +PROTOBUF_NOINLINE void Constant::Clear() { +// @@protoc_insertion_point(message_clear_start:abacus.protobuf.Constant) ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; _impl_.description_.ClearToEmpty(); - _impl_.offset_ = 0u; - clear_kind(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.unit_.ClearNonDefaultToEmpty(); + } + clear_value(); + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* StringMetric::_InternalParse( +const char* Constant::_InternalParse( const char* ptr, ::_pbi::ParseContext* ctx) { ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); return ptr; @@ -5814,74 +4283,154 @@ const char* StringMetric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 3, 1, 48, 2> StringMetric::_table_ = { +const ::_pbi::TcParseTable<1, 11, 0, 62, 2> Constant::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(Constant, _impl_._has_bits_), 0, // no _extensions_ - 3, 8, // max_field_number, fast_idx_mask + 11, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap + 4294965248, // skipmap offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_StringMetric_default_instance_._instance, + 11, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_Constant_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // string description = 2; + // string description = 10; {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.description_)}}, - // uint32 offset = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(StringMetric, _impl_.offset_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.offset_)}}, + {82, 63, 0, PROTOBUF_FIELD_OFFSET(Constant, _impl_.description_)}}, + // optional string unit = 11; + {::_pbi::TcParser::FastUS1, + {90, 0, 0, PROTOBUF_FIELD_OFFSET(Constant, _impl_.unit_)}}, }}, {{ 65535, 65535 }}, {{ - // uint32 offset = 1; - {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.offset_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // string description = 2; - {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.description_), 0, 0, + // uint64 uint64 = 1; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.uint64_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt64)}, + // int64 int64 = 2; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.int64_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kInt64)}, + // uint32 uint32 = 3; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.uint32_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, + // int32 int32 = 4; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.int32_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kInt32)}, + // float float32 = 5; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.float32_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kFloat)}, + // double float64 = 6; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.float64_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + // bool boolean = 7; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.boolean_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kBool)}, + // uint32 enum8 = 8; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.enum8_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, + // string string = 9; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.string_), _Internal::kOneofCaseOffset + 0, 0, + (0 | ::_fl::kFcOneof | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string description = 10; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .abacus.protobuf.Constant constant = 3; - {PROTOBUF_FIELD_OFFSET(StringMetric, _impl_.kind_.constant_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvDefault)}, - }}, {{ - {::_pbi::FieldAuxDefaultMessage{}, &::abacus::protobuf::_Constant_default_instance_}, - }}, {{ - "\34\0\13\0\0\0\0\0" - "abacus.protobuf.StringMetric" + // optional string unit = 11; + {PROTOBUF_FIELD_OFFSET(Constant, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\30\0\0\0\0\0\0\0\0\6\13\4\0\0\0\0" + "abacus.protobuf.Constant" + "string" "description" + "unit" }}, }; -::uint8_t* StringMetric::_InternalSerialize( +::uint8_t* Constant::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.StringMetric) + // @@protoc_insertion_point(serialize_to_array_start:abacus.protobuf.Constant) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // uint32 offset = 1; - if (this->_internal_offset() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 1, this->_internal_offset(), target); + switch (value_case()) { + case kUint64: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 1, this->_internal_uint64(), target); + break; + } + case kInt64: { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64ToArrayWithField<2>( + stream, this->_internal_int64(), target); + break; + } + case kUint32: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 3, this->_internal_uint32(), target); + break; + } + case kInt32: { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<4>( + stream, this->_internal_int32(), target); + break; + } + case kFloat32: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFloatToArray( + 5, this->_internal_float32(), target); + break; + } + case kFloat64: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 6, this->_internal_float64(), target); + break; + } + case kBoolean: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 7, this->_internal_boolean(), target); + break; + } + case kEnum8: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 8, this->_internal_enum8(), target); + break; + } + case kString: { + const std::string& _s = this->_internal_string(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Constant.string"); + target = stream->WriteStringMaybeAliased(9, _s, target); + break; + } + default: + break; } - - // string description = 2; + // string description = 10; 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, "abacus.protobuf.StringMetric.description"); - target = stream->WriteStringMaybeAliased(2, _s, target); + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Constant.description"); + target = stream->WriteStringMaybeAliased(10, _s, target); } - // .abacus.protobuf.Constant constant = 3; - if (kind_case() == kConstant) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::constant(this), - _Internal::constant(this).GetCachedSize(), target, stream); + cached_has_bits = _impl_._has_bits_[0]; + // optional string unit = 11; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_unit(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Constant.unit"); + target = stream->WriteStringMaybeAliased(11, _s, target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -5889,56 +4438,101 @@ ::uint8_t* StringMetric::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.StringMetric) + // @@protoc_insertion_point(serialize_to_array_end:abacus.protobuf.Constant) return target; } -::size_t StringMetric::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.StringMetric) +::size_t Constant::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:abacus.protobuf.Constant) ::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 description = 2; + // string description = 10; if (!this->_internal_description().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_description()); } - // uint32 offset = 1; - if (this->_internal_offset() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_offset()); + // optional string unit = 11; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_unit()); } - switch (kind_case()) { - // .abacus.protobuf.Constant constant = 3; - case kConstant: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.kind_.constant_); + switch (value_case()) { + // uint64 uint64 = 1; + case kUint64: { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this->_internal_uint64()); + break; + } + // int64 int64 = 2; + case kInt64: { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this->_internal_int64()); + break; + } + // uint32 uint32 = 3; + case kUint32: { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_uint32()); + break; + } + // int32 int32 = 4; + case kInt32: { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_int32()); + break; + } + // float float32 = 5; + case kFloat32: { + total_size += 5; + break; + } + // double float64 = 6; + case kFloat64: { + total_size += 9; + break; + } + // bool boolean = 7; + case kBoolean: { + total_size += 2; + break; + } + // uint32 enum8 = 8; + case kEnum8: { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this->_internal_enum8()); + break; + } + // string string = 9; + case kString: { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_string()); break; } - case KIND_NOT_SET: { + case VALUE_NOT_SET: { break; } } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::google::protobuf::Message::ClassData StringMetric::_class_data_ = { +const ::google::protobuf::Message::ClassData Constant::_class_data_ = { ::google::protobuf::Message::CopyWithSourceCheck, - StringMetric::MergeImpl + Constant::MergeImpl }; -const ::google::protobuf::Message::ClassData*StringMetric::GetClassData() const { return &_class_data_; } +const ::google::protobuf::Message::ClassData*Constant::GetClassData() const { return &_class_data_; } -void StringMetric::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:abacus.protobuf.StringMetric) +void Constant::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:abacus.protobuf.Constant) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -5946,49 +4540,82 @@ void StringMetric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (!from._internal_description().empty()) { _this->_internal_set_description(from._internal_description()); } - if (from._internal_offset() != 0) { - _this->_internal_set_offset(from._internal_offset()); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_unit(from._internal_unit()); } - switch (from.kind_case()) { - case kConstant: { - _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( - from._internal_constant()); + switch (from.value_case()) { + case kUint64: { + _this->_internal_set_uint64(from._internal_uint64()); + break; + } + case kInt64: { + _this->_internal_set_int64(from._internal_int64()); + break; + } + case kUint32: { + _this->_internal_set_uint32(from._internal_uint32()); + break; + } + case kInt32: { + _this->_internal_set_int32(from._internal_int32()); + break; + } + case kFloat32: { + _this->_internal_set_float32(from._internal_float32()); + break; + } + case kFloat64: { + _this->_internal_set_float64(from._internal_float64()); + break; + } + case kBoolean: { + _this->_internal_set_boolean(from._internal_boolean()); + break; + } + case kEnum8: { + _this->_internal_set_enum8(from._internal_enum8()); break; } - case KIND_NOT_SET: { + case kString: { + _this->_internal_set_string(from._internal_string()); + break; + } + case VALUE_NOT_SET: { break; } } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void StringMetric::CopyFrom(const StringMetric& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.StringMetric) +void Constant::CopyFrom(const Constant& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:abacus.protobuf.Constant) if (&from == this) return; Clear(); MergeFrom(from); } -PROTOBUF_NOINLINE bool StringMetric::IsInitialized() const { +PROTOBUF_NOINLINE bool Constant::IsInitialized() const { return true; } -void StringMetric::InternalSwap(StringMetric* other) { +void Constant::InternalSwap(Constant* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.description_, lhs_arena, &other->_impl_.description_, rhs_arena); - swap(_impl_.offset_, other->_impl_.offset_); - swap(_impl_.kind_, other->_impl_.kind_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, + &other->_impl_.unit_, rhs_arena); + swap(_impl_.value_, other->_impl_.value_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } -::google::protobuf::Metadata StringMetric::GetMetadata() const { +::google::protobuf::Metadata Constant::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[10]); } // =================================================================== @@ -5996,6 +4623,7 @@ class Metric::_Internal { public: static constexpr ::int32_t kOneofCaseOffset = PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _impl_._oneof_case_); + static const ::abacus::protobuf::Constant& constant(const Metric* msg); static const ::abacus::protobuf::UInt64Metric& uint64(const Metric* msg); static const ::abacus::protobuf::Int64Metric& int64(const Metric* msg); static const ::abacus::protobuf::UInt32Metric& uint32(const Metric* msg); @@ -6004,9 +4632,11 @@ class Metric::_Internal { static const ::abacus::protobuf::Float32Metric& float32(const Metric* msg); static const ::abacus::protobuf::BoolMetric& boolean(const Metric* msg); static const ::abacus::protobuf::Enum8Metric& enum8(const Metric* msg); - static const ::abacus::protobuf::StringMetric& string(const Metric* msg); }; +const ::abacus::protobuf::Constant& Metric::_Internal::constant(const Metric* msg) { + return *msg->_impl_.type_.constant_; +} const ::abacus::protobuf::UInt64Metric& Metric::_Internal::uint64(const Metric* msg) { return *msg->_impl_.type_.uint64_; } @@ -6031,8 +4661,20 @@ const ::abacus::protobuf::BoolMetric& Metric::_Internal::boolean(const Metric* m const ::abacus::protobuf::Enum8Metric& Metric::_Internal::enum8(const Metric* msg) { return *msg->_impl_.type_.enum8_; } -const ::abacus::protobuf::StringMetric& Metric::_Internal::string(const Metric* msg) { - return *msg->_impl_.type_.string_; +void Metric::set_allocated_constant(::abacus::protobuf::Constant* constant) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + clear_type(); + if (constant) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(constant); + if (message_arena != submessage_arena) { + constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constant, submessage_arena); + } + set_has_constant(); + _impl_.type_.constant_ = constant; + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.constant) } void Metric::set_allocated_uint64(::abacus::protobuf::UInt64Metric* uint64) { ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); @@ -6154,21 +4796,6 @@ void Metric::set_allocated_enum8(::abacus::protobuf::Enum8Metric* enum8) { } // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.enum8) } -void Metric::set_allocated_string(::abacus::protobuf::StringMetric* string) { - ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); - clear_type(); - if (string) { - ::google::protobuf::Arena* submessage_arena = - ::google::protobuf::Arena::InternalGetOwningArena(string); - if (message_arena != submessage_arena) { - string = ::google::protobuf::internal::GetOwnedMessage( - message_arena, string, submessage_arena); - } - set_has_string(); - _impl_.type_.string_ = string; - } - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Metric.string) -} Metric::Metric(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -6186,6 +4813,11 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { from._internal_metadata_); clear_has_type(); switch (from.type_case()) { + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } case kUint64: { _this->_internal_mutable_uint64()->::abacus::protobuf::UInt64Metric::MergeFrom( from._internal_uint64()); @@ -6226,11 +4858,6 @@ Metric::Metric(const Metric& from) : ::google::protobuf::Message() { from._internal_enum8()); break; } - case kString: { - _this->_internal_mutable_string()->::abacus::protobuf::StringMetric::MergeFrom( - from._internal_string()); - break; - } case TYPE_NOT_SET: { break; } @@ -6265,6 +4892,12 @@ void Metric::SetCachedSize(int size) const { void Metric::clear_type() { // @@protoc_insertion_point(one_of_clear_start:abacus.protobuf.Metric) switch (type_case()) { + case kConstant: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.type_.constant_; + } + break; + } case kUint64: { if (GetArenaForAllocation() == nullptr) { delete _impl_.type_.uint64_; @@ -6313,12 +4946,6 @@ void Metric::clear_type() { } break; } - case kString: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.string_; - } - break; - } case TYPE_NOT_SET: { break; } @@ -6349,9 +4976,9 @@ const ::_pbi::TcParseTable<0, 9, 9, 0, 2> Metric::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 11, 0, // max_field_number, fast_idx_mask + 9, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294965251, // skipmap + 4294966784, // skipmap offsetof(decltype(_table_), field_entries), 9, // num_field_entries 9, // num_aux_entries @@ -6363,34 +4990,35 @@ const ::_pbi::TcParseTable<0, 9, 9, 0, 2> Metric::_table_ = { }}, {{ 65535, 65535 }}, {{ - // .abacus.protobuf.UInt64Metric uint64 = 3; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_), _Internal::kOneofCaseOffset + 0, 0, + // .abacus.protobuf.Constant constant = 1; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.constant_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Int64Metric int64 = 4; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int64_), _Internal::kOneofCaseOffset + 0, 1, + // .abacus.protobuf.UInt64Metric uint64 = 2; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint64_), _Internal::kOneofCaseOffset + 0, 1, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.UInt32Metric uint32 = 5; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint32_), _Internal::kOneofCaseOffset + 0, 2, + // .abacus.protobuf.Int64Metric int64 = 3; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int64_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Int32Metric int32 = 6; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int32_), _Internal::kOneofCaseOffset + 0, 3, + // .abacus.protobuf.UInt32Metric uint32 = 4; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.uint32_), _Internal::kOneofCaseOffset + 0, 3, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Float64Metric float64 = 7; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float64_), _Internal::kOneofCaseOffset + 0, 4, + // .abacus.protobuf.Int32Metric int32 = 5; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.int32_), _Internal::kOneofCaseOffset + 0, 4, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Float32Metric float32 = 8; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float32_), _Internal::kOneofCaseOffset + 0, 5, + // .abacus.protobuf.Float64Metric float64 = 6; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float64_), _Internal::kOneofCaseOffset + 0, 5, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.BoolMetric boolean = 9; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.boolean_), _Internal::kOneofCaseOffset + 0, 6, + // .abacus.protobuf.Float32Metric float32 = 7; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.float32_), _Internal::kOneofCaseOffset + 0, 6, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.Enum8Metric enum8 = 10; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.enum8_), _Internal::kOneofCaseOffset + 0, 7, + // .abacus.protobuf.BoolMetric boolean = 8; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.boolean_), _Internal::kOneofCaseOffset + 0, 7, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .abacus.protobuf.StringMetric string = 11; - {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.string_), _Internal::kOneofCaseOffset + 0, 8, + // .abacus.protobuf.Enum8Metric enum8 = 9; + {PROTOBUF_FIELD_OFFSET(Metric, _impl_.type_.enum8_), _Internal::kOneofCaseOffset + 0, 8, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ + {::_pbi::TcParser::GetTable<::abacus::protobuf::Constant>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt64Metric>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::Int64Metric>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::UInt32Metric>()}, @@ -6399,7 +5027,6 @@ const ::_pbi::TcParseTable<0, 9, 9, 0, 2> Metric::_table_ = { {::_pbi::TcParser::GetTable<::abacus::protobuf::Float32Metric>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::BoolMetric>()}, {::_pbi::TcParser::GetTable<::abacus::protobuf::Enum8Metric>()}, - {::_pbi::TcParser::GetTable<::abacus::protobuf::StringMetric>()}, }}, {{ }}, }; @@ -6412,60 +5039,60 @@ ::uint8_t* Metric::_InternalSerialize( (void)cached_has_bits; switch (type_case()) { + case kConstant: { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::constant(this), + _Internal::constant(this).GetCachedSize(), target, stream); + break; + } case kUint64: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::uint64(this), + InternalWriteMessage(2, _Internal::uint64(this), _Internal::uint64(this).GetCachedSize(), target, stream); break; } case kInt64: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::int64(this), + InternalWriteMessage(3, _Internal::int64(this), _Internal::int64(this).GetCachedSize(), target, stream); break; } case kUint32: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::uint32(this), + InternalWriteMessage(4, _Internal::uint32(this), _Internal::uint32(this).GetCachedSize(), target, stream); break; } case kInt32: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(6, _Internal::int32(this), + InternalWriteMessage(5, _Internal::int32(this), _Internal::int32(this).GetCachedSize(), target, stream); break; } case kFloat64: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::float64(this), + InternalWriteMessage(6, _Internal::float64(this), _Internal::float64(this).GetCachedSize(), target, stream); break; } case kFloat32: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::float32(this), + InternalWriteMessage(7, _Internal::float32(this), _Internal::float32(this).GetCachedSize(), target, stream); break; } case kBoolean: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(9, _Internal::boolean(this), + InternalWriteMessage(8, _Internal::boolean(this), _Internal::boolean(this).GetCachedSize(), target, stream); break; } case kEnum8: { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(10, _Internal::enum8(this), + InternalWriteMessage(9, _Internal::enum8(this), _Internal::enum8(this).GetCachedSize(), target, stream); break; } - case kString: { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(11, _Internal::string(this), - _Internal::string(this).GetCachedSize(), target, stream); - break; - } default: break; } @@ -6487,69 +5114,69 @@ ::size_t Metric::ByteSizeLong() const { (void) cached_has_bits; switch (type_case()) { - // .abacus.protobuf.UInt64Metric uint64 = 3; + // .abacus.protobuf.Constant constant = 1; + case kConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.type_.constant_); + break; + } + // .abacus.protobuf.UInt64Metric uint64 = 2; case kUint64: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.uint64_); break; } - // .abacus.protobuf.Int64Metric int64 = 4; + // .abacus.protobuf.Int64Metric int64 = 3; case kInt64: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.int64_); break; } - // .abacus.protobuf.UInt32Metric uint32 = 5; + // .abacus.protobuf.UInt32Metric uint32 = 4; case kUint32: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.uint32_); break; } - // .abacus.protobuf.Int32Metric int32 = 6; + // .abacus.protobuf.Int32Metric int32 = 5; case kInt32: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.int32_); break; } - // .abacus.protobuf.Float64Metric float64 = 7; + // .abacus.protobuf.Float64Metric float64 = 6; case kFloat64: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.float64_); break; } - // .abacus.protobuf.Float32Metric float32 = 8; + // .abacus.protobuf.Float32Metric float32 = 7; case kFloat32: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.float32_); break; } - // .abacus.protobuf.BoolMetric boolean = 9; + // .abacus.protobuf.BoolMetric boolean = 8; case kBoolean: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.boolean_); break; } - // .abacus.protobuf.Enum8Metric enum8 = 10; + // .abacus.protobuf.Enum8Metric enum8 = 9; case kEnum8: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *_impl_.type_.enum8_); break; } - // .abacus.protobuf.StringMetric string = 11; - case kString: { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSize( - *_impl_.type_.string_); - break; - } case TYPE_NOT_SET: { break; } @@ -6573,6 +5200,11 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot (void) cached_has_bits; switch (from.type_case()) { + case kConstant: { + _this->_internal_mutable_constant()->::abacus::protobuf::Constant::MergeFrom( + from._internal_constant()); + break; + } case kUint64: { _this->_internal_mutable_uint64()->::abacus::protobuf::UInt64Metric::MergeFrom( from._internal_uint64()); @@ -6613,11 +5245,6 @@ void Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google::prot from._internal_enum8()); break; } - case kString: { - _this->_internal_mutable_string()->::abacus::protobuf::StringMetric::MergeFrom( - from._internal_string()); - break; - } case TYPE_NOT_SET: { break; } @@ -6646,7 +5273,7 @@ void Metric::InternalSwap(Metric* other) { ::google::protobuf::Metadata Metric::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[14]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[11]); } // =================================================================== @@ -6659,7 +5286,7 @@ void MetricsMetadata_MetricsEntry_DoNotUse::MergeFrom(const MetricsMetadata_Metr ::google::protobuf::Metadata MetricsMetadata_MetricsEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[15]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[12]); } // =================================================================== @@ -6933,7 +5560,7 @@ void MetricsMetadata::InternalSwap(MetricsMetadata* other) { ::google::protobuf::Metadata MetricsMetadata::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_getter, &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, - file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[16]); + file_level_metadata_abacus_2fprotobuf_2fmetrics_2eproto[13]); } // @@protoc_insertion_point(namespace_scope) } // namespace protobuf diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 35d49e3d..89197ac2 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -24,7 +24,6 @@ #include "google/protobuf/io/coded_stream.h" #include "google/protobuf/arena.h" #include "google/protobuf/arenastring.h" -#include "google/protobuf/generated_message_bases.h" #include "google/protobuf/generated_message_tctable_decl.h" #include "google/protobuf/generated_message_util.h" #include "google/protobuf/metadata_lite.h" @@ -66,9 +65,6 @@ extern BoolMetricDefaultTypeInternal _BoolMetric_default_instance_; class Constant; struct ConstantDefaultTypeInternal; extern ConstantDefaultTypeInternal _Constant_default_instance_; -class Counter; -struct CounterDefaultTypeInternal; -extern CounterDefaultTypeInternal _Counter_default_instance_; class Enum8Metric; struct Enum8MetricDefaultTypeInternal; extern Enum8MetricDefaultTypeInternal _Enum8Metric_default_instance_; @@ -84,9 +80,6 @@ extern Float32MetricDefaultTypeInternal _Float32Metric_default_instance_; class Float64Metric; struct Float64MetricDefaultTypeInternal; extern Float64MetricDefaultTypeInternal _Float64Metric_default_instance_; -class Gauge; -struct GaugeDefaultTypeInternal; -extern GaugeDefaultTypeInternal _Gauge_default_instance_; class Int32Metric; struct Int32MetricDefaultTypeInternal; extern Int32MetricDefaultTypeInternal _Int32Metric_default_instance_; @@ -102,9 +95,6 @@ extern MetricsMetadataDefaultTypeInternal _MetricsMetadata_default_instance_; class MetricsMetadata_MetricsEntry_DoNotUse; struct MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal; extern MetricsMetadata_MetricsEntry_DoNotUseDefaultTypeInternal _MetricsMetadata_MetricsEntry_DoNotUse_default_instance_; -class StringMetric; -struct StringMetricDefaultTypeInternal; -extern StringMetricDefaultTypeInternal _StringMetric_default_instance_; class UInt32Metric; struct UInt32MetricDefaultTypeInternal; extern UInt32MetricDefaultTypeInternal _UInt32Metric_default_instance_; @@ -152,31 +142,63 @@ inline bool Endianness_Parse(absl::string_view name, Endianness* value) { return ::google::protobuf::internal::ParseNamedEnum( Endianness_descriptor(), name, value); } +enum Kind : int { + GAUGE = 0, + COUNTER = 1, + 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(1); +constexpr int Kind_ARRAYSIZE = 1 + 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); +} // =================================================================== // ------------------------------------------------------------------- -class Gauge final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Gauge) */ { +class UInt64Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt64Metric) */ { public: - inline Gauge() : Gauge(nullptr) {} - ~Gauge() override; + inline UInt64Metric() : UInt64Metric(nullptr) {} + ~UInt64Metric() override; template - explicit PROTOBUF_CONSTEXPR Gauge(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UInt64Metric(::google::protobuf::internal::ConstantInitialized); - Gauge(const Gauge& from); - Gauge(Gauge&& from) noexcept - : Gauge() { + UInt64Metric(const UInt64Metric& from); + UInt64Metric(UInt64Metric&& from) noexcept + : UInt64Metric() { *this = ::std::move(from); } - inline Gauge& operator=(const Gauge& from) { + inline UInt64Metric& operator=(const UInt64Metric& from) { CopyFrom(from); return *this; } - inline Gauge& operator=(Gauge&& from) noexcept { + inline UInt64Metric& operator=(UInt64Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -206,20 +228,20 @@ class Gauge final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Gauge& default_instance() { + static const UInt64Metric& default_instance() { return *internal_default_instance(); } - static inline const Gauge* internal_default_instance() { - return reinterpret_cast( - &_Gauge_default_instance_); + static inline const UInt64Metric* internal_default_instance() { + return reinterpret_cast( + &_UInt64Metric_default_instance_); } static constexpr int kIndexInFileMessages = 0; - friend void swap(Gauge& a, Gauge& b) { + friend void swap(UInt64Metric& a, UInt64Metric& b) { a.Swap(&b); } - inline void Swap(Gauge* other) { + inline void Swap(UInt64Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -232,7 +254,7 @@ class Gauge final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Gauge* other) { + void UnsafeArenaSwap(UInt64Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -240,14 +262,14 @@ class Gauge final : // implements Message ---------------------------------------------- - Gauge* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + UInt64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Gauge& from); + void CopyFrom(const UInt64Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Gauge& from) { - Gauge::MergeImpl(*this, from); + void MergeFrom( const UInt64Metric& from) { + UInt64Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -265,15 +287,15 @@ class Gauge final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Gauge* other); + void InternalSwap(UInt64Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Gauge"; + return "abacus.protobuf.UInt64Metric"; } protected: - explicit Gauge(::google::protobuf::Arena* arena); + explicit UInt64Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -286,9 +308,58 @@ class Gauge final : // accessors ------------------------------------------------------- enum : int { - kOptionalFieldNumber = 1, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 5, + kOffsetFieldNumber = 1, + kOptionalFieldNumber = 3, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kKindFieldNumber = 4, }; - // bool optional = 1; + // 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: + // optional string unit = 5; + bool has_unit() const; + 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: + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // bool optional = 3; void clear_optional() ; bool optional() const; void set_optional(bool value); @@ -298,43 +369,82 @@ class Gauge final : void _internal_set_optional(bool value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Gauge) + // optional uint64 min = 6; + bool has_min() const; + void clear_min() ; + ::uint64_t min() const; + void set_min(::uint64_t value); + + private: + ::uint64_t _internal_min() const; + void _internal_set_min(::uint64_t value); + + public: + // optional uint64 max = 7; + bool has_max() const; + void clear_max() ; + ::uint64_t max() const; + void set_max(::uint64_t value); + + private: + ::uint64_t _internal_max() const; + void _internal_set_max(::uint64_t value); + + public: + // .abacus.protobuf.Kind kind = 4; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt64Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 1, 0, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 52, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - bool optional_; + ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; + bool optional_; + ::uint64_t min_; + ::uint64_t max_; + int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Counter final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Counter) */ { +class Int64Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int64Metric) */ { public: - inline Counter() : Counter(nullptr) {} - ~Counter() override; + inline Int64Metric() : Int64Metric(nullptr) {} + ~Int64Metric() override; template - explicit PROTOBUF_CONSTEXPR Counter(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Int64Metric(::google::protobuf::internal::ConstantInitialized); - Counter(const Counter& from); - Counter(Counter&& from) noexcept - : Counter() { + Int64Metric(const Int64Metric& from); + Int64Metric(Int64Metric&& from) noexcept + : Int64Metric() { *this = ::std::move(from); } - inline Counter& operator=(const Counter& from) { + inline Int64Metric& operator=(const Int64Metric& from) { CopyFrom(from); return *this; } - inline Counter& operator=(Counter&& from) noexcept { + inline Int64Metric& operator=(Int64Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -364,20 +474,20 @@ class Counter final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Counter& default_instance() { + static const Int64Metric& default_instance() { return *internal_default_instance(); } - static inline const Counter* internal_default_instance() { - return reinterpret_cast( - &_Counter_default_instance_); + static inline const Int64Metric* internal_default_instance() { + return reinterpret_cast( + &_Int64Metric_default_instance_); } static constexpr int kIndexInFileMessages = 1; - friend void swap(Counter& a, Counter& b) { + friend void swap(Int64Metric& a, Int64Metric& b) { a.Swap(&b); } - inline void Swap(Counter* other) { + inline void Swap(Int64Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -390,7 +500,7 @@ class Counter final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Counter* other) { + void UnsafeArenaSwap(Int64Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -398,14 +508,14 @@ class Counter final : // implements Message ---------------------------------------------- - Counter* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Int64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Counter& from); + void CopyFrom(const Int64Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Counter& from) { - Counter::MergeImpl(*this, from); + void MergeFrom( const Int64Metric& from) { + Int64Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -423,15 +533,15 @@ class Counter final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Counter* other); + void InternalSwap(Int64Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Counter"; + return "abacus.protobuf.Int64Metric"; } protected: - explicit Counter(::google::protobuf::Arena* arena); + explicit Int64Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -444,9 +554,58 @@ class Counter final : // accessors ------------------------------------------------------- enum : int { - kOptionalFieldNumber = 1, + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 5, + kOffsetFieldNumber = 1, + kOptionalFieldNumber = 3, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kKindFieldNumber = 4, }; - // bool optional = 1; + // 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: + // optional string unit = 5; + bool has_unit() const; + 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: + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // bool optional = 3; void clear_optional() ; bool optional() const; void set_optional(bool value); @@ -456,42 +615,82 @@ class Counter final : void _internal_set_optional(bool value); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Counter) + // optional int64 min = 6; + bool has_min() const; + void clear_min() ; + ::int64_t min() const; + void set_min(::int64_t value); + + private: + ::int64_t _internal_min() const; + void _internal_set_min(::int64_t value); + + public: + // optional int64 max = 7; + bool has_max() const; + void clear_max() ; + ::int64_t max() const; + void set_max(::int64_t value); + + private: + ::int64_t _internal_max() const; + void _internal_set_max(::int64_t value); + + public: + // .abacus.protobuf.Kind kind = 4; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.Int64Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 1, 0, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - bool optional_; + ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; + bool optional_; + ::int64_t min_; + ::int64_t max_; + int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Constant final : - public ::google::protobuf::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:abacus.protobuf.Constant) */ { +class UInt32Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt32Metric) */ { public: - inline Constant() : Constant(nullptr) {} + inline UInt32Metric() : UInt32Metric(nullptr) {} + ~UInt32Metric() override; template - explicit PROTOBUF_CONSTEXPR Constant(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UInt32Metric(::google::protobuf::internal::ConstantInitialized); - Constant(const Constant& from); - Constant(Constant&& from) noexcept - : Constant() { + UInt32Metric(const UInt32Metric& from); + UInt32Metric(UInt32Metric&& from) noexcept + : UInt32Metric() { *this = ::std::move(from); } - inline Constant& operator=(const Constant& from) { + inline UInt32Metric& operator=(const UInt32Metric& from) { CopyFrom(from); return *this; } - inline Constant& operator=(Constant&& from) noexcept { + inline UInt32Metric& operator=(UInt32Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -521,20 +720,20 @@ class Constant final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Constant& default_instance() { + static const UInt32Metric& default_instance() { return *internal_default_instance(); } - static inline const Constant* internal_default_instance() { - return reinterpret_cast( - &_Constant_default_instance_); + static inline const UInt32Metric* internal_default_instance() { + return reinterpret_cast( + &_UInt32Metric_default_instance_); } static constexpr int kIndexInFileMessages = 2; - friend void swap(Constant& a, Constant& b) { + friend void swap(UInt32Metric& a, UInt32Metric& b) { a.Swap(&b); } - inline void Swap(Constant* other) { + inline void Swap(UInt32Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -547,7 +746,7 @@ class Constant final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Constant* other) { + void UnsafeArenaSwap(UInt32Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -555,26 +754,40 @@ class Constant final : // implements Message ---------------------------------------------- - Constant* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const Constant& from) { - ::google::protobuf::internal::ZeroFieldsBase::CopyImpl(*this, from); + UInt32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - using ::google::protobuf::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const Constant& from) { - ::google::protobuf::internal::ZeroFieldsBase::MergeImpl(*this, from); + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const UInt32Metric& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const UInt32Metric& from) { + UInt32Metric::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(UInt32Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Constant"; + return "abacus.protobuf.UInt32Metric"; } protected: - explicit Constant(::google::protobuf::Arena* arena); + explicit UInt32Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -586,38 +799,144 @@ class Constant final : // accessors ------------------------------------------------------- - // @@protoc_insertion_point(class_scope:abacus.protobuf.Constant) + enum : int { + kDescriptionFieldNumber = 2, + kUnitFieldNumber = 5, + kOffsetFieldNumber = 1, + kOptionalFieldNumber = 3, + kKindFieldNumber = 4, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + }; + // 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: + // optional string unit = 5; + bool has_unit() const; + 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: + // uint32 offset = 1; + void clear_offset() ; + ::uint32_t offset() const; + void set_offset(::uint32_t value); + + private: + ::uint32_t _internal_offset() const; + void _internal_set_offset(::uint32_t value); + + public: + // bool optional = 3; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); + + private: + bool _internal_optional() const; + void _internal_set_optional(bool value); + + public: + // .abacus.protobuf.Kind kind = 4; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); + + private: + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); + + public: + // optional uint32 min = 6; + bool has_min() const; + void clear_min() ; + ::uint32_t min() const; + void set_min(::uint32_t value); + + private: + ::uint32_t _internal_min() const; + void _internal_set_min(::uint32_t value); + + public: + // optional uint32 max = 7; + bool has_max() const; + void clear_max() ; + ::uint32_t max() const; + void set_max(::uint32_t value); + + private: + ::uint32_t _internal_max() const; + void _internal_set_max(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt32Metric) private: class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 52, 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_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr unit_; + ::uint32_t offset_; + bool optional_; + int kind_; + ::uint32_t min_; + ::uint32_t max_; PROTOBUF_TSAN_DECLARE_MEMBER }; + union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class UInt64Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt64Metric) */ { +class Int32Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int32Metric) */ { public: - inline UInt64Metric() : UInt64Metric(nullptr) {} - ~UInt64Metric() override; + inline Int32Metric() : Int32Metric(nullptr) {} + ~Int32Metric() override; template - explicit PROTOBUF_CONSTEXPR UInt64Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Int32Metric(::google::protobuf::internal::ConstantInitialized); - UInt64Metric(const UInt64Metric& from); - UInt64Metric(UInt64Metric&& from) noexcept - : UInt64Metric() { + Int32Metric(const Int32Metric& from); + Int32Metric(Int32Metric&& from) noexcept + : Int32Metric() { *this = ::std::move(from); } - inline UInt64Metric& operator=(const UInt64Metric& from) { + inline Int32Metric& operator=(const Int32Metric& from) { CopyFrom(from); return *this; } - inline UInt64Metric& operator=(UInt64Metric&& from) noexcept { + inline Int32Metric& operator=(Int32Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -647,27 +966,20 @@ class UInt64Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const UInt64Metric& default_instance() { + static const Int32Metric& default_instance() { return *internal_default_instance(); } - enum KindCase { - kGauge = 3, - kCounter = 4, - kConstant = 5, - KIND_NOT_SET = 0, - }; - - static inline const UInt64Metric* internal_default_instance() { - return reinterpret_cast( - &_UInt64Metric_default_instance_); + static inline const Int32Metric* internal_default_instance() { + return reinterpret_cast( + &_Int32Metric_default_instance_); } static constexpr int kIndexInFileMessages = 3; - friend void swap(UInt64Metric& a, UInt64Metric& b) { + friend void swap(Int32Metric& a, Int32Metric& b) { a.Swap(&b); } - inline void Swap(UInt64Metric* other) { + inline void Swap(Int32Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -680,7 +992,7 @@ class UInt64Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(UInt64Metric* other) { + void UnsafeArenaSwap(Int32Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -688,14 +1000,14 @@ class UInt64Metric final : // implements Message ---------------------------------------------- - UInt64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Int32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const UInt64Metric& from); + void CopyFrom(const Int32Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const UInt64Metric& from) { - UInt64Metric::MergeImpl(*this, from); + void MergeFrom( const Int32Metric& from) { + Int32Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -713,15 +1025,15 @@ class UInt64Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(UInt64Metric* other); + void InternalSwap(Int32Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.UInt64Metric"; + return "abacus.protobuf.Int32Metric"; } protected: - explicit UInt64Metric(::google::protobuf::Arena* arena); + explicit Int32Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -735,13 +1047,12 @@ class UInt64Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 6, - kMinFieldNumber = 7, - kMaxFieldNumber = 8, + kUnitFieldNumber = 5, kOffsetFieldNumber = 1, - kGaugeFieldNumber = 3, - kCounterFieldNumber = 4, - kConstantFieldNumber = 5, + kOptionalFieldNumber = 3, + kKindFieldNumber = 4, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, }; // string description = 2; void clear_description() ; @@ -759,7 +1070,7 @@ class UInt64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 6; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -775,28 +1086,6 @@ class UInt64Metric final : const std::string& value); std::string* _internal_mutable_unit(); - public: - // optional uint64 min = 7; - bool has_min() const; - void clear_min() ; - ::uint64_t min() const; - void set_min(::uint64_t value); - - private: - ::uint64_t _internal_min() const; - void _internal_set_min(::uint64_t value); - - public: - // optional uint64 max = 8; - bool has_max() const; - void clear_max() ; - ::uint64_t max() const; - void set_max(::uint64_t value); - - private: - ::uint64_t _internal_max() const; - void _internal_set_max(::uint64_t value); - public: // uint32 offset = 1; void clear_offset() ; @@ -808,77 +1097,54 @@ class UInt64Metric final : void _internal_set_offset(::uint32_t value); public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; - private: - bool _internal_has_gauge() const; - - public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); - - private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + // bool optional = 3; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); - public: - // .abacus.protobuf.Counter counter = 4; - bool has_counter() const; private: - bool _internal_has_counter() const; + bool _internal_optional() const; + void _internal_set_optional(bool value); public: - void clear_counter() ; - const ::abacus::protobuf::Counter& counter() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); - ::abacus::protobuf::Counter* mutable_counter(); - void set_allocated_counter(::abacus::protobuf::Counter* value); - void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); - ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + // .abacus.protobuf.Kind kind = 4; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - const ::abacus::protobuf::Counter& _internal_counter() const; - ::abacus::protobuf::Counter* _internal_mutable_counter(); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - // .abacus.protobuf.Constant constant = 5; - bool has_constant() const; + // optional int32 min = 6; + bool has_min() const; + void clear_min() ; + ::int32_t min() const; + void set_min(::int32_t value); + private: - bool _internal_has_constant() const; + ::int32_t _internal_min() const; + void _internal_set_min(::int32_t value); public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + // optional int32 max = 7; + bool has_max() const; + void clear_max() ; + ::int32_t max() const; + void set_max(::int32_t value); private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); + ::int32_t _internal_max() const; + void _internal_set_max(::int32_t value); public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt64Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Int32Metric) private: class _Internal; - void set_has_gauge(); - void set_has_counter(); - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 60, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -887,43 +1153,36 @@ class UInt64Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - ::uint64_t min_; - ::uint64_t max_; ::uint32_t offset_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Counter* counter_; - ::abacus::protobuf::Constant* constant_; - } kind_; - ::uint32_t _oneof_case_[1]; - + bool optional_; + int kind_; + ::int32_t min_; + ::int32_t max_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Int64Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int64Metric) */ { +class Float64Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float64Metric) */ { public: - inline Int64Metric() : Int64Metric(nullptr) {} - ~Int64Metric() override; + inline Float64Metric() : Float64Metric(nullptr) {} + ~Float64Metric() override; template - explicit PROTOBUF_CONSTEXPR Int64Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Float64Metric(::google::protobuf::internal::ConstantInitialized); - Int64Metric(const Int64Metric& from); - Int64Metric(Int64Metric&& from) noexcept - : Int64Metric() { - *this = ::std::move(from); + Float64Metric(const Float64Metric& from); + Float64Metric(Float64Metric&& from) noexcept + : Float64Metric() { + *this = ::std::move(from); } - inline Int64Metric& operator=(const Int64Metric& from) { + inline Float64Metric& operator=(const Float64Metric& from) { CopyFrom(from); return *this; } - inline Int64Metric& operator=(Int64Metric&& from) noexcept { + inline Float64Metric& operator=(Float64Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -953,27 +1212,20 @@ class Int64Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Int64Metric& default_instance() { + static const Float64Metric& default_instance() { return *internal_default_instance(); } - enum KindCase { - kGauge = 3, - kCounter = 4, - kConstant = 5, - KIND_NOT_SET = 0, - }; - - static inline const Int64Metric* internal_default_instance() { - return reinterpret_cast( - &_Int64Metric_default_instance_); + static inline const Float64Metric* internal_default_instance() { + return reinterpret_cast( + &_Float64Metric_default_instance_); } static constexpr int kIndexInFileMessages = 4; - friend void swap(Int64Metric& a, Int64Metric& b) { + friend void swap(Float64Metric& a, Float64Metric& b) { a.Swap(&b); } - inline void Swap(Int64Metric* other) { + inline void Swap(Float64Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -986,7 +1238,7 @@ class Int64Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Int64Metric* other) { + void UnsafeArenaSwap(Float64Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -994,14 +1246,14 @@ class Int64Metric final : // implements Message ---------------------------------------------- - Int64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Float64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Int64Metric& from); + void CopyFrom(const Float64Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Int64Metric& from) { - Int64Metric::MergeImpl(*this, from); + void MergeFrom( const Float64Metric& from) { + Float64Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1019,15 +1271,15 @@ class Int64Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Int64Metric* other); + void InternalSwap(Float64Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Int64Metric"; + return "abacus.protobuf.Float64Metric"; } protected: - explicit Int64Metric(::google::protobuf::Arena* arena); + explicit Float64Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1041,13 +1293,12 @@ class Int64Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 6, - kMinFieldNumber = 7, - kMaxFieldNumber = 8, + kUnitFieldNumber = 5, kOffsetFieldNumber = 1, - kGaugeFieldNumber = 3, - kCounterFieldNumber = 4, - kConstantFieldNumber = 5, + kOptionalFieldNumber = 3, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, + kKindFieldNumber = 4, }; // string description = 2; void clear_description() ; @@ -1065,7 +1316,7 @@ class Int64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 6; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1081,28 +1332,6 @@ class Int64Metric final : const std::string& value); std::string* _internal_mutable_unit(); - public: - // optional int64 min = 7; - bool has_min() const; - void clear_min() ; - ::int64_t min() const; - void set_min(::int64_t value); - - private: - ::int64_t _internal_min() const; - void _internal_set_min(::int64_t value); - - public: - // optional int64 max = 8; - bool has_max() const; - void clear_max() ; - ::int64_t max() const; - void set_max(::int64_t value); - - private: - ::int64_t _internal_max() const; - void _internal_set_max(::int64_t value); - public: // uint32 offset = 1; void clear_offset() ; @@ -1114,77 +1343,54 @@ class Int64Metric final : void _internal_set_offset(::uint32_t value); public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; - private: - bool _internal_has_gauge() const; - - public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); - - private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + // bool optional = 3; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); - public: - // .abacus.protobuf.Counter counter = 4; - bool has_counter() const; private: - bool _internal_has_counter() const; + bool _internal_optional() const; + void _internal_set_optional(bool value); public: - void clear_counter() ; - const ::abacus::protobuf::Counter& counter() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); - ::abacus::protobuf::Counter* mutable_counter(); - void set_allocated_counter(::abacus::protobuf::Counter* value); - void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); - ::abacus::protobuf::Counter* unsafe_arena_release_counter(); + // optional double min = 6; + bool has_min() const; + void clear_min() ; + double min() const; + void set_min(double value); private: - const ::abacus::protobuf::Counter& _internal_counter() const; - ::abacus::protobuf::Counter* _internal_mutable_counter(); + double _internal_min() const; + void _internal_set_min(double value); public: - // .abacus.protobuf.Constant constant = 5; - bool has_constant() const; + // optional double max = 7; + bool has_max() const; + void clear_max() ; + double max() const; + void set_max(double value); + private: - bool _internal_has_constant() const; + double _internal_max() const; + void _internal_set_max(double value); public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + // .abacus.protobuf.Kind kind = 4; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Int64Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Float64Metric) private: class _Internal; - void set_has_gauge(); - void set_has_counter(); - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 59, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 53, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1193,43 +1399,36 @@ class Int64Metric final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - ::int64_t min_; - ::int64_t max_; ::uint32_t offset_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Counter* counter_; - ::abacus::protobuf::Constant* constant_; - } kind_; - ::uint32_t _oneof_case_[1]; - + bool optional_; + double min_; + double max_; + int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class UInt32Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.UInt32Metric) */ { +class Float32Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float32Metric) */ { public: - inline UInt32Metric() : UInt32Metric(nullptr) {} - ~UInt32Metric() override; + inline Float32Metric() : Float32Metric(nullptr) {} + ~Float32Metric() override; template - explicit PROTOBUF_CONSTEXPR UInt32Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Float32Metric(::google::protobuf::internal::ConstantInitialized); - UInt32Metric(const UInt32Metric& from); - UInt32Metric(UInt32Metric&& from) noexcept - : UInt32Metric() { + Float32Metric(const Float32Metric& from); + Float32Metric(Float32Metric&& from) noexcept + : Float32Metric() { *this = ::std::move(from); } - inline UInt32Metric& operator=(const UInt32Metric& from) { + inline Float32Metric& operator=(const Float32Metric& from) { CopyFrom(from); return *this; } - inline UInt32Metric& operator=(UInt32Metric&& from) noexcept { + inline Float32Metric& operator=(Float32Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1259,27 +1458,20 @@ class UInt32Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const UInt32Metric& default_instance() { + static const Float32Metric& default_instance() { return *internal_default_instance(); } - enum KindCase { - kGauge = 3, - kCounter = 4, - kConstant = 5, - KIND_NOT_SET = 0, - }; - - static inline const UInt32Metric* internal_default_instance() { - return reinterpret_cast( - &_UInt32Metric_default_instance_); + static inline const Float32Metric* internal_default_instance() { + return reinterpret_cast( + &_Float32Metric_default_instance_); } static constexpr int kIndexInFileMessages = 5; - friend void swap(UInt32Metric& a, UInt32Metric& b) { + friend void swap(Float32Metric& a, Float32Metric& b) { a.Swap(&b); } - inline void Swap(UInt32Metric* other) { + inline void Swap(Float32Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1292,7 +1484,7 @@ class UInt32Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(UInt32Metric* other) { + void UnsafeArenaSwap(Float32Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1300,14 +1492,14 @@ class UInt32Metric final : // implements Message ---------------------------------------------- - UInt32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Float32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const UInt32Metric& from); + void CopyFrom(const Float32Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const UInt32Metric& from) { - UInt32Metric::MergeImpl(*this, from); + void MergeFrom( const Float32Metric& from) { + Float32Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1325,15 +1517,15 @@ class UInt32Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(UInt32Metric* other); + void InternalSwap(Float32Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.UInt32Metric"; + return "abacus.protobuf.Float32Metric"; } protected: - explicit UInt32Metric(::google::protobuf::Arena* arena); + explicit Float32Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1347,13 +1539,12 @@ class UInt32Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 6, + kUnitFieldNumber = 5, kOffsetFieldNumber = 1, - kMinFieldNumber = 7, - kMaxFieldNumber = 8, - kGaugeFieldNumber = 3, - kCounterFieldNumber = 4, - kConstantFieldNumber = 5, + kOptionalFieldNumber = 3, + kKindFieldNumber = 4, + kMinFieldNumber = 6, + kMaxFieldNumber = 7, }; // string description = 2; void clear_description() ; @@ -1371,7 +1562,7 @@ class UInt32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 6; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1398,99 +1589,54 @@ class UInt32Metric final : void _internal_set_offset(::uint32_t value); public: - // optional uint32 min = 7; - bool has_min() const; - void clear_min() ; - ::uint32_t min() const; - void set_min(::uint32_t value); - - private: - ::uint32_t _internal_min() const; - void _internal_set_min(::uint32_t value); - - public: - // optional uint32 max = 8; - bool has_max() const; - void clear_max() ; - ::uint32_t max() const; - void set_max(::uint32_t value); - - private: - ::uint32_t _internal_max() const; - void _internal_set_max(::uint32_t value); + // bool optional = 3; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); - public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; private: - bool _internal_has_gauge() const; + bool _internal_optional() const; + void _internal_set_optional(bool value); public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + // .abacus.protobuf.Kind kind = 4; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - // .abacus.protobuf.Counter counter = 4; - bool has_counter() const; - private: - bool _internal_has_counter() const; - - public: - void clear_counter() ; - const ::abacus::protobuf::Counter& counter() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); - ::abacus::protobuf::Counter* mutable_counter(); - void set_allocated_counter(::abacus::protobuf::Counter* value); - void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); - ::abacus::protobuf::Counter* unsafe_arena_release_counter(); - - private: - const ::abacus::protobuf::Counter& _internal_counter() const; - ::abacus::protobuf::Counter* _internal_mutable_counter(); + // optional float min = 6; + bool has_min() const; + void clear_min() ; + float min() const; + void set_min(float value); - public: - // .abacus.protobuf.Constant constant = 5; - bool has_constant() const; private: - bool _internal_has_constant() const; + float _internal_min() const; + void _internal_set_min(float value); public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + // optional float max = 7; + bool has_max() const; + void clear_max() ; + float max() const; + void set_max(float value); private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); + float _internal_max() const; + void _internal_set_max(float value); public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt32Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Float32Metric) private: class _Internal; - void set_has_gauge(); - void set_has_counter(); - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 60, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 53, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1500,42 +1646,35 @@ class UInt32Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - ::uint32_t min_; - ::uint32_t max_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Counter* counter_; - ::abacus::protobuf::Constant* constant_; - } kind_; - ::uint32_t _oneof_case_[1]; - + bool optional_; + int kind_; + float min_; + float max_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Int32Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Int32Metric) */ { +class BoolMetric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.BoolMetric) */ { public: - inline Int32Metric() : Int32Metric(nullptr) {} - ~Int32Metric() override; + inline BoolMetric() : BoolMetric(nullptr) {} + ~BoolMetric() override; template - explicit PROTOBUF_CONSTEXPR Int32Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BoolMetric(::google::protobuf::internal::ConstantInitialized); - Int32Metric(const Int32Metric& from); - Int32Metric(Int32Metric&& from) noexcept - : Int32Metric() { + BoolMetric(const BoolMetric& from); + BoolMetric(BoolMetric&& from) noexcept + : BoolMetric() { *this = ::std::move(from); } - inline Int32Metric& operator=(const Int32Metric& from) { + inline BoolMetric& operator=(const BoolMetric& from) { CopyFrom(from); return *this; } - inline Int32Metric& operator=(Int32Metric&& from) noexcept { + inline BoolMetric& operator=(BoolMetric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1565,27 +1704,20 @@ class Int32Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Int32Metric& default_instance() { + static const BoolMetric& default_instance() { return *internal_default_instance(); } - enum KindCase { - kGauge = 3, - kCounter = 4, - kConstant = 5, - KIND_NOT_SET = 0, - }; - - static inline const Int32Metric* internal_default_instance() { - return reinterpret_cast( - &_Int32Metric_default_instance_); + static inline const BoolMetric* internal_default_instance() { + return reinterpret_cast( + &_BoolMetric_default_instance_); } static constexpr int kIndexInFileMessages = 6; - friend void swap(Int32Metric& a, Int32Metric& b) { + friend void swap(BoolMetric& a, BoolMetric& b) { a.Swap(&b); } - inline void Swap(Int32Metric* other) { + inline void Swap(BoolMetric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1598,7 +1730,7 @@ class Int32Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Int32Metric* other) { + void UnsafeArenaSwap(BoolMetric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1606,14 +1738,14 @@ class Int32Metric final : // implements Message ---------------------------------------------- - Int32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + BoolMetric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Int32Metric& from); + void CopyFrom(const BoolMetric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Int32Metric& from) { - Int32Metric::MergeImpl(*this, from); + void MergeFrom( const BoolMetric& from) { + BoolMetric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1631,15 +1763,15 @@ class Int32Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Int32Metric* other); + void InternalSwap(BoolMetric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Int32Metric"; + return "abacus.protobuf.BoolMetric"; } protected: - explicit Int32Metric(::google::protobuf::Arena* arena); + explicit BoolMetric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1653,13 +1785,9 @@ class Int32Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 6, + kUnitFieldNumber = 4, kOffsetFieldNumber = 1, - kMinFieldNumber = 7, - kMaxFieldNumber = 8, - kGaugeFieldNumber = 3, - kCounterFieldNumber = 4, - kConstantFieldNumber = 5, + kOptionalFieldNumber = 3, }; // string description = 2; void clear_description() ; @@ -1677,7 +1805,7 @@ class Int32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 6; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1704,99 +1832,22 @@ class Int32Metric final : void _internal_set_offset(::uint32_t value); public: - // optional int32 min = 7; - bool has_min() const; - void clear_min() ; - ::int32_t min() const; - void set_min(::int32_t value); - - private: - ::int32_t _internal_min() const; - void _internal_set_min(::int32_t value); - - public: - // optional int32 max = 8; - bool has_max() const; - void clear_max() ; - ::int32_t max() const; - void set_max(::int32_t value); - - private: - ::int32_t _internal_max() const; - void _internal_set_max(::int32_t value); - - public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; - private: - bool _internal_has_gauge() const; - - public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); - - private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); - - public: - // .abacus.protobuf.Counter counter = 4; - bool has_counter() const; - private: - bool _internal_has_counter() const; - - public: - void clear_counter() ; - const ::abacus::protobuf::Counter& counter() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); - ::abacus::protobuf::Counter* mutable_counter(); - void set_allocated_counter(::abacus::protobuf::Counter* value); - void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); - ::abacus::protobuf::Counter* unsafe_arena_release_counter(); - - private: - const ::abacus::protobuf::Counter& _internal_counter() const; - ::abacus::protobuf::Counter* _internal_mutable_counter(); - - public: - // .abacus.protobuf.Constant constant = 5; - bool has_constant() const; - private: - bool _internal_has_constant() const; - - public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + // bool optional = 3; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); + bool _internal_optional() const; + void _internal_set_optional(bool value); public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Int32Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.BoolMetric) private: class _Internal; - void set_has_gauge(); - void set_has_counter(); - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 59, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 50, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1806,42 +1857,32 @@ class Int32Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - ::int32_t min_; - ::int32_t max_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Counter* counter_; - ::abacus::protobuf::Constant* constant_; - } kind_; - ::uint32_t _oneof_case_[1]; - + bool optional_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Float64Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float64Metric) */ { +class Enum8Metric_EnumValue final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Enum8Metric.EnumValue) */ { public: - inline Float64Metric() : Float64Metric(nullptr) {} - ~Float64Metric() override; + inline Enum8Metric_EnumValue() : Enum8Metric_EnumValue(nullptr) {} + ~Enum8Metric_EnumValue() override; template - explicit PROTOBUF_CONSTEXPR Float64Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Enum8Metric_EnumValue(::google::protobuf::internal::ConstantInitialized); - Float64Metric(const Float64Metric& from); - Float64Metric(Float64Metric&& from) noexcept - : Float64Metric() { + Enum8Metric_EnumValue(const Enum8Metric_EnumValue& from); + Enum8Metric_EnumValue(Enum8Metric_EnumValue&& from) noexcept + : Enum8Metric_EnumValue() { *this = ::std::move(from); } - inline Float64Metric& operator=(const Float64Metric& from) { + inline Enum8Metric_EnumValue& operator=(const Enum8Metric_EnumValue& from) { CopyFrom(from); return *this; } - inline Float64Metric& operator=(Float64Metric&& from) noexcept { + inline Enum8Metric_EnumValue& operator=(Enum8Metric_EnumValue&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1871,27 +1912,20 @@ class Float64Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Float64Metric& default_instance() { + static const Enum8Metric_EnumValue& default_instance() { return *internal_default_instance(); } - enum KindCase { - kGauge = 3, - kCounter = 4, - kConstant = 5, - KIND_NOT_SET = 0, - }; - - static inline const Float64Metric* internal_default_instance() { - return reinterpret_cast( - &_Float64Metric_default_instance_); + static inline const Enum8Metric_EnumValue* internal_default_instance() { + return reinterpret_cast( + &_Enum8Metric_EnumValue_default_instance_); } static constexpr int kIndexInFileMessages = 7; - friend void swap(Float64Metric& a, Float64Metric& b) { + friend void swap(Enum8Metric_EnumValue& a, Enum8Metric_EnumValue& b) { a.Swap(&b); } - inline void Swap(Float64Metric* other) { + inline void Swap(Enum8Metric_EnumValue* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1904,7 +1938,7 @@ class Float64Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Float64Metric* other) { + void UnsafeArenaSwap(Enum8Metric_EnumValue* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1912,14 +1946,14 @@ class Float64Metric final : // implements Message ---------------------------------------------- - Float64Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Enum8Metric_EnumValue* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Float64Metric& from); + void CopyFrom(const Enum8Metric_EnumValue& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Float64Metric& from) { - Float64Metric::MergeImpl(*this, from); + void MergeFrom( const Enum8Metric_EnumValue& from) { + Enum8Metric_EnumValue::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -1937,15 +1971,15 @@ class Float64Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Float64Metric* other); + void InternalSwap(Enum8Metric_EnumValue* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Float64Metric"; + return "abacus.protobuf.Enum8Metric.EnumValue"; } protected: - explicit Float64Metric(::google::protobuf::Arena* arena); + explicit Enum8Metric_EnumValue(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -1958,16 +1992,27 @@ class Float64Metric final : // accessors ------------------------------------------------------- enum : int { + kNameFieldNumber = 1, kDescriptionFieldNumber = 2, - kUnitFieldNumber = 6, - kMinFieldNumber = 7, - kMaxFieldNumber = 8, - kOffsetFieldNumber = 1, - kGaugeFieldNumber = 3, - kCounterFieldNumber = 4, - kConstantFieldNumber = 5, }; - // string description = 2; + // 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: + // optional string description = 2; + bool has_description() const; void clear_description() ; const std::string& description() const; template @@ -1983,171 +2028,69 @@ class Float64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 6; - bool has_unit() const; - 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: - // optional double min = 7; - bool has_min() const; - void clear_min() ; - double min() const; - void set_min(double value); - - private: - double _internal_min() const; - void _internal_set_min(double value); - - public: - // optional double max = 8; - bool has_max() const; - void clear_max() ; - double max() const; - void set_max(double value); - - private: - double _internal_max() const; - void _internal_set_max(double value); - - public: - // uint32 offset = 1; - void clear_offset() ; - ::uint32_t offset() const; - void set_offset(::uint32_t value); - - private: - ::uint32_t _internal_offset() const; - void _internal_set_offset(::uint32_t value); - - public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; - private: - bool _internal_has_gauge() const; - - public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); - - private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); - - public: - // .abacus.protobuf.Counter counter = 4; - bool has_counter() const; - private: - bool _internal_has_counter() const; - - public: - void clear_counter() ; - const ::abacus::protobuf::Counter& counter() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); - ::abacus::protobuf::Counter* mutable_counter(); - void set_allocated_counter(::abacus::protobuf::Counter* value); - void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); - ::abacus::protobuf::Counter* unsafe_arena_release_counter(); - - private: - const ::abacus::protobuf::Counter& _internal_counter() const; - ::abacus::protobuf::Counter* _internal_mutable_counter(); - - public: - // .abacus.protobuf.Constant constant = 5; - bool has_constant() const; - private: - bool _internal_has_constant() const; - - public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); - - private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); - - public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Float64Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric.EnumValue) private: class _Internal; - void set_has_gauge(); - void set_has_counter(); - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 61, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 61, 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_; + ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr description_; - ::google::protobuf::internal::ArenaStringPtr unit_; - double min_; - double max_; - ::uint32_t offset_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Counter* counter_; - ::abacus::protobuf::Constant* constant_; - } kind_; - ::uint32_t _oneof_case_[1]; - PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Float32Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Float32Metric) */ { +class Enum8Metric_ValuesEntry_DoNotUse final : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + Enum8Metric_ValuesEntry_DoNotUse(); + template + explicit PROTOBUF_CONSTEXPR Enum8Metric_ValuesEntry_DoNotUse( + ::google::protobuf::internal::ConstantInitialized); + explicit Enum8Metric_ValuesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const Enum8Metric_ValuesEntry_DoNotUse& other); + static const Enum8Metric_ValuesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Enum8Metric_ValuesEntry_DoNotUse_default_instance_); } + static bool ValidateKey(void*) { return true; } + static bool ValidateValue(void*) { return true; } + using ::google::protobuf::Message::MergeFrom; + ::google::protobuf::Metadata GetMetadata() const final; + friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class Enum8Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Enum8Metric) */ { public: - inline Float32Metric() : Float32Metric(nullptr) {} - ~Float32Metric() override; + inline Enum8Metric() : Enum8Metric(nullptr) {} + ~Enum8Metric() override; template - explicit PROTOBUF_CONSTEXPR Float32Metric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Enum8Metric(::google::protobuf::internal::ConstantInitialized); - Float32Metric(const Float32Metric& from); - Float32Metric(Float32Metric&& from) noexcept - : Float32Metric() { + Enum8Metric(const Enum8Metric& from); + Enum8Metric(Enum8Metric&& from) noexcept + : Enum8Metric() { *this = ::std::move(from); } - inline Float32Metric& operator=(const Float32Metric& from) { + inline Enum8Metric& operator=(const Enum8Metric& from) { CopyFrom(from); return *this; } - inline Float32Metric& operator=(Float32Metric&& from) noexcept { + inline Enum8Metric& operator=(Enum8Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2177,27 +2120,20 @@ class Float32Metric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Float32Metric& default_instance() { + static const Enum8Metric& default_instance() { return *internal_default_instance(); } - enum KindCase { - kGauge = 3, - kCounter = 4, - kConstant = 5, - KIND_NOT_SET = 0, - }; - - static inline const Float32Metric* internal_default_instance() { - return reinterpret_cast( - &_Float32Metric_default_instance_); + static inline const Enum8Metric* internal_default_instance() { + return reinterpret_cast( + &_Enum8Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 9; - friend void swap(Float32Metric& a, Float32Metric& b) { + friend void swap(Enum8Metric& a, Enum8Metric& b) { a.Swap(&b); } - inline void Swap(Float32Metric* other) { + inline void Swap(Enum8Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2210,7 +2146,7 @@ class Float32Metric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Float32Metric* other) { + void UnsafeArenaSwap(Enum8Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2218,14 +2154,14 @@ class Float32Metric final : // implements Message ---------------------------------------------- - Float32Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Enum8Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Float32Metric& from); + void CopyFrom(const Enum8Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Float32Metric& from) { - Float32Metric::MergeImpl(*this, from); + void MergeFrom( const Enum8Metric& from) { + Enum8Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -2243,15 +2179,15 @@ class Float32Metric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Float32Metric* other); + void InternalSwap(Enum8Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Float32Metric"; + return "abacus.protobuf.Enum8Metric"; } protected: - explicit Float32Metric(::google::protobuf::Arena* arena); + explicit Enum8Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -2261,18 +2197,32 @@ class Float32Metric final : // nested types ---------------------------------------------------- + typedef Enum8Metric_EnumValue EnumValue; + // accessors ------------------------------------------------------- enum : int { + kValuesFieldNumber = 4, kDescriptionFieldNumber = 2, - kUnitFieldNumber = 6, + kUnitFieldNumber = 5, kOffsetFieldNumber = 1, - kMinFieldNumber = 7, - kMaxFieldNumber = 8, - kGaugeFieldNumber = 3, - kCounterFieldNumber = 4, - kConstantFieldNumber = 5, + kOptionalFieldNumber = 3, }; + // map values = 4; + int values_size() const; + private: + int _internal_values_size() const; + + public: + void clear_values() ; + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& values() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* mutable_values(); + + private: + const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& _internal_values() const; + ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* _internal_mutable_values(); + + public: // string description = 2; void clear_description() ; const std::string& description() const; @@ -2289,7 +2239,7 @@ class Float32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 6; + // optional string unit = 5; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -2316,144 +2266,61 @@ class Float32Metric final : void _internal_set_offset(::uint32_t value); public: - // optional float min = 7; - bool has_min() const; - void clear_min() ; - float min() const; - void set_min(float value); - - private: - float _internal_min() const; - void _internal_set_min(float value); - - public: - // optional float max = 8; - bool has_max() const; - void clear_max() ; - float max() const; - void set_max(float value); - - private: - float _internal_max() const; - void _internal_set_max(float value); - - public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; - private: - bool _internal_has_gauge() const; - - public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); - - private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); - - public: - // .abacus.protobuf.Counter counter = 4; - bool has_counter() const; - private: - bool _internal_has_counter() const; - - public: - void clear_counter() ; - const ::abacus::protobuf::Counter& counter() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Counter* release_counter(); - ::abacus::protobuf::Counter* mutable_counter(); - void set_allocated_counter(::abacus::protobuf::Counter* value); - void unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* value); - ::abacus::protobuf::Counter* unsafe_arena_release_counter(); - - private: - const ::abacus::protobuf::Counter& _internal_counter() const; - ::abacus::protobuf::Counter* _internal_mutable_counter(); - - public: - // .abacus.protobuf.Constant constant = 5; - bool has_constant() const; - private: - bool _internal_has_constant() const; - - public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + // bool optional = 3; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); + bool _internal_optional() const; + void _internal_set_optional(bool value); public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Float32Metric) + // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric) private: class _Internal; - void set_has_gauge(); - void set_has_counter(); - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 8, 3, 61, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 2, 51, 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_; + ::google::protobuf::internal::MapField + values_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - float min_; - float max_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Counter* counter_; - ::abacus::protobuf::Constant* constant_; - } kind_; - ::uint32_t _oneof_case_[1]; - + bool optional_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class BoolMetric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.BoolMetric) */ { +class Constant final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Constant) */ { public: - inline BoolMetric() : BoolMetric(nullptr) {} - ~BoolMetric() override; + inline Constant() : Constant(nullptr) {} + ~Constant() override; template - explicit PROTOBUF_CONSTEXPR BoolMetric(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Constant(::google::protobuf::internal::ConstantInitialized); - BoolMetric(const BoolMetric& from); - BoolMetric(BoolMetric&& from) noexcept - : BoolMetric() { + Constant(const Constant& from); + Constant(Constant&& from) noexcept + : Constant() { *this = ::std::move(from); } - inline BoolMetric& operator=(const BoolMetric& from) { + inline Constant& operator=(const Constant& from) { CopyFrom(from); return *this; } - inline BoolMetric& operator=(BoolMetric&& from) noexcept { + inline Constant& operator=(Constant&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2483,26 +2350,33 @@ class BoolMetric final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const BoolMetric& default_instance() { + static const Constant& default_instance() { return *internal_default_instance(); } - enum KindCase { - kGauge = 3, - kConstant = 4, - KIND_NOT_SET = 0, + enum ValueCase { + kUint64 = 1, + kInt64 = 2, + kUint32 = 3, + kInt32 = 4, + kFloat32 = 5, + kFloat64 = 6, + kBoolean = 7, + kEnum8 = 8, + kString = 9, + VALUE_NOT_SET = 0, }; - static inline const BoolMetric* internal_default_instance() { - return reinterpret_cast( - &_BoolMetric_default_instance_); + static inline const Constant* internal_default_instance() { + return reinterpret_cast( + &_Constant_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 10; - friend void swap(BoolMetric& a, BoolMetric& b) { + friend void swap(Constant& a, Constant& b) { a.Swap(&b); } - inline void Swap(BoolMetric* other) { + inline void Swap(Constant* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2515,7 +2389,7 @@ class BoolMetric final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(BoolMetric* other) { + void UnsafeArenaSwap(Constant* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2523,14 +2397,14 @@ class BoolMetric final : // implements Message ---------------------------------------------- - BoolMetric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Constant* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const BoolMetric& from); + void CopyFrom(const Constant& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const BoolMetric& from) { - BoolMetric::MergeImpl(*this, from); + void MergeFrom( const Constant& from) { + Constant::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -2548,15 +2422,15 @@ class BoolMetric final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(BoolMetric* other); + void InternalSwap(Constant* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.BoolMetric"; + return "abacus.protobuf.Constant"; } protected: - explicit BoolMetric(::google::protobuf::Arena* arena); + explicit Constant(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -2569,13 +2443,19 @@ class BoolMetric final : // accessors ------------------------------------------------------- enum : int { - kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, - kOffsetFieldNumber = 1, - kGaugeFieldNumber = 3, - kConstantFieldNumber = 4, + kDescriptionFieldNumber = 10, + kUnitFieldNumber = 11, + kUint64FieldNumber = 1, + kInt64FieldNumber = 2, + kUint32FieldNumber = 3, + kInt32FieldNumber = 4, + kFloat32FieldNumber = 5, + kFloat64FieldNumber = 6, + kBooleanFieldNumber = 7, + kEnum8FieldNumber = 8, + kStringFieldNumber = 9, }; - // string description = 2; + // string description = 10; void clear_description() ; const std::string& description() const; template @@ -2591,7 +2471,7 @@ class BoolMetric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 11; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -2608,82 +2488,152 @@ class BoolMetric final : std::string* _internal_mutable_unit(); public: - // uint32 offset = 1; - void clear_offset() ; - ::uint32_t offset() const; - void set_offset(::uint32_t value); + // uint64 uint64 = 1; + bool has_uint64() const; + void clear_uint64() ; + ::uint64_t uint64() const; + void set_uint64(::uint64_t value); private: - ::uint32_t _internal_offset() const; - void _internal_set_offset(::uint32_t value); + ::uint64_t _internal_uint64() const; + void _internal_set_uint64(::uint64_t value); public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; + // int64 int64 = 2; + bool has_int64() const; + void clear_int64() ; + ::int64_t int64() const; + void set_int64(::int64_t value); + private: - bool _internal_has_gauge() const; + ::int64_t _internal_int64() const; + void _internal_set_int64(::int64_t value); public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); + // uint32 uint32 = 3; + bool has_uint32() const; + void clear_uint32() ; + ::uint32_t uint32() const; + void set_uint32(::uint32_t value); private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); + ::uint32_t _internal_uint32() const; + void _internal_set_uint32(::uint32_t value); public: - // .abacus.protobuf.Constant constant = 4; - bool has_constant() const; + // int32 int32 = 4; + bool has_int32() const; + void clear_int32() ; + ::int32_t int32() const; + void set_int32(::int32_t value); + private: - bool _internal_has_constant() const; + ::int32_t _internal_int32() const; + void _internal_set_int32(::int32_t value); public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); + // float float32 = 5; + bool has_float32() const; + void clear_float32() ; + float float32() const; + void set_float32(float value); private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); + float _internal_float32() const; + void _internal_set_float32(float value); public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.BoolMetric) - private: - class _Internal; - void set_has_gauge(); - void set_has_constant(); + // double float64 = 6; + bool has_float64() const; + void clear_float64() ; + double float64() const; + void set_float64(double value); - inline bool has_kind() const; - inline void clear_has_kind(); + private: + double _internal_float64() const; + void _internal_set_float64(double value); - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 2, 50, 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_; + public: + // bool boolean = 7; + bool has_boolean() const; + void clear_boolean() ; + bool boolean() const; + void set_boolean(bool value); + + private: + bool _internal_boolean() const; + void _internal_set_boolean(bool value); + + public: + // uint32 enum8 = 8; + bool has_enum8() const; + void clear_enum8() ; + ::uint32_t enum8() const; + void set_enum8(::uint32_t value); + + private: + ::uint32_t _internal_enum8() const; + void _internal_set_enum8(::uint32_t value); + + public: + // string string = 9; + bool has_string() const; + void clear_string() ; + const std::string& string() const; + template + void set_string(Arg_&& arg, Args_... args); + std::string* mutable_string(); + PROTOBUF_NODISCARD std::string* release_string(); + void set_allocated_string(std::string* ptr); + + private: + const std::string& _internal_string() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_string( + const std::string& value); + std::string* _internal_mutable_string(); + + public: + void clear_value(); + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:abacus.protobuf.Constant) + private: + class _Internal; + void set_has_uint64(); + void set_has_int64(); + void set_has_uint32(); + void set_has_int32(); + void set_has_float32(); + void set_has_float64(); + void set_has_boolean(); + void set_has_enum8(); + void set_has_string(); + + inline bool has_value() const; + inline void clear_has_value(); + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 11, 0, 62, 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_; ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; - ::uint32_t offset_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} + union ValueUnion { + constexpr ValueUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Constant* constant_; - } kind_; + ::uint64_t uint64_; + ::int64_t int64_; + ::uint32_t uint32_; + ::int32_t int32_; + float float32_; + double float64_; + bool boolean_; + ::uint32_t enum8_; + ::google::protobuf::internal::ArenaStringPtr string_; + } value_; ::uint32_t _oneof_case_[1]; PROTOBUF_TSAN_DECLARE_MEMBER @@ -2692,25 +2642,25 @@ class BoolMetric final : friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; };// ------------------------------------------------------------------- -class Enum8Metric_EnumValue final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Enum8Metric.EnumValue) */ { +class Metric final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Metric) */ { public: - inline Enum8Metric_EnumValue() : Enum8Metric_EnumValue(nullptr) {} - ~Enum8Metric_EnumValue() override; + inline Metric() : Metric(nullptr) {} + ~Metric() override; template - explicit PROTOBUF_CONSTEXPR Enum8Metric_EnumValue(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Metric(::google::protobuf::internal::ConstantInitialized); - Enum8Metric_EnumValue(const Enum8Metric_EnumValue& from); - Enum8Metric_EnumValue(Enum8Metric_EnumValue&& from) noexcept - : Enum8Metric_EnumValue() { + Metric(const Metric& from); + Metric(Metric&& from) noexcept + : Metric() { *this = ::std::move(from); } - inline Enum8Metric_EnumValue& operator=(const Enum8Metric_EnumValue& from) { + inline Metric& operator=(const Metric& from) { CopyFrom(from); return *this; } - inline Enum8Metric_EnumValue& operator=(Enum8Metric_EnumValue&& from) noexcept { + inline Metric& operator=(Metric&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2740,20 +2690,33 @@ class Enum8Metric_EnumValue final : static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const Enum8Metric_EnumValue& default_instance() { + static const Metric& default_instance() { return *internal_default_instance(); } - static inline const Enum8Metric_EnumValue* internal_default_instance() { - return reinterpret_cast( - &_Enum8Metric_EnumValue_default_instance_); + enum TypeCase { + kConstant = 1, + kUint64 = 2, + kInt64 = 3, + kUint32 = 4, + kInt32 = 5, + kFloat64 = 6, + kFloat32 = 7, + kBoolean = 8, + kEnum8 = 9, + TYPE_NOT_SET = 0, + }; + + static inline const Metric* internal_default_instance() { + return reinterpret_cast( + &_Metric_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 11; - friend void swap(Enum8Metric_EnumValue& a, Enum8Metric_EnumValue& b) { + friend void swap(Metric& a, Metric& b) { a.Swap(&b); } - inline void Swap(Enum8Metric_EnumValue* other) { + inline void Swap(Metric* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2766,7 +2729,7 @@ class Enum8Metric_EnumValue final : ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Enum8Metric_EnumValue* other) { + void UnsafeArenaSwap(Metric* other) { if (other == this) return; ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2774,14 +2737,14 @@ class Enum8Metric_EnumValue final : // implements Message ---------------------------------------------- - Enum8Metric_EnumValue* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Metric* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Enum8Metric_EnumValue& from); + void CopyFrom(const Metric& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Enum8Metric_EnumValue& from) { - Enum8Metric_EnumValue::MergeImpl(*this, from); + void MergeFrom( const Metric& from) { + Metric::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); @@ -2799,15 +2762,15 @@ class Enum8Metric_EnumValue final : void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(Enum8Metric_EnumValue* other); + void InternalSwap(Metric* other); private: friend class ::google::protobuf::internal::AnyMetadata; static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Enum8Metric.EnumValue"; + return "abacus.protobuf.Metric"; } protected: - explicit Enum8Metric_EnumValue(::google::protobuf::Arena* arena); + explicit Metric(::google::protobuf::Arena* arena); public: static const ClassData _class_data_; @@ -2820,772 +2783,77 @@ class Enum8Metric_EnumValue final : // accessors ------------------------------------------------------- enum : int { - kNameFieldNumber = 1, - kDescriptionFieldNumber = 2, + kConstantFieldNumber = 1, + kUint64FieldNumber = 2, + kInt64FieldNumber = 3, + kUint32FieldNumber = 4, + kInt32FieldNumber = 5, + kFloat64FieldNumber = 6, + kFloat32FieldNumber = 7, + kBooleanFieldNumber = 8, + kEnum8FieldNumber = 9, }; - // 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); - + // .abacus.protobuf.Constant constant = 1; + bool has_constant() const; private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name( - const std::string& value); - std::string* _internal_mutable_name(); + bool _internal_has_constant() const; public: - // optional string description = 2; - bool has_description() const; - 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); + void clear_constant() ; + const ::abacus::protobuf::Constant& constant() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); + ::abacus::protobuf::Constant* mutable_constant(); + void set_allocated_constant(::abacus::protobuf::Constant* value); + void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); + ::abacus::protobuf::Constant* unsafe_arena_release_constant(); private: - const std::string& _internal_description() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_description( - const std::string& value); - std::string* _internal_mutable_description(); + const ::abacus::protobuf::Constant& _internal_constant() const; + ::abacus::protobuf::Constant* _internal_mutable_constant(); public: - // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric.EnumValue) - private: - class _Internal; + // .abacus.protobuf.UInt64Metric uint64 = 2; + bool has_uint64() const; + private: + bool _internal_has_uint64() const; - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 61, 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_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::google::protobuf::internal::ArenaStringPtr description_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -};// ------------------------------------------------------------------- + public: + void clear_uint64() ; + const ::abacus::protobuf::UInt64Metric& uint64() const; + PROTOBUF_NODISCARD ::abacus::protobuf::UInt64Metric* release_uint64(); + ::abacus::protobuf::UInt64Metric* mutable_uint64(); + void set_allocated_uint64(::abacus::protobuf::UInt64Metric* value); + void unsafe_arena_set_allocated_uint64(::abacus::protobuf::UInt64Metric* value); + ::abacus::protobuf::UInt64Metric* unsafe_arena_release_uint64(); -class Enum8Metric_ValuesEntry_DoNotUse final : public ::google::protobuf::internal::MapEntry { -public: - typedef ::google::protobuf::internal::MapEntry SuperType; - Enum8Metric_ValuesEntry_DoNotUse(); - template - explicit PROTOBUF_CONSTEXPR Enum8Metric_ValuesEntry_DoNotUse( - ::google::protobuf::internal::ConstantInitialized); - explicit Enum8Metric_ValuesEntry_DoNotUse(::google::protobuf::Arena* arena); - void MergeFrom(const Enum8Metric_ValuesEntry_DoNotUse& other); - static const Enum8Metric_ValuesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Enum8Metric_ValuesEntry_DoNotUse_default_instance_); } - static bool ValidateKey(void*) { return true; } - static bool ValidateValue(void*) { return true; } - using ::google::protobuf::Message::MergeFrom; - ::google::protobuf::Metadata GetMetadata() const final; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -}; -// ------------------------------------------------------------------- + private: + const ::abacus::protobuf::UInt64Metric& _internal_uint64() const; + ::abacus::protobuf::UInt64Metric* _internal_mutable_uint64(); -class Enum8Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.Enum8Metric) */ { - public: - inline Enum8Metric() : Enum8Metric(nullptr) {} - ~Enum8Metric() override; - template - explicit PROTOBUF_CONSTEXPR Enum8Metric(::google::protobuf::internal::ConstantInitialized); + public: + // .abacus.protobuf.Int64Metric int64 = 3; + bool has_int64() const; + private: + bool _internal_has_int64() const; - Enum8Metric(const Enum8Metric& from); - Enum8Metric(Enum8Metric&& from) noexcept - : Enum8Metric() { - *this = ::std::move(from); - } + public: + void clear_int64() ; + const ::abacus::protobuf::Int64Metric& int64() const; + PROTOBUF_NODISCARD ::abacus::protobuf::Int64Metric* release_int64(); + ::abacus::protobuf::Int64Metric* mutable_int64(); + void set_allocated_int64(::abacus::protobuf::Int64Metric* value); + void unsafe_arena_set_allocated_int64(::abacus::protobuf::Int64Metric* value); + ::abacus::protobuf::Int64Metric* unsafe_arena_release_int64(); - inline Enum8Metric& operator=(const Enum8Metric& from) { - CopyFrom(from); - return *this; - } - inline Enum8Metric& operator=(Enum8Metric&& 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; - } + private: + const ::abacus::protobuf::Int64Metric& _internal_int64() const; + ::abacus::protobuf::Int64Metric* _internal_mutable_int64(); - 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 Enum8Metric& default_instance() { - return *internal_default_instance(); - } - enum KindCase { - kGauge = 3, - kConstant = 4, - KIND_NOT_SET = 0, - }; - - static inline const Enum8Metric* internal_default_instance() { - return reinterpret_cast( - &_Enum8Metric_default_instance_); - } - static constexpr int kIndexInFileMessages = - 12; - - friend void swap(Enum8Metric& a, Enum8Metric& b) { - a.Swap(&b); - } - inline void Swap(Enum8Metric* 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(Enum8Metric* other) { - if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Enum8Metric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Enum8Metric& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Enum8Metric& from) { - Enum8Metric::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(Enum8Metric* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "abacus.protobuf.Enum8Metric"; - } - protected: - explicit Enum8Metric(::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 ---------------------------------------------------- - - typedef Enum8Metric_EnumValue EnumValue; - - // accessors ------------------------------------------------------- - - enum : int { - kValuesFieldNumber = 6, - kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, - kOffsetFieldNumber = 1, - kGaugeFieldNumber = 3, - kConstantFieldNumber = 4, - }; - // map values = 6; - int values_size() const; - private: - int _internal_values_size() const; - - public: - void clear_values() ; - const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& values() const; - ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* mutable_values(); - - private: - const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& _internal_values() const; - ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* _internal_mutable_values(); - - 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: - // optional string unit = 5; - bool has_unit() const; - 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: - // uint32 offset = 1; - void clear_offset() ; - ::uint32_t offset() const; - void set_offset(::uint32_t value); - - private: - ::uint32_t _internal_offset() const; - void _internal_set_offset(::uint32_t value); - - public: - // .abacus.protobuf.Gauge gauge = 3; - bool has_gauge() const; - private: - bool _internal_has_gauge() const; - - public: - void clear_gauge() ; - const ::abacus::protobuf::Gauge& gauge() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Gauge* release_gauge(); - ::abacus::protobuf::Gauge* mutable_gauge(); - void set_allocated_gauge(::abacus::protobuf::Gauge* value); - void unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* value); - ::abacus::protobuf::Gauge* unsafe_arena_release_gauge(); - - private: - const ::abacus::protobuf::Gauge& _internal_gauge() const; - ::abacus::protobuf::Gauge* _internal_mutable_gauge(); - - public: - // .abacus.protobuf.Constant constant = 4; - bool has_constant() const; - private: - bool _internal_has_constant() const; - - public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); - - private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); - - public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric) - private: - class _Internal; - void set_has_gauge(); - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 6, 4, 51, 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_; - ::google::protobuf::internal::MapField - values_; - ::google::protobuf::internal::ArenaStringPtr description_; - ::google::protobuf::internal::ArenaStringPtr unit_; - ::uint32_t offset_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Gauge* gauge_; - ::abacus::protobuf::Constant* constant_; - } kind_; - ::uint32_t _oneof_case_[1]; - - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -};// ------------------------------------------------------------------- - -class StringMetric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.protobuf.StringMetric) */ { - public: - inline StringMetric() : StringMetric(nullptr) {} - ~StringMetric() override; - template - explicit PROTOBUF_CONSTEXPR StringMetric(::google::protobuf::internal::ConstantInitialized); - - StringMetric(const StringMetric& from); - StringMetric(StringMetric&& from) noexcept - : StringMetric() { - *this = ::std::move(from); - } - - inline StringMetric& operator=(const StringMetric& from) { - CopyFrom(from); - return *this; - } - inline StringMetric& operator=(StringMetric&& 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 StringMetric& default_instance() { - return *internal_default_instance(); - } - enum KindCase { - kConstant = 3, - KIND_NOT_SET = 0, - }; - - static inline const StringMetric* internal_default_instance() { - return reinterpret_cast( - &_StringMetric_default_instance_); - } - static constexpr int kIndexInFileMessages = - 13; - - friend void swap(StringMetric& a, StringMetric& b) { - a.Swap(&b); - } - inline void Swap(StringMetric* 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(StringMetric* other) { - if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - StringMetric* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const StringMetric& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const StringMetric& from) { - StringMetric::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(StringMetric* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "abacus.protobuf.StringMetric"; - } - protected: - explicit StringMetric(::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 { - kDescriptionFieldNumber = 2, - kOffsetFieldNumber = 1, - kConstantFieldNumber = 3, - }; - // 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: - // uint32 offset = 1; - void clear_offset() ; - ::uint32_t offset() const; - void set_offset(::uint32_t value); - - private: - ::uint32_t _internal_offset() const; - void _internal_set_offset(::uint32_t value); - - public: - // .abacus.protobuf.Constant constant = 3; - bool has_constant() const; - private: - bool _internal_has_constant() const; - - public: - void clear_constant() ; - const ::abacus::protobuf::Constant& constant() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Constant* release_constant(); - ::abacus::protobuf::Constant* mutable_constant(); - void set_allocated_constant(::abacus::protobuf::Constant* value); - void unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* value); - ::abacus::protobuf::Constant* unsafe_arena_release_constant(); - - private: - const ::abacus::protobuf::Constant& _internal_constant() const; - ::abacus::protobuf::Constant* _internal_mutable_constant(); - - public: - void clear_kind(); - KindCase kind_case() const; - // @@protoc_insertion_point(class_scope:abacus.protobuf.StringMetric) - private: - class _Internal; - void set_has_constant(); - - inline bool has_kind() const; - inline void clear_has_kind(); - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 3, 1, 48, 2> _table_; - template friend class ::google::protobuf::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::google::protobuf::internal::ArenaStringPtr description_; - ::uint32_t offset_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::abacus::protobuf::Constant* constant_; - } kind_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::uint32_t _oneof_case_[1]; - - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_abacus_2fprotobuf_2fmetrics_2eproto; -};// ------------------------------------------------------------------- - -class Metric final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:abacus.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 TypeCase { - kUint64 = 3, - kInt64 = 4, - kUint32 = 5, - kInt32 = 6, - kFloat64 = 7, - kFloat32 = 8, - kBoolean = 9, - kEnum8 = 10, - kString = 11, - TYPE_NOT_SET = 0, - }; - - static inline const Metric* internal_default_instance() { - return reinterpret_cast( - &_Metric_default_instance_); - } - static constexpr int kIndexInFileMessages = - 14; - - 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 "abacus.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 { - kUint64FieldNumber = 3, - kInt64FieldNumber = 4, - kUint32FieldNumber = 5, - kInt32FieldNumber = 6, - kFloat64FieldNumber = 7, - kFloat32FieldNumber = 8, - kBooleanFieldNumber = 9, - kEnum8FieldNumber = 10, - kStringFieldNumber = 11, - }; - // .abacus.protobuf.UInt64Metric uint64 = 3; - bool has_uint64() const; - private: - bool _internal_has_uint64() const; - - public: - void clear_uint64() ; - const ::abacus::protobuf::UInt64Metric& uint64() const; - PROTOBUF_NODISCARD ::abacus::protobuf::UInt64Metric* release_uint64(); - ::abacus::protobuf::UInt64Metric* mutable_uint64(); - void set_allocated_uint64(::abacus::protobuf::UInt64Metric* value); - void unsafe_arena_set_allocated_uint64(::abacus::protobuf::UInt64Metric* value); - ::abacus::protobuf::UInt64Metric* unsafe_arena_release_uint64(); - - private: - const ::abacus::protobuf::UInt64Metric& _internal_uint64() const; - ::abacus::protobuf::UInt64Metric* _internal_mutable_uint64(); - - public: - // .abacus.protobuf.Int64Metric int64 = 4; - bool has_int64() const; - private: - bool _internal_has_int64() const; - - public: - void clear_int64() ; - const ::abacus::protobuf::Int64Metric& int64() const; - PROTOBUF_NODISCARD ::abacus::protobuf::Int64Metric* release_int64(); - ::abacus::protobuf::Int64Metric* mutable_int64(); - void set_allocated_int64(::abacus::protobuf::Int64Metric* value); - void unsafe_arena_set_allocated_int64(::abacus::protobuf::Int64Metric* value); - ::abacus::protobuf::Int64Metric* unsafe_arena_release_int64(); - - private: - const ::abacus::protobuf::Int64Metric& _internal_int64() const; - ::abacus::protobuf::Int64Metric* _internal_mutable_int64(); - - public: - // .abacus.protobuf.UInt32Metric uint32 = 5; - bool has_uint32() const; - private: - bool _internal_has_uint32() const; + public: + // .abacus.protobuf.UInt32Metric uint32 = 4; + bool has_uint32() const; + private: + bool _internal_has_uint32() const; public: void clear_uint32() ; @@ -3601,7 +2869,7 @@ class Metric final : ::abacus::protobuf::UInt32Metric* _internal_mutable_uint32(); public: - // .abacus.protobuf.Int32Metric int32 = 6; + // .abacus.protobuf.Int32Metric int32 = 5; bool has_int32() const; private: bool _internal_has_int32() const; @@ -3620,7 +2888,7 @@ class Metric final : ::abacus::protobuf::Int32Metric* _internal_mutable_int32(); public: - // .abacus.protobuf.Float64Metric float64 = 7; + // .abacus.protobuf.Float64Metric float64 = 6; bool has_float64() const; private: bool _internal_has_float64() const; @@ -3639,7 +2907,7 @@ class Metric final : ::abacus::protobuf::Float64Metric* _internal_mutable_float64(); public: - // .abacus.protobuf.Float32Metric float32 = 8; + // .abacus.protobuf.Float32Metric float32 = 7; bool has_float32() const; private: bool _internal_has_float32() const; @@ -3658,7 +2926,7 @@ class Metric final : ::abacus::protobuf::Float32Metric* _internal_mutable_float32(); public: - // .abacus.protobuf.BoolMetric boolean = 9; + // .abacus.protobuf.BoolMetric boolean = 8; bool has_boolean() const; private: bool _internal_has_boolean() const; @@ -3677,7 +2945,7 @@ class Metric final : ::abacus::protobuf::BoolMetric* _internal_mutable_boolean(); public: - // .abacus.protobuf.Enum8Metric enum8 = 10; + // .abacus.protobuf.Enum8Metric enum8 = 9; bool has_enum8() const; private: bool _internal_has_enum8() const; @@ -3695,31 +2963,13 @@ class Metric final : const ::abacus::protobuf::Enum8Metric& _internal_enum8() const; ::abacus::protobuf::Enum8Metric* _internal_mutable_enum8(); - public: - // .abacus.protobuf.StringMetric string = 11; - bool has_string() const; - private: - bool _internal_has_string() const; - - public: - void clear_string() ; - const ::abacus::protobuf::StringMetric& string() const; - PROTOBUF_NODISCARD ::abacus::protobuf::StringMetric* release_string(); - ::abacus::protobuf::StringMetric* mutable_string(); - void set_allocated_string(::abacus::protobuf::StringMetric* value); - void unsafe_arena_set_allocated_string(::abacus::protobuf::StringMetric* value); - ::abacus::protobuf::StringMetric* unsafe_arena_release_string(); - - private: - const ::abacus::protobuf::StringMetric& _internal_string() const; - ::abacus::protobuf::StringMetric* _internal_mutable_string(); - public: void clear_type(); TypeCase type_case() const; // @@protoc_insertion_point(class_scope:abacus.protobuf.Metric) private: class _Internal; + void set_has_constant(); void set_has_uint64(); void set_has_int64(); void set_has_uint32(); @@ -3728,7 +2978,6 @@ class Metric final : void set_has_float32(); void set_has_boolean(); void set_has_enum8(); - void set_has_string(); inline bool has_type() const; inline void clear_has_type(); @@ -3742,6 +2991,7 @@ class Metric final : union TypeUnion { constexpr TypeUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; + ::abacus::protobuf::Constant* constant_; ::abacus::protobuf::UInt64Metric* uint64_; ::abacus::protobuf::Int64Metric* int64_; ::abacus::protobuf::UInt32Metric* uint32_; @@ -3750,7 +3000,6 @@ class Metric final : ::abacus::protobuf::Float32Metric* float32_; ::abacus::protobuf::BoolMetric* boolean_; ::abacus::protobuf::Enum8Metric* enum8_; - ::abacus::protobuf::StringMetric* string_; } type_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::uint32_t _oneof_case_[1]; @@ -3843,7 +3092,7 @@ class MetricsMetadata final : &_MetricsMetadata_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 13; friend void swap(MetricsMetadata& a, MetricsMetadata& b) { a.Swap(&b); @@ -4004,62 +3253,6 @@ class MetricsMetadata final : #endif // __GNUC__ // ------------------------------------------------------------------- -// Gauge - -// bool optional = 1; -inline void Gauge::clear_optional() { - _impl_.optional_ = false; -} -inline bool Gauge::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Gauge.optional) - return _internal_optional(); -} -inline void Gauge::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Gauge.optional) -} -inline bool Gauge::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Gauge::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// ------------------------------------------------------------------- - -// Counter - -// bool optional = 1; -inline void Counter::clear_optional() { - _impl_.optional_ = false; -} -inline bool Counter::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Counter.optional) - return _internal_optional(); -} -inline void Counter::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Counter.optional) -} -inline bool Counter::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Counter::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// ------------------------------------------------------------------- - -// Constant - -// ------------------------------------------------------------------- - // UInt64Metric // uint32 offset = 1; @@ -4135,229 +3328,51 @@ inline void UInt64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.description) } -// .abacus.protobuf.Gauge gauge = 3; -inline bool UInt64Metric::has_gauge() const { - return kind_case() == kGauge; -} -inline bool UInt64Metric::_internal_has_gauge() const { - return kind_case() == kGauge; -} -inline void UInt64Metric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; -} -inline void UInt64Metric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Gauge* UInt64Metric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Gauge& UInt64Metric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); -} -inline const ::abacus::protobuf::Gauge& UInt64Metric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.gauge) - return _internal_gauge(); -} -inline ::abacus::protobuf::Gauge* UInt64Metric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt64Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void UInt64Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt64Metric.gauge) -} -inline ::abacus::protobuf::Gauge* UInt64Metric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; -} -inline ::abacus::protobuf::Gauge* UInt64Metric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.gauge) - return _msg; -} - -// .abacus.protobuf.Counter counter = 4; -inline bool UInt64Metric::has_counter() const { - return kind_case() == kCounter; -} -inline bool UInt64Metric::_internal_has_counter() const { - return kind_case() == kCounter; -} -inline void UInt64Metric::set_has_counter() { - _impl_._oneof_case_[0] = kCounter; -} -inline void UInt64Metric::clear_counter() { - if (kind_case() == kCounter) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Counter* UInt64Metric::release_counter() { - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Counter& UInt64Metric::_internal_counter() const { - return kind_case() == kCounter - ? *_impl_.kind_.counter_ - : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); -} -inline const ::abacus::protobuf::Counter& UInt64Metric::counter() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.counter) - return _internal_counter(); +// bool optional = 3; +inline void UInt64Metric::clear_optional() { + _impl_.optional_ = false; } -inline ::abacus::protobuf::Counter* UInt64Metric::unsafe_arena_release_counter() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt64Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool UInt64Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.optional) + return _internal_optional(); } -inline void UInt64Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { - clear_kind(); - if (counter) { - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt64Metric.counter) +inline void UInt64Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.optional) } -inline ::abacus::protobuf::Counter* UInt64Metric::_internal_mutable_counter() { - if (kind_case() != kCounter) { - clear_kind(); - set_has_counter(); - _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); - } - return _impl_.kind_.counter_; +inline bool UInt64Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline ::abacus::protobuf::Counter* UInt64Metric::mutable_counter() { - ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.counter) - return _msg; +inline void UInt64Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -// .abacus.protobuf.Constant constant = 5; -inline bool UInt64Metric::has_constant() const { - return kind_case() == kConstant; -} -inline bool UInt64Metric::_internal_has_constant() const { - return kind_case() == kConstant; -} -inline void UInt64Metric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; -} -inline void UInt64Metric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Constant* UInt64Metric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt64Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Constant& UInt64Metric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +// .abacus.protobuf.Kind kind = 4; +inline void UInt64Metric::clear_kind() { + _impl_.kind_ = 0; } -inline const ::abacus::protobuf::Constant& UInt64Metric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.constant) - return _internal_constant(); -} -inline ::abacus::protobuf::Constant* UInt64Metric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt64Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::abacus::protobuf::Kind UInt64Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.kind) + return _internal_kind(); } -inline void UInt64Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt64Metric.constant) +inline void UInt64Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.kind) } -inline ::abacus::protobuf::Constant* UInt64Metric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; +inline ::abacus::protobuf::Kind UInt64Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline ::abacus::protobuf::Constant* UInt64Metric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt64Metric.constant) - return _msg; +inline void UInt64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; } -// optional string unit = 6; +// optional string unit = 5; inline bool UInt64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4426,7 +3441,7 @@ inline void UInt64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.unit) } -// optional uint64 min = 7; +// optional uint64 min = 6; inline bool UInt64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -4453,7 +3468,7 @@ inline void UInt64Metric::_internal_set_min(::uint64_t value) { _impl_.min_ = value; } -// optional uint64 max = 8; +// optional uint64 max = 7; inline bool UInt64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4480,15 +3495,6 @@ inline void UInt64Metric::_internal_set_max(::uint64_t value) { _impl_.max_ = value; } -inline bool UInt64Metric::has_kind() const { - return kind_case() != KIND_NOT_SET; -} -inline void UInt64Metric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; -} -inline UInt64Metric::KindCase UInt64Metric::kind_case() const { - return UInt64Metric::KindCase(_impl_._oneof_case_[0]); -} // ------------------------------------------------------------------- // Int64Metric @@ -4521,274 +3527,96 @@ inline void Int64Metric::clear_description() { } inline const std::string& Int64Metric::description() const { // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.description) - return _internal_description(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Int64Metric::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:abacus.protobuf.Int64Metric.description) -} -inline std::string* Int64Metric::mutable_description() { - std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.description) - return _s; -} -inline const std::string& Int64Metric::_internal_description() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.description_.Get(); -} -inline void Int64Metric::_internal_set_description(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.description_.Set(value, GetArenaForAllocation()); -} -inline std::string* Int64Metric::_internal_mutable_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.description_.Mutable( GetArenaForAllocation()); -} -inline std::string* Int64Metric::release_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.description) - return _impl_.description_.Release(); -} -inline void Int64Metric::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:abacus.protobuf.Int64Metric.description) -} - -// .abacus.protobuf.Gauge gauge = 3; -inline bool Int64Metric::has_gauge() const { - return kind_case() == kGauge; -} -inline bool Int64Metric::_internal_has_gauge() const { - return kind_case() == kGauge; -} -inline void Int64Metric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; -} -inline void Int64Metric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Gauge* Int64Metric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Gauge& Int64Metric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); -} -inline const ::abacus::protobuf::Gauge& Int64Metric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.gauge) - return _internal_gauge(); -} -inline ::abacus::protobuf::Gauge* Int64Metric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int64Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Int64Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int64Metric.gauge) -} -inline ::abacus::protobuf::Gauge* Int64Metric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; -} -inline ::abacus::protobuf::Gauge* Int64Metric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.gauge) - return _msg; -} - -// .abacus.protobuf.Counter counter = 4; -inline bool Int64Metric::has_counter() const { - return kind_case() == kCounter; -} -inline bool Int64Metric::_internal_has_counter() const { - return kind_case() == kCounter; -} -inline void Int64Metric::set_has_counter() { - _impl_._oneof_case_[0] = kCounter; -} -inline void Int64Metric::clear_counter() { - if (kind_case() == kCounter) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Counter* Int64Metric::release_counter() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } + return _internal_description(); } -inline const ::abacus::protobuf::Counter& Int64Metric::_internal_counter() const { - return kind_case() == kCounter - ? *_impl_.kind_.counter_ - : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +template +inline PROTOBUF_ALWAYS_INLINE void Int64Metric::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:abacus.protobuf.Int64Metric.description) } -inline const ::abacus::protobuf::Counter& Int64Metric::counter() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.counter) - return _internal_counter(); +inline std::string* Int64Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.description) + return _s; } -inline ::abacus::protobuf::Counter* Int64Metric::unsafe_arena_release_counter() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int64Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } +inline const std::string& Int64Metric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); } -inline void Int64Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { - clear_kind(); - if (counter) { - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int64Metric.counter) +inline void Int64Metric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); } -inline ::abacus::protobuf::Counter* Int64Metric::_internal_mutable_counter() { - if (kind_case() != kCounter) { - clear_kind(); - set_has_counter(); - _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); - } - return _impl_.kind_.counter_; +inline std::string* Int64Metric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline ::abacus::protobuf::Counter* Int64Metric::mutable_counter() { - ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.counter) - return _msg; +inline std::string* Int64Metric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.description) + return _impl_.description_.Release(); } - -// .abacus.protobuf.Constant constant = 5; -inline bool Int64Metric::has_constant() const { - return kind_case() == kConstant; +inline void Int64Metric::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:abacus.protobuf.Int64Metric.description) } -inline bool Int64Metric::_internal_has_constant() const { - return kind_case() == kConstant; + +// bool optional = 3; +inline void Int64Metric::clear_optional() { + _impl_.optional_ = false; } -inline void Int64Metric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; +inline bool Int64Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.optional) + return _internal_optional(); } -inline void Int64Metric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } +inline void Int64Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.optional) } -inline ::abacus::protobuf::Constant* Int64Metric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Int64Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool Int64Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline const ::abacus::protobuf::Constant& Int64Metric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +inline void Int64Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -inline const ::abacus::protobuf::Constant& Int64Metric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.constant) - return _internal_constant(); + +// .abacus.protobuf.Kind kind = 4; +inline void Int64Metric::clear_kind() { + _impl_.kind_ = 0; } -inline ::abacus::protobuf::Constant* Int64Metric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int64Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::abacus::protobuf::Kind Int64Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.kind) + return _internal_kind(); } -inline void Int64Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int64Metric.constant) +inline void Int64Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.kind) } -inline ::abacus::protobuf::Constant* Int64Metric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; +inline ::abacus::protobuf::Kind Int64Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline ::abacus::protobuf::Constant* Int64Metric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int64Metric.constant) - return _msg; +inline void Int64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; } -// optional string unit = 6; +// optional string unit = 5; inline bool Int64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4857,7 +3685,7 @@ inline void Int64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.unit) } -// optional int64 min = 7; +// optional int64 min = 6; inline bool Int64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -4884,7 +3712,7 @@ inline void Int64Metric::_internal_set_min(::int64_t value) { _impl_.min_ = value; } -// optional int64 max = 8; +// optional int64 max = 7; inline bool Int64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4911,15 +3739,6 @@ inline void Int64Metric::_internal_set_max(::int64_t value) { _impl_.max_ = value; } -inline bool Int64Metric::has_kind() const { - return kind_case() != KIND_NOT_SET; -} -inline void Int64Metric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; -} -inline Int64Metric::KindCase Int64Metric::kind_case() const { - return Int64Metric::KindCase(_impl_._oneof_case_[0]); -} // ------------------------------------------------------------------- // UInt32Metric @@ -4997,229 +3816,51 @@ inline void UInt32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.description) } -// .abacus.protobuf.Gauge gauge = 3; -inline bool UInt32Metric::has_gauge() const { - return kind_case() == kGauge; -} -inline bool UInt32Metric::_internal_has_gauge() const { - return kind_case() == kGauge; -} -inline void UInt32Metric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; -} -inline void UInt32Metric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Gauge* UInt32Metric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Gauge& UInt32Metric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); -} -inline const ::abacus::protobuf::Gauge& UInt32Metric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.gauge) - return _internal_gauge(); -} -inline ::abacus::protobuf::Gauge* UInt32Metric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt32Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void UInt32Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt32Metric.gauge) -} -inline ::abacus::protobuf::Gauge* UInt32Metric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; -} -inline ::abacus::protobuf::Gauge* UInt32Metric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.gauge) - return _msg; -} - -// .abacus.protobuf.Counter counter = 4; -inline bool UInt32Metric::has_counter() const { - return kind_case() == kCounter; -} -inline bool UInt32Metric::_internal_has_counter() const { - return kind_case() == kCounter; -} -inline void UInt32Metric::set_has_counter() { - _impl_._oneof_case_[0] = kCounter; -} -inline void UInt32Metric::clear_counter() { - if (kind_case() == kCounter) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Counter* UInt32Metric::release_counter() { - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Counter& UInt32Metric::_internal_counter() const { - return kind_case() == kCounter - ? *_impl_.kind_.counter_ - : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); -} -inline const ::abacus::protobuf::Counter& UInt32Metric::counter() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.counter) - return _internal_counter(); +// bool optional = 3; +inline void UInt32Metric::clear_optional() { + _impl_.optional_ = false; } -inline ::abacus::protobuf::Counter* UInt32Metric::unsafe_arena_release_counter() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt32Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool UInt32Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.optional) + return _internal_optional(); } -inline void UInt32Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { - clear_kind(); - if (counter) { - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt32Metric.counter) +inline void UInt32Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.optional) } -inline ::abacus::protobuf::Counter* UInt32Metric::_internal_mutable_counter() { - if (kind_case() != kCounter) { - clear_kind(); - set_has_counter(); - _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); - } - return _impl_.kind_.counter_; +inline bool UInt32Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline ::abacus::protobuf::Counter* UInt32Metric::mutable_counter() { - ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.counter) - return _msg; +inline void UInt32Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -// .abacus.protobuf.Constant constant = 5; -inline bool UInt32Metric::has_constant() const { - return kind_case() == kConstant; -} -inline bool UInt32Metric::_internal_has_constant() const { - return kind_case() == kConstant; -} -inline void UInt32Metric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; -} -inline void UInt32Metric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Constant* UInt32Metric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.UInt32Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +// .abacus.protobuf.Kind kind = 4; +inline void UInt32Metric::clear_kind() { + _impl_.kind_ = 0; } -inline const ::abacus::protobuf::Constant& UInt32Metric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); -} -inline const ::abacus::protobuf::Constant& UInt32Metric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.constant) - return _internal_constant(); -} -inline ::abacus::protobuf::Constant* UInt32Metric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.UInt32Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::abacus::protobuf::Kind UInt32Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.kind) + return _internal_kind(); } -inline void UInt32Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.UInt32Metric.constant) +inline void UInt32Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.kind) } -inline ::abacus::protobuf::Constant* UInt32Metric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; +inline ::abacus::protobuf::Kind UInt32Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline ::abacus::protobuf::Constant* UInt32Metric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.UInt32Metric.constant) - return _msg; +inline void UInt32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; } -// optional string unit = 6; +// optional string unit = 5; inline bool UInt32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -5288,7 +3929,7 @@ inline void UInt32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.unit) } -// optional uint32 min = 7; +// optional uint32 min = 6; inline bool UInt32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -5315,7 +3956,7 @@ inline void UInt32Metric::_internal_set_min(::uint32_t value) { _impl_.min_ = value; } -// optional uint32 max = 8; +// optional uint32 max = 7; inline bool UInt32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -5342,15 +3983,6 @@ inline void UInt32Metric::_internal_set_max(::uint32_t value) { _impl_.max_ = value; } -inline bool UInt32Metric::has_kind() const { - return kind_case() != KIND_NOT_SET; -} -inline void UInt32Metric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; -} -inline UInt32Metric::KindCase UInt32Metric::kind_case() const { - return UInt32Metric::KindCase(_impl_._oneof_case_[0]); -} // ------------------------------------------------------------------- // Int32Metric @@ -5428,229 +4060,51 @@ inline void Int32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.description) } -// .abacus.protobuf.Gauge gauge = 3; -inline bool Int32Metric::has_gauge() const { - return kind_case() == kGauge; -} -inline bool Int32Metric::_internal_has_gauge() const { - return kind_case() == kGauge; -} -inline void Int32Metric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; -} -inline void Int32Metric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Gauge* Int32Metric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Gauge& Int32Metric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); -} -inline const ::abacus::protobuf::Gauge& Int32Metric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.gauge) - return _internal_gauge(); -} -inline ::abacus::protobuf::Gauge* Int32Metric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int32Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Int32Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int32Metric.gauge) -} -inline ::abacus::protobuf::Gauge* Int32Metric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; -} -inline ::abacus::protobuf::Gauge* Int32Metric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.gauge) - return _msg; -} - -// .abacus.protobuf.Counter counter = 4; -inline bool Int32Metric::has_counter() const { - return kind_case() == kCounter; -} -inline bool Int32Metric::_internal_has_counter() const { - return kind_case() == kCounter; -} -inline void Int32Metric::set_has_counter() { - _impl_._oneof_case_[0] = kCounter; -} -inline void Int32Metric::clear_counter() { - if (kind_case() == kCounter) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Counter* Int32Metric::release_counter() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Counter& Int32Metric::_internal_counter() const { - return kind_case() == kCounter - ? *_impl_.kind_.counter_ - : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); -} -inline const ::abacus::protobuf::Counter& Int32Metric::counter() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.counter) - return _internal_counter(); -} -inline ::abacus::protobuf::Counter* Int32Metric::unsafe_arena_release_counter() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int32Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Int32Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { - clear_kind(); - if (counter) { - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int32Metric.counter) -} -inline ::abacus::protobuf::Counter* Int32Metric::_internal_mutable_counter() { - if (kind_case() != kCounter) { - clear_kind(); - set_has_counter(); - _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); - } - return _impl_.kind_.counter_; -} -inline ::abacus::protobuf::Counter* Int32Metric::mutable_counter() { - ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.counter) - return _msg; -} - -// .abacus.protobuf.Constant constant = 5; -inline bool Int32Metric::has_constant() const { - return kind_case() == kConstant; -} -inline bool Int32Metric::_internal_has_constant() const { - return kind_case() == kConstant; -} -inline void Int32Metric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; -} -inline void Int32Metric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Constant* Int32Metric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Int32Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +// bool optional = 3; +inline void Int32Metric::clear_optional() { + _impl_.optional_ = false; } -inline const ::abacus::protobuf::Constant& Int32Metric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +inline bool Int32Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.optional) + return _internal_optional(); } -inline const ::abacus::protobuf::Constant& Int32Metric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.constant) - return _internal_constant(); +inline void Int32Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.optional) } -inline ::abacus::protobuf::Constant* Int32Metric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Int32Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool Int32Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline void Int32Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Int32Metric.constant) +inline void Int32Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -inline ::abacus::protobuf::Constant* Int32Metric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; + +// .abacus.protobuf.Kind kind = 4; +inline void Int32Metric::clear_kind() { + _impl_.kind_ = 0; } -inline ::abacus::protobuf::Constant* Int32Metric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Int32Metric.constant) - return _msg; +inline ::abacus::protobuf::Kind Int32Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.kind) + return _internal_kind(); +} +inline void Int32Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.kind) +} +inline ::abacus::protobuf::Kind Int32Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void Int32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; } -// optional string unit = 6; +// optional string unit = 5; inline bool Int32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -5719,7 +4173,7 @@ inline void Int32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.unit) } -// optional int32 min = 7; +// optional int32 min = 6; inline bool Int32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -5746,7 +4200,7 @@ inline void Int32Metric::_internal_set_min(::int32_t value) { _impl_.min_ = value; } -// optional int32 max = 8; +// optional int32 max = 7; inline bool Int32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -5773,15 +4227,6 @@ inline void Int32Metric::_internal_set_max(::int32_t value) { _impl_.max_ = value; } -inline bool Int32Metric::has_kind() const { - return kind_case() != KIND_NOT_SET; -} -inline void Int32Metric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; -} -inline Int32Metric::KindCase Int32Metric::kind_case() const { - return Int32Metric::KindCase(_impl_._oneof_case_[0]); -} // ------------------------------------------------------------------- // Float64Metric @@ -5859,271 +4304,337 @@ inline void Float64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.description) } -// .abacus.protobuf.Gauge gauge = 3; -inline bool Float64Metric::has_gauge() const { - return kind_case() == kGauge; +// bool optional = 3; +inline void Float64Metric::clear_optional() { + _impl_.optional_ = false; } -inline bool Float64Metric::_internal_has_gauge() const { - return kind_case() == kGauge; +inline bool Float64Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.optional) + return _internal_optional(); } -inline void Float64Metric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; +inline void Float64Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.optional) } -inline void Float64Metric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } +inline bool Float64Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline ::abacus::protobuf::Gauge* Float64Metric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void Float64Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -inline const ::abacus::protobuf::Gauge& Float64Metric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); + +// .abacus.protobuf.Kind kind = 4; +inline void Float64Metric::clear_kind() { + _impl_.kind_ = 0; } -inline const ::abacus::protobuf::Gauge& Float64Metric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.gauge) - return _internal_gauge(); +inline ::abacus::protobuf::Kind Float64Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.kind) + return _internal_kind(); } -inline ::abacus::protobuf::Gauge* Float64Metric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float64Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { +inline void Float64Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.kind) +} +inline ::abacus::protobuf::Kind Float64Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); +} +inline void Float64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; +} + +// optional string unit = 5; +inline bool Float64Metric::has_unit() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void Float64Metric::clear_unit() { + _impl_.unit_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Float64Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.unit) + return _internal_unit(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Float64Metric::set_unit(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.unit) +} +inline std::string* Float64Metric::mutable_unit() { + std::string* _s = _internal_mutable_unit(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.unit) + return _s; +} +inline const std::string& Float64Metric::_internal_unit() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.unit_.Get(); +} +inline void Float64Metric::_internal_set_unit(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.unit_.Set(value, GetArenaForAllocation()); +} +inline std::string* Float64Metric::_internal_mutable_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.unit_.Mutable( GetArenaForAllocation()); +} +inline std::string* Float64Metric::release_unit() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.unit) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.unit_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.unit_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline void Float64Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; +inline void Float64Metric::set_allocated_unit(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float64Metric.gauge) + _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:abacus.protobuf.Float64Metric.unit) } -inline ::abacus::protobuf::Gauge* Float64Metric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; + +// optional double min = 6; +inline bool Float64Metric::has_min() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline ::abacus::protobuf::Gauge* Float64Metric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.gauge) - return _msg; +inline void Float64Metric::clear_min() { + _impl_.min_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline double Float64Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.min) + return _internal_min(); +} +inline void Float64Metric::set_min(double value) { + _internal_set_min(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.min) +} +inline double Float64Metric::_internal_min() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.min_; +} +inline void Float64Metric::_internal_set_min(double value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.min_ = value; } -// .abacus.protobuf.Counter counter = 4; -inline bool Float64Metric::has_counter() const { - return kind_case() == kCounter; +// optional double max = 7; +inline bool Float64Metric::has_max() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline bool Float64Metric::_internal_has_counter() const { - return kind_case() == kCounter; +inline void Float64Metric::clear_max() { + _impl_.max_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline void Float64Metric::set_has_counter() { - _impl_._oneof_case_[0] = kCounter; +inline double Float64Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.max) + return _internal_max(); } -inline void Float64Metric::clear_counter() { - if (kind_case() == kCounter) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - clear_has_kind(); - } +inline void Float64Metric::set_max(double value) { + _internal_set_max(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.max) } -inline ::abacus::protobuf::Counter* Float64Metric::release_counter() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } +inline double Float64Metric::_internal_max() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.max_; } -inline const ::abacus::protobuf::Counter& Float64Metric::_internal_counter() const { - return kind_case() == kCounter - ? *_impl_.kind_.counter_ - : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); +inline void Float64Metric::_internal_set_max(double value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.max_ = value; } -inline const ::abacus::protobuf::Counter& Float64Metric::counter() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.counter) - return _internal_counter(); + +// ------------------------------------------------------------------- + +// Float32Metric + +// uint32 offset = 1; +inline void Float32Metric::clear_offset() { + _impl_.offset_ = 0u; } -inline ::abacus::protobuf::Counter* Float64Metric::unsafe_arena_release_counter() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float64Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::uint32_t Float32Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.offset) + return _internal_offset(); } -inline void Float64Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { - clear_kind(); - if (counter) { - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float64Metric.counter) +inline void Float32Metric::set_offset(::uint32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.offset) } -inline ::abacus::protobuf::Counter* Float64Metric::_internal_mutable_counter() { - if (kind_case() != kCounter) { - clear_kind(); - set_has_counter(); - _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); - } - return _impl_.kind_.counter_; +inline ::uint32_t Float32Metric::_internal_offset() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.offset_; } -inline ::abacus::protobuf::Counter* Float64Metric::mutable_counter() { - ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.counter) - return _msg; +inline void Float32Metric::_internal_set_offset(::uint32_t value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.offset_ = value; } -// .abacus.protobuf.Constant constant = 5; -inline bool Float64Metric::has_constant() const { - return kind_case() == kConstant; +// string description = 2; +inline void Float32Metric::clear_description() { + _impl_.description_.ClearToEmpty(); +} +inline const std::string& Float32Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.description) + return _internal_description(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Float32Metric::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:abacus.protobuf.Float32Metric.description) +} +inline std::string* Float32Metric::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.description) + return _s; +} +inline const std::string& Float32Metric::_internal_description() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.description_.Get(); +} +inline void Float32Metric::_internal_set_description(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.description_.Set(value, GetArenaForAllocation()); +} +inline std::string* Float32Metric::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.description_.Mutable( GetArenaForAllocation()); +} +inline std::string* Float32Metric::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.description) + return _impl_.description_.Release(); +} +inline void Float32Metric::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:abacus.protobuf.Float32Metric.description) } -inline bool Float64Metric::_internal_has_constant() const { - return kind_case() == kConstant; + +// bool optional = 3; +inline void Float32Metric::clear_optional() { + _impl_.optional_ = false; } -inline void Float64Metric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; +inline bool Float32Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.optional) + return _internal_optional(); } -inline void Float64Metric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } +inline void Float32Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.optional) } -inline ::abacus::protobuf::Constant* Float64Metric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool Float32Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline const ::abacus::protobuf::Constant& Float64Metric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +inline void Float32Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -inline const ::abacus::protobuf::Constant& Float64Metric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.constant) - return _internal_constant(); + +// .abacus.protobuf.Kind kind = 4; +inline void Float32Metric::clear_kind() { + _impl_.kind_ = 0; } -inline ::abacus::protobuf::Constant* Float64Metric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float64Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::abacus::protobuf::Kind Float32Metric::kind() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.kind) + return _internal_kind(); } -inline void Float64Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float64Metric.constant) +inline void Float32Metric::set_kind(::abacus::protobuf::Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.kind) } -inline ::abacus::protobuf::Constant* Float64Metric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; +inline ::abacus::protobuf::Kind Float32Metric::_internal_kind() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::abacus::protobuf::Kind>(_impl_.kind_); } -inline ::abacus::protobuf::Constant* Float64Metric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.constant) - return _msg; +inline void Float32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.kind_ = value; } -// optional string unit = 6; -inline bool Float64Metric::has_unit() const { +// optional string unit = 5; +inline bool Float32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline void Float64Metric::clear_unit() { +inline void Float32Metric::clear_unit() { _impl_.unit_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& Float64Metric::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.unit) +inline const std::string& Float32Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.unit) return _internal_unit(); } template -inline PROTOBUF_ALWAYS_INLINE void Float64Metric::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Float32Metric::set_unit(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.unit) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.unit) } -inline std::string* Float64Metric::mutable_unit() { +inline std::string* Float32Metric::mutable_unit() { std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float64Metric.unit) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.unit) return _s; } -inline const std::string& Float64Metric::_internal_unit() const { +inline const std::string& Float32Metric::_internal_unit() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.unit_.Get(); } -inline void Float64Metric::_internal_set_unit(const std::string& value) { +inline void Float32Metric::_internal_set_unit(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline std::string* Float64Metric::_internal_mutable_unit() { +inline std::string* Float32Metric::_internal_mutable_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline std::string* Float64Metric::release_unit() { +inline std::string* Float32Metric::release_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Float64Metric.unit) + // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.unit) if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } @@ -6134,7 +4645,7 @@ inline std::string* Float64Metric::release_unit() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return released; } -inline void Float64Metric::set_allocated_unit(std::string* value) { +inline void Float32Metric::set_allocated_unit(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); if (value != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; @@ -6147,139 +4658,130 @@ inline void Float64Metric::set_allocated_unit(std::string* value) { _impl_.unit_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.unit) } -// optional double min = 7; -inline bool Float64Metric::has_min() const { +// optional float min = 6; +inline bool Float32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline void Float64Metric::clear_min() { +inline void Float32Metric::clear_min() { _impl_.min_ = 0; _impl_._has_bits_[0] &= ~0x00000002u; } -inline double Float64Metric::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.min) +inline float Float32Metric::min() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.min) return _internal_min(); } -inline void Float64Metric::set_min(double value) { +inline void Float32Metric::set_min(float value) { _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.min) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.min) } -inline double Float64Metric::_internal_min() const { +inline float Float32Metric::_internal_min() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.min_; } -inline void Float64Metric::_internal_set_min(double value) { +inline void Float32Metric::_internal_set_min(float value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000002u; _impl_.min_ = value; } -// optional double max = 8; -inline bool Float64Metric::has_max() const { +// optional float max = 7; +inline bool Float32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline void Float64Metric::clear_max() { +inline void Float32Metric::clear_max() { _impl_.max_ = 0; _impl_._has_bits_[0] &= ~0x00000004u; } -inline double Float64Metric::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.max) +inline float Float32Metric::max() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.max) return _internal_max(); } -inline void Float64Metric::set_max(double value) { +inline void Float32Metric::set_max(float value) { _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.max) + // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.max) } -inline double Float64Metric::_internal_max() const { +inline float Float32Metric::_internal_max() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.max_; } -inline void Float64Metric::_internal_set_max(double value) { +inline void Float32Metric::_internal_set_max(float value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000004u; _impl_.max_ = value; } -inline bool Float64Metric::has_kind() const { - return kind_case() != KIND_NOT_SET; -} -inline void Float64Metric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; -} -inline Float64Metric::KindCase Float64Metric::kind_case() const { - return Float64Metric::KindCase(_impl_._oneof_case_[0]); -} // ------------------------------------------------------------------- -// Float32Metric +// BoolMetric // uint32 offset = 1; -inline void Float32Metric::clear_offset() { +inline void BoolMetric::clear_offset() { _impl_.offset_ = 0u; } -inline ::uint32_t Float32Metric::offset() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.offset) +inline ::uint32_t BoolMetric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.offset) return _internal_offset(); } -inline void Float32Metric::set_offset(::uint32_t value) { +inline void BoolMetric::set_offset(::uint32_t value) { _internal_set_offset(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.offset) + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.offset) } -inline ::uint32_t Float32Metric::_internal_offset() const { +inline ::uint32_t BoolMetric::_internal_offset() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.offset_; } -inline void Float32Metric::_internal_set_offset(::uint32_t value) { +inline void BoolMetric::_internal_set_offset(::uint32_t value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.offset_ = value; } // string description = 2; -inline void Float32Metric::clear_description() { +inline void BoolMetric::clear_description() { _impl_.description_.ClearToEmpty(); } -inline const std::string& Float32Metric::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.description) +inline const std::string& BoolMetric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.description) return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void Float32Metric::set_description(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void BoolMetric::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:abacus.protobuf.Float32Metric.description) + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.description) } -inline std::string* Float32Metric::mutable_description() { +inline std::string* BoolMetric::mutable_description() { std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.description) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.description) return _s; } -inline const std::string& Float32Metric::_internal_description() const { +inline const std::string& BoolMetric::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.description_.Get(); } -inline void Float32Metric::_internal_set_description(const std::string& value) { +inline void BoolMetric::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* Float32Metric::_internal_mutable_description() { +inline std::string* BoolMetric::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* Float32Metric::release_description() { +inline std::string* BoolMetric::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.description) + // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.description) return _impl_.description_.Release(); } -inline void Float32Metric::set_allocated_description(std::string* value) { +inline void BoolMetric::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_.description_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -6287,274 +4789,74 @@ inline void Float32Metric::set_allocated_description(std::string* value) { _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.description) -} - -// .abacus.protobuf.Gauge gauge = 3; -inline bool Float32Metric::has_gauge() const { - return kind_case() == kGauge; -} -inline bool Float32Metric::_internal_has_gauge() const { - return kind_case() == kGauge; -} -inline void Float32Metric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; -} -inline void Float32Metric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Gauge* Float32Metric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Gauge& Float32Metric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); -} -inline const ::abacus::protobuf::Gauge& Float32Metric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.gauge) - return _internal_gauge(); -} -inline ::abacus::protobuf::Gauge* Float32Metric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float32Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Float32Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float32Metric.gauge) -} -inline ::abacus::protobuf::Gauge* Float32Metric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; -} -inline ::abacus::protobuf::Gauge* Float32Metric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.gauge) - return _msg; -} - -// .abacus.protobuf.Counter counter = 4; -inline bool Float32Metric::has_counter() const { - return kind_case() == kCounter; -} -inline bool Float32Metric::_internal_has_counter() const { - return kind_case() == kCounter; -} -inline void Float32Metric::set_has_counter() { - _impl_._oneof_case_[0] = kCounter; -} -inline void Float32Metric::clear_counter() { - if (kind_case() == kCounter) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.counter_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Counter* Float32Metric::release_counter() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Counter& Float32Metric::_internal_counter() const { - return kind_case() == kCounter - ? *_impl_.kind_.counter_ - : reinterpret_cast<::abacus::protobuf::Counter&>(::abacus::protobuf::_Counter_default_instance_); -} -inline const ::abacus::protobuf::Counter& Float32Metric::counter() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.counter) - return _internal_counter(); -} -inline ::abacus::protobuf::Counter* Float32Metric::unsafe_arena_release_counter() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float32Metric.counter) - if (kind_case() == kCounter) { - clear_has_kind(); - ::abacus::protobuf::Counter* temp = _impl_.kind_.counter_; - _impl_.kind_.counter_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Float32Metric::unsafe_arena_set_allocated_counter(::abacus::protobuf::Counter* counter) { - clear_kind(); - if (counter) { - set_has_counter(); - _impl_.kind_.counter_ = counter; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float32Metric.counter) -} -inline ::abacus::protobuf::Counter* Float32Metric::_internal_mutable_counter() { - if (kind_case() != kCounter) { - clear_kind(); - set_has_counter(); - _impl_.kind_.counter_ = CreateMaybeMessage< ::abacus::protobuf::Counter >(GetArenaForAllocation()); - } - return _impl_.kind_.counter_; -} -inline ::abacus::protobuf::Counter* Float32Metric::mutable_counter() { - ::abacus::protobuf::Counter* _msg = _internal_mutable_counter(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.counter) - return _msg; + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.description) } -// .abacus.protobuf.Constant constant = 5; -inline bool Float32Metric::has_constant() const { - return kind_case() == kConstant; -} -inline bool Float32Metric::_internal_has_constant() const { - return kind_case() == kConstant; -} -inline void Float32Metric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; -} -inline void Float32Metric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Constant* Float32Metric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Constant& Float32Metric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); -} -inline const ::abacus::protobuf::Constant& Float32Metric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.constant) - return _internal_constant(); +// bool optional = 3; +inline void BoolMetric::clear_optional() { + _impl_.optional_ = false; } -inline ::abacus::protobuf::Constant* Float32Metric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Float32Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool BoolMetric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.optional) + return _internal_optional(); } -inline void Float32Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Float32Metric.constant) +inline void BoolMetric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.optional) } -inline ::abacus::protobuf::Constant* Float32Metric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; +inline bool BoolMetric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline ::abacus::protobuf::Constant* Float32Metric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.constant) - return _msg; +inline void BoolMetric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -// optional string unit = 6; -inline bool Float32Metric::has_unit() const { +// optional string unit = 4; +inline bool BoolMetric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline void Float32Metric::clear_unit() { +inline void BoolMetric::clear_unit() { _impl_.unit_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& Float32Metric::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.unit) +inline const std::string& BoolMetric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.unit) return _internal_unit(); } template -inline PROTOBUF_ALWAYS_INLINE void Float32Metric::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void BoolMetric::set_unit(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.unit) + // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.unit) } -inline std::string* Float32Metric::mutable_unit() { +inline std::string* BoolMetric::mutable_unit() { std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Float32Metric.unit) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.unit) return _s; } -inline const std::string& Float32Metric::_internal_unit() const { +inline const std::string& BoolMetric::_internal_unit() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.unit_.Get(); } -inline void Float32Metric::_internal_set_unit(const std::string& value) { +inline void BoolMetric::_internal_set_unit(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline std::string* Float32Metric::_internal_mutable_unit() { +inline std::string* BoolMetric::_internal_mutable_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline std::string* Float32Metric::release_unit() { +inline std::string* BoolMetric::release_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Float32Metric.unit) + // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.unit) if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } @@ -6565,7 +4867,7 @@ inline std::string* Float32Metric::release_unit() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return released; } -inline void Float32Metric::set_allocated_unit(std::string* value) { +inline void BoolMetric::set_allocated_unit(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); if (value != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; @@ -6578,139 +4880,202 @@ inline void Float32Metric::set_allocated_unit(std::string* value) { _impl_.unit_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.unit) } -// optional float min = 7; -inline bool Float32Metric::has_min() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; +// ------------------------------------------------------------------- + +// Enum8Metric_EnumValue + +// string name = 1; +inline void Enum8Metric_EnumValue::clear_name() { + _impl_.name_.ClearToEmpty(); } -inline void Float32Metric::clear_min() { - _impl_.min_ = 0; - _impl_._has_bits_[0] &= ~0x00000002u; +inline const std::string& Enum8Metric_EnumValue::name() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.EnumValue.name) + return _internal_name(); } -inline float Float32Metric::min() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.min) - return _internal_min(); +template +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric_EnumValue::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:abacus.protobuf.Enum8Metric.EnumValue.name) } -inline void Float32Metric::set_min(float value) { - _internal_set_min(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.min) +inline std::string* Enum8Metric_EnumValue::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.EnumValue.name) + return _s; } -inline float Float32Metric::_internal_min() const { +inline const std::string& Enum8Metric_EnumValue::_internal_name() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.min_; + return _impl_.name_.Get(); } -inline void Float32Metric::_internal_set_min(float value) { +inline void Enum8Metric_EnumValue::_internal_set_name(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.min_ = value; + ; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Enum8Metric_EnumValue::_internal_mutable_name() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.name_.Mutable( GetArenaForAllocation()); +} +inline std::string* Enum8Metric_EnumValue::release_name() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.EnumValue.name) + return _impl_.name_.Release(); +} +inline void Enum8Metric_EnumValue::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:abacus.protobuf.Enum8Metric.EnumValue.name) } -// optional float max = 8; -inline bool Float32Metric::has_max() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; +// optional string description = 2; +inline bool Enum8Metric_EnumValue::has_description() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline void Float32Metric::clear_max() { - _impl_.max_ = 0; - _impl_._has_bits_[0] &= ~0x00000004u; +inline void Enum8Metric_EnumValue::clear_description() { + _impl_.description_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline float Float32Metric::max() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.max) - return _internal_max(); +inline const std::string& Enum8Metric_EnumValue::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.EnumValue.description) + return _internal_description(); } -inline void Float32Metric::set_max(float value) { - _internal_set_max(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.max) +template +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric_EnumValue::set_description(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.EnumValue.description) } -inline float Float32Metric::_internal_max() const { +inline std::string* Enum8Metric_EnumValue::mutable_description() { + std::string* _s = _internal_mutable_description(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.EnumValue.description) + return _s; +} +inline const std::string& Enum8Metric_EnumValue::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.max_; + return _impl_.description_.Get(); } -inline void Float32Metric::_internal_set_max(float value) { +inline void Enum8Metric_EnumValue::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.max_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.description_.Set(value, GetArenaForAllocation()); } - -inline bool Float32Metric::has_kind() const { - return kind_case() != KIND_NOT_SET; +inline std::string* Enum8Metric_EnumValue::_internal_mutable_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline void Float32Metric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; +inline std::string* Enum8Metric_EnumValue::release_description() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.EnumValue.description) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.description_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.description_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; } -inline Float32Metric::KindCase Float32Metric::kind_case() const { - return Float32Metric::KindCase(_impl_._oneof_case_[0]); +inline void Enum8Metric_EnumValue::set_allocated_description(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _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:abacus.protobuf.Enum8Metric.EnumValue.description) } + // ------------------------------------------------------------------- -// BoolMetric +// ------------------------------------------------------------------- + +// Enum8Metric // uint32 offset = 1; -inline void BoolMetric::clear_offset() { +inline void Enum8Metric::clear_offset() { _impl_.offset_ = 0u; } -inline ::uint32_t BoolMetric::offset() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.offset) +inline ::uint32_t Enum8Metric::offset() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.offset) return _internal_offset(); } -inline void BoolMetric::set_offset(::uint32_t value) { +inline void Enum8Metric::set_offset(::uint32_t value) { _internal_set_offset(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.offset) + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.offset) } -inline ::uint32_t BoolMetric::_internal_offset() const { +inline ::uint32_t Enum8Metric::_internal_offset() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.offset_; } -inline void BoolMetric::_internal_set_offset(::uint32_t value) { +inline void Enum8Metric::_internal_set_offset(::uint32_t value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.offset_ = value; } // string description = 2; -inline void BoolMetric::clear_description() { +inline void Enum8Metric::clear_description() { _impl_.description_.ClearToEmpty(); } -inline const std::string& BoolMetric::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.description) +inline const std::string& Enum8Metric::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.description) return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void BoolMetric::set_description(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric::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:abacus.protobuf.BoolMetric.description) + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.description) } -inline std::string* BoolMetric::mutable_description() { +inline std::string* Enum8Metric::mutable_description() { std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.description) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.description) return _s; } -inline const std::string& BoolMetric::_internal_description() const { +inline const std::string& Enum8Metric::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.description_.Get(); } -inline void BoolMetric::_internal_set_description(const std::string& value) { +inline void Enum8Metric::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* BoolMetric::_internal_mutable_description() { +inline std::string* Enum8Metric::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* BoolMetric::release_description() { +inline std::string* Enum8Metric::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.description) + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.description) return _impl_.description_.Release(); } -inline void BoolMetric::set_allocated_description(std::string* value) { +inline void Enum8Metric::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_.description_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -6718,200 +5083,101 @@ inline void BoolMetric::set_allocated_description(std::string* value) { _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.description) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.description) } -// .abacus.protobuf.Gauge gauge = 3; -inline bool BoolMetric::has_gauge() const { - return kind_case() == kGauge; -} -inline bool BoolMetric::_internal_has_gauge() const { - return kind_case() == kGauge; -} -inline void BoolMetric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; -} -inline void BoolMetric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Gauge* BoolMetric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Gauge& BoolMetric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); -} -inline const ::abacus::protobuf::Gauge& BoolMetric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.gauge) - return _internal_gauge(); +// bool optional = 3; +inline void Enum8Metric::clear_optional() { + _impl_.optional_ = false; } -inline ::abacus::protobuf::Gauge* BoolMetric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.BoolMetric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool Enum8Metric::optional() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.optional) + return _internal_optional(); } -inline void BoolMetric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.BoolMetric.gauge) +inline void Enum8Metric::set_optional(bool value) { + _internal_set_optional(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.optional) } -inline ::abacus::protobuf::Gauge* BoolMetric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; +inline bool Enum8Metric::_internal_optional() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.optional_; } -inline ::abacus::protobuf::Gauge* BoolMetric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.gauge) - return _msg; +inline void Enum8Metric::_internal_set_optional(bool value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.optional_ = value; } -// .abacus.protobuf.Constant constant = 4; -inline bool BoolMetric::has_constant() const { - return kind_case() == kConstant; -} -inline bool BoolMetric::_internal_has_constant() const { - return kind_case() == kConstant; -} -inline void BoolMetric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; -} -inline void BoolMetric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Constant* BoolMetric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +// map values = 4; +inline int Enum8Metric::_internal_values_size() const { + return _internal_values().size(); } -inline const ::abacus::protobuf::Constant& BoolMetric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); +inline int Enum8Metric::values_size() const { + return _internal_values_size(); } -inline const ::abacus::protobuf::Constant& BoolMetric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.constant) - return _internal_constant(); +inline void Enum8Metric::clear_values() { + _impl_.values_.Clear(); } -inline ::abacus::protobuf::Constant* BoolMetric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.BoolMetric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& Enum8Metric::_internal_values() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.values_.GetMap(); } -inline void BoolMetric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.BoolMetric.constant) +inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& Enum8Metric::values() const { + // @@protoc_insertion_point(field_map:abacus.protobuf.Enum8Metric.values) + return _internal_values(); } -inline ::abacus::protobuf::Constant* BoolMetric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* Enum8Metric::_internal_mutable_values() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + return _impl_.values_.MutableMap(); } -inline ::abacus::protobuf::Constant* BoolMetric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.constant) - return _msg; +inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* Enum8Metric::mutable_values() { + // @@protoc_insertion_point(field_mutable_map:abacus.protobuf.Enum8Metric.values) + return _internal_mutable_values(); } // optional string unit = 5; -inline bool BoolMetric::has_unit() const { +inline bool Enum8Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline void BoolMetric::clear_unit() { +inline void Enum8Metric::clear_unit() { _impl_.unit_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& BoolMetric::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.unit) +inline const std::string& Enum8Metric::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.unit) return _internal_unit(); } template -inline PROTOBUF_ALWAYS_INLINE void BoolMetric::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Enum8Metric::set_unit(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.unit) + // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.unit) } -inline std::string* BoolMetric::mutable_unit() { +inline std::string* Enum8Metric::mutable_unit() { std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.BoolMetric.unit) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.unit) return _s; } -inline const std::string& BoolMetric::_internal_unit() const { +inline const std::string& Enum8Metric::_internal_unit() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.unit_.Get(); } -inline void BoolMetric::_internal_set_unit(const std::string& value) { +inline void Enum8Metric::_internal_set_unit(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline std::string* BoolMetric::_internal_mutable_unit() { +inline std::string* Enum8Metric::_internal_mutable_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline std::string* BoolMetric::release_unit() { +inline std::string* Enum8Metric::release_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.BoolMetric.unit) + // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.unit) if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } @@ -6922,7 +5188,7 @@ inline std::string* BoolMetric::release_unit() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return released; } -inline void BoolMetric::set_allocated_unit(std::string* value) { +inline void Enum8Metric::set_allocated_unit(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); if (value != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; @@ -6935,211 +5201,417 @@ inline void BoolMetric::set_allocated_unit(std::string* value) { _impl_.unit_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.unit) + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.unit) } -inline bool BoolMetric::has_kind() const { - return kind_case() != KIND_NOT_SET; +// ------------------------------------------------------------------- + +// Constant + +// uint64 uint64 = 1; +inline bool Constant::has_uint64() const { + return value_case() == kUint64; } -inline void BoolMetric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; +inline void Constant::set_has_uint64() { + _impl_._oneof_case_[0] = kUint64; } -inline BoolMetric::KindCase BoolMetric::kind_case() const { - return BoolMetric::KindCase(_impl_._oneof_case_[0]); +inline void Constant::clear_uint64() { + if (value_case() == kUint64) { + _impl_.value_.uint64_ = ::uint64_t{0u}; + clear_has_value(); + } +} +inline ::uint64_t Constant::uint64() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.uint64) + return _internal_uint64(); +} +inline void Constant::set_uint64(::uint64_t value) { + _internal_set_uint64(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.uint64) +} +inline ::uint64_t Constant::_internal_uint64() const { + if (value_case() == kUint64) { + return _impl_.value_.uint64_; + } + return ::uint64_t{0u}; +} +inline void Constant::_internal_set_uint64(::uint64_t value) { + if (value_case() != kUint64) { + clear_value(); + set_has_uint64(); + } + _impl_.value_.uint64_ = value; } -// ------------------------------------------------------------------- - -// Enum8Metric_EnumValue -// string name = 1; -inline void Enum8Metric_EnumValue::clear_name() { - _impl_.name_.ClearToEmpty(); +// int64 int64 = 2; +inline bool Constant::has_int64() const { + return value_case() == kInt64; } -inline const std::string& Enum8Metric_EnumValue::name() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.EnumValue.name) - return _internal_name(); +inline void Constant::set_has_int64() { + _impl_._oneof_case_[0] = kInt64; } -template -inline PROTOBUF_ALWAYS_INLINE void Enum8Metric_EnumValue::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:abacus.protobuf.Enum8Metric.EnumValue.name) +inline void Constant::clear_int64() { + if (value_case() == kInt64) { + _impl_.value_.int64_ = ::int64_t{0}; + clear_has_value(); + } } -inline std::string* Enum8Metric_EnumValue::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.EnumValue.name) - return _s; +inline ::int64_t Constant::int64() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.int64) + return _internal_int64(); } -inline const std::string& Enum8Metric_EnumValue::_internal_name() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.name_.Get(); +inline void Constant::set_int64(::int64_t value) { + _internal_set_int64(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.int64) } -inline void Enum8Metric_EnumValue::_internal_set_name(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.name_.Set(value, GetArenaForAllocation()); +inline ::int64_t Constant::_internal_int64() const { + if (value_case() == kInt64) { + return _impl_.value_.int64_; + } + return ::int64_t{0}; } -inline std::string* Enum8Metric_EnumValue::_internal_mutable_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.name_.Mutable( GetArenaForAllocation()); +inline void Constant::_internal_set_int64(::int64_t value) { + if (value_case() != kInt64) { + clear_value(); + set_has_int64(); + } + _impl_.value_.int64_ = value; } -inline std::string* Enum8Metric_EnumValue::release_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.EnumValue.name) - return _impl_.name_.Release(); + +// uint32 uint32 = 3; +inline bool Constant::has_uint32() const { + return value_case() == kUint32; } -inline void Enum8Metric_EnumValue::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:abacus.protobuf.Enum8Metric.EnumValue.name) +inline void Constant::set_has_uint32() { + _impl_._oneof_case_[0] = kUint32; +} +inline void Constant::clear_uint32() { + if (value_case() == kUint32) { + _impl_.value_.uint32_ = 0u; + clear_has_value(); + } +} +inline ::uint32_t Constant::uint32() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.uint32) + return _internal_uint32(); +} +inline void Constant::set_uint32(::uint32_t value) { + _internal_set_uint32(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.uint32) +} +inline ::uint32_t Constant::_internal_uint32() const { + if (value_case() == kUint32) { + return _impl_.value_.uint32_; + } + return 0u; +} +inline void Constant::_internal_set_uint32(::uint32_t value) { + if (value_case() != kUint32) { + clear_value(); + set_has_uint32(); + } + _impl_.value_.uint32_ = value; } -// optional string description = 2; -inline bool Enum8Metric_EnumValue::has_description() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; +// int32 int32 = 4; +inline bool Constant::has_int32() const { + return value_case() == kInt32; } -inline void Enum8Metric_EnumValue::clear_description() { - _impl_.description_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; +inline void Constant::set_has_int32() { + _impl_._oneof_case_[0] = kInt32; } -inline const std::string& Enum8Metric_EnumValue::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.EnumValue.description) - return _internal_description(); +inline void Constant::clear_int32() { + if (value_case() == kInt32) { + _impl_.value_.int32_ = 0; + clear_has_value(); + } } -template -inline PROTOBUF_ALWAYS_INLINE void Enum8Metric_EnumValue::set_description(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.description_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.EnumValue.description) +inline ::int32_t Constant::int32() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.int32) + return _internal_int32(); } -inline std::string* Enum8Metric_EnumValue::mutable_description() { - std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.EnumValue.description) - return _s; +inline void Constant::set_int32(::int32_t value) { + _internal_set_int32(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.int32) } -inline const std::string& Enum8Metric_EnumValue::_internal_description() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.description_.Get(); +inline ::int32_t Constant::_internal_int32() const { + if (value_case() == kInt32) { + return _impl_.value_.int32_; + } + return 0; } -inline void Enum8Metric_EnumValue::_internal_set_description(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.description_.Set(value, GetArenaForAllocation()); +inline void Constant::_internal_set_int32(::int32_t value) { + if (value_case() != kInt32) { + clear_value(); + set_has_int32(); + } + _impl_.value_.int32_ = value; } -inline std::string* Enum8Metric_EnumValue::_internal_mutable_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.description_.Mutable( GetArenaForAllocation()); + +// float float32 = 5; +inline bool Constant::has_float32() const { + return value_case() == kFloat32; } -inline std::string* Enum8Metric_EnumValue::release_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.EnumValue.description) - if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { - return nullptr; +inline void Constant::set_has_float32() { + _impl_._oneof_case_[0] = kFloat32; +} +inline void Constant::clear_float32() { + if (value_case() == kFloat32) { + _impl_.value_.float32_ = 0; + clear_has_value(); } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* released = _impl_.description_.Release(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.description_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return released; } -inline void Enum8Metric_EnumValue::set_allocated_description(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; +inline float Constant::float32() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.float32) + return _internal_float32(); +} +inline void Constant::set_float32(float value) { + _internal_set_float32(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.float32) +} +inline float Constant::_internal_float32() const { + if (value_case() == kFloat32) { + return _impl_.value_.float32_; } - _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:abacus.protobuf.Enum8Metric.EnumValue.description) + return 0; +} +inline void Constant::_internal_set_float32(float value) { + if (value_case() != kFloat32) { + clear_value(); + set_has_float32(); + } + _impl_.value_.float32_ = value; } -// ------------------------------------------------------------------- +// double float64 = 6; +inline bool Constant::has_float64() const { + return value_case() == kFloat64; +} +inline void Constant::set_has_float64() { + _impl_._oneof_case_[0] = kFloat64; +} +inline void Constant::clear_float64() { + if (value_case() == kFloat64) { + _impl_.value_.float64_ = 0; + clear_has_value(); + } +} +inline double Constant::float64() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.float64) + return _internal_float64(); +} +inline void Constant::set_float64(double value) { + _internal_set_float64(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.float64) +} +inline double Constant::_internal_float64() const { + if (value_case() == kFloat64) { + return _impl_.value_.float64_; + } + return 0; +} +inline void Constant::_internal_set_float64(double value) { + if (value_case() != kFloat64) { + clear_value(); + set_has_float64(); + } + _impl_.value_.float64_ = value; +} -// ------------------------------------------------------------------- +// bool boolean = 7; +inline bool Constant::has_boolean() const { + return value_case() == kBoolean; +} +inline void Constant::set_has_boolean() { + _impl_._oneof_case_[0] = kBoolean; +} +inline void Constant::clear_boolean() { + if (value_case() == kBoolean) { + _impl_.value_.boolean_ = false; + clear_has_value(); + } +} +inline bool Constant::boolean() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.boolean) + return _internal_boolean(); +} +inline void Constant::set_boolean(bool value) { + _internal_set_boolean(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.boolean) +} +inline bool Constant::_internal_boolean() const { + if (value_case() == kBoolean) { + return _impl_.value_.boolean_; + } + return false; +} +inline void Constant::_internal_set_boolean(bool value) { + if (value_case() != kBoolean) { + clear_value(); + set_has_boolean(); + } + _impl_.value_.boolean_ = value; +} -// Enum8Metric +// uint32 enum8 = 8; +inline bool Constant::has_enum8() const { + return value_case() == kEnum8; +} +inline void Constant::set_has_enum8() { + _impl_._oneof_case_[0] = kEnum8; +} +inline void Constant::clear_enum8() { + if (value_case() == kEnum8) { + _impl_.value_.enum8_ = 0u; + clear_has_value(); + } +} +inline ::uint32_t Constant::enum8() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.enum8) + return _internal_enum8(); +} +inline void Constant::set_enum8(::uint32_t value) { + _internal_set_enum8(value); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.enum8) +} +inline ::uint32_t Constant::_internal_enum8() const { + if (value_case() == kEnum8) { + return _impl_.value_.enum8_; + } + return 0u; +} +inline void Constant::_internal_set_enum8(::uint32_t value) { + if (value_case() != kEnum8) { + clear_value(); + set_has_enum8(); + } + _impl_.value_.enum8_ = value; +} -// uint32 offset = 1; -inline void Enum8Metric::clear_offset() { - _impl_.offset_ = 0u; +// string string = 9; +inline bool Constant::has_string() const { + return value_case() == kString; } -inline ::uint32_t Enum8Metric::offset() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.offset) - return _internal_offset(); +inline void Constant::set_has_string() { + _impl_._oneof_case_[0] = kString; +} +inline void Constant::clear_string() { + if (value_case() == kString) { + _impl_.value_.string_.Destroy(); + clear_has_value(); + } +} +inline const std::string& Constant::string() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.string) + return _internal_string(); +} +template +inline PROTOBUF_ALWAYS_INLINE void Constant::set_string(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value_case() != kString) { + clear_value(); + + set_has_string(); + _impl_.value_.string_.InitDefault(); + } + _impl_.value_.string_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.string) } -inline void Enum8Metric::set_offset(::uint32_t value) { - _internal_set_offset(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.offset) +inline std::string* Constant::mutable_string() { + std::string* _s = _internal_mutable_string(); + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Constant.string) + return _s; } -inline ::uint32_t Enum8Metric::_internal_offset() const { +inline const std::string& Constant::_internal_string() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.offset_; + if (value_case() != kString) { + return ::google::protobuf::internal::GetEmptyStringAlreadyInited(); + } + return _impl_.value_.string_.Get(); } -inline void Enum8Metric::_internal_set_offset(::uint32_t value) { +inline void Constant::_internal_set_string(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.offset_ = value; + if (value_case() != kString) { + clear_value(); + + set_has_string(); + _impl_.value_.string_.InitDefault(); + } + _impl_.value_.string_.Set(value, GetArenaForAllocation()); } +inline std::string* Constant::_internal_mutable_string() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (value_case() != kString) { + clear_value(); -// string description = 2; -inline void Enum8Metric::clear_description() { + set_has_string(); + _impl_.value_.string_.InitDefault(); + } + return _impl_.value_.string_.Mutable( GetArenaForAllocation()); +} +inline std::string* Constant::release_string() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:abacus.protobuf.Constant.string) + if (value_case() != kString) { + return nullptr; + } + clear_has_value(); + return _impl_.value_.string_.Release(); +} +inline void Constant::set_allocated_string(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (has_value()) { + clear_value(); + } + if (value != nullptr) { + set_has_string(); + _impl_.value_.string_.InitAllocated(value, GetArenaForAllocation()); + } + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Constant.string) +} + +// string description = 10; +inline void Constant::clear_description() { _impl_.description_.ClearToEmpty(); } -inline const std::string& Enum8Metric::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.description) +inline const std::string& Constant::description() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.description) return _internal_description(); } template -inline PROTOBUF_ALWAYS_INLINE void Enum8Metric::set_description(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Constant::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:abacus.protobuf.Enum8Metric.description) + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.description) } -inline std::string* Enum8Metric::mutable_description() { +inline std::string* Constant::mutable_description() { std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.description) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Constant.description) return _s; } -inline const std::string& Enum8Metric::_internal_description() const { +inline const std::string& Constant::_internal_description() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.description_.Get(); } -inline void Enum8Metric::_internal_set_description(const std::string& value) { +inline void Constant::_internal_set_description(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.description_.Set(value, GetArenaForAllocation()); } -inline std::string* Enum8Metric::_internal_mutable_description() { +inline std::string* Constant::_internal_mutable_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; return _impl_.description_.Mutable( GetArenaForAllocation()); } -inline std::string* Enum8Metric::release_description() { +inline std::string* Constant::release_description() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.description) + // @@protoc_insertion_point(field_release:abacus.protobuf.Constant.description) return _impl_.description_.Release(); } -inline void Enum8Metric::set_allocated_description(std::string* value) { +inline void Constant::set_allocated_description(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_.description_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -7147,200 +5619,52 @@ inline void Enum8Metric::set_allocated_description(std::string* value) { _impl_.description_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.description) -} - -// .abacus.protobuf.Gauge gauge = 3; -inline bool Enum8Metric::has_gauge() const { - return kind_case() == kGauge; -} -inline bool Enum8Metric::_internal_has_gauge() const { - return kind_case() == kGauge; -} -inline void Enum8Metric::set_has_gauge() { - _impl_._oneof_case_[0] = kGauge; -} -inline void Enum8Metric::clear_gauge() { - if (kind_case() == kGauge) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.gauge_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Gauge* Enum8Metric::release_gauge() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Gauge& Enum8Metric::_internal_gauge() const { - return kind_case() == kGauge - ? *_impl_.kind_.gauge_ - : reinterpret_cast<::abacus::protobuf::Gauge&>(::abacus::protobuf::_Gauge_default_instance_); -} -inline const ::abacus::protobuf::Gauge& Enum8Metric::gauge() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.gauge) - return _internal_gauge(); -} -inline ::abacus::protobuf::Gauge* Enum8Metric::unsafe_arena_release_gauge() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Enum8Metric.gauge) - if (kind_case() == kGauge) { - clear_has_kind(); - ::abacus::protobuf::Gauge* temp = _impl_.kind_.gauge_; - _impl_.kind_.gauge_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Enum8Metric::unsafe_arena_set_allocated_gauge(::abacus::protobuf::Gauge* gauge) { - clear_kind(); - if (gauge) { - set_has_gauge(); - _impl_.kind_.gauge_ = gauge; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Enum8Metric.gauge) -} -inline ::abacus::protobuf::Gauge* Enum8Metric::_internal_mutable_gauge() { - if (kind_case() != kGauge) { - clear_kind(); - set_has_gauge(); - _impl_.kind_.gauge_ = CreateMaybeMessage< ::abacus::protobuf::Gauge >(GetArenaForAllocation()); - } - return _impl_.kind_.gauge_; -} -inline ::abacus::protobuf::Gauge* Enum8Metric::mutable_gauge() { - ::abacus::protobuf::Gauge* _msg = _internal_mutable_gauge(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.gauge) - return _msg; -} - -// .abacus.protobuf.Constant constant = 4; -inline bool Enum8Metric::has_constant() const { - return kind_case() == kConstant; -} -inline bool Enum8Metric::_internal_has_constant() const { - return kind_case() == kConstant; -} -inline void Enum8Metric::set_has_constant() { - _impl_._oneof_case_[0] = kConstant; -} -inline void Enum8Metric::clear_constant() { - if (kind_case() == kConstant) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; - } - clear_has_kind(); - } -} -inline ::abacus::protobuf::Constant* Enum8Metric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::Constant& Enum8Metric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ - : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); -} -inline const ::abacus::protobuf::Constant& Enum8Metric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.constant) - return _internal_constant(); -} -inline ::abacus::protobuf::Constant* Enum8Metric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Enum8Metric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Enum8Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); - if (constant) { - set_has_constant(); - _impl_.kind_.constant_ = constant; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Enum8Metric.constant) -} -inline ::abacus::protobuf::Constant* Enum8Metric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); - set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); - } - return _impl_.kind_.constant_; -} -inline ::abacus::protobuf::Constant* Enum8Metric::mutable_constant() { - ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.constant) - return _msg; + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Constant.description) } -// optional string unit = 5; -inline bool Enum8Metric::has_unit() const { +// optional string unit = 11; +inline bool Constant::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline void Enum8Metric::clear_unit() { +inline void Constant::clear_unit() { _impl_.unit_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& Enum8Metric::unit() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.unit) +inline const std::string& Constant::unit() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.unit) return _internal_unit(); } template -inline PROTOBUF_ALWAYS_INLINE void Enum8Metric::set_unit(Arg_&& arg, +inline PROTOBUF_ALWAYS_INLINE void Constant::set_unit(Arg_&& arg, Args_... args) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.unit) + // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.unit) } -inline std::string* Enum8Metric::mutable_unit() { +inline std::string* Constant::mutable_unit() { std::string* _s = _internal_mutable_unit(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Enum8Metric.unit) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Constant.unit) return _s; } -inline const std::string& Enum8Metric::_internal_unit() const { +inline const std::string& Constant::_internal_unit() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); return _impl_.unit_.Get(); } -inline void Enum8Metric::_internal_set_unit(const std::string& value) { +inline void Constant::_internal_set_unit(const std::string& value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; _impl_.unit_.Set(value, GetArenaForAllocation()); } -inline std::string* Enum8Metric::_internal_mutable_unit() { +inline std::string* Constant::_internal_mutable_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); _impl_._has_bits_[0] |= 0x00000001u; return _impl_.unit_.Mutable( GetArenaForAllocation()); } -inline std::string* Enum8Metric::release_unit() { +inline std::string* Constant::release_unit() { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.Enum8Metric.unit) + // @@protoc_insertion_point(field_release:abacus.protobuf.Constant.unit) if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } @@ -7351,7 +5675,7 @@ inline std::string* Enum8Metric::release_unit() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return released; } -inline void Enum8Metric::set_allocated_unit(std::string* value) { +inline void Constant::set_allocated_unit(std::string* value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); if (value != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; @@ -7364,210 +5688,97 @@ inline void Enum8Metric::set_allocated_unit(std::string* value) { _impl_.unit_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.unit) -} - -// map values = 6; -inline int Enum8Metric::_internal_values_size() const { - return _internal_values().size(); -} -inline int Enum8Metric::values_size() const { - return _internal_values_size(); -} -inline void Enum8Metric::clear_values() { - _impl_.values_.Clear(); -} -inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& Enum8Metric::_internal_values() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.values_.GetMap(); -} -inline const ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>& Enum8Metric::values() const { - // @@protoc_insertion_point(field_map:abacus.protobuf.Enum8Metric.values) - return _internal_values(); -} -inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* Enum8Metric::_internal_mutable_values() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _impl_.values_.MutableMap(); -} -inline ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>* Enum8Metric::mutable_values() { - // @@protoc_insertion_point(field_mutable_map:abacus.protobuf.Enum8Metric.values) - return _internal_mutable_values(); + // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Constant.unit) } -inline bool Enum8Metric::has_kind() const { - return kind_case() != KIND_NOT_SET; +inline bool Constant::has_value() const { + return value_case() != VALUE_NOT_SET; } -inline void Enum8Metric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; +inline void Constant::clear_has_value() { + _impl_._oneof_case_[0] = VALUE_NOT_SET; } -inline Enum8Metric::KindCase Enum8Metric::kind_case() const { - return Enum8Metric::KindCase(_impl_._oneof_case_[0]); +inline Constant::ValueCase Constant::value_case() const { + return Constant::ValueCase(_impl_._oneof_case_[0]); } // ------------------------------------------------------------------- -// StringMetric - -// uint32 offset = 1; -inline void StringMetric::clear_offset() { - _impl_.offset_ = 0u; -} -inline ::uint32_t StringMetric::offset() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.StringMetric.offset) - return _internal_offset(); -} -inline void StringMetric::set_offset(::uint32_t value) { - _internal_set_offset(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.StringMetric.offset) -} -inline ::uint32_t StringMetric::_internal_offset() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.offset_; -} -inline void StringMetric::_internal_set_offset(::uint32_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.offset_ = value; -} - -// string description = 2; -inline void StringMetric::clear_description() { - _impl_.description_.ClearToEmpty(); -} -inline const std::string& StringMetric::description() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.StringMetric.description) - return _internal_description(); -} -template -inline PROTOBUF_ALWAYS_INLINE void StringMetric::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:abacus.protobuf.StringMetric.description) -} -inline std::string* StringMetric::mutable_description() { - std::string* _s = _internal_mutable_description(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.StringMetric.description) - return _s; -} -inline const std::string& StringMetric::_internal_description() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.description_.Get(); -} -inline void StringMetric::_internal_set_description(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.description_.Set(value, GetArenaForAllocation()); -} -inline std::string* StringMetric::_internal_mutable_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.description_.Mutable( GetArenaForAllocation()); -} -inline std::string* StringMetric::release_description() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:abacus.protobuf.StringMetric.description) - return _impl_.description_.Release(); -} -inline void StringMetric::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:abacus.protobuf.StringMetric.description) -} +// Metric -// .abacus.protobuf.Constant constant = 3; -inline bool StringMetric::has_constant() const { - return kind_case() == kConstant; +// .abacus.protobuf.Constant constant = 1; +inline bool Metric::has_constant() const { + return type_case() == kConstant; } -inline bool StringMetric::_internal_has_constant() const { - return kind_case() == kConstant; +inline bool Metric::_internal_has_constant() const { + return type_case() == kConstant; } -inline void StringMetric::set_has_constant() { +inline void Metric::set_has_constant() { _impl_._oneof_case_[0] = kConstant; } -inline void StringMetric::clear_constant() { - if (kind_case() == kConstant) { +inline void Metric::clear_constant() { + if (type_case() == kConstant) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.kind_.constant_; + delete _impl_.type_.constant_; } - clear_has_kind(); + clear_has_type(); } } -inline ::abacus::protobuf::Constant* StringMetric::release_constant() { - // @@protoc_insertion_point(field_release:abacus.protobuf.StringMetric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; +inline ::abacus::protobuf::Constant* Metric::release_constant() { + // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.constant) + if (type_case() == kConstant) { + clear_has_type(); + ::abacus::protobuf::Constant* temp = _impl_.type_.constant_; if (GetArenaForAllocation() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - _impl_.kind_.constant_ = nullptr; + _impl_.type_.constant_ = nullptr; return temp; } else { return nullptr; } } -inline const ::abacus::protobuf::Constant& StringMetric::_internal_constant() const { - return kind_case() == kConstant - ? *_impl_.kind_.constant_ +inline const ::abacus::protobuf::Constant& Metric::_internal_constant() const { + return type_case() == kConstant + ? *_impl_.type_.constant_ : reinterpret_cast<::abacus::protobuf::Constant&>(::abacus::protobuf::_Constant_default_instance_); } -inline const ::abacus::protobuf::Constant& StringMetric::constant() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.StringMetric.constant) +inline const ::abacus::protobuf::Constant& Metric::constant() const { + // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.constant) return _internal_constant(); } -inline ::abacus::protobuf::Constant* StringMetric::unsafe_arena_release_constant() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.StringMetric.constant) - if (kind_case() == kConstant) { - clear_has_kind(); - ::abacus::protobuf::Constant* temp = _impl_.kind_.constant_; - _impl_.kind_.constant_ = nullptr; +inline ::abacus::protobuf::Constant* Metric::unsafe_arena_release_constant() { + // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.constant) + if (type_case() == kConstant) { + clear_has_type(); + ::abacus::protobuf::Constant* temp = _impl_.type_.constant_; + _impl_.type_.constant_ = nullptr; return temp; } else { return nullptr; } } -inline void StringMetric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { - clear_kind(); +inline void Metric::unsafe_arena_set_allocated_constant(::abacus::protobuf::Constant* constant) { + clear_type(); if (constant) { set_has_constant(); - _impl_.kind_.constant_ = constant; + _impl_.type_.constant_ = constant; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.StringMetric.constant) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.constant) } -inline ::abacus::protobuf::Constant* StringMetric::_internal_mutable_constant() { - if (kind_case() != kConstant) { - clear_kind(); +inline ::abacus::protobuf::Constant* Metric::_internal_mutable_constant() { + if (type_case() != kConstant) { + clear_type(); set_has_constant(); - _impl_.kind_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); + _impl_.type_.constant_ = CreateMaybeMessage< ::abacus::protobuf::Constant >(GetArenaForAllocation()); } - return _impl_.kind_.constant_; + return _impl_.type_.constant_; } -inline ::abacus::protobuf::Constant* StringMetric::mutable_constant() { +inline ::abacus::protobuf::Constant* Metric::mutable_constant() { ::abacus::protobuf::Constant* _msg = _internal_mutable_constant(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.StringMetric.constant) + // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.constant) return _msg; } -inline bool StringMetric::has_kind() const { - return kind_case() != KIND_NOT_SET; -} -inline void StringMetric::clear_has_kind() { - _impl_._oneof_case_[0] = KIND_NOT_SET; -} -inline StringMetric::KindCase StringMetric::kind_case() const { - return StringMetric::KindCase(_impl_._oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// Metric - -// .abacus.protobuf.UInt64Metric uint64 = 3; +// .abacus.protobuf.UInt64Metric uint64 = 2; inline bool Metric::has_uint64() const { return type_case() == kUint64; } @@ -7641,7 +5852,7 @@ inline ::abacus::protobuf::UInt64Metric* Metric::mutable_uint64() { return _msg; } -// .abacus.protobuf.Int64Metric int64 = 4; +// .abacus.protobuf.Int64Metric int64 = 3; inline bool Metric::has_int64() const { return type_case() == kInt64; } @@ -7715,7 +5926,7 @@ inline ::abacus::protobuf::Int64Metric* Metric::mutable_int64() { return _msg; } -// .abacus.protobuf.UInt32Metric uint32 = 5; +// .abacus.protobuf.UInt32Metric uint32 = 4; inline bool Metric::has_uint32() const { return type_case() == kUint32; } @@ -7789,7 +6000,7 @@ inline ::abacus::protobuf::UInt32Metric* Metric::mutable_uint32() { return _msg; } -// .abacus.protobuf.Int32Metric int32 = 6; +// .abacus.protobuf.Int32Metric int32 = 5; inline bool Metric::has_int32() const { return type_case() == kInt32; } @@ -7863,7 +6074,7 @@ inline ::abacus::protobuf::Int32Metric* Metric::mutable_int32() { return _msg; } -// .abacus.protobuf.Float64Metric float64 = 7; +// .abacus.protobuf.Float64Metric float64 = 6; inline bool Metric::has_float64() const { return type_case() == kFloat64; } @@ -7937,7 +6148,7 @@ inline ::abacus::protobuf::Float64Metric* Metric::mutable_float64() { return _msg; } -// .abacus.protobuf.Float32Metric float32 = 8; +// .abacus.protobuf.Float32Metric float32 = 7; inline bool Metric::has_float32() const { return type_case() == kFloat32; } @@ -8011,7 +6222,7 @@ inline ::abacus::protobuf::Float32Metric* Metric::mutable_float32() { return _msg; } -// .abacus.protobuf.BoolMetric boolean = 9; +// .abacus.protobuf.BoolMetric boolean = 8; inline bool Metric::has_boolean() const { return type_case() == kBoolean; } @@ -8085,7 +6296,7 @@ inline ::abacus::protobuf::BoolMetric* Metric::mutable_boolean() { return _msg; } -// .abacus.protobuf.Enum8Metric enum8 = 10; +// .abacus.protobuf.Enum8Metric enum8 = 9; inline bool Metric::has_enum8() const { return type_case() == kEnum8; } @@ -8159,80 +6370,6 @@ inline ::abacus::protobuf::Enum8Metric* Metric::mutable_enum8() { return _msg; } -// .abacus.protobuf.StringMetric string = 11; -inline bool Metric::has_string() const { - return type_case() == kString; -} -inline bool Metric::_internal_has_string() const { - return type_case() == kString; -} -inline void Metric::set_has_string() { - _impl_._oneof_case_[0] = kString; -} -inline void Metric::clear_string() { - if (type_case() == kString) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.type_.string_; - } - clear_has_type(); - } -} -inline ::abacus::protobuf::StringMetric* Metric::release_string() { - // @@protoc_insertion_point(field_release:abacus.protobuf.Metric.string) - if (type_case() == kString) { - clear_has_type(); - ::abacus::protobuf::StringMetric* temp = _impl_.type_.string_; - if (GetArenaForAllocation() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.type_.string_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::abacus::protobuf::StringMetric& Metric::_internal_string() const { - return type_case() == kString - ? *_impl_.type_.string_ - : reinterpret_cast<::abacus::protobuf::StringMetric&>(::abacus::protobuf::_StringMetric_default_instance_); -} -inline const ::abacus::protobuf::StringMetric& Metric::string() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Metric.string) - return _internal_string(); -} -inline ::abacus::protobuf::StringMetric* Metric::unsafe_arena_release_string() { - // @@protoc_insertion_point(field_unsafe_arena_release:abacus.protobuf.Metric.string) - if (type_case() == kString) { - clear_has_type(); - ::abacus::protobuf::StringMetric* temp = _impl_.type_.string_; - _impl_.type_.string_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Metric::unsafe_arena_set_allocated_string(::abacus::protobuf::StringMetric* string) { - clear_type(); - if (string) { - set_has_string(); - _impl_.type_.string_ = string; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:abacus.protobuf.Metric.string) -} -inline ::abacus::protobuf::StringMetric* Metric::_internal_mutable_string() { - if (type_case() != kString) { - clear_type(); - set_has_string(); - _impl_.type_.string_ = CreateMaybeMessage< ::abacus::protobuf::StringMetric >(GetArenaForAllocation()); - } - return _impl_.type_.string_; -} -inline ::abacus::protobuf::StringMetric* Metric::mutable_string() { - ::abacus::protobuf::StringMetric* _msg = _internal_mutable_string(); - // @@protoc_insertion_point(field_mutable:abacus.protobuf.Metric.string) - return _msg; -} - inline bool Metric::has_type() const { return type_case() != TYPE_NOT_SET; } @@ -8359,6 +6496,12 @@ template <> inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Endianness>() { return ::abacus::protobuf::Endianness_descriptor(); } +template <> +struct is_proto_enum<::abacus::protobuf::Kind> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::abacus::protobuf::Kind>() { + return ::abacus::protobuf::Kind_descriptor(); +} } // namespace protobuf } // namespace google diff --git a/src/abacus/string.hpp b/src/abacus/string.hpp deleted file mode 100644 index b08a0d19..00000000 --- a/src/abacus/string.hpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include "availability.hpp" -#include "description.hpp" -#include "kind.hpp" -#include "max.hpp" -#include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" -#include "unit.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -/// A 32-bit integer metric -struct string -{ - /// The primitive type of the metric - using type = std::string_view; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - std::memcpy(memory + 1, value.data(), value.size()); - // Set the null terminator - memory[1 + value.size()] = '\0'; - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - - return std::string_view(reinterpret_cast(memory + 1)); - } - - /// The metric kind - std::variant> kind; - - /// The metric description - abacus::description description; -}; -} -} diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index b2b87746..ac91b45c 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -54,7 +54,10 @@ struct uint32 } /// The metric kind - std::variant> kind; + abacus::kind kind; + + /// The availability of the metric + abacus::availability availability; /// The metric description abacus::description description; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index a73adb1d..19d1419f 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -54,7 +54,10 @@ struct uint64 } /// The metric kind - std::variant> kind; + abacus::kind kind; + + /// The availability of the metric + abacus::availability availability; /// The metric description abacus::description description; From 3152d6e6d5f6753a6d8a66533dc36556021bcfe8 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Sat, 1 Feb 2025 22:20:37 +0100 Subject: [PATCH 51/68] working on it --- benchmark/main.cpp | 18 ++--- examples/metrics_simple.cpp | 5 +- src/abacus/constant.hpp | 3 +- src/abacus/kind.hpp | 38 +++++++++- src/abacus/metrics.cpp | 22 +++--- test/src/test_info.cpp | 11 --- test/src/test_metrics.cpp | 140 +++++++++++++++++------------------- test/src/test_to_json.cpp | 20 +++--- test/src/test_view.cpp | 10 +-- 9 files changed, 141 insertions(+), 126 deletions(-) diff --git a/benchmark/main.cpp b/benchmark/main.cpp index b787e598..192fad00 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -7,21 +7,21 @@ std::map create_metric_infos() { return { - {abacus::name{"0"}, abacus::boolean{abacus::gauge{abacus::required}, - abacus::description{""}}}, - {abacus::name{"1"}, abacus::uint64{abacus::gauge{abacus::required}, + {abacus::name{"0"}, + abacus::boolean{abacus::required, abacus::description{""}}}, + {abacus::name{"1"}, abacus::uint64{abacus::gauge, abacus::required, abacus::description{""}}}, - {abacus::name{"2"}, abacus::int64{abacus::gauge{abacus::required}, + {abacus::name{"2"}, abacus::int64{abacus::gauge, abacus::required, abacus::description{""}}}, - {abacus::name{"3"}, abacus::float64{abacus::gauge{abacus::required}, - abacus::description{""}}}, - {abacus::name{"4"}, abacus::boolean{abacus::gauge{abacus::required}, + {abacus::name{"3"}, abacus::float64{abacus::gauge, abacus::required, abacus::description{""}}}, - {abacus::name{"5"}, abacus::float64{abacus::gauge{abacus::required}, + {abacus::name{"4"}, + abacus::boolean{abacus::required, abacus::description{""}}}, + {abacus::name{"5"}, abacus::float64{abacus::gauge, abacus::required, abacus::description{""}}}, {abacus::name{"6"}, abacus::enum8{ - abacus::gauge{abacus::required}, + abacus::required, abacus::description{""}, {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}}}}; } diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 38491acd..9ac98ba1 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -26,7 +26,7 @@ int main() abacus::unit{"wheels"}}}, {abacus::name{"days_until_maintenance"}, abacus::int64{ - abacus::kind::gauge, abacus::required, + abacus::gauge, abacus::required, abacus::description{"Days until next maintenance, if less than 0, " "maintenance is overdue"}, abacus::unit{"days"}}}, @@ -34,7 +34,8 @@ int main() abacus::boolean{abacus::optional, abacus::description{"Is the car registered"}}}, {abacus::name{"license_plate"}, - abacus::constant{abacus::value{"ABC-1234"}}}}; + abacus::constant{abacus::value{"ABC-1234"}, + abacus::description{"License plate"}}}}; abacus::metrics car(infos); diff --git a/src/abacus/constant.hpp b/src/abacus/constant.hpp index c1aad9c6..7cdb1556 100644 --- a/src/abacus/constant.hpp +++ b/src/abacus/constant.hpp @@ -44,8 +44,7 @@ struct constant std::variant, abacus::value, abacus::value, abacus::value, abacus::value, abacus::value, - abacus::value, abacus::value, - abacus::value> + abacus::value, abacus::value> value; // The description of the constant abacus::description description; diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index ec6c6a57..66cedb2e 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -12,10 +12,42 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -enum class kind +/// A tag type representing a gauge kind. +struct gauge_ { - gauge = protobuf::Kind::GAUGE, - counter = protobuf::Kind::COUNTER + static constexpr abacus::protobuf::Kind kind = abacus::protobuf::GAUGE; }; + +/// A constant instance of the gauge_ tag type. +static const gauge_ gauge; + +/// A tag type representing an counter kind. +struct counter_ +{ + static constexpr abacus::protobuf::Kind kind = abacus::protobuf::COUNTER; +}; + +/// A constant instance of the counter_ tag type. +static const counter_ counter; + +/// A variant type that can hold either a gauge_ or an counter_. +using kind = std::variant; + +/// Check if the given kind is counter. +/// @param k The kind to check. +/// @return true if the kind is counter, false otherwise. +static inline bool is_counter(const kind& k) +{ + return std::holds_alternative(k); +} + +/// Check if the given kind is gauge. +/// @param a The kind to check. +/// @return true if the kind is gauge, false otherwise. +static inline bool is_gauge(const kind& k) +{ + return std::holds_alternative(k); +} + } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 8298ecdf..cd70b086 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -30,6 +30,11 @@ static inline auto is_optional(const protobuf::Metric& metric) -> bool { return metric.optional(); }); } +static inline auto get_kind(abacus::kind k) -> protobuf::Kind +{ + return std::visit([](auto&& k) { return k.kind; }, k); +} + metrics::metrics(metrics&& other) noexcept : m_metadata(std::move(other.m_metadata)), m_data(std::move(other.m_data)), m_metadata_bytes(other.m_metadata_bytes), m_hash(other.m_hash), @@ -65,7 +70,7 @@ metrics::metrics(const std::map& infos) typed_metric->set_offset(m_value_bytes); typed_metric->set_description(m->description.value); typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(static_cast(m->kind)); + typed_metric->set_kind(get_kind(m->kind)); if (!m->unit.empty()) { @@ -92,7 +97,7 @@ metrics::metrics(const std::map& infos) typed_metric->set_offset(m_value_bytes); typed_metric->set_description(m->description.value); typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(static_cast(m->kind)); + typed_metric->set_kind(get_kind(m->kind)); if (!m->unit.empty()) { @@ -119,7 +124,7 @@ metrics::metrics(const std::map& infos) typed_metric->set_offset(m_value_bytes); typed_metric->set_description(m->description.value); typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(static_cast(m->kind)); + typed_metric->set_kind(get_kind(m->kind)); if (!m->unit.empty()) { @@ -146,7 +151,7 @@ metrics::metrics(const std::map& infos) typed_metric->set_offset(m_value_bytes); typed_metric->set_description(m->description.value); typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(static_cast(m->kind)); + typed_metric->set_kind(get_kind(m->kind)); if (!m->unit.empty()) { @@ -173,7 +178,7 @@ metrics::metrics(const std::map& infos) typed_metric->set_offset(m_value_bytes); typed_metric->set_description(m->description.value); typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(static_cast(m->kind)); + typed_metric->set_kind(get_kind(m->kind)); if (!m->unit.empty()) { @@ -200,7 +205,7 @@ metrics::metrics(const std::map& infos) typed_metric->set_offset(m_value_bytes); typed_metric->set_description(m->description.value); typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(static_cast(m->kind)); + typed_metric->set_kind(get_kind(m->kind)); if (!m->unit.empty()) { @@ -304,11 +309,6 @@ metrics::metrics(const std::map& infos) typed_metric->set_boolean(value.value); return; } - if constexpr (std::is_same_v) - { - typed_metric->set_enum8(value.value); - return; - } if constexpr (std::is_same_v) { typed_metric->set_string(value.value); diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index 41ea8c05..f640b703 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -222,14 +222,3 @@ TEST(test_info, enum8) EXPECT_EQ(r.value(), 3U); } } - -TEST(test_info, string) -{ - { - uint8_t data[7]; - std::memset(data, 0, sizeof(data)); - data[0] = 1; - abacus::string::set_value(data, "hello"); - EXPECT_EQ(abacus::string::value(data), "hello"); - } -} diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 75487b06..a72ac472 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -39,38 +39,38 @@ TEST(test_metrics, api) std::map infos = { {abacus::name{name0}, - abacus::boolean{abacus::gauge{abacus::optional}, + abacus::boolean{abacus::optional, abacus::description{"A boolean metric"}}}, {abacus::name{name1}, - abacus::uint64{abacus::counter{abacus::required}, + abacus::uint64{abacus::counter, abacus::required, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name2}, - abacus::int64{abacus::gauge{abacus::optional}, + abacus::int64{abacus::gauge, abacus::optional, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}, {abacus::name{name3}, - abacus::float64{abacus::gauge{abacus::optional}, + abacus::float64{abacus::gauge, abacus::optional, abacus::description{"A floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name4}, - abacus::boolean{abacus::constant{true}, - abacus::description{"A constant boolean metric"}}}, + abacus::constant{abacus::value{true}, + abacus::description{"A constant boolean metric"}}}, {abacus::name{name5}, - abacus::float64{ - abacus::constant{42.42}, + abacus::constant{ + abacus::value{42.42}, abacus::description{"A constant floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name6}, - abacus::enum8{abacus::gauge{abacus::optional}, + abacus::enum8{abacus::optional, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, {3, {"value3", "The value for 3"}}}}}, {abacus::name{name7}, - abacus::string{abacus::constant{"hello"}, - abacus::description{"A string metric"}}}}; + abacus::constant{abacus::value{"hello"}, + abacus::description{"A string metric"}}}}; abacus::metrics from_metrics(infos); abacus::metrics metrics(std::move(from_metrics)); @@ -78,46 +78,46 @@ TEST(test_metrics, api) EXPECT_EQ(metrics.metadata().protocol_version(), abacus::protocol_version()); - EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().kind_case(), - abacus::protobuf::BoolMetric::KindCase::kGauge); EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().description(), "A boolean metric"); + EXPECT_TRUE(metrics.metadata().metrics().at(name0).boolean().optional()); EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().unit(), ""); // empty unit - EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().kind_case(), - abacus::protobuf::UInt64Metric::KindCase::kCounter); + EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().kind(), + abacus::protobuf::Kind::COUNTER); + EXPECT_FALSE(metrics.metadata().metrics().at(name1).uint64().optional()); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().description(), "An unsigned integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().unit(), "bytes"); - EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().kind_case(), - abacus::protobuf::Int64Metric::KindCase::kGauge); + EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().kind(), + abacus::protobuf::Kind::GAUGE); + EXPECT_TRUE(metrics.metadata().metrics().at(name2).int64().optional()); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().description(), "A signed integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().unit(), "USD"); - EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().kind_case(), - abacus::protobuf::Float64Metric::KindCase::kGauge); + EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().kind(), + abacus::protobuf::Kind::GAUGE); + EXPECT_TRUE(metrics.metadata().metrics().at(name3).float64().optional()); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().description(), "A floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().unit(), "ms"); - EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().kind_case(), - abacus::protobuf::BoolMetric::KindCase::kConstant); + EXPECT_EQ(metrics.metadata().metrics().at(name4).constant().value_case(), + abacus::protobuf::Constant::ValueCase::kBoolean); EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().description(), "A constant boolean metric"); EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().unit(), ""); // empty unit - EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().kind_case(), - abacus::protobuf::Float64Metric::KindCase::kConstant); + EXPECT_EQ(metrics.metadata().metrics().at(name5).constant().value_case(), + abacus::protobuf::Constant::ValueCase::kFloat64); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().description(), "A constant floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().unit(), "ms"); - EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().kind_case(), - abacus::protobuf::Enum8Metric::KindCase::kGauge); EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().description(), "An enum metric"); EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().values().size(), @@ -134,9 +134,9 @@ TEST(test_metrics, api) .description(), "The value for 0"); - EXPECT_EQ(metrics.metadata().metrics().at(name7).string().kind_case(), - abacus::protobuf::StringMetric::KindCase::kConstant); - EXPECT_EQ(metrics.metadata().metrics().at(name7).string().description(), + EXPECT_EQ(metrics.metadata().metrics().at(name7).constant().value_case(), + abacus::protobuf::Constant::ValueCase::kString); + EXPECT_EQ(metrics.metadata().metrics().at(name7).constant().description(), "A string metric"); EXPECT_FALSE(metrics.is_initialized()); @@ -203,11 +203,11 @@ TEST(test_metrics, value_and_metadata_bytes) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter{abacus::optional}, + abacus::uint64{abacus::counter, abacus::optional, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge{abacus::optional}, + abacus::int64{abacus::gauge, abacus::optional, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}}; @@ -233,11 +233,11 @@ TEST(test_metrics, reset_counters) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter{abacus::optional}, + abacus::uint64{abacus::counter, abacus::optional, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge{abacus::optional}, + abacus::int64{abacus::gauge, abacus::optional, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}}; @@ -306,19 +306,19 @@ TEST(test_metrics, protocol_version) << "If this test fails, you need to update the protocol version"); std::map infos = { {abacus::name{"metric0"}, - abacus::uint64{abacus::counter{abacus::required}, + abacus::uint64{abacus::counter, abacus::required, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{"metric1"}, - abacus::int64{abacus::gauge{abacus::required}, + abacus::int64{abacus::gauge, abacus::required, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}, {abacus::name{"metric2"}, - abacus::float64{abacus::gauge{abacus::required}, + abacus::float64{abacus::gauge, abacus::required, abacus::description{"A floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{"metric3"}, - abacus::boolean{abacus::gauge{abacus::required}, + abacus::boolean{abacus::required, abacus::description{"A boolean metric"}}}}; abacus::metrics metrics(infos); @@ -393,80 +393,74 @@ TEST(test_metrics, reset) // Create one of each metric both required and optional std::map infos = { {abacus::name{"uint64_required"}, - abacus::uint64{abacus::counter{abacus::required}, + abacus::uint64{abacus::counter, abacus::required, abacus::description{""}}}, {abacus::name{"uint64_optional"}, - abacus::uint64{abacus::counter{abacus::optional}, + abacus::uint64{abacus::counter, abacus::optional, abacus::description{""}}}, {abacus::name{"uint32_required"}, - abacus::uint32{abacus::counter{abacus::required}, + abacus::uint32{abacus::counter, abacus::required, abacus::description{""}}}, {abacus::name{"uint32_optional"}, - abacus::uint32{abacus::counter{abacus::optional}, + abacus::uint32{abacus::counter, abacus::optional, abacus::description{""}}}, {abacus::name{"int64_required"}, - abacus::int64{abacus::gauge{abacus::required}, + abacus::int64{abacus::gauge, abacus::required, abacus::description{""}}}, {abacus::name{"int64_optional"}, - abacus::int64{abacus::gauge{abacus::optional}, + abacus::int64{abacus::gauge, abacus::optional, abacus::description{""}}}, {abacus::name{"int32_required"}, - abacus::int32{abacus::gauge{abacus::required}, + abacus::int32{abacus::gauge, abacus::required, abacus::description{""}}}, {abacus::name{"int32_optional"}, - abacus::int32{abacus::gauge{abacus::optional}, + abacus::int32{abacus::gauge, abacus::optional, abacus::description{""}}}, {abacus::name{"float64_required"}, - abacus::float64{abacus::gauge{abacus::required}, + abacus::float64{abacus::gauge, abacus::required, abacus::description{""}}}, {abacus::name{"float64_optional"}, - abacus::float64{abacus::gauge{abacus::optional}, + abacus::float64{abacus::gauge, abacus::optional, abacus::description{""}}}, {abacus::name{"float32_required"}, - abacus::float32{abacus::gauge{abacus::required}, + abacus::float32{abacus::gauge, abacus::required, abacus::description{""}}}, {abacus::name{"float32_optional"}, - abacus::float32{abacus::gauge{abacus::optional}, + abacus::float32{abacus::gauge, abacus::optional, abacus::description{""}}}, {abacus::name{"boolean_required"}, - abacus::boolean{abacus::gauge{abacus::required}, - abacus::description{""}}}, + abacus::boolean{abacus::required, abacus::description{""}}}, {abacus::name{"boolean_optional"}, - abacus::boolean{abacus::gauge{abacus::optional}, - abacus::description{""}}}, - {abacus::name{"enum8_required"}, - abacus::enum8{abacus::gauge{abacus::required}, - abacus::description{""}, - {{0, {"", ""}}}}}, - {abacus::name{"enum8_optional"}, - abacus::enum8{abacus::gauge{abacus::optional}, - abacus::description{""}, - {{0, {"", ""}}}}}, + abacus::boolean{abacus::optional, abacus::description{""}}}, + {abacus::name{"enum8_required"}, abacus::enum8{abacus::required, + abacus::description{""}, + {{0, {"", ""}}}}}, + {abacus::name{"enum8_optional"}, abacus::enum8{abacus::optional, + abacus::description{""}, + {{0, {"", ""}}}}}, {abacus::name{"uint64_constant"}, - abacus::uint64{abacus::constant{1111UL}, abacus::description{""}}}, + abacus::constant{abacus::value{1111UL}, abacus::description{""}}}, {abacus::name{"uint32_constant"}, - abacus::uint32{abacus::constant{2222U}, abacus::description{""}}}, + abacus::constant{abacus::value{2222U}, abacus::description{""}}}, {abacus::name{"int64_constant"}, - abacus::int64{abacus::constant{3333L}, abacus::description{""}}}, + abacus::constant{abacus::value{3333L}, abacus::description{""}}}, {abacus::name{"int32_constant"}, - abacus::int32{abacus::constant{4444}, abacus::description{""}}}, + abacus::constant{abacus::value{4444}, abacus::description{""}}}, {abacus::name{"float64_constant"}, - abacus::float64{abacus::constant{5555.0}, abacus::description{""}}}, + abacus::constant{abacus::value{5555.0}, abacus::description{""}}}, {abacus::name{"float32_constant"}, - abacus::float32{abacus::constant{6666.0f}, abacus::description{""}}}, + abacus::constant{abacus::value{6666.0f}, abacus::description{""}}}, {abacus::name{"boolean_constant"}, - abacus::boolean{abacus::constant{true}, abacus::description{""}}}, - {abacus::name{"enum8_constant"}, - abacus::enum8{abacus::constant{(uint8_t)77}, - abacus::description{""}, - {{0, {"", ""}}}}}, + abacus::constant{abacus::value{true}, abacus::description{""}}}, + {abacus::name{"string_constant"}, + abacus::constant{abacus::value{"hello"}, abacus::description{""}}}, // Finally a metric that we do not initialize {abacus::name{"not_initialized_required"}, - abacus::uint64{abacus::counter{abacus::required}, + abacus::uint64{abacus::counter, abacus::required, abacus::description{""}}}, {abacus::name{"not_initialized_optional"}, - abacus::uint64{abacus::counter{abacus::optional}, + abacus::uint64{abacus::counter, abacus::optional, abacus::description{""}}}}; abacus::metrics metrics(infos); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 5ced8d14..f6a2483c 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -29,20 +29,20 @@ TEST(test_to_json, to_json_minimal) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter{abacus::required}, + abacus::uint64{abacus::counter, abacus::required, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge{abacus::required}, + abacus::int64{abacus::gauge, abacus::required, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::constant{true}, - abacus::description{"A boolean constant"}}}, + abacus::constant{abacus::value{true}, + abacus::description{"A boolean constant"}}}, {abacus::name{name3}, - abacus::enum8{abacus::gauge{abacus::required}, + abacus::enum8{abacus::required, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, @@ -156,20 +156,20 @@ TEST(test_to_json, to_json) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter{abacus::required}, + abacus::uint64{abacus::counter, abacus::required, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge{abacus::required}, + abacus::int64{abacus::gauge, abacus::required, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::boolean{abacus::constant{true}, - abacus::description{"A boolean constant"}}}, + abacus::constant{abacus::value{true}, + abacus::description{"A boolean constant"}}}, {abacus::name{name3}, - abacus::enum8{abacus::gauge{abacus::required}, + abacus::enum8{abacus::required, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 2fc875cb..0b3cb5d9 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -22,20 +22,20 @@ TEST(test_view, api) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter{abacus::optional}, + abacus::uint64{abacus::counter, abacus::optional, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge{abacus::optional}, + abacus::int64{abacus::gauge, abacus::optional, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}, {abacus::name{name2}, - abacus::float64{ - abacus::constant{3.14}, + abacus::constant{ + abacus::value{3.14}, abacus::description{"A constant floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name3}, - abacus::enum8{abacus::gauge{abacus::optional}, + abacus::enum8{abacus::optional, abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, From 59c38c94e5e6436ceb1d76a82d5b99ca5959f6f6 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Sun, 2 Feb 2025 21:06:47 +0100 Subject: [PATCH 52/68] working on it --- src/abacus/metrics.cpp | 1 + test/src/test_metrics.cpp | 45 +++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index cd70b086..9c7090fc 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -317,6 +317,7 @@ metrics::metrics(const std::map& infos) assert(false && "Unknown type"); }, m->value); + m_initialized[name.value] = true; } m_metadata.mutable_metrics()->insert({name.value, metric}); diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index a72ac472..3de8f475 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -107,16 +107,16 @@ TEST(test_metrics, api) EXPECT_EQ(metrics.metadata().metrics().at(name4).constant().value_case(), abacus::protobuf::Constant::ValueCase::kBoolean); - EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().description(), + EXPECT_EQ(metrics.metadata().metrics().at(name4).constant().description(), "A constant boolean metric"); - EXPECT_EQ(metrics.metadata().metrics().at(name4).boolean().unit(), + EXPECT_EQ(metrics.metadata().metrics().at(name4).constant().unit(), ""); // empty unit + EXPECT_EQ(metrics.metadata().metrics().at(name5).constant().value_case(), abacus::protobuf::Constant::ValueCase::kFloat64); - - EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().description(), + EXPECT_EQ(metrics.metadata().metrics().at(name5).constant().description(), "A constant floating point metric"); - EXPECT_EQ(metrics.metadata().metrics().at(name5).float64().unit(), "ms"); + EXPECT_EQ(metrics.metadata().metrics().at(name5).constant().unit(), "ms"); EXPECT_EQ(metrics.metadata().metrics().at(name6).enum8().description(), "An enum metric"); @@ -218,7 +218,7 @@ TEST(test_metrics, value_and_metadata_bytes) (void)m0; (void)m1; - EXPECT_EQ(metrics.metadata().ByteSizeLong(), 114U); + EXPECT_EQ(metrics.metadata().ByteSizeLong(), 112); EXPECT_EQ(metrics.value_bytes(), sizeof(uint32_t) + // hash 1 + sizeof(uint64_t) + // metric0 has_value + value @@ -272,23 +272,22 @@ TEST(test_metrics, reset_counters) } static const std::vector expected_metadata = { - 0x08, 0x02, 0x1d, 0x8d, 0x25, 0xed, 0x54, 0x22, 0x2e, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, 0x23, 0x3a, 0x21, 0x08, 0x16, - 0x12, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, - 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x1a, 0x00, 0x32, 0x02, 0x6d, 0x73, 0x22, 0x34, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x1a, 0x27, 0x08, 0x04, - 0x12, 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x22, 0x00, 0x32, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x23, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, - 0x12, 0x18, 0x4a, 0x16, 0x08, 0x1f, 0x12, 0x10, 0x41, 0x20, 0x62, 0x6f, - 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, - 0x1a, 0x00, 0x22, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, - 0x31, 0x12, 0x24, 0x22, 0x22, 0x08, 0x0d, 0x12, 0x17, 0x41, 0x20, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, - 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x1a, 0x00, 0x32, 0x03, - 0x55, 0x53, 0x44, + 0x08, 0x02, 0x1d, 0xa6, 0xbc, 0x77, 0x0c, 0x22, 0x2d, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, 0x12, 0x22, 0x1a, 0x20, 0x08, 0x0d, + 0x12, 0x17, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, + 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x2a, 0x03, 0x55, 0x53, 0x44, 0x22, 0x34, 0x0a, 0x07, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x12, 0x27, 0x08, 0x04, 0x12, + 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x20, 0x01, 0x2a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x22, 0x21, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, + 0x16, 0x42, 0x14, 0x08, 0x1f, 0x12, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, + 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x22, + 0x2c, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, 0x21, + 0x32, 0x1f, 0x08, 0x16, 0x12, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x2a, 0x02, 0x6d, 0x73, }; static const std::vector expected_value_data = { From 56554eeb526d103fa91a8e8a442b67dfe1ccb285 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 09:04:32 +0100 Subject: [PATCH 53/68] suggestions (#44) * suggestions Co-authored-by: Morten V. Pedersen --- benchmark/main.cpp | 80 +- examples/metrics_simple.cpp | 41 +- protobuf/metrics.proto | 74 +- src/abacus/availability.hpp | 51 - src/abacus/boolean.hpp | 35 +- src/abacus/constant.hpp | 55 +- .../detail/has_arithmetic_operators.hpp | 41 - src/abacus/detail/overload.hpp | 29 + src/abacus/detail/size_of_type.hpp | 29 - src/abacus/enum8.hpp | 75 +- src/abacus/float32.hpp | 42 +- src/abacus/float64.hpp | 44 +- src/abacus/int32.hpp | 35 - src/abacus/int64.hpp | 35 - src/abacus/kind.hpp | 36 +- src/abacus/metric.hpp | 304 ++++++ src/abacus/metrics.cpp | 642 +++++------- src/abacus/metrics.hpp | 30 +- src/abacus/optional_metric.hpp | 175 ---- src/abacus/parse.hpp | 31 - src/abacus/{parse.cpp => parse_metadata.cpp} | 4 +- src/abacus/parse_metadata.hpp | 24 + src/abacus/protobuf/metrics.pb.cc | 991 ++++++------------ src/abacus/protobuf/metrics.pb.h | 676 ++---------- src/abacus/required_metric.hpp | 174 --- src/abacus/to_json.cpp | 4 +- src/abacus/uint32.hpp | 35 - src/abacus/uint64.hpp | 36 +- test/src/test_info.cpp | 111 +- test/src/test_metric.cpp | 6 +- test/src/test_metrics.cpp | 230 ++-- test/src/test_to_json.cpp | 32 +- test/src/test_view.cpp | 15 +- 33 files changed, 1343 insertions(+), 2879 deletions(-) delete mode 100644 src/abacus/availability.hpp delete mode 100644 src/abacus/detail/has_arithmetic_operators.hpp create mode 100644 src/abacus/detail/overload.hpp delete mode 100644 src/abacus/detail/size_of_type.hpp create mode 100644 src/abacus/metric.hpp delete mode 100644 src/abacus/optional_metric.hpp delete mode 100644 src/abacus/parse.hpp rename src/abacus/{parse.cpp => parse_metadata.cpp} (83%) create mode 100644 src/abacus/parse_metadata.hpp delete mode 100644 src/abacus/required_metric.hpp diff --git a/benchmark/main.cpp b/benchmark/main.cpp index 192fad00..9dd2bd7a 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -3,27 +3,33 @@ #include #include +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; + // Helper function to create metric definitions std::map create_metric_infos() { return { - {abacus::name{"0"}, - abacus::boolean{abacus::required, abacus::description{""}}}, - {abacus::name{"1"}, abacus::uint64{abacus::gauge, abacus::required, - abacus::description{""}}}, - {abacus::name{"2"}, abacus::int64{abacus::gauge, abacus::required, - abacus::description{""}}}, - {abacus::name{"3"}, abacus::float64{abacus::gauge, abacus::required, - abacus::description{""}}}, - {abacus::name{"4"}, - abacus::boolean{abacus::required, abacus::description{""}}}, - {abacus::name{"5"}, abacus::float64{abacus::gauge, abacus::required, - abacus::description{""}}}, - {abacus::name{"6"}, - abacus::enum8{ - abacus::required, - abacus::description{""}, - {{0, {"", ""}}, {1, {"", ""}}, {2, {"", ""}}, {3, {"", ""}}}}}}; + {abacus::name{"0"}, abacus::boolean{abacus::description{""}}}, + {abacus::name{"1"}, + abacus::uint64{abacus::kind::gauge, abacus::description{""}}}, + {abacus::name{"2"}, + abacus::int64{abacus::kind::gauge, abacus::description{""}}}, + {abacus::name{"3"}, + abacus::float64{abacus::kind::gauge, abacus::description{""}}}, + {abacus::name{"4"}, abacus::boolean{abacus::description{""}}}, + {abacus::name{"5"}, + abacus::float64{abacus::kind::gauge, abacus::description{""}}}, + {abacus::name{"6"}, abacus::enum8{abacus::description{""}, + {{test_enum::value0, {"", ""}}, + {test_enum::value1, {"", ""}}, + {test_enum::value2, {"", ""}}, + {test_enum::value3, {"", ""}}}}}}; } // Benchmark for metric initialization @@ -33,13 +39,14 @@ static void BM_MetricInitialization(benchmark::State& state) for (auto _ : state) { abacus::metrics metrics(create_metric_infos()); - auto m0 = metrics.initialize_required("0", false); - auto m1 = metrics.initialize_required("1", 0); - auto m2 = metrics.initialize_required("2", 0); - auto m3 = metrics.initialize_required("3", 0.0); - auto m4 = metrics.initialize_required("4", true); - auto m5 = metrics.initialize_required("5", 3.14); - auto m6 = metrics.initialize_required("6", 1); + auto m0 = metrics.initialize("0").set_value(false); + auto m1 = metrics.initialize("1").set_value(0); + auto m2 = metrics.initialize("2").set_value(0); + auto m3 = metrics.initialize("3").set_value(0.0); + auto m4 = metrics.initialize("4").set_value(true); + auto m5 = metrics.initialize("5").set_value(3.14); + auto m6 = + metrics.initialize("6").set_value(test_enum::value1); (void)m0; (void)m1; @@ -57,13 +64,14 @@ static void BM_AssignMetrics(benchmark::State& state) { state.SetLabel("Assign Metrics"); abacus::metrics metrics(create_metric_infos()); - auto m0 = metrics.initialize_required("0", false); - auto m1 = metrics.initialize_required("1", 0); - auto m2 = metrics.initialize_required("2", 0); - auto m3 = metrics.initialize_required("3", 0.0); - auto m4 = metrics.initialize_required("4", true); - auto m5 = metrics.initialize_required("5", 3.14); - auto m6 = metrics.initialize_required("6", 1); + auto m0 = metrics.initialize("0").set_value(false); + auto m1 = metrics.initialize("1").set_value(0); + auto m2 = metrics.initialize("2").set_value(0); + auto m3 = metrics.initialize("3").set_value(0.0); + auto m4 = metrics.initialize("4").set_value(true); + auto m5 = metrics.initialize("5").set_value(3.14); + auto m6 = + metrics.initialize("6").set_value(test_enum::value1); for (auto _ : state) { @@ -84,10 +92,10 @@ static void BM_AccessMetrics(benchmark::State& state) { state.SetLabel("Access Metrics"); abacus::metrics metrics(create_metric_infos()); - auto m0 = metrics.initialize_required("0", false); - auto m1 = metrics.initialize_required("1", 0); - auto m2 = metrics.initialize_required("2", 0); - auto m3 = metrics.initialize_required("3", 0.0); + auto m0 = metrics.initialize("0"); + auto m1 = metrics.initialize("1"); + auto m2 = metrics.initialize("2"); + auto m3 = metrics.initialize("3"); for (auto _ : state) { @@ -110,7 +118,7 @@ static void BM_IncrementUint64(benchmark::State& state) { state.SetLabel("Increment Uint64 Metric"); abacus::metrics metrics(create_metric_infos()); - auto m1 = metrics.initialize_required("1", 0); + auto m1 = metrics.initialize("1"); for (auto _ : state) { diff --git a/examples/metrics_simple.cpp b/examples/metrics_simple.cpp index 9ac98ba1..71de0322 100644 --- a/examples/metrics_simple.cpp +++ b/examples/metrics_simple.cpp @@ -11,46 +11,65 @@ #include #include +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; + // Simple example of metrics on a car. int main() { std::map infos = { {abacus::name{"fuel_consumption"}, abacus::constant{ - abacus::value{22.3}, + abacus::constant::float64{22.3}, abacus::description{"Fuel consumption in kilometers per liter"}, abacus::unit{"km/l"}}}, {abacus::name{"wheels"}, - abacus::constant{abacus::value{4UL}, + abacus::constant{abacus::constant::uint64{4}, abacus::description{"Wheels on the car"}, abacus::unit{"wheels"}}}, {abacus::name{"days_until_maintenance"}, abacus::int64{ - abacus::gauge, abacus::required, + abacus::kind::gauge, abacus::description{"Days until next maintenance, if less than 0, " "maintenance is overdue"}, abacus::unit{"days"}}}, {abacus::name{"registered"}, - abacus::boolean{abacus::optional, - abacus::description{"Is the car registered"}}}, + abacus::boolean{abacus::description{"Is the car registered"}}}, {abacus::name{"license_plate"}, - abacus::constant{abacus::value{"ABC-1234"}, - abacus::description{"License plate"}}}}; + abacus::constant{abacus::constant::str{"ABC-1234"}, + abacus::description{"License plate of the car"}}}, + {abacus::name{"some_enum"}, + abacus::enum8{abacus::description{"An enum metric"}, + {{test_enum::value0, {"value0", "The value for 0"}}, + {test_enum::value1, {"value1", "The value for 1"}}, + {test_enum::value2, {"value2", "The value for 2"}}, + {test_enum::value3, {"value3", "The value for 3"}}}}}}; abacus::metrics car(infos); // The car still has some time before maintenance. - abacus::int64::required days_until_maintenance = - car.initialize_required("days_until_maintenance", 10); + abacus::metric days_until_maintenance = + car.initialize("days_until_maintenance"); // The car should be registered. - abacus::boolean::optional registered = - car.initialize_optional("registered"); + abacus::metric registered = + car.initialize("registered"); // The registration is initialized, but not set. assert(registered.is_initialized()); assert(!registered.has_value()); + abacus::metric some_enum = + car.initialize("some_enum").set_value(test_enum::value1); + + // Change value + some_enum = test_enum::value2; + // The car hasn't been registered. registered = false; diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index ed0945cb..c53ba919 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -15,76 +15,69 @@ enum Kind { // Metadata for unsigned 64-bit metrics message UInt64Metric { - uint32 offset = 1; // Offset into packed memory for the value + uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional - Kind kind = 4; // The kind of metric - optional string unit = 5; // Unit of measurement - optional uint64 min = 6; // Minimum allowable value - optional uint64 max = 7; // Maximum allowable value + Kind kind = 3; // The kind of metric + optional string unit = 4; // Unit of measurement + optional uint64 min = 5; // Minimum allowable value + optional uint64 max = 6; // Maximum allowable value } // Metadata for signed 64-bit metrics message Int64Metric { - uint32 offset = 1; // Offset into packed memory for the value + uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional - Kind kind = 4; // The kind of metric - optional string unit = 5; // Unit of measurement - optional int64 min = 6; // Minimum allowable value - optional int64 max = 7; // Maximum allowable value + Kind kind = 3; // The kind of metric + optional string unit = 4; // Unit of measurement + optional int64 min = 5; // Minimum allowable value + optional int64 max = 6; // Maximum allowable value } // Metadata for unsigned 32-bit metrics message UInt32Metric { - uint32 offset = 1; // Offset into packed memory for the value + uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional - Kind kind = 4; // The kind of metric - optional string unit = 5; // Unit of measurement - optional uint32 min = 6; // Minimum allowable value - optional uint32 max = 7; // Maximum allowable value + Kind kind = 3; // The kind of metric + optional string unit = 4; // Unit of measurement + optional uint32 min = 5; // Minimum allowable value + optional uint32 max = 6; // Maximum allowable value } // Metadata for signed 32-bit metrics message Int32Metric { - uint32 offset = 1; // Offset into packed memory for the value + uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional - Kind kind = 4; // The kind of metric - optional string unit = 5; // Unit of measurement - optional int32 min = 6; // Minimum allowable value - optional int32 max = 7; // Maximum allowable value + Kind kind = 3; // The kind of metric + optional string unit = 4; // Unit of measurement + optional int32 min = 5; // Minimum allowable value + optional int32 max = 6; // Maximum allowable value } // Metadata for 64-bit floating-point metrics message Float64Metric { - uint32 offset = 1; // Offset into packed memory for the value + uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional - Kind kind = 4; // The kind of metric - optional string unit = 5; // Unit of measurement - optional double min = 6; // Minimum allowable value - optional double max = 7; // Maximum allowable value + Kind kind = 3; // The kind of metric + optional string unit = 4; // Unit of measurement + optional double min = 5; // Minimum allowable value + optional double max = 6; // Maximum allowable value } // Metadata for 32-bit floating-point metrics message Float32Metric { - uint32 offset = 1; // Offset into packed memory for the value + uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional - Kind kind = 4; // The kind of metric - optional string unit = 5; // Unit of measurement - optional float min = 6; // Minimum allowable value - optional float max = 7; // Maximum allowable value + Kind kind = 3; // The kind of metric + optional string unit = 4; // Unit of measurement + optional float min = 5; // Minimum allowable value + optional float max = 6; // Maximum allowable value } // Metadata for boolean metrics message BoolMetric { uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional - optional string unit = 4; // Unit of measurement + optional string unit = 3; // Unit of measurement } // Metadata for enumerated metrics @@ -95,7 +88,6 @@ message Enum8Metric { } uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - bool optional = 3; // Whether the metric is optional map values = 4; // Mapping from packed index to enum info optional string unit = 5; // Unit of measurement } @@ -106,12 +98,8 @@ message Constant{ oneof value { uint64 uint64 = 1; // Unsigned 64-bit constant value int64 int64 = 2; // Signed 64-bit constant value - uint32 uint32 = 3; // Unsigned 32-bit constant value - int32 int32 = 4; // Signed 32-bit constant value - float float32 = 5; // 32-bit floating-point constant value double float64 = 6; // 64-bit floating-point constant value bool boolean = 7; // Boolean constant value - uint32 enum8 = 8; // Enumerated constant value string string = 9; // String constant value } string description = 10; // Metric description diff --git a/src/abacus/availability.hpp b/src/abacus/availability.hpp deleted file mode 100644 index a1a6bf53..00000000 --- a/src/abacus/availability.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include - -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -/// A tag type representing a required availability. -struct required_ -{ -}; - -/// A constant instance of the required_ tag type. -static const required_ required; - -/// A tag type representing an optional availability. -struct optional_ -{ -}; - -/// A constant instance of the optional_ tag type. -static const optional_ optional; - -/// A variant type that can hold either a required_ or an optional_. -using availability = std::variant; - -/// Check if the given availability is optional. -/// @param a The availability to check. -/// @return true if the availability is optional, false otherwise. -static inline bool is_optional(const availability& a) -{ - return std::holds_alternative(a); -} - -/// Check if the given availability is required. -/// @param a The availability to check. -/// @return true if the availability is required, false otherwise. -static inline bool is_required(const availability& a) -{ - return std::holds_alternative(a); -} -} -} diff --git a/src/abacus/boolean.hpp b/src/abacus/boolean.hpp index 3aed333e..30ee7b61 100644 --- a/src/abacus/boolean.hpp +++ b/src/abacus/boolean.hpp @@ -10,11 +10,8 @@ #include #include -#include "availability.hpp" #include "description.hpp" #include "kind.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" namespace abacus { @@ -26,36 +23,8 @@ struct boolean /// The primitive type of the metric using type = bool; - /// Required boolean metric - using required = required_metric; - - /// Optional boolean metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - memory[0] = 1; - memory[1] = value; - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - return memory[1]; - } - - /// The availability of the metric - abacus::availability availability; + /// Ensure this is a 1 bit type + static_assert(sizeof(bool) == 1, "bool must be 8 bits"); /// The description of the metric abacus::description description; diff --git a/src/abacus/constant.hpp b/src/abacus/constant.hpp index 7cdb1556..ca3aaad8 100644 --- a/src/abacus/constant.hpp +++ b/src/abacus/constant.hpp @@ -9,45 +9,46 @@ #include "unit.hpp" #include "version.hpp" -#include "boolean.hpp" -#include "enum8.hpp" -#include "float32.hpp" -#include "float64.hpp" -#include "int32.hpp" -#include "int64.hpp" -#include "uint32.hpp" -#include "uint64.hpp" - namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -template -struct value +/// Tag type representing a constant kind. +struct constant { - // The value of the constant - T value; -}; -// Enable class template argument deduction (CTAD) -template -value(T) -> value; + struct int64 + { + int64_t value; + }; -// Special deduction guide for string literals to deduce std::string -value(const char*) -> value; + struct uint64 + { + uint64_t value; + }; + + struct boolean + { + bool value; + }; + + struct float64 + { + double value; + }; + + struct str + { + std::string value; + }; -/// Tag type representing a constant kind. -struct constant -{ // The value of the constant - std::variant, abacus::value, - abacus::value, abacus::value, - abacus::value, abacus::value, - abacus::value, abacus::value> - value; + std::variant value; + // The description of the constant abacus::description description; + // The unit of the constant abacus::unit unit{}; }; diff --git a/src/abacus/detail/has_arithmetic_operators.hpp b/src/abacus/detail/has_arithmetic_operators.hpp deleted file mode 100644 index 56440635..00000000 --- a/src/abacus/detail/has_arithmetic_operators.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include - -#include "../version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -struct boolean; -struct enum8; -namespace detail -{ -/// Check if a metric supports arithmetic operators -template -struct has_arithmetic_operators : std::true_type -{ -}; - -template <> -struct has_arithmetic_operators : std::false_type -{ -}; - -template <> -struct has_arithmetic_operators : std::false_type -{ -}; - -} -} -} diff --git a/src/abacus/detail/overload.hpp b/src/abacus/detail/overload.hpp new file mode 100644 index 00000000..34b77c28 --- /dev/null +++ b/src/abacus/detail/overload.hpp @@ -0,0 +1,29 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include + +#include "../version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ +namespace detail +{ +// Variant overload visit helper +template +struct overload : Ts... +{ + using Ts::operator()...; +}; +template +overload(Ts...) -> overload; +} +} +} diff --git a/src/abacus/detail/size_of_type.hpp b/src/abacus/detail/size_of_type.hpp deleted file mode 100644 index 595f0ed6..00000000 --- a/src/abacus/detail/size_of_type.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include - -#include "../version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -namespace detail -{ -/// Get the size of the primitive backing type of a metric -/// @tparam Metric The metric to get the size of -/// @return The size of the primitive backing type of the metric -template -constexpr static auto size_of_type() -> std::size_t -{ - return sizeof(typename std::remove_pointer::type::type); -} -} -} -} diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index d9d25cc2..bcf2240c 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -11,10 +11,7 @@ #include #include -#include "availability.hpp" #include "description.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -24,64 +21,23 @@ inline namespace STEINWURF_ABACUS_VERSION /// A enumeration metric struct enum8 { - /// The primitive type of the metric - using type = uint8_t; - - /// Required enum8 metric - using required = required_metric; - - /// Optional enum8 metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - template - static inline auto set_value(uint8_t* memory, T value) -> void + struct enum_value { - static_assert(std::is_enum_v, "T must be an enum"); - static_assert(sizeof(std::underlying_type_t) == sizeof(type), - "The underlying type of the enum must match the type"); - assert(memory != nullptr); - memory[1] = (std::underlying_type_t)value; - } + template + enum_value(T v) : value(static_cast(v)) + { + } - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - memory[1] = value; - } + auto operator<(const enum_value& other) const -> bool + { + return value < other.value; + } - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - return memory[1]; - } + uint8_t value; + }; - /// Get the enumeration value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The enumeration value of the metric - template - static inline auto value(const uint8_t* memory) -> T - { - static_assert(std::is_enum_v, "T must be an enum"); - static_assert(sizeof(std::underlying_type_t) == sizeof(type), - "The underlying type of the enum must match the type"); - assert(memory != nullptr); - assert(memory[0] == 1); - return (T)memory[1]; - } + /// The primitive type of the metric + using type = uint8_t; /// The enumeration value type struct value_info @@ -93,14 +49,11 @@ struct enum8 std::string description; }; - /// The availability of the metric - abacus::availability availability; - /// The metric description abacus::description description; /// The enumeration value information - std::map values; + std::map values; /// The unit of the metric abacus::unit unit{}; diff --git a/src/abacus/float32.hpp b/src/abacus/float32.hpp index fd69461e..297cdcd3 100644 --- a/src/abacus/float32.hpp +++ b/src/abacus/float32.hpp @@ -7,13 +7,10 @@ #include -#include "availability.hpp" #include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -23,48 +20,15 @@ inline namespace STEINWURF_ABACUS_VERSION /// A 32-bit floating point metric struct float32 { + /// Ensure this is a 32 bit type + static_assert(sizeof(float) == 4, "double must be 32 bits"); + /// The primitive type of the metric using type = float; - /// Required float32 metric - using required = required_metric; - - /// Optional float32 metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - - std::memcpy(memory + 1, &value, sizeof(type)); - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - type value; - std::memcpy(&value, memory + 1, sizeof(type)); - return value; - } - /// The metric kind abacus::kind kind; - /// The availability of the metric - abacus::availability availability; - /// The metric description abacus::description description; diff --git a/src/abacus/float64.hpp b/src/abacus/float64.hpp index 1703a9e7..737d3cf2 100644 --- a/src/abacus/float64.hpp +++ b/src/abacus/float64.hpp @@ -5,64 +5,28 @@ #pragma once -#include "availability.hpp" #include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -/// A 32-bit floating point metric +/// A 64-bit floating point metric struct float64 { + /// Ensure this is a 64 bit type + static_assert(sizeof(double) == 8, "double must be 64 bits"); + /// The primitive type of the metric using type = double; - /// Required float64 metric - using required = required_metric; - - /// Optional float64 metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - - assert(!std::isnan(value) && "Cannot assign a NaN"); - assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); - - std::memcpy(memory + 1, &value, sizeof(type)); - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - type value; - std::memcpy(&value, memory + 1, sizeof(type)); - return value; - } - /// The metric kind abacus::kind kind; - /// The availability of the metric - abacus::availability availability; - /// The metric description abacus::description description; diff --git a/src/abacus/int32.hpp b/src/abacus/int32.hpp index 63a80e6f..ef99ddce 100644 --- a/src/abacus/int32.hpp +++ b/src/abacus/int32.hpp @@ -5,13 +5,10 @@ #pragma once -#include "availability.hpp" #include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -24,41 +21,9 @@ struct int32 /// The primitive type of the metric using type = int32_t; - /// Required int32 metric - using required = required_metric; - - /// Optional int32 metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - std::memcpy(memory + 1, &value, sizeof(type)); - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - type value; - std::memcpy(&value, memory + 1, sizeof(type)); - return value; - } - /// The metric kind abacus::kind kind; - /// The availability of the metric - abacus::availability availability; - /// The metric description abacus::description description; diff --git a/src/abacus/int64.hpp b/src/abacus/int64.hpp index 59c86c12..7244894b 100644 --- a/src/abacus/int64.hpp +++ b/src/abacus/int64.hpp @@ -5,13 +5,10 @@ #pragma once -#include "availability.hpp" #include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -24,41 +21,9 @@ struct int64 /// The primitive type of the metric using type = int64_t; - /// Required int64 metric - using required = required_metric; - - /// Optional int64 metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - std::memcpy(memory + 1, &value, sizeof(type)); - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - type value; - std::memcpy(&value, memory + 1, sizeof(type)); - return value; - } - /// The metric kind abacus::kind kind; - /// The availability of the metric - abacus::availability availability; - /// The metric description abacus::description description; diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index 66cedb2e..a1037703 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -12,42 +12,12 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -/// A tag type representing a gauge kind. -struct gauge_ -{ - static constexpr abacus::protobuf::Kind kind = abacus::protobuf::GAUGE; -}; - -/// A constant instance of the gauge_ tag type. -static const gauge_ gauge; -/// A tag type representing an counter kind. -struct counter_ +enum class kind { - static constexpr abacus::protobuf::Kind kind = abacus::protobuf::COUNTER; + gauge = abacus::protobuf::GAUGE, + counter = abacus::protobuf::COUNTER }; -/// A constant instance of the counter_ tag type. -static const counter_ counter; - -/// A variant type that can hold either a gauge_ or an counter_. -using kind = std::variant; - -/// Check if the given kind is counter. -/// @param k The kind to check. -/// @return true if the kind is counter, false otherwise. -static inline bool is_counter(const kind& k) -{ - return std::holds_alternative(k); -} - -/// Check if the given kind is gauge. -/// @param a The kind to check. -/// @return true if the kind is gauge, false otherwise. -static inline bool is_gauge(const kind& k) -{ - return std::holds_alternative(k); -} - } } diff --git a/src/abacus/metric.hpp b/src/abacus/metric.hpp new file mode 100644 index 00000000..2cec656c --- /dev/null +++ b/src/abacus/metric.hpp @@ -0,0 +1,304 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include +#include +#include +#include + +#include "boolean.hpp" +#include "enum8.hpp" +#include "float32.hpp" +#include "float64.hpp" +#include "int32.hpp" +#include "int64.hpp" +#include "uint32.hpp" +#include "uint64.hpp" +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +/// An optional metric class for most metrics +template +struct metric +{ + using value_type = typename Metric::type; + + /// Default constructor + metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(value_type) + 1 bytes long. + /// @param value The initial value of the metric + metric(uint8_t* memory) + { + assert(memory != nullptr); + m_memory = memory; + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> value_type + { + assert(has_value()); + value_type value; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); + return value; + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(value_type value) -> metric& + { + assert(is_initialized()); + + if constexpr (std::is_floating_point_v) + { + assert(!std::isnan(value) && "Cannot assign a NaN"); + assert(!std::isinf(value) && "Cannot assign an Inf/-Inf value"); + } + + m_memory[0] = 1; + std::memcpy(&value, m_memory + 1, sizeof(value_type)); + + return *this; + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(value_type value) -> metric& + { + return set_value(value); + } + + /// Reset the metric. This will cause the metric to not have a value + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + +public: + /// Arithmetic operators + + /// Increment the metric + /// @param increment The value to add + /// @return The result of the arithmetic + auto operator+=(value_type increment) -> metric& + { + set_value(value() + increment); + return *this; + } + + /// Decrement the metric + /// @param decrement The value to subtract + /// @return The result of the arithmetic + auto operator-=(value_type decrement) -> metric& + { + set_value(value() - decrement); + return *this; + } + + /// Increment the value of the metric + /// @return The result of the arithmetic + auto operator++() -> metric& + { + set_value(value() + 1); + return *this; + } + + /// Decrement the value of the metric + /// @return The result of the arithmetic + auto operator--() -> metric& + { + set_value(value() - 1); + return *this; + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; + +/// Enum specializations +template <> +struct metric +{ + /// Default constructor + metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(value_type) + 1 bytes long. + /// @param value The initial value of the metric + metric(uint8_t* memory) + { + assert(memory != nullptr); + m_memory = memory; + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1; + } + + /// The the value as a specific enum type + /// @return The value of the metric as the enum type + template + auto value() const -> T + { + static_assert(std::is_enum_v); + + assert(has_value()); + + return static_cast(m_memory[1]); + } + + /// Assign a new value to the metric + /// @param value The value to assign + template + auto set_value(T value) -> metric& + { + // @todo enable again + // static_assert(std::is_enum_v); + + assert(static_cast(value) <= + std::numeric_limits::max() && + "The value is too large to fit in the enum"); + assert(static_cast(value) >= + std::numeric_limits::min() && + "The value is too small to fit in the enum"); + + assert(is_initialized()); + + m_memory[0] = 1; + m_memory[1] = static_cast(value); + + return *this; + } + + /// Assign the metric a new value + template + auto operator=(T value) -> metric& + { + return set_value(value); + } + + /// Reset the metric. This will cause the metric to not have a value + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + +protected: + /// The metric memory + uint8_t* m_memory = nullptr; +}; + +/// Boolean specializations +template <> +struct metric +{ + /// Default constructor + metric() = default; + + /// Constructor + /// @param memory The memory to use for the metric, note that the memory + /// must be at least sizeof(value_type) + 1 bytes long. + /// @param value The initial value of the metric + metric(uint8_t* memory) + { + assert(memory != nullptr); + m_memory = memory; + } + + /// Check if the metric is initialized + /// @return true if the metric is initialized + auto is_initialized() const -> bool + { + return m_memory != nullptr; + } + + /// Check if the metric has a value + /// @return true if the metric has a value + auto has_value() const -> bool + { + assert(is_initialized()); + return m_memory[0] == 1; + } + + /// Get the value of the metric + /// @return The value of the metric + auto value() const -> bool + { + assert(has_value()); + return static_cast(m_memory[1]); + } + + /// Assign a new value to the metric + /// @param value The value to assign + auto set_value(bool value) -> metric& + { + assert(is_initialized()); + m_memory[0] = 1; + m_memory[1] = static_cast(value); + + return *this; + } + + /// Assign the metric a new value + /// @param value The value to assign + /// @return the metric with the new value + auto operator=(bool value) -> metric& + { + return set_value(value); + } + + /// Reset the metric. This will cause the metric to not have a value + auto reset() -> void + { + assert(is_initialized()); + m_memory[0] = 0; + } + +private: + /// The metric memory + uint8_t* m_memory = nullptr; +}; +} +} diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 9c7090fc..1cd1d9af 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -6,13 +6,13 @@ #include "metrics.hpp" #include "detail/hash_function.hpp" -#include "detail/size_of_type.hpp" #include "info.hpp" #include "protocol_version.hpp" #include "version.hpp" #include "detail/helpers.hpp" +#include "detail/overload.hpp" #include "protobuf/metrics.pb.h" #include @@ -24,29 +24,19 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -static inline auto is_optional(const protobuf::Metric& metric) -> bool -{ - return detail::call_type(metric, [](const auto& metric) - { return metric.optional(); }); -} - -static inline auto get_kind(abacus::kind k) -> protobuf::Kind -{ - return std::visit([](auto&& k) { return k.kind; }, k); -} - metrics::metrics(metrics&& other) noexcept : m_metadata(std::move(other.m_metadata)), m_data(std::move(other.m_data)), m_metadata_bytes(other.m_metadata_bytes), m_hash(other.m_hash), - m_value_bytes(other.m_value_bytes), - m_initialized(std::move(other.m_initialized)) + m_value_bytes(other.m_value_bytes), m_offsets(std::move(other.m_offsets)), + m_resets(std::move(other.m_resets)) { other.m_metadata = protobuf::MetricsMetadata(); other.m_data.clear(); other.m_metadata_bytes = 0; other.m_hash = 0; other.m_value_bytes = 0; - other.m_initialized.clear(); + other.m_offsets.clear(); + other.m_resets.clear(); } metrics::metrics(const std::map& infos) @@ -63,262 +53,230 @@ metrics::metrics(const std::map& infos) for (auto [name, info] : infos) { protobuf::Metric metric; - m_initialized[name.value] = false; - if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_uint64(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(get_kind(m->kind)); - - if (!m->unit.empty()) - { - typed_metric->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - typed_metric->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - typed_metric->set_max(m->max.value.value()); - } - // The offset is incremented by the size of the type - m_value_bytes += detail::size_of_type(); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_int64(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(get_kind(m->kind)); - - if (!m->unit.empty()) - { - typed_metric->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - typed_metric->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - typed_metric->set_max(m->max.value.value()); - } - // The offset is incremented by the size of the type - m_value_bytes += detail::size_of_type(); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_uint32(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(get_kind(m->kind)); - - if (!m->unit.empty()) - { - typed_metric->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - typed_metric->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - typed_metric->set_max(m->max.value.value()); - } - // The offset is incremented by the size of the type - m_value_bytes += detail::size_of_type(); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_int32(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(get_kind(m->kind)); - - if (!m->unit.empty()) - { - typed_metric->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - typed_metric->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - typed_metric->set_max(m->max.value.value()); - } - // The offset is incremented by the size of the type - m_value_bytes += detail::size_of_type(); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_float64(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(get_kind(m->kind)); - - if (!m->unit.empty()) - { - typed_metric->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - typed_metric->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - typed_metric->set_max(m->max.value.value()); - } - // The offset is incremented by the size of the type - m_value_bytes += detail::size_of_type(); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_float32(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - typed_metric->set_kind(get_kind(m->kind)); - - if (!m->unit.empty()) - { - typed_metric->set_unit(m->unit.value); - } - if (m->min.value.has_value()) - { - typed_metric->set_min(m->min.value.value()); - } - if (m->max.value.has_value()) - { - typed_metric->set_max(m->max.value.value()); - } - // The offset is incremented by the size of the type - m_value_bytes += detail::size_of_type(); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_boolean(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - m_value_bytes += detail::size_of_type(); - - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_enum8(); - typed_metric->set_offset(m_value_bytes); - typed_metric->set_description(m->description.value); - typed_metric->set_optional(is_optional(m->availability)); - for (auto [key, value] : m->values) - { - auto enum_value = protobuf::Enum8Metric::EnumValue(); - enum_value.set_name(value.name); - if (!value.description.empty()) + + // Save the offset of the metric + m_offsets.emplace(name.value, m_value_bytes); + + std::visit( + detail::overload{ + [&](const uint64& m) { - enum_value.set_description(value.description); - } + auto* typed_metric = metric.mutable_uint64(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + typed_metric->set_kind(static_cast(m.kind)); - typed_metric->mutable_values()->insert({key, enum_value}); - } - m_value_bytes += detail::size_of_type(); + if (!m.unit.empty()) + { + typed_metric->set_unit(m.unit.value); + } + if (m.min.value.has_value()) + { + typed_metric->set_min(m.min.value.value()); + } + if (m.max.value.has_value()) + { + typed_metric->set_max(m.max.value.value()); + } + // The offset is incremented by the size of the type + m_value_bytes += sizeof(uint64::type); - // The offset is incremented by one byte which represents - // whether the metric is set or not. - m_value_bytes += 1; - } - else if (auto* m = std::get_if(&info)) - { - auto* typed_metric = metric.mutable_constant(); - typed_metric->set_description(m->description.value); - if (!m->unit.empty()) - { - typed_metric->set_unit(m->unit.value); - } - // We expect the metric to be a constant - std::visit( - [&typed_metric](auto&& value) + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; + }, + [&](const int64& m) { - using Type = decltype(value.value); - if constexpr (std::is_same_v) + auto* typed_metric = metric.mutable_int64(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + typed_metric->set_kind(static_cast(m.kind)); + + if (!m.unit.empty()) { - typed_metric->set_uint64(value.value); - return; + typed_metric->set_unit(m.unit.value); } - if constexpr (std::is_same_v) + if (m.min.value.has_value()) { - typed_metric->set_int64(value.value); - return; + typed_metric->set_min(m.min.value.value()); } - if constexpr (std::is_same_v) + if (m.max.value.has_value()) { - typed_metric->set_uint32(value.value); - return; + typed_metric->set_max(m.max.value.value()); } - if constexpr (std::is_same_v) + // The offset is incremented by the size of the type + m_value_bytes += sizeof(int64::type); + + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; + }, + [&](const uint32& m) + { + auto* typed_metric = metric.mutable_uint32(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + typed_metric->set_kind(static_cast(m.kind)); + + if (!m.unit.empty()) { - typed_metric->set_int32(value.value); - return; + typed_metric->set_unit(m.unit.value); } - if constexpr (std::is_same_v) + if (m.min.value.has_value()) { - typed_metric->set_float64(value.value); - return; + typed_metric->set_min(m.min.value.value()); } - if constexpr (std::is_same_v) + if (m.max.value.has_value()) { - typed_metric->set_float32(value.value); - return; + typed_metric->set_max(m.max.value.value()); } - if constexpr (std::is_same_v) + // The offset is incremented by the size of the type + m_value_bytes += sizeof(uint32::type); + + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; + }, + [&](const int32& m) + { + auto* typed_metric = metric.mutable_int32(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + typed_metric->set_kind(static_cast(m.kind)); + + if (!m.unit.empty()) + { + typed_metric->set_unit(m.unit.value); + } + if (m.min.value.has_value()) { - typed_metric->set_boolean(value.value); - return; + typed_metric->set_min(m.min.value.value()); } - if constexpr (std::is_same_v) + if (m.max.value.has_value()) { - typed_metric->set_string(value.value); - return; + typed_metric->set_max(m.max.value.value()); } - assert(false && "Unknown type"); + // The offset is incremented by the size of the type + m_value_bytes += sizeof(int32::type); + + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; }, - m->value); - m_initialized[name.value] = true; - } + [&](const float64& m) + { + auto* typed_metric = metric.mutable_float64(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + typed_metric->set_kind(static_cast(m.kind)); + + if (!m.unit.empty()) + { + typed_metric->set_unit(m.unit.value); + } + if (m.min.value.has_value()) + { + typed_metric->set_min(m.min.value.value()); + } + if (m.max.value.has_value()) + { + typed_metric->set_max(m.max.value.value()); + } + // The offset is incremented by the size of the type + m_value_bytes += sizeof(float64::type); + + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; + }, + [&](const float32& m) + { + auto* typed_metric = metric.mutable_float32(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + typed_metric->set_kind(static_cast(m.kind)); + + if (!m.unit.empty()) + { + typed_metric->set_unit(m.unit.value); + } + if (m.min.value.has_value()) + { + typed_metric->set_min(m.min.value.value()); + } + if (m.max.value.has_value()) + { + typed_metric->set_max(m.max.value.value()); + } + // The offset is incremented by the size of the type + m_value_bytes += sizeof(float32::type); + + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; + }, + [&](const boolean& m) + { + auto* typed_metric = metric.mutable_boolean(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + m_value_bytes += sizeof(boolean::type); + + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; + }, + [&](const enum8& m) + { + auto* typed_metric = metric.mutable_enum8(); + typed_metric->set_offset(m_value_bytes); + typed_metric->set_description(m.description.value); + for (auto [key, value] : m.values) + { + auto enum_value = protobuf::Enum8Metric::EnumValue(); + enum_value.set_name(value.name); + if (!value.description.empty()) + { + enum_value.set_description(value.description); + } + + typed_metric->mutable_values()->insert( + {key.value, enum_value}); + } + m_value_bytes += sizeof(enum8::type); + + // The offset is incremented by one byte which + // represents whether the metric is set or not. + m_value_bytes += 1; + }, + [&](const constant& m) + { + auto* typed_metric = metric.mutable_constant(); + typed_metric->set_description(m.description.value); + if (!m.unit.empty()) + { + typed_metric->set_unit(m.unit.value); + } + // We expect the metric to be a constant + std::visit( + detail::overload{ + [typed_metric](constant::uint64 c) + { typed_metric->set_uint64(c.value); }, + [typed_metric](constant::int64 c) + { typed_metric->set_int64(c.value); }, + [typed_metric](constant::float64 c) + { typed_metric->set_float64(c.value); }, + [typed_metric](constant::str c) + { typed_metric->set_string(c.value); }, + [typed_metric](constant::boolean c) + { typed_metric->set_boolean(c.value); }, + [](const auto&) + { assert(false && "Unsupported constant type"); }}, + m.value); + }, + [&](const auto&) + { assert(false && "Unsupported metric type"); }}, + info); m_metadata.mutable_metrics()->insert({name.value, metric}); } @@ -350,99 +308,53 @@ metrics::metrics(const std::map& infos) // will be written as the endianess of the system) Consuming code // can use the endianness field in the metadata to read the sync // value - std::memcpy(value_data(0), &m_hash, sizeof(uint32_t)); + std::memcpy(m_data.data() + m_metadata_bytes, &m_hash, sizeof(uint32_t)); } template -[[nodiscard]] auto metrics::initialize_optional(const std::string& name) -> - typename Metric::optional +[[nodiscard]] auto +metrics::initialize(const std::string& name) -> metric { - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - const protobuf::Metric& proto_metric = metadata().metrics().at(name); - assert(is_optional(proto_metric)); + assert(m_resets.find(name) == m_resets.end()); + assert(m_offsets.find(name) != m_offsets.end()); - auto offset = detail::get_offset(proto_metric); + std::size_t offset = m_offsets.at(name); + metric m(m_data.data() + m_metadata_bytes + offset); - return {value_data(offset)}; + m_resets[name] = [m]() mutable { m.reset(); }; + return m; } // Explicit instantiations for the expected types -template auto metrics::initialize_optional(const std::string& name) - -> uint64::optional; -template auto metrics::initialize_optional(const std::string& name) - -> int64::optional; -template auto metrics::initialize_optional(const std::string& name) - -> uint32::optional; -template auto metrics::initialize_optional(const std::string& name) - -> int32::optional; -template auto metrics::initialize_optional(const std::string& name) - -> float64::optional; -template auto metrics::initialize_optional(const std::string& name) - -> float32::optional; -template auto metrics::initialize_optional(const std::string& name) - -> boolean::optional; -template auto metrics::initialize_optional(const std::string& name) - -> enum8::optional; +template auto +metrics::initialize(const std::string& name) -> metric; -template -[[nodiscard]] auto metrics::initialize_required(const std::string& name, - typename Metric::type value) -> - typename Metric::required -{ - assert(m_initialized.find(name) != m_initialized.end()); - assert(!m_initialized.at(name)); - m_initialized[name] = true; - const protobuf::Metric& proto_metric = metadata().metrics().at(name); - assert(!is_optional(proto_metric)); +template auto +metrics::initialize(const std::string& name) -> metric; - auto offset = detail::get_offset(proto_metric); +template auto +metrics::initialize(const std::string& name) -> metric; - m_initial_values[name] = value; - return {value_data(offset), value}; -} +template auto +metrics::initialize(const std::string& name) -> metric; -// Explicit instantiations for the expected types -template auto metrics::initialize_required(const std::string& name, - uint64::type value) - -> uint64::required; -template auto metrics::initialize_required(const std::string& name, - int64::type value) - -> int64::required; -template auto metrics::initialize_required(const std::string& name, - uint32::type value) - -> uint32::required; -template auto metrics::initialize_required(const std::string& name, - int32::type value) - -> int32::required; -template auto metrics::initialize_required(const std::string& name, - float64::type value) - -> float64::required; -template auto metrics::initialize_required(const std::string& name, - float32::type value) - -> float32::required; -template auto metrics::initialize_required(const std::string& name, - boolean::type value) - -> boolean::required; -template auto metrics::initialize_required(const std::string& name, - enum8::type value) - -> enum8::required; - -metrics::~metrics() -{ -} +template auto +metrics::initialize(const std::string& name) -> metric; + +template auto +metrics::initialize(const std::string& name) -> metric; + +template auto +metrics::initialize(const std::string& name) -> metric; + +template auto +metrics::initialize(const std::string& name) -> metric; auto metrics::value_data() const -> const uint8_t* { return m_data.data() + m_metadata_bytes; } -auto metrics::value_data(std::size_t offset) -> uint8_t* -{ - return m_data.data() + m_metadata_bytes + offset; -} - auto metrics::value_bytes() const -> std::size_t { return m_value_bytes; @@ -465,94 +377,28 @@ auto metrics::metadata_bytes() const -> std::size_t auto metrics::is_initialized(const std::string& name) const -> bool { - assert(m_initialized.find(name) != m_initialized.end()); - return m_initialized.at(name); + return m_resets.find(name) != m_resets.end(); } auto metrics::is_initialized() const -> bool { - for (auto [name, initialized] : m_initialized) + for (const auto& [name, offset] : m_offsets) { - if (!initialized) + (void)offset; + if (!is_initialized(name)) { return false; } } return true; } + auto metrics::reset() -> void { - for (const auto& [name, metric] : metadata().metrics()) + for (const auto& [name, reset] : m_resets) { - if (metric.has_constant()) - { - continue; - } - - if (!is_initialized(name)) - { - // Skip metrics that have not been initialized - continue; - } - - auto offset = detail::get_offset(metric); - if (is_optional(metric)) - { - // Set the has value byte to 0 - value_data(offset)[0] = 0; - } - else - { - // Set the value to what it was initialized to - if (metric.has_uint64()) - { - uint64::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - else if (metric.has_int64()) - { - int64::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - else if (metric.has_uint32()) - { - uint32::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - else if (metric.has_int32()) - { - int32::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - else if (metric.has_float64()) - { - float64::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - else if (metric.has_float32()) - { - float32::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - else if (metric.has_boolean()) - { - boolean::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - else if (metric.has_enum8()) - { - enum8::set_value( - value_data(offset), - std::any_cast(m_initial_values.at(name))); - } - } + (void)name; + reset(); } } } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index d163a769..fdec979d 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -15,9 +15,8 @@ #include "name.hpp" #include "version.hpp" -#include "optional_metric.hpp" +#include "metric.hpp" #include "protobuf/metrics.pb.h" -#include "required_metric.hpp" namespace abacus { @@ -40,24 +39,11 @@ class metrics /// @param info The info of the metrics to create. metrics(const std::map& info); - /// Destructor - ~metrics(); - - /// Initialize a required metric - /// @param name The name of the metric - /// @param value Optional initial value of the metric - /// @return The metric object - template - [[nodiscard]] auto initialize_required(const std::string& name, - typename Metric::type value) -> - typename Metric::required; - /// Initialize a metric /// @param name The name of the metric /// @return The metric object template - [[nodiscard]] auto initialize_optional(const std::string& name) -> - typename Metric::optional; + [[nodiscard]] auto initialize(const std::string& name) -> metric; /// Check if a metric has been initialized /// @param name The name of the metric @@ -88,10 +74,6 @@ class metrics auto metadata() const -> const protobuf::MetricsMetadata&; private: - /// @param offset The offset of the value data - /// @return the pointer to the value data of the metrics. - auto value_data(std::size_t offset) -> uint8_t*; - /// No copy metrics(metrics&) = delete; @@ -114,11 +96,11 @@ class metrics /// The size of the value data in bytes std::size_t m_value_bytes; - /// A map of the metrics and whether they have been initialized - std::map m_initialized; + /// Map to offset + std::unordered_map m_offsets; - /// The initial values of the metrics - std::map m_initial_values; + /// Map to reset functions - only initialized metrics can be reset + std::unordered_map> m_resets; }; } } diff --git a/src/abacus/optional_metric.hpp b/src/abacus/optional_metric.hpp deleted file mode 100644 index aaadee3a..00000000 --- a/src/abacus/optional_metric.hpp +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include - -#include "detail/has_arithmetic_operators.hpp" - -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -/// An optional metric class for most metrics -template -struct optional_metric -{ - using value_type = typename Metric::type; - - /// Default constructor - optional_metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(value_type) + 1 bytes long. - /// @param value The initial value of the metric - optional_metric(uint8_t* memory) - { - assert(memory != nullptr); - m_memory = memory; - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Check if the metric has a value - /// @return true if the metric has a value - auto has_value() const -> bool - { - assert(is_initialized()); - return m_memory[0] == 1; - } - - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> value_type - { - assert(has_value()); - return Metric::value(m_memory); - } - - /// Assign a new value to the metric - /// @param value The value to assign - auto set_value(value_type value) -> void - { - assert(is_initialized()); - m_memory[0] = 1; - Metric::set_value(m_memory, value); - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - auto operator=(value_type value) -> optional_metric& - { - set_value(value); - return *this; - } - - /// Reset the metric. This will cause the metric to not have a value - auto reset() -> void - { - assert(is_initialized()); - m_memory[0] = 0; - } - -public: - /// Arithmetic operators - - /// Increment the metric - /// @param increment The value to add - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator+=(value_type increment) -> optional_metric& - { - assert(has_value()); - Metric::set_value(m_memory, value() + increment); - return *this; - } - - /// Decrement the metric - /// @param decrement The value to subtract - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator-=(value_type decrement) -> optional_metric& - { - assert(has_value()); - Metric::set_value(m_memory, value() - decrement); - return *this; - } - - /// Increment the value of the metric - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator++() -> optional_metric& - { - assert(has_value()); - Metric::set_value(m_memory, value() + 1); - return *this; - } - - /// Decrement the value of the metric - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator--() -> optional_metric& - { - assert(has_value()); - Metric::set_value(m_memory, value() - 1); - return *this; - } - -public: - /// Enum specializations - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - template && - std::is_same_v>> - auto operator=(T value) -> optional_metric& - { - set_value(value); - return *this; - } - - /// Assign a new value to the metric - /// @param value The value to assign - template && - std::is_same_v>> - auto set_value(T value) -> void - { - assert(is_initialized()); - assert((std::underlying_type_t)value <= - std::numeric_limits::max()); - - set_value(static_cast(value)); - } - -protected: - /// The metric memory - uint8_t* m_memory = nullptr; -}; -} -} diff --git a/src/abacus/parse.hpp b/src/abacus/parse.hpp deleted file mode 100644 index 8b597eb7..00000000 --- a/src/abacus/parse.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include - -#include "protobuf/metrics.pb.h" -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -struct parse -{ -private: - /// Private constructor to prevent instantiation of this class - parse() = delete; - -public: - /// @param metadata_data The meta data pointer - /// @param metadata_bytes The meta data size in bytes - static auto metadata(const uint8_t* metadata_data, - std::size_t metadata_bytes) - -> std::optional; -}; -} -} diff --git a/src/abacus/parse.cpp b/src/abacus/parse_metadata.cpp similarity index 83% rename from src/abacus/parse.cpp rename to src/abacus/parse_metadata.cpp index 3cabe0b0..57c99d2c 100644 --- a/src/abacus/parse.cpp +++ b/src/abacus/parse_metadata.cpp @@ -3,7 +3,7 @@ // // Distributed under the "BSD License". See the accompanying LICENSE.rst file. -#include "parse.hpp" +#include "parse_metadata.hpp" #include #include @@ -12,7 +12,7 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -auto parse::metadata(const uint8_t* metadata_data, std::size_t metadata_bytes) +auto parse_metadata(const uint8_t* metadata_data, std::size_t metadata_bytes) -> std::optional { assert(metadata_data != nullptr); diff --git a/src/abacus/parse_metadata.hpp b/src/abacus/parse_metadata.hpp new file mode 100644 index 00000000..7c9acff8 --- /dev/null +++ b/src/abacus/parse_metadata.hpp @@ -0,0 +1,24 @@ +// Copyright (c) Steinwurf ApS 2020. +// All Rights Reserved +// +// Distributed under the "BSD License". See the accompanying LICENSE.rst file. + +#pragma once + +#include + +#include "protobuf/metrics.pb.h" +#include "version.hpp" + +namespace abacus +{ +inline namespace STEINWURF_ABACUS_VERSION +{ + +/// @param metadata_data The meta data pointer +/// @param metadata_bytes The meta data size in bytes +auto parse_metadata(const uint8_t* metadata_data, std::size_t metadata_bytes) + -> std::optional; + +} +} diff --git a/src/abacus/protobuf/metrics.pb.cc b/src/abacus/protobuf/metrics.pb.cc index ee205267..bc17a080 100644 --- a/src/abacus/protobuf/metrics.pb.cc +++ b/src/abacus/protobuf/metrics.pb.cc @@ -36,10 +36,9 @@ PROTOBUF_CONSTEXPR UInt64Metric::UInt64Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ ::uint64_t{0u}, /*decltype(_impl_.max_)*/ ::uint64_t{0u}, - /*decltype(_impl_.kind_)*/ 0, } {} struct UInt64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR UInt64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -65,10 +64,9 @@ PROTOBUF_CONSTEXPR Int64Metric::Int64Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ ::int64_t{0}, /*decltype(_impl_.max_)*/ ::int64_t{0}, - /*decltype(_impl_.kind_)*/ 0, } {} struct Int64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Int64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -94,7 +92,6 @@ PROTOBUF_CONSTEXPR UInt32Metric::UInt32Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0u, /*decltype(_impl_.max_)*/ 0u, @@ -123,7 +120,6 @@ PROTOBUF_CONSTEXPR Int32Metric::Int32Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, @@ -152,10 +148,9 @@ PROTOBUF_CONSTEXPR Float64Metric::Float64Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, + /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, - /*decltype(_impl_.kind_)*/ 0, } {} struct Float64MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Float64MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -181,7 +176,6 @@ PROTOBUF_CONSTEXPR Float32Metric::Float32Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, /*decltype(_impl_.kind_)*/ 0, /*decltype(_impl_.min_)*/ 0, /*decltype(_impl_.max_)*/ 0, @@ -210,7 +204,6 @@ PROTOBUF_CONSTEXPR BoolMetric::BoolMetric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, } {} struct BoolMetricDefaultTypeInternal { PROTOBUF_CONSTEXPR BoolMetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -273,7 +266,6 @@ PROTOBUF_CONSTEXPR Enum8Metric::Enum8Metric(::_pbi::ConstantInitialized) ::_pbi::ConstantInitialized{}, }, /*decltype(_impl_.offset_)*/ 0u, - /*decltype(_impl_.optional_)*/ false, } {} struct Enum8MetricDefaultTypeInternal { PROTOBUF_CONSTEXPR Enum8MetricDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -377,7 +369,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt64Metric, _impl_.min_), @@ -385,7 +376,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, - ~0u, 0, 1, 2, @@ -399,7 +389,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int64Metric, _impl_.min_), @@ -407,7 +396,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, - ~0u, 0, 1, 2, @@ -421,7 +409,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::UInt32Metric, _impl_.min_), @@ -429,7 +416,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, - ~0u, 0, 1, 2, @@ -443,7 +429,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Int32Metric, _impl_.min_), @@ -451,7 +436,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, - ~0u, 0, 1, 2, @@ -465,7 +449,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float64Metric, _impl_.min_), @@ -473,7 +456,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, - ~0u, 0, 1, 2, @@ -487,7 +469,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.kind_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Float32Metric, _impl_.min_), @@ -495,7 +476,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, - ~0u, 0, 1, 2, @@ -509,11 +489,9 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::BoolMetric, _impl_.unit_), ~0u, ~0u, - ~0u, 0, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric_EnumValue, _internal_metadata_), @@ -549,13 +527,11 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.offset_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.description_), - PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.optional_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.values_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Enum8Metric, _impl_.unit_), ~0u, ~0u, ~0u, - ~0u, 0, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _internal_metadata_), @@ -570,10 +546,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_.description_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_.unit_), PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Constant, _impl_.value_), @@ -583,10 +555,6 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT ~0u, ~0u, ~0u, - ~0u, - ~0u, - ~0u, - ~0u, 0, ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::abacus::protobuf::Metric, _internal_metadata_), @@ -634,20 +602,20 @@ const ::uint32_t TableStruct_abacus_2fprotobuf_2fmetrics_2eproto::offsets[] PROT static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, 15, -1, sizeof(::abacus::protobuf::UInt64Metric)}, - {22, 37, -1, sizeof(::abacus::protobuf::Int64Metric)}, - {44, 59, -1, sizeof(::abacus::protobuf::UInt32Metric)}, - {66, 81, -1, sizeof(::abacus::protobuf::Int32Metric)}, - {88, 103, -1, sizeof(::abacus::protobuf::Float64Metric)}, - {110, 125, -1, sizeof(::abacus::protobuf::Float32Metric)}, - {132, 144, -1, sizeof(::abacus::protobuf::BoolMetric)}, - {148, 158, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, - {160, 170, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, - {172, 185, -1, sizeof(::abacus::protobuf::Enum8Metric)}, - {190, 210, -1, sizeof(::abacus::protobuf::Constant)}, - {221, -1, -1, sizeof(::abacus::protobuf::Metric)}, - {239, 249, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, - {251, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, + {0, 14, -1, sizeof(::abacus::protobuf::UInt64Metric)}, + {20, 34, -1, sizeof(::abacus::protobuf::Int64Metric)}, + {40, 54, -1, sizeof(::abacus::protobuf::UInt32Metric)}, + {60, 74, -1, sizeof(::abacus::protobuf::Int32Metric)}, + {80, 94, -1, sizeof(::abacus::protobuf::Float64Metric)}, + {100, 114, -1, sizeof(::abacus::protobuf::Float32Metric)}, + {120, 131, -1, sizeof(::abacus::protobuf::BoolMetric)}, + {134, 144, -1, sizeof(::abacus::protobuf::Enum8Metric_EnumValue)}, + {146, 156, -1, sizeof(::abacus::protobuf::Enum8Metric_ValuesEntry_DoNotUse)}, + {158, 170, -1, sizeof(::abacus::protobuf::Enum8Metric)}, + {174, 190, -1, sizeof(::abacus::protobuf::Constant)}, + {197, -1, -1, sizeof(::abacus::protobuf::Metric)}, + {215, 225, -1, sizeof(::abacus::protobuf::MetricsMetadata_MetricsEntry_DoNotUse)}, + {227, -1, -1, sizeof(::abacus::protobuf::MetricsMetadata)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -668,77 +636,72 @@ static const ::_pb::Message* const file_default_instances[] = { }; const char descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\035abacus/protobuf/metrics.proto\022\017abacus." - "protobuf\"\272\001\n\014UInt64Metric\022\016\n\006offset\030\001 \001(" - "\r\022\023\n\013description\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010" - "\022#\n\004kind\030\004 \001(\0162\025.abacus.protobuf.Kind\022\021\n" - "\004unit\030\005 \001(\tH\000\210\001\001\022\020\n\003min\030\006 \001(\004H\001\210\001\001\022\020\n\003ma" - "x\030\007 \001(\004H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\271\001" - "\n\013Int64Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descrip" - "tion\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\022#\n\004kind\030\004 \001" - "(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030\005 \001(\tH" - "\000\210\001\001\022\020\n\003min\030\006 \001(\003H\001\210\001\001\022\020\n\003max\030\007 \001(\003H\002\210\001\001" - "B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\272\001\n\014UInt32Metr" - "ic\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022" - "\020\n\010optional\030\003 \001(\010\022#\n\004kind\030\004 \001(\0162\025.abacus" - ".protobuf.Kind\022\021\n\004unit\030\005 \001(\tH\000\210\001\001\022\020\n\003min" - "\030\006 \001(\rH\001\210\001\001\022\020\n\003max\030\007 \001(\rH\002\210\001\001B\007\n\005_unitB\006" - "\n\004_minB\006\n\004_max\"\271\001\n\013Int32Metric\022\016\n\006offset" - "\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\020\n\010optional\030" - "\003 \001(\010\022#\n\004kind\030\004 \001(\0162\025.abacus.protobuf.Ki" - "nd\022\021\n\004unit\030\005 \001(\tH\000\210\001\001\022\020\n\003min\030\006 \001(\005H\001\210\001\001\022" - "\020\n\003max\030\007 \001(\005H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_m" - "ax\"\273\001\n\rFloat64Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013" - "description\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\022#\n\004k" - "ind\030\004 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit" - "\030\005 \001(\tH\000\210\001\001\022\020\n\003min\030\006 \001(\001H\001\210\001\001\022\020\n\003max\030\007 \001" - "(\001H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\273\001\n\rFlo" - "at32Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descriptio" - "n\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\022#\n\004kind\030\004 \001(\0162" - "\025.abacus.protobuf.Kind\022\021\n\004unit\030\005 \001(\tH\000\210\001" - "\001\022\020\n\003min\030\006 \001(\002H\001\210\001\001\022\020\n\003max\030\007 \001(\002H\002\210\001\001B\007\n" - "\005_unitB\006\n\004_minB\006\n\004_max\"_\n\nBoolMetric\022\016\n\006" - "offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\020\n\010opt" - "ional\030\003 \001(\010\022\021\n\004unit\030\004 \001(\tH\000\210\001\001B\007\n\005_unit\"" - "\266\002\n\013Enum8Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013descr" - "iption\030\002 \001(\t\022\020\n\010optional\030\003 \001(\010\0228\n\006values" - "\030\004 \003(\0132(.abacus.protobuf.Enum8Metric.Val" - "uesEntry\022\021\n\004unit\030\005 \001(\tH\000\210\001\001\032C\n\tEnumValue" - "\022\014\n\004name\030\001 \001(\t\022\030\n\013description\030\002 \001(\tH\000\210\001\001" - "B\016\n\014_description\032U\n\013ValuesEntry\022\013\n\003key\030\001" - " \001(\r\0225\n\005value\030\002 \001(\0132&.abacus.protobuf.En" - "um8Metric.EnumValue:\0028\001B\007\n\005_unit\"\346\001\n\010Con" - "stant\022\020\n\006uint64\030\001 \001(\004H\000\022\017\n\005int64\030\002 \001(\003H\000" - "\022\020\n\006uint32\030\003 \001(\rH\000\022\017\n\005int32\030\004 \001(\005H\000\022\021\n\007f" - "loat32\030\005 \001(\002H\000\022\021\n\007float64\030\006 \001(\001H\000\022\021\n\007boo" - "lean\030\007 \001(\010H\000\022\017\n\005enum8\030\010 \001(\rH\000\022\020\n\006string\030" - "\t \001(\tH\000\022\023\n\013description\030\n \001(\t\022\021\n\004unit\030\013 \001" - "(\tH\001\210\001\001B\007\n\005valueB\007\n\005_unit\"\304\003\n\006Metric\022-\n\010" - "constant\030\001 \001(\0132\031.abacus.protobuf.Constan" - "tH\000\022/\n\006uint64\030\002 \001(\0132\035.abacus.protobuf.UI" - "nt64MetricH\000\022-\n\005int64\030\003 \001(\0132\034.abacus.pro" - "tobuf.Int64MetricH\000\022/\n\006uint32\030\004 \001(\0132\035.ab" - "acus.protobuf.UInt32MetricH\000\022-\n\005int32\030\005 " - "\001(\0132\034.abacus.protobuf.Int32MetricH\000\0221\n\007f" - "loat64\030\006 \001(\0132\036.abacus.protobuf.Float64Me" - "tricH\000\0221\n\007float32\030\007 \001(\0132\036.abacus.protobu" - "f.Float32MetricH\000\022.\n\007boolean\030\010 \001(\0132\033.aba" - "cus.protobuf.BoolMetricH\000\022-\n\005enum8\030\t \001(\013" - "2\034.abacus.protobuf.Enum8MetricH\000B\006\n\004type" - "\"\371\001\n\017MetricsMetadata\022\030\n\020protocol_version" - "\030\001 \001(\r\022/\n\nendianness\030\002 \001(\0162\033.abacus.prot" - "obuf.Endianness\022\022\n\nsync_value\030\003 \001(\007\022>\n\007m" - "etrics\030\004 \003(\0132-.abacus.protobuf.MetricsMe" - "tadata.MetricsEntry\032G\n\014MetricsEntry\022\013\n\003k" - "ey\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.abacus.protobu" - "f.Metric:\0028\001*!\n\nEndianness\022\n\n\006LITTLE\020\000\022\007" - "\n\003BIG\020\001*\036\n\004Kind\022\t\n\005GAUGE\020\000\022\013\n\007COUNTER\020\001B" - "\021Z\017abacus/protobufb\006proto3" + "protobuf\"\250\001\n\014UInt64Metric\022\016\n\006offset\030\001 \001(" + "\r\022\023\n\013description\030\002 \001(\t\022#\n\004kind\030\003 \001(\0162\025.a" + "bacus.protobuf.Kind\022\021\n\004unit\030\004 \001(\tH\000\210\001\001\022\020" + "\n\003min\030\005 \001(\004H\001\210\001\001\022\020\n\003max\030\006 \001(\004H\002\210\001\001B\007\n\005_u" + "nitB\006\n\004_minB\006\n\004_max\"\247\001\n\013Int64Metric\022\016\n\006o" + "ffset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022#\n\004kind" + "\030\003 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004unit\030\004 " + "\001(\tH\000\210\001\001\022\020\n\003min\030\005 \001(\003H\001\210\001\001\022\020\n\003max\030\006 \001(\003H" + "\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"\250\001\n\014UInt32" + "Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030\002 " + "\001(\t\022#\n\004kind\030\003 \001(\0162\025.abacus.protobuf.Kind" + "\022\021\n\004unit\030\004 \001(\tH\000\210\001\001\022\020\n\003min\030\005 \001(\rH\001\210\001\001\022\020\n" + "\003max\030\006 \001(\rH\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max" + "\"\247\001\n\013Int32Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013desc" + "ription\030\002 \001(\t\022#\n\004kind\030\003 \001(\0162\025.abacus.pro" + "tobuf.Kind\022\021\n\004unit\030\004 \001(\tH\000\210\001\001\022\020\n\003min\030\005 \001" + "(\005H\001\210\001\001\022\020\n\003max\030\006 \001(\005H\002\210\001\001B\007\n\005_unitB\006\n\004_m" + "inB\006\n\004_max\"\251\001\n\rFloat64Metric\022\016\n\006offset\030\001" + " \001(\r\022\023\n\013description\030\002 \001(\t\022#\n\004kind\030\003 \001(\0162" + "\025.abacus.protobuf.Kind\022\021\n\004unit\030\004 \001(\tH\000\210\001" + "\001\022\020\n\003min\030\005 \001(\001H\001\210\001\001\022\020\n\003max\030\006 \001(\001H\002\210\001\001B\007\n" + "\005_unitB\006\n\004_minB\006\n\004_max\"\251\001\n\rFloat32Metric" + "\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022#\n" + "\004kind\030\003 \001(\0162\025.abacus.protobuf.Kind\022\021\n\004un" + "it\030\004 \001(\tH\000\210\001\001\022\020\n\003min\030\005 \001(\002H\001\210\001\001\022\020\n\003max\030\006" + " \001(\002H\002\210\001\001B\007\n\005_unitB\006\n\004_minB\006\n\004_max\"M\n\nBo" + "olMetric\022\016\n\006offset\030\001 \001(\r\022\023\n\013description\030" + "\002 \001(\t\022\021\n\004unit\030\003 \001(\tH\000\210\001\001B\007\n\005_unit\"\244\002\n\013En" + "um8Metric\022\016\n\006offset\030\001 \001(\r\022\023\n\013description" + "\030\002 \001(\t\0228\n\006values\030\004 \003(\0132(.abacus.protobuf" + ".Enum8Metric.ValuesEntry\022\021\n\004unit\030\005 \001(\tH\000" + "\210\001\001\032C\n\tEnumValue\022\014\n\004name\030\001 \001(\t\022\030\n\013descri" + "ption\030\002 \001(\tH\000\210\001\001B\016\n\014_description\032U\n\013Valu" + "esEntry\022\013\n\003key\030\001 \001(\r\0225\n\005value\030\002 \001(\0132&.ab" + "acus.protobuf.Enum8Metric.EnumValue:\0028\001B" + "\007\n\005_unit\"\237\001\n\010Constant\022\020\n\006uint64\030\001 \001(\004H\000\022" + "\017\n\005int64\030\002 \001(\003H\000\022\021\n\007float64\030\006 \001(\001H\000\022\021\n\007b" + "oolean\030\007 \001(\010H\000\022\020\n\006string\030\t \001(\tH\000\022\023\n\013desc" + "ription\030\n \001(\t\022\021\n\004unit\030\013 \001(\tH\001\210\001\001B\007\n\005valu" + "eB\007\n\005_unit\"\304\003\n\006Metric\022-\n\010constant\030\001 \001(\0132" + "\031.abacus.protobuf.ConstantH\000\022/\n\006uint64\030\002" + " \001(\0132\035.abacus.protobuf.UInt64MetricH\000\022-\n" + "\005int64\030\003 \001(\0132\034.abacus.protobuf.Int64Metr" + "icH\000\022/\n\006uint32\030\004 \001(\0132\035.abacus.protobuf.U" + "Int32MetricH\000\022-\n\005int32\030\005 \001(\0132\034.abacus.pr" + "otobuf.Int32MetricH\000\0221\n\007float64\030\006 \001(\0132\036." + "abacus.protobuf.Float64MetricH\000\0221\n\007float" + "32\030\007 \001(\0132\036.abacus.protobuf.Float32Metric" + "H\000\022.\n\007boolean\030\010 \001(\0132\033.abacus.protobuf.Bo" + "olMetricH\000\022-\n\005enum8\030\t \001(\0132\034.abacus.proto" + "buf.Enum8MetricH\000B\006\n\004type\"\371\001\n\017MetricsMet" + "adata\022\030\n\020protocol_version\030\001 \001(\r\022/\n\nendia" + "nness\030\002 \001(\0162\033.abacus.protobuf.Endianness" + "\022\022\n\nsync_value\030\003 \001(\007\022>\n\007metrics\030\004 \003(\0132-." + "abacus.protobuf.MetricsMetadata.MetricsE" + "ntry\032G\n\014MetricsEntry\022\013\n\003key\030\001 \001(\t\022&\n\005val" + "ue\030\002 \001(\0132\027.abacus.protobuf.Metric:\0028\001*!\n" + "\nEndianness\022\n\n\006LITTLE\020\000\022\007\n\003BIG\020\001*\036\n\004Kind" + "\022\t\n\005GAUGE\020\000\022\013\n\007COUNTER\020\001B\021Z\017abacus/proto" + "bufb\006proto3" }; static ::absl::once_flag descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto = { false, false, - 2626, + 2411, descriptor_table_protodef_abacus_2fprotobuf_2fmetrics_2eproto, "abacus/protobuf/metrics.proto", &descriptor_table_abacus_2fprotobuf_2fmetrics_2eproto_once, @@ -830,10 +793,9 @@ UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Messa decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, + decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -852,8 +814,8 @@ UInt64Metric::UInt64Metric(const UInt64Metric& from) : ::google::protobuf::Messa _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.offset_, &from._impl_.offset_, - static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); // @@protoc_insertion_point(copy_constructor:abacus.protobuf.UInt64Metric) } @@ -865,10 +827,9 @@ inline void UInt64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, + decltype(_impl_.kind_){0}, decltype(_impl_.min_){::uint64_t{0u}}, decltype(_impl_.max_){::uint64_t{0u}}, - decltype(_impl_.kind_){0}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -905,14 +866,13 @@ PROTOBUF_NOINLINE void UInt64Metric::Clear() { _impl_.unit_.ClearNonDefaultToEmpty(); } ::memset(&_impl_.offset_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - _impl_.kind_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -925,15 +885,15 @@ const char* UInt64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 6, 0, 52, 2> UInt64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 6, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967232, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 6, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_UInt64Metric_default_instance_._instance, @@ -946,21 +906,19 @@ const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt64Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.optional_)}}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt64Metric, _impl_.kind_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_)}}, - // optional string unit = 5; + {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_)}}, + // optional string unit = 4; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, - // optional uint64 min = 6; + {34, 0, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_)}}, + // optional uint64 min = 5; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, - // optional uint64 max = 7; + {40, 1, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_)}}, + // optional uint64 max = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UInt64Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, + {48, 2, 0, PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ @@ -970,25 +928,22 @@ const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt64Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 5; + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint64 min = 6; + // optional uint64 min = 5; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - // optional uint64 max = 7; + // optional uint64 max = 6; {PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, }}, // no aux_entries {{ - "\34\0\13\0\0\4\0\0" + "\34\0\13\0\4\0\0\0" "abacus.protobuf.UInt64Metric" "description" "unit" @@ -1017,41 +972,34 @@ ::uint8_t* UInt64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_kind(), target); + 3, this->_internal_kind(), target); } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt64Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } - // optional uint64 min = 6; + // optional uint64 min = 5; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 6, this->_internal_min(), target); + 5, this->_internal_min(), target); } - // optional uint64 max = 7; + // optional uint64 max = 6; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 7, this->_internal_max(), target); + 6, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1077,7 +1025,7 @@ ::size_t UInt64Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 5; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -1090,31 +1038,26 @@ ::size_t UInt64Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; + // .abacus.protobuf.Kind kind = 3; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } if (cached_has_bits & 0x00000006u) { - // optional uint64 min = 6; + // optional uint64 min = 5; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_min()); } - // optional uint64 max = 7; + // optional uint64 max = 6; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( this->_internal_max()); } } - // .abacus.protobuf.Kind kind = 4; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1142,8 +1085,8 @@ void UInt64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); } cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000006u) { @@ -1155,9 +1098,6 @@ void UInt64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -1183,8 +1123,8 @@ void UInt64Metric::InternalSwap(UInt64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.kind_) - + sizeof(UInt64Metric::_impl_.kind_) + PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.max_) + + sizeof(UInt64Metric::_impl_.max_) - PROTOBUF_FIELD_OFFSET(UInt64Metric, _impl_.offset_)>( reinterpret_cast(&_impl_.offset_), reinterpret_cast(&other->_impl_.offset_)); @@ -1227,10 +1167,9 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, + decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -1249,8 +1188,8 @@ Int64Metric::Int64Metric(const Int64Metric& from) : ::google::protobuf::Message( _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.offset_, &from._impl_.offset_, - static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Int64Metric) } @@ -1262,10 +1201,9 @@ inline void Int64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, + decltype(_impl_.kind_){0}, decltype(_impl_.min_){::int64_t{0}}, decltype(_impl_.max_){::int64_t{0}}, - decltype(_impl_.kind_){0}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -1302,14 +1240,13 @@ PROTOBUF_NOINLINE void Int64Metric::Clear() { _impl_.unit_.ClearNonDefaultToEmpty(); } ::memset(&_impl_.offset_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - _impl_.kind_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -1322,15 +1259,15 @@ const char* Int64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 6, 0, 51, 2> Int64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 6, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967232, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 6, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_Int64Metric_default_instance_._instance, @@ -1343,21 +1280,19 @@ const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int64Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.optional_)}}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int64Metric, _impl_.kind_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_)}}, - // optional string unit = 5; + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_)}}, + // optional string unit = 4; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, - // optional int64 min = 6; + {34, 0, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_)}}, + // optional int64 min = 5; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, - // optional int64 max = 7; + {40, 1, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_)}}, + // optional int64 max = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Int64Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, + {48, 2, 0, PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ @@ -1367,25 +1302,22 @@ const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int64Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 5; + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int64 min = 6; + // optional int64 min = 5; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, - // optional int64 max = 7; + // optional int64 max = 6; {PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, }}, // no aux_entries {{ - "\33\0\13\0\0\4\0\0" + "\33\0\13\0\4\0\0\0" "abacus.protobuf.Int64Metric" "description" "unit" @@ -1414,40 +1346,33 @@ ::uint8_t* Int64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_kind(), target); + 3, this->_internal_kind(), target); } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int64Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } - // optional int64 min = 6; + // optional int64 min = 5; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<6>( + WriteInt64ToArrayWithField<5>( stream, this->_internal_min(), target); } - // optional int64 max = 7; + // optional int64 max = 6; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<7>( + WriteInt64ToArrayWithField<6>( stream, this->_internal_max(), target); } @@ -1474,7 +1399,7 @@ ::size_t Int64Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 5; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -1487,31 +1412,26 @@ ::size_t Int64Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; + // .abacus.protobuf.Kind kind = 3; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } if (cached_has_bits & 0x00000006u) { - // optional int64 min = 6; + // optional int64 min = 5; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_min()); } - // optional int64 max = 7; + // optional int64 max = 6; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( this->_internal_max()); } } - // .abacus.protobuf.Kind kind = 4; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1539,8 +1459,8 @@ void Int64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); } cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000006u) { @@ -1552,9 +1472,6 @@ void Int64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -1580,8 +1497,8 @@ void Int64Metric::InternalSwap(Int64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.kind_) - + sizeof(Int64Metric::_impl_.kind_) + PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.max_) + + sizeof(Int64Metric::_impl_.max_) - PROTOBUF_FIELD_OFFSET(Int64Metric, _impl_.offset_)>( reinterpret_cast(&_impl_.offset_), reinterpret_cast(&other->_impl_.offset_)); @@ -1624,7 +1541,6 @@ UInt32Metric::UInt32Metric(const UInt32Metric& from) : ::google::protobuf::Messa decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, @@ -1659,7 +1575,6 @@ inline void UInt32Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, decltype(_impl_.kind_){0}, decltype(_impl_.min_){0u}, decltype(_impl_.max_){0u}, @@ -1718,15 +1633,15 @@ const char* UInt32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 6, 0, 52, 2> UInt32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 6, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967232, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 6, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_UInt32Metric_default_instance_._instance, @@ -1739,21 +1654,19 @@ const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt32Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.optional_)}}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.kind_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_)}}, - // optional string unit = 5; + {24, 63, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_)}}, + // optional string unit = 4; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, - // optional uint32 min = 6; + {34, 0, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_)}}, + // optional uint32 min = 5; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, - // optional uint32 max = 7; + {40, 1, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_)}}, + // optional uint32 max = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UInt32Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, + {48, 2, 0, PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ @@ -1763,25 +1676,22 @@ const ::_pbi::TcParseTable<3, 7, 0, 52, 2> UInt32Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 5; + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional uint32 min = 6; + // optional uint32 min = 5; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, - // optional uint32 max = 7; + // optional uint32 max = 6; {PROTOBUF_FIELD_OFFSET(UInt32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, }}, // no aux_entries {{ - "\34\0\13\0\0\4\0\0" + "\34\0\13\0\4\0\0\0" "abacus.protobuf.UInt32Metric" "description" "unit" @@ -1810,41 +1720,34 @@ ::uint8_t* UInt32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_kind(), target); + 3, this->_internal_kind(), target); } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.UInt32Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } - // optional uint32 min = 6; + // optional uint32 min = 5; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 6, this->_internal_min(), target); + 5, this->_internal_min(), target); } - // optional uint32 max = 7; + // optional uint32 max = 6; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 7, this->_internal_max(), target); + 6, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1870,7 +1773,7 @@ ::size_t UInt32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 5; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -1883,25 +1786,20 @@ ::size_t UInt32Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } if (cached_has_bits & 0x00000006u) { - // optional uint32 min = 6; + // optional uint32 min = 5; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_min()); } - // optional uint32 max = 7; + // optional uint32 max = 6; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this->_internal_max()); @@ -1935,9 +1833,6 @@ void UInt32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); } @@ -2020,7 +1915,6 @@ Int32Metric::Int32Metric(const Int32Metric& from) : ::google::protobuf::Message( decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, @@ -2055,7 +1949,6 @@ inline void Int32Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, @@ -2114,15 +2007,15 @@ const char* Int32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 6, 0, 51, 2> Int32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 6, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967232, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 6, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_Int32Metric_default_instance_._instance, @@ -2135,21 +2028,19 @@ const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int32Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.optional_)}}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.kind_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_)}}, - // optional string unit = 5; + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_)}}, + // optional string unit = 4; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, - // optional int32 min = 6; + {34, 0, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_)}}, + // optional int32 min = 5; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.min_), 1>(), - {48, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, - // optional int32 max = 7; + {40, 1, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_)}}, + // optional int32 max = 6; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Int32Metric, _impl_.max_), 2>(), - {56, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, + {48, 2, 0, PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ @@ -2159,25 +2050,22 @@ const ::_pbi::TcParseTable<3, 7, 0, 51, 2> Int32Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 5; + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int32 min = 6; + // optional int32 min = 5; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - // optional int32 max = 7; + // optional int32 max = 6; {PROTOBUF_FIELD_OFFSET(Int32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, }}, // no aux_entries {{ - "\33\0\13\0\0\4\0\0" + "\33\0\13\0\4\0\0\0" "abacus.protobuf.Int32Metric" "description" "unit" @@ -2206,40 +2094,33 @@ ::uint8_t* Int32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_kind(), target); + 3, this->_internal_kind(), target); } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Int32Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } - // optional int32 min = 6; + // optional int32 min = 5; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<6>( + WriteInt32ToArrayWithField<5>( stream, this->_internal_min(), target); } - // optional int32 max = 7; + // optional int32 max = 6; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<7>( + WriteInt32ToArrayWithField<6>( stream, this->_internal_max(), target); } @@ -2266,7 +2147,7 @@ ::size_t Int32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 5; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -2279,25 +2160,20 @@ ::size_t Int32Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } if (cached_has_bits & 0x00000006u) { - // optional int32 min = 6; + // optional int32 min = 5; if (cached_has_bits & 0x00000002u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_min()); } - // optional int32 max = 7; + // optional int32 max = 6; if (cached_has_bits & 0x00000004u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_max()); @@ -2331,9 +2207,6 @@ void Int32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); } @@ -2416,10 +2289,9 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, + decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, - decltype(_impl_.kind_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -2438,8 +2310,8 @@ Float64Metric::Float64Metric(const Float64Metric& from) : ::google::protobuf::Me _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } ::memcpy(&_impl_.offset_, &from._impl_.offset_, - static_cast<::size_t>(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.max_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.max_)); // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Float64Metric) } @@ -2451,10 +2323,9 @@ inline void Float64Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, + decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, - decltype(_impl_.kind_){0}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -2491,14 +2362,13 @@ PROTOBUF_NOINLINE void Float64Metric::Clear() { _impl_.unit_.ClearNonDefaultToEmpty(); } ::memset(&_impl_.offset_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.kind_)); if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.min_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.max_) - reinterpret_cast(&_impl_.min_)) + sizeof(_impl_.max_)); } - _impl_.kind_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -2511,15 +2381,15 @@ const char* Float64Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float64Metric::_table_ = { +const ::_pbi::TcParseTable<3, 6, 0, 53, 2> Float64Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 6, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967232, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 6, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_Float64Metric_default_instance_._instance, @@ -2532,21 +2402,19 @@ const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float64Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.optional_)}}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float64Metric, _impl_.kind_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_)}}, - // optional string unit = 5; + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_)}}, + // optional string unit = 4; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, - // optional double min = 6; + {34, 0, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_)}}, + // optional double min = 5; {::_pbi::TcParser::FastF64S1, - {49, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, - // optional double max = 7; + {41, 1, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_)}}, + // optional double max = 6; {::_pbi::TcParser::FastF64S1, - {57, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, + {49, 2, 0, PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ @@ -2556,25 +2424,22 @@ const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float64Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 5; + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional double min = 6; + // optional double min = 5; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, - // optional double max = 7; + // optional double max = 6; {PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kDouble)}, }}, // no aux_entries {{ - "\35\0\13\0\0\4\0\0" + "\35\0\13\0\4\0\0\0" "abacus.protobuf.Float64Metric" "description" "unit" @@ -2603,41 +2468,34 @@ ::uint8_t* Float64Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_kind(), target); + 3, this->_internal_kind(), target); } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float64Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } - // optional double min = 6; + // optional double min = 5; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 6, this->_internal_min(), target); + 5, this->_internal_min(), target); } - // optional double max = 7; + // optional double max = 6; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 7, this->_internal_max(), target); + 6, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -2663,7 +2521,7 @@ ::size_t Float64Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 5; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -2676,29 +2534,24 @@ ::size_t Float64Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; + // .abacus.protobuf.Kind kind = 3; + if (this->_internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } if (cached_has_bits & 0x00000006u) { - // optional double min = 6; + // optional double min = 5; if (cached_has_bits & 0x00000002u) { total_size += 9; } - // optional double max = 7; + // optional double max = 6; if (cached_has_bits & 0x00000004u) { total_size += 9; } } - // .abacus.protobuf.Kind kind = 4; - if (this->_internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2726,8 +2579,8 @@ void Float64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); + if (from._internal_kind() != 0) { + _this->_internal_set_kind(from._internal_kind()); } cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000006u) { @@ -2739,9 +2592,6 @@ void Float64Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (from._internal_kind() != 0) { - _this->_internal_set_kind(from._internal_kind()); - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -2767,8 +2617,8 @@ void Float64Metric::InternalSwap(Float64Metric* other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.kind_) - + sizeof(Float64Metric::_impl_.kind_) + PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.max_) + + sizeof(Float64Metric::_impl_.max_) - PROTOBUF_FIELD_OFFSET(Float64Metric, _impl_.offset_)>( reinterpret_cast(&_impl_.offset_), reinterpret_cast(&other->_impl_.offset_)); @@ -2811,7 +2661,6 @@ Float32Metric::Float32Metric(const Float32Metric& from) : ::google::protobuf::Me decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, decltype(_impl_.kind_){}, decltype(_impl_.min_){}, decltype(_impl_.max_){}, @@ -2846,7 +2695,6 @@ inline void Float32Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, decltype(_impl_.kind_){0}, decltype(_impl_.min_){0}, decltype(_impl_.max_){0}, @@ -2905,15 +2753,15 @@ const char* Float32Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float32Metric::_table_ = { +const ::_pbi::TcParseTable<3, 6, 0, 53, 2> Float32Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_._has_bits_), 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask + 6, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap + 4294967232, // skipmap offsetof(decltype(_table_), field_entries), - 7, // num_field_entries + 6, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_Float32Metric_default_instance_._instance, @@ -2926,21 +2774,19 @@ const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float32Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.optional_)}}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Float32Metric, _impl_.kind_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_)}}, - // optional string unit = 5; + {24, 63, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_)}}, + // optional string unit = 4; {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, - // optional float min = 6; + {34, 0, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_)}}, + // optional float min = 5; {::_pbi::TcParser::FastF32S1, - {53, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, - // optional float max = 7; + {45, 1, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_)}}, + // optional float max = 6; {::_pbi::TcParser::FastF32S1, - {61, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, + {53, 2, 0, PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ @@ -2950,25 +2796,22 @@ const ::_pbi::TcParseTable<3, 7, 0, 53, 2> Float32Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.kind_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string unit = 5; + // optional string unit = 4; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional float min = 6; + // optional float min = 5; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.min_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, - // optional float max = 7; + // optional float max = 6; {PROTOBUF_FIELD_OFFSET(Float32Metric, _impl_.max_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kFloat)}, }}, // no aux_entries {{ - "\35\0\13\0\0\4\0\0" + "\35\0\13\0\4\0\0\0" "abacus.protobuf.Float32Metric" "description" "unit" @@ -2997,41 +2840,34 @@ ::uint8_t* Float32Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_kind(), target); + 3, this->_internal_kind(), target); } cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 5; + // optional string unit = 4; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.Float32Metric.unit"); - target = stream->WriteStringMaybeAliased(5, _s, target); + target = stream->WriteStringMaybeAliased(4, _s, target); } - // optional float min = 6; + // optional float min = 5; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 6, this->_internal_min(), target); + 5, this->_internal_min(), target); } - // optional float max = 7; + // optional float max = 6; if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteFloatToArray( - 7, this->_internal_max(), target); + 6, this->_internal_max(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -3057,7 +2893,7 @@ ::size_t Float32Metric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 5; + // optional string unit = 4; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -3070,24 +2906,19 @@ ::size_t Float32Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; - } - - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; if (this->_internal_kind() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } if (cached_has_bits & 0x00000006u) { - // optional float min = 6; + // optional float min = 5; if (cached_has_bits & 0x00000002u) { total_size += 5; } - // optional float max = 7; + // optional float max = 6; if (cached_has_bits & 0x00000004u) { total_size += 5; } @@ -3120,9 +2951,6 @@ void Float32Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::googl if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } if (from._internal_kind() != 0) { _this->_internal_set_kind(from._internal_kind()); } @@ -3199,7 +3027,6 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -3217,9 +3044,7 @@ BoolMetric::BoolMetric(const BoolMetric& from) : ::google::protobuf::Message() { if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.offset_, &from._impl_.offset_, - static_cast<::size_t>(reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + _this->_impl_.offset_ = from._impl_.offset_; // @@protoc_insertion_point(copy_constructor:abacus.protobuf.BoolMetric) } @@ -3231,7 +3056,6 @@ inline void BoolMetric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -3267,9 +3091,7 @@ PROTOBUF_NOINLINE void BoolMetric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - ::memset(&_impl_.offset_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + _impl_.offset_ = 0u; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3282,32 +3104,30 @@ const char* BoolMetric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 50, 2> BoolMetric::_table_ = { +const ::_pbi::TcParseTable<2, 3, 0, 50, 2> BoolMetric::_table_ = { { PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_._has_bits_), 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask + 3, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries + 3, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_BoolMetric_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // optional string unit = 4; - {::_pbi::TcParser::FastUS1, - {34, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, + {::_pbi::TcParser::MiniParse, {}}, // uint32 offset = 1; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(BoolMetric, _impl_.offset_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.offset_)}}, // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.optional_)}}, + // optional string unit = 3; + {::_pbi::TcParser::FastUS1, + {26, 0, 0, PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_)}}, }}, {{ 65535, 65535 }}, {{ @@ -3317,16 +3137,13 @@ const ::_pbi::TcParseTable<2, 4, 0, 50, 2> BoolMetric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // optional string unit = 4; + // optional string unit = 3; {PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.unit_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, }}, // no aux_entries {{ - "\32\0\13\0\4\0\0\0" + "\32\0\13\4\0\0\0\0" "abacus.protobuf.BoolMetric" "description" "unit" @@ -3355,20 +3172,13 @@ ::uint8_t* BoolMetric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - cached_has_bits = _impl_._has_bits_[0]; - // optional string unit = 4; + // optional string unit = 3; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_unit(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "abacus.protobuf.BoolMetric.unit"); - target = stream->WriteStringMaybeAliased(4, _s, target); + target = stream->WriteStringMaybeAliased(3, _s, target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -3394,7 +3204,7 @@ ::size_t BoolMetric::ByteSizeLong() const { this->_internal_description()); } - // optional string unit = 4; + // optional string unit = 3; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -3407,11 +3217,6 @@ ::size_t BoolMetric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3439,9 +3244,6 @@ void BoolMetric::MergeImpl(::google::protobuf::Message& to_msg, const ::google:: if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -3466,12 +3268,7 @@ void BoolMetric::InternalSwap(BoolMetric* other) { &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.optional_) - + sizeof(BoolMetric::_impl_.optional_) - - PROTOBUF_FIELD_OFFSET(BoolMetric, _impl_.offset_)>( - reinterpret_cast(&_impl_.offset_), - reinterpret_cast(&other->_impl_.offset_)); + swap(_impl_.offset_, other->_impl_.offset_); } ::google::protobuf::Metadata BoolMetric::GetMetadata() const { @@ -3766,7 +3563,6 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){}, - decltype(_impl_.optional_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); @@ -3785,9 +3581,7 @@ Enum8Metric::Enum8Metric(const Enum8Metric& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { _this->_impl_.unit_.Set(from._internal_unit(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.offset_, &from._impl_.offset_, - static_cast<::size_t>(reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + _this->_impl_.offset_ = from._impl_.offset_; // @@protoc_insertion_point(copy_constructor:abacus.protobuf.Enum8Metric) } @@ -3800,7 +3594,6 @@ inline void Enum8Metric::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.description_){}, decltype(_impl_.unit_){}, decltype(_impl_.offset_){0u}, - decltype(_impl_.optional_){false}, }; _impl_.description_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -3838,9 +3631,7 @@ PROTOBUF_NOINLINE void Enum8Metric::Clear() { if (cached_has_bits & 0x00000001u) { _impl_.unit_.ClearNonDefaultToEmpty(); } - ::memset(&_impl_.offset_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.optional_) - - reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.optional_)); + _impl_.offset_ = 0u; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -3853,15 +3644,15 @@ const char* Enum8Metric::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 2, 51, 2> Enum8Metric::_table_ = { +const ::_pbi::TcParseTable<3, 4, 2, 51, 2> Enum8Metric::_table_ = { { PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_._has_bits_), 0, // no _extensions_ 5, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967268, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries + 4, // num_field_entries 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_Enum8Metric_default_instance_._instance, @@ -3874,9 +3665,7 @@ const ::_pbi::TcParseTable<3, 5, 2, 51, 2> Enum8Metric::_table_ = { // string description = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_)}}, - // bool optional = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.optional_)}}, + {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, // optional string unit = 5; {::_pbi::TcParser::FastUS1, @@ -3892,9 +3681,6 @@ const ::_pbi::TcParseTable<3, 5, 2, 51, 2> Enum8Metric::_table_ = { // string description = 2; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.description_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool optional = 3; - {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.optional_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, // map values = 4; {PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.values_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, @@ -3905,7 +3691,7 @@ const ::_pbi::TcParseTable<3, 5, 2, 51, 2> Enum8Metric::_table_ = { {::_pbi::TcParser::GetMapAuxInfo(1, 0, 0)}, {::_pbi::TcParser::CreateInArenaStorageCb<::abacus::protobuf::Enum8Metric_EnumValue>}, }}, {{ - "\33\0\13\0\0\4\0\0" + "\33\0\13\0\4\0\0\0" "abacus.protobuf.Enum8Metric" "description" "unit" @@ -3934,13 +3720,6 @@ ::uint8_t* Enum8Metric::_InternalSerialize( target = stream->WriteStringMaybeAliased(2, _s, target); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_optional(), target); - } - // map values = 4; if (!_internal_values().empty()) { using MapType = ::google::protobuf::Map<::uint32_t, ::abacus::protobuf::Enum8Metric_EnumValue>; @@ -4010,11 +3789,6 @@ ::size_t Enum8Metric::ByteSizeLong() const { this->_internal_offset()); } - // bool optional = 3; - if (this->_internal_optional() != 0) { - total_size += 2; - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -4043,9 +3817,6 @@ void Enum8Metric::MergeImpl(::google::protobuf::Message& to_msg, const ::google: if (from._internal_offset() != 0) { _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_optional() != 0) { - _this->_internal_set_optional(from._internal_optional()); - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -4071,12 +3842,7 @@ void Enum8Metric::InternalSwap(Enum8Metric* other) { &other->_impl_.description_, rhs_arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.unit_, lhs_arena, &other->_impl_.unit_, rhs_arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.optional_) - + sizeof(Enum8Metric::_impl_.optional_) - - PROTOBUF_FIELD_OFFSET(Enum8Metric, _impl_.offset_)>( - reinterpret_cast(&_impl_.offset_), - reinterpret_cast(&other->_impl_.offset_)); + swap(_impl_.offset_, other->_impl_.offset_); } ::google::protobuf::Metadata Enum8Metric::GetMetadata() const { @@ -4140,18 +3906,6 @@ Constant::Constant(const Constant& from) : ::google::protobuf::Message() { _this->_internal_set_int64(from._internal_int64()); break; } - case kUint32: { - _this->_internal_set_uint32(from._internal_uint32()); - break; - } - case kInt32: { - _this->_internal_set_int32(from._internal_int32()); - break; - } - case kFloat32: { - _this->_internal_set_float32(from._internal_float32()); - break; - } case kFloat64: { _this->_internal_set_float64(from._internal_float64()); break; @@ -4160,10 +3914,6 @@ Constant::Constant(const Constant& from) : ::google::protobuf::Message() { _this->_internal_set_boolean(from._internal_boolean()); break; } - case kEnum8: { - _this->_internal_set_enum8(from._internal_enum8()); - break; - } case kString: { _this->_internal_set_string(from._internal_string()); break; @@ -4223,18 +3973,6 @@ void Constant::clear_value() { // No need to clear break; } - case kUint32: { - // No need to clear - break; - } - case kInt32: { - // No need to clear - break; - } - case kFloat32: { - // No need to clear - break; - } case kFloat64: { // No need to clear break; @@ -4243,10 +3981,6 @@ void Constant::clear_value() { // No need to clear break; } - case kEnum8: { - // No need to clear - break; - } case kString: { _impl_.value_.string_.Destroy(); break; @@ -4283,15 +4017,15 @@ const char* Constant::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 11, 0, 62, 2> Constant::_table_ = { +const ::_pbi::TcParseTable<1, 7, 0, 54, 2> Constant::_table_ = { { PROTOBUF_FIELD_OFFSET(Constant, _impl_._has_bits_), 0, // no _extensions_ 11, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294965248, // skipmap + 4294965404, // skipmap offsetof(decltype(_table_), field_entries), - 11, // num_field_entries + 7, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_Constant_default_instance_._instance, @@ -4312,24 +4046,12 @@ const ::_pbi::TcParseTable<1, 11, 0, 62, 2> Constant::_table_ = { // int64 int64 = 2; {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.int64_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kInt64)}, - // uint32 uint32 = 3; - {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.uint32_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, - // int32 int32 = 4; - {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.int32_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kInt32)}, - // float float32 = 5; - {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.float32_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kFloat)}, // double float64 = 6; {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.float64_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, // bool boolean = 7; {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.boolean_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kBool)}, - // uint32 enum8 = 8; - {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.enum8_), _Internal::kOneofCaseOffset + 0, 0, - (0 | ::_fl::kFcOneof | ::_fl::kUInt32)}, // string string = 9; {PROTOBUF_FIELD_OFFSET(Constant, _impl_.value_.string_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kUtf8String | ::_fl::kRepAString)}, @@ -4342,7 +4064,7 @@ const ::_pbi::TcParseTable<1, 11, 0, 62, 2> Constant::_table_ = { }}, // no aux_entries {{ - "\30\0\0\0\0\0\0\0\0\6\13\4\0\0\0\0" + "\30\0\0\0\0\6\13\4" "abacus.protobuf.Constant" "string" "description" @@ -4370,24 +4092,6 @@ ::uint8_t* Constant::_InternalSerialize( stream, this->_internal_int64(), target); break; } - case kUint32: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 3, this->_internal_uint32(), target); - break; - } - case kInt32: { - target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArrayWithField<4>( - stream, this->_internal_int32(), target); - break; - } - case kFloat32: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteFloatToArray( - 5, this->_internal_float32(), target); - break; - } case kFloat64: { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteDoubleToArray( @@ -4400,12 +4104,6 @@ ::uint8_t* Constant::_InternalSerialize( 7, this->_internal_boolean(), target); break; } - case kEnum8: { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 8, this->_internal_enum8(), target); - break; - } case kString: { const std::string& _s = this->_internal_string(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -4476,23 +4174,6 @@ ::size_t Constant::ByteSizeLong() const { this->_internal_int64()); break; } - // uint32 uint32 = 3; - case kUint32: { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_uint32()); - break; - } - // int32 int32 = 4; - case kInt32: { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( - this->_internal_int32()); - break; - } - // float float32 = 5; - case kFloat32: { - total_size += 5; - break; - } // double float64 = 6; case kFloat64: { total_size += 9; @@ -4503,12 +4184,6 @@ ::size_t Constant::ByteSizeLong() const { total_size += 2; break; } - // uint32 enum8 = 8; - case kEnum8: { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_enum8()); - break; - } // string string = 9; case kString: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -4552,18 +4227,6 @@ void Constant::MergeImpl(::google::protobuf::Message& to_msg, const ::google::pr _this->_internal_set_int64(from._internal_int64()); break; } - case kUint32: { - _this->_internal_set_uint32(from._internal_uint32()); - break; - } - case kInt32: { - _this->_internal_set_int32(from._internal_int32()); - break; - } - case kFloat32: { - _this->_internal_set_float32(from._internal_float32()); - break; - } case kFloat64: { _this->_internal_set_float64(from._internal_float64()); break; @@ -4572,10 +4235,6 @@ void Constant::MergeImpl(::google::protobuf::Message& to_msg, const ::google::pr _this->_internal_set_boolean(from._internal_boolean()); break; } - case kEnum8: { - _this->_internal_set_enum8(from._internal_enum8()); - break; - } case kString: { _this->_internal_set_string(from._internal_string()); break; diff --git a/src/abacus/protobuf/metrics.pb.h b/src/abacus/protobuf/metrics.pb.h index 89197ac2..e4931f48 100644 --- a/src/abacus/protobuf/metrics.pb.h +++ b/src/abacus/protobuf/metrics.pb.h @@ -309,12 +309,11 @@ class UInt64Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, + kUnitFieldNumber = 4, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kKindFieldNumber = 4, + kKindFieldNumber = 3, + kMinFieldNumber = 5, + kMaxFieldNumber = 6, }; // string description = 2; void clear_description() ; @@ -332,7 +331,7 @@ class UInt64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -359,17 +358,17 @@ class UInt64Metric final : void _internal_set_offset(::uint32_t value); public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); + // .abacus.protobuf.Kind kind = 3; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - bool _internal_optional() const; - void _internal_set_optional(bool value); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - // optional uint64 min = 6; + // optional uint64 min = 5; bool has_min() const; void clear_min() ; ::uint64_t min() const; @@ -380,7 +379,7 @@ class UInt64Metric final : void _internal_set_min(::uint64_t value); public: - // optional uint64 max = 7; + // optional uint64 max = 6; bool has_max() const; void clear_max() ; ::uint64_t max() const; @@ -390,23 +389,13 @@ class UInt64Metric final : ::uint64_t _internal_max() const; void _internal_set_max(::uint64_t value); - public: - // .abacus.protobuf.Kind kind = 4; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); - - private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); - public: // @@protoc_insertion_point(class_scope:abacus.protobuf.UInt64Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 52, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 6, 0, 52, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -416,10 +405,9 @@ class UInt64Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; + int kind_; ::uint64_t min_; ::uint64_t max_; - int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -555,12 +543,11 @@ class Int64Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, + kUnitFieldNumber = 4, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kKindFieldNumber = 4, + kKindFieldNumber = 3, + kMinFieldNumber = 5, + kMaxFieldNumber = 6, }; // string description = 2; void clear_description() ; @@ -578,7 +565,7 @@ class Int64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -605,17 +592,17 @@ class Int64Metric final : void _internal_set_offset(::uint32_t value); public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); + // .abacus.protobuf.Kind kind = 3; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - bool _internal_optional() const; - void _internal_set_optional(bool value); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - // optional int64 min = 6; + // optional int64 min = 5; bool has_min() const; void clear_min() ; ::int64_t min() const; @@ -626,7 +613,7 @@ class Int64Metric final : void _internal_set_min(::int64_t value); public: - // optional int64 max = 7; + // optional int64 max = 6; bool has_max() const; void clear_max() ; ::int64_t max() const; @@ -636,23 +623,13 @@ class Int64Metric final : ::int64_t _internal_max() const; void _internal_set_max(::int64_t value); - public: - // .abacus.protobuf.Kind kind = 4; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); - - private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); - public: // @@protoc_insertion_point(class_scope:abacus.protobuf.Int64Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 6, 0, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -662,10 +639,9 @@ class Int64Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; + int kind_; ::int64_t min_; ::int64_t max_; - int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -801,12 +777,11 @@ class UInt32Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, + kUnitFieldNumber = 4, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, - kKindFieldNumber = 4, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, + kKindFieldNumber = 3, + kMinFieldNumber = 5, + kMaxFieldNumber = 6, }; // string description = 2; void clear_description() ; @@ -824,7 +799,7 @@ class UInt32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -851,17 +826,7 @@ class UInt32Metric final : void _internal_set_offset(::uint32_t value); public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); - - private: - bool _internal_optional() const; - void _internal_set_optional(bool value); - - public: - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; void clear_kind() ; ::abacus::protobuf::Kind kind() const; void set_kind(::abacus::protobuf::Kind value); @@ -871,7 +836,7 @@ class UInt32Metric final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // optional uint32 min = 6; + // optional uint32 min = 5; bool has_min() const; void clear_min() ; ::uint32_t min() const; @@ -882,7 +847,7 @@ class UInt32Metric final : void _internal_set_min(::uint32_t value); public: - // optional uint32 max = 7; + // optional uint32 max = 6; bool has_max() const; void clear_max() ; ::uint32_t max() const; @@ -898,7 +863,7 @@ class UInt32Metric final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 52, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 6, 0, 52, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -908,7 +873,6 @@ class UInt32Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; int kind_; ::uint32_t min_; ::uint32_t max_; @@ -1047,12 +1011,11 @@ class Int32Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, + kUnitFieldNumber = 4, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, - kKindFieldNumber = 4, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, + kKindFieldNumber = 3, + kMinFieldNumber = 5, + kMaxFieldNumber = 6, }; // string description = 2; void clear_description() ; @@ -1070,7 +1033,7 @@ class Int32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1097,17 +1060,7 @@ class Int32Metric final : void _internal_set_offset(::uint32_t value); public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); - - private: - bool _internal_optional() const; - void _internal_set_optional(bool value); - - public: - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; void clear_kind() ; ::abacus::protobuf::Kind kind() const; void set_kind(::abacus::protobuf::Kind value); @@ -1117,7 +1070,7 @@ class Int32Metric final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // optional int32 min = 6; + // optional int32 min = 5; bool has_min() const; void clear_min() ; ::int32_t min() const; @@ -1128,7 +1081,7 @@ class Int32Metric final : void _internal_set_min(::int32_t value); public: - // optional int32 max = 7; + // optional int32 max = 6; bool has_max() const; void clear_max() ; ::int32_t max() const; @@ -1144,7 +1097,7 @@ class Int32Metric final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 6, 0, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1154,7 +1107,6 @@ class Int32Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; int kind_; ::int32_t min_; ::int32_t max_; @@ -1293,12 +1245,11 @@ class Float64Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, + kUnitFieldNumber = 4, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, - kKindFieldNumber = 4, + kKindFieldNumber = 3, + kMinFieldNumber = 5, + kMaxFieldNumber = 6, }; // string description = 2; void clear_description() ; @@ -1316,7 +1267,7 @@ class Float64Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1343,17 +1294,17 @@ class Float64Metric final : void _internal_set_offset(::uint32_t value); public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); + // .abacus.protobuf.Kind kind = 3; + void clear_kind() ; + ::abacus::protobuf::Kind kind() const; + void set_kind(::abacus::protobuf::Kind value); private: - bool _internal_optional() const; - void _internal_set_optional(bool value); + ::abacus::protobuf::Kind _internal_kind() const; + void _internal_set_kind(::abacus::protobuf::Kind value); public: - // optional double min = 6; + // optional double min = 5; bool has_min() const; void clear_min() ; double min() const; @@ -1364,7 +1315,7 @@ class Float64Metric final : void _internal_set_min(double value); public: - // optional double max = 7; + // optional double max = 6; bool has_max() const; void clear_max() ; double max() const; @@ -1374,23 +1325,13 @@ class Float64Metric final : double _internal_max() const; void _internal_set_max(double value); - public: - // .abacus.protobuf.Kind kind = 4; - void clear_kind() ; - ::abacus::protobuf::Kind kind() const; - void set_kind(::abacus::protobuf::Kind value); - - private: - ::abacus::protobuf::Kind _internal_kind() const; - void _internal_set_kind(::abacus::protobuf::Kind value); - public: // @@protoc_insertion_point(class_scope:abacus.protobuf.Float64Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 53, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 6, 0, 53, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1400,10 +1341,9 @@ class Float64Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; + int kind_; double min_; double max_; - int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -1539,12 +1479,11 @@ class Float32Metric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 5, + kUnitFieldNumber = 4, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, - kKindFieldNumber = 4, - kMinFieldNumber = 6, - kMaxFieldNumber = 7, + kKindFieldNumber = 3, + kMinFieldNumber = 5, + kMaxFieldNumber = 6, }; // string description = 2; void clear_description() ; @@ -1562,7 +1501,7 @@ class Float32Metric final : std::string* _internal_mutable_description(); public: - // optional string unit = 5; + // optional string unit = 4; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1589,17 +1528,7 @@ class Float32Metric final : void _internal_set_offset(::uint32_t value); public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); - - private: - bool _internal_optional() const; - void _internal_set_optional(bool value); - - public: - // .abacus.protobuf.Kind kind = 4; + // .abacus.protobuf.Kind kind = 3; void clear_kind() ; ::abacus::protobuf::Kind kind() const; void set_kind(::abacus::protobuf::Kind value); @@ -1609,7 +1538,7 @@ class Float32Metric final : void _internal_set_kind(::abacus::protobuf::Kind value); public: - // optional float min = 6; + // optional float min = 5; bool has_min() const; void clear_min() ; float min() const; @@ -1620,7 +1549,7 @@ class Float32Metric final : void _internal_set_min(float value); public: - // optional float max = 7; + // optional float max = 6; bool has_max() const; void clear_max() ; float max() const; @@ -1636,7 +1565,7 @@ class Float32Metric final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 7, 0, 53, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 6, 0, 53, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1646,7 +1575,6 @@ class Float32Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; int kind_; float min_; float max_; @@ -1785,9 +1713,8 @@ class BoolMetric final : enum : int { kDescriptionFieldNumber = 2, - kUnitFieldNumber = 4, + kUnitFieldNumber = 3, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, }; // string description = 2; void clear_description() ; @@ -1805,7 +1732,7 @@ class BoolMetric final : std::string* _internal_mutable_description(); public: - // optional string unit = 4; + // optional string unit = 3; bool has_unit() const; void clear_unit() ; const std::string& unit() const; @@ -1831,23 +1758,13 @@ class BoolMetric final : ::uint32_t _internal_offset() const; void _internal_set_offset(::uint32_t value); - public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); - - private: - bool _internal_optional() const; - void _internal_set_optional(bool value); - public: // @@protoc_insertion_point(class_scope:abacus.protobuf.BoolMetric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 50, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 3, 0, 50, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -1857,7 +1774,6 @@ class BoolMetric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -2206,7 +2122,6 @@ class Enum8Metric final : kDescriptionFieldNumber = 2, kUnitFieldNumber = 5, kOffsetFieldNumber = 1, - kOptionalFieldNumber = 3, }; // map values = 4; int values_size() const; @@ -2265,23 +2180,13 @@ class Enum8Metric final : ::uint32_t _internal_offset() const; void _internal_set_offset(::uint32_t value); - public: - // bool optional = 3; - void clear_optional() ; - bool optional() const; - void set_optional(bool value); - - private: - bool _internal_optional() const; - void _internal_set_optional(bool value); - public: // @@protoc_insertion_point(class_scope:abacus.protobuf.Enum8Metric) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 2, 51, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 4, 2, 51, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2295,7 +2200,6 @@ class Enum8Metric final : ::google::protobuf::internal::ArenaStringPtr description_; ::google::protobuf::internal::ArenaStringPtr unit_; ::uint32_t offset_; - bool optional_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; @@ -2356,12 +2260,8 @@ class Constant final : enum ValueCase { kUint64 = 1, kInt64 = 2, - kUint32 = 3, - kInt32 = 4, - kFloat32 = 5, kFloat64 = 6, kBoolean = 7, - kEnum8 = 8, kString = 9, VALUE_NOT_SET = 0, }; @@ -2447,12 +2347,8 @@ class Constant final : kUnitFieldNumber = 11, kUint64FieldNumber = 1, kInt64FieldNumber = 2, - kUint32FieldNumber = 3, - kInt32FieldNumber = 4, - kFloat32FieldNumber = 5, kFloat64FieldNumber = 6, kBooleanFieldNumber = 7, - kEnum8FieldNumber = 8, kStringFieldNumber = 9, }; // string description = 10; @@ -2509,39 +2405,6 @@ class Constant final : ::int64_t _internal_int64() const; void _internal_set_int64(::int64_t value); - public: - // uint32 uint32 = 3; - bool has_uint32() const; - void clear_uint32() ; - ::uint32_t uint32() const; - void set_uint32(::uint32_t value); - - private: - ::uint32_t _internal_uint32() const; - void _internal_set_uint32(::uint32_t value); - - public: - // int32 int32 = 4; - bool has_int32() const; - void clear_int32() ; - ::int32_t int32() const; - void set_int32(::int32_t value); - - private: - ::int32_t _internal_int32() const; - void _internal_set_int32(::int32_t value); - - public: - // float float32 = 5; - bool has_float32() const; - void clear_float32() ; - float float32() const; - void set_float32(float value); - - private: - float _internal_float32() const; - void _internal_set_float32(float value); - public: // double float64 = 6; bool has_float64() const; @@ -2564,17 +2427,6 @@ class Constant final : bool _internal_boolean() const; void _internal_set_boolean(bool value); - public: - // uint32 enum8 = 8; - bool has_enum8() const; - void clear_enum8() ; - ::uint32_t enum8() const; - void set_enum8(::uint32_t value); - - private: - ::uint32_t _internal_enum8() const; - void _internal_set_enum8(::uint32_t value); - public: // string string = 9; bool has_string() const; @@ -2600,19 +2452,15 @@ class Constant final : class _Internal; void set_has_uint64(); void set_has_int64(); - void set_has_uint32(); - void set_has_int32(); - void set_has_float32(); void set_has_float64(); void set_has_boolean(); - void set_has_enum8(); void set_has_string(); inline bool has_value() const; inline void clear_has_value(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 11, 0, 62, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<1, 7, 0, 54, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2626,12 +2474,8 @@ class Constant final : ::google::protobuf::internal::ConstantInitialized _constinit_; ::uint64_t uint64_; ::int64_t int64_; - ::uint32_t uint32_; - ::int32_t int32_; - float float32_; double float64_; bool boolean_; - ::uint32_t enum8_; ::google::protobuf::internal::ArenaStringPtr string_; } value_; ::uint32_t _oneof_case_[1]; @@ -3328,29 +3172,7 @@ inline void UInt64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.description) } -// bool optional = 3; -inline void UInt64Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool UInt64Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt64Metric.optional) - return _internal_optional(); -} -inline void UInt64Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt64Metric.optional) -} -inline bool UInt64Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void UInt64Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// .abacus.protobuf.Kind kind = 4; +// .abacus.protobuf.Kind kind = 3; inline void UInt64Metric::clear_kind() { _impl_.kind_ = 0; } @@ -3372,7 +3194,7 @@ inline void UInt64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { _impl_.kind_ = value; } -// optional string unit = 5; +// optional string unit = 4; inline bool UInt64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3441,7 +3263,7 @@ inline void UInt64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt64Metric.unit) } -// optional uint64 min = 6; +// optional uint64 min = 5; inline bool UInt64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3468,7 +3290,7 @@ inline void UInt64Metric::_internal_set_min(::uint64_t value) { _impl_.min_ = value; } -// optional uint64 max = 7; +// optional uint64 max = 6; inline bool UInt64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -3572,29 +3394,7 @@ inline void Int64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.description) } -// bool optional = 3; -inline void Int64Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool Int64Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int64Metric.optional) - return _internal_optional(); -} -inline void Int64Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int64Metric.optional) -} -inline bool Int64Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Int64Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// .abacus.protobuf.Kind kind = 4; +// .abacus.protobuf.Kind kind = 3; inline void Int64Metric::clear_kind() { _impl_.kind_ = 0; } @@ -3616,7 +3416,7 @@ inline void Int64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { _impl_.kind_ = value; } -// optional string unit = 5; +// optional string unit = 4; inline bool Int64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3685,7 +3485,7 @@ inline void Int64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int64Metric.unit) } -// optional int64 min = 6; +// optional int64 min = 5; inline bool Int64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3712,7 +3512,7 @@ inline void Int64Metric::_internal_set_min(::int64_t value) { _impl_.min_ = value; } -// optional int64 max = 7; +// optional int64 max = 6; inline bool Int64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -3816,29 +3616,7 @@ inline void UInt32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.description) } -// bool optional = 3; -inline void UInt32Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool UInt32Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.UInt32Metric.optional) - return _internal_optional(); -} -inline void UInt32Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.UInt32Metric.optional) -} -inline bool UInt32Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void UInt32Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// .abacus.protobuf.Kind kind = 4; +// .abacus.protobuf.Kind kind = 3; inline void UInt32Metric::clear_kind() { _impl_.kind_ = 0; } @@ -3860,7 +3638,7 @@ inline void UInt32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { _impl_.kind_ = value; } -// optional string unit = 5; +// optional string unit = 4; inline bool UInt32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -3929,7 +3707,7 @@ inline void UInt32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.UInt32Metric.unit) } -// optional uint32 min = 6; +// optional uint32 min = 5; inline bool UInt32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -3956,7 +3734,7 @@ inline void UInt32Metric::_internal_set_min(::uint32_t value) { _impl_.min_ = value; } -// optional uint32 max = 7; +// optional uint32 max = 6; inline bool UInt32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4060,29 +3838,7 @@ inline void Int32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.description) } -// bool optional = 3; -inline void Int32Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool Int32Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Int32Metric.optional) - return _internal_optional(); -} -inline void Int32Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Int32Metric.optional) -} -inline bool Int32Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Int32Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// .abacus.protobuf.Kind kind = 4; +// .abacus.protobuf.Kind kind = 3; inline void Int32Metric::clear_kind() { _impl_.kind_ = 0; } @@ -4104,7 +3860,7 @@ inline void Int32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { _impl_.kind_ = value; } -// optional string unit = 5; +// optional string unit = 4; inline bool Int32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4173,7 +3929,7 @@ inline void Int32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Int32Metric.unit) } -// optional int32 min = 6; +// optional int32 min = 5; inline bool Int32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -4200,7 +3956,7 @@ inline void Int32Metric::_internal_set_min(::int32_t value) { _impl_.min_ = value; } -// optional int32 max = 7; +// optional int32 max = 6; inline bool Int32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4304,29 +4060,7 @@ inline void Float64Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.description) } -// bool optional = 3; -inline void Float64Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool Float64Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float64Metric.optional) - return _internal_optional(); -} -inline void Float64Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float64Metric.optional) -} -inline bool Float64Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Float64Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// .abacus.protobuf.Kind kind = 4; +// .abacus.protobuf.Kind kind = 3; inline void Float64Metric::clear_kind() { _impl_.kind_ = 0; } @@ -4348,7 +4082,7 @@ inline void Float64Metric::_internal_set_kind(::abacus::protobuf::Kind value) { _impl_.kind_ = value; } -// optional string unit = 5; +// optional string unit = 4; inline bool Float64Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4417,7 +4151,7 @@ inline void Float64Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float64Metric.unit) } -// optional double min = 6; +// optional double min = 5; inline bool Float64Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -4444,7 +4178,7 @@ inline void Float64Metric::_internal_set_min(double value) { _impl_.min_ = value; } -// optional double max = 7; +// optional double max = 6; inline bool Float64Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4548,29 +4282,7 @@ inline void Float32Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.description) } -// bool optional = 3; -inline void Float32Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool Float32Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Float32Metric.optional) - return _internal_optional(); -} -inline void Float32Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Float32Metric.optional) -} -inline bool Float32Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Float32Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// .abacus.protobuf.Kind kind = 4; +// .abacus.protobuf.Kind kind = 3; inline void Float32Metric::clear_kind() { _impl_.kind_ = 0; } @@ -4592,7 +4304,7 @@ inline void Float32Metric::_internal_set_kind(::abacus::protobuf::Kind value) { _impl_.kind_ = value; } -// optional string unit = 5; +// optional string unit = 4; inline bool Float32Metric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -4661,7 +4373,7 @@ inline void Float32Metric::set_allocated_unit(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Float32Metric.unit) } -// optional float min = 6; +// optional float min = 5; inline bool Float32Metric::has_min() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -4688,7 +4400,7 @@ inline void Float32Metric::_internal_set_min(float value) { _impl_.min_ = value; } -// optional float max = 7; +// optional float max = 6; inline bool Float32Metric::has_max() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -4792,29 +4504,7 @@ inline void BoolMetric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.BoolMetric.description) } -// bool optional = 3; -inline void BoolMetric::clear_optional() { - _impl_.optional_ = false; -} -inline bool BoolMetric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.BoolMetric.optional) - return _internal_optional(); -} -inline void BoolMetric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.BoolMetric.optional) -} -inline bool BoolMetric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void BoolMetric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - -// optional string unit = 4; +// optional string unit = 3; inline bool BoolMetric::has_unit() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -5086,28 +4776,6 @@ inline void Enum8Metric::set_allocated_description(std::string* value) { // @@protoc_insertion_point(field_set_allocated:abacus.protobuf.Enum8Metric.description) } -// bool optional = 3; -inline void Enum8Metric::clear_optional() { - _impl_.optional_ = false; -} -inline bool Enum8Metric::optional() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Enum8Metric.optional) - return _internal_optional(); -} -inline void Enum8Metric::set_optional(bool value) { - _internal_set_optional(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Enum8Metric.optional) -} -inline bool Enum8Metric::_internal_optional() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.optional_; -} -inline void Enum8Metric::_internal_set_optional(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.optional_ = value; -} - // map values = 4; inline int Enum8Metric::_internal_values_size() const { return _internal_values().size(); @@ -5278,111 +4946,6 @@ inline void Constant::_internal_set_int64(::int64_t value) { _impl_.value_.int64_ = value; } -// uint32 uint32 = 3; -inline bool Constant::has_uint32() const { - return value_case() == kUint32; -} -inline void Constant::set_has_uint32() { - _impl_._oneof_case_[0] = kUint32; -} -inline void Constant::clear_uint32() { - if (value_case() == kUint32) { - _impl_.value_.uint32_ = 0u; - clear_has_value(); - } -} -inline ::uint32_t Constant::uint32() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.uint32) - return _internal_uint32(); -} -inline void Constant::set_uint32(::uint32_t value) { - _internal_set_uint32(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.uint32) -} -inline ::uint32_t Constant::_internal_uint32() const { - if (value_case() == kUint32) { - return _impl_.value_.uint32_; - } - return 0u; -} -inline void Constant::_internal_set_uint32(::uint32_t value) { - if (value_case() != kUint32) { - clear_value(); - set_has_uint32(); - } - _impl_.value_.uint32_ = value; -} - -// int32 int32 = 4; -inline bool Constant::has_int32() const { - return value_case() == kInt32; -} -inline void Constant::set_has_int32() { - _impl_._oneof_case_[0] = kInt32; -} -inline void Constant::clear_int32() { - if (value_case() == kInt32) { - _impl_.value_.int32_ = 0; - clear_has_value(); - } -} -inline ::int32_t Constant::int32() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.int32) - return _internal_int32(); -} -inline void Constant::set_int32(::int32_t value) { - _internal_set_int32(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.int32) -} -inline ::int32_t Constant::_internal_int32() const { - if (value_case() == kInt32) { - return _impl_.value_.int32_; - } - return 0; -} -inline void Constant::_internal_set_int32(::int32_t value) { - if (value_case() != kInt32) { - clear_value(); - set_has_int32(); - } - _impl_.value_.int32_ = value; -} - -// float float32 = 5; -inline bool Constant::has_float32() const { - return value_case() == kFloat32; -} -inline void Constant::set_has_float32() { - _impl_._oneof_case_[0] = kFloat32; -} -inline void Constant::clear_float32() { - if (value_case() == kFloat32) { - _impl_.value_.float32_ = 0; - clear_has_value(); - } -} -inline float Constant::float32() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.float32) - return _internal_float32(); -} -inline void Constant::set_float32(float value) { - _internal_set_float32(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.float32) -} -inline float Constant::_internal_float32() const { - if (value_case() == kFloat32) { - return _impl_.value_.float32_; - } - return 0; -} -inline void Constant::_internal_set_float32(float value) { - if (value_case() != kFloat32) { - clear_value(); - set_has_float32(); - } - _impl_.value_.float32_ = value; -} - // double float64 = 6; inline bool Constant::has_float64() const { return value_case() == kFloat64; @@ -5453,41 +5016,6 @@ inline void Constant::_internal_set_boolean(bool value) { _impl_.value_.boolean_ = value; } -// uint32 enum8 = 8; -inline bool Constant::has_enum8() const { - return value_case() == kEnum8; -} -inline void Constant::set_has_enum8() { - _impl_._oneof_case_[0] = kEnum8; -} -inline void Constant::clear_enum8() { - if (value_case() == kEnum8) { - _impl_.value_.enum8_ = 0u; - clear_has_value(); - } -} -inline ::uint32_t Constant::enum8() const { - // @@protoc_insertion_point(field_get:abacus.protobuf.Constant.enum8) - return _internal_enum8(); -} -inline void Constant::set_enum8(::uint32_t value) { - _internal_set_enum8(value); - // @@protoc_insertion_point(field_set:abacus.protobuf.Constant.enum8) -} -inline ::uint32_t Constant::_internal_enum8() const { - if (value_case() == kEnum8) { - return _impl_.value_.enum8_; - } - return 0u; -} -inline void Constant::_internal_set_enum8(::uint32_t value) { - if (value_case() != kEnum8) { - clear_value(); - set_has_enum8(); - } - _impl_.value_.enum8_ = value; -} - // string string = 9; inline bool Constant::has_string() const { return value_case() == kString; diff --git a/src/abacus/required_metric.hpp b/src/abacus/required_metric.hpp deleted file mode 100644 index 45489f6d..00000000 --- a/src/abacus/required_metric.hpp +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst file. - -#pragma once - -#include -#include -#include -#include - -#include "detail/has_arithmetic_operators.hpp" -#include "version.hpp" - -namespace abacus -{ -inline namespace STEINWURF_ABACUS_VERSION -{ -/// A required_metric class for most metrics -template -struct required_metric -{ - using value_type = typename Metric::type; - - /// Default constructor - required_metric() = default; - - /// Constructor - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(value_type) + 1 bytes long. - /// @param value The initial value of the metric - required_metric(uint8_t* memory, value_type value) - { - assert(memory != nullptr); - m_memory = memory; - // Set the initialized flag to true as this should always be the case - // for required metrics. - m_memory[0] = 1; - set_value(value); - } - - /// Check if the metric is initialized - /// @return true if the metric is initialized - auto is_initialized() const -> bool - { - return m_memory != nullptr; - } - - /// Get the value of the metric - /// @return The value of the metric - auto value() const -> value_type - { - assert(is_initialized()); - return Metric::value(m_memory); - } - - /// Assign a new value to the metric - /// @param value The value to assign - auto set_value(value_type value) -> void - { - assert(is_initialized()); - Metric::set_value(m_memory, value); - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - auto operator=(value_type value) -> required_metric& - { - set_value(value); - return *this; - } - -public: - /// Arithmetic operators - - /// Increment the metric - /// @param increment The value to add - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator+=(value_type increment) -> required_metric& - { - Metric::set_value(m_memory, value() + increment); - return *this; - } - - /// Decrement the metric - /// @param decrement The value to subtract - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator-=(value_type decrement) -> required_metric& - { - Metric::set_value(m_memory, value() - decrement); - return *this; - } - - /// Increment the value of the metric - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator++() -> required_metric& - { - Metric::set_value(m_memory, value() + 1); - return *this; - } - - /// Decrement the value of the metric - /// @return The result of the arithmetic - template < - typename U = Metric, - typename = std::enable_if_t::value>> - auto operator--() -> required_metric& - { - Metric::set_value(m_memory, value() - 1); - return *this; - } - -public: - /// Enum specializations - - /// Constructor for enum8 - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(value_type) + 1 bytes long. - /// @param value The initial enum value of the metric - template && - std::is_same_v>> - required_metric(uint8_t* memory, T value) : - required_metric(memory, static_cast(value)) - { - static_assert( - sizeof(std::underlying_type_t) == sizeof(value_type), - "The underlying type of the enum must match the value_type"); - } - - /// Assign the metric a new value - /// @param value The value to assign - /// @return the metric with the new value - template && - std::is_same_v>> - auto operator=(T value) -> required_metric& - { - set_value(value); - return *this; - } - - /// Assign a new value to the metric - /// @param value The value to assign - template && - std::is_same_v>> - auto set_value(T value) -> void - { - assert(is_initialized()); - assert((std::underlying_type_t)value <= - std::numeric_limits::max()); - - set_value(static_cast(value)); - } - -protected: - /// The metric memory - uint8_t* m_memory = nullptr; -}; - -} -} diff --git a/src/abacus/to_json.cpp b/src/abacus/to_json.cpp index 24b94c73..7b22b3b3 100644 --- a/src/abacus/to_json.cpp +++ b/src/abacus/to_json.cpp @@ -6,7 +6,7 @@ #include #include "detail/to_json.hpp" -#include "parse.hpp" +#include "parse_metadata.hpp" #include "protobuf/metrics.pb.h" #include "to_json.hpp" @@ -20,7 +20,7 @@ auto to_json(const uint8_t* metadata_data, std::size_t metadata_bytes, bool minimal) -> std::string { view v; - auto parsed = parse::metadata(metadata_data, metadata_bytes); + auto parsed = parse_metadata(metadata_data, metadata_bytes); if (!parsed.has_value()) { return ""; diff --git a/src/abacus/uint32.hpp b/src/abacus/uint32.hpp index ac91b45c..a72bc36f 100644 --- a/src/abacus/uint32.hpp +++ b/src/abacus/uint32.hpp @@ -5,13 +5,10 @@ #pragma once -#include "availability.hpp" #include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus @@ -24,41 +21,9 @@ struct uint32 /// The primitive type of the metric using type = uint32_t; - /// Required uint32 metric - using required = required_metric; - - /// Optional uint32 metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - std::memcpy(memory + 1, &value, sizeof(type)); - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - type value; - std::memcpy(&value, memory + 1, sizeof(type)); - return value; - } - /// The metric kind abacus::kind kind; - /// The availability of the metric - abacus::availability availability; - /// The metric description abacus::description description; diff --git a/src/abacus/uint64.hpp b/src/abacus/uint64.hpp index 19d1419f..de483e86 100644 --- a/src/abacus/uint64.hpp +++ b/src/abacus/uint64.hpp @@ -5,60 +5,26 @@ #pragma once -#include "availability.hpp" #include "description.hpp" #include "kind.hpp" #include "max.hpp" #include "min.hpp" -#include "optional_metric.hpp" -#include "required_metric.hpp" #include "unit.hpp" namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { + /// A 64-bit integer metric struct uint64 { /// The primitive type of the metric using type = uint64_t; - /// Required uint64 metric - using required = required_metric; - - /// Optional uint64 metric - using optional = optional_metric; - - /// Set the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @param value The value to set - static inline auto set_value(uint8_t* memory, type value) -> void - { - assert(memory != nullptr); - std::memcpy(memory + 1, &value, sizeof(type)); - } - - /// Get the value of the metric - /// @param memory The memory to use for the metric, note that the memory - /// must be at least sizeof(type) + 1 bytes long. - /// @return The value of the metric - static inline auto value(const uint8_t* memory) -> type - { - assert(memory != nullptr); - assert(memory[0] == 1); - type value; - std::memcpy(&value, memory + 1, sizeof(type)); - return value; - } - /// The metric kind abacus::kind kind; - /// The availability of the metric - abacus::availability availability; - /// The metric description abacus::description description; diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index f640b703..1b6ce89e 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -8,8 +8,7 @@ #include #include -#include -#include +#include template void integer_test() @@ -17,7 +16,7 @@ void integer_test() using type = typename T::type; { - using optional = typename T::optional; + using optional = abacus::metric; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); optional o; @@ -37,22 +36,6 @@ void integer_test() o.reset(); EXPECT_FALSE(o.has_value()); } - { - using required = typename T::required; - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - required r; - EXPECT_FALSE(r.is_initialized()); - r = required(data, 10U); - EXPECT_TRUE(r.is_initialized()); - EXPECT_EQ(r.value(), type{10}); - r += 12; - r -= 2; - ++r; - --r; - - EXPECT_EQ(r.value(), type{20}); - } } TEST(test_info, integer) @@ -69,7 +52,7 @@ void floating_point_test() using type = typename T::type; { - using optional = typename T::optional; + using optional = abacus::metric; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); optional o; @@ -89,22 +72,6 @@ void floating_point_test() o.reset(); EXPECT_FALSE(o.has_value()); } - { - using required = typename T::required; - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - required r; - EXPECT_FALSE(r.is_initialized()); - r = required(data, 10.0); - EXPECT_TRUE(r.is_initialized()); - EXPECT_EQ(r.value(), type{10.0}); - r += 12.0; - r -= 2.0; - ++r; - --r; - - EXPECT_EQ(r.value(), type{20.0}); - } } TEST(test_info, floating_point) @@ -119,9 +86,9 @@ TEST(test_info, boolean) { uint8_t data[sizeof(bool) + 1]; std::memset(data, 0, sizeof(data)); - abacus::boolean::optional o; + abacus::metric o; EXPECT_FALSE(o.is_initialized()); - o = abacus::boolean::optional(data); + o = abacus::metric(data); EXPECT_TRUE(o.is_initialized()); EXPECT_FALSE(o.has_value()); o = true; @@ -132,17 +99,6 @@ TEST(test_info, boolean) o.reset(); EXPECT_FALSE(o.has_value()); } - { - uint8_t data[sizeof(bool) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::boolean::required r; - EXPECT_FALSE(r.is_initialized()); - r = abacus::boolean::required(data, true); - EXPECT_TRUE(r.is_initialized()); - EXPECT_EQ(r.value(), true); - r = false; - EXPECT_EQ(r.value(), false); - } } namespace { @@ -160,65 +116,28 @@ TEST(test_info, enum8) { uint8_t data[sizeof(uint8_t) + 1]; std::memset(data, 0, sizeof(data)); - abacus::enum8::optional o; + abacus::metric o; EXPECT_FALSE(o.is_initialized()); - o = abacus::enum8::optional(data); + o = abacus::metric(data); EXPECT_TRUE(o.is_initialized()); EXPECT_FALSE(o.has_value()); - o = 10U; - EXPECT_TRUE(o.has_value()); - EXPECT_EQ(o.value(), 10U); - o = 20U; - EXPECT_EQ(o.value(), 20U); - o.reset(); - EXPECT_FALSE(o.has_value()); o.set_value(test_enum::value0); - EXPECT_EQ(o.value(), 0U); + EXPECT_EQ(o.value(), test_enum::value0); o.set_value(test_enum::value1); - EXPECT_EQ(o.value(), 1U); + EXPECT_EQ(o.value(), test_enum::value1); o.set_value(test_enum::value2); - EXPECT_EQ(o.value(), 2U); + EXPECT_EQ(o.value(), test_enum::value2); o.set_value(test_enum::value3); - EXPECT_EQ(o.value(), 3U); + EXPECT_EQ(o.value(), test_enum::value3); o = test_enum::value0; - EXPECT_EQ(o.value(), 0U); + EXPECT_EQ(o.value(), test_enum::value0); o = test_enum::value1; - EXPECT_EQ(o.value(), 1U); + EXPECT_EQ(o.value(), test_enum::value1); o = test_enum::value2; - EXPECT_EQ(o.value(), 2U); + EXPECT_EQ(o.value(), test_enum::value2); o = test_enum::value3; - EXPECT_EQ(o.value(), 3U); - } - - { - uint8_t data[sizeof(uint8_t) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::enum8::required r; - EXPECT_FALSE(r.is_initialized()); - r = abacus::enum8::required(data, 10U); - EXPECT_TRUE(r.is_initialized()); - EXPECT_EQ(r.value(), 10U); - r = 20U; - EXPECT_EQ(r.value(), 20U); - - r.set_value(test_enum::value0); - EXPECT_EQ(r.value(), 0U); - r.set_value(test_enum::value1); - EXPECT_EQ(r.value(), 1U); - r.set_value(test_enum::value2); - EXPECT_EQ(r.value(), 2U); - r.set_value(test_enum::value3); - EXPECT_EQ(r.value(), 3U); - - r = test_enum::value0; - EXPECT_EQ(r.value(), 0U); - r = test_enum::value1; - EXPECT_EQ(r.value(), 1U); - r = test_enum::value2; - EXPECT_EQ(r.value(), 2U); - r = test_enum::value3; - EXPECT_EQ(r.value(), 3U); + EXPECT_EQ(o.value(), test_enum::value3); } } diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index a6d04a78..e2fbc7e7 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -8,14 +8,14 @@ #include #include -#include +#include TEST(test_metric, constructor) { uint8_t data[9]; std::memset(data, 0, sizeof(data)); - abacus::uint64::optional uint_metric(data); + abacus::metric uint_metric(data); EXPECT_TRUE(uint_metric.is_initialized()); EXPECT_FALSE(uint_metric.has_value()); @@ -29,7 +29,7 @@ TEST(test_metric, float_assignment) uint8_t data[9]; std::memset(data, 0, sizeof(data)); - abacus::float64::optional double_metric(data); + abacus::metric double_metric(data); EXPECT_TRUE(double_metric.is_initialized()); EXPECT_FALSE(double_metric.has_value()); double_metric = 1123.12; diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 3de8f475..62a36a65 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -26,6 +26,14 @@ TEST(test_metrics, empty) EXPECT_EQ(0U, metrics2.metadata().metrics().size()); } +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; + TEST(test_metrics, api) { std::string name0 = "metric0"; @@ -39,37 +47,35 @@ TEST(test_metrics, api) std::map infos = { {abacus::name{name0}, - abacus::boolean{abacus::optional, - abacus::description{"A boolean metric"}}}, + abacus::boolean{abacus::description{"A boolean metric"}}}, {abacus::name{name1}, - abacus::uint64{abacus::counter, abacus::required, + abacus::uint64{abacus::kind::counter, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name2}, - abacus::int64{abacus::gauge, abacus::optional, + abacus::int64{abacus::kind::gauge, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}, {abacus::name{name3}, - abacus::float64{abacus::gauge, abacus::optional, + abacus::float64{abacus::kind::gauge, abacus::description{"A floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name4}, - abacus::constant{abacus::value{true}, + abacus::constant{abacus::constant::boolean{true}, abacus::description{"A constant boolean metric"}}}, {abacus::name{name5}, abacus::constant{ - abacus::value{42.42}, + abacus::constant::float64{42.42}, abacus::description{"A constant floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name6}, - abacus::enum8{abacus::optional, - abacus::description{"An enum metric"}, - {{0, {"value0", "The value for 0"}}, - {1, {"value1", "The value for 1"}}, - {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}, + abacus::enum8{abacus::description{"An enum metric"}, + {{test_enum::value0, {"value0", "The value for 0"}}, + {test_enum::value1, {"value1", "The value for 1"}}, + {test_enum::value2, {"value2", "The value for 2"}}, + {test_enum::value3, {"value3", "The value for 3"}}}}}, {abacus::name{name7}, - abacus::constant{abacus::value{"hello"}, + abacus::constant{abacus::constant::str{"hello"}, abacus::description{"A string metric"}}}}; abacus::metrics from_metrics(infos); @@ -80,40 +86,33 @@ TEST(test_metrics, api) EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().description(), "A boolean metric"); - EXPECT_TRUE(metrics.metadata().metrics().at(name0).boolean().optional()); + EXPECT_EQ(metrics.metadata().metrics().at(name0).boolean().unit(), ""); // empty unit EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().kind(), abacus::protobuf::Kind::COUNTER); - EXPECT_FALSE(metrics.metadata().metrics().at(name1).uint64().optional()); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().description(), "An unsigned integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name1).uint64().unit(), "bytes"); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().kind(), abacus::protobuf::Kind::GAUGE); - EXPECT_TRUE(metrics.metadata().metrics().at(name2).int64().optional()); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().description(), "A signed integer metric"); EXPECT_EQ(metrics.metadata().metrics().at(name2).int64().unit(), "USD"); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().kind(), abacus::protobuf::Kind::GAUGE); - EXPECT_TRUE(metrics.metadata().metrics().at(name3).float64().optional()); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().description(), "A floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name3).float64().unit(), "ms"); - EXPECT_EQ(metrics.metadata().metrics().at(name4).constant().value_case(), - abacus::protobuf::Constant::ValueCase::kBoolean); EXPECT_EQ(metrics.metadata().metrics().at(name4).constant().description(), "A constant boolean metric"); EXPECT_EQ(metrics.metadata().metrics().at(name4).constant().unit(), ""); // empty unit - EXPECT_EQ(metrics.metadata().metrics().at(name5).constant().value_case(), - abacus::protobuf::Constant::ValueCase::kFloat64); EXPECT_EQ(metrics.metadata().metrics().at(name5).constant().description(), "A constant floating point metric"); EXPECT_EQ(metrics.metadata().metrics().at(name5).constant().unit(), "ms"); @@ -134,29 +133,27 @@ TEST(test_metrics, api) .description(), "The value for 0"); - EXPECT_EQ(metrics.metadata().metrics().at(name7).constant().value_case(), - abacus::protobuf::Constant::ValueCase::kString); EXPECT_EQ(metrics.metadata().metrics().at(name7).constant().description(), "A string metric"); EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name1)); - auto metric1 = metrics.initialize_required(name1, 9000U); + auto metric1 = metrics.initialize(name1).set_value(9000U); EXPECT_TRUE(metrics.is_initialized(name1)); EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name2)); - auto metric2 = metrics.initialize_optional(name2); + auto metric2 = metrics.initialize(name2); EXPECT_TRUE(metrics.is_initialized(name2)); EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name3)); - auto metric3 = metrics.initialize_optional(name3); + auto metric3 = metrics.initialize(name3); EXPECT_TRUE(metrics.is_initialized(name3)); EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name0)); - auto metric0 = metrics.initialize_optional(name0); + auto metric0 = metrics.initialize(name0); EXPECT_TRUE(metrics.is_initialized(name0)); EXPECT_TRUE(metrics.is_initialized(name4)); @@ -164,7 +161,7 @@ TEST(test_metrics, api) EXPECT_FALSE(metrics.is_initialized()); EXPECT_FALSE(metrics.is_initialized(name6)); - auto metric6 = metrics.initialize_optional(name6); + auto metric6 = metrics.initialize(name6); EXPECT_TRUE(metrics.is_initialized(name6)); EXPECT_TRUE(metrics.is_initialized(name7)); @@ -191,9 +188,9 @@ TEST(test_metrics, api) EXPECT_EQ(metric0.value(), true); EXPECT_FALSE(metric6.has_value()); - metric6 = 2; + metric6 = test_enum::value2; EXPECT_TRUE(metric6.has_value()); - EXPECT_EQ(metric6.value(), 2); + EXPECT_EQ(metric6.value(), test_enum::value2); } TEST(test_metrics, value_and_metadata_bytes) @@ -203,22 +200,22 @@ TEST(test_metrics, value_and_metadata_bytes) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, abacus::optional, + abacus::uint64{abacus::kind::counter, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, abacus::optional, + abacus::int64{abacus::kind::gauge, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; - auto m0 = metrics.initialize_optional(name0); - auto m1 = metrics.initialize_optional(name1); + auto m0 = metrics.initialize(name0); + auto m1 = metrics.initialize(name1); (void)m0; (void)m1; - EXPECT_EQ(metrics.metadata().ByteSizeLong(), 112); + EXPECT_EQ(metrics.metadata().ByteSizeLong(), 112U); EXPECT_EQ(metrics.value_bytes(), sizeof(uint32_t) + // hash 1 + sizeof(uint64_t) + // metric0 has_value + value @@ -233,18 +230,18 @@ TEST(test_metrics, reset_counters) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, abacus::optional, + abacus::uint64{abacus::kind::counter, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, abacus::optional, + abacus::int64{abacus::kind::gauge, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}}; abacus::metrics metrics{infos}; - auto uint_metric = metrics.initialize_optional(name0); - auto int_metric = metrics.initialize_optional(name1); + auto uint_metric = metrics.initialize(name0); + auto int_metric = metrics.initialize(name1); EXPECT_FALSE(uint_metric.has_value()); EXPECT_FALSE(int_metric.has_value()); @@ -305,31 +302,30 @@ TEST(test_metrics, protocol_version) << "If this test fails, you need to update the protocol version"); std::map infos = { {abacus::name{"metric0"}, - abacus::uint64{abacus::counter, abacus::required, + abacus::uint64{abacus::kind::counter, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{"metric1"}, - abacus::int64{abacus::gauge, abacus::required, + abacus::int64{abacus::kind::gauge, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}, {abacus::name{"metric2"}, - abacus::float64{abacus::gauge, abacus::required, + abacus::float64{abacus::kind::gauge, abacus::description{"A floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{"metric3"}, - abacus::boolean{abacus::required, - abacus::description{"A boolean metric"}}}}; + abacus::boolean{abacus::description{"A boolean metric"}}}}; abacus::metrics metrics(infos); auto uint_metric = - metrics.initialize_required("metric0", 42U); + metrics.initialize("metric0").set_value(42); auto int_metric = - metrics.initialize_required("metric1", -42); + metrics.initialize("metric1").set_value(-42); auto float_metric = - metrics.initialize_required("metric2", 142.0); + metrics.initialize("metric2").set_value(142.0); auto bool_metric = - metrics.initialize_required("metric3", true); + metrics.initialize("metric3").set_value(true); (void)uint_metric; (void)int_metric; @@ -354,8 +350,8 @@ TEST(test_metrics, protocol_version) SCOPED_TRACE(::testing::Message() << "Meta data:\n" << meta_stream.str()); - auto expected = abacus::parse::metadata(expected_metadata.data(), - expected_metadata.size()); + auto expected = abacus::parse_metadata(expected_metadata.data(), + expected_metadata.size()); ASSERT_TRUE(expected.has_value()); auto actual = metrics.metadata(); @@ -392,111 +388,96 @@ TEST(test_metrics, reset) // Create one of each metric both required and optional std::map infos = { {abacus::name{"uint64_required"}, - abacus::uint64{abacus::counter, abacus::required, - abacus::description{""}}}, + abacus::uint64{abacus::kind::counter, abacus::description{""}}}, {abacus::name{"uint64_optional"}, - abacus::uint64{abacus::counter, abacus::optional, - abacus::description{""}}}, + abacus::uint64{abacus::kind::counter, abacus::description{""}}}, {abacus::name{"uint32_required"}, - abacus::uint32{abacus::counter, abacus::required, - abacus::description{""}}}, + abacus::uint32{abacus::kind::counter, abacus::description{""}}}, {abacus::name{"uint32_optional"}, - abacus::uint32{abacus::counter, abacus::optional, - abacus::description{""}}}, + abacus::uint32{abacus::kind::counter, abacus::description{""}}}, {abacus::name{"int64_required"}, - abacus::int64{abacus::gauge, abacus::required, - abacus::description{""}}}, + abacus::int64{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"int64_optional"}, - abacus::int64{abacus::gauge, abacus::optional, - abacus::description{""}}}, + abacus::int64{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"int32_required"}, - abacus::int32{abacus::gauge, abacus::required, - abacus::description{""}}}, + abacus::int32{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"int32_optional"}, - abacus::int32{abacus::gauge, abacus::optional, - abacus::description{""}}}, + abacus::int32{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"float64_required"}, - abacus::float64{abacus::gauge, abacus::required, - abacus::description{""}}}, + abacus::float64{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"float64_optional"}, - abacus::float64{abacus::gauge, abacus::optional, - abacus::description{""}}}, + abacus::float64{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"float32_required"}, - abacus::float32{abacus::gauge, abacus::required, - abacus::description{""}}}, + abacus::float32{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"float32_optional"}, - abacus::float32{abacus::gauge, abacus::optional, - abacus::description{""}}}, + abacus::float32{abacus::kind::gauge, abacus::description{""}}}, {abacus::name{"boolean_required"}, - abacus::boolean{abacus::required, abacus::description{""}}}, + abacus::boolean{abacus::description{""}}}, {abacus::name{"boolean_optional"}, - abacus::boolean{abacus::optional, abacus::description{""}}}, - {abacus::name{"enum8_required"}, abacus::enum8{abacus::required, - abacus::description{""}, - {{0, {"", ""}}}}}, - {abacus::name{"enum8_optional"}, abacus::enum8{abacus::optional, - abacus::description{""}, - {{0, {"", ""}}}}}, + abacus::boolean{abacus::description{""}}}, + {abacus::name{"enum8_required"}, + abacus::enum8{abacus::description{""}, {{0, {"", ""}}}}}, + {abacus::name{"enum8_optional"}, + abacus::enum8{abacus::description{""}, {{0, {"", ""}}}}}, {abacus::name{"uint64_constant"}, - abacus::constant{abacus::value{1111UL}, abacus::description{""}}}, + abacus::constant{abacus::constant::uint64{1111}, + abacus::description{""}}}, {abacus::name{"uint32_constant"}, - abacus::constant{abacus::value{2222U}, abacus::description{""}}}, + abacus::constant{abacus::constant::uint64{2222}, + abacus::description{""}}}, {abacus::name{"int64_constant"}, - abacus::constant{abacus::value{3333L}, abacus::description{""}}}, + abacus::constant{abacus::constant::int64{3333}, + abacus::description{""}}}, {abacus::name{"int32_constant"}, - abacus::constant{abacus::value{4444}, abacus::description{""}}}, + abacus::constant{abacus::constant::uint64{4444}, + abacus::description{""}}}, {abacus::name{"float64_constant"}, - abacus::constant{abacus::value{5555.0}, abacus::description{""}}}, + abacus::constant{abacus::constant::float64{5555.0}, + abacus::description{""}}}, {abacus::name{"float32_constant"}, - abacus::constant{abacus::value{6666.0f}, abacus::description{""}}}, + abacus::constant{abacus::constant::float64{6666.0f}, + abacus::description{""}}}, {abacus::name{"boolean_constant"}, - abacus::constant{abacus::value{true}, abacus::description{""}}}, - {abacus::name{"string_constant"}, - abacus::constant{abacus::value{"hello"}, abacus::description{""}}}, - + abacus::constant{abacus::constant::boolean{true}, + abacus::description{""}}}, // Finally a metric that we do not initialize {abacus::name{"not_initialized_required"}, - abacus::uint64{abacus::counter, abacus::required, - abacus::description{""}}}, + abacus::uint64{abacus::kind::counter, abacus::description{""}}}, {abacus::name{"not_initialized_optional"}, - abacus::uint64{abacus::counter, abacus::optional, - abacus::description{""}}}}; + abacus::uint64{abacus::kind::counter, abacus::description{""}}}}; abacus::metrics metrics(infos); // Inirialize metrics auto uint64_required = - metrics.initialize_required("uint64_required", 1U); + metrics.initialize("uint64_required").set_value(1U); auto uint64_optional = - metrics.initialize_optional("uint64_optional"); + metrics.initialize("uint64_optional"); auto uint32_required = - metrics.initialize_required("uint32_required", 2U); + metrics.initialize("uint32_required").set_value(2U); auto uint32_optional = - metrics.initialize_optional("uint32_optional"); + metrics.initialize("uint32_optional"); auto int64_required = - metrics.initialize_required("int64_required", 3); - auto int64_optional = - metrics.initialize_optional("int64_optional"); + metrics.initialize("int64_required").set_value(3); + auto int64_optional = metrics.initialize("int64_optional"); auto int32_required = - metrics.initialize_required("int32_required", 4); - auto int32_optional = - metrics.initialize_optional("int32_optional"); + metrics.initialize("int32_required").set_value(4); + auto int32_optional = metrics.initialize("int32_optional"); auto float64_required = - metrics.initialize_required("float64_required", 5.0); + metrics.initialize("float64_required").set_value(5.0); auto float64_optional = - metrics.initialize_optional("float64_optional"); + metrics.initialize("float64_optional"); auto float32_required = - metrics.initialize_required("float32_required", 6.0); + metrics.initialize("float32_required").set_value(6.0); auto float32_optional = - metrics.initialize_optional("float32_optional"); + metrics.initialize("float32_optional"); auto boolean_required = - metrics.initialize_required("boolean_required", true); + metrics.initialize("boolean_required").set_value(true); auto boolean_optional = - metrics.initialize_optional("boolean_optional"); - auto enum8_required = - metrics.initialize_required("enum8_required", 0U); - auto enum8_optional = - metrics.initialize_optional("enum8_optional"); + metrics.initialize("boolean_optional"); + auto enum8_required = metrics.initialize("enum8_required") + .set_value(test_enum::value0); + auto enum8_optional = metrics.initialize("enum8_optional"); // Check all required values EXPECT_EQ(uint64_required.value(), 1U); @@ -506,7 +487,7 @@ TEST(test_metrics, reset) EXPECT_EQ(float64_required.value(), 5.0); EXPECT_EQ(float32_required.value(), 6.0); EXPECT_EQ(boolean_required.value(), true); - EXPECT_EQ(enum8_required.value(), 0U); + EXPECT_EQ(enum8_required.value(), test_enum::value0); // Check all optional values returns false for has_value EXPECT_FALSE(uint64_optional.has_value()); @@ -526,7 +507,7 @@ TEST(test_metrics, reset) float64_optional = 55.0; float32_optional = 66.0; boolean_optional = false; - enum8_optional = 1U; + enum8_optional = test_enum::value1; // Check all optional values EXPECT_EQ(uint64_optional.value(), 11U); @@ -536,7 +517,7 @@ TEST(test_metrics, reset) EXPECT_EQ(float64_optional.value(), 55.0); EXPECT_EQ(float32_optional.value(), 66.0); EXPECT_EQ(boolean_optional.value(), false); - EXPECT_EQ(enum8_optional.value(), 1U); + EXPECT_EQ(enum8_optional.value(), test_enum::value1); // Change and check all required values uint64_required = 111U; @@ -546,7 +527,7 @@ TEST(test_metrics, reset) float64_required = 555.0; float32_required = 666.0; boolean_required = false; - enum8_required = 2; + enum8_required = test_enum::value2; EXPECT_EQ(uint64_required.value(), 111U); EXPECT_EQ(uint32_required.value(), 222U); @@ -555,7 +536,7 @@ TEST(test_metrics, reset) EXPECT_EQ(float64_required.value(), 555.0); EXPECT_EQ(float32_required.value(), 666.0); EXPECT_EQ(boolean_required.value(), false); - EXPECT_EQ(enum8_required.value(), 2U); + EXPECT_EQ(enum8_required.value(), test_enum::value2); // Create a view to see the constants abacus::view view; @@ -571,7 +552,6 @@ TEST(test_metrics, reset) EXPECT_EQ(view.value("float64_constant").value(), 5555.0); EXPECT_EQ(view.value("float32_constant").value(), 6666.0); EXPECT_EQ(view.value("boolean_constant").value(), true); - EXPECT_EQ(view.value("enum8_constant").value(), 77U); // While we are at it, let's check the other values as well EXPECT_EQ(view.value("uint64_required").value(), 111U); @@ -609,7 +589,7 @@ TEST(test_metrics, reset) EXPECT_EQ(float64_required.value(), 5.0); EXPECT_EQ(float32_required.value(), 6.0); EXPECT_EQ(boolean_required.value(), true); - EXPECT_EQ(enum8_required.value(), 0U); + EXPECT_EQ(enum8_required.value(), test_enum::value0); // Check all optional values returns false for has_value EXPECT_FALSE(uint64_optional.has_value()); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index f6a2483c..ed01cd7c 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -29,21 +29,20 @@ TEST(test_to_json, to_json_minimal) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, abacus::required, + abacus::uint64{abacus::kind::counter, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, abacus::required, + abacus::int64{abacus::kind::gauge, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::constant{abacus::value{true}, + abacus::constant{abacus::constant::boolean{true}, abacus::description{"A boolean constant"}}}, {abacus::name{name3}, - abacus::enum8{abacus::required, - abacus::description{"An enum metric"}, + abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -51,9 +50,9 @@ TEST(test_to_json, to_json_minimal) abacus::metrics metrics(infos); - auto m0 = metrics.initialize_required(name0, 42); - auto m1 = metrics.initialize_required(name1, -42); - auto m3 = metrics.initialize_required(name3, 2); + auto m0 = metrics.initialize(name0).set_value(42); + auto m1 = metrics.initialize(name1).set_value(-42); + auto m3 = metrics.initialize(name3).set_value(2); (void)m0; (void)m1; @@ -156,21 +155,20 @@ TEST(test_to_json, to_json) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, abacus::required, + abacus::uint64{abacus::kind::counter, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}, abacus::min{uint64_t{0U}}, abacus::max{uint64_t{100U}}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, abacus::required, + abacus::int64{abacus::kind::gauge, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}, abacus::min{int64_t{-100}}, abacus::max{int64_t{100}}}}, {abacus::name{name2}, - abacus::constant{abacus::value{true}, + abacus::constant{abacus::constant::boolean{true}, abacus::description{"A boolean constant"}}}, {abacus::name{name3}, - abacus::enum8{abacus::required, - abacus::description{"An enum metric"}, + abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -178,10 +176,10 @@ TEST(test_to_json, to_json) abacus::metrics metrics(infos); - auto m0 = metrics.initialize_required(name0, 42); - auto m1 = metrics.initialize_required(name1, -42); - auto m3 = metrics.initialize_required( - name3, (uint8_t)test_enum::value1); + auto m0 = metrics.initialize(name0).set_value(42); + auto m1 = metrics.initialize(name1).set_value(-42); + auto m3 = + metrics.initialize(name3).set_value(test_enum::value2); m3 = test_enum::value2; diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 0b3cb5d9..170073e6 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -22,21 +22,20 @@ TEST(test_view, api) std::map infos = { {abacus::name{name0}, - abacus::uint64{abacus::counter, abacus::optional, + abacus::uint64{abacus::kind::counter, abacus::description{"An unsigned integer metric"}, abacus::unit{"bytes"}}}, {abacus::name{name1}, - abacus::int64{abacus::gauge, abacus::optional, + abacus::int64{abacus::kind::gauge, abacus::description{"A signed integer metric"}, abacus::unit{"USD"}}}, {abacus::name{name2}, abacus::constant{ - abacus::value{3.14}, + abacus::constant::float64{3.14}, abacus::description{"A constant floating point metric"}, abacus::unit{"ms"}}}, {abacus::name{name3}, - abacus::enum8{abacus::optional, - abacus::description{"An enum metric"}, + abacus::enum8{abacus::description{"An enum metric"}, {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, @@ -44,11 +43,11 @@ TEST(test_view, api) abacus::metrics metrics(infos); - auto metric0 = metrics.initialize_optional(name0); + auto metric0 = metrics.initialize(name0); - auto metric1 = metrics.initialize_optional(name1); + auto metric1 = metrics.initialize(name1); - auto metric3 = metrics.initialize_optional(name3); + auto metric3 = metrics.initialize(name3); std::vector value_data(metrics.value_bytes()); std::memcpy(value_data.data(), metrics.value_data(), metrics.value_bytes()); From 18db3bc5be8da86836b7c685da86a6a606418858 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 11:37:42 +0100 Subject: [PATCH 54/68] fixed tests --- src/abacus/constant.hpp | 25 +++--- src/abacus/detail/to_json.cpp | 22 +++++ src/abacus/metric.hpp | 2 +- src/abacus/metrics.cpp | 19 ++--- src/abacus/metrics.hpp | 2 +- src/abacus/view.cpp | 96 +++++++++++++++++---- test/src/test_info.cpp | 4 +- test/src/test_metric.cpp | 151 +++++++++++++++++++++++++++------- test/src/test_metrics.cpp | 100 +++++++++------------- test/src/test_to_json.cpp | 22 ++--- test/src/test_view.cpp | 3 +- 11 files changed, 299 insertions(+), 147 deletions(-) diff --git a/src/abacus/constant.hpp b/src/abacus/constant.hpp index ca3aaad8..4dabdbcf 100644 --- a/src/abacus/constant.hpp +++ b/src/abacus/constant.hpp @@ -18,33 +18,38 @@ inline namespace STEINWURF_ABACUS_VERSION struct constant { - struct int64 + struct uint64 { - int64_t value; + using type = uint64_t; + type value; }; - struct uint64 + struct int64 { - uint64_t value; + using type = int64_t; + type value; }; - struct boolean + struct float64 { - bool value; + using type = double; + type value; }; - struct float64 + struct boolean { - double value; + using type = bool; + type value; }; struct str { - std::string value; + using type = std::string; + type value; }; // The value of the constant - std::variant value; + std::variant value; // The description of the constant abacus::description description; diff --git a/src/abacus/detail/to_json.cpp b/src/abacus/detail/to_json.cpp index 4e4bcd84..93bdf1e3 100644 --- a/src/abacus/detail/to_json.cpp +++ b/src/abacus/detail/to_json.cpp @@ -36,6 +36,28 @@ auto to_json(const view& view, bool minimal) -> bourne::json { switch (metric.type_case()) { + case protobuf::Metric::kConstant: + { + switch (metric.constant().value_case()) + { + case protobuf::Constant::kUint64: + json[name] = metric.constant().uint64(); + break; + case protobuf::Constant::kInt64: + json[name] = metric.constant().int64(); + break; + case protobuf::Constant::kFloat64: + json[name] = metric.constant().float64(); + break; + case protobuf::Constant::kBoolean: + json[name] = metric.constant().boolean(); + break; + case protobuf::Constant::kString: + json[name] = metric.constant().string(); + break; + } + break; + } case protobuf::Metric::kUint64: { auto v = view.value(name); diff --git a/src/abacus/metric.hpp b/src/abacus/metric.hpp index 2cec656c..ccffb5d1 100644 --- a/src/abacus/metric.hpp +++ b/src/abacus/metric.hpp @@ -82,7 +82,7 @@ struct metric } m_memory[0] = 1; - std::memcpy(&value, m_memory + 1, sizeof(value_type)); + std::memcpy(m_memory + 1, &value, sizeof(value_type)); return *this; } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 1cd1d9af..8bf98cc8 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -28,7 +28,7 @@ metrics::metrics(metrics&& other) noexcept : m_metadata(std::move(other.m_metadata)), m_data(std::move(other.m_data)), m_metadata_bytes(other.m_metadata_bytes), m_hash(other.m_hash), m_value_bytes(other.m_value_bytes), m_offsets(std::move(other.m_offsets)), - m_resets(std::move(other.m_resets)) + m_initialized(std::move(other.m_initialized)) { other.m_metadata = protobuf::MetricsMetadata(); other.m_data.clear(); @@ -36,7 +36,7 @@ metrics::metrics(metrics&& other) noexcept : other.m_hash = 0; other.m_value_bytes = 0; other.m_offsets.clear(); - other.m_resets.clear(); + other.m_initialized.clear(); } metrics::metrics(const std::map& infos) @@ -273,6 +273,7 @@ metrics::metrics(const std::map& infos) [](const auto&) { assert(false && "Unsupported constant type"); }}, m.value); + m_initialized[name.value] = true; }, [&](const auto&) { assert(false && "Unsupported metric type"); }}, @@ -315,13 +316,13 @@ template [[nodiscard]] auto metrics::initialize(const std::string& name) -> metric { - assert(m_resets.find(name) == m_resets.end()); + assert(m_initialized.find(name) == m_initialized.end()); assert(m_offsets.find(name) != m_offsets.end()); std::size_t offset = m_offsets.at(name); metric m(m_data.data() + m_metadata_bytes + offset); - m_resets[name] = [m]() mutable { m.reset(); }; + m_initialized[name] = true; return m; } @@ -377,7 +378,7 @@ auto metrics::metadata_bytes() const -> std::size_t auto metrics::is_initialized(const std::string& name) const -> bool { - return m_resets.find(name) != m_resets.end(); + return m_initialized.find(name) != m_initialized.end(); } auto metrics::is_initialized() const -> bool @@ -395,11 +396,9 @@ auto metrics::is_initialized() const -> bool auto metrics::reset() -> void { - for (const auto& [name, reset] : m_resets) - { - (void)name; - reset(); - } + // Reset all metrics but keep the hash + std::memset(m_data.data() + m_metadata_bytes + sizeof(uint32_t), 0, + m_value_bytes - sizeof(uint32_t)); } } } diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index fdec979d..c3e43495 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -100,7 +100,7 @@ class metrics std::unordered_map m_offsets; /// Map to reset functions - only initialized metrics can be reset - std::unordered_map> m_resets; + std::unordered_map m_initialized; }; } } diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 308aaa0b..f1655190 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -6,6 +6,7 @@ #include "view.hpp" #include "boolean.hpp" +#include "constant.hpp" #include "detail/helpers.hpp" #include "enum8.hpp" #include "float32.hpp" @@ -28,6 +29,65 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { +namespace +{ +template +inline auto get_value(const uint8_t* data, bool is_big_endian) + -> std::optional +{ + assert(data != nullptr); + if (data[0] == 0) + { + // The metric is unset + return std::nullopt; + } + + if (is_big_endian) + { + return endian::big_endian::get(data + 1); + } + else + { + return endian::little_endian::get(data + 1); + } +} + +template <> +inline auto get_value(const uint8_t*, + bool) -> std::optional +{ + assert(false); + return std::nullopt; +} + +template +inline auto get_constant_value(const protobuf::Constant& constant) + -> std::optional +{ + switch (constant.value_case()) + { + case protobuf::Constant::ValueCase::kUint64: + return constant.uint64(); + case protobuf::Constant::ValueCase::kInt64: + return constant.int64(); + case protobuf::Constant::ValueCase::kFloat64: + return constant.float64(); + case protobuf::Constant::ValueCase::kBoolean: + return constant.boolean(); + default: + assert(false); + return std::nullopt; + } +} +template <> +inline auto get_constant_value( + const protobuf::Constant& constant) -> std::optional +{ + assert(constant.value_case() == protobuf::Constant::ValueCase::kString); + return constant.string(); +} +} + [[nodiscard]] auto view::set_metadata(const protobuf::MetricsMetadata& metadata) -> bool { @@ -98,25 +158,19 @@ auto view::value(const std::string& name) const assert(m_metadata.IsInitialized()); assert(m_value_data != nullptr); auto m = metric(name); - auto offset = detail::get_offset(m); - assert(offset < m_value_bytes); - - if (m_value_data[offset] == 0) + if (m.has_constant()) { - // Either the metric is unintialized or it's optional and has no value - return std::nullopt; - } - - if (m_metadata.endianness() == protobuf::Endianness::BIG) - { - return endian::big_endian::get(m_value_data + - offset + 1); + // Check that Metric is one of the expected constant types + assert((detail::is_in_variant_v)); + return get_constant_value(m.constant()); } else { - assert(m_metadata.endianness() == protobuf::Endianness::LITTLE); - return endian::little_endian::get(m_value_data + - offset + 1); + auto offset = detail::get_offset(m); + assert(offset < m_value_bytes); + return get_value(m_value_data + offset, + m_metadata.endianness() == + protobuf::Endianness::BIG); } } @@ -137,5 +191,17 @@ template auto view::value(const std::string& name) const -> std::optional; template auto view::value(const std::string& name) const -> std::optional; +// Constants +template auto view::value(const std::string& name) + const -> std::optional; +template auto view::value(const std::string& name) + const -> std::optional; +template auto view::value(const std::string& name) + const -> std::optional; +template auto view::value(const std::string& name) + const -> std::optional; +template auto view::value(const std::string& name) const + -> std::optional; + } } diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index 1b6ce89e..a273647b 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -14,8 +14,10 @@ template void integer_test() { using type = typename T::type; - { + SCOPED_TRACE(::testing::Message() + << "Testing integer metric: " << typeid(T).name()); + using optional = abacus::metric; uint8_t data[sizeof(type) + 1]; std::memset(data, 0, sizeof(data)); diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index e2fbc7e7..94b00ed0 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -28,40 +28,129 @@ TEST(test_metric, float_assignment) { uint8_t data[9]; std::memset(data, 0, sizeof(data)); - abacus::metric double_metric(data); EXPECT_TRUE(double_metric.is_initialized()); EXPECT_FALSE(double_metric.has_value()); double_metric = 1123.12; EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); - - // Assignment - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric = 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric = 1 / -0.0, ""); - - // Add and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric += 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric += 1 / -0.0, ""); - - // Subtract and Assign - // Check that assignment to NaN is not allowed - EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); - // Check that that assignment to -NaN is not allowed - EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); - // Check that that assignment to +Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / 0.0, ""); - // Check that that assignment to -Inf is not allowed - EXPECT_DEATH(double_metric -= 1 / -0.0, ""); } + +// TEST(test_metric, float_death1) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); +// } + +// TEST(test_metric, float_death2) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); +// } + +// TEST(test_metric, float_death3) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / 0.0, ""); +// } + +// TEST(test_metric, float_death4) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric = 1 / -0.0, ""); +// } + +// TEST(test_metric, float_death5) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); +// } + +// TEST(test_metric, float_death6) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); +// } + +// // Check that that assignment to +Inf is not allowed +// TEST(test_metric, float_death7) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// EXPECT_DEATH(double_metric += 1 / 0.0, ""); +// } + +// TEST(test_metric, float_death8) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric += 1 / -0.0, ""); +// } + +// TEST(test_metric, float_death9) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that assignment to NaN is not allowed +// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); +// } + +// TEST(test_metric, float_death10) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to -NaN is not allowed +// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); +// } + +// TEST(test_metric, float_death11) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to +Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); +// } + +// TEST(test_metric, float_death12) +// { +// uint8_t data[9]; +// std::memset(data, 0, sizeof(data)); +// abacus::metric double_metric(data); +// double_metric = 2; +// // Check that that assignment to -Inf is not allowed +// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +// } diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 62a36a65..4a484e9c 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -215,7 +215,7 @@ TEST(test_metrics, value_and_metadata_bytes) (void)m0; (void)m1; - EXPECT_EQ(metrics.metadata().ByteSizeLong(), 112U); + EXPECT_EQ(metrics.metadata().ByteSizeLong(), 108U); EXPECT_EQ(metrics.value_bytes(), sizeof(uint32_t) + // hash 1 + sizeof(uint64_t) + // metric0 has_value + value @@ -269,22 +269,22 @@ TEST(test_metrics, reset_counters) } static const std::vector expected_metadata = { - 0x08, 0x02, 0x1d, 0xa6, 0xbc, 0x77, 0x0c, 0x22, 0x2d, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x31, 0x12, 0x22, 0x1a, 0x20, 0x08, 0x0d, - 0x12, 0x17, 0x41, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x2a, 0x03, 0x55, 0x53, 0x44, 0x22, 0x34, 0x0a, 0x07, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x30, 0x12, 0x29, 0x12, 0x27, 0x08, 0x04, 0x12, - 0x1a, 0x41, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x20, 0x01, 0x2a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x22, 0x21, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, - 0x16, 0x42, 0x14, 0x08, 0x1f, 0x12, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, - 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x22, - 0x2c, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, 0x21, - 0x32, 0x1f, 0x08, 0x16, 0x12, 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, - 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x2a, 0x02, 0x6d, 0x73, + 0x08, 0x02, 0x1d, 0xb0, 0xd7, 0xc6, 0x24, 0x22, 0x21, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x33, 0x12, 0x16, 0x42, 0x14, 0x08, 0x1f, + 0x12, 0x10, 0x41, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x20, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x22, 0x2c, 0x0a, 0x07, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x32, 0x12, 0x21, 0x32, 0x1f, 0x08, 0x16, 0x12, + 0x17, 0x41, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x22, 0x02, 0x6d, 0x73, 0x22, 0x2d, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x31, 0x12, 0x22, 0x1a, 0x20, 0x08, 0x0d, 0x12, 0x17, 0x41, + 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, + 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x22, 0x03, + 0x55, 0x53, 0x44, 0x22, 0x34, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x30, 0x12, 0x29, 0x12, 0x27, 0x08, 0x04, 0x12, 0x1a, 0x41, 0x6e, + 0x20, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, + 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x18, 0x01, 0x22, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, }; static const std::vector expected_value_data = { @@ -422,24 +422,18 @@ TEST(test_metrics, reset) {abacus::name{"uint64_constant"}, abacus::constant{abacus::constant::uint64{1111}, abacus::description{""}}}, - {abacus::name{"uint32_constant"}, - abacus::constant{abacus::constant::uint64{2222}, - abacus::description{""}}}, {abacus::name{"int64_constant"}, - abacus::constant{abacus::constant::int64{3333}, - abacus::description{""}}}, - {abacus::name{"int32_constant"}, - abacus::constant{abacus::constant::uint64{4444}, + abacus::constant{abacus::constant::int64{2222}, abacus::description{""}}}, {abacus::name{"float64_constant"}, - abacus::constant{abacus::constant::float64{5555.0}, - abacus::description{""}}}, - {abacus::name{"float32_constant"}, - abacus::constant{abacus::constant::float64{6666.0f}, + abacus::constant{abacus::constant::float64{3333.0}, abacus::description{""}}}, {abacus::name{"boolean_constant"}, abacus::constant{abacus::constant::boolean{true}, abacus::description{""}}}, + {abacus::name{"string_constant"}, + abacus::constant{abacus::constant::str{"fivefivefivefive"}, + abacus::description{""}}}, // Finally a metric that we do not initialize {abacus::name{"not_initialized_required"}, abacus::uint64{abacus::kind::counter, abacus::description{""}}}, @@ -545,13 +539,16 @@ TEST(test_metrics, reset) view.set_value_data(metrics.value_data(), metrics.value_bytes())); // Check all constant values - EXPECT_EQ(view.value("uint64_constant").value(), 1111U); - EXPECT_EQ(view.value("uint32_constant").value(), 2222U); - EXPECT_EQ(view.value("int64_constant").value(), 3333); - EXPECT_EQ(view.value("int32_constant").value(), 4444); - EXPECT_EQ(view.value("float64_constant").value(), 5555.0); - EXPECT_EQ(view.value("float32_constant").value(), 6666.0); - EXPECT_EQ(view.value("boolean_constant").value(), true); + EXPECT_EQ(view.value("uint64_constant").value(), + 1111U); + EXPECT_EQ(view.value("int64_constant").value(), + 2222); + EXPECT_EQ(view.value("float64_constant").value(), + 3333.0); + EXPECT_EQ(view.value("boolean_constant").value(), + true); + EXPECT_EQ(view.value("string_constant").value(), + "fivefivefivefive"); // While we are at it, let's check the other values as well EXPECT_EQ(view.value("uint64_required").value(), 111U); @@ -581,16 +578,6 @@ TEST(test_metrics, reset) // Reset all values metrics.reset(); - // Check all required values - EXPECT_EQ(uint64_required.value(), 1U); - EXPECT_EQ(uint32_required.value(), 2U); - EXPECT_EQ(int64_required.value(), 3); - EXPECT_EQ(int32_required.value(), 4); - EXPECT_EQ(float64_required.value(), 5.0); - EXPECT_EQ(float32_required.value(), 6.0); - EXPECT_EQ(boolean_required.value(), true); - EXPECT_EQ(enum8_required.value(), test_enum::value0); - // Check all optional values returns false for has_value EXPECT_FALSE(uint64_optional.has_value()); EXPECT_FALSE(uint32_optional.has_value()); @@ -606,22 +593,13 @@ TEST(test_metrics, reset) view.set_value_data(metrics.value_data(), metrics.value_bytes())); // Check all constant values - EXPECT_EQ(view.value("uint64_constant"), 1111U); - EXPECT_EQ(view.value("uint32_constant"), 2222U); - EXPECT_EQ(view.value("int64_constant"), 3333); - EXPECT_EQ(view.value("int32_constant"), 4444); - EXPECT_EQ(view.value("float64_constant"), 5555.0); - EXPECT_EQ(view.value("float32_constant"), 6666.0); - EXPECT_EQ(view.value("boolean_constant"), true); - - EXPECT_EQ(view.value("uint64_required").value(), 1U); - EXPECT_EQ(view.value("uint32_required").value(), 2U); - EXPECT_EQ(view.value("int64_required").value(), 3); - EXPECT_EQ(view.value("int32_required").value(), 4); - EXPECT_EQ(view.value("float64_required").value(), 5.0); - EXPECT_EQ(view.value("float32_required").value(), 6.0); - EXPECT_EQ(view.value("boolean_required").value(), true); - EXPECT_EQ(view.value("enum8_required").value(), 0U); + EXPECT_EQ(view.value("uint64_constant"), 1111U); + EXPECT_EQ(view.value("int64_constant"), 2222); + EXPECT_EQ(view.value("float64_constant"), + 3333.0); + EXPECT_EQ(view.value("boolean_constant"), true); + EXPECT_EQ(view.value("string_constant"), + "fivefivefivefive"); EXPECT_FALSE(view.value("uint64_optional").has_value()); EXPECT_FALSE(view.value("uint32_optional").has_value()); diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index ed01cd7c..ab70946ef 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -71,10 +71,8 @@ TEST(test_to_json, to_json_minimal) static const char* expected_json = R"({ "metric0" : { "uint64" : { - "counter" : { - "optional" : false - }, "description" : "An unsigned integer metric", + "kind" : "COUNTER", "max" : "100", "min" : "0", "offset" : 4, @@ -85,9 +83,7 @@ static const char* expected_json = R"({ "metric1" : { "int64" : { "description" : "A signed integer metric", - "gauge" : { - "optional" : false - }, + "kind" : "GAUGE", "max" : "100", "min" : "-100", "offset" : 13, @@ -96,22 +92,16 @@ static const char* expected_json = R"({ "value" : -42 }, "metric2" : { - "boolean" : { - "constant" : { - - }, - "description" : "A boolean constant", - "offset" : 22 + "constant" : { + "boolean" : true, + "description" : "A boolean constant" }, "value" : true }, "metric3" : { "enum8" : { "description" : "An enum metric", - "gauge" : { - "optional" : false - }, - "offset" : 24, + "offset" : 22, "values" : { "0" : { "description" : "The value for 0", diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index 170073e6..c13736ba 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -69,7 +69,8 @@ TEST(test_view, api) std::optional view_value0 = view.value(name0); std::optional view_value1 = view.value(name1); - std::optional view_value2 = view.value(name2); + std::optional view_value2 = + view.value(name2); std::optional view_value3 = view.value(name3); EXPECT_FALSE(view_value0.has_value()); From 994d96dedb96eae383df23dda4bab28cc5ca6d62 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 11:45:04 +0100 Subject: [PATCH 55/68] rm required --- test/src/test_metrics.cpp | 257 ++++++++++++++------------------------ 1 file changed, 96 insertions(+), 161 deletions(-) diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 4a484e9c..52f0063e 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -385,39 +385,22 @@ TEST(test_metrics, protocol_version) TEST(test_metrics, reset) { - // Create one of each metric both required and optional + // Create one of each metric std::map infos = { - {abacus::name{"uint64_required"}, + {abacus::name{"uint64"}, abacus::uint64{abacus::kind::counter, abacus::description{""}}}, - {abacus::name{"uint64_optional"}, - abacus::uint64{abacus::kind::counter, abacus::description{""}}}, - {abacus::name{"uint32_required"}, - abacus::uint32{abacus::kind::counter, abacus::description{""}}}, - {abacus::name{"uint32_optional"}, + {abacus::name{"uint32"}, abacus::uint32{abacus::kind::counter, abacus::description{""}}}, - {abacus::name{"int64_required"}, - abacus::int64{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"int64_optional"}, + {abacus::name{"int64"}, abacus::int64{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"int32_required"}, + {abacus::name{"int32"}, abacus::int32{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"int32_optional"}, - abacus::int32{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"float64_required"}, - abacus::float64{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"float64_optional"}, + {abacus::name{"float64"}, abacus::float64{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"float32_required"}, + {abacus::name{"float32"}, abacus::float32{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"float32_optional"}, - abacus::float32{abacus::kind::gauge, abacus::description{""}}}, - {abacus::name{"boolean_required"}, - abacus::boolean{abacus::description{""}}}, - {abacus::name{"boolean_optional"}, - abacus::boolean{abacus::description{""}}}, - {abacus::name{"enum8_required"}, - abacus::enum8{abacus::description{""}, {{0, {"", ""}}}}}, - {abacus::name{"enum8_optional"}, + {abacus::name{"boolean"}, abacus::boolean{abacus::description{""}}}, + {abacus::name{"enum8"}, abacus::enum8{abacus::description{""}, {{0, {"", ""}}}}}, {abacus::name{"uint64_constant"}, abacus::constant{abacus::constant::uint64{1111}, @@ -435,102 +418,69 @@ TEST(test_metrics, reset) abacus::constant{abacus::constant::str{"fivefivefivefive"}, abacus::description{""}}}, // Finally a metric that we do not initialize - {abacus::name{"not_initialized_required"}, - abacus::uint64{abacus::kind::counter, abacus::description{""}}}, - {abacus::name{"not_initialized_optional"}, + {abacus::name{"not_initialized"}, abacus::uint64{abacus::kind::counter, abacus::description{""}}}}; abacus::metrics metrics(infos); - // Inirialize metrics - auto uint64_required = - metrics.initialize("uint64_required").set_value(1U); - auto uint64_optional = - metrics.initialize("uint64_optional"); - auto uint32_required = - metrics.initialize("uint32_required").set_value(2U); - auto uint32_optional = - metrics.initialize("uint32_optional"); - auto int64_required = - metrics.initialize("int64_required").set_value(3); - auto int64_optional = metrics.initialize("int64_optional"); - auto int32_required = - metrics.initialize("int32_required").set_value(4); - auto int32_optional = metrics.initialize("int32_optional"); - auto float64_required = - metrics.initialize("float64_required").set_value(5.0); - auto float64_optional = - metrics.initialize("float64_optional"); - auto float32_required = - metrics.initialize("float32_required").set_value(6.0); - auto float32_optional = - metrics.initialize("float32_optional"); - auto boolean_required = - metrics.initialize("boolean_required").set_value(true); - auto boolean_optional = - metrics.initialize("boolean_optional"); - auto enum8_required = metrics.initialize("enum8_required") - .set_value(test_enum::value0); - auto enum8_optional = metrics.initialize("enum8_optional"); - - // Check all required values - EXPECT_EQ(uint64_required.value(), 1U); - EXPECT_EQ(uint32_required.value(), 2U); - EXPECT_EQ(int64_required.value(), 3); - EXPECT_EQ(int32_required.value(), 4); - EXPECT_EQ(float64_required.value(), 5.0); - EXPECT_EQ(float32_required.value(), 6.0); - EXPECT_EQ(boolean_required.value(), true); - EXPECT_EQ(enum8_required.value(), test_enum::value0); - - // Check all optional values returns false for has_value - EXPECT_FALSE(uint64_optional.has_value()); - EXPECT_FALSE(uint32_optional.has_value()); - EXPECT_FALSE(int64_optional.has_value()); - EXPECT_FALSE(int32_optional.has_value()); - EXPECT_FALSE(float64_optional.has_value()); - EXPECT_FALSE(float32_optional.has_value()); - EXPECT_FALSE(boolean_optional.has_value()); - EXPECT_FALSE(enum8_optional.has_value()); - - // Set all optional values to some value - uint64_optional = 11U; - uint32_optional = 22U; - int64_optional = 33; - int32_optional = 44; - float64_optional = 55.0; - float32_optional = 66.0; - boolean_optional = false; - enum8_optional = test_enum::value1; - - // Check all optional values - EXPECT_EQ(uint64_optional.value(), 11U); - EXPECT_EQ(uint32_optional.value(), 22U); - EXPECT_EQ(int64_optional.value(), 33); - EXPECT_EQ(int32_optional.value(), 44); - EXPECT_EQ(float64_optional.value(), 55.0); - EXPECT_EQ(float32_optional.value(), 66.0); - EXPECT_EQ(boolean_optional.value(), false); - EXPECT_EQ(enum8_optional.value(), test_enum::value1); - - // Change and check all required values - uint64_required = 111U; - uint32_required = 222U; - int64_required = 333; - int32_required = 444; - float64_required = 555.0; - float32_required = 666.0; - boolean_required = false; - enum8_required = test_enum::value2; - - EXPECT_EQ(uint64_required.value(), 111U); - EXPECT_EQ(uint32_required.value(), 222U); - EXPECT_EQ(int64_required.value(), 333); - EXPECT_EQ(int32_required.value(), 444); - EXPECT_EQ(float64_required.value(), 555.0); - EXPECT_EQ(float32_required.value(), 666.0); - EXPECT_EQ(boolean_required.value(), false); - EXPECT_EQ(enum8_required.value(), test_enum::value2); + // Initialize metrics + auto uint64 = metrics.initialize("uint64"); + auto uint32 = metrics.initialize("uint32"); + auto int64 = metrics.initialize("int64"); + auto int32 = metrics.initialize("int32"); + auto float64 = metrics.initialize("float64"); + auto float32 = metrics.initialize("float32"); + auto boolean = metrics.initialize("boolean"); + auto enum8 = metrics.initialize("enum8"); + + // Check that all metric returns false for has_value + EXPECT_FALSE(uint64.has_value()); + EXPECT_FALSE(uint32.has_value()); + EXPECT_FALSE(int64.has_value()); + EXPECT_FALSE(int32.has_value()); + EXPECT_FALSE(float64.has_value()); + EXPECT_FALSE(float32.has_value()); + EXPECT_FALSE(boolean.has_value()); + EXPECT_FALSE(enum8.has_value()); + + // Set all values to some value + uint64 = 11U; + uint32 = 22U; + int64 = 33; + int32 = 44; + float64 = 55.0; + float32 = 66.0; + boolean = false; + enum8 = test_enum::value1; + + // Check all values + EXPECT_EQ(uint64.value(), 11U); + EXPECT_EQ(uint32.value(), 22U); + EXPECT_EQ(int64.value(), 33); + EXPECT_EQ(int32.value(), 44); + EXPECT_EQ(float64.value(), 55.0); + EXPECT_EQ(float32.value(), 66.0); + EXPECT_EQ(boolean.value(), false); + EXPECT_EQ(enum8.value(), test_enum::value1); + + // Change and check all values (now using set_value function) + uint64.set_value(111U); + uint32.set_value(222U); + int64.set_value(333); + int32.set_value(444); + float64.set_value(555.0); + float32.set_value(666.0); + boolean.set_value(true); + enum8.set_value(test_enum::value2); + + EXPECT_EQ(uint64.value(), 111U); + EXPECT_EQ(uint32.value(), 222U); + EXPECT_EQ(int64.value(), 333); + EXPECT_EQ(int32.value(), 444); + EXPECT_EQ(float64.value(), 555.0); + EXPECT_EQ(float32.value(), 666.0); + EXPECT_EQ(boolean.value(), true); + EXPECT_EQ(enum8.value(), test_enum::value2); // Create a view to see the constants abacus::view view; @@ -551,42 +501,30 @@ TEST(test_metrics, reset) "fivefivefivefive"); // While we are at it, let's check the other values as well - EXPECT_EQ(view.value("uint64_required").value(), 111U); - EXPECT_EQ(view.value("uint32_required").value(), 222U); - EXPECT_EQ(view.value("int64_required").value(), 333); - EXPECT_EQ(view.value("int32_required").value(), 444); - EXPECT_EQ(view.value("float64_required").value(), 555.0); - EXPECT_EQ(view.value("float32_required").value(), 666.0); - EXPECT_EQ(view.value("boolean_required").value(), false); - EXPECT_EQ(view.value("enum8_required").value(), 2U); - - EXPECT_EQ(view.value("uint64_optional").value(), 11U); - EXPECT_EQ(view.value("uint32_optional").value(), 22U); - EXPECT_EQ(view.value("int64_optional").value(), 33); - EXPECT_EQ(view.value("int32_optional").value(), 44); - EXPECT_EQ(view.value("float64_optional").value(), 55.0); - EXPECT_EQ(view.value("float32_optional").value(), 66.0); - EXPECT_EQ(view.value("boolean_optional").value(), false); - EXPECT_EQ(view.value("enum8_optional").value(), 1U); + EXPECT_EQ(view.value("uint64").value(), 111U); + EXPECT_EQ(view.value("uint32").value(), 222U); + EXPECT_EQ(view.value("int64").value(), 333); + EXPECT_EQ(view.value("int32").value(), 444); + EXPECT_EQ(view.value("float64").value(), 555.0); + EXPECT_EQ(view.value("float32").value(), 666.0); + EXPECT_EQ(view.value("boolean").value(), true); + EXPECT_EQ(view.value("enum8").value(), 2U); // And finally the not initialized value - EXPECT_FALSE( - view.value("not_initialized_required").has_value()); - EXPECT_FALSE( - view.value("not_initialized_optional").has_value()); + EXPECT_FALSE(view.value("not_initialized").has_value()); // Reset all values metrics.reset(); - // Check all optional values returns false for has_value - EXPECT_FALSE(uint64_optional.has_value()); - EXPECT_FALSE(uint32_optional.has_value()); - EXPECT_FALSE(int64_optional.has_value()); - EXPECT_FALSE(int32_optional.has_value()); - EXPECT_FALSE(float64_optional.has_value()); - EXPECT_FALSE(float32_optional.has_value()); - EXPECT_FALSE(boolean_optional.has_value()); - EXPECT_FALSE(enum8_optional.has_value()); + // Check all values returns false for has_value + EXPECT_FALSE(uint64.has_value()); + EXPECT_FALSE(uint32.has_value()); + EXPECT_FALSE(int64.has_value()); + EXPECT_FALSE(int32.has_value()); + EXPECT_FALSE(float64.has_value()); + EXPECT_FALSE(float32.has_value()); + EXPECT_FALSE(boolean.has_value()); + EXPECT_FALSE(enum8.has_value()); // Update view and check all constant values ASSERT_TRUE( @@ -601,17 +539,14 @@ TEST(test_metrics, reset) EXPECT_EQ(view.value("string_constant"), "fivefivefivefive"); - EXPECT_FALSE(view.value("uint64_optional").has_value()); - EXPECT_FALSE(view.value("uint32_optional").has_value()); - EXPECT_FALSE(view.value("int64_optional").has_value()); - EXPECT_FALSE(view.value("int32_optional").has_value()); - EXPECT_FALSE(view.value("float64_optional").has_value()); - EXPECT_FALSE(view.value("float32_optional").has_value()); - EXPECT_FALSE(view.value("boolean_optional").has_value()); - EXPECT_FALSE(view.value("enum8_optional").has_value()); - - EXPECT_FALSE( - view.value("not_initialized_required").has_value()); - EXPECT_FALSE( - view.value("not_initialized_optional").has_value()); + EXPECT_FALSE(view.value("uint64").has_value()); + EXPECT_FALSE(view.value("uint32").has_value()); + EXPECT_FALSE(view.value("int64").has_value()); + EXPECT_FALSE(view.value("int32").has_value()); + EXPECT_FALSE(view.value("float64").has_value()); + EXPECT_FALSE(view.value("float32").has_value()); + EXPECT_FALSE(view.value("boolean").has_value()); + EXPECT_FALSE(view.value("enum8").has_value()); + + EXPECT_FALSE(view.value("not_initialized").has_value()); } From 110563eb45e5c8ca291db96c6192045c9b88606e Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 11:54:21 +0100 Subject: [PATCH 56/68] no more optional --- src/abacus/metric.hpp | 2 +- src/abacus/metrics.hpp | 4 +- src/abacus/view.cpp | 11 +-- test/src/test_info.cpp | 151 +++++++++++++++++++---------------------- 4 files changed, 78 insertions(+), 90 deletions(-) diff --git a/src/abacus/metric.hpp b/src/abacus/metric.hpp index ccffb5d1..76524807 100644 --- a/src/abacus/metric.hpp +++ b/src/abacus/metric.hpp @@ -25,7 +25,7 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -/// An optional metric class for most metrics +/// A class that can be used to store and manipulate the memory of a metric. template struct metric { diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index c3e43495..64a22214 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -53,9 +53,7 @@ class metrics /// @return true if all metrics have been initialized auto is_initialized() const -> bool; - /// Reset all metrics to their initial values - /// Optional values will be reset to std::nullopt unless they were set - /// during initialization. + /// Reset all metrics to be unset auto reset() -> void; /// @return the pointer to the metadata part of the metrics. diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index f1655190..9c66311d 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -56,13 +56,15 @@ template <> inline auto get_value(const uint8_t*, bool) -> std::optional { + // This function should never be called, but we need it to silence the + // compiler assert(false); return std::nullopt; } template -inline auto get_constant_value(const protobuf::Constant& constant) - -> std::optional +inline auto get_constant_value(const protobuf::Constant& constant) -> + typename Metric::type { switch (constant.value_case()) { @@ -75,13 +77,12 @@ inline auto get_constant_value(const protobuf::Constant& constant) case protobuf::Constant::ValueCase::kBoolean: return constant.boolean(); default: - assert(false); - return std::nullopt; + throw std::runtime_error("Invalid constant type"); } } template <> inline auto get_constant_value( - const protobuf::Constant& constant) -> std::optional + const protobuf::Constant& constant) -> constant::str::type { assert(constant.value_case() == protobuf::Constant::ValueCase::kString); return constant.string(); diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp index a273647b..36a026ee 100644 --- a/test/src/test_info.cpp +++ b/test/src/test_info.cpp @@ -14,30 +14,24 @@ template void integer_test() { using type = typename T::type; - { - SCOPED_TRACE(::testing::Message() - << "Testing integer metric: " << typeid(T).name()); - - using optional = abacus::metric; - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - optional o; - EXPECT_FALSE(o.is_initialized()); - o = optional(data); - EXPECT_TRUE(o.is_initialized()); - EXPECT_FALSE(o.has_value()); - o = 10U; - EXPECT_TRUE(o.has_value()); - EXPECT_EQ(o.value(), type{10}); - o += 12; - o -= 2; - ++o; - --o; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = 10U; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), type{10}); + m += 12; + m -= 2; + ++m; + --m; - EXPECT_EQ(o.value(), type{20}); - o.reset(); - EXPECT_FALSE(o.has_value()); - } + EXPECT_EQ(m.value(), type{20}); + m.reset(); + EXPECT_FALSE(m.has_value()); } TEST(test_info, integer) @@ -52,28 +46,24 @@ template void floating_point_test() { using type = typename T::type; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = 10.0; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), 10.0); + m += 12.0; + m -= 2.0; + ++m; + --m; - { - using optional = abacus::metric; - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - optional o; - EXPECT_FALSE(o.is_initialized()); - o = optional(data); - EXPECT_TRUE(o.is_initialized()); - EXPECT_FALSE(o.has_value()); - o = 10.0; - EXPECT_TRUE(o.has_value()); - EXPECT_EQ(o.value(), 10.0); - o += 12.0; - o -= 2.0; - ++o; - --o; - - EXPECT_EQ(o.value(), 20.0); - o.reset(); - EXPECT_FALSE(o.has_value()); - } + EXPECT_EQ(m.value(), 20.0); + m.reset(); + EXPECT_FALSE(m.has_value()); } TEST(test_info, floating_point) @@ -85,22 +75,21 @@ TEST(test_info, floating_point) TEST(test_info, boolean) { - { - uint8_t data[sizeof(bool) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::metric o; - EXPECT_FALSE(o.is_initialized()); - o = abacus::metric(data); - EXPECT_TRUE(o.is_initialized()); - EXPECT_FALSE(o.has_value()); - o = true; - EXPECT_TRUE(o.has_value()); - EXPECT_EQ(o.value(), true); - o = false; - EXPECT_EQ(o.value(), false); - o.reset(); - EXPECT_FALSE(o.has_value()); - } + + uint8_t data[sizeof(bool) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = true; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), true); + m = false; + EXPECT_EQ(m.value(), false); + m.reset(); + EXPECT_FALSE(m.has_value()); } namespace { @@ -118,28 +107,28 @@ TEST(test_info, enum8) { uint8_t data[sizeof(uint8_t) + 1]; std::memset(data, 0, sizeof(data)); - abacus::metric o; - EXPECT_FALSE(o.is_initialized()); - o = abacus::metric(data); - EXPECT_TRUE(o.is_initialized()); - EXPECT_FALSE(o.has_value()); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); - o.set_value(test_enum::value0); - EXPECT_EQ(o.value(), test_enum::value0); - o.set_value(test_enum::value1); - EXPECT_EQ(o.value(), test_enum::value1); - o.set_value(test_enum::value2); - EXPECT_EQ(o.value(), test_enum::value2); - o.set_value(test_enum::value3); - EXPECT_EQ(o.value(), test_enum::value3); + m.set_value(test_enum::value0); + EXPECT_EQ(m.value(), test_enum::value0); + m.set_value(test_enum::value1); + EXPECT_EQ(m.value(), test_enum::value1); + m.set_value(test_enum::value2); + EXPECT_EQ(m.value(), test_enum::value2); + m.set_value(test_enum::value3); + EXPECT_EQ(m.value(), test_enum::value3); - o = test_enum::value0; - EXPECT_EQ(o.value(), test_enum::value0); - o = test_enum::value1; - EXPECT_EQ(o.value(), test_enum::value1); - o = test_enum::value2; - EXPECT_EQ(o.value(), test_enum::value2); - o = test_enum::value3; - EXPECT_EQ(o.value(), test_enum::value3); + m = test_enum::value0; + EXPECT_EQ(m.value(), test_enum::value0); + m = test_enum::value1; + EXPECT_EQ(m.value(), test_enum::value1); + m = test_enum::value2; + EXPECT_EQ(m.value(), test_enum::value2); + m = test_enum::value3; + EXPECT_EQ(m.value(), test_enum::value3); } } From 2b08c5d61f41241493f9973a8d8b6f8ee0e38487 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 11:56:14 +0100 Subject: [PATCH 57/68] fix oldy --- src/abacus/metrics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 8bf98cc8..ae243291 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -249,7 +249,7 @@ metrics::metrics(const std::map& infos) // represents whether the metric is set or not. m_value_bytes += 1; }, - [&](const constant& m) + [this, &metric, name](const constant& m) { auto* typed_metric = metric.mutable_constant(); typed_metric->set_description(m.description.value); From c77bfeea640cca658ed25b3e71b3ddc4fb3da655 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 11:58:04 +0100 Subject: [PATCH 58/68] fix oldy --- src/abacus/metrics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index ae243291..0154747b 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -53,9 +53,9 @@ metrics::metrics(const std::map& infos) for (auto [name, info] : infos) { protobuf::Metric metric; - + std::string name_str = name.value; // Save the offset of the metric - m_offsets.emplace(name.value, m_value_bytes); + m_offsets.emplace(name_str, m_value_bytes); std::visit( detail::overload{ @@ -249,7 +249,7 @@ metrics::metrics(const std::map& infos) // represents whether the metric is set or not. m_value_bytes += 1; }, - [this, &metric, name](const constant& m) + [&](const constant& m) { auto* typed_metric = metric.mutable_constant(); typed_metric->set_description(m.description.value); @@ -273,7 +273,7 @@ metrics::metrics(const std::map& infos) [](const auto&) { assert(false && "Unsupported constant type"); }}, m.value); - m_initialized[name.value] = true; + m_initialized[name_str] = true; }, [&](const auto&) { assert(false && "Unsupported metric type"); }}, From fe36c6e30d49d9324ff74748f1fd04cab6ee6573 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 11:58:36 +0100 Subject: [PATCH 59/68] fix oldy --- src/abacus/detail/to_json.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/abacus/detail/to_json.cpp b/src/abacus/detail/to_json.cpp index 93bdf1e3..cce732da 100644 --- a/src/abacus/detail/to_json.cpp +++ b/src/abacus/detail/to_json.cpp @@ -55,6 +55,8 @@ auto to_json(const view& view, bool minimal) -> bourne::json case protobuf::Constant::kString: json[name] = metric.constant().string(); break; + case protobuf::Constant::VALUE_NOT_SET: + break; } break; } From 4d9f50c0aa61081d7cdf771c2faa9957826ebb98 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 12:53:20 +0100 Subject: [PATCH 60/68] fix docs --- docs/conf.py | 6 ++-- docs/user_api/availability.rst | 2 -- docs/user_api/{parse.rst => metric.rst} | 2 +- .../{metrics.rst => metric_info/constant.rst} | 3 +- docs/user_api/metric_info/metric_info.rst | 1 + docs/user_api/user_api.rst | 1 - src/abacus/constant.hpp | 18 ++++++++-- src/abacus/description.hpp | 11 ------ src/abacus/detail/helpers.hpp | 35 ------------------ src/abacus/enum8.hpp | 4 +++ src/abacus/info.hpp | 2 +- src/abacus/kind.hpp | 5 ++- src/abacus/metrics.hpp | 4 +-- src/abacus/view.cpp | 36 ++++++++++++++++++- 14 files changed, 69 insertions(+), 61 deletions(-) delete mode 100644 docs/user_api/availability.rst rename docs/user_api/{parse.rst => metric.rst} (51%) rename docs/user_api/{metrics.rst => metric_info/constant.rst} (50%) diff --git a/docs/conf.py b/docs/conf.py index 584e2a8c..b1fea823 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,8 +22,8 @@ wurfapi = { "source_paths": [ # API - "../src/abacus/availability.hpp", "../src/abacus/boolean.hpp", + "../src/abacus/constant.hpp", "../src/abacus/description.hpp", "../src/abacus/enum8.hpp", "../src/abacus/float32.hpp", @@ -33,15 +33,17 @@ "../src/abacus/int64.hpp", "../src/abacus/kind.hpp", "../src/abacus/max.hpp", + "../src/abacus/metric.hpp", "../src/abacus/metrics.hpp", "../src/abacus/min.hpp", "../src/abacus/name.hpp", - "../src/abacus/parse.hpp", + "../src/abacus/parse_metadata.hpp", "../src/abacus/protocol_version.hpp", "../src/abacus/to_json.hpp", "../src/abacus/uint32.hpp", "../src/abacus/uint64.hpp", "../src/abacus/unit.hpp", + "../src/abacus/version.hpp", "../src/abacus/view.hpp", ], "recursive": False, diff --git a/docs/user_api/availability.rst b/docs/user_api/availability.rst deleted file mode 100644 index 9e05d16a..00000000 --- a/docs/user_api/availability.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. wurfapi:: type_alias_synopsis.rst - :selector: abacus::availability diff --git a/docs/user_api/parse.rst b/docs/user_api/metric.rst similarity index 51% rename from docs/user_api/parse.rst rename to docs/user_api/metric.rst index 25583316..02c7b076 100644 --- a/docs/user_api/parse.rst +++ b/docs/user_api/metric.rst @@ -1,2 +1,2 @@ .. wurfapi:: class_synopsis.rst - :selector: abacus::parse + :selector: abacus::metric diff --git a/docs/user_api/metrics.rst b/docs/user_api/metric_info/constant.rst similarity index 50% rename from docs/user_api/metrics.rst rename to docs/user_api/metric_info/constant.rst index e63b531f..b3dd9702 100644 --- a/docs/user_api/metrics.rst +++ b/docs/user_api/metric_info/constant.rst @@ -1,3 +1,2 @@ .. wurfapi:: class_synopsis.rst - :selector: abacus::metrics - + :selector: abacus::constant diff --git a/docs/user_api/metric_info/metric_info.rst b/docs/user_api/metric_info/metric_info.rst index f6379aa7..cb03e5f9 100644 --- a/docs/user_api/metric_info/metric_info.rst +++ b/docs/user_api/metric_info/metric_info.rst @@ -10,6 +10,7 @@ Overview of the metric info types. .. toctree:: :maxdepth: 2 + constant uint64 uint32 int64 diff --git a/docs/user_api/user_api.rst b/docs/user_api/user_api.rst index 508a1fc3..34f65f9f 100644 --- a/docs/user_api/user_api.rst +++ b/docs/user_api/user_api.rst @@ -15,7 +15,6 @@ Overview of the public API. metric_info/metric_info kind description - availability unit min max diff --git a/src/abacus/constant.hpp b/src/abacus/constant.hpp index 4dabdbcf..22dc5ee2 100644 --- a/src/abacus/constant.hpp +++ b/src/abacus/constant.hpp @@ -14,37 +14,51 @@ namespace abacus inline namespace STEINWURF_ABACUS_VERSION { -/// Tag type representing a constant kind. +/// A constant value stored in the metadata struct constant { - + /// A 64-bit unsigned integer struct uint64 { + /// The type used to store the value using type = uint64_t; + /// The value of the constant type value; }; + /// A 64-bit signed integer struct int64 { + /// The type used to store the value using type = int64_t; + /// The value of the constant type value; }; + /// A 64-bit floating point number struct float64 { + /// The type used to store the value using type = double; + /// The value of the constant type value; }; + /// A boolean value struct boolean { + /// The type used to store the value using type = bool; + /// The value of the constant type value; }; + /// A string value struct str { + /// The type used to store the value using type = std::string; + /// The value of the constant type value; }; diff --git a/src/abacus/description.hpp b/src/abacus/description.hpp index a33308b4..e663b5c2 100644 --- a/src/abacus/description.hpp +++ b/src/abacus/description.hpp @@ -26,16 +26,5 @@ struct description /// The description string std::string value; }; - -inline bool operator==(const description& lhs, const description& rhs) -{ - return lhs.value == rhs.value; -} - -inline bool operator<(const description& lhs, const description& rhs) -{ - return lhs.value < rhs.value; -} - } } diff --git a/src/abacus/detail/helpers.hpp b/src/abacus/detail/helpers.hpp index caf9813d..ee762963 100644 --- a/src/abacus/detail/helpers.hpp +++ b/src/abacus/detail/helpers.hpp @@ -29,41 +29,6 @@ struct is_in_variant> template constexpr bool is_in_variant_v = is_in_variant::value; -template -static inline auto call_type(const protobuf::Metric& metric, const Func& func) - -> decltype(func(metric.uint64())) -{ - switch (metric.type_case()) - { - case protobuf::Metric::kUint64: - return func(metric.uint64()); - case protobuf::Metric::kInt64: - return func(metric.int64()); - case protobuf::Metric::kUint32: - return func(metric.uint32()); - case protobuf::Metric::kInt32: - return func(metric.int32()); - case protobuf::Metric::kFloat64: - return func(metric.float64()); - case protobuf::Metric::kFloat32: - return func(metric.float32()); - case protobuf::Metric::kBoolean: - return func(metric.boolean()); - case protobuf::Metric::kEnum8: - return func(metric.enum8()); - default: - // This should never be reached - assert(false); - using ReturnType = decltype(func(metric.uint64())); - return ReturnType(); - } -} - -static inline std::size_t get_offset(const protobuf::Metric& m) -{ - return call_type(m, [](const auto& metric) { return metric.offset(); }); -} - } } } diff --git a/src/abacus/enum8.hpp b/src/abacus/enum8.hpp index bcf2240c..3b3e871e 100644 --- a/src/abacus/enum8.hpp +++ b/src/abacus/enum8.hpp @@ -21,18 +21,22 @@ inline namespace STEINWURF_ABACUS_VERSION /// A enumeration metric struct enum8 { + /// The enumeration value information struct enum_value { + /// Constructor template enum_value(T v) : value(static_cast(v)) { } + /// Compare two enumeration values auto operator<(const enum_value& other) const -> bool { return value < other.value; } + /// The value of the enumeration uint8_t value; }; diff --git a/src/abacus/info.hpp b/src/abacus/info.hpp index 00f488f6..04f6af68 100644 --- a/src/abacus/info.hpp +++ b/src/abacus/info.hpp @@ -20,7 +20,7 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { -/// A variant for all the supported metrics +/// A variant for all the supported metric types using info = std::variant; } diff --git a/src/abacus/kind.hpp b/src/abacus/kind.hpp index a1037703..a158a3b5 100644 --- a/src/abacus/kind.hpp +++ b/src/abacus/kind.hpp @@ -12,10 +12,13 @@ namespace abacus { inline namespace STEINWURF_ABACUS_VERSION { - +/// The kind of metric enum class kind { + /// A gauge metric. This is a metric can can be both incremented and + /// decremented. gauge = abacus::protobuf::GAUGE, + /// A counter metric. This is a metric that can only be incremented. counter = abacus::protobuf::COUNTER }; diff --git a/src/abacus/metrics.hpp b/src/abacus/metrics.hpp index 64a22214..a8f18370 100644 --- a/src/abacus/metrics.hpp +++ b/src/abacus/metrics.hpp @@ -94,10 +94,10 @@ class metrics /// The size of the value data in bytes std::size_t m_value_bytes; - /// Map to offset + /// Map of metric offsets std::unordered_map m_offsets; - /// Map to reset functions - only initialized metrics can be reset + /// Map of metrics initialization status std::unordered_map m_initialized; }; } diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 9c66311d..09aa3dc9 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -31,6 +31,40 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace { +static inline std::size_t get_offset(const protobuf::Metric& m) +{ + switch (m.type_case()) + { + case protobuf::Metric::kUint64: + return m.uint64().offset(); + case protobuf::Metric::kInt64: + return m.int64().offset(); + case protobuf::Metric::kUint32: + return m.uint32().offset(); + case protobuf::Metric::kInt32: + return m.int32().offset(); + case protobuf::Metric::kFloat64: + return m.float64().offset(); + case protobuf::Metric::kFloat32: + return m.float32().offset(); + case protobuf::Metric::kBoolean: + return m.boolean().offset(); + case protobuf::Metric::kEnum8: + return m.enum8().offset(); + case protobuf::Metric::kConstant: + // This should never be reached + assert(false); + return 0; + case protobuf::Metric::TYPE_NOT_SET: + // This should never be reached + assert(false); + return 0; + default: + // This should never be reached + assert(false); + return 0; + } +} template inline auto get_value(const uint8_t* data, bool is_big_endian) -> std::optional @@ -167,7 +201,7 @@ auto view::value(const std::string& name) const } else { - auto offset = detail::get_offset(m); + auto offset = get_offset(m); assert(offset < m_value_bytes); return get_value(m_value_data + offset, m_metadata.endianness() == From 2b89e5c3a64422113da2dd3d811b66377dc3878c Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 12:56:19 +0100 Subject: [PATCH 61/68] fix docs --- src/abacus/constant.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/abacus/constant.hpp b/src/abacus/constant.hpp index 22dc5ee2..cebead91 100644 --- a/src/abacus/constant.hpp +++ b/src/abacus/constant.hpp @@ -62,13 +62,13 @@ struct constant type value; }; - // The value of the constant + /// The value of the constant std::variant value; - // The description of the constant + /// The description of the constant abacus::description description; - // The unit of the constant + /// The unit of the constant abacus::unit unit{}; }; } From 2fff7ededefebc6373c8e52a9aad8f70f8e2357e Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 12:57:53 +0100 Subject: [PATCH 62/68] fix docs --- src/abacus/metric.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/abacus/metric.hpp b/src/abacus/metric.hpp index 76524807..3b35a4b7 100644 --- a/src/abacus/metric.hpp +++ b/src/abacus/metric.hpp @@ -29,6 +29,7 @@ inline namespace STEINWURF_ABACUS_VERSION template struct metric { + /// The type used to store the value using value_type = typename Metric::type; /// Default constructor @@ -37,7 +38,6 @@ struct metric /// Constructor /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(value_type) + 1 bytes long. - /// @param value The initial value of the metric metric(uint8_t* memory) { assert(memory != nullptr); @@ -154,7 +154,6 @@ struct metric /// Constructor /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(value_type) + 1 bytes long. - /// @param value The initial value of the metric metric(uint8_t* memory) { assert(memory != nullptr); @@ -240,7 +239,6 @@ struct metric /// Constructor /// @param memory The memory to use for the metric, note that the memory /// must be at least sizeof(value_type) + 1 bytes long. - /// @param value The initial value of the metric metric(uint8_t* memory) { assert(memory != nullptr); From 23f44efb6fc6810c67dc398700456b0390597f76 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 13:34:10 +0100 Subject: [PATCH 63/68] work --- .../detail/{helpers.hpp => is_constant.hpp} | 15 +- src/abacus/metrics.cpp | 1 - src/abacus/view.cpp | 134 ++++++++---------- src/abacus/view.hpp | 5 +- test/src/test_metrics.cpp | 13 +- 5 files changed, 76 insertions(+), 92 deletions(-) rename src/abacus/detail/{helpers.hpp => is_constant.hpp} (58%) diff --git a/src/abacus/detail/helpers.hpp b/src/abacus/detail/is_constant.hpp similarity index 58% rename from src/abacus/detail/helpers.hpp rename to src/abacus/detail/is_constant.hpp index ee762963..835fbddb 100644 --- a/src/abacus/detail/helpers.hpp +++ b/src/abacus/detail/is_constant.hpp @@ -8,6 +8,7 @@ #include #include +#include "../constant.hpp" #include "../version.hpp" namespace abacus @@ -16,18 +17,20 @@ inline namespace STEINWURF_ABACUS_VERSION { namespace detail { -// Helper to check if a type is in the variant -template -struct is_in_variant; +// Helper to check if a metric is a constant + +template +struct is_constant_; template -struct is_in_variant> +struct is_constant_> : std::disjunction...> { }; -template -constexpr bool is_in_variant_v = is_in_variant::value; +template +constexpr bool is_constant_v = + is_constant_::value; } } diff --git a/src/abacus/metrics.cpp b/src/abacus/metrics.cpp index 0154747b..df42d6f7 100644 --- a/src/abacus/metrics.cpp +++ b/src/abacus/metrics.cpp @@ -11,7 +11,6 @@ #include "protocol_version.hpp" #include "version.hpp" -#include "detail/helpers.hpp" #include "detail/overload.hpp" #include "protobuf/metrics.pb.h" diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 09aa3dc9..80518970 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -7,7 +7,7 @@ #include "boolean.hpp" #include "constant.hpp" -#include "detail/helpers.hpp" +#include "detail/is_constant.hpp" #include "enum8.hpp" #include "float32.hpp" #include "float64.hpp" @@ -65,62 +65,6 @@ static inline std::size_t get_offset(const protobuf::Metric& m) return 0; } } -template -inline auto get_value(const uint8_t* data, bool is_big_endian) - -> std::optional -{ - assert(data != nullptr); - if (data[0] == 0) - { - // The metric is unset - return std::nullopt; - } - - if (is_big_endian) - { - return endian::big_endian::get(data + 1); - } - else - { - return endian::little_endian::get(data + 1); - } -} - -template <> -inline auto get_value(const uint8_t*, - bool) -> std::optional -{ - // This function should never be called, but we need it to silence the - // compiler - assert(false); - return std::nullopt; -} - -template -inline auto get_constant_value(const protobuf::Constant& constant) -> - typename Metric::type -{ - switch (constant.value_case()) - { - case protobuf::Constant::ValueCase::kUint64: - return constant.uint64(); - case protobuf::Constant::ValueCase::kInt64: - return constant.int64(); - case protobuf::Constant::ValueCase::kFloat64: - return constant.float64(); - case protobuf::Constant::ValueCase::kBoolean: - return constant.boolean(); - default: - throw std::runtime_error("Invalid constant type"); - } -} -template <> -inline auto get_constant_value( - const protobuf::Constant& constant) -> constant::str::type -{ - assert(constant.value_case() == protobuf::Constant::ValueCase::kString); - return constant.string(); -} } [[nodiscard]] auto @@ -188,24 +132,63 @@ const protobuf::Metric& view::metric(const std::string& name) const template auto view::value(const std::string& name) const - -> std::optional + -> std::conditional_t, typename Metric::type, + std::optional> { assert(m_metadata.IsInitialized()); assert(m_value_data != nullptr); auto m = metric(name); - if (m.has_constant()) + if constexpr (detail::is_constant_v) { - // Check that Metric is one of the expected constant types - assert((detail::is_in_variant_v)); - return get_constant_value(m.constant()); + // Check that Metric is constant + assert(m.has_constant()); + auto constant = m.constant(); + if constexpr (std::is_same_v) + { + if (constant.value_case() != protobuf::Constant::ValueCase::kString) + { + throw std::runtime_error("Invalid constant type"); + } + return constant.string(); + } + if constexpr (!std::is_same_v) + { + auto constant = m.constant(); + switch (constant.value_case()) + { + case protobuf::Constant::ValueCase::kUint64: + return constant.uint64(); + case protobuf::Constant::ValueCase::kInt64: + return constant.int64(); + case protobuf::Constant::ValueCase::kFloat64: + return constant.float64(); + case protobuf::Constant::ValueCase::kBoolean: + return constant.boolean(); + default: + throw std::runtime_error("Invalid constant type"); + } + } } - else + if constexpr (!detail::is_constant_v) { auto offset = get_offset(m); assert(offset < m_value_bytes); - return get_value(m_value_data + offset, - m_metadata.endianness() == - protobuf::Endianness::BIG); + auto data = m_value_data + offset; + assert(data != nullptr); + if (data[0] == 0) + { + // The metric is unset + return std::nullopt; + } + + if (m_metadata.endianness() == protobuf::Endianness::BIG) + { + return endian::big_endian::get(data + 1); + } + else + { + return endian::little_endian::get(data + 1); + } } } @@ -227,16 +210,15 @@ template auto view::value(const std::string& name) const template auto view::value(const std::string& name) const -> std::optional; // Constants -template auto view::value(const std::string& name) - const -> std::optional; -template auto view::value(const std::string& name) - const -> std::optional; -template auto view::value(const std::string& name) - const -> std::optional; -template auto view::value(const std::string& name) - const -> std::optional; +template auto view::value( + const std::string& name) const -> abacus::constant::uint64::type; +template auto view::value( + const std::string& name) const -> abacus::constant::int64::type; +template auto view::value( + const std::string& name) const -> abacus::constant::float64::type; +template auto view::value( + const std::string& name) const -> abacus::constant::boolean::type; template auto view::value(const std::string& name) const - -> std::optional; - + -> abacus::constant::str::type; } } diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index 6dd6af79..617301a9 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -9,6 +9,7 @@ #include #include +#include "detail/is_constant.hpp" #include "protobuf/metrics.pb.h" #include "version.hpp" @@ -69,7 +70,9 @@ class view /// value template auto value(const std::string& name) const - -> std::optional; + -> std::conditional_t, + typename Metric::type, + std::optional>; private: /// The meta data diff --git a/test/src/test_metrics.cpp b/test/src/test_metrics.cpp index 52f0063e..43bd735f 100644 --- a/test/src/test_metrics.cpp +++ b/test/src/test_metrics.cpp @@ -489,15 +489,12 @@ TEST(test_metrics, reset) view.set_value_data(metrics.value_data(), metrics.value_bytes())); // Check all constant values - EXPECT_EQ(view.value("uint64_constant").value(), - 1111U); - EXPECT_EQ(view.value("int64_constant").value(), - 2222); - EXPECT_EQ(view.value("float64_constant").value(), + EXPECT_EQ(view.value("uint64_constant"), 1111U); + EXPECT_EQ(view.value("int64_constant"), 2222); + EXPECT_EQ(view.value("float64_constant"), 3333.0); - EXPECT_EQ(view.value("boolean_constant").value(), - true); - EXPECT_EQ(view.value("string_constant").value(), + EXPECT_EQ(view.value("boolean_constant"), true); + EXPECT_EQ(view.value("string_constant"), "fivefivefivefive"); // While we are at it, let's check the other values as well From cfdd2b6e27218d6cd9893406e1fa03507c1c00b8 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 13:35:54 +0100 Subject: [PATCH 64/68] added docs --- src/abacus/view.cpp | 3 ++- src/abacus/view.hpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/abacus/view.cpp b/src/abacus/view.cpp index 80518970..03774cc5 100644 --- a/src/abacus/view.cpp +++ b/src/abacus/view.cpp @@ -209,7 +209,8 @@ template auto view::value(const std::string& name) const -> std::optional; template auto view::value(const std::string& name) const -> std::optional; -// Constants + +// Constants (no optional) template auto view::value( const std::string& name) const -> abacus::constant::uint64::type; template auto view::value( diff --git a/src/abacus/view.hpp b/src/abacus/view.hpp index 617301a9..4090002f 100644 --- a/src/abacus/view.hpp +++ b/src/abacus/view.hpp @@ -66,8 +66,8 @@ class view /// Gets the value of a metric /// @param name The name of the metric - /// @return The value of the metric or std::nullopt if the metric has no - /// value + /// @return The value of the metric, if the metric is a constant the value + /// is returned directly, otherwise an optional is returned template auto value(const std::string& name) const -> std::conditional_t, From 0e758b2aeeedf8107fe27eccd4e119ce610945c3 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 4 Feb 2025 13:48:35 +0100 Subject: [PATCH 65/68] minor changes --- NEWS.rst | 7 +++---- benchmark/main.cpp | 10 +++++----- src/abacus/detail/to_json.cpp | 4 ++++ test/src/test_to_json.cpp | 20 +++++++++++++++++--- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 96391a07..3bda5dee 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -8,12 +8,11 @@ Latest ------ * Major: Changed protocol format to version 2. * Minor: Added benchmark. -* Major: Changed the metadata to be specified using protobuf 3. -* Major: Changed callbacks to now use std::function rather than the custom - delegate previously used. +* Major: Changed the metadata to be specified using protobuf. * Major: Changed API of how metrics are specified. All attributes are now - strongly typed, and specified using a std::map of strings to abacus::info. + strongly typed, and specified using a std::map of abacus::name to abacus::info. * Minor: Added support for enums. +* Minor: Added support for constants. * Minor: Added support for more metric types: int32, uint32, float32, and enum8. 6.0.1 diff --git a/benchmark/main.cpp b/benchmark/main.cpp index 9dd2bd7a..6064fb47 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -92,10 +92,10 @@ static void BM_AccessMetrics(benchmark::State& state) { state.SetLabel("Access Metrics"); abacus::metrics metrics(create_metric_infos()); - auto m0 = metrics.initialize("0"); - auto m1 = metrics.initialize("1"); - auto m2 = metrics.initialize("2"); - auto m3 = metrics.initialize("3"); + auto m0 = metrics.initialize("0").set_value(false); + auto m1 = metrics.initialize("1").set_value(0); + auto m2 = metrics.initialize("2").set_value(0); + auto m3 = metrics.initialize("3").set_value(0.0); for (auto _ : state) { @@ -118,7 +118,7 @@ static void BM_IncrementUint64(benchmark::State& state) { state.SetLabel("Increment Uint64 Metric"); abacus::metrics metrics(create_metric_infos()); - auto m1 = metrics.initialize("1"); + auto m1 = metrics.initialize("1").set_value(0); for (auto _ : state) { diff --git a/src/abacus/detail/to_json.cpp b/src/abacus/detail/to_json.cpp index cce732da..90201185 100644 --- a/src/abacus/detail/to_json.cpp +++ b/src/abacus/detail/to_json.cpp @@ -135,6 +135,10 @@ auto to_json(const view& view, bool minimal) -> bourne::json default: break; } + if (!json.has_key(name)) + { + json[name] = nullptr; + } } } else diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index ab70946ef..43c14cdf 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -17,7 +17,8 @@ static const char* expected_json_minimal = R"({ "metric0" : 42, "metric1" : -42, "metric2" : true, - "metric3" : 2 + "metric3" : 2, + "metric4" : null })"; TEST(test_to_json, to_json_minimal) @@ -26,6 +27,7 @@ TEST(test_to_json, to_json_minimal) std::string name1 = "metric1"; std::string name2 = "metric2"; std::string name3 = "metric3"; + std::string name4 = "metric4"; std::map infos = { {abacus::name{name0}, @@ -46,7 +48,9 @@ TEST(test_to_json, to_json_minimal) {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {3, {"value3", "The value for 3"}}}}}, + {abacus::name{name4}, + abacus::boolean{abacus::description{"An unset boolean metric"}}}}; abacus::metrics metrics(infos); @@ -122,6 +126,13 @@ static const char* expected_json = R"({ } }, "value" : 2 + }, + "metric4" : { + "boolean" : { + "description" : "An unset boolean metric", + "offset" : 24 + }, + "value" : null } })"; @@ -142,6 +153,7 @@ TEST(test_to_json, to_json) std::string name1 = "metric1"; std::string name2 = "metric2"; std::string name3 = "metric3"; + std::string name4 = "metric4"; std::map infos = { {abacus::name{name0}, @@ -162,7 +174,9 @@ TEST(test_to_json, to_json) {{0, {"value0", "The value for 0"}}, {1, {"value1", "The value for 1"}}, {2, {"value2", "The value for 2"}}, - {3, {"value3", "The value for 3"}}}}}}; + {3, {"value3", "The value for 3"}}}}}, + {abacus::name{name4}, + abacus::boolean{abacus::description{"An unset boolean metric"}}}}; abacus::metrics metrics(infos); From f24ca61619f2097e6d42b21d6b7de7f33f55f181 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 5 Feb 2025 12:30:54 +0100 Subject: [PATCH 66/68] simplify unit tests --- test/src/test_info.cpp | 134 --------------- test/src/test_metric.cpp | 363 +++++++++++++++++++++++++-------------- 2 files changed, 230 insertions(+), 267 deletions(-) delete mode 100644 test/src/test_info.cpp diff --git a/test/src/test_info.cpp b/test/src/test_info.cpp deleted file mode 100644 index 36a026ee..00000000 --- a/test/src/test_info.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Steinwurf ApS 2020. -// All Rights Reserved -// -// Distributed under the "BSD License". See the accompanying LICENSE.rst -// file. - -#include -#include - -#include -#include - -template -void integer_test() -{ - using type = typename T::type; - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::metric m; - EXPECT_FALSE(m.is_initialized()); - m = abacus::metric(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - m = 10U; - EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), type{10}); - m += 12; - m -= 2; - ++m; - --m; - - EXPECT_EQ(m.value(), type{20}); - m.reset(); - EXPECT_FALSE(m.has_value()); -} - -TEST(test_info, integer) -{ - integer_test(); - integer_test(); - integer_test(); - integer_test(); -} - -template -void floating_point_test() -{ - using type = typename T::type; - uint8_t data[sizeof(type) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::metric m; - EXPECT_FALSE(m.is_initialized()); - m = abacus::metric(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - m = 10.0; - EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), 10.0); - m += 12.0; - m -= 2.0; - ++m; - --m; - - EXPECT_EQ(m.value(), 20.0); - m.reset(); - EXPECT_FALSE(m.has_value()); -} - -TEST(test_info, floating_point) -{ - - floating_point_test(); - floating_point_test(); -} - -TEST(test_info, boolean) -{ - - uint8_t data[sizeof(bool) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::metric m; - EXPECT_FALSE(m.is_initialized()); - m = abacus::metric(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - m = true; - EXPECT_TRUE(m.has_value()); - EXPECT_EQ(m.value(), true); - m = false; - EXPECT_EQ(m.value(), false); - m.reset(); - EXPECT_FALSE(m.has_value()); -} -namespace -{ -enum class test_enum -{ - value0 = 0, - value1 = 1, - value2 = 2, - value3 = 3 -}; -} - -TEST(test_info, enum8) -{ - { - uint8_t data[sizeof(uint8_t) + 1]; - std::memset(data, 0, sizeof(data)); - abacus::metric m; - EXPECT_FALSE(m.is_initialized()); - m = abacus::metric(data); - EXPECT_TRUE(m.is_initialized()); - EXPECT_FALSE(m.has_value()); - - m.set_value(test_enum::value0); - EXPECT_EQ(m.value(), test_enum::value0); - m.set_value(test_enum::value1); - EXPECT_EQ(m.value(), test_enum::value1); - m.set_value(test_enum::value2); - EXPECT_EQ(m.value(), test_enum::value2); - m.set_value(test_enum::value3); - EXPECT_EQ(m.value(), test_enum::value3); - - m = test_enum::value0; - EXPECT_EQ(m.value(), test_enum::value0); - m = test_enum::value1; - EXPECT_EQ(m.value(), test_enum::value1); - m = test_enum::value2; - EXPECT_EQ(m.value(), test_enum::value2); - m = test_enum::value3; - EXPECT_EQ(m.value(), test_enum::value3); - } -} diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index 94b00ed0..15110cb2 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -8,149 +8,246 @@ #include #include +#include #include -TEST(test_metric, constructor) +template +void integer_test() +{ + using type = typename T::type; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = 10U; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), type{10}); + m += 12; + m -= 2; + ++m; + --m; + + EXPECT_EQ(m.value(), type{20}); + m.reset(); + EXPECT_FALSE(m.has_value()); +} + +TEST(test_info, integer) +{ + integer_test(); + integer_test(); + integer_test(); + integer_test(); +} + +template +void floating_point_test() +{ + using type = typename T::type; + uint8_t data[sizeof(type) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = 10.0; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), 10.0); + m += 12.0; + m -= 2.0; + ++m; + --m; + + EXPECT_EQ(m.value(), 20.0); + m.reset(); + EXPECT_FALSE(m.has_value()); +} + +TEST(test_info, floating_point) +{ + + floating_point_test(); + floating_point_test(); +} + +TEST(test_info, boolean) +{ + + uint8_t data[sizeof(bool) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + m = true; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), true); + m = false; + EXPECT_EQ(m.value(), false); + m.reset(); + EXPECT_FALSE(m.has_value()); +} +namespace +{ +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; +} + +TEST(test_info, enum8) +{ + uint8_t data[sizeof(uint8_t) + 1]; + std::memset(data, 0, sizeof(data)); + abacus::metric m; + EXPECT_FALSE(m.is_initialized()); + m = abacus::metric(data); + EXPECT_TRUE(m.is_initialized()); + EXPECT_FALSE(m.has_value()); + + m.set_value(test_enum::value0); + EXPECT_EQ(m.value(), test_enum::value0); + m.set_value(test_enum::value1); + EXPECT_EQ(m.value(), test_enum::value1); + m.set_value(test_enum::value2); + EXPECT_EQ(m.value(), test_enum::value2); + m.set_value(test_enum::value3); + EXPECT_EQ(m.value(), test_enum::value3); + + m = test_enum::value0; + EXPECT_EQ(m.value(), test_enum::value0); + m = test_enum::value1; + EXPECT_EQ(m.value(), test_enum::value1); + m = test_enum::value2; + EXPECT_EQ(m.value(), test_enum::value2); + m = test_enum::value3; + EXPECT_EQ(m.value(), test_enum::value3); +} + +TEST(test_metric, float_death1) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); +} + +TEST(test_metric, float_death2) { uint8_t data[9]; std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); +} - abacus::metric uint_metric(data); +TEST(test_metric, float_death3) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric = 1 / 0.0, ""); +} - EXPECT_TRUE(uint_metric.is_initialized()); - EXPECT_FALSE(uint_metric.has_value()); - uint_metric = 42U; - EXPECT_TRUE(uint_metric.has_value()); - EXPECT_EQ(uint_metric.value(), 42U); +TEST(test_metric, float_death4) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric = 1 / -0.0, ""); } -TEST(test_metric, float_assignment) +TEST(test_metric, float_death5) { uint8_t data[9]; std::memset(data, 0, sizeof(data)); abacus::metric double_metric(data); - EXPECT_TRUE(double_metric.is_initialized()); - EXPECT_FALSE(double_metric.has_value()); - double_metric = 1123.12; - EXPECT_DOUBLE_EQ(double_metric.value(), 1123.12); -} - -// TEST(test_metric, float_death1) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric = 0.0 / 0.0, ""); -// } - -// TEST(test_metric, float_death2) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric = -0.0 / 0.0, ""); -// } - -// TEST(test_metric, float_death3) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / 0.0, ""); -// } - -// TEST(test_metric, float_death4) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric = 1 / -0.0, ""); -// } - -// TEST(test_metric, float_death5) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); -// } - -// TEST(test_metric, float_death6) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); -// } - -// // Check that that assignment to +Inf is not allowed -// TEST(test_metric, float_death7) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// EXPECT_DEATH(double_metric += 1 / 0.0, ""); -// } - -// TEST(test_metric, float_death8) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric += 1 / -0.0, ""); -// } - -// TEST(test_metric, float_death9) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that assignment to NaN is not allowed -// EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); -// } - -// TEST(test_metric, float_death10) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to -NaN is not allowed -// EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); -// } - -// TEST(test_metric, float_death11) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to +Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / 0.0, ""); -// } - -// TEST(test_metric, float_death12) -// { -// uint8_t data[9]; -// std::memset(data, 0, sizeof(data)); -// abacus::metric double_metric(data); -// double_metric = 2; -// // Check that that assignment to -Inf is not allowed -// EXPECT_DEATH(double_metric -= 1 / -0.0, ""); -// } + double_metric = 2; + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric += 0.0 / 0.0, ""); +} + +TEST(test_metric, float_death6) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric += -0.0 / 0.0, ""); +} + +// Check that that assignment to +Inf is not allowed +TEST(test_metric, float_death7) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + EXPECT_DEATH(double_metric += 1 / 0.0, ""); +} + +TEST(test_metric, float_death8) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric += 1 / -0.0, ""); +} + +TEST(test_metric, float_death9) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that assignment to NaN is not allowed + EXPECT_DEATH(double_metric -= 0.0 / 0.0, ""); +} + +TEST(test_metric, float_death10) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to -NaN is not allowed + EXPECT_DEATH(double_metric -= -0.0 / 0.0, ""); +} + +TEST(test_metric, float_death11) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to +Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / 0.0, ""); +} + +TEST(test_metric, float_death12) +{ + uint8_t data[9]; + std::memset(data, 0, sizeof(data)); + abacus::metric double_metric(data); + double_metric = 2; + // Check that that assignment to -Inf is not allowed + EXPECT_DEATH(double_metric -= 1 / -0.0, ""); +} From 338e6e12445233e3f4b9316514772595ae66c157 Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Wed, 5 Feb 2025 12:31:26 +0100 Subject: [PATCH 67/68] fix unit test names --- test/src/test_metric.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index 15110cb2..ef9d0918 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -35,7 +35,7 @@ void integer_test() EXPECT_FALSE(m.has_value()); } -TEST(test_info, integer) +TEST(test_metric, integer) { integer_test(); integer_test(); @@ -67,14 +67,14 @@ void floating_point_test() EXPECT_FALSE(m.has_value()); } -TEST(test_info, floating_point) +TEST(test_metric, floating_point) { floating_point_test(); floating_point_test(); } -TEST(test_info, boolean) +TEST(test_metric, boolean) { uint8_t data[sizeof(bool) + 1]; @@ -103,7 +103,7 @@ enum class test_enum }; } -TEST(test_info, enum8) +TEST(test_metric, enum8) { uint8_t data[sizeof(uint8_t) + 1]; std::memset(data, 0, sizeof(data)); From a4433cbeb10a70ceca0f6b48aea7f79b9a5a3b4e Mon Sep 17 00:00:00 2001 From: Jeppe Pihl Date: Tue, 11 Feb 2025 12:16:28 +0100 Subject: [PATCH 68/68] work --- benchmark/main.cpp | 2 +- protobuf/metrics.proto | 14 +++---- src/abacus/metric.hpp | 80 ++++++++++++++++++++++++++++++++++++++- test/src/test_metric.cpp | 40 ++++++++++++++++++++ test/src/test_to_json.cpp | 25 ++++++------ test/src/test_view.cpp | 15 +++++++- 6 files changed, 152 insertions(+), 24 deletions(-) diff --git a/benchmark/main.cpp b/benchmark/main.cpp index 6064fb47..381d553e 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -81,7 +81,7 @@ static void BM_AssignMetrics(benchmark::State& state) ++m3; m4 = false; --m5; - m6 = 4; + m6 = test_enum::value2; } state.SetItemsProcessed(state.iterations()); diff --git a/protobuf/metrics.proto b/protobuf/metrics.proto index c53ba919..5f9da9af 100644 --- a/protobuf/metrics.proto +++ b/protobuf/metrics.proto @@ -88,8 +88,8 @@ message Enum8Metric { } uint32 offset = 1; // Offset into packed memory for the value string description = 2; // Metric description - map values = 4; // Mapping from packed index to enum info - optional string unit = 5; // Unit of measurement + map values = 3; // Mapping from packed index to enum info + optional string unit = 4; // Unit of measurement } @@ -98,12 +98,12 @@ message Constant{ oneof value { uint64 uint64 = 1; // Unsigned 64-bit constant value int64 int64 = 2; // Signed 64-bit constant value - double float64 = 6; // 64-bit floating-point constant value - bool boolean = 7; // Boolean constant value - string string = 9; // String constant value + double float64 = 3; // 64-bit floating-point constant value + bool boolean = 4; // Boolean constant value + string string = 5; // String constant value } - string description = 10; // Metric description - optional string unit = 11; // Unit of measurement + string description = 6; // Metric description + optional string unit = 7; // Unit of measurement } // Metadata for a single metric diff --git a/src/abacus/metric.hpp b/src/abacus/metric.hpp index 3b35a4b7..2b77aac0 100644 --- a/src/abacus/metric.hpp +++ b/src/abacus/metric.hpp @@ -87,6 +87,31 @@ struct metric return *this; } + /// Assign an optional value to the metric + /// @param value The value to assign, if the value is not set the metric + /// will be reset. + auto set_value(std::optional value) -> metric& + { + if (value) + { + return set_value(*value); + } + else + { + reset(); + } + + return *this; + } + + /// Assign the metric a new optional value + /// @param value The value to assign if the value is not set the metric + /// will be reset. + auto operator=(std::optional value) -> metric& + { + return set_value(value); + } + /// Assign the metric a new value /// @param value The value to assign /// @return the metric with the new value @@ -192,8 +217,7 @@ struct metric template auto set_value(T value) -> metric& { - // @todo enable again - // static_assert(std::is_enum_v); + static_assert(std::is_enum_v); assert(static_cast(value) <= std::numeric_limits::max() && @@ -217,6 +241,33 @@ struct metric return set_value(value); } + /// Assign an optional value to the metric + /// @param value The value to assign, if the value is not set the metric + /// will be reset. + template + auto set_value(std::optional value) -> metric& + { + if (value) + { + return set_value(*value); + } + else + { + reset(); + } + + return *this; + } + + /// Assign the metric a new optional value + /// @param value The value to assign if the value is not set the metric + /// will be reset. + template + auto operator=(std::optional value) -> metric& + { + return set_value(value); + } + /// Reset the metric. This will cause the metric to not have a value auto reset() -> void { @@ -287,6 +338,31 @@ struct metric return set_value(value); } + /// Assign an optional value to the metric + /// @param value The value to assign, if the value is not set the metric + /// will be reset. + auto set_value(std::optional value) -> metric& + { + if (value) + { + return set_value(*value); + } + else + { + reset(); + } + + return *this; + } + + /// Assign the metric a new optional value + /// @param value The value to assign if the value is not set the metric + /// will be reset. + auto operator=(std::optional value) -> metric& + { + return set_value(value); + } + /// Reset the metric. This will cause the metric to not have a value auto reset() -> void { diff --git a/test/src/test_metric.cpp b/test/src/test_metric.cpp index ef9d0918..54245bc0 100644 --- a/test/src/test_metric.cpp +++ b/test/src/test_metric.cpp @@ -33,6 +33,15 @@ void integer_test() EXPECT_EQ(m.value(), type{20}); m.reset(); EXPECT_FALSE(m.has_value()); + + std::optional new_value = 10; + m = new_value; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), type{10}); + + new_value.reset(); + m = new_value; + EXPECT_FALSE(m.has_value()); } TEST(test_metric, integer) @@ -65,6 +74,15 @@ void floating_point_test() EXPECT_EQ(m.value(), 20.0); m.reset(); EXPECT_FALSE(m.has_value()); + + std::optional new_value = 10.0; + m = new_value; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), type{10.0}); + + new_value.reset(); + m = new_value; + EXPECT_FALSE(m.has_value()); } TEST(test_metric, floating_point) @@ -91,6 +109,15 @@ TEST(test_metric, boolean) EXPECT_EQ(m.value(), false); m.reset(); EXPECT_FALSE(m.has_value()); + + std::optional new_value = true; + m = new_value; + EXPECT_TRUE(m.has_value()); + EXPECT_TRUE(m.value()); + + new_value.reset(); + m = new_value; + EXPECT_FALSE(m.has_value()); } namespace { @@ -130,6 +157,19 @@ TEST(test_metric, enum8) EXPECT_EQ(m.value(), test_enum::value2); m = test_enum::value3; EXPECT_EQ(m.value(), test_enum::value3); + + m.reset(); + EXPECT_FALSE(m.has_value()); + + std::optional new_value = test_enum::value0; + + m = new_value; + EXPECT_TRUE(m.has_value()); + EXPECT_EQ(m.value(), test_enum::value0); + + new_value.reset(); + m = new_value; + EXPECT_FALSE(m.has_value()); } TEST(test_metric, float_death1) diff --git a/test/src/test_to_json.cpp b/test/src/test_to_json.cpp index 43c14cdf..358bcfa7 100644 --- a/test/src/test_to_json.cpp +++ b/test/src/test_to_json.cpp @@ -13,6 +13,17 @@ #include +namespace +{ +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; +} + static const char* expected_json_minimal = R"({ "metric0" : 42, "metric1" : -42, @@ -56,7 +67,8 @@ TEST(test_to_json, to_json_minimal) auto m0 = metrics.initialize(name0).set_value(42); auto m1 = metrics.initialize(name1).set_value(-42); - auto m3 = metrics.initialize(name3).set_value(2); + auto m3 = + metrics.initialize(name3).set_value(test_enum::value2); (void)m0; (void)m1; @@ -136,17 +148,6 @@ static const char* expected_json = R"({ } })"; -namespace -{ -enum class test_enum -{ - value0 = 0, - value1 = 1, - value2 = 2, - value3 = 3 -}; -} - TEST(test_to_json, to_json) { std::string name0 = "metric0"; diff --git a/test/src/test_view.cpp b/test/src/test_view.cpp index c13736ba..8a696e08 100644 --- a/test/src/test_view.cpp +++ b/test/src/test_view.cpp @@ -13,6 +13,17 @@ #include +namespace +{ +enum class test_enum +{ + value0 = 0, + value1 = 1, + value2 = 2, + value3 = 3 +}; +} + TEST(test_view, api) { std::string name0 = "metric0"; @@ -82,7 +93,7 @@ TEST(test_view, api) // Update metrics metric0 = 9000U; metric1 = -1000; - metric3 = 2; + metric3 = test_enum::value2; // Check that the view is not updated EXPECT_FALSE(view_value0.has_value()); @@ -107,5 +118,5 @@ TEST(test_view, api) view_value3 = view.value(name3); EXPECT_TRUE(view_value3.has_value()); - EXPECT_EQ(2, view_value3.value()); + EXPECT_EQ(test_enum::value2, (test_enum)view_value3.value()); }