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