1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_PROTOS_THIRD_PARTY_STATSD_SHELL_CONFIG_PROTO_H_ 4 #define PERFETTO_PROTOS_PROTOS_THIRD_PARTY_STATSD_SHELL_CONFIG_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 StatsdPulledAtomSubscription; 19 class StatsdSimpleAtomMatcher; 20 } // Namespace pbzero. 21 } // Namespace protos. 22 } // Namespace perfetto. 23 24 namespace perfetto { 25 namespace protos { 26 namespace pbzero { 27 28 class StatsdSimpleAtomMatcher_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 29 public: StatsdSimpleAtomMatcher_Decoder(const uint8_t * data,size_t len)30 StatsdSimpleAtomMatcher_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} StatsdSimpleAtomMatcher_Decoder(const std::string & raw)31 explicit StatsdSimpleAtomMatcher_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} StatsdSimpleAtomMatcher_Decoder(const::protozero::ConstBytes & raw)32 explicit StatsdSimpleAtomMatcher_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_atom_id()33 bool has_atom_id() const { return at<1>().valid(); } atom_id()34 int32_t atom_id() const { return at<1>().as_int32(); } 35 }; 36 37 class StatsdSimpleAtomMatcher : public ::protozero::Message { 38 public: 39 using Decoder = StatsdSimpleAtomMatcher_Decoder; 40 enum : int32_t { 41 kAtomIdFieldNumber = 1, 42 }; GetName()43 static constexpr const char* GetName() { return ".perfetto.protos.StatsdSimpleAtomMatcher"; } 44 45 46 using FieldMetadata_AtomId = 47 ::protozero::proto_utils::FieldMetadata< 48 1, 49 ::protozero::proto_utils::RepetitionType::kNotRepeated, 50 ::protozero::proto_utils::ProtoSchemaType::kInt32, 51 int32_t, 52 StatsdSimpleAtomMatcher>; 53 54 static constexpr FieldMetadata_AtomId kAtomId{}; set_atom_id(int32_t value)55 void set_atom_id(int32_t value) { 56 static constexpr uint32_t field_id = FieldMetadata_AtomId::kFieldId; 57 // Call the appropriate protozero::Message::Append(field_id, ...) 58 // method based on the type of the field. 59 ::protozero::internal::FieldWriter< 60 ::protozero::proto_utils::ProtoSchemaType::kInt32> 61 ::Append(*this, field_id, value); 62 } 63 }; 64 65 class StatsdPulledAtomSubscription_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { 66 public: StatsdPulledAtomSubscription_Decoder(const uint8_t * data,size_t len)67 StatsdPulledAtomSubscription_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} StatsdPulledAtomSubscription_Decoder(const std::string & raw)68 explicit StatsdPulledAtomSubscription_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} StatsdPulledAtomSubscription_Decoder(const::protozero::ConstBytes & raw)69 explicit StatsdPulledAtomSubscription_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_matcher()70 bool has_matcher() const { return at<1>().valid(); } matcher()71 ::protozero::ConstBytes matcher() const { return at<1>().as_bytes(); } has_freq_millis()72 bool has_freq_millis() const { return at<2>().valid(); } freq_millis()73 int32_t freq_millis() const { return at<2>().as_int32(); } has_packages()74 bool has_packages() const { return at<3>().valid(); } packages()75 ::protozero::RepeatedFieldIterator<::protozero::ConstChars> packages() const { return GetRepeated<::protozero::ConstChars>(3); } 76 }; 77 78 class StatsdPulledAtomSubscription : public ::protozero::Message { 79 public: 80 using Decoder = StatsdPulledAtomSubscription_Decoder; 81 enum : int32_t { 82 kMatcherFieldNumber = 1, 83 kFreqMillisFieldNumber = 2, 84 kPackagesFieldNumber = 3, 85 }; GetName()86 static constexpr const char* GetName() { return ".perfetto.protos.StatsdPulledAtomSubscription"; } 87 88 89 using FieldMetadata_Matcher = 90 ::protozero::proto_utils::FieldMetadata< 91 1, 92 ::protozero::proto_utils::RepetitionType::kNotRepeated, 93 ::protozero::proto_utils::ProtoSchemaType::kMessage, 94 StatsdSimpleAtomMatcher, 95 StatsdPulledAtomSubscription>; 96 97 static constexpr FieldMetadata_Matcher kMatcher{}; set_matcher()98 template <typename T = StatsdSimpleAtomMatcher> T* set_matcher() { 99 return BeginNestedMessage<T>(1); 100 } 101 102 103 using FieldMetadata_FreqMillis = 104 ::protozero::proto_utils::FieldMetadata< 105 2, 106 ::protozero::proto_utils::RepetitionType::kNotRepeated, 107 ::protozero::proto_utils::ProtoSchemaType::kInt32, 108 int32_t, 109 StatsdPulledAtomSubscription>; 110 111 static constexpr FieldMetadata_FreqMillis kFreqMillis{}; set_freq_millis(int32_t value)112 void set_freq_millis(int32_t value) { 113 static constexpr uint32_t field_id = FieldMetadata_FreqMillis::kFieldId; 114 // Call the appropriate protozero::Message::Append(field_id, ...) 115 // method based on the type of the field. 116 ::protozero::internal::FieldWriter< 117 ::protozero::proto_utils::ProtoSchemaType::kInt32> 118 ::Append(*this, field_id, value); 119 } 120 121 using FieldMetadata_Packages = 122 ::protozero::proto_utils::FieldMetadata< 123 3, 124 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, 125 ::protozero::proto_utils::ProtoSchemaType::kString, 126 std::string, 127 StatsdPulledAtomSubscription>; 128 129 static constexpr FieldMetadata_Packages kPackages{}; add_packages(const char * data,size_t size)130 void add_packages(const char* data, size_t size) { 131 AppendBytes(FieldMetadata_Packages::kFieldId, data, size); 132 } add_packages(::protozero::ConstChars chars)133 void add_packages(::protozero::ConstChars chars) { 134 AppendBytes(FieldMetadata_Packages::kFieldId, chars.data, chars.size); 135 } add_packages(std::string value)136 void add_packages(std::string value) { 137 static constexpr uint32_t field_id = FieldMetadata_Packages::kFieldId; 138 // Call the appropriate protozero::Message::Append(field_id, ...) 139 // method based on the type of the field. 140 ::protozero::internal::FieldWriter< 141 ::protozero::proto_utils::ProtoSchemaType::kString> 142 ::Append(*this, field_id, value); 143 } 144 }; 145 146 class StatsdShellSubscription_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { 147 public: StatsdShellSubscription_Decoder(const uint8_t * data,size_t len)148 StatsdShellSubscription_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} StatsdShellSubscription_Decoder(const std::string & raw)149 explicit StatsdShellSubscription_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} StatsdShellSubscription_Decoder(const::protozero::ConstBytes & raw)150 explicit StatsdShellSubscription_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_pushed()151 bool has_pushed() const { return at<1>().valid(); } pushed()152 ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> pushed() const { return GetRepeated<::protozero::ConstBytes>(1); } has_pulled()153 bool has_pulled() const { return at<2>().valid(); } pulled()154 ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> pulled() const { return GetRepeated<::protozero::ConstBytes>(2); } 155 }; 156 157 class StatsdShellSubscription : public ::protozero::Message { 158 public: 159 using Decoder = StatsdShellSubscription_Decoder; 160 enum : int32_t { 161 kPushedFieldNumber = 1, 162 kPulledFieldNumber = 2, 163 }; GetName()164 static constexpr const char* GetName() { return ".perfetto.protos.StatsdShellSubscription"; } 165 166 167 using FieldMetadata_Pushed = 168 ::protozero::proto_utils::FieldMetadata< 169 1, 170 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, 171 ::protozero::proto_utils::ProtoSchemaType::kMessage, 172 StatsdSimpleAtomMatcher, 173 StatsdShellSubscription>; 174 175 static constexpr FieldMetadata_Pushed kPushed{}; add_pushed()176 template <typename T = StatsdSimpleAtomMatcher> T* add_pushed() { 177 return BeginNestedMessage<T>(1); 178 } 179 180 181 using FieldMetadata_Pulled = 182 ::protozero::proto_utils::FieldMetadata< 183 2, 184 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, 185 ::protozero::proto_utils::ProtoSchemaType::kMessage, 186 StatsdPulledAtomSubscription, 187 StatsdShellSubscription>; 188 189 static constexpr FieldMetadata_Pulled kPulled{}; add_pulled()190 template <typename T = StatsdPulledAtomSubscription> T* add_pulled() { 191 return BeginNestedMessage<T>(2); 192 } 193 194 }; 195 196 } // Namespace. 197 } // Namespace. 198 } // Namespace. 199 #endif // Include guard. 200