1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_SERVER_SURFACEANIMATOR_PROTO_H_ 4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_SERVER_SURFACEANIMATOR_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 AnimationAdapterProto; 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 SurfaceAnimatorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 29 public: SurfaceAnimatorProto_Decoder(const uint8_t * data,size_t len)30 SurfaceAnimatorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} SurfaceAnimatorProto_Decoder(const std::string & raw)31 explicit SurfaceAnimatorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} SurfaceAnimatorProto_Decoder(const::protozero::ConstBytes & raw)32 explicit SurfaceAnimatorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_leash()33 bool has_leash() const { return at<1>().valid(); } leash()34 ::protozero::ConstBytes leash() const { return at<1>().as_bytes(); } has_animation_start_delayed()35 bool has_animation_start_delayed() const { return at<2>().valid(); } animation_start_delayed()36 bool animation_start_delayed() const { return at<2>().as_bool(); } has_animation_adapter()37 bool has_animation_adapter() const { return at<3>().valid(); } animation_adapter()38 ::protozero::ConstBytes animation_adapter() const { return at<3>().as_bytes(); } 39 }; 40 41 class SurfaceAnimatorProto : public ::protozero::Message { 42 public: 43 using Decoder = SurfaceAnimatorProto_Decoder; 44 enum : int32_t { 45 kLeashFieldNumber = 1, 46 kAnimationStartDelayedFieldNumber = 2, 47 kAnimationAdapterFieldNumber = 3, 48 }; GetName()49 static constexpr const char* GetName() { return ".perfetto.protos.SurfaceAnimatorProto"; } 50 51 52 using FieldMetadata_Leash = 53 ::protozero::proto_utils::FieldMetadata< 54 1, 55 ::protozero::proto_utils::RepetitionType::kNotRepeated, 56 ::protozero::proto_utils::ProtoSchemaType::kMessage, 57 SurfaceControlProto, 58 SurfaceAnimatorProto>; 59 60 static constexpr FieldMetadata_Leash kLeash{}; set_leash()61 template <typename T = SurfaceControlProto> T* set_leash() { 62 return BeginNestedMessage<T>(1); 63 } 64 65 66 using FieldMetadata_AnimationStartDelayed = 67 ::protozero::proto_utils::FieldMetadata< 68 2, 69 ::protozero::proto_utils::RepetitionType::kNotRepeated, 70 ::protozero::proto_utils::ProtoSchemaType::kBool, 71 bool, 72 SurfaceAnimatorProto>; 73 74 static constexpr FieldMetadata_AnimationStartDelayed kAnimationStartDelayed{}; set_animation_start_delayed(bool value)75 void set_animation_start_delayed(bool value) { 76 static constexpr uint32_t field_id = FieldMetadata_AnimationStartDelayed::kFieldId; 77 // Call the appropriate protozero::Message::Append(field_id, ...) 78 // method based on the type of the field. 79 ::protozero::internal::FieldWriter< 80 ::protozero::proto_utils::ProtoSchemaType::kBool> 81 ::Append(*this, field_id, value); 82 } 83 84 using FieldMetadata_AnimationAdapter = 85 ::protozero::proto_utils::FieldMetadata< 86 3, 87 ::protozero::proto_utils::RepetitionType::kNotRepeated, 88 ::protozero::proto_utils::ProtoSchemaType::kMessage, 89 AnimationAdapterProto, 90 SurfaceAnimatorProto>; 91 92 static constexpr FieldMetadata_AnimationAdapter kAnimationAdapter{}; set_animation_adapter()93 template <typename T = AnimationAdapterProto> T* set_animation_adapter() { 94 return BeginNestedMessage<T>(3); 95 } 96 97 }; 98 99 } // Namespace. 100 } // Namespace. 101 } // Namespace. 102 #endif // Include guard. 103