Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
track_descriptor.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_DESCRIPTOR_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_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 ProcessDescriptor;
28class ThreadDescriptor;
29
30class TrackDescriptor_Decoder : public ::protozero::TypedProtoDecoder<
31 /*MAX_FIELD_ID=*/5,
32 /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33 public:
34 TrackDescriptor_Decoder(const uint8_t* data, size_t len)
35 : TypedProtoDecoder(data, len) {}
36 explicit TrackDescriptor_Decoder(const std::string& raw)
37 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
38 raw.size()) {}
39 explicit TrackDescriptor_Decoder(const ::protozero::ConstBytes& raw)
40 : TypedProtoDecoder(raw.data, raw.size) {}
41 bool has_uuid() const { return at<1>().valid(); }
42 uint64_t uuid() const { return at<1>().as_uint64(); }
43 bool has_parent_uuid() const { return at<5>().valid(); }
44 uint64_t parent_uuid() const { return at<5>().as_uint64(); }
45 bool has_name() const { return at<2>().valid(); }
46 ::protozero::ConstChars name() const { return at<2>().as_string(); }
47 bool has_process() const { return at<3>().valid(); }
48 ::protozero::ConstBytes process() const { return at<3>().as_bytes(); }
49 bool has_thread() const { return at<4>().valid(); }
50 ::protozero::ConstBytes thread() const { return at<4>().as_bytes(); }
51};
52
53class TrackDescriptor : public ::protozero::Message {
54 public:
56 enum : int32_t {
62 };
63 static constexpr const char* GetName() {
64 return ".perfetto.protos.TrackDescriptor";
65 }
66
67 using FieldMetadata_Uuid = ::protozero::proto_utils::FieldMetadata<
68 1,
69 ::protozero::proto_utils::RepetitionType::kNotRepeated,
70 ::protozero::proto_utils::ProtoSchemaType::kUint64,
71 uint64_t,
73
74 // Ceci n'est pas une pipe.
75 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
76 // type (and users are expected to use it as such, hence kCamelCase name).
77 // It is declared as a function to keep protozero bindings header-only as
78 // inline constexpr variables are not available until C++17 (while inline
79 // functions are).
80 // TODO(altimin): Use inline variable instead after adopting C++17.
81 static constexpr FieldMetadata_Uuid kUuid() { return {}; }
82 void set_uuid(uint64_t value) {
83 static constexpr uint32_t field_id = FieldMetadata_Uuid::kFieldId;
84 // Call the appropriate protozero::Message::Append(field_id, ...)
85 // method based on the type of the field.
86 ::protozero::internal::FieldWriter<
87 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
88 field_id,
89 value);
90 }
91
92 using FieldMetadata_ParentUuid = ::protozero::proto_utils::FieldMetadata<
93 5,
94 ::protozero::proto_utils::RepetitionType::kNotRepeated,
95 ::protozero::proto_utils::ProtoSchemaType::kUint64,
96 uint64_t,
98
99 // Ceci n'est pas une pipe.
100 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
101 // type (and users are expected to use it as such, hence kCamelCase name).
102 // It is declared as a function to keep protozero bindings header-only as
103 // inline constexpr variables are not available until C++17 (while inline
104 // functions are).
105 // TODO(altimin): Use inline variable instead after adopting C++17.
106 static constexpr FieldMetadata_ParentUuid kParentUuid() { return {}; }
107 void set_parent_uuid(uint64_t value) {
108 static constexpr uint32_t field_id = FieldMetadata_ParentUuid::kFieldId;
109 // Call the appropriate protozero::Message::Append(field_id, ...)
110 // method based on the type of the field.
111 ::protozero::internal::FieldWriter<
112 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
113 field_id,
114 value);
115 }
116
117 using FieldMetadata_Name = ::protozero::proto_utils::FieldMetadata<
118 2,
119 ::protozero::proto_utils::RepetitionType::kNotRepeated,
120 ::protozero::proto_utils::ProtoSchemaType::kString,
121 std::string,
123
124 // Ceci n'est pas une pipe.
125 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
126 // type (and users are expected to use it as such, hence kCamelCase name).
127 // It is declared as a function to keep protozero bindings header-only as
128 // inline constexpr variables are not available until C++17 (while inline
129 // functions are).
130 // TODO(altimin): Use inline variable instead after adopting C++17.
131 static constexpr FieldMetadata_Name kName() { return {}; }
132 void set_name(const char* data, size_t size) {
133 AppendBytes(FieldMetadata_Name::kFieldId, data, size);
134 }
135 void set_name(::protozero::ConstChars chars) {
136 AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size);
137 }
138 void set_name(std::string value) {
139 static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
140 // Call the appropriate protozero::Message::Append(field_id, ...)
141 // method based on the type of the field.
142 ::protozero::internal::FieldWriter<
143 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*this,
144 field_id,
145 value);
146 }
147
148 using FieldMetadata_Process = ::protozero::proto_utils::FieldMetadata<
149 3,
150 ::protozero::proto_utils::RepetitionType::kNotRepeated,
151 ::protozero::proto_utils::ProtoSchemaType::kMessage,
154
155 // Ceci n'est pas une pipe.
156 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
157 // type (and users are expected to use it as such, hence kCamelCase name).
158 // It is declared as a function to keep protozero bindings header-only as
159 // inline constexpr variables are not available until C++17 (while inline
160 // functions are).
161 // TODO(altimin): Use inline variable instead after adopting C++17.
162 static constexpr FieldMetadata_Process kProcess() { return {}; }
163 template <typename T = ProcessDescriptor>
165 return BeginNestedMessage<T>(3);
166 }
167
168 using FieldMetadata_Thread = ::protozero::proto_utils::FieldMetadata<
169 4,
170 ::protozero::proto_utils::RepetitionType::kNotRepeated,
171 ::protozero::proto_utils::ProtoSchemaType::kMessage,
174
175 // Ceci n'est pas une pipe.
176 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
177 // type (and users are expected to use it as such, hence kCamelCase name).
178 // It is declared as a function to keep protozero bindings header-only as
179 // inline constexpr variables are not available until C++17 (while inline
180 // functions are).
181 // TODO(altimin): Use inline variable instead after adopting C++17.
182 static constexpr FieldMetadata_Thread kThread() { return {}; }
183 template <typename T = ThreadDescriptor>
185 return BeginNestedMessage<T>(4);
186 }
187};
188
189} // namespace pbzero
190} // namespace protos
191} // namespace perfetto
192#endif // Include guard.
TrackDescriptor_Decoder(const ::protozero::ConstBytes &raw)
void set_name(const char *data, size_t size)
static constexpr FieldMetadata_Name kName()
static constexpr FieldMetadata_Thread kThread()
static constexpr FieldMetadata_Uuid kUuid()
static constexpr FieldMetadata_ParentUuid kParentUuid()
::protozero::proto_utils::FieldMetadata< 3, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kMessage, ProcessDescriptor, TrackDescriptor > FieldMetadata_Process
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kString, std::string, TrackDescriptor > FieldMetadata_Name
::protozero::proto_utils::FieldMetadata< 5, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, TrackDescriptor > FieldMetadata_ParentUuid
static constexpr FieldMetadata_Process kProcess()
void set_name(::protozero::ConstChars chars)
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, TrackDescriptor > FieldMetadata_Uuid
::protozero::proto_utils::FieldMetadata< 4, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kMessage, ThreadDescriptor, TrackDescriptor > FieldMetadata_Thread
uint8_t value
#define T