1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/android/pixel_modem_config.proto
3
4 #include "protos/perfetto/config/android/pixel_modem_config.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
PixelModemConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR PixelModemConfig::PixelModemConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.pigweed_hash_allow_list_)*/{}
28 , /*decltype(_impl_.pigweed_hash_deny_list_)*/{}
29 , /*decltype(_impl_.event_group_)*/0} {}
30 struct PixelModemConfigDefaultTypeInternal {
PixelModemConfigDefaultTypeInternalperfetto::protos::PixelModemConfigDefaultTypeInternal31 PROTOBUF_CONSTEXPR PixelModemConfigDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~PixelModemConfigDefaultTypeInternalperfetto::protos::PixelModemConfigDefaultTypeInternal33 ~PixelModemConfigDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 PixelModemConfig _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PixelModemConfigDefaultTypeInternal _PixelModemConfig_default_instance_;
39 } // namespace protos
40 } // namespace perfetto
41 namespace perfetto {
42 namespace protos {
PixelModemConfig_EventGroup_IsValid(int value)43 bool PixelModemConfig_EventGroup_IsValid(int value) {
44 switch (value) {
45 case 0:
46 case 1:
47 case 2:
48 return true;
49 default:
50 return false;
51 }
52 }
53
54 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> PixelModemConfig_EventGroup_strings[3] = {};
55
56 static const char PixelModemConfig_EventGroup_names[] =
57 "EVENT_GROUP_HIGH_AND_LOW_BANDWIDTH"
58 "EVENT_GROUP_LOW_BANDWIDTH"
59 "EVENT_GROUP_UNKNOWN";
60
61 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry PixelModemConfig_EventGroup_entries[] = {
62 { {PixelModemConfig_EventGroup_names + 0, 34}, 2 },
63 { {PixelModemConfig_EventGroup_names + 34, 25}, 1 },
64 { {PixelModemConfig_EventGroup_names + 59, 19}, 0 },
65 };
66
67 static const int PixelModemConfig_EventGroup_entries_by_number[] = {
68 2, // 0 -> EVENT_GROUP_UNKNOWN
69 1, // 1 -> EVENT_GROUP_LOW_BANDWIDTH
70 0, // 2 -> EVENT_GROUP_HIGH_AND_LOW_BANDWIDTH
71 };
72
PixelModemConfig_EventGroup_Name(PixelModemConfig_EventGroup value)73 const std::string& PixelModemConfig_EventGroup_Name(
74 PixelModemConfig_EventGroup value) {
75 static const bool dummy =
76 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
77 PixelModemConfig_EventGroup_entries,
78 PixelModemConfig_EventGroup_entries_by_number,
79 3, PixelModemConfig_EventGroup_strings);
80 (void) dummy;
81 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
82 PixelModemConfig_EventGroup_entries,
83 PixelModemConfig_EventGroup_entries_by_number,
84 3, value);
85 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
86 PixelModemConfig_EventGroup_strings[idx].get();
87 }
PixelModemConfig_EventGroup_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,PixelModemConfig_EventGroup * value)88 bool PixelModemConfig_EventGroup_Parse(
89 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PixelModemConfig_EventGroup* value) {
90 int int_value;
91 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
92 PixelModemConfig_EventGroup_entries, 3, name, &int_value);
93 if (success) {
94 *value = static_cast<PixelModemConfig_EventGroup>(int_value);
95 }
96 return success;
97 }
98 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
99 constexpr PixelModemConfig_EventGroup PixelModemConfig::EVENT_GROUP_UNKNOWN;
100 constexpr PixelModemConfig_EventGroup PixelModemConfig::EVENT_GROUP_LOW_BANDWIDTH;
101 constexpr PixelModemConfig_EventGroup PixelModemConfig::EVENT_GROUP_HIGH_AND_LOW_BANDWIDTH;
102 constexpr PixelModemConfig_EventGroup PixelModemConfig::EventGroup_MIN;
103 constexpr PixelModemConfig_EventGroup PixelModemConfig::EventGroup_MAX;
104 constexpr int PixelModemConfig::EventGroup_ARRAYSIZE;
105 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
106
107 // ===================================================================
108
109 class PixelModemConfig::_Internal {
110 public:
111 using HasBits = decltype(std::declval<PixelModemConfig>()._impl_._has_bits_);
set_has_event_group(HasBits * has_bits)112 static void set_has_event_group(HasBits* has_bits) {
113 (*has_bits)[0] |= 1u;
114 }
115 };
116
PixelModemConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)117 PixelModemConfig::PixelModemConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
118 bool is_message_owned)
119 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
120 SharedCtor(arena, is_message_owned);
121 // @@protoc_insertion_point(arena_constructor:perfetto.protos.PixelModemConfig)
122 }
PixelModemConfig(const PixelModemConfig & from)123 PixelModemConfig::PixelModemConfig(const PixelModemConfig& from)
124 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
125 PixelModemConfig* const _this = this; (void)_this;
126 new (&_impl_) Impl_{
127 decltype(_impl_._has_bits_){from._impl_._has_bits_}
128 , /*decltype(_impl_._cached_size_)*/{}
129 , decltype(_impl_.pigweed_hash_allow_list_){from._impl_.pigweed_hash_allow_list_}
130 , decltype(_impl_.pigweed_hash_deny_list_){from._impl_.pigweed_hash_deny_list_}
131 , decltype(_impl_.event_group_){}};
132
133 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
134 _this->_impl_.event_group_ = from._impl_.event_group_;
135 // @@protoc_insertion_point(copy_constructor:perfetto.protos.PixelModemConfig)
136 }
137
SharedCtor(::_pb::Arena * arena,bool is_message_owned)138 inline void PixelModemConfig::SharedCtor(
139 ::_pb::Arena* arena, bool is_message_owned) {
140 (void)arena;
141 (void)is_message_owned;
142 new (&_impl_) Impl_{
143 decltype(_impl_._has_bits_){}
144 , /*decltype(_impl_._cached_size_)*/{}
145 , decltype(_impl_.pigweed_hash_allow_list_){arena}
146 , decltype(_impl_.pigweed_hash_deny_list_){arena}
147 , decltype(_impl_.event_group_){0}
148 };
149 }
150
~PixelModemConfig()151 PixelModemConfig::~PixelModemConfig() {
152 // @@protoc_insertion_point(destructor:perfetto.protos.PixelModemConfig)
153 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
154 (void)arena;
155 return;
156 }
157 SharedDtor();
158 }
159
SharedDtor()160 inline void PixelModemConfig::SharedDtor() {
161 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
162 _impl_.pigweed_hash_allow_list_.~RepeatedField();
163 _impl_.pigweed_hash_deny_list_.~RepeatedField();
164 }
165
SetCachedSize(int size) const166 void PixelModemConfig::SetCachedSize(int size) const {
167 _impl_._cached_size_.Set(size);
168 }
169
Clear()170 void PixelModemConfig::Clear() {
171 // @@protoc_insertion_point(message_clear_start:perfetto.protos.PixelModemConfig)
172 ::uint32_t cached_has_bits = 0;
173 // Prevent compiler warnings about cached_has_bits being unused
174 (void) cached_has_bits;
175
176 _impl_.pigweed_hash_allow_list_.Clear();
177 _impl_.pigweed_hash_deny_list_.Clear();
178 _impl_.event_group_ = 0;
179 _impl_._has_bits_.Clear();
180 _internal_metadata_.Clear<std::string>();
181 }
182
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)183 const char* PixelModemConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
184 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
185 _Internal::HasBits has_bits{};
186 while (!ctx->Done(&ptr)) {
187 ::uint32_t tag;
188 ptr = ::_pbi::ReadTag(ptr, &tag);
189 switch (tag >> 3) {
190 // optional .perfetto.protos.PixelModemConfig.EventGroup event_group = 1;
191 case 1:
192 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
193 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
194 CHK_(ptr);
195 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::PixelModemConfig_EventGroup_IsValid(val))) {
196 _internal_set_event_group(static_cast<::perfetto::protos::PixelModemConfig_EventGroup>(val));
197 } else {
198 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
199 }
200 } else {
201 goto handle_unusual;
202 }
203 continue;
204 // repeated int64 pigweed_hash_allow_list = 2;
205 case 2:
206 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
207 ptr -= 1;
208 do {
209 ptr += 1;
210 _internal_add_pigweed_hash_allow_list(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
211 CHK_(ptr);
212 if (!ctx->DataAvailable(ptr)) break;
213 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
214 } else if (static_cast<::uint8_t>(tag) == 18) {
215 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_pigweed_hash_allow_list(), ptr, ctx);
216 CHK_(ptr);
217 } else {
218 goto handle_unusual;
219 }
220 continue;
221 // repeated int64 pigweed_hash_deny_list = 3;
222 case 3:
223 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
224 ptr -= 1;
225 do {
226 ptr += 1;
227 _internal_add_pigweed_hash_deny_list(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
228 CHK_(ptr);
229 if (!ctx->DataAvailable(ptr)) break;
230 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
231 } else if (static_cast<::uint8_t>(tag) == 26) {
232 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_pigweed_hash_deny_list(), ptr, ctx);
233 CHK_(ptr);
234 } else {
235 goto handle_unusual;
236 }
237 continue;
238 default:
239 goto handle_unusual;
240 } // switch
241 handle_unusual:
242 if ((tag == 0) || ((tag & 7) == 4)) {
243 CHK_(ptr);
244 ctx->SetLastTag(tag);
245 goto message_done;
246 }
247 ptr = UnknownFieldParse(
248 tag,
249 _internal_metadata_.mutable_unknown_fields<std::string>(),
250 ptr, ctx);
251 CHK_(ptr != nullptr);
252 } // while
253 message_done:
254 _impl_._has_bits_.Or(has_bits);
255 return ptr;
256 failure:
257 ptr = nullptr;
258 goto message_done;
259 #undef CHK_
260 }
261
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const262 ::uint8_t* PixelModemConfig::_InternalSerialize(
263 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
264 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.PixelModemConfig)
265 ::uint32_t cached_has_bits = 0;
266 (void) cached_has_bits;
267
268 cached_has_bits = _impl_._has_bits_[0];
269 // optional .perfetto.protos.PixelModemConfig.EventGroup event_group = 1;
270 if (cached_has_bits & 0x00000001u) {
271 target = stream->EnsureSpace(target);
272 target = ::_pbi::WireFormatLite::WriteEnumToArray(
273 1, this->_internal_event_group(), target);
274 }
275
276 // repeated int64 pigweed_hash_allow_list = 2;
277 for (int i = 0, n = this->_internal_pigweed_hash_allow_list_size(); i < n; i++) {
278 target = stream->EnsureSpace(target);
279 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_pigweed_hash_allow_list(i), target);
280 }
281
282 // repeated int64 pigweed_hash_deny_list = 3;
283 for (int i = 0, n = this->_internal_pigweed_hash_deny_list_size(); i < n; i++) {
284 target = stream->EnsureSpace(target);
285 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_pigweed_hash_deny_list(i), target);
286 }
287
288 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
289 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
290 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
291 }
292 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.PixelModemConfig)
293 return target;
294 }
295
ByteSizeLong() const296 size_t PixelModemConfig::ByteSizeLong() const {
297 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.PixelModemConfig)
298 size_t total_size = 0;
299
300 ::uint32_t cached_has_bits = 0;
301 // Prevent compiler warnings about cached_has_bits being unused
302 (void) cached_has_bits;
303
304 // repeated int64 pigweed_hash_allow_list = 2;
305 {
306 size_t data_size = ::_pbi::WireFormatLite::
307 Int64Size(this->_impl_.pigweed_hash_allow_list_);
308 total_size += 1 *
309 ::_pbi::FromIntSize(this->_internal_pigweed_hash_allow_list_size());
310 total_size += data_size;
311 }
312
313 // repeated int64 pigweed_hash_deny_list = 3;
314 {
315 size_t data_size = ::_pbi::WireFormatLite::
316 Int64Size(this->_impl_.pigweed_hash_deny_list_);
317 total_size += 1 *
318 ::_pbi::FromIntSize(this->_internal_pigweed_hash_deny_list_size());
319 total_size += data_size;
320 }
321
322 // optional .perfetto.protos.PixelModemConfig.EventGroup event_group = 1;
323 cached_has_bits = _impl_._has_bits_[0];
324 if (cached_has_bits & 0x00000001u) {
325 total_size += 1 +
326 ::_pbi::WireFormatLite::EnumSize(this->_internal_event_group());
327 }
328
329 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
330 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
331 }
332 int cached_size = ::_pbi::ToCachedSize(total_size);
333 SetCachedSize(cached_size);
334 return total_size;
335 }
336
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)337 void PixelModemConfig::CheckTypeAndMergeFrom(
338 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
339 MergeFrom(*::_pbi::DownCast<const PixelModemConfig*>(
340 &from));
341 }
342
MergeFrom(const PixelModemConfig & from)343 void PixelModemConfig::MergeFrom(const PixelModemConfig& from) {
344 PixelModemConfig* const _this = this;
345 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.PixelModemConfig)
346 GOOGLE_DCHECK_NE(&from, _this);
347 ::uint32_t cached_has_bits = 0;
348 (void) cached_has_bits;
349
350 _this->_impl_.pigweed_hash_allow_list_.MergeFrom(from._impl_.pigweed_hash_allow_list_);
351 _this->_impl_.pigweed_hash_deny_list_.MergeFrom(from._impl_.pigweed_hash_deny_list_);
352 if (from._internal_has_event_group()) {
353 _this->_internal_set_event_group(from._internal_event_group());
354 }
355 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
356 }
357
CopyFrom(const PixelModemConfig & from)358 void PixelModemConfig::CopyFrom(const PixelModemConfig& from) {
359 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.PixelModemConfig)
360 if (&from == this) return;
361 Clear();
362 MergeFrom(from);
363 }
364
IsInitialized() const365 bool PixelModemConfig::IsInitialized() const {
366 return true;
367 }
368
InternalSwap(PixelModemConfig * other)369 void PixelModemConfig::InternalSwap(PixelModemConfig* other) {
370 using std::swap;
371 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
372 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
373 _impl_.pigweed_hash_allow_list_.InternalSwap(&other->_impl_.pigweed_hash_allow_list_);
374 _impl_.pigweed_hash_deny_list_.InternalSwap(&other->_impl_.pigweed_hash_deny_list_);
375 swap(_impl_.event_group_, other->_impl_.event_group_);
376 }
377
GetTypeName() const378 std::string PixelModemConfig::GetTypeName() const {
379 return "perfetto.protos.PixelModemConfig";
380 }
381
382
383 // @@protoc_insertion_point(namespace_scope)
384 } // namespace protos
385 } // namespace perfetto
386 PROTOBUF_NAMESPACE_OPEN
387 template<> PROTOBUF_NOINLINE ::perfetto::protos::PixelModemConfig*
CreateMaybeMessage(Arena * arena)388 Arena::CreateMaybeMessage< ::perfetto::protos::PixelModemConfig >(Arena* arena) {
389 return Arena::CreateMessageInternal< ::perfetto::protos::PixelModemConfig >(arena);
390 }
391 PROTOBUF_NAMESPACE_CLOSE
392
393 // @@protoc_insertion_point(global_scope)
394 #include <google/protobuf/port_undef.inc>
395