Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
clock_snapshot.pbzero.h
Go to the documentation of this file.
1// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5// IMPORTANT: This file should only ever be modified by modifying the
6// corresponding .proto file and then running
7// `dart runtime/vm/protos/tools/compile_perfetto_protos.dart` from the SDK root
8// directory.
9// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
10
11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
13
14#include <stddef.h>
15#include <stdint.h>
16
17#include "perfetto/protozero/field_writer.h"
18#include "perfetto/protozero/message.h"
19#include "perfetto/protozero/packed_repeated_fields.h"
20#include "perfetto/protozero/proto_decoder.h"
21#include "perfetto/protozero/proto_utils.h"
22
23namespace perfetto {
24namespace protos {
25namespace pbzero {
26
27class ClockSnapshot_Clock;
28enum BuiltinClock : int32_t;
29
30class ClockSnapshot_Decoder : public ::protozero::TypedProtoDecoder<
31 /*MAX_FIELD_ID=*/2,
32 /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
33 public:
34 ClockSnapshot_Decoder(const uint8_t* data, size_t len)
35 : TypedProtoDecoder(data, len) {}
36 explicit ClockSnapshot_Decoder(const std::string& raw)
37 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
38 raw.size()) {}
39 explicit ClockSnapshot_Decoder(const ::protozero::ConstBytes& raw)
40 : TypedProtoDecoder(raw.data, raw.size) {}
41 bool has_clocks() const { return at<1>().valid(); }
42 ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> clocks() const {
43 return GetRepeated<::protozero::ConstBytes>(1);
44 }
45 bool has_primary_trace_clock() const { return at<2>().valid(); }
46 int32_t primary_trace_clock() const { return at<2>().as_int32(); }
47};
48
49class ClockSnapshot : public ::protozero::Message {
50 public:
52 enum : int32_t {
55 };
56 static constexpr const char* GetName() {
57 return ".perfetto.protos.ClockSnapshot";
58 }
59
61
62 using FieldMetadata_Clocks = ::protozero::proto_utils::FieldMetadata<
63 1,
64 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
65 ::protozero::proto_utils::ProtoSchemaType::kMessage,
68
69 // Ceci n'est pas une pipe.
70 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
71 // type (and users are expected to use it as such, hence kCamelCase name).
72 // It is declared as a function to keep protozero bindings header-only as
73 // inline constexpr variables are not available until C++17 (while inline
74 // functions are).
75 // TODO(altimin): Use inline variable instead after adopting C++17.
76 static constexpr FieldMetadata_Clocks kClocks() { return {}; }
77 template <typename T = ClockSnapshot_Clock>
79 return BeginNestedMessage<T>(1);
80 }
81
83 ::protozero::proto_utils::FieldMetadata<
84 2,
85 ::protozero::proto_utils::RepetitionType::kNotRepeated,
86 ::protozero::proto_utils::ProtoSchemaType::kEnum,
89
90 // Ceci n'est pas une pipe.
91 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
92 // type (and users are expected to use it as such, hence kCamelCase name).
93 // It is declared as a function to keep protozero bindings header-only as
94 // inline constexpr variables are not available until C++17 (while inline
95 // functions are).
96 // TODO(altimin): Use inline variable instead after adopting C++17.
98 return {};
99 }
101 static constexpr uint32_t field_id =
102 FieldMetadata_PrimaryTraceClock::kFieldId;
103 // Call the appropriate protozero::Message::Append(field_id, ...)
104 // method based on the type of the field.
105 ::protozero::internal::FieldWriter<
106 ::protozero::proto_utils::ProtoSchemaType::kEnum>::Append(*this,
107 field_id,
108 value);
109 }
110};
111
113 : public ::protozero::TypedProtoDecoder<
114 /*MAX_FIELD_ID=*/2,
115 /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
116 public:
117 ClockSnapshot_Clock_Decoder(const uint8_t* data, size_t len)
118 : TypedProtoDecoder(data, len) {}
119 explicit ClockSnapshot_Clock_Decoder(const std::string& raw)
120 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
121 raw.size()) {}
122 explicit ClockSnapshot_Clock_Decoder(const ::protozero::ConstBytes& raw)
123 : TypedProtoDecoder(raw.data, raw.size) {}
124 bool has_clock_id() const { return at<1>().valid(); }
125 uint32_t clock_id() const { return at<1>().as_uint32(); }
126 bool has_timestamp() const { return at<2>().valid(); }
127 uint64_t timestamp() const { return at<2>().as_uint64(); }
128};
129
130class ClockSnapshot_Clock : public ::protozero::Message {
131 public:
133 enum : int32_t {
136 };
137 static constexpr const char* GetName() {
138 return ".perfetto.protos.ClockSnapshot.Clock";
139 }
140
141 using FieldMetadata_ClockId = ::protozero::proto_utils::FieldMetadata<
142 1,
143 ::protozero::proto_utils::RepetitionType::kNotRepeated,
144 ::protozero::proto_utils::ProtoSchemaType::kUint32,
145 uint32_t,
147
148 // Ceci n'est pas une pipe.
149 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
150 // type (and users are expected to use it as such, hence kCamelCase name).
151 // It is declared as a function to keep protozero bindings header-only as
152 // inline constexpr variables are not available until C++17 (while inline
153 // functions are).
154 // TODO(altimin): Use inline variable instead after adopting C++17.
155 static constexpr FieldMetadata_ClockId kClockId() { return {}; }
156 void set_clock_id(uint32_t value) {
157 static constexpr uint32_t field_id = FieldMetadata_ClockId::kFieldId;
158 // Call the appropriate protozero::Message::Append(field_id, ...)
159 // method based on the type of the field.
160 ::protozero::internal::FieldWriter<
161 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*this,
162 field_id,
163 value);
164 }
165
166 using FieldMetadata_Timestamp = ::protozero::proto_utils::FieldMetadata<
167 2,
168 ::protozero::proto_utils::RepetitionType::kNotRepeated,
169 ::protozero::proto_utils::ProtoSchemaType::kUint64,
170 uint64_t,
172
173 // Ceci n'est pas une pipe.
174 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
175 // type (and users are expected to use it as such, hence kCamelCase name).
176 // It is declared as a function to keep protozero bindings header-only as
177 // inline constexpr variables are not available until C++17 (while inline
178 // functions are).
179 // TODO(altimin): Use inline variable instead after adopting C++17.
180 static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
181 void set_timestamp(uint64_t value) {
182 static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
183 // Call the appropriate protozero::Message::Append(field_id, ...)
184 // method based on the type of the field.
185 ::protozero::internal::FieldWriter<
186 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
187 field_id,
188 value);
189 }
190};
191
192} // namespace pbzero
193} // namespace protos
194} // namespace perfetto
195#endif // Include guard.
ClockSnapshot_Clock_Decoder(const ::protozero::ConstBytes &raw)
static constexpr FieldMetadata_Timestamp kTimestamp()
static constexpr FieldMetadata_ClockId kClockId()
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, ClockSnapshot_Clock > FieldMetadata_ClockId
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, ClockSnapshot_Clock > FieldMetadata_Timestamp
ClockSnapshot_Decoder(const uint8_t *data, size_t len)
::protozero::RepeatedFieldIterator<::protozero::ConstBytes > clocks() const
ClockSnapshot_Decoder(const ::protozero::ConstBytes &raw)
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kMessage, ClockSnapshot_Clock, ClockSnapshot > FieldMetadata_Clocks
static constexpr FieldMetadata_PrimaryTraceClock kPrimaryTraceClock()
static constexpr const char * GetName()
void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value)
static constexpr FieldMetadata_Clocks kClocks()
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kEnum, ::perfetto::protos::pbzero::BuiltinClock, ClockSnapshot > FieldMetadata_PrimaryTraceClock
uint8_t value
#define T