Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
debug_annotation.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_DEBUG_ANNOTATION_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_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_Decoder : public ::protozero::TypedProtoDecoder<
28 /*MAX_FIELD_ID=*/10,
29 /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30 public:
31 DebugAnnotation_Decoder(const uint8_t* data, size_t len)
32 : TypedProtoDecoder(data, len) {}
33 explicit DebugAnnotation_Decoder(const std::string& raw)
34 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
35 raw.size()) {}
36 explicit DebugAnnotation_Decoder(const ::protozero::ConstBytes& raw)
37 : TypedProtoDecoder(raw.data, raw.size) {}
38 bool has_name() const { return at<10>().valid(); }
39 ::protozero::ConstChars name() const { return at<10>().as_string(); }
40 bool has_string_value() const { return at<6>().valid(); }
41 ::protozero::ConstChars string_value() const { return at<6>().as_string(); }
42 bool has_legacy_json_value() const { return at<9>().valid(); }
43 ::protozero::ConstChars legacy_json_value() const {
44 return at<9>().as_string();
45 }
46};
47
48class DebugAnnotation : public ::protozero::Message {
49 public:
51 enum : int32_t {
55 };
56 static constexpr const char* GetName() {
57 return ".perfetto.protos.DebugAnnotation";
58 }
59
60 using FieldMetadata_Name = ::protozero::proto_utils::FieldMetadata<
61 10,
62 ::protozero::proto_utils::RepetitionType::kNotRepeated,
63 ::protozero::proto_utils::ProtoSchemaType::kString,
64 std::string,
66
67 // Ceci n'est pas une pipe.
68 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
69 // type (and users are expected to use it as such, hence kCamelCase name).
70 // It is declared as a function to keep protozero bindings header-only as
71 // inline constexpr variables are not available until C++17 (while inline
72 // functions are).
73 // TODO(altimin): Use inline variable instead after adopting C++17.
74 static constexpr FieldMetadata_Name kName() { return {}; }
75 void set_name(const char* data, size_t size) {
76 AppendBytes(FieldMetadata_Name::kFieldId, data, size);
77 }
78 void set_name(::protozero::ConstChars chars) {
79 AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size);
80 }
81 void set_name(std::string value) {
82 static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
83 // Call the appropriate protozero::Message::Append(field_id, ...)
84 // method based on the type of the field.
85 ::protozero::internal::FieldWriter<
86 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*this,
87 field_id,
88 value);
89 }
90
91 using FieldMetadata_StringValue = ::protozero::proto_utils::FieldMetadata<
92 6,
93 ::protozero::proto_utils::RepetitionType::kNotRepeated,
94 ::protozero::proto_utils::ProtoSchemaType::kString,
95 std::string,
97
98 // Ceci n'est pas une pipe.
99 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
100 // type (and users are expected to use it as such, hence kCamelCase name).
101 // It is declared as a function to keep protozero bindings header-only as
102 // inline constexpr variables are not available until C++17 (while inline
103 // functions are).
104 // TODO(altimin): Use inline variable instead after adopting C++17.
105 static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
106 void set_string_value(const char* data, size_t size) {
107 AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
108 }
109 void set_string_value(::protozero::ConstChars chars) {
110 AppendBytes(FieldMetadata_StringValue::kFieldId, chars.data, chars.size);
111 }
112 void set_string_value(std::string value) {
113 static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
114 // Call the appropriate protozero::Message::Append(field_id, ...)
115 // method based on the type of the field.
116 ::protozero::internal::FieldWriter<
117 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*this,
118 field_id,
119 value);
120 }
121
122 using FieldMetadata_LegacyJsonValue = ::protozero::proto_utils::FieldMetadata<
123 9,
124 ::protozero::proto_utils::RepetitionType::kNotRepeated,
125 ::protozero::proto_utils::ProtoSchemaType::kString,
126 std::string,
128
129 // Ceci n'est pas une pipe.
130 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
131 // type (and users are expected to use it as such, hence kCamelCase name).
132 // It is declared as a function to keep protozero bindings header-only as
133 // inline constexpr variables are not available until C++17 (while inline
134 // functions are).
135 // TODO(altimin): Use inline variable instead after adopting C++17.
137 return {};
138 }
139 void set_legacy_json_value(const char* data, size_t size) {
140 AppendBytes(FieldMetadata_LegacyJsonValue::kFieldId, data, size);
141 }
142 void set_legacy_json_value(::protozero::ConstChars chars) {
143 AppendBytes(FieldMetadata_LegacyJsonValue::kFieldId, chars.data,
144 chars.size);
145 }
146 void set_legacy_json_value(std::string value) {
147 static constexpr uint32_t field_id =
148 FieldMetadata_LegacyJsonValue::kFieldId;
149 // Call the appropriate protozero::Message::Append(field_id, ...)
150 // method based on the type of the field.
151 ::protozero::internal::FieldWriter<
152 ::protozero::proto_utils::ProtoSchemaType::kString>::Append(*this,
153 field_id,
154 value);
155 }
156};
157
158} // namespace pbzero
159} // namespace protos
160} // namespace perfetto
161#endif // Include guard.
DebugAnnotation_Decoder(const ::protozero::ConstBytes &raw)
void set_name(const char *data, size_t size)
::protozero::proto_utils::FieldMetadata< 6, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kString, std::string, DebugAnnotation > FieldMetadata_StringValue
static constexpr FieldMetadata_StringValue kStringValue()
void set_string_value(::protozero::ConstChars chars)
void set_legacy_json_value(const char *data, size_t size)
::protozero::proto_utils::FieldMetadata< 9, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kString, std::string, DebugAnnotation > FieldMetadata_LegacyJsonValue
::protozero::proto_utils::FieldMetadata< 10, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kString, std::string, DebugAnnotation > FieldMetadata_Name
void set_legacy_json_value(::protozero::ConstChars chars)
static constexpr FieldMetadata_LegacyJsonValue kLegacyJsonValue()
void set_string_value(const char *data, size_t size)
void set_name(::protozero::ConstChars chars)
static constexpr FieldMetadata_Name kName()
uint8_t value