1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/filesystem/inode_file_map.proto
3
4 #include "protos/perfetto/trace/filesystem/inode_file_map.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 {
InodeFileMap_Entry(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR InodeFileMap_Entry::InodeFileMap_Entry(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.paths_)*/{}
28 , /*decltype(_impl_.inode_number_)*/::uint64_t{0u}
29 , /*decltype(_impl_.type_)*/0} {}
30 struct InodeFileMap_EntryDefaultTypeInternal {
InodeFileMap_EntryDefaultTypeInternalperfetto::protos::InodeFileMap_EntryDefaultTypeInternal31 PROTOBUF_CONSTEXPR InodeFileMap_EntryDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~InodeFileMap_EntryDefaultTypeInternalperfetto::protos::InodeFileMap_EntryDefaultTypeInternal33 ~InodeFileMap_EntryDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 InodeFileMap_Entry _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InodeFileMap_EntryDefaultTypeInternal _InodeFileMap_Entry_default_instance_;
InodeFileMap(::_pbi::ConstantInitialized)39 PROTOBUF_CONSTEXPR InodeFileMap::InodeFileMap(
40 ::_pbi::ConstantInitialized): _impl_{
41 /*decltype(_impl_._has_bits_)*/{}
42 , /*decltype(_impl_._cached_size_)*/{}
43 , /*decltype(_impl_.mount_points_)*/{}
44 , /*decltype(_impl_.entries_)*/{}
45 , /*decltype(_impl_.block_device_id_)*/::uint64_t{0u}} {}
46 struct InodeFileMapDefaultTypeInternal {
InodeFileMapDefaultTypeInternalperfetto::protos::InodeFileMapDefaultTypeInternal47 PROTOBUF_CONSTEXPR InodeFileMapDefaultTypeInternal()
48 : _instance(::_pbi::ConstantInitialized{}) {}
~InodeFileMapDefaultTypeInternalperfetto::protos::InodeFileMapDefaultTypeInternal49 ~InodeFileMapDefaultTypeInternal() {}
50 union { // NOLINT(misc-non-private-member-variables-in-classes)
51 InodeFileMap _instance;
52 };
53 };
54 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InodeFileMapDefaultTypeInternal _InodeFileMap_default_instance_;
55 } // namespace protos
56 } // namespace perfetto
57 namespace perfetto {
58 namespace protos {
InodeFileMap_Entry_Type_IsValid(int value)59 bool InodeFileMap_Entry_Type_IsValid(int value) {
60 switch (value) {
61 case 0:
62 case 1:
63 case 2:
64 return true;
65 default:
66 return false;
67 }
68 }
69
70 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> InodeFileMap_Entry_Type_strings[3] = {};
71
72 static const char InodeFileMap_Entry_Type_names[] =
73 "DIRECTORY"
74 "FILE"
75 "UNKNOWN";
76
77 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry InodeFileMap_Entry_Type_entries[] = {
78 { {InodeFileMap_Entry_Type_names + 0, 9}, 2 },
79 { {InodeFileMap_Entry_Type_names + 9, 4}, 1 },
80 { {InodeFileMap_Entry_Type_names + 13, 7}, 0 },
81 };
82
83 static const int InodeFileMap_Entry_Type_entries_by_number[] = {
84 2, // 0 -> UNKNOWN
85 1, // 1 -> FILE
86 0, // 2 -> DIRECTORY
87 };
88
InodeFileMap_Entry_Type_Name(InodeFileMap_Entry_Type value)89 const std::string& InodeFileMap_Entry_Type_Name(
90 InodeFileMap_Entry_Type value) {
91 static const bool dummy =
92 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
93 InodeFileMap_Entry_Type_entries,
94 InodeFileMap_Entry_Type_entries_by_number,
95 3, InodeFileMap_Entry_Type_strings);
96 (void) dummy;
97 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
98 InodeFileMap_Entry_Type_entries,
99 InodeFileMap_Entry_Type_entries_by_number,
100 3, value);
101 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
102 InodeFileMap_Entry_Type_strings[idx].get();
103 }
InodeFileMap_Entry_Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,InodeFileMap_Entry_Type * value)104 bool InodeFileMap_Entry_Type_Parse(
105 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, InodeFileMap_Entry_Type* value) {
106 int int_value;
107 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
108 InodeFileMap_Entry_Type_entries, 3, name, &int_value);
109 if (success) {
110 *value = static_cast<InodeFileMap_Entry_Type>(int_value);
111 }
112 return success;
113 }
114 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
115 constexpr InodeFileMap_Entry_Type InodeFileMap_Entry::UNKNOWN;
116 constexpr InodeFileMap_Entry_Type InodeFileMap_Entry::FILE;
117 constexpr InodeFileMap_Entry_Type InodeFileMap_Entry::DIRECTORY;
118 constexpr InodeFileMap_Entry_Type InodeFileMap_Entry::Type_MIN;
119 constexpr InodeFileMap_Entry_Type InodeFileMap_Entry::Type_MAX;
120 constexpr int InodeFileMap_Entry::Type_ARRAYSIZE;
121 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
122
123 // ===================================================================
124
125 class InodeFileMap_Entry::_Internal {
126 public:
127 using HasBits = decltype(std::declval<InodeFileMap_Entry>()._impl_._has_bits_);
set_has_inode_number(HasBits * has_bits)128 static void set_has_inode_number(HasBits* has_bits) {
129 (*has_bits)[0] |= 1u;
130 }
set_has_type(HasBits * has_bits)131 static void set_has_type(HasBits* has_bits) {
132 (*has_bits)[0] |= 2u;
133 }
134 };
135
InodeFileMap_Entry(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)136 InodeFileMap_Entry::InodeFileMap_Entry(::PROTOBUF_NAMESPACE_ID::Arena* arena,
137 bool is_message_owned)
138 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
139 SharedCtor(arena, is_message_owned);
140 // @@protoc_insertion_point(arena_constructor:perfetto.protos.InodeFileMap.Entry)
141 }
InodeFileMap_Entry(const InodeFileMap_Entry & from)142 InodeFileMap_Entry::InodeFileMap_Entry(const InodeFileMap_Entry& from)
143 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
144 InodeFileMap_Entry* const _this = this; (void)_this;
145 new (&_impl_) Impl_{
146 decltype(_impl_._has_bits_){from._impl_._has_bits_}
147 , /*decltype(_impl_._cached_size_)*/{}
148 , decltype(_impl_.paths_){from._impl_.paths_}
149 , decltype(_impl_.inode_number_){}
150 , decltype(_impl_.type_){}};
151
152 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
153 ::memcpy(&_impl_.inode_number_, &from._impl_.inode_number_,
154 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.type_) -
155 reinterpret_cast<char*>(&_impl_.inode_number_)) + sizeof(_impl_.type_));
156 // @@protoc_insertion_point(copy_constructor:perfetto.protos.InodeFileMap.Entry)
157 }
158
SharedCtor(::_pb::Arena * arena,bool is_message_owned)159 inline void InodeFileMap_Entry::SharedCtor(
160 ::_pb::Arena* arena, bool is_message_owned) {
161 (void)arena;
162 (void)is_message_owned;
163 new (&_impl_) Impl_{
164 decltype(_impl_._has_bits_){}
165 , /*decltype(_impl_._cached_size_)*/{}
166 , decltype(_impl_.paths_){arena}
167 , decltype(_impl_.inode_number_){::uint64_t{0u}}
168 , decltype(_impl_.type_){0}
169 };
170 }
171
~InodeFileMap_Entry()172 InodeFileMap_Entry::~InodeFileMap_Entry() {
173 // @@protoc_insertion_point(destructor:perfetto.protos.InodeFileMap.Entry)
174 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
175 (void)arena;
176 return;
177 }
178 SharedDtor();
179 }
180
SharedDtor()181 inline void InodeFileMap_Entry::SharedDtor() {
182 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
183 _impl_.paths_.~RepeatedPtrField();
184 }
185
SetCachedSize(int size) const186 void InodeFileMap_Entry::SetCachedSize(int size) const {
187 _impl_._cached_size_.Set(size);
188 }
189
Clear()190 void InodeFileMap_Entry::Clear() {
191 // @@protoc_insertion_point(message_clear_start:perfetto.protos.InodeFileMap.Entry)
192 ::uint32_t cached_has_bits = 0;
193 // Prevent compiler warnings about cached_has_bits being unused
194 (void) cached_has_bits;
195
196 _impl_.paths_.Clear();
197 cached_has_bits = _impl_._has_bits_[0];
198 if (cached_has_bits & 0x00000003u) {
199 ::memset(&_impl_.inode_number_, 0, static_cast<size_t>(
200 reinterpret_cast<char*>(&_impl_.type_) -
201 reinterpret_cast<char*>(&_impl_.inode_number_)) + sizeof(_impl_.type_));
202 }
203 _impl_._has_bits_.Clear();
204 _internal_metadata_.Clear<std::string>();
205 }
206
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)207 const char* InodeFileMap_Entry::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
208 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
209 _Internal::HasBits has_bits{};
210 while (!ctx->Done(&ptr)) {
211 ::uint32_t tag;
212 ptr = ::_pbi::ReadTag(ptr, &tag);
213 switch (tag >> 3) {
214 // optional uint64 inode_number = 1;
215 case 1:
216 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
217 _Internal::set_has_inode_number(&has_bits);
218 _impl_.inode_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
219 CHK_(ptr);
220 } else {
221 goto handle_unusual;
222 }
223 continue;
224 // repeated string paths = 2;
225 case 2:
226 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
227 ptr -= 1;
228 do {
229 ptr += 1;
230 auto str = _internal_add_paths();
231 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
232 CHK_(ptr);
233 if (!ctx->DataAvailable(ptr)) break;
234 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
235 } else {
236 goto handle_unusual;
237 }
238 continue;
239 // optional .perfetto.protos.InodeFileMap.Entry.Type type = 3;
240 case 3:
241 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
242 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
243 CHK_(ptr);
244 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::InodeFileMap_Entry_Type_IsValid(val))) {
245 _internal_set_type(static_cast<::perfetto::protos::InodeFileMap_Entry_Type>(val));
246 } else {
247 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
248 }
249 } else {
250 goto handle_unusual;
251 }
252 continue;
253 default:
254 goto handle_unusual;
255 } // switch
256 handle_unusual:
257 if ((tag == 0) || ((tag & 7) == 4)) {
258 CHK_(ptr);
259 ctx->SetLastTag(tag);
260 goto message_done;
261 }
262 ptr = UnknownFieldParse(
263 tag,
264 _internal_metadata_.mutable_unknown_fields<std::string>(),
265 ptr, ctx);
266 CHK_(ptr != nullptr);
267 } // while
268 message_done:
269 _impl_._has_bits_.Or(has_bits);
270 return ptr;
271 failure:
272 ptr = nullptr;
273 goto message_done;
274 #undef CHK_
275 }
276
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const277 ::uint8_t* InodeFileMap_Entry::_InternalSerialize(
278 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
279 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.InodeFileMap.Entry)
280 ::uint32_t cached_has_bits = 0;
281 (void) cached_has_bits;
282
283 cached_has_bits = _impl_._has_bits_[0];
284 // optional uint64 inode_number = 1;
285 if (cached_has_bits & 0x00000001u) {
286 target = stream->EnsureSpace(target);
287 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_inode_number(), target);
288 }
289
290 // repeated string paths = 2;
291 for (int i = 0, n = this->_internal_paths_size(); i < n; i++) {
292 const auto& s = this->_internal_paths(i);
293 target = stream->WriteString(2, s, target);
294 }
295
296 // optional .perfetto.protos.InodeFileMap.Entry.Type type = 3;
297 if (cached_has_bits & 0x00000002u) {
298 target = stream->EnsureSpace(target);
299 target = ::_pbi::WireFormatLite::WriteEnumToArray(
300 3, this->_internal_type(), target);
301 }
302
303 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
304 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
305 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
306 }
307 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.InodeFileMap.Entry)
308 return target;
309 }
310
ByteSizeLong() const311 size_t InodeFileMap_Entry::ByteSizeLong() const {
312 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.InodeFileMap.Entry)
313 size_t total_size = 0;
314
315 ::uint32_t cached_has_bits = 0;
316 // Prevent compiler warnings about cached_has_bits being unused
317 (void) cached_has_bits;
318
319 // repeated string paths = 2;
320 total_size += 1 *
321 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.paths_.size());
322 for (int i = 0, n = _impl_.paths_.size(); i < n; i++) {
323 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
324 _impl_.paths_.Get(i));
325 }
326
327 cached_has_bits = _impl_._has_bits_[0];
328 if (cached_has_bits & 0x00000003u) {
329 // optional uint64 inode_number = 1;
330 if (cached_has_bits & 0x00000001u) {
331 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_inode_number());
332 }
333
334 // optional .perfetto.protos.InodeFileMap.Entry.Type type = 3;
335 if (cached_has_bits & 0x00000002u) {
336 total_size += 1 +
337 ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
338 }
339
340 }
341 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
342 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
343 }
344 int cached_size = ::_pbi::ToCachedSize(total_size);
345 SetCachedSize(cached_size);
346 return total_size;
347 }
348
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)349 void InodeFileMap_Entry::CheckTypeAndMergeFrom(
350 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
351 MergeFrom(*::_pbi::DownCast<const InodeFileMap_Entry*>(
352 &from));
353 }
354
MergeFrom(const InodeFileMap_Entry & from)355 void InodeFileMap_Entry::MergeFrom(const InodeFileMap_Entry& from) {
356 InodeFileMap_Entry* const _this = this;
357 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.InodeFileMap.Entry)
358 GOOGLE_DCHECK_NE(&from, _this);
359 ::uint32_t cached_has_bits = 0;
360 (void) cached_has_bits;
361
362 _this->_impl_.paths_.MergeFrom(from._impl_.paths_);
363 cached_has_bits = from._impl_._has_bits_[0];
364 if (cached_has_bits & 0x00000003u) {
365 if (cached_has_bits & 0x00000001u) {
366 _this->_impl_.inode_number_ = from._impl_.inode_number_;
367 }
368 if (cached_has_bits & 0x00000002u) {
369 _this->_impl_.type_ = from._impl_.type_;
370 }
371 _this->_impl_._has_bits_[0] |= cached_has_bits;
372 }
373 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
374 }
375
CopyFrom(const InodeFileMap_Entry & from)376 void InodeFileMap_Entry::CopyFrom(const InodeFileMap_Entry& from) {
377 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.InodeFileMap.Entry)
378 if (&from == this) return;
379 Clear();
380 MergeFrom(from);
381 }
382
IsInitialized() const383 bool InodeFileMap_Entry::IsInitialized() const {
384 return true;
385 }
386
InternalSwap(InodeFileMap_Entry * other)387 void InodeFileMap_Entry::InternalSwap(InodeFileMap_Entry* other) {
388 using std::swap;
389 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
390 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
391 _impl_.paths_.InternalSwap(&other->_impl_.paths_);
392 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
393 PROTOBUF_FIELD_OFFSET(InodeFileMap_Entry, _impl_.type_)
394 + sizeof(InodeFileMap_Entry::_impl_.type_) // NOLINT
395 - PROTOBUF_FIELD_OFFSET(InodeFileMap_Entry, _impl_.inode_number_)>(
396 reinterpret_cast<char*>(&_impl_.inode_number_),
397 reinterpret_cast<char*>(&other->_impl_.inode_number_));
398 }
399
GetTypeName() const400 std::string InodeFileMap_Entry::GetTypeName() const {
401 return "perfetto.protos.InodeFileMap.Entry";
402 }
403
404
405 // ===================================================================
406
407 class InodeFileMap::_Internal {
408 public:
409 using HasBits = decltype(std::declval<InodeFileMap>()._impl_._has_bits_);
set_has_block_device_id(HasBits * has_bits)410 static void set_has_block_device_id(HasBits* has_bits) {
411 (*has_bits)[0] |= 1u;
412 }
413 };
414
InodeFileMap(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)415 InodeFileMap::InodeFileMap(::PROTOBUF_NAMESPACE_ID::Arena* arena,
416 bool is_message_owned)
417 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
418 SharedCtor(arena, is_message_owned);
419 // @@protoc_insertion_point(arena_constructor:perfetto.protos.InodeFileMap)
420 }
InodeFileMap(const InodeFileMap & from)421 InodeFileMap::InodeFileMap(const InodeFileMap& from)
422 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
423 InodeFileMap* const _this = this; (void)_this;
424 new (&_impl_) Impl_{
425 decltype(_impl_._has_bits_){from._impl_._has_bits_}
426 , /*decltype(_impl_._cached_size_)*/{}
427 , decltype(_impl_.mount_points_){from._impl_.mount_points_}
428 , decltype(_impl_.entries_){from._impl_.entries_}
429 , decltype(_impl_.block_device_id_){}};
430
431 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
432 _this->_impl_.block_device_id_ = from._impl_.block_device_id_;
433 // @@protoc_insertion_point(copy_constructor:perfetto.protos.InodeFileMap)
434 }
435
SharedCtor(::_pb::Arena * arena,bool is_message_owned)436 inline void InodeFileMap::SharedCtor(
437 ::_pb::Arena* arena, bool is_message_owned) {
438 (void)arena;
439 (void)is_message_owned;
440 new (&_impl_) Impl_{
441 decltype(_impl_._has_bits_){}
442 , /*decltype(_impl_._cached_size_)*/{}
443 , decltype(_impl_.mount_points_){arena}
444 , decltype(_impl_.entries_){arena}
445 , decltype(_impl_.block_device_id_){::uint64_t{0u}}
446 };
447 }
448
~InodeFileMap()449 InodeFileMap::~InodeFileMap() {
450 // @@protoc_insertion_point(destructor:perfetto.protos.InodeFileMap)
451 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
452 (void)arena;
453 return;
454 }
455 SharedDtor();
456 }
457
SharedDtor()458 inline void InodeFileMap::SharedDtor() {
459 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
460 _impl_.mount_points_.~RepeatedPtrField();
461 _impl_.entries_.~RepeatedPtrField();
462 }
463
SetCachedSize(int size) const464 void InodeFileMap::SetCachedSize(int size) const {
465 _impl_._cached_size_.Set(size);
466 }
467
Clear()468 void InodeFileMap::Clear() {
469 // @@protoc_insertion_point(message_clear_start:perfetto.protos.InodeFileMap)
470 ::uint32_t cached_has_bits = 0;
471 // Prevent compiler warnings about cached_has_bits being unused
472 (void) cached_has_bits;
473
474 _impl_.mount_points_.Clear();
475 _impl_.entries_.Clear();
476 _impl_.block_device_id_ = ::uint64_t{0u};
477 _impl_._has_bits_.Clear();
478 _internal_metadata_.Clear<std::string>();
479 }
480
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)481 const char* InodeFileMap::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
482 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
483 _Internal::HasBits has_bits{};
484 while (!ctx->Done(&ptr)) {
485 ::uint32_t tag;
486 ptr = ::_pbi::ReadTag(ptr, &tag);
487 switch (tag >> 3) {
488 // optional uint64 block_device_id = 1;
489 case 1:
490 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
491 _Internal::set_has_block_device_id(&has_bits);
492 _impl_.block_device_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
493 CHK_(ptr);
494 } else {
495 goto handle_unusual;
496 }
497 continue;
498 // repeated string mount_points = 2;
499 case 2:
500 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
501 ptr -= 1;
502 do {
503 ptr += 1;
504 auto str = _internal_add_mount_points();
505 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
506 CHK_(ptr);
507 if (!ctx->DataAvailable(ptr)) break;
508 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
509 } else {
510 goto handle_unusual;
511 }
512 continue;
513 // repeated .perfetto.protos.InodeFileMap.Entry entries = 3;
514 case 3:
515 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
516 ptr -= 1;
517 do {
518 ptr += 1;
519 ptr = ctx->ParseMessage(_internal_add_entries(), ptr);
520 CHK_(ptr);
521 if (!ctx->DataAvailable(ptr)) break;
522 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
523 } else {
524 goto handle_unusual;
525 }
526 continue;
527 default:
528 goto handle_unusual;
529 } // switch
530 handle_unusual:
531 if ((tag == 0) || ((tag & 7) == 4)) {
532 CHK_(ptr);
533 ctx->SetLastTag(tag);
534 goto message_done;
535 }
536 ptr = UnknownFieldParse(
537 tag,
538 _internal_metadata_.mutable_unknown_fields<std::string>(),
539 ptr, ctx);
540 CHK_(ptr != nullptr);
541 } // while
542 message_done:
543 _impl_._has_bits_.Or(has_bits);
544 return ptr;
545 failure:
546 ptr = nullptr;
547 goto message_done;
548 #undef CHK_
549 }
550
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const551 ::uint8_t* InodeFileMap::_InternalSerialize(
552 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
553 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.InodeFileMap)
554 ::uint32_t cached_has_bits = 0;
555 (void) cached_has_bits;
556
557 cached_has_bits = _impl_._has_bits_[0];
558 // optional uint64 block_device_id = 1;
559 if (cached_has_bits & 0x00000001u) {
560 target = stream->EnsureSpace(target);
561 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_block_device_id(), target);
562 }
563
564 // repeated string mount_points = 2;
565 for (int i = 0, n = this->_internal_mount_points_size(); i < n; i++) {
566 const auto& s = this->_internal_mount_points(i);
567 target = stream->WriteString(2, s, target);
568 }
569
570 // repeated .perfetto.protos.InodeFileMap.Entry entries = 3;
571 for (unsigned i = 0,
572 n = static_cast<unsigned>(this->_internal_entries_size()); i < n; i++) {
573 const auto& repfield = this->_internal_entries(i);
574 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
575 InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
576 }
577
578 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
579 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
580 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
581 }
582 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.InodeFileMap)
583 return target;
584 }
585
ByteSizeLong() const586 size_t InodeFileMap::ByteSizeLong() const {
587 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.InodeFileMap)
588 size_t total_size = 0;
589
590 ::uint32_t cached_has_bits = 0;
591 // Prevent compiler warnings about cached_has_bits being unused
592 (void) cached_has_bits;
593
594 // repeated string mount_points = 2;
595 total_size += 1 *
596 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.mount_points_.size());
597 for (int i = 0, n = _impl_.mount_points_.size(); i < n; i++) {
598 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
599 _impl_.mount_points_.Get(i));
600 }
601
602 // repeated .perfetto.protos.InodeFileMap.Entry entries = 3;
603 total_size += 1UL * this->_internal_entries_size();
604 for (const auto& msg : this->_impl_.entries_) {
605 total_size +=
606 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
607 }
608
609 // optional uint64 block_device_id = 1;
610 cached_has_bits = _impl_._has_bits_[0];
611 if (cached_has_bits & 0x00000001u) {
612 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_block_device_id());
613 }
614
615 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
616 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
617 }
618 int cached_size = ::_pbi::ToCachedSize(total_size);
619 SetCachedSize(cached_size);
620 return total_size;
621 }
622
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)623 void InodeFileMap::CheckTypeAndMergeFrom(
624 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
625 MergeFrom(*::_pbi::DownCast<const InodeFileMap*>(
626 &from));
627 }
628
MergeFrom(const InodeFileMap & from)629 void InodeFileMap::MergeFrom(const InodeFileMap& from) {
630 InodeFileMap* const _this = this;
631 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.InodeFileMap)
632 GOOGLE_DCHECK_NE(&from, _this);
633 ::uint32_t cached_has_bits = 0;
634 (void) cached_has_bits;
635
636 _this->_impl_.mount_points_.MergeFrom(from._impl_.mount_points_);
637 _this->_impl_.entries_.MergeFrom(from._impl_.entries_);
638 if (from._internal_has_block_device_id()) {
639 _this->_internal_set_block_device_id(from._internal_block_device_id());
640 }
641 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
642 }
643
CopyFrom(const InodeFileMap & from)644 void InodeFileMap::CopyFrom(const InodeFileMap& from) {
645 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.InodeFileMap)
646 if (&from == this) return;
647 Clear();
648 MergeFrom(from);
649 }
650
IsInitialized() const651 bool InodeFileMap::IsInitialized() const {
652 return true;
653 }
654
InternalSwap(InodeFileMap * other)655 void InodeFileMap::InternalSwap(InodeFileMap* other) {
656 using std::swap;
657 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
658 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
659 _impl_.mount_points_.InternalSwap(&other->_impl_.mount_points_);
660 _impl_.entries_.InternalSwap(&other->_impl_.entries_);
661 swap(_impl_.block_device_id_, other->_impl_.block_device_id_);
662 }
663
GetTypeName() const664 std::string InodeFileMap::GetTypeName() const {
665 return "perfetto.protos.InodeFileMap";
666 }
667
668
669 // @@protoc_insertion_point(namespace_scope)
670 } // namespace protos
671 } // namespace perfetto
672 PROTOBUF_NAMESPACE_OPEN
673 template<> PROTOBUF_NOINLINE ::perfetto::protos::InodeFileMap_Entry*
CreateMaybeMessage(Arena * arena)674 Arena::CreateMaybeMessage< ::perfetto::protos::InodeFileMap_Entry >(Arena* arena) {
675 return Arena::CreateMessageInternal< ::perfetto::protos::InodeFileMap_Entry >(arena);
676 }
677 template<> PROTOBUF_NOINLINE ::perfetto::protos::InodeFileMap*
CreateMaybeMessage(Arena * arena)678 Arena::CreateMaybeMessage< ::perfetto::protos::InodeFileMap >(Arena* arena) {
679 return Arena::CreateMessageInternal< ::perfetto::protos::InodeFileMap >(arena);
680 }
681 PROTOBUF_NAMESPACE_CLOSE
682
683 // @@protoc_insertion_point(global_scope)
684 #include <google/protobuf/port_undef.inc>
685