Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
track_event.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_TRACK_EVENT_TRACK_EVENT_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_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 DebugAnnotation;
28namespace perfetto_pbzero_enum_TrackEvent {
29enum Type : int32_t;
30} // namespace perfetto_pbzero_enum_TrackEvent
32
33namespace perfetto_pbzero_enum_TrackEvent {
34enum Type : int32_t {
38};
39} // namespace perfetto_pbzero_enum_TrackEvent
41
43 TrackEvent_Type::TYPE_SLICE_BEGIN;
44constexpr TrackEvent_Type TrackEvent_Type_MAX = TrackEvent_Type::TYPE_INSTANT;
45
46PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE
49 switch (value) {
50 case ::perfetto::protos::pbzero::TrackEvent_Type::TYPE_SLICE_BEGIN:
51 return "TYPE_SLICE_BEGIN";
52
53 case ::perfetto::protos::pbzero::TrackEvent_Type::TYPE_SLICE_END:
54 return "TYPE_SLICE_END";
55
56 case ::perfetto::protos::pbzero::TrackEvent_Type::TYPE_INSTANT:
57 return "TYPE_INSTANT";
58 }
59 return "PBZERO_UNKNOWN_ENUM_VALUE";
60}
61
62class TrackEvent_Decoder : public ::protozero::TypedProtoDecoder<
63 /*MAX_FIELD_ID=*/48,
64 /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
65 public:
66 TrackEvent_Decoder(const uint8_t* data, size_t len)
67 : TypedProtoDecoder(data, len) {}
68 explicit TrackEvent_Decoder(const std::string& raw)
69 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
70 raw.size()) {}
71 explicit TrackEvent_Decoder(const ::protozero::ConstBytes& raw)
72 : TypedProtoDecoder(raw.data, raw.size) {}
73 bool has_categories() const { return at<22>().valid(); }
74 ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories()
75 const {
76 return GetRepeated<::protozero::ConstChars>(22);
77 }
78 bool has_name() const { return at<23>().valid(); }
79 ::protozero::ConstChars name() const { return at<23>().as_string(); }
80 bool has_type() const { return at<9>().valid(); }
81 int32_t type() const { return at<9>().as_int32(); }
82 bool has_track_uuid() const { return at<11>().valid(); }
83 uint64_t track_uuid() const { return at<11>().as_uint64(); }
84 bool has_flow_ids() const { return at<47>().valid(); }
85 ::protozero::RepeatedFieldIterator<uint64_t> flow_ids() const {
86 return GetRepeated<uint64_t>(47);
87 }
88 bool has_terminating_flow_ids() const { return at<48>().valid(); }
89 ::protozero::RepeatedFieldIterator<uint64_t> terminating_flow_ids() const {
90 return GetRepeated<uint64_t>(48);
91 }
92 bool has_debug_annotations() const { return at<4>().valid(); }
93 ::protozero::RepeatedFieldIterator<::protozero::ConstBytes>
95 return GetRepeated<::protozero::ConstBytes>(4);
96 }
97};
98
99class TrackEvent : public ::protozero::Message {
100 public:
102 enum : int32_t {
110 };
111 static constexpr const char* GetName() {
112 return ".perfetto.protos.TrackEvent";
113 }
114
116 static inline const char* Type_Name(Type value) {
117 return ::perfetto::protos::pbzero::TrackEvent_Type_Name(value);
118 }
119 static const Type TYPE_SLICE_BEGIN = Type::TYPE_SLICE_BEGIN;
120 static const Type TYPE_SLICE_END = Type::TYPE_SLICE_END;
121 static const Type TYPE_INSTANT = Type::TYPE_INSTANT;
122
123 using FieldMetadata_Categories = ::protozero::proto_utils::FieldMetadata<
124 22,
125 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
126 ::protozero::proto_utils::ProtoSchemaType::kString,
127 std::string,
128 TrackEvent>;
129
130 // Ceci n'est pas une pipe.
131 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
132 // type (and users are expected to use it as such, hence kCamelCase name).
133 // It is declared as a function to keep protozero bindings header-only as
134 // inline constexpr variables are not available until C++17 (while inline
135 // functions are).
136 // TODO(altimin): Use inline variable instead after adopting C++17.
137 static constexpr FieldMetadata_Categories kCategories() { return {}; }
138 void add_categories(const char* data, size_t size) {
139 AppendBytes(FieldMetadata_Categories::kFieldId, data, size);
140 }
141 void add_categories(::protozero::ConstChars chars) {
142 AppendBytes(FieldMetadata_Categories::kFieldId, chars.data, chars.size);
143 }
144 void add_categories(std::string value) {
145 static constexpr uint32_t field_id = FieldMetadata_Categories::kFieldId;
146 // Call the appropriate protozero::Message::Append(field_id, ...)
147 // method based on the type of the field.
148 ::protozero::internal::FieldWriter<
149 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*this,
150 field_id,
151 value);
152 }
153
154 using FieldMetadata_Name = ::protozero::proto_utils::FieldMetadata<
155 23,
156 ::protozero::proto_utils::RepetitionType::kNotRepeated,
157 ::protozero::proto_utils::ProtoSchemaType::kString,
158 std::string,
159 TrackEvent>;
160
161 // Ceci n'est pas une pipe.
162 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
163 // type (and users are expected to use it as such, hence kCamelCase name).
164 // It is declared as a function to keep protozero bindings header-only as
165 // inline constexpr variables are not available until C++17 (while inline
166 // functions are).
167 // TODO(altimin): Use inline variable instead after adopting C++17.
168 static constexpr FieldMetadata_Name kName() { return {}; }
169 void set_name(const char* data, size_t size) {
170 AppendBytes(FieldMetadata_Name::kFieldId, data, size);
171 }
172 void set_name(::protozero::ConstChars chars) {
173 AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size);
174 }
175 void set_name(std::string value) {
176 static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
177 // Call the appropriate protozero::Message::Append(field_id, ...)
178 // method based on the type of the field.
179 ::protozero::internal::FieldWriter<
180 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*this,
181 field_id,
182 value);
183 }
184
185 using FieldMetadata_Type = ::protozero::proto_utils::FieldMetadata<
186 9,
187 ::protozero::proto_utils::RepetitionType::kNotRepeated,
188 ::protozero::proto_utils::ProtoSchemaType::kEnum,
190 TrackEvent>;
191
192 // Ceci n'est pas une pipe.
193 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
194 // type (and users are expected to use it as such, hence kCamelCase name).
195 // It is declared as a function to keep protozero bindings header-only as
196 // inline constexpr variables are not available until C++17 (while inline
197 // functions are).
198 // TODO(altimin): Use inline variable instead after adopting C++17.
199 static constexpr FieldMetadata_Type kType() { return {}; }
201 static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
202 // Call the appropriate protozero::Message::Append(field_id, ...)
203 // method based on the type of the field.
204 ::protozero::internal::FieldWriter<
205 ::protozero::proto_utils::ProtoSchemaType::kEnum>::Append(*this,
206 field_id,
207 value);
208 }
209
210 using FieldMetadata_TrackUuid = ::protozero::proto_utils::FieldMetadata<
211 11,
212 ::protozero::proto_utils::RepetitionType::kNotRepeated,
213 ::protozero::proto_utils::ProtoSchemaType::kUint64,
214 uint64_t,
215 TrackEvent>;
216
217 // Ceci n'est pas une pipe.
218 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
219 // type (and users are expected to use it as such, hence kCamelCase name).
220 // It is declared as a function to keep protozero bindings header-only as
221 // inline constexpr variables are not available until C++17 (while inline
222 // functions are).
223 // TODO(altimin): Use inline variable instead after adopting C++17.
224 static constexpr FieldMetadata_TrackUuid kTrackUuid() { return {}; }
225 void set_track_uuid(uint64_t value) {
226 static constexpr uint32_t field_id = FieldMetadata_TrackUuid::kFieldId;
227 // Call the appropriate protozero::Message::Append(field_id, ...)
228 // method based on the type of the field.
229 ::protozero::internal::FieldWriter<
230 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
231 field_id,
232 value);
233 }
234
235 using FieldMetadata_FlowIds = ::protozero::proto_utils::FieldMetadata<
236 47,
237 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
238 ::protozero::proto_utils::ProtoSchemaType::kFixed64,
239 uint64_t,
240 TrackEvent>;
241
242 // Ceci n'est pas une pipe.
243 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
244 // type (and users are expected to use it as such, hence kCamelCase name).
245 // It is declared as a function to keep protozero bindings header-only as
246 // inline constexpr variables are not available until C++17 (while inline
247 // functions are).
248 // TODO(altimin): Use inline variable instead after adopting C++17.
249 static constexpr FieldMetadata_FlowIds kFlowIds() { return {}; }
250 void add_flow_ids(uint64_t value) {
251 static constexpr uint32_t field_id = FieldMetadata_FlowIds::kFieldId;
252 // Call the appropriate protozero::Message::Append(field_id, ...)
253 // method based on the type of the field.
254 ::protozero::internal::FieldWriter<
255 ::protozero::proto_utils::ProtoSchemaType::kFixed64>::Append(*this,
256 field_id,
257 value);
258 }
259
261 ::protozero::proto_utils::FieldMetadata<
262 48,
263 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
264 ::protozero::proto_utils::ProtoSchemaType::kFixed64,
265 uint64_t,
266 TrackEvent>;
267
268 // Ceci n'est pas une pipe.
269 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
270 // type (and users are expected to use it as such, hence kCamelCase name).
271 // It is declared as a function to keep protozero bindings header-only as
272 // inline constexpr variables are not available until C++17 (while inline
273 // functions are).
274 // TODO(altimin): Use inline variable instead after adopting C++17.
276 return {};
277 }
278 void add_terminating_flow_ids(uint64_t value) {
279 static constexpr uint32_t field_id =
280 FieldMetadata_TerminatingFlowIds::kFieldId;
281 // Call the appropriate protozero::Message::Append(field_id, ...)
282 // method based on the type of the field.
283 ::protozero::internal::FieldWriter<
284 ::protozero::proto_utils::ProtoSchemaType::kFixed64>::Append(*this,
285 field_id,
286 value);
287 }
288
290 ::protozero::proto_utils::FieldMetadata<
291 4,
292 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
293 ::protozero::proto_utils::ProtoSchemaType::kMessage,
295 TrackEvent>;
296
297 // Ceci n'est pas une pipe.
298 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
299 // type (and users are expected to use it as such, hence kCamelCase name).
300 // It is declared as a function to keep protozero bindings header-only as
301 // inline constexpr variables are not available until C++17 (while inline
302 // functions are).
303 // TODO(altimin): Use inline variable instead after adopting C++17.
305 return {};
306 }
307 template <typename T = DebugAnnotation>
309 return BeginNestedMessage<T>(4);
310 }
311};
312
313} // namespace pbzero
314} // namespace protos
315} // namespace perfetto
316#endif // Include guard.
::protozero::RepeatedFieldIterator< uint64_t > flow_ids() const
::protozero::RepeatedFieldIterator< uint64_t > terminating_flow_ids() const
TrackEvent_Decoder(const ::protozero::ConstBytes &raw)
::protozero::RepeatedFieldIterator<::protozero::ConstChars > categories() const
::protozero::RepeatedFieldIterator<::protozero::ConstBytes > debug_annotations() const
TrackEvent_Decoder(const uint8_t *data, size_t len)
void add_categories(const char *data, size_t size)
static constexpr FieldMetadata_Categories kCategories()
::protozero::proto_utils::FieldMetadata< 22, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kString, std::string, TrackEvent > FieldMetadata_Categories
::protozero::proto_utils::FieldMetadata< 9, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kEnum, ::perfetto::protos::pbzero::TrackEvent_Type, TrackEvent > FieldMetadata_Type
void set_type(::perfetto::protos::pbzero::TrackEvent_Type value)
void add_categories(::protozero::ConstChars chars)
static const char * Type_Name(Type value)
::protozero::proto_utils::FieldMetadata< 4, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kMessage, DebugAnnotation, TrackEvent > FieldMetadata_DebugAnnotations
static constexpr FieldMetadata_FlowIds kFlowIds()
static constexpr FieldMetadata_Name kName()
::protozero::proto_utils::FieldMetadata< 47, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kFixed64, uint64_t, TrackEvent > FieldMetadata_FlowIds
::protozero::proto_utils::FieldMetadata< 11, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, TrackEvent > FieldMetadata_TrackUuid
::protozero::proto_utils::FieldMetadata< 48, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kFixed64, uint64_t, TrackEvent > FieldMetadata_TerminatingFlowIds
static constexpr FieldMetadata_DebugAnnotations kDebugAnnotations()
static constexpr const char * GetName()
static constexpr FieldMetadata_TrackUuid kTrackUuid()
void set_name(::protozero::ConstChars chars)
static constexpr FieldMetadata_TerminatingFlowIds kTerminatingFlowIds()
void set_name(const char *data, size_t size)
::protozero::proto_utils::FieldMetadata< 23, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kString, std::string, TrackEvent > FieldMetadata_Name
static constexpr FieldMetadata_Type kType()
uint8_t value
constexpr TrackEvent_Type TrackEvent_Type_MIN
constexpr TrackEvent_Type TrackEvent_Type_MAX
PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE const char * TrackEvent_Type_Name(::perfetto::protos::pbzero::TrackEvent_Type value)
perfetto_pbzero_enum_TrackEvent::Type TrackEvent_Type
#define T