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_
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"
27class ProcessDescriptor;
28class ThreadDescriptor;
35 : TypedProtoDecoder(data, len) {}
37 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
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(); }
45 bool has_name()
const {
return at<2>().valid(); }
46 ::protozero::ConstChars
name()
const {
return at<2>().as_string(); }
48 ::protozero::ConstBytes
process()
const {
return at<3>().as_bytes(); }
50 ::protozero::ConstBytes
thread()
const {
return at<4>().as_bytes(); }
64 return ".perfetto.protos.TrackDescriptor";
69 ::protozero::proto_utils::RepetitionType::kNotRepeated,
70 ::protozero::proto_utils::ProtoSchemaType::kUint64,
83 static constexpr uint32_t field_id = FieldMetadata_Uuid::kFieldId;
86 ::protozero::internal::FieldWriter<
87 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
94 ::protozero::proto_utils::RepetitionType::kNotRepeated,
95 ::protozero::proto_utils::ProtoSchemaType::kUint64,
108 static constexpr uint32_t field_id = FieldMetadata_ParentUuid::kFieldId;
111 ::protozero::internal::FieldWriter<
112 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
119 ::protozero::proto_utils::RepetitionType::kNotRepeated,
120 ::protozero::proto_utils::ProtoSchemaType::kString,
133 AppendBytes(FieldMetadata_Name::kFieldId, data, size);
136 AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size);
139 static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
142 ::protozero::internal::FieldWriter<
143 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*
this,
150 ::protozero::proto_utils::RepetitionType::kNotRepeated,
151 ::protozero::proto_utils::ProtoSchemaType::kMessage,
163 template <
typename T = ProcessDescriptor>
165 return BeginNestedMessage<T>(3);
170 ::protozero::proto_utils::RepetitionType::kNotRepeated,
171 ::protozero::proto_utils::ProtoSchemaType::kMessage,
183 template <
typename T = ThreadDescriptor>
185 return BeginNestedMessage<T>(4);
TrackDescriptor_Decoder(const ::protozero::ConstBytes &raw)
uint64_t parent_uuid() const
bool has_parent_uuid() const
TrackDescriptor_Decoder(const std::string &raw)
::protozero::ConstChars name() const
::protozero::ConstBytes process() const
TrackDescriptor_Decoder(const uint8_t *data, size_t len)
::protozero::ConstBytes thread() const
void set_parent_uuid(uint64_t value)
void set_name(const char *data, size_t size)
static constexpr FieldMetadata_Name kName()
void set_name(std::string value)
static constexpr FieldMetadata_Thread kThread()
static constexpr FieldMetadata_Uuid kUuid()
static constexpr FieldMetadata_ParentUuid kParentUuid()
static constexpr const char * GetName()
::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)
void set_uuid(uint64_t value)
::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