1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
2 
3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_INSETSSOURCE_PROTO_H_
4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_INSETSSOURCE_PROTO_H_
5 
6 #include <stddef.h>
7 #include <stdint.h>
8 
9 #include "perfetto/protozero/field_writer.h"
10 #include "perfetto/protozero/message.h"
11 #include "perfetto/protozero/packed_repeated_fields.h"
12 #include "perfetto/protozero/proto_decoder.h"
13 #include "perfetto/protozero/proto_utils.h"
14 
15 namespace perfetto {
16 namespace protos {
17 namespace pbzero {
18 class RectProto;
19 } // Namespace pbzero.
20 } // Namespace protos.
21 } // Namespace perfetto.
22 
23 namespace perfetto {
24 namespace protos {
25 namespace pbzero {
26 
27 class InsetsSourceProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28  public:
InsetsSourceProto_Decoder(const uint8_t * data,size_t len)29   InsetsSourceProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
InsetsSourceProto_Decoder(const std::string & raw)30   explicit InsetsSourceProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
InsetsSourceProto_Decoder(const::protozero::ConstBytes & raw)31   explicit InsetsSourceProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_type()32   bool has_type() const { return at<1>().valid(); }
type()33   ::protozero::ConstChars type() const { return at<1>().as_string(); }
has_frame()34   bool has_frame() const { return at<2>().valid(); }
frame()35   ::protozero::ConstBytes frame() const { return at<2>().as_bytes(); }
has_visible_frame()36   bool has_visible_frame() const { return at<3>().valid(); }
visible_frame()37   ::protozero::ConstBytes visible_frame() const { return at<3>().as_bytes(); }
has_visible()38   bool has_visible() const { return at<4>().valid(); }
visible()39   bool visible() const { return at<4>().as_bool(); }
has_type_number()40   bool has_type_number() const { return at<5>().valid(); }
type_number()41   int32_t type_number() const { return at<5>().as_int32(); }
42 };
43 
44 class InsetsSourceProto : public ::protozero::Message {
45  public:
46   using Decoder = InsetsSourceProto_Decoder;
47   enum : int32_t {
48     kTypeFieldNumber = 1,
49     kFrameFieldNumber = 2,
50     kVisibleFrameFieldNumber = 3,
51     kVisibleFieldNumber = 4,
52     kTypeNumberFieldNumber = 5,
53   };
GetName()54   static constexpr const char* GetName() { return ".perfetto.protos.InsetsSourceProto"; }
55 
56 
57   using FieldMetadata_Type =
58     ::protozero::proto_utils::FieldMetadata<
59       1,
60       ::protozero::proto_utils::RepetitionType::kNotRepeated,
61       ::protozero::proto_utils::ProtoSchemaType::kString,
62       std::string,
63       InsetsSourceProto>;
64 
65   static constexpr FieldMetadata_Type kType{};
set_type(const char * data,size_t size)66   void set_type(const char* data, size_t size) {
67     AppendBytes(FieldMetadata_Type::kFieldId, data, size);
68   }
set_type(::protozero::ConstChars chars)69   void set_type(::protozero::ConstChars chars) {
70     AppendBytes(FieldMetadata_Type::kFieldId, chars.data, chars.size);
71   }
set_type(std::string value)72   void set_type(std::string value) {
73     static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
74     // Call the appropriate protozero::Message::Append(field_id, ...)
75     // method based on the type of the field.
76     ::protozero::internal::FieldWriter<
77       ::protozero::proto_utils::ProtoSchemaType::kString>
78         ::Append(*this, field_id, value);
79   }
80 
81   using FieldMetadata_Frame =
82     ::protozero::proto_utils::FieldMetadata<
83       2,
84       ::protozero::proto_utils::RepetitionType::kNotRepeated,
85       ::protozero::proto_utils::ProtoSchemaType::kMessage,
86       RectProto,
87       InsetsSourceProto>;
88 
89   static constexpr FieldMetadata_Frame kFrame{};
set_frame()90   template <typename T = RectProto> T* set_frame() {
91     return BeginNestedMessage<T>(2);
92   }
93 
94 
95   using FieldMetadata_VisibleFrame =
96     ::protozero::proto_utils::FieldMetadata<
97       3,
98       ::protozero::proto_utils::RepetitionType::kNotRepeated,
99       ::protozero::proto_utils::ProtoSchemaType::kMessage,
100       RectProto,
101       InsetsSourceProto>;
102 
103   static constexpr FieldMetadata_VisibleFrame kVisibleFrame{};
set_visible_frame()104   template <typename T = RectProto> T* set_visible_frame() {
105     return BeginNestedMessage<T>(3);
106   }
107 
108 
109   using FieldMetadata_Visible =
110     ::protozero::proto_utils::FieldMetadata<
111       4,
112       ::protozero::proto_utils::RepetitionType::kNotRepeated,
113       ::protozero::proto_utils::ProtoSchemaType::kBool,
114       bool,
115       InsetsSourceProto>;
116 
117   static constexpr FieldMetadata_Visible kVisible{};
set_visible(bool value)118   void set_visible(bool value) {
119     static constexpr uint32_t field_id = FieldMetadata_Visible::kFieldId;
120     // Call the appropriate protozero::Message::Append(field_id, ...)
121     // method based on the type of the field.
122     ::protozero::internal::FieldWriter<
123       ::protozero::proto_utils::ProtoSchemaType::kBool>
124         ::Append(*this, field_id, value);
125   }
126 
127   using FieldMetadata_TypeNumber =
128     ::protozero::proto_utils::FieldMetadata<
129       5,
130       ::protozero::proto_utils::RepetitionType::kNotRepeated,
131       ::protozero::proto_utils::ProtoSchemaType::kInt32,
132       int32_t,
133       InsetsSourceProto>;
134 
135   static constexpr FieldMetadata_TypeNumber kTypeNumber{};
set_type_number(int32_t value)136   void set_type_number(int32_t value) {
137     static constexpr uint32_t field_id = FieldMetadata_TypeNumber::kFieldId;
138     // Call the appropriate protozero::Message::Append(field_id, ...)
139     // method based on the type of the field.
140     ::protozero::internal::FieldWriter<
141       ::protozero::proto_utils::ProtoSchemaType::kInt32>
142         ::Append(*this, field_id, value);
143   }
144 };
145 
146 } // Namespace.
147 } // Namespace.
148 } // Namespace.
149 #endif  // Include guard.
150