1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_INSETSSOURCECONTROL_PROTO_H_ 4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_INSETSSOURCECONTROL_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 PointProto; 19 class SurfaceControlProto; 20 } // Namespace pbzero. 21 } // Namespace protos. 22 } // Namespace perfetto. 23 24 namespace perfetto { 25 namespace protos { 26 namespace pbzero { 27 28 class InsetsSourceControlProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 29 public: InsetsSourceControlProto_Decoder(const uint8_t * data,size_t len)30 InsetsSourceControlProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} InsetsSourceControlProto_Decoder(const std::string & raw)31 explicit InsetsSourceControlProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} InsetsSourceControlProto_Decoder(const::protozero::ConstBytes & raw)32 explicit InsetsSourceControlProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_type()33 bool has_type() const { return at<1>().valid(); } type()34 ::protozero::ConstChars type() const { return at<1>().as_string(); } has_position()35 bool has_position() const { return at<2>().valid(); } position()36 ::protozero::ConstBytes position() const { return at<2>().as_bytes(); } has_leash()37 bool has_leash() const { return at<3>().valid(); } leash()38 ::protozero::ConstBytes leash() const { return at<3>().as_bytes(); } has_type_number()39 bool has_type_number() const { return at<4>().valid(); } type_number()40 int32_t type_number() const { return at<4>().as_int32(); } 41 }; 42 43 class InsetsSourceControlProto : public ::protozero::Message { 44 public: 45 using Decoder = InsetsSourceControlProto_Decoder; 46 enum : int32_t { 47 kTypeFieldNumber = 1, 48 kPositionFieldNumber = 2, 49 kLeashFieldNumber = 3, 50 kTypeNumberFieldNumber = 4, 51 }; GetName()52 static constexpr const char* GetName() { return ".perfetto.protos.InsetsSourceControlProto"; } 53 54 55 using FieldMetadata_Type = 56 ::protozero::proto_utils::FieldMetadata< 57 1, 58 ::protozero::proto_utils::RepetitionType::kNotRepeated, 59 ::protozero::proto_utils::ProtoSchemaType::kString, 60 std::string, 61 InsetsSourceControlProto>; 62 63 static constexpr FieldMetadata_Type kType{}; set_type(const char * data,size_t size)64 void set_type(const char* data, size_t size) { 65 AppendBytes(FieldMetadata_Type::kFieldId, data, size); 66 } set_type(::protozero::ConstChars chars)67 void set_type(::protozero::ConstChars chars) { 68 AppendBytes(FieldMetadata_Type::kFieldId, chars.data, chars.size); 69 } set_type(std::string value)70 void set_type(std::string value) { 71 static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId; 72 // Call the appropriate protozero::Message::Append(field_id, ...) 73 // method based on the type of the field. 74 ::protozero::internal::FieldWriter< 75 ::protozero::proto_utils::ProtoSchemaType::kString> 76 ::Append(*this, field_id, value); 77 } 78 79 using FieldMetadata_Position = 80 ::protozero::proto_utils::FieldMetadata< 81 2, 82 ::protozero::proto_utils::RepetitionType::kNotRepeated, 83 ::protozero::proto_utils::ProtoSchemaType::kMessage, 84 PointProto, 85 InsetsSourceControlProto>; 86 87 static constexpr FieldMetadata_Position kPosition{}; set_position()88 template <typename T = PointProto> T* set_position() { 89 return BeginNestedMessage<T>(2); 90 } 91 92 93 using FieldMetadata_Leash = 94 ::protozero::proto_utils::FieldMetadata< 95 3, 96 ::protozero::proto_utils::RepetitionType::kNotRepeated, 97 ::protozero::proto_utils::ProtoSchemaType::kMessage, 98 SurfaceControlProto, 99 InsetsSourceControlProto>; 100 101 static constexpr FieldMetadata_Leash kLeash{}; set_leash()102 template <typename T = SurfaceControlProto> T* set_leash() { 103 return BeginNestedMessage<T>(3); 104 } 105 106 107 using FieldMetadata_TypeNumber = 108 ::protozero::proto_utils::FieldMetadata< 109 4, 110 ::protozero::proto_utils::RepetitionType::kNotRepeated, 111 ::protozero::proto_utils::ProtoSchemaType::kInt32, 112 int32_t, 113 InsetsSourceControlProto>; 114 115 static constexpr FieldMetadata_TypeNumber kTypeNumber{}; set_type_number(int32_t value)116 void set_type_number(int32_t value) { 117 static constexpr uint32_t field_id = FieldMetadata_TypeNumber::kFieldId; 118 // Call the appropriate protozero::Message::Append(field_id, ...) 119 // method based on the type of the field. 120 ::protozero::internal::FieldWriter< 121 ::protozero::proto_utils::ProtoSchemaType::kInt32> 122 ::Append(*this, field_id, value); 123 } 124 }; 125 126 } // Namespace. 127 } // Namespace. 128 } // Namespace. 129 #endif // Include guard. 130