1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
2 
3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_SYSTEM_METRICS_PROTO_H_
4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_SYSTEM_METRICS_PROTO_H_
5 
6 #include <stddef.h>
7 #include <stdint.h>
8 
9 #include "perfetto/protozero/field_writer.h"
10 #include "perfetto/protozero/message.h"
11 #include "perfetto/protozero/packed_repeated_fields.h"
12 #include "perfetto/protozero/proto_decoder.h"
13 #include "perfetto/protozero/proto_utils.h"
14 
15 
16 namespace perfetto {
17 namespace protos {
18 namespace pbzero {
19 
20 class ChromiumSystemMetricsConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
21  public:
ChromiumSystemMetricsConfig_Decoder(const uint8_t * data,size_t len)22   ChromiumSystemMetricsConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
ChromiumSystemMetricsConfig_Decoder(const std::string & raw)23   explicit ChromiumSystemMetricsConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
ChromiumSystemMetricsConfig_Decoder(const::protozero::ConstBytes & raw)24   explicit ChromiumSystemMetricsConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_sampling_interval_ms()25   bool has_sampling_interval_ms() const { return at<1>().valid(); }
sampling_interval_ms()26   uint32_t sampling_interval_ms() const { return at<1>().as_uint32(); }
27 };
28 
29 class ChromiumSystemMetricsConfig : public ::protozero::Message {
30  public:
31   using Decoder = ChromiumSystemMetricsConfig_Decoder;
32   enum : int32_t {
33     kSamplingIntervalMsFieldNumber = 1,
34   };
GetName()35   static constexpr const char* GetName() { return ".perfetto.protos.ChromiumSystemMetricsConfig"; }
36 
37 
38   using FieldMetadata_SamplingIntervalMs =
39     ::protozero::proto_utils::FieldMetadata<
40       1,
41       ::protozero::proto_utils::RepetitionType::kNotRepeated,
42       ::protozero::proto_utils::ProtoSchemaType::kUint32,
43       uint32_t,
44       ChromiumSystemMetricsConfig>;
45 
46   static constexpr FieldMetadata_SamplingIntervalMs kSamplingIntervalMs{};
set_sampling_interval_ms(uint32_t value)47   void set_sampling_interval_ms(uint32_t value) {
48     static constexpr uint32_t field_id = FieldMetadata_SamplingIntervalMs::kFieldId;
49     // Call the appropriate protozero::Message::Append(field_id, ...)
50     // method based on the type of the field.
51     ::protozero::internal::FieldWriter<
52       ::protozero::proto_utils::ProtoSchemaType::kUint32>
53         ::Append(*this, field_id, value);
54   }
55 };
56 
57 } // Namespace.
58 } // Namespace.
59 } // Namespace.
60 #endif  // Include guard.
61