1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/sync.proto
3 
4 #include "protos/perfetto/trace/ftrace/sync.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 {
SyncPtFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR SyncPtFtraceEvent::SyncPtFtraceEvent(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.timeline_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28   , /*decltype(_impl_.value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
29 struct SyncPtFtraceEventDefaultTypeInternal {
SyncPtFtraceEventDefaultTypeInternalperfetto::protos::SyncPtFtraceEventDefaultTypeInternal30   PROTOBUF_CONSTEXPR SyncPtFtraceEventDefaultTypeInternal()
31       : _instance(::_pbi::ConstantInitialized{}) {}
~SyncPtFtraceEventDefaultTypeInternalperfetto::protos::SyncPtFtraceEventDefaultTypeInternal32   ~SyncPtFtraceEventDefaultTypeInternal() {}
33   union {  // NOLINT(misc-non-private-member-variables-in-classes)
34     SyncPtFtraceEvent _instance;
35   };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SyncPtFtraceEventDefaultTypeInternal _SyncPtFtraceEvent_default_instance_;
SyncTimelineFtraceEvent(::_pbi::ConstantInitialized)38 PROTOBUF_CONSTEXPR SyncTimelineFtraceEvent::SyncTimelineFtraceEvent(
39     ::_pbi::ConstantInitialized): _impl_{
40     /*decltype(_impl_._has_bits_)*/{}
41   , /*decltype(_impl_._cached_size_)*/{}
42   , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
43   , /*decltype(_impl_.value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
44 struct SyncTimelineFtraceEventDefaultTypeInternal {
SyncTimelineFtraceEventDefaultTypeInternalperfetto::protos::SyncTimelineFtraceEventDefaultTypeInternal45   PROTOBUF_CONSTEXPR SyncTimelineFtraceEventDefaultTypeInternal()
46       : _instance(::_pbi::ConstantInitialized{}) {}
~SyncTimelineFtraceEventDefaultTypeInternalperfetto::protos::SyncTimelineFtraceEventDefaultTypeInternal47   ~SyncTimelineFtraceEventDefaultTypeInternal() {}
48   union {  // NOLINT(misc-non-private-member-variables-in-classes)
49     SyncTimelineFtraceEvent _instance;
50   };
51 };
52 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SyncTimelineFtraceEventDefaultTypeInternal _SyncTimelineFtraceEvent_default_instance_;
SyncWaitFtraceEvent(::_pbi::ConstantInitialized)53 PROTOBUF_CONSTEXPR SyncWaitFtraceEvent::SyncWaitFtraceEvent(
54     ::_pbi::ConstantInitialized): _impl_{
55     /*decltype(_impl_._has_bits_)*/{}
56   , /*decltype(_impl_._cached_size_)*/{}
57   , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
58   , /*decltype(_impl_.status_)*/0
59   , /*decltype(_impl_.begin_)*/0u} {}
60 struct SyncWaitFtraceEventDefaultTypeInternal {
SyncWaitFtraceEventDefaultTypeInternalperfetto::protos::SyncWaitFtraceEventDefaultTypeInternal61   PROTOBUF_CONSTEXPR SyncWaitFtraceEventDefaultTypeInternal()
62       : _instance(::_pbi::ConstantInitialized{}) {}
~SyncWaitFtraceEventDefaultTypeInternalperfetto::protos::SyncWaitFtraceEventDefaultTypeInternal63   ~SyncWaitFtraceEventDefaultTypeInternal() {}
64   union {  // NOLINT(misc-non-private-member-variables-in-classes)
65     SyncWaitFtraceEvent _instance;
66   };
67 };
68 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SyncWaitFtraceEventDefaultTypeInternal _SyncWaitFtraceEvent_default_instance_;
69 }  // namespace protos
70 }  // namespace perfetto
71 namespace perfetto {
72 namespace protos {
73 
74 // ===================================================================
75 
76 class SyncPtFtraceEvent::_Internal {
77  public:
78   using HasBits = decltype(std::declval<SyncPtFtraceEvent>()._impl_._has_bits_);
set_has_timeline(HasBits * has_bits)79   static void set_has_timeline(HasBits* has_bits) {
80     (*has_bits)[0] |= 1u;
81   }
set_has_value(HasBits * has_bits)82   static void set_has_value(HasBits* has_bits) {
83     (*has_bits)[0] |= 2u;
84   }
85 };
86 
SyncPtFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)87 SyncPtFtraceEvent::SyncPtFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
88                          bool is_message_owned)
89   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
90   SharedCtor(arena, is_message_owned);
91   // @@protoc_insertion_point(arena_constructor:perfetto.protos.SyncPtFtraceEvent)
92 }
SyncPtFtraceEvent(const SyncPtFtraceEvent & from)93 SyncPtFtraceEvent::SyncPtFtraceEvent(const SyncPtFtraceEvent& from)
94   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
95   SyncPtFtraceEvent* const _this = this; (void)_this;
96   new (&_impl_) Impl_{
97       decltype(_impl_._has_bits_){from._impl_._has_bits_}
98     , /*decltype(_impl_._cached_size_)*/{}
99     , decltype(_impl_.timeline_){}
100     , decltype(_impl_.value_){}};
101 
102   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
103   _impl_.timeline_.InitDefault();
104   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
105     _impl_.timeline_.Set("", GetArenaForAllocation());
106   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
107   if (from._internal_has_timeline()) {
108     _this->_impl_.timeline_.Set(from._internal_timeline(),
109       _this->GetArenaForAllocation());
110   }
111   _impl_.value_.InitDefault();
112   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
113     _impl_.value_.Set("", GetArenaForAllocation());
114   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
115   if (from._internal_has_value()) {
116     _this->_impl_.value_.Set(from._internal_value(),
117       _this->GetArenaForAllocation());
118   }
119   // @@protoc_insertion_point(copy_constructor:perfetto.protos.SyncPtFtraceEvent)
120 }
121 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)122 inline void SyncPtFtraceEvent::SharedCtor(
123     ::_pb::Arena* arena, bool is_message_owned) {
124   (void)arena;
125   (void)is_message_owned;
126   new (&_impl_) Impl_{
127       decltype(_impl_._has_bits_){}
128     , /*decltype(_impl_._cached_size_)*/{}
129     , decltype(_impl_.timeline_){}
130     , decltype(_impl_.value_){}
131   };
132   _impl_.timeline_.InitDefault();
133   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
134     _impl_.timeline_.Set("", GetArenaForAllocation());
135   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
136   _impl_.value_.InitDefault();
137   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
138     _impl_.value_.Set("", GetArenaForAllocation());
139   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
140 }
141 
~SyncPtFtraceEvent()142 SyncPtFtraceEvent::~SyncPtFtraceEvent() {
143   // @@protoc_insertion_point(destructor:perfetto.protos.SyncPtFtraceEvent)
144   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
145   (void)arena;
146     return;
147   }
148   SharedDtor();
149 }
150 
SharedDtor()151 inline void SyncPtFtraceEvent::SharedDtor() {
152   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
153   _impl_.timeline_.Destroy();
154   _impl_.value_.Destroy();
155 }
156 
SetCachedSize(int size) const157 void SyncPtFtraceEvent::SetCachedSize(int size) const {
158   _impl_._cached_size_.Set(size);
159 }
160 
Clear()161 void SyncPtFtraceEvent::Clear() {
162 // @@protoc_insertion_point(message_clear_start:perfetto.protos.SyncPtFtraceEvent)
163   ::uint32_t cached_has_bits = 0;
164   // Prevent compiler warnings about cached_has_bits being unused
165   (void) cached_has_bits;
166 
167   cached_has_bits = _impl_._has_bits_[0];
168   if (cached_has_bits & 0x00000003u) {
169     if (cached_has_bits & 0x00000001u) {
170       _impl_.timeline_.ClearNonDefaultToEmpty();
171     }
172     if (cached_has_bits & 0x00000002u) {
173       _impl_.value_.ClearNonDefaultToEmpty();
174     }
175   }
176   _impl_._has_bits_.Clear();
177   _internal_metadata_.Clear<std::string>();
178 }
179 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)180 const char* SyncPtFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
181 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
182   _Internal::HasBits has_bits{};
183   while (!ctx->Done(&ptr)) {
184     ::uint32_t tag;
185     ptr = ::_pbi::ReadTag(ptr, &tag);
186     switch (tag >> 3) {
187       // optional string timeline = 1;
188       case 1:
189         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
190           auto str = _internal_mutable_timeline();
191           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
192           CHK_(ptr);
193         } else {
194           goto handle_unusual;
195         }
196         continue;
197       // optional string value = 2;
198       case 2:
199         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
200           auto str = _internal_mutable_value();
201           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
202           CHK_(ptr);
203         } else {
204           goto handle_unusual;
205         }
206         continue;
207       default:
208         goto handle_unusual;
209     }  // switch
210   handle_unusual:
211     if ((tag == 0) || ((tag & 7) == 4)) {
212       CHK_(ptr);
213       ctx->SetLastTag(tag);
214       goto message_done;
215     }
216     ptr = UnknownFieldParse(
217         tag,
218         _internal_metadata_.mutable_unknown_fields<std::string>(),
219         ptr, ctx);
220     CHK_(ptr != nullptr);
221   }  // while
222 message_done:
223   _impl_._has_bits_.Or(has_bits);
224   return ptr;
225 failure:
226   ptr = nullptr;
227   goto message_done;
228 #undef CHK_
229 }
230 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const231 ::uint8_t* SyncPtFtraceEvent::_InternalSerialize(
232     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
233   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.SyncPtFtraceEvent)
234   ::uint32_t cached_has_bits = 0;
235   (void) cached_has_bits;
236 
237   cached_has_bits = _impl_._has_bits_[0];
238   // optional string timeline = 1;
239   if (cached_has_bits & 0x00000001u) {
240     target = stream->WriteStringMaybeAliased(
241         1, this->_internal_timeline(), target);
242   }
243 
244   // optional string value = 2;
245   if (cached_has_bits & 0x00000002u) {
246     target = stream->WriteStringMaybeAliased(
247         2, this->_internal_value(), target);
248   }
249 
250   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
251     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
252         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
253   }
254   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.SyncPtFtraceEvent)
255   return target;
256 }
257 
ByteSizeLong() const258 size_t SyncPtFtraceEvent::ByteSizeLong() const {
259 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.SyncPtFtraceEvent)
260   size_t total_size = 0;
261 
262   ::uint32_t cached_has_bits = 0;
263   // Prevent compiler warnings about cached_has_bits being unused
264   (void) cached_has_bits;
265 
266   cached_has_bits = _impl_._has_bits_[0];
267   if (cached_has_bits & 0x00000003u) {
268     // optional string timeline = 1;
269     if (cached_has_bits & 0x00000001u) {
270       total_size += 1 +
271         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
272           this->_internal_timeline());
273     }
274 
275     // optional string value = 2;
276     if (cached_has_bits & 0x00000002u) {
277       total_size += 1 +
278         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
279           this->_internal_value());
280     }
281 
282   }
283   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
284     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
285   }
286   int cached_size = ::_pbi::ToCachedSize(total_size);
287   SetCachedSize(cached_size);
288   return total_size;
289 }
290 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)291 void SyncPtFtraceEvent::CheckTypeAndMergeFrom(
292     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
293   MergeFrom(*::_pbi::DownCast<const SyncPtFtraceEvent*>(
294       &from));
295 }
296 
MergeFrom(const SyncPtFtraceEvent & from)297 void SyncPtFtraceEvent::MergeFrom(const SyncPtFtraceEvent& from) {
298   SyncPtFtraceEvent* const _this = this;
299   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.SyncPtFtraceEvent)
300   GOOGLE_DCHECK_NE(&from, _this);
301   ::uint32_t cached_has_bits = 0;
302   (void) cached_has_bits;
303 
304   cached_has_bits = from._impl_._has_bits_[0];
305   if (cached_has_bits & 0x00000003u) {
306     if (cached_has_bits & 0x00000001u) {
307       _this->_internal_set_timeline(from._internal_timeline());
308     }
309     if (cached_has_bits & 0x00000002u) {
310       _this->_internal_set_value(from._internal_value());
311     }
312   }
313   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
314 }
315 
CopyFrom(const SyncPtFtraceEvent & from)316 void SyncPtFtraceEvent::CopyFrom(const SyncPtFtraceEvent& from) {
317 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.SyncPtFtraceEvent)
318   if (&from == this) return;
319   Clear();
320   MergeFrom(from);
321 }
322 
IsInitialized() const323 bool SyncPtFtraceEvent::IsInitialized() const {
324   return true;
325 }
326 
InternalSwap(SyncPtFtraceEvent * other)327 void SyncPtFtraceEvent::InternalSwap(SyncPtFtraceEvent* other) {
328   using std::swap;
329   auto* lhs_arena = GetArenaForAllocation();
330   auto* rhs_arena = other->GetArenaForAllocation();
331   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
332   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
333   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
334       &_impl_.timeline_, lhs_arena,
335       &other->_impl_.timeline_, rhs_arena
336   );
337   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
338       &_impl_.value_, lhs_arena,
339       &other->_impl_.value_, rhs_arena
340   );
341 }
342 
GetTypeName() const343 std::string SyncPtFtraceEvent::GetTypeName() const {
344   return "perfetto.protos.SyncPtFtraceEvent";
345 }
346 
347 
348 // ===================================================================
349 
350 class SyncTimelineFtraceEvent::_Internal {
351  public:
352   using HasBits = decltype(std::declval<SyncTimelineFtraceEvent>()._impl_._has_bits_);
set_has_name(HasBits * has_bits)353   static void set_has_name(HasBits* has_bits) {
354     (*has_bits)[0] |= 1u;
355   }
set_has_value(HasBits * has_bits)356   static void set_has_value(HasBits* has_bits) {
357     (*has_bits)[0] |= 2u;
358   }
359 };
360 
SyncTimelineFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)361 SyncTimelineFtraceEvent::SyncTimelineFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
362                          bool is_message_owned)
363   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
364   SharedCtor(arena, is_message_owned);
365   // @@protoc_insertion_point(arena_constructor:perfetto.protos.SyncTimelineFtraceEvent)
366 }
SyncTimelineFtraceEvent(const SyncTimelineFtraceEvent & from)367 SyncTimelineFtraceEvent::SyncTimelineFtraceEvent(const SyncTimelineFtraceEvent& from)
368   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
369   SyncTimelineFtraceEvent* const _this = this; (void)_this;
370   new (&_impl_) Impl_{
371       decltype(_impl_._has_bits_){from._impl_._has_bits_}
372     , /*decltype(_impl_._cached_size_)*/{}
373     , decltype(_impl_.name_){}
374     , decltype(_impl_.value_){}};
375 
376   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
377   _impl_.name_.InitDefault();
378   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
379     _impl_.name_.Set("", GetArenaForAllocation());
380   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
381   if (from._internal_has_name()) {
382     _this->_impl_.name_.Set(from._internal_name(),
383       _this->GetArenaForAllocation());
384   }
385   _impl_.value_.InitDefault();
386   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
387     _impl_.value_.Set("", GetArenaForAllocation());
388   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
389   if (from._internal_has_value()) {
390     _this->_impl_.value_.Set(from._internal_value(),
391       _this->GetArenaForAllocation());
392   }
393   // @@protoc_insertion_point(copy_constructor:perfetto.protos.SyncTimelineFtraceEvent)
394 }
395 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)396 inline void SyncTimelineFtraceEvent::SharedCtor(
397     ::_pb::Arena* arena, bool is_message_owned) {
398   (void)arena;
399   (void)is_message_owned;
400   new (&_impl_) Impl_{
401       decltype(_impl_._has_bits_){}
402     , /*decltype(_impl_._cached_size_)*/{}
403     , decltype(_impl_.name_){}
404     , decltype(_impl_.value_){}
405   };
406   _impl_.name_.InitDefault();
407   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
408     _impl_.name_.Set("", GetArenaForAllocation());
409   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
410   _impl_.value_.InitDefault();
411   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
412     _impl_.value_.Set("", GetArenaForAllocation());
413   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
414 }
415 
~SyncTimelineFtraceEvent()416 SyncTimelineFtraceEvent::~SyncTimelineFtraceEvent() {
417   // @@protoc_insertion_point(destructor:perfetto.protos.SyncTimelineFtraceEvent)
418   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
419   (void)arena;
420     return;
421   }
422   SharedDtor();
423 }
424 
SharedDtor()425 inline void SyncTimelineFtraceEvent::SharedDtor() {
426   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
427   _impl_.name_.Destroy();
428   _impl_.value_.Destroy();
429 }
430 
SetCachedSize(int size) const431 void SyncTimelineFtraceEvent::SetCachedSize(int size) const {
432   _impl_._cached_size_.Set(size);
433 }
434 
Clear()435 void SyncTimelineFtraceEvent::Clear() {
436 // @@protoc_insertion_point(message_clear_start:perfetto.protos.SyncTimelineFtraceEvent)
437   ::uint32_t cached_has_bits = 0;
438   // Prevent compiler warnings about cached_has_bits being unused
439   (void) cached_has_bits;
440 
441   cached_has_bits = _impl_._has_bits_[0];
442   if (cached_has_bits & 0x00000003u) {
443     if (cached_has_bits & 0x00000001u) {
444       _impl_.name_.ClearNonDefaultToEmpty();
445     }
446     if (cached_has_bits & 0x00000002u) {
447       _impl_.value_.ClearNonDefaultToEmpty();
448     }
449   }
450   _impl_._has_bits_.Clear();
451   _internal_metadata_.Clear<std::string>();
452 }
453 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)454 const char* SyncTimelineFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
455 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
456   _Internal::HasBits has_bits{};
457   while (!ctx->Done(&ptr)) {
458     ::uint32_t tag;
459     ptr = ::_pbi::ReadTag(ptr, &tag);
460     switch (tag >> 3) {
461       // optional string name = 1;
462       case 1:
463         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
464           auto str = _internal_mutable_name();
465           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
466           CHK_(ptr);
467         } else {
468           goto handle_unusual;
469         }
470         continue;
471       // optional string value = 2;
472       case 2:
473         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
474           auto str = _internal_mutable_value();
475           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
476           CHK_(ptr);
477         } else {
478           goto handle_unusual;
479         }
480         continue;
481       default:
482         goto handle_unusual;
483     }  // switch
484   handle_unusual:
485     if ((tag == 0) || ((tag & 7) == 4)) {
486       CHK_(ptr);
487       ctx->SetLastTag(tag);
488       goto message_done;
489     }
490     ptr = UnknownFieldParse(
491         tag,
492         _internal_metadata_.mutable_unknown_fields<std::string>(),
493         ptr, ctx);
494     CHK_(ptr != nullptr);
495   }  // while
496 message_done:
497   _impl_._has_bits_.Or(has_bits);
498   return ptr;
499 failure:
500   ptr = nullptr;
501   goto message_done;
502 #undef CHK_
503 }
504 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const505 ::uint8_t* SyncTimelineFtraceEvent::_InternalSerialize(
506     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
507   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.SyncTimelineFtraceEvent)
508   ::uint32_t cached_has_bits = 0;
509   (void) cached_has_bits;
510 
511   cached_has_bits = _impl_._has_bits_[0];
512   // optional string name = 1;
513   if (cached_has_bits & 0x00000001u) {
514     target = stream->WriteStringMaybeAliased(
515         1, this->_internal_name(), target);
516   }
517 
518   // optional string value = 2;
519   if (cached_has_bits & 0x00000002u) {
520     target = stream->WriteStringMaybeAliased(
521         2, this->_internal_value(), target);
522   }
523 
524   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
525     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
526         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
527   }
528   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.SyncTimelineFtraceEvent)
529   return target;
530 }
531 
ByteSizeLong() const532 size_t SyncTimelineFtraceEvent::ByteSizeLong() const {
533 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.SyncTimelineFtraceEvent)
534   size_t total_size = 0;
535 
536   ::uint32_t cached_has_bits = 0;
537   // Prevent compiler warnings about cached_has_bits being unused
538   (void) cached_has_bits;
539 
540   cached_has_bits = _impl_._has_bits_[0];
541   if (cached_has_bits & 0x00000003u) {
542     // optional string name = 1;
543     if (cached_has_bits & 0x00000001u) {
544       total_size += 1 +
545         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
546           this->_internal_name());
547     }
548 
549     // optional string value = 2;
550     if (cached_has_bits & 0x00000002u) {
551       total_size += 1 +
552         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
553           this->_internal_value());
554     }
555 
556   }
557   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
558     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
559   }
560   int cached_size = ::_pbi::ToCachedSize(total_size);
561   SetCachedSize(cached_size);
562   return total_size;
563 }
564 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)565 void SyncTimelineFtraceEvent::CheckTypeAndMergeFrom(
566     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
567   MergeFrom(*::_pbi::DownCast<const SyncTimelineFtraceEvent*>(
568       &from));
569 }
570 
MergeFrom(const SyncTimelineFtraceEvent & from)571 void SyncTimelineFtraceEvent::MergeFrom(const SyncTimelineFtraceEvent& from) {
572   SyncTimelineFtraceEvent* const _this = this;
573   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.SyncTimelineFtraceEvent)
574   GOOGLE_DCHECK_NE(&from, _this);
575   ::uint32_t cached_has_bits = 0;
576   (void) cached_has_bits;
577 
578   cached_has_bits = from._impl_._has_bits_[0];
579   if (cached_has_bits & 0x00000003u) {
580     if (cached_has_bits & 0x00000001u) {
581       _this->_internal_set_name(from._internal_name());
582     }
583     if (cached_has_bits & 0x00000002u) {
584       _this->_internal_set_value(from._internal_value());
585     }
586   }
587   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
588 }
589 
CopyFrom(const SyncTimelineFtraceEvent & from)590 void SyncTimelineFtraceEvent::CopyFrom(const SyncTimelineFtraceEvent& from) {
591 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.SyncTimelineFtraceEvent)
592   if (&from == this) return;
593   Clear();
594   MergeFrom(from);
595 }
596 
IsInitialized() const597 bool SyncTimelineFtraceEvent::IsInitialized() const {
598   return true;
599 }
600 
InternalSwap(SyncTimelineFtraceEvent * other)601 void SyncTimelineFtraceEvent::InternalSwap(SyncTimelineFtraceEvent* other) {
602   using std::swap;
603   auto* lhs_arena = GetArenaForAllocation();
604   auto* rhs_arena = other->GetArenaForAllocation();
605   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
606   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
607   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
608       &_impl_.name_, lhs_arena,
609       &other->_impl_.name_, rhs_arena
610   );
611   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
612       &_impl_.value_, lhs_arena,
613       &other->_impl_.value_, rhs_arena
614   );
615 }
616 
GetTypeName() const617 std::string SyncTimelineFtraceEvent::GetTypeName() const {
618   return "perfetto.protos.SyncTimelineFtraceEvent";
619 }
620 
621 
622 // ===================================================================
623 
624 class SyncWaitFtraceEvent::_Internal {
625  public:
626   using HasBits = decltype(std::declval<SyncWaitFtraceEvent>()._impl_._has_bits_);
set_has_name(HasBits * has_bits)627   static void set_has_name(HasBits* has_bits) {
628     (*has_bits)[0] |= 1u;
629   }
set_has_status(HasBits * has_bits)630   static void set_has_status(HasBits* has_bits) {
631     (*has_bits)[0] |= 2u;
632   }
set_has_begin(HasBits * has_bits)633   static void set_has_begin(HasBits* has_bits) {
634     (*has_bits)[0] |= 4u;
635   }
636 };
637 
SyncWaitFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)638 SyncWaitFtraceEvent::SyncWaitFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
639                          bool is_message_owned)
640   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
641   SharedCtor(arena, is_message_owned);
642   // @@protoc_insertion_point(arena_constructor:perfetto.protos.SyncWaitFtraceEvent)
643 }
SyncWaitFtraceEvent(const SyncWaitFtraceEvent & from)644 SyncWaitFtraceEvent::SyncWaitFtraceEvent(const SyncWaitFtraceEvent& from)
645   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
646   SyncWaitFtraceEvent* const _this = this; (void)_this;
647   new (&_impl_) Impl_{
648       decltype(_impl_._has_bits_){from._impl_._has_bits_}
649     , /*decltype(_impl_._cached_size_)*/{}
650     , decltype(_impl_.name_){}
651     , decltype(_impl_.status_){}
652     , decltype(_impl_.begin_){}};
653 
654   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
655   _impl_.name_.InitDefault();
656   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
657     _impl_.name_.Set("", GetArenaForAllocation());
658   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
659   if (from._internal_has_name()) {
660     _this->_impl_.name_.Set(from._internal_name(),
661       _this->GetArenaForAllocation());
662   }
663   ::memcpy(&_impl_.status_, &from._impl_.status_,
664     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.begin_) -
665     reinterpret_cast<char*>(&_impl_.status_)) + sizeof(_impl_.begin_));
666   // @@protoc_insertion_point(copy_constructor:perfetto.protos.SyncWaitFtraceEvent)
667 }
668 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)669 inline void SyncWaitFtraceEvent::SharedCtor(
670     ::_pb::Arena* arena, bool is_message_owned) {
671   (void)arena;
672   (void)is_message_owned;
673   new (&_impl_) Impl_{
674       decltype(_impl_._has_bits_){}
675     , /*decltype(_impl_._cached_size_)*/{}
676     , decltype(_impl_.name_){}
677     , decltype(_impl_.status_){0}
678     , decltype(_impl_.begin_){0u}
679   };
680   _impl_.name_.InitDefault();
681   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
682     _impl_.name_.Set("", GetArenaForAllocation());
683   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
684 }
685 
~SyncWaitFtraceEvent()686 SyncWaitFtraceEvent::~SyncWaitFtraceEvent() {
687   // @@protoc_insertion_point(destructor:perfetto.protos.SyncWaitFtraceEvent)
688   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
689   (void)arena;
690     return;
691   }
692   SharedDtor();
693 }
694 
SharedDtor()695 inline void SyncWaitFtraceEvent::SharedDtor() {
696   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
697   _impl_.name_.Destroy();
698 }
699 
SetCachedSize(int size) const700 void SyncWaitFtraceEvent::SetCachedSize(int size) const {
701   _impl_._cached_size_.Set(size);
702 }
703 
Clear()704 void SyncWaitFtraceEvent::Clear() {
705 // @@protoc_insertion_point(message_clear_start:perfetto.protos.SyncWaitFtraceEvent)
706   ::uint32_t cached_has_bits = 0;
707   // Prevent compiler warnings about cached_has_bits being unused
708   (void) cached_has_bits;
709 
710   cached_has_bits = _impl_._has_bits_[0];
711   if (cached_has_bits & 0x00000001u) {
712     _impl_.name_.ClearNonDefaultToEmpty();
713   }
714   if (cached_has_bits & 0x00000006u) {
715     ::memset(&_impl_.status_, 0, static_cast<size_t>(
716         reinterpret_cast<char*>(&_impl_.begin_) -
717         reinterpret_cast<char*>(&_impl_.status_)) + sizeof(_impl_.begin_));
718   }
719   _impl_._has_bits_.Clear();
720   _internal_metadata_.Clear<std::string>();
721 }
722 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)723 const char* SyncWaitFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
724 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
725   _Internal::HasBits has_bits{};
726   while (!ctx->Done(&ptr)) {
727     ::uint32_t tag;
728     ptr = ::_pbi::ReadTag(ptr, &tag);
729     switch (tag >> 3) {
730       // optional string name = 1;
731       case 1:
732         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
733           auto str = _internal_mutable_name();
734           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
735           CHK_(ptr);
736         } else {
737           goto handle_unusual;
738         }
739         continue;
740       // optional int32 status = 2;
741       case 2:
742         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
743           _Internal::set_has_status(&has_bits);
744           _impl_.status_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
745           CHK_(ptr);
746         } else {
747           goto handle_unusual;
748         }
749         continue;
750       // optional uint32 begin = 3;
751       case 3:
752         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
753           _Internal::set_has_begin(&has_bits);
754           _impl_.begin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
755           CHK_(ptr);
756         } else {
757           goto handle_unusual;
758         }
759         continue;
760       default:
761         goto handle_unusual;
762     }  // switch
763   handle_unusual:
764     if ((tag == 0) || ((tag & 7) == 4)) {
765       CHK_(ptr);
766       ctx->SetLastTag(tag);
767       goto message_done;
768     }
769     ptr = UnknownFieldParse(
770         tag,
771         _internal_metadata_.mutable_unknown_fields<std::string>(),
772         ptr, ctx);
773     CHK_(ptr != nullptr);
774   }  // while
775 message_done:
776   _impl_._has_bits_.Or(has_bits);
777   return ptr;
778 failure:
779   ptr = nullptr;
780   goto message_done;
781 #undef CHK_
782 }
783 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const784 ::uint8_t* SyncWaitFtraceEvent::_InternalSerialize(
785     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
786   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.SyncWaitFtraceEvent)
787   ::uint32_t cached_has_bits = 0;
788   (void) cached_has_bits;
789 
790   cached_has_bits = _impl_._has_bits_[0];
791   // optional string name = 1;
792   if (cached_has_bits & 0x00000001u) {
793     target = stream->WriteStringMaybeAliased(
794         1, this->_internal_name(), target);
795   }
796 
797   // optional int32 status = 2;
798   if (cached_has_bits & 0x00000002u) {
799     target = stream->EnsureSpace(target);
800     target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_status(), target);
801   }
802 
803   // optional uint32 begin = 3;
804   if (cached_has_bits & 0x00000004u) {
805     target = stream->EnsureSpace(target);
806     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_begin(), target);
807   }
808 
809   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
810     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
811         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
812   }
813   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.SyncWaitFtraceEvent)
814   return target;
815 }
816 
ByteSizeLong() const817 size_t SyncWaitFtraceEvent::ByteSizeLong() const {
818 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.SyncWaitFtraceEvent)
819   size_t total_size = 0;
820 
821   ::uint32_t cached_has_bits = 0;
822   // Prevent compiler warnings about cached_has_bits being unused
823   (void) cached_has_bits;
824 
825   cached_has_bits = _impl_._has_bits_[0];
826   if (cached_has_bits & 0x00000007u) {
827     // optional string name = 1;
828     if (cached_has_bits & 0x00000001u) {
829       total_size += 1 +
830         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
831           this->_internal_name());
832     }
833 
834     // optional int32 status = 2;
835     if (cached_has_bits & 0x00000002u) {
836       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_status());
837     }
838 
839     // optional uint32 begin = 3;
840     if (cached_has_bits & 0x00000004u) {
841       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_begin());
842     }
843 
844   }
845   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
846     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
847   }
848   int cached_size = ::_pbi::ToCachedSize(total_size);
849   SetCachedSize(cached_size);
850   return total_size;
851 }
852 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)853 void SyncWaitFtraceEvent::CheckTypeAndMergeFrom(
854     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
855   MergeFrom(*::_pbi::DownCast<const SyncWaitFtraceEvent*>(
856       &from));
857 }
858 
MergeFrom(const SyncWaitFtraceEvent & from)859 void SyncWaitFtraceEvent::MergeFrom(const SyncWaitFtraceEvent& from) {
860   SyncWaitFtraceEvent* const _this = this;
861   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.SyncWaitFtraceEvent)
862   GOOGLE_DCHECK_NE(&from, _this);
863   ::uint32_t cached_has_bits = 0;
864   (void) cached_has_bits;
865 
866   cached_has_bits = from._impl_._has_bits_[0];
867   if (cached_has_bits & 0x00000007u) {
868     if (cached_has_bits & 0x00000001u) {
869       _this->_internal_set_name(from._internal_name());
870     }
871     if (cached_has_bits & 0x00000002u) {
872       _this->_impl_.status_ = from._impl_.status_;
873     }
874     if (cached_has_bits & 0x00000004u) {
875       _this->_impl_.begin_ = from._impl_.begin_;
876     }
877     _this->_impl_._has_bits_[0] |= cached_has_bits;
878   }
879   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
880 }
881 
CopyFrom(const SyncWaitFtraceEvent & from)882 void SyncWaitFtraceEvent::CopyFrom(const SyncWaitFtraceEvent& from) {
883 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.SyncWaitFtraceEvent)
884   if (&from == this) return;
885   Clear();
886   MergeFrom(from);
887 }
888 
IsInitialized() const889 bool SyncWaitFtraceEvent::IsInitialized() const {
890   return true;
891 }
892 
InternalSwap(SyncWaitFtraceEvent * other)893 void SyncWaitFtraceEvent::InternalSwap(SyncWaitFtraceEvent* other) {
894   using std::swap;
895   auto* lhs_arena = GetArenaForAllocation();
896   auto* rhs_arena = other->GetArenaForAllocation();
897   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
898   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
899   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
900       &_impl_.name_, lhs_arena,
901       &other->_impl_.name_, rhs_arena
902   );
903   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
904       PROTOBUF_FIELD_OFFSET(SyncWaitFtraceEvent, _impl_.begin_)
905       + sizeof(SyncWaitFtraceEvent::_impl_.begin_)  // NOLINT
906       - PROTOBUF_FIELD_OFFSET(SyncWaitFtraceEvent, _impl_.status_)>(
907           reinterpret_cast<char*>(&_impl_.status_),
908           reinterpret_cast<char*>(&other->_impl_.status_));
909 }
910 
GetTypeName() const911 std::string SyncWaitFtraceEvent::GetTypeName() const {
912   return "perfetto.protos.SyncWaitFtraceEvent";
913 }
914 
915 
916 // @@protoc_insertion_point(namespace_scope)
917 }  // namespace protos
918 }  // namespace perfetto
919 PROTOBUF_NAMESPACE_OPEN
920 template<> PROTOBUF_NOINLINE ::perfetto::protos::SyncPtFtraceEvent*
CreateMaybeMessage(Arena * arena)921 Arena::CreateMaybeMessage< ::perfetto::protos::SyncPtFtraceEvent >(Arena* arena) {
922   return Arena::CreateMessageInternal< ::perfetto::protos::SyncPtFtraceEvent >(arena);
923 }
924 template<> PROTOBUF_NOINLINE ::perfetto::protos::SyncTimelineFtraceEvent*
CreateMaybeMessage(Arena * arena)925 Arena::CreateMaybeMessage< ::perfetto::protos::SyncTimelineFtraceEvent >(Arena* arena) {
926   return Arena::CreateMessageInternal< ::perfetto::protos::SyncTimelineFtraceEvent >(arena);
927 }
928 template<> PROTOBUF_NOINLINE ::perfetto::protos::SyncWaitFtraceEvent*
CreateMaybeMessage(Arena * arena)929 Arena::CreateMaybeMessage< ::perfetto::protos::SyncWaitFtraceEvent >(Arena* arena) {
930   return Arena::CreateMessageInternal< ::perfetto::protos::SyncWaitFtraceEvent >(arena);
931 }
932 PROTOBUF_NAMESPACE_CLOSE
933 
934 // @@protoc_insertion_point(global_scope)
935 #include <google/protobuf/port_undef.inc>
936