• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
2 
3 #ifndef PERFETTO_PROTOS_TRACK_DESCRIPTOR_PROTO_H_
4 #define PERFETTO_PROTOS_TRACK_DESCRIPTOR_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 ChromeProcessDescriptor;
19 class ChromeThreadDescriptor;
20 class CounterDescriptor;
21 class ProcessDescriptor;
22 class ThreadDescriptor;
23 
24 class TrackDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25  public:
TrackDescriptor_Decoder(const uint8_t * data,size_t len)26   TrackDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
TrackDescriptor_Decoder(const std::string & raw)27   explicit TrackDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
TrackDescriptor_Decoder(const::protozero::ConstBytes & raw)28   explicit TrackDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_uuid()29   bool has_uuid() const { return at<1>().valid(); }
uuid()30   uint64_t uuid() const { return at<1>().as_uint64(); }
has_parent_uuid()31   bool has_parent_uuid() const { return at<5>().valid(); }
parent_uuid()32   uint64_t parent_uuid() const { return at<5>().as_uint64(); }
has_name()33   bool has_name() const { return at<2>().valid(); }
name()34   ::protozero::ConstChars name() const { return at<2>().as_string(); }
has_process()35   bool has_process() const { return at<3>().valid(); }
process()36   ::protozero::ConstBytes process() const { return at<3>().as_bytes(); }
has_chrome_process()37   bool has_chrome_process() const { return at<6>().valid(); }
chrome_process()38   ::protozero::ConstBytes chrome_process() const { return at<6>().as_bytes(); }
has_thread()39   bool has_thread() const { return at<4>().valid(); }
thread()40   ::protozero::ConstBytes thread() const { return at<4>().as_bytes(); }
has_chrome_thread()41   bool has_chrome_thread() const { return at<7>().valid(); }
chrome_thread()42   ::protozero::ConstBytes chrome_thread() const { return at<7>().as_bytes(); }
has_counter()43   bool has_counter() const { return at<8>().valid(); }
counter()44   ::protozero::ConstBytes counter() const { return at<8>().as_bytes(); }
45 };
46 
47 class TrackDescriptor : public ::protozero::Message {
48  public:
49   using Decoder = TrackDescriptor_Decoder;
50   enum : int32_t {
51     kUuidFieldNumber = 1,
52     kParentUuidFieldNumber = 5,
53     kNameFieldNumber = 2,
54     kProcessFieldNumber = 3,
55     kChromeProcessFieldNumber = 6,
56     kThreadFieldNumber = 4,
57     kChromeThreadFieldNumber = 7,
58     kCounterFieldNumber = 8,
59   };
set_uuid(uint64_t value)60   void set_uuid(uint64_t value) {
61     AppendVarInt(1, value);
62   }
set_parent_uuid(uint64_t value)63   void set_parent_uuid(uint64_t value) {
64     AppendVarInt(5, value);
65   }
set_name(const std::string & value)66   void set_name(const std::string& value) {
67     AppendBytes(2, value.data(), value.size());
68   }
set_name(const char * data,size_t size)69   void set_name(const char* data, size_t size) {
70     AppendBytes(2, data, size);
71   }
set_process()72   template <typename T = ProcessDescriptor> T* set_process() {
73     return BeginNestedMessage<T>(3);
74   }
75 
set_chrome_process()76   template <typename T = ChromeProcessDescriptor> T* set_chrome_process() {
77     return BeginNestedMessage<T>(6);
78   }
79 
set_thread()80   template <typename T = ThreadDescriptor> T* set_thread() {
81     return BeginNestedMessage<T>(4);
82   }
83 
set_chrome_thread()84   template <typename T = ChromeThreadDescriptor> T* set_chrome_thread() {
85     return BeginNestedMessage<T>(7);
86   }
87 
set_counter()88   template <typename T = CounterDescriptor> T* set_counter() {
89     return BeginNestedMessage<T>(8);
90   }
91 
92 };
93 
94 } // Namespace.
95 } // Namespace.
96 } // Namespace.
97 #endif  // Include guard.
98