1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/android/packages_list.proto
3
4 #include "protos/perfetto/trace/android/packages_list.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 {
PackagesList_PackageInfo(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR PackagesList_PackageInfo::PackagesList_PackageInfo(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.uid_)*/::uint64_t{0u}
29 , /*decltype(_impl_.version_code_)*/::int64_t{0}
30 , /*decltype(_impl_.debuggable_)*/false
31 , /*decltype(_impl_.profileable_from_shell_)*/false} {}
32 struct PackagesList_PackageInfoDefaultTypeInternal {
PackagesList_PackageInfoDefaultTypeInternalperfetto::protos::PackagesList_PackageInfoDefaultTypeInternal33 PROTOBUF_CONSTEXPR PackagesList_PackageInfoDefaultTypeInternal()
34 : _instance(::_pbi::ConstantInitialized{}) {}
~PackagesList_PackageInfoDefaultTypeInternalperfetto::protos::PackagesList_PackageInfoDefaultTypeInternal35 ~PackagesList_PackageInfoDefaultTypeInternal() {}
36 union { // NOLINT(misc-non-private-member-variables-in-classes)
37 PackagesList_PackageInfo _instance;
38 };
39 };
40 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PackagesList_PackageInfoDefaultTypeInternal _PackagesList_PackageInfo_default_instance_;
PackagesList(::_pbi::ConstantInitialized)41 PROTOBUF_CONSTEXPR PackagesList::PackagesList(
42 ::_pbi::ConstantInitialized): _impl_{
43 /*decltype(_impl_._has_bits_)*/{}
44 , /*decltype(_impl_._cached_size_)*/{}
45 , /*decltype(_impl_.packages_)*/{}
46 , /*decltype(_impl_.parse_error_)*/false
47 , /*decltype(_impl_.read_error_)*/false} {}
48 struct PackagesListDefaultTypeInternal {
PackagesListDefaultTypeInternalperfetto::protos::PackagesListDefaultTypeInternal49 PROTOBUF_CONSTEXPR PackagesListDefaultTypeInternal()
50 : _instance(::_pbi::ConstantInitialized{}) {}
~PackagesListDefaultTypeInternalperfetto::protos::PackagesListDefaultTypeInternal51 ~PackagesListDefaultTypeInternal() {}
52 union { // NOLINT(misc-non-private-member-variables-in-classes)
53 PackagesList _instance;
54 };
55 };
56 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PackagesListDefaultTypeInternal _PackagesList_default_instance_;
57 } // namespace protos
58 } // namespace perfetto
59 namespace perfetto {
60 namespace protos {
61
62 // ===================================================================
63
64 class PackagesList_PackageInfo::_Internal {
65 public:
66 using HasBits = decltype(std::declval<PackagesList_PackageInfo>()._impl_._has_bits_);
set_has_name(HasBits * has_bits)67 static void set_has_name(HasBits* has_bits) {
68 (*has_bits)[0] |= 1u;
69 }
set_has_uid(HasBits * has_bits)70 static void set_has_uid(HasBits* has_bits) {
71 (*has_bits)[0] |= 2u;
72 }
set_has_debuggable(HasBits * has_bits)73 static void set_has_debuggable(HasBits* has_bits) {
74 (*has_bits)[0] |= 8u;
75 }
set_has_profileable_from_shell(HasBits * has_bits)76 static void set_has_profileable_from_shell(HasBits* has_bits) {
77 (*has_bits)[0] |= 16u;
78 }
set_has_version_code(HasBits * has_bits)79 static void set_has_version_code(HasBits* has_bits) {
80 (*has_bits)[0] |= 4u;
81 }
82 };
83
PackagesList_PackageInfo(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)84 PackagesList_PackageInfo::PackagesList_PackageInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
85 bool is_message_owned)
86 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
87 SharedCtor(arena, is_message_owned);
88 // @@protoc_insertion_point(arena_constructor:perfetto.protos.PackagesList.PackageInfo)
89 }
PackagesList_PackageInfo(const PackagesList_PackageInfo & from)90 PackagesList_PackageInfo::PackagesList_PackageInfo(const PackagesList_PackageInfo& from)
91 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
92 PackagesList_PackageInfo* const _this = this; (void)_this;
93 new (&_impl_) Impl_{
94 decltype(_impl_._has_bits_){from._impl_._has_bits_}
95 , /*decltype(_impl_._cached_size_)*/{}
96 , decltype(_impl_.name_){}
97 , decltype(_impl_.uid_){}
98 , decltype(_impl_.version_code_){}
99 , decltype(_impl_.debuggable_){}
100 , decltype(_impl_.profileable_from_shell_){}};
101
102 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
103 _impl_.name_.InitDefault();
104 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
105 _impl_.name_.Set("", GetArenaForAllocation());
106 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
107 if (from._internal_has_name()) {
108 _this->_impl_.name_.Set(from._internal_name(),
109 _this->GetArenaForAllocation());
110 }
111 ::memcpy(&_impl_.uid_, &from._impl_.uid_,
112 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.profileable_from_shell_) -
113 reinterpret_cast<char*>(&_impl_.uid_)) + sizeof(_impl_.profileable_from_shell_));
114 // @@protoc_insertion_point(copy_constructor:perfetto.protos.PackagesList.PackageInfo)
115 }
116
SharedCtor(::_pb::Arena * arena,bool is_message_owned)117 inline void PackagesList_PackageInfo::SharedCtor(
118 ::_pb::Arena* arena, bool is_message_owned) {
119 (void)arena;
120 (void)is_message_owned;
121 new (&_impl_) Impl_{
122 decltype(_impl_._has_bits_){}
123 , /*decltype(_impl_._cached_size_)*/{}
124 , decltype(_impl_.name_){}
125 , decltype(_impl_.uid_){::uint64_t{0u}}
126 , decltype(_impl_.version_code_){::int64_t{0}}
127 , decltype(_impl_.debuggable_){false}
128 , decltype(_impl_.profileable_from_shell_){false}
129 };
130 _impl_.name_.InitDefault();
131 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
132 _impl_.name_.Set("", GetArenaForAllocation());
133 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
134 }
135
~PackagesList_PackageInfo()136 PackagesList_PackageInfo::~PackagesList_PackageInfo() {
137 // @@protoc_insertion_point(destructor:perfetto.protos.PackagesList.PackageInfo)
138 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
139 (void)arena;
140 return;
141 }
142 SharedDtor();
143 }
144
SharedDtor()145 inline void PackagesList_PackageInfo::SharedDtor() {
146 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
147 _impl_.name_.Destroy();
148 }
149
SetCachedSize(int size) const150 void PackagesList_PackageInfo::SetCachedSize(int size) const {
151 _impl_._cached_size_.Set(size);
152 }
153
Clear()154 void PackagesList_PackageInfo::Clear() {
155 // @@protoc_insertion_point(message_clear_start:perfetto.protos.PackagesList.PackageInfo)
156 ::uint32_t cached_has_bits = 0;
157 // Prevent compiler warnings about cached_has_bits being unused
158 (void) cached_has_bits;
159
160 cached_has_bits = _impl_._has_bits_[0];
161 if (cached_has_bits & 0x00000001u) {
162 _impl_.name_.ClearNonDefaultToEmpty();
163 }
164 if (cached_has_bits & 0x0000001eu) {
165 ::memset(&_impl_.uid_, 0, static_cast<size_t>(
166 reinterpret_cast<char*>(&_impl_.profileable_from_shell_) -
167 reinterpret_cast<char*>(&_impl_.uid_)) + sizeof(_impl_.profileable_from_shell_));
168 }
169 _impl_._has_bits_.Clear();
170 _internal_metadata_.Clear<std::string>();
171 }
172
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)173 const char* PackagesList_PackageInfo::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
174 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
175 _Internal::HasBits has_bits{};
176 while (!ctx->Done(&ptr)) {
177 ::uint32_t tag;
178 ptr = ::_pbi::ReadTag(ptr, &tag);
179 switch (tag >> 3) {
180 // optional string name = 1;
181 case 1:
182 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
183 auto str = _internal_mutable_name();
184 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
185 CHK_(ptr);
186 } else {
187 goto handle_unusual;
188 }
189 continue;
190 // optional uint64 uid = 2;
191 case 2:
192 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
193 _Internal::set_has_uid(&has_bits);
194 _impl_.uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
195 CHK_(ptr);
196 } else {
197 goto handle_unusual;
198 }
199 continue;
200 // optional bool debuggable = 3;
201 case 3:
202 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
203 _Internal::set_has_debuggable(&has_bits);
204 _impl_.debuggable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
205 CHK_(ptr);
206 } else {
207 goto handle_unusual;
208 }
209 continue;
210 // optional bool profileable_from_shell = 4;
211 case 4:
212 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
213 _Internal::set_has_profileable_from_shell(&has_bits);
214 _impl_.profileable_from_shell_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
215 CHK_(ptr);
216 } else {
217 goto handle_unusual;
218 }
219 continue;
220 // optional int64 version_code = 5;
221 case 5:
222 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
223 _Internal::set_has_version_code(&has_bits);
224 _impl_.version_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
225 CHK_(ptr);
226 } else {
227 goto handle_unusual;
228 }
229 continue;
230 default:
231 goto handle_unusual;
232 } // switch
233 handle_unusual:
234 if ((tag == 0) || ((tag & 7) == 4)) {
235 CHK_(ptr);
236 ctx->SetLastTag(tag);
237 goto message_done;
238 }
239 ptr = UnknownFieldParse(
240 tag,
241 _internal_metadata_.mutable_unknown_fields<std::string>(),
242 ptr, ctx);
243 CHK_(ptr != nullptr);
244 } // while
245 message_done:
246 _impl_._has_bits_.Or(has_bits);
247 return ptr;
248 failure:
249 ptr = nullptr;
250 goto message_done;
251 #undef CHK_
252 }
253
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const254 ::uint8_t* PackagesList_PackageInfo::_InternalSerialize(
255 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
256 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.PackagesList.PackageInfo)
257 ::uint32_t cached_has_bits = 0;
258 (void) cached_has_bits;
259
260 cached_has_bits = _impl_._has_bits_[0];
261 // optional string name = 1;
262 if (cached_has_bits & 0x00000001u) {
263 target = stream->WriteStringMaybeAliased(
264 1, this->_internal_name(), target);
265 }
266
267 // optional uint64 uid = 2;
268 if (cached_has_bits & 0x00000002u) {
269 target = stream->EnsureSpace(target);
270 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_uid(), target);
271 }
272
273 // optional bool debuggable = 3;
274 if (cached_has_bits & 0x00000008u) {
275 target = stream->EnsureSpace(target);
276 target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_debuggable(), target);
277 }
278
279 // optional bool profileable_from_shell = 4;
280 if (cached_has_bits & 0x00000010u) {
281 target = stream->EnsureSpace(target);
282 target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_profileable_from_shell(), target);
283 }
284
285 // optional int64 version_code = 5;
286 if (cached_has_bits & 0x00000004u) {
287 target = stream->EnsureSpace(target);
288 target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_version_code(), target);
289 }
290
291 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
292 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
293 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
294 }
295 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.PackagesList.PackageInfo)
296 return target;
297 }
298
ByteSizeLong() const299 size_t PackagesList_PackageInfo::ByteSizeLong() const {
300 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.PackagesList.PackageInfo)
301 size_t total_size = 0;
302
303 ::uint32_t cached_has_bits = 0;
304 // Prevent compiler warnings about cached_has_bits being unused
305 (void) cached_has_bits;
306
307 cached_has_bits = _impl_._has_bits_[0];
308 if (cached_has_bits & 0x0000001fu) {
309 // optional string name = 1;
310 if (cached_has_bits & 0x00000001u) {
311 total_size += 1 +
312 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
313 this->_internal_name());
314 }
315
316 // optional uint64 uid = 2;
317 if (cached_has_bits & 0x00000002u) {
318 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_uid());
319 }
320
321 // optional int64 version_code = 5;
322 if (cached_has_bits & 0x00000004u) {
323 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_version_code());
324 }
325
326 // optional bool debuggable = 3;
327 if (cached_has_bits & 0x00000008u) {
328 total_size += 1 + 1;
329 }
330
331 // optional bool profileable_from_shell = 4;
332 if (cached_has_bits & 0x00000010u) {
333 total_size += 1 + 1;
334 }
335
336 }
337 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
338 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
339 }
340 int cached_size = ::_pbi::ToCachedSize(total_size);
341 SetCachedSize(cached_size);
342 return total_size;
343 }
344
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)345 void PackagesList_PackageInfo::CheckTypeAndMergeFrom(
346 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
347 MergeFrom(*::_pbi::DownCast<const PackagesList_PackageInfo*>(
348 &from));
349 }
350
MergeFrom(const PackagesList_PackageInfo & from)351 void PackagesList_PackageInfo::MergeFrom(const PackagesList_PackageInfo& from) {
352 PackagesList_PackageInfo* const _this = this;
353 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.PackagesList.PackageInfo)
354 GOOGLE_DCHECK_NE(&from, _this);
355 ::uint32_t cached_has_bits = 0;
356 (void) cached_has_bits;
357
358 cached_has_bits = from._impl_._has_bits_[0];
359 if (cached_has_bits & 0x0000001fu) {
360 if (cached_has_bits & 0x00000001u) {
361 _this->_internal_set_name(from._internal_name());
362 }
363 if (cached_has_bits & 0x00000002u) {
364 _this->_impl_.uid_ = from._impl_.uid_;
365 }
366 if (cached_has_bits & 0x00000004u) {
367 _this->_impl_.version_code_ = from._impl_.version_code_;
368 }
369 if (cached_has_bits & 0x00000008u) {
370 _this->_impl_.debuggable_ = from._impl_.debuggable_;
371 }
372 if (cached_has_bits & 0x00000010u) {
373 _this->_impl_.profileable_from_shell_ = from._impl_.profileable_from_shell_;
374 }
375 _this->_impl_._has_bits_[0] |= cached_has_bits;
376 }
377 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
378 }
379
CopyFrom(const PackagesList_PackageInfo & from)380 void PackagesList_PackageInfo::CopyFrom(const PackagesList_PackageInfo& from) {
381 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.PackagesList.PackageInfo)
382 if (&from == this) return;
383 Clear();
384 MergeFrom(from);
385 }
386
IsInitialized() const387 bool PackagesList_PackageInfo::IsInitialized() const {
388 return true;
389 }
390
InternalSwap(PackagesList_PackageInfo * other)391 void PackagesList_PackageInfo::InternalSwap(PackagesList_PackageInfo* other) {
392 using std::swap;
393 auto* lhs_arena = GetArenaForAllocation();
394 auto* rhs_arena = other->GetArenaForAllocation();
395 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
396 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
397 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
398 &_impl_.name_, lhs_arena,
399 &other->_impl_.name_, rhs_arena
400 );
401 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
402 PROTOBUF_FIELD_OFFSET(PackagesList_PackageInfo, _impl_.profileable_from_shell_)
403 + sizeof(PackagesList_PackageInfo::_impl_.profileable_from_shell_) // NOLINT
404 - PROTOBUF_FIELD_OFFSET(PackagesList_PackageInfo, _impl_.uid_)>(
405 reinterpret_cast<char*>(&_impl_.uid_),
406 reinterpret_cast<char*>(&other->_impl_.uid_));
407 }
408
GetTypeName() const409 std::string PackagesList_PackageInfo::GetTypeName() const {
410 return "perfetto.protos.PackagesList.PackageInfo";
411 }
412
413
414 // ===================================================================
415
416 class PackagesList::_Internal {
417 public:
418 using HasBits = decltype(std::declval<PackagesList>()._impl_._has_bits_);
set_has_parse_error(HasBits * has_bits)419 static void set_has_parse_error(HasBits* has_bits) {
420 (*has_bits)[0] |= 1u;
421 }
set_has_read_error(HasBits * has_bits)422 static void set_has_read_error(HasBits* has_bits) {
423 (*has_bits)[0] |= 2u;
424 }
425 };
426
PackagesList(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)427 PackagesList::PackagesList(::PROTOBUF_NAMESPACE_ID::Arena* arena,
428 bool is_message_owned)
429 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
430 SharedCtor(arena, is_message_owned);
431 // @@protoc_insertion_point(arena_constructor:perfetto.protos.PackagesList)
432 }
PackagesList(const PackagesList & from)433 PackagesList::PackagesList(const PackagesList& from)
434 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
435 PackagesList* const _this = this; (void)_this;
436 new (&_impl_) Impl_{
437 decltype(_impl_._has_bits_){from._impl_._has_bits_}
438 , /*decltype(_impl_._cached_size_)*/{}
439 , decltype(_impl_.packages_){from._impl_.packages_}
440 , decltype(_impl_.parse_error_){}
441 , decltype(_impl_.read_error_){}};
442
443 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
444 ::memcpy(&_impl_.parse_error_, &from._impl_.parse_error_,
445 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.read_error_) -
446 reinterpret_cast<char*>(&_impl_.parse_error_)) + sizeof(_impl_.read_error_));
447 // @@protoc_insertion_point(copy_constructor:perfetto.protos.PackagesList)
448 }
449
SharedCtor(::_pb::Arena * arena,bool is_message_owned)450 inline void PackagesList::SharedCtor(
451 ::_pb::Arena* arena, bool is_message_owned) {
452 (void)arena;
453 (void)is_message_owned;
454 new (&_impl_) Impl_{
455 decltype(_impl_._has_bits_){}
456 , /*decltype(_impl_._cached_size_)*/{}
457 , decltype(_impl_.packages_){arena}
458 , decltype(_impl_.parse_error_){false}
459 , decltype(_impl_.read_error_){false}
460 };
461 }
462
~PackagesList()463 PackagesList::~PackagesList() {
464 // @@protoc_insertion_point(destructor:perfetto.protos.PackagesList)
465 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
466 (void)arena;
467 return;
468 }
469 SharedDtor();
470 }
471
SharedDtor()472 inline void PackagesList::SharedDtor() {
473 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
474 _impl_.packages_.~RepeatedPtrField();
475 }
476
SetCachedSize(int size) const477 void PackagesList::SetCachedSize(int size) const {
478 _impl_._cached_size_.Set(size);
479 }
480
Clear()481 void PackagesList::Clear() {
482 // @@protoc_insertion_point(message_clear_start:perfetto.protos.PackagesList)
483 ::uint32_t cached_has_bits = 0;
484 // Prevent compiler warnings about cached_has_bits being unused
485 (void) cached_has_bits;
486
487 _impl_.packages_.Clear();
488 ::memset(&_impl_.parse_error_, 0, static_cast<size_t>(
489 reinterpret_cast<char*>(&_impl_.read_error_) -
490 reinterpret_cast<char*>(&_impl_.parse_error_)) + sizeof(_impl_.read_error_));
491 _impl_._has_bits_.Clear();
492 _internal_metadata_.Clear<std::string>();
493 }
494
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)495 const char* PackagesList::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
496 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
497 _Internal::HasBits has_bits{};
498 while (!ctx->Done(&ptr)) {
499 ::uint32_t tag;
500 ptr = ::_pbi::ReadTag(ptr, &tag);
501 switch (tag >> 3) {
502 // repeated .perfetto.protos.PackagesList.PackageInfo packages = 1;
503 case 1:
504 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
505 ptr -= 1;
506 do {
507 ptr += 1;
508 ptr = ctx->ParseMessage(_internal_add_packages(), ptr);
509 CHK_(ptr);
510 if (!ctx->DataAvailable(ptr)) break;
511 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
512 } else {
513 goto handle_unusual;
514 }
515 continue;
516 // optional bool parse_error = 2;
517 case 2:
518 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
519 _Internal::set_has_parse_error(&has_bits);
520 _impl_.parse_error_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
521 CHK_(ptr);
522 } else {
523 goto handle_unusual;
524 }
525 continue;
526 // optional bool read_error = 3;
527 case 3:
528 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
529 _Internal::set_has_read_error(&has_bits);
530 _impl_.read_error_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
531 CHK_(ptr);
532 } else {
533 goto handle_unusual;
534 }
535 continue;
536 default:
537 goto handle_unusual;
538 } // switch
539 handle_unusual:
540 if ((tag == 0) || ((tag & 7) == 4)) {
541 CHK_(ptr);
542 ctx->SetLastTag(tag);
543 goto message_done;
544 }
545 ptr = UnknownFieldParse(
546 tag,
547 _internal_metadata_.mutable_unknown_fields<std::string>(),
548 ptr, ctx);
549 CHK_(ptr != nullptr);
550 } // while
551 message_done:
552 _impl_._has_bits_.Or(has_bits);
553 return ptr;
554 failure:
555 ptr = nullptr;
556 goto message_done;
557 #undef CHK_
558 }
559
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const560 ::uint8_t* PackagesList::_InternalSerialize(
561 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
562 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.PackagesList)
563 ::uint32_t cached_has_bits = 0;
564 (void) cached_has_bits;
565
566 // repeated .perfetto.protos.PackagesList.PackageInfo packages = 1;
567 for (unsigned i = 0,
568 n = static_cast<unsigned>(this->_internal_packages_size()); i < n; i++) {
569 const auto& repfield = this->_internal_packages(i);
570 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
571 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
572 }
573
574 cached_has_bits = _impl_._has_bits_[0];
575 // optional bool parse_error = 2;
576 if (cached_has_bits & 0x00000001u) {
577 target = stream->EnsureSpace(target);
578 target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_parse_error(), target);
579 }
580
581 // optional bool read_error = 3;
582 if (cached_has_bits & 0x00000002u) {
583 target = stream->EnsureSpace(target);
584 target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_read_error(), target);
585 }
586
587 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
588 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
589 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
590 }
591 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.PackagesList)
592 return target;
593 }
594
ByteSizeLong() const595 size_t PackagesList::ByteSizeLong() const {
596 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.PackagesList)
597 size_t total_size = 0;
598
599 ::uint32_t cached_has_bits = 0;
600 // Prevent compiler warnings about cached_has_bits being unused
601 (void) cached_has_bits;
602
603 // repeated .perfetto.protos.PackagesList.PackageInfo packages = 1;
604 total_size += 1UL * this->_internal_packages_size();
605 for (const auto& msg : this->_impl_.packages_) {
606 total_size +=
607 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
608 }
609
610 cached_has_bits = _impl_._has_bits_[0];
611 if (cached_has_bits & 0x00000003u) {
612 // optional bool parse_error = 2;
613 if (cached_has_bits & 0x00000001u) {
614 total_size += 1 + 1;
615 }
616
617 // optional bool read_error = 3;
618 if (cached_has_bits & 0x00000002u) {
619 total_size += 1 + 1;
620 }
621
622 }
623 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
624 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
625 }
626 int cached_size = ::_pbi::ToCachedSize(total_size);
627 SetCachedSize(cached_size);
628 return total_size;
629 }
630
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)631 void PackagesList::CheckTypeAndMergeFrom(
632 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
633 MergeFrom(*::_pbi::DownCast<const PackagesList*>(
634 &from));
635 }
636
MergeFrom(const PackagesList & from)637 void PackagesList::MergeFrom(const PackagesList& from) {
638 PackagesList* const _this = this;
639 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.PackagesList)
640 GOOGLE_DCHECK_NE(&from, _this);
641 ::uint32_t cached_has_bits = 0;
642 (void) cached_has_bits;
643
644 _this->_impl_.packages_.MergeFrom(from._impl_.packages_);
645 cached_has_bits = from._impl_._has_bits_[0];
646 if (cached_has_bits & 0x00000003u) {
647 if (cached_has_bits & 0x00000001u) {
648 _this->_impl_.parse_error_ = from._impl_.parse_error_;
649 }
650 if (cached_has_bits & 0x00000002u) {
651 _this->_impl_.read_error_ = from._impl_.read_error_;
652 }
653 _this->_impl_._has_bits_[0] |= cached_has_bits;
654 }
655 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
656 }
657
CopyFrom(const PackagesList & from)658 void PackagesList::CopyFrom(const PackagesList& from) {
659 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.PackagesList)
660 if (&from == this) return;
661 Clear();
662 MergeFrom(from);
663 }
664
IsInitialized() const665 bool PackagesList::IsInitialized() const {
666 return true;
667 }
668
InternalSwap(PackagesList * other)669 void PackagesList::InternalSwap(PackagesList* other) {
670 using std::swap;
671 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
672 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
673 _impl_.packages_.InternalSwap(&other->_impl_.packages_);
674 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
675 PROTOBUF_FIELD_OFFSET(PackagesList, _impl_.read_error_)
676 + sizeof(PackagesList::_impl_.read_error_) // NOLINT
677 - PROTOBUF_FIELD_OFFSET(PackagesList, _impl_.parse_error_)>(
678 reinterpret_cast<char*>(&_impl_.parse_error_),
679 reinterpret_cast<char*>(&other->_impl_.parse_error_));
680 }
681
GetTypeName() const682 std::string PackagesList::GetTypeName() const {
683 return "perfetto.protos.PackagesList";
684 }
685
686
687 // @@protoc_insertion_point(namespace_scope)
688 } // namespace protos
689 } // namespace perfetto
690 PROTOBUF_NAMESPACE_OPEN
691 template<> PROTOBUF_NOINLINE ::perfetto::protos::PackagesList_PackageInfo*
CreateMaybeMessage(Arena * arena)692 Arena::CreateMaybeMessage< ::perfetto::protos::PackagesList_PackageInfo >(Arena* arena) {
693 return Arena::CreateMessageInternal< ::perfetto::protos::PackagesList_PackageInfo >(arena);
694 }
695 template<> PROTOBUF_NOINLINE ::perfetto::protos::PackagesList*
CreateMaybeMessage(Arena * arena)696 Arena::CreateMaybeMessage< ::perfetto::protos::PackagesList >(Arena* arena) {
697 return Arena::CreateMessageInternal< ::perfetto::protos::PackagesList >(arena);
698 }
699 PROTOBUF_NAMESPACE_CLOSE
700
701 // @@protoc_insertion_point(global_scope)
702 #include <google/protobuf/port_undef.inc>
703