11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_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"
32 : TypedProtoDecoder(data, len) {}
34 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
37 : TypedProtoDecoder(raw.data, raw.size) {}
38 bool has_pid()
const {
return at<1>().valid(); }
39 int32_t
pid()
const {
return at<1>().as_int32(); }
40 bool has_tid()
const {
return at<2>().valid(); }
41 int32_t
tid()
const {
return at<2>().as_int32(); }
43 ::protozero::ConstChars
thread_name()
const {
return at<5>().as_string(); }
55 return ".perfetto.protos.ThreadDescriptor";
60 ::protozero::proto_utils::RepetitionType::kNotRepeated,
61 ::protozero::proto_utils::ProtoSchemaType::kInt32,
74 static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
77 ::protozero::internal::FieldWriter<
78 ::protozero::proto_utils::ProtoSchemaType::kInt32>::Append(*
this,
85 ::protozero::proto_utils::RepetitionType::kNotRepeated,
86 ::protozero::proto_utils::ProtoSchemaType::kInt32,
99 static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
102 ::protozero::internal::FieldWriter<
103 ::protozero::proto_utils::ProtoSchemaType::kInt32>::Append(*
this,
110 ::protozero::proto_utils::RepetitionType::kNotRepeated,
111 ::protozero::proto_utils::ProtoSchemaType::kString,
124 AppendBytes(FieldMetadata_ThreadName::kFieldId, data, size);
127 AppendBytes(FieldMetadata_ThreadName::kFieldId, chars.data, chars.size);
130 static constexpr uint32_t field_id = FieldMetadata_ThreadName::kFieldId;
133 ::protozero::internal::FieldWriter<
134 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*
this,
ThreadDescriptor_Decoder(const uint8_t *data, size_t len)
bool has_thread_name() const
ThreadDescriptor_Decoder(const std::string &raw)
ThreadDescriptor_Decoder(const ::protozero::ConstBytes &raw)
::protozero::ConstChars thread_name() const
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kInt32, int32_t, ThreadDescriptor > FieldMetadata_Tid
static constexpr FieldMetadata_Pid kPid()
static constexpr const char * GetName()
void set_pid(int32_t value)
void set_thread_name(std::string value)
void set_tid(int32_t value)
::protozero::proto_utils::FieldMetadata< 5, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kString, std::string, ThreadDescriptor > FieldMetadata_ThreadName
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kInt32, int32_t, ThreadDescriptor > FieldMetadata_Pid
static constexpr FieldMetadata_Tid kTid()
static constexpr FieldMetadata_ThreadName kThreadName()
void set_thread_name(const char *data, size_t size)
void set_thread_name(::protozero::ConstChars chars)