1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CPM_TRACE_PROTO_H_ 4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CPM_TRACE_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 16 namespace perfetto { 17 namespace protos { 18 namespace pbzero { 19 20 class ParamSetValueCpmFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 21 public: ParamSetValueCpmFtraceEvent_Decoder(const uint8_t * data,size_t len)22 ParamSetValueCpmFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} ParamSetValueCpmFtraceEvent_Decoder(const std::string & raw)23 explicit ParamSetValueCpmFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} ParamSetValueCpmFtraceEvent_Decoder(const::protozero::ConstBytes & raw)24 explicit ParamSetValueCpmFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_body()25 bool has_body() const { return at<1>().valid(); } body()26 ::protozero::ConstChars body() const { return at<1>().as_string(); } has_value()27 bool has_value() const { return at<2>().valid(); } value()28 uint32_t value() const { return at<2>().as_uint32(); } has_timestamp()29 bool has_timestamp() const { return at<3>().valid(); } timestamp()30 int64_t timestamp() const { return at<3>().as_int64(); } 31 }; 32 33 class ParamSetValueCpmFtraceEvent : public ::protozero::Message { 34 public: 35 using Decoder = ParamSetValueCpmFtraceEvent_Decoder; 36 enum : int32_t { 37 kBodyFieldNumber = 1, 38 kValueFieldNumber = 2, 39 kTimestampFieldNumber = 3, 40 }; GetName()41 static constexpr const char* GetName() { return ".perfetto.protos.ParamSetValueCpmFtraceEvent"; } 42 43 44 using FieldMetadata_Body = 45 ::protozero::proto_utils::FieldMetadata< 46 1, 47 ::protozero::proto_utils::RepetitionType::kNotRepeated, 48 ::protozero::proto_utils::ProtoSchemaType::kString, 49 std::string, 50 ParamSetValueCpmFtraceEvent>; 51 52 static constexpr FieldMetadata_Body kBody{}; set_body(const char * data,size_t size)53 void set_body(const char* data, size_t size) { 54 AppendBytes(FieldMetadata_Body::kFieldId, data, size); 55 } set_body(::protozero::ConstChars chars)56 void set_body(::protozero::ConstChars chars) { 57 AppendBytes(FieldMetadata_Body::kFieldId, chars.data, chars.size); 58 } set_body(std::string value)59 void set_body(std::string value) { 60 static constexpr uint32_t field_id = FieldMetadata_Body::kFieldId; 61 // Call the appropriate protozero::Message::Append(field_id, ...) 62 // method based on the type of the field. 63 ::protozero::internal::FieldWriter< 64 ::protozero::proto_utils::ProtoSchemaType::kString> 65 ::Append(*this, field_id, value); 66 } 67 68 using FieldMetadata_Value = 69 ::protozero::proto_utils::FieldMetadata< 70 2, 71 ::protozero::proto_utils::RepetitionType::kNotRepeated, 72 ::protozero::proto_utils::ProtoSchemaType::kUint32, 73 uint32_t, 74 ParamSetValueCpmFtraceEvent>; 75 76 static constexpr FieldMetadata_Value kValue{}; set_value(uint32_t value)77 void set_value(uint32_t value) { 78 static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId; 79 // Call the appropriate protozero::Message::Append(field_id, ...) 80 // method based on the type of the field. 81 ::protozero::internal::FieldWriter< 82 ::protozero::proto_utils::ProtoSchemaType::kUint32> 83 ::Append(*this, field_id, value); 84 } 85 86 using FieldMetadata_Timestamp = 87 ::protozero::proto_utils::FieldMetadata< 88 3, 89 ::protozero::proto_utils::RepetitionType::kNotRepeated, 90 ::protozero::proto_utils::ProtoSchemaType::kInt64, 91 int64_t, 92 ParamSetValueCpmFtraceEvent>; 93 94 static constexpr FieldMetadata_Timestamp kTimestamp{}; set_timestamp(int64_t value)95 void set_timestamp(int64_t value) { 96 static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId; 97 // Call the appropriate protozero::Message::Append(field_id, ...) 98 // method based on the type of the field. 99 ::protozero::internal::FieldWriter< 100 ::protozero::proto_utils::ProtoSchemaType::kInt64> 101 ::Append(*this, field_id, value); 102 } 103 }; 104 105 } // Namespace. 106 } // Namespace. 107 } // Namespace. 108 #endif // Include guard. 109