1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/systrace.proto
3 
4 #include "protos/perfetto/trace/ftrace/systrace.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 {
ZeroFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ZeroFtraceEvent::ZeroFtraceEvent(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28   , /*decltype(_impl_.flag_)*/0
29   , /*decltype(_impl_.pid_)*/0
30   , /*decltype(_impl_.value_)*/::int64_t{0}} {}
31 struct ZeroFtraceEventDefaultTypeInternal {
ZeroFtraceEventDefaultTypeInternalperfetto::protos::ZeroFtraceEventDefaultTypeInternal32   PROTOBUF_CONSTEXPR ZeroFtraceEventDefaultTypeInternal()
33       : _instance(::_pbi::ConstantInitialized{}) {}
~ZeroFtraceEventDefaultTypeInternalperfetto::protos::ZeroFtraceEventDefaultTypeInternal34   ~ZeroFtraceEventDefaultTypeInternal() {}
35   union {  // NOLINT(misc-non-private-member-variables-in-classes)
36     ZeroFtraceEvent _instance;
37   };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ZeroFtraceEventDefaultTypeInternal _ZeroFtraceEvent_default_instance_;
40 }  // namespace protos
41 }  // namespace perfetto
42 namespace perfetto {
43 namespace protos {
44 
45 // ===================================================================
46 
47 class ZeroFtraceEvent::_Internal {
48  public:
49   using HasBits = decltype(std::declval<ZeroFtraceEvent>()._impl_._has_bits_);
set_has_flag(HasBits * has_bits)50   static void set_has_flag(HasBits* has_bits) {
51     (*has_bits)[0] |= 2u;
52   }
set_has_name(HasBits * has_bits)53   static void set_has_name(HasBits* has_bits) {
54     (*has_bits)[0] |= 1u;
55   }
set_has_pid(HasBits * has_bits)56   static void set_has_pid(HasBits* has_bits) {
57     (*has_bits)[0] |= 4u;
58   }
set_has_value(HasBits * has_bits)59   static void set_has_value(HasBits* has_bits) {
60     (*has_bits)[0] |= 8u;
61   }
62 };
63 
ZeroFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)64 ZeroFtraceEvent::ZeroFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
65                          bool is_message_owned)
66   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
67   SharedCtor(arena, is_message_owned);
68   // @@protoc_insertion_point(arena_constructor:perfetto.protos.ZeroFtraceEvent)
69 }
ZeroFtraceEvent(const ZeroFtraceEvent & from)70 ZeroFtraceEvent::ZeroFtraceEvent(const ZeroFtraceEvent& from)
71   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
72   ZeroFtraceEvent* const _this = this; (void)_this;
73   new (&_impl_) Impl_{
74       decltype(_impl_._has_bits_){from._impl_._has_bits_}
75     , /*decltype(_impl_._cached_size_)*/{}
76     , decltype(_impl_.name_){}
77     , decltype(_impl_.flag_){}
78     , decltype(_impl_.pid_){}
79     , decltype(_impl_.value_){}};
80 
81   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
82   _impl_.name_.InitDefault();
83   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
84     _impl_.name_.Set("", GetArenaForAllocation());
85   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
86   if (from._internal_has_name()) {
87     _this->_impl_.name_.Set(from._internal_name(),
88       _this->GetArenaForAllocation());
89   }
90   ::memcpy(&_impl_.flag_, &from._impl_.flag_,
91     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.value_) -
92     reinterpret_cast<char*>(&_impl_.flag_)) + sizeof(_impl_.value_));
93   // @@protoc_insertion_point(copy_constructor:perfetto.protos.ZeroFtraceEvent)
94 }
95 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)96 inline void ZeroFtraceEvent::SharedCtor(
97     ::_pb::Arena* arena, bool is_message_owned) {
98   (void)arena;
99   (void)is_message_owned;
100   new (&_impl_) Impl_{
101       decltype(_impl_._has_bits_){}
102     , /*decltype(_impl_._cached_size_)*/{}
103     , decltype(_impl_.name_){}
104     , decltype(_impl_.flag_){0}
105     , decltype(_impl_.pid_){0}
106     , decltype(_impl_.value_){::int64_t{0}}
107   };
108   _impl_.name_.InitDefault();
109   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
110     _impl_.name_.Set("", GetArenaForAllocation());
111   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
112 }
113 
~ZeroFtraceEvent()114 ZeroFtraceEvent::~ZeroFtraceEvent() {
115   // @@protoc_insertion_point(destructor:perfetto.protos.ZeroFtraceEvent)
116   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
117   (void)arena;
118     return;
119   }
120   SharedDtor();
121 }
122 
SharedDtor()123 inline void ZeroFtraceEvent::SharedDtor() {
124   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
125   _impl_.name_.Destroy();
126 }
127 
SetCachedSize(int size) const128 void ZeroFtraceEvent::SetCachedSize(int size) const {
129   _impl_._cached_size_.Set(size);
130 }
131 
Clear()132 void ZeroFtraceEvent::Clear() {
133 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ZeroFtraceEvent)
134   ::uint32_t cached_has_bits = 0;
135   // Prevent compiler warnings about cached_has_bits being unused
136   (void) cached_has_bits;
137 
138   cached_has_bits = _impl_._has_bits_[0];
139   if (cached_has_bits & 0x00000001u) {
140     _impl_.name_.ClearNonDefaultToEmpty();
141   }
142   if (cached_has_bits & 0x0000000eu) {
143     ::memset(&_impl_.flag_, 0, static_cast<size_t>(
144         reinterpret_cast<char*>(&_impl_.value_) -
145         reinterpret_cast<char*>(&_impl_.flag_)) + sizeof(_impl_.value_));
146   }
147   _impl_._has_bits_.Clear();
148   _internal_metadata_.Clear<std::string>();
149 }
150 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)151 const char* ZeroFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
152 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
153   _Internal::HasBits has_bits{};
154   while (!ctx->Done(&ptr)) {
155     ::uint32_t tag;
156     ptr = ::_pbi::ReadTag(ptr, &tag);
157     switch (tag >> 3) {
158       // optional int32 flag = 1;
159       case 1:
160         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
161           _Internal::set_has_flag(&has_bits);
162           _impl_.flag_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
163           CHK_(ptr);
164         } else {
165           goto handle_unusual;
166         }
167         continue;
168       // optional string name = 2;
169       case 2:
170         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
171           auto str = _internal_mutable_name();
172           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
173           CHK_(ptr);
174         } else {
175           goto handle_unusual;
176         }
177         continue;
178       // optional int32 pid = 3;
179       case 3:
180         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
181           _Internal::set_has_pid(&has_bits);
182           _impl_.pid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
183           CHK_(ptr);
184         } else {
185           goto handle_unusual;
186         }
187         continue;
188       // optional int64 value = 4;
189       case 4:
190         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
191           _Internal::set_has_value(&has_bits);
192           _impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
193           CHK_(ptr);
194         } else {
195           goto handle_unusual;
196         }
197         continue;
198       default:
199         goto handle_unusual;
200     }  // switch
201   handle_unusual:
202     if ((tag == 0) || ((tag & 7) == 4)) {
203       CHK_(ptr);
204       ctx->SetLastTag(tag);
205       goto message_done;
206     }
207     ptr = UnknownFieldParse(
208         tag,
209         _internal_metadata_.mutable_unknown_fields<std::string>(),
210         ptr, ctx);
211     CHK_(ptr != nullptr);
212   }  // while
213 message_done:
214   _impl_._has_bits_.Or(has_bits);
215   return ptr;
216 failure:
217   ptr = nullptr;
218   goto message_done;
219 #undef CHK_
220 }
221 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const222 ::uint8_t* ZeroFtraceEvent::_InternalSerialize(
223     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
224   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ZeroFtraceEvent)
225   ::uint32_t cached_has_bits = 0;
226   (void) cached_has_bits;
227 
228   cached_has_bits = _impl_._has_bits_[0];
229   // optional int32 flag = 1;
230   if (cached_has_bits & 0x00000002u) {
231     target = stream->EnsureSpace(target);
232     target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_flag(), target);
233   }
234 
235   // optional string name = 2;
236   if (cached_has_bits & 0x00000001u) {
237     target = stream->WriteStringMaybeAliased(
238         2, this->_internal_name(), target);
239   }
240 
241   // optional int32 pid = 3;
242   if (cached_has_bits & 0x00000004u) {
243     target = stream->EnsureSpace(target);
244     target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_pid(), target);
245   }
246 
247   // optional int64 value = 4;
248   if (cached_has_bits & 0x00000008u) {
249     target = stream->EnsureSpace(target);
250     target = ::_pbi::WireFormatLite::WriteInt64ToArray(4, this->_internal_value(), target);
251   }
252 
253   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
254     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
255         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
256   }
257   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ZeroFtraceEvent)
258   return target;
259 }
260 
ByteSizeLong() const261 size_t ZeroFtraceEvent::ByteSizeLong() const {
262 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ZeroFtraceEvent)
263   size_t total_size = 0;
264 
265   ::uint32_t cached_has_bits = 0;
266   // Prevent compiler warnings about cached_has_bits being unused
267   (void) cached_has_bits;
268 
269   cached_has_bits = _impl_._has_bits_[0];
270   if (cached_has_bits & 0x0000000fu) {
271     // optional string name = 2;
272     if (cached_has_bits & 0x00000001u) {
273       total_size += 1 +
274         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
275           this->_internal_name());
276     }
277 
278     // optional int32 flag = 1;
279     if (cached_has_bits & 0x00000002u) {
280       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_flag());
281     }
282 
283     // optional int32 pid = 3;
284     if (cached_has_bits & 0x00000004u) {
285       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pid());
286     }
287 
288     // optional int64 value = 4;
289     if (cached_has_bits & 0x00000008u) {
290       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_value());
291     }
292 
293   }
294   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
295     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
296   }
297   int cached_size = ::_pbi::ToCachedSize(total_size);
298   SetCachedSize(cached_size);
299   return total_size;
300 }
301 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)302 void ZeroFtraceEvent::CheckTypeAndMergeFrom(
303     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
304   MergeFrom(*::_pbi::DownCast<const ZeroFtraceEvent*>(
305       &from));
306 }
307 
MergeFrom(const ZeroFtraceEvent & from)308 void ZeroFtraceEvent::MergeFrom(const ZeroFtraceEvent& from) {
309   ZeroFtraceEvent* const _this = this;
310   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ZeroFtraceEvent)
311   GOOGLE_DCHECK_NE(&from, _this);
312   ::uint32_t cached_has_bits = 0;
313   (void) cached_has_bits;
314 
315   cached_has_bits = from._impl_._has_bits_[0];
316   if (cached_has_bits & 0x0000000fu) {
317     if (cached_has_bits & 0x00000001u) {
318       _this->_internal_set_name(from._internal_name());
319     }
320     if (cached_has_bits & 0x00000002u) {
321       _this->_impl_.flag_ = from._impl_.flag_;
322     }
323     if (cached_has_bits & 0x00000004u) {
324       _this->_impl_.pid_ = from._impl_.pid_;
325     }
326     if (cached_has_bits & 0x00000008u) {
327       _this->_impl_.value_ = from._impl_.value_;
328     }
329     _this->_impl_._has_bits_[0] |= cached_has_bits;
330   }
331   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
332 }
333 
CopyFrom(const ZeroFtraceEvent & from)334 void ZeroFtraceEvent::CopyFrom(const ZeroFtraceEvent& from) {
335 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ZeroFtraceEvent)
336   if (&from == this) return;
337   Clear();
338   MergeFrom(from);
339 }
340 
IsInitialized() const341 bool ZeroFtraceEvent::IsInitialized() const {
342   return true;
343 }
344 
InternalSwap(ZeroFtraceEvent * other)345 void ZeroFtraceEvent::InternalSwap(ZeroFtraceEvent* other) {
346   using std::swap;
347   auto* lhs_arena = GetArenaForAllocation();
348   auto* rhs_arena = other->GetArenaForAllocation();
349   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
350   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
351   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
352       &_impl_.name_, lhs_arena,
353       &other->_impl_.name_, rhs_arena
354   );
355   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
356       PROTOBUF_FIELD_OFFSET(ZeroFtraceEvent, _impl_.value_)
357       + sizeof(ZeroFtraceEvent::_impl_.value_)  // NOLINT
358       - PROTOBUF_FIELD_OFFSET(ZeroFtraceEvent, _impl_.flag_)>(
359           reinterpret_cast<char*>(&_impl_.flag_),
360           reinterpret_cast<char*>(&other->_impl_.flag_));
361 }
362 
GetTypeName() const363 std::string ZeroFtraceEvent::GetTypeName() const {
364   return "perfetto.protos.ZeroFtraceEvent";
365 }
366 
367 
368 // @@protoc_insertion_point(namespace_scope)
369 }  // namespace protos
370 }  // namespace perfetto
371 PROTOBUF_NAMESPACE_OPEN
372 template<> PROTOBUF_NOINLINE ::perfetto::protos::ZeroFtraceEvent*
CreateMaybeMessage(Arena * arena)373 Arena::CreateMaybeMessage< ::perfetto::protos::ZeroFtraceEvent >(Arena* arena) {
374   return Arena::CreateMessageInternal< ::perfetto::protos::ZeroFtraceEvent >(arena);
375 }
376 PROTOBUF_NAMESPACE_CLOSE
377 
378 // @@protoc_insertion_point(global_scope)
379 #include <google/protobuf/port_undef.inc>
380