1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_TRACE_PROTO_H_ 4 #define PERFETTO_PROTOS_TRACE_PROTO_H_ 5 6 #include <stddef.h> 7 #include <stdint.h> 8 9 #include "perfetto/protozero/message.h" 10 #include "perfetto/protozero/packed_repeated_fields.h" 11 #include "perfetto/protozero/proto_decoder.h" 12 #include "perfetto/protozero/proto_utils.h" 13 14 namespace perfetto { 15 namespace protos { 16 namespace pbzero { 17 18 class TracePacket; 19 20 class Trace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { 21 public: Trace_Decoder(const uint8_t * data,size_t len)22 Trace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} Trace_Decoder(const std::string & raw)23 explicit Trace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} Trace_Decoder(const::protozero::ConstBytes & raw)24 explicit Trace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_packet()25 bool has_packet() const { return at<1>().valid(); } packet()26 ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> packet() const { return GetRepeated<::protozero::ConstBytes>(1); } 27 }; 28 29 class Trace : public ::protozero::Message { 30 public: 31 using Decoder = Trace_Decoder; 32 enum : int32_t { 33 kPacketFieldNumber = 1, 34 }; add_packet()35 template <typename T = TracePacket> T* add_packet() { 36 return BeginNestedMessage<T>(1); 37 } 38 39 }; 40 41 } // Namespace. 42 } // Namespace. 43 } // Namespace. 44 #endif // Include guard. 45