1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_APP_WINDOW_CONFIGURATION_PROTO_H_ 4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_APP_WINDOW_CONFIGURATION_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 WindowConfigurationProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 28 public: WindowConfigurationProto_Decoder(const uint8_t * data,size_t len)29 WindowConfigurationProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} WindowConfigurationProto_Decoder(const std::string & raw)30 explicit WindowConfigurationProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} WindowConfigurationProto_Decoder(const::protozero::ConstBytes & raw)31 explicit WindowConfigurationProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_app_bounds()32 bool has_app_bounds() const { return at<1>().valid(); } app_bounds()33 ::protozero::ConstBytes app_bounds() const { return at<1>().as_bytes(); } has_windowing_mode()34 bool has_windowing_mode() const { return at<2>().valid(); } windowing_mode()35 int32_t windowing_mode() const { return at<2>().as_int32(); } has_activity_type()36 bool has_activity_type() const { return at<3>().valid(); } activity_type()37 int32_t activity_type() const { return at<3>().as_int32(); } has_bounds()38 bool has_bounds() const { return at<4>().valid(); } bounds()39 ::protozero::ConstBytes bounds() const { return at<4>().as_bytes(); } has_max_bounds()40 bool has_max_bounds() const { return at<5>().valid(); } max_bounds()41 ::protozero::ConstBytes max_bounds() const { return at<5>().as_bytes(); } 42 }; 43 44 class WindowConfigurationProto : public ::protozero::Message { 45 public: 46 using Decoder = WindowConfigurationProto_Decoder; 47 enum : int32_t { 48 kAppBoundsFieldNumber = 1, 49 kWindowingModeFieldNumber = 2, 50 kActivityTypeFieldNumber = 3, 51 kBoundsFieldNumber = 4, 52 kMaxBoundsFieldNumber = 5, 53 }; GetName()54 static constexpr const char* GetName() { return ".perfetto.protos.WindowConfigurationProto"; } 55 56 57 using FieldMetadata_AppBounds = 58 ::protozero::proto_utils::FieldMetadata< 59 1, 60 ::protozero::proto_utils::RepetitionType::kNotRepeated, 61 ::protozero::proto_utils::ProtoSchemaType::kMessage, 62 RectProto, 63 WindowConfigurationProto>; 64 65 static constexpr FieldMetadata_AppBounds kAppBounds{}; set_app_bounds()66 template <typename T = RectProto> T* set_app_bounds() { 67 return BeginNestedMessage<T>(1); 68 } 69 70 71 using FieldMetadata_WindowingMode = 72 ::protozero::proto_utils::FieldMetadata< 73 2, 74 ::protozero::proto_utils::RepetitionType::kNotRepeated, 75 ::protozero::proto_utils::ProtoSchemaType::kInt32, 76 int32_t, 77 WindowConfigurationProto>; 78 79 static constexpr FieldMetadata_WindowingMode kWindowingMode{}; set_windowing_mode(int32_t value)80 void set_windowing_mode(int32_t value) { 81 static constexpr uint32_t field_id = FieldMetadata_WindowingMode::kFieldId; 82 // Call the appropriate protozero::Message::Append(field_id, ...) 83 // method based on the type of the field. 84 ::protozero::internal::FieldWriter< 85 ::protozero::proto_utils::ProtoSchemaType::kInt32> 86 ::Append(*this, field_id, value); 87 } 88 89 using FieldMetadata_ActivityType = 90 ::protozero::proto_utils::FieldMetadata< 91 3, 92 ::protozero::proto_utils::RepetitionType::kNotRepeated, 93 ::protozero::proto_utils::ProtoSchemaType::kInt32, 94 int32_t, 95 WindowConfigurationProto>; 96 97 static constexpr FieldMetadata_ActivityType kActivityType{}; set_activity_type(int32_t value)98 void set_activity_type(int32_t value) { 99 static constexpr uint32_t field_id = FieldMetadata_ActivityType::kFieldId; 100 // Call the appropriate protozero::Message::Append(field_id, ...) 101 // method based on the type of the field. 102 ::protozero::internal::FieldWriter< 103 ::protozero::proto_utils::ProtoSchemaType::kInt32> 104 ::Append(*this, field_id, value); 105 } 106 107 using FieldMetadata_Bounds = 108 ::protozero::proto_utils::FieldMetadata< 109 4, 110 ::protozero::proto_utils::RepetitionType::kNotRepeated, 111 ::protozero::proto_utils::ProtoSchemaType::kMessage, 112 RectProto, 113 WindowConfigurationProto>; 114 115 static constexpr FieldMetadata_Bounds kBounds{}; set_bounds()116 template <typename T = RectProto> T* set_bounds() { 117 return BeginNestedMessage<T>(4); 118 } 119 120 121 using FieldMetadata_MaxBounds = 122 ::protozero::proto_utils::FieldMetadata< 123 5, 124 ::protozero::proto_utils::RepetitionType::kNotRepeated, 125 ::protozero::proto_utils::ProtoSchemaType::kMessage, 126 RectProto, 127 WindowConfigurationProto>; 128 129 static constexpr FieldMetadata_MaxBounds kMaxBounds{}; set_max_bounds()130 template <typename T = RectProto> T* set_max_bounds() { 131 return BeginNestedMessage<T>(5); 132 } 133 134 }; 135 136 } // Namespace. 137 } // Namespace. 138 } // Namespace. 139 #endif // Include guard. 140