1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/thermal.proto
3
4 #include "protos/perfetto/trace/ftrace/thermal.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 {
ThermalTemperatureFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ThermalTemperatureFtraceEvent::ThermalTemperatureFtraceEvent(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.thermal_zone_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.id_)*/0
29 , /*decltype(_impl_.temp_)*/0
30 , /*decltype(_impl_.temp_prev_)*/0} {}
31 struct ThermalTemperatureFtraceEventDefaultTypeInternal {
ThermalTemperatureFtraceEventDefaultTypeInternalperfetto::protos::ThermalTemperatureFtraceEventDefaultTypeInternal32 PROTOBUF_CONSTEXPR ThermalTemperatureFtraceEventDefaultTypeInternal()
33 : _instance(::_pbi::ConstantInitialized{}) {}
~ThermalTemperatureFtraceEventDefaultTypeInternalperfetto::protos::ThermalTemperatureFtraceEventDefaultTypeInternal34 ~ThermalTemperatureFtraceEventDefaultTypeInternal() {}
35 union { // NOLINT(misc-non-private-member-variables-in-classes)
36 ThermalTemperatureFtraceEvent _instance;
37 };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ThermalTemperatureFtraceEventDefaultTypeInternal _ThermalTemperatureFtraceEvent_default_instance_;
CdevUpdateFtraceEvent(::_pbi::ConstantInitialized)40 PROTOBUF_CONSTEXPR CdevUpdateFtraceEvent::CdevUpdateFtraceEvent(
41 ::_pbi::ConstantInitialized): _impl_{
42 /*decltype(_impl_._has_bits_)*/{}
43 , /*decltype(_impl_._cached_size_)*/{}
44 , /*decltype(_impl_.type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
45 , /*decltype(_impl_.target_)*/::uint64_t{0u}} {}
46 struct CdevUpdateFtraceEventDefaultTypeInternal {
CdevUpdateFtraceEventDefaultTypeInternalperfetto::protos::CdevUpdateFtraceEventDefaultTypeInternal47 PROTOBUF_CONSTEXPR CdevUpdateFtraceEventDefaultTypeInternal()
48 : _instance(::_pbi::ConstantInitialized{}) {}
~CdevUpdateFtraceEventDefaultTypeInternalperfetto::protos::CdevUpdateFtraceEventDefaultTypeInternal49 ~CdevUpdateFtraceEventDefaultTypeInternal() {}
50 union { // NOLINT(misc-non-private-member-variables-in-classes)
51 CdevUpdateFtraceEvent _instance;
52 };
53 };
54 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CdevUpdateFtraceEventDefaultTypeInternal _CdevUpdateFtraceEvent_default_instance_;
55 } // namespace protos
56 } // namespace perfetto
57 namespace perfetto {
58 namespace protos {
59
60 // ===================================================================
61
62 class ThermalTemperatureFtraceEvent::_Internal {
63 public:
64 using HasBits = decltype(std::declval<ThermalTemperatureFtraceEvent>()._impl_._has_bits_);
set_has_id(HasBits * has_bits)65 static void set_has_id(HasBits* has_bits) {
66 (*has_bits)[0] |= 2u;
67 }
set_has_temp(HasBits * has_bits)68 static void set_has_temp(HasBits* has_bits) {
69 (*has_bits)[0] |= 4u;
70 }
set_has_temp_prev(HasBits * has_bits)71 static void set_has_temp_prev(HasBits* has_bits) {
72 (*has_bits)[0] |= 8u;
73 }
set_has_thermal_zone(HasBits * has_bits)74 static void set_has_thermal_zone(HasBits* has_bits) {
75 (*has_bits)[0] |= 1u;
76 }
77 };
78
ThermalTemperatureFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)79 ThermalTemperatureFtraceEvent::ThermalTemperatureFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
80 bool is_message_owned)
81 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
82 SharedCtor(arena, is_message_owned);
83 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ThermalTemperatureFtraceEvent)
84 }
ThermalTemperatureFtraceEvent(const ThermalTemperatureFtraceEvent & from)85 ThermalTemperatureFtraceEvent::ThermalTemperatureFtraceEvent(const ThermalTemperatureFtraceEvent& from)
86 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
87 ThermalTemperatureFtraceEvent* const _this = this; (void)_this;
88 new (&_impl_) Impl_{
89 decltype(_impl_._has_bits_){from._impl_._has_bits_}
90 , /*decltype(_impl_._cached_size_)*/{}
91 , decltype(_impl_.thermal_zone_){}
92 , decltype(_impl_.id_){}
93 , decltype(_impl_.temp_){}
94 , decltype(_impl_.temp_prev_){}};
95
96 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
97 _impl_.thermal_zone_.InitDefault();
98 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
99 _impl_.thermal_zone_.Set("", GetArenaForAllocation());
100 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
101 if (from._internal_has_thermal_zone()) {
102 _this->_impl_.thermal_zone_.Set(from._internal_thermal_zone(),
103 _this->GetArenaForAllocation());
104 }
105 ::memcpy(&_impl_.id_, &from._impl_.id_,
106 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.temp_prev_) -
107 reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.temp_prev_));
108 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ThermalTemperatureFtraceEvent)
109 }
110
SharedCtor(::_pb::Arena * arena,bool is_message_owned)111 inline void ThermalTemperatureFtraceEvent::SharedCtor(
112 ::_pb::Arena* arena, bool is_message_owned) {
113 (void)arena;
114 (void)is_message_owned;
115 new (&_impl_) Impl_{
116 decltype(_impl_._has_bits_){}
117 , /*decltype(_impl_._cached_size_)*/{}
118 , decltype(_impl_.thermal_zone_){}
119 , decltype(_impl_.id_){0}
120 , decltype(_impl_.temp_){0}
121 , decltype(_impl_.temp_prev_){0}
122 };
123 _impl_.thermal_zone_.InitDefault();
124 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
125 _impl_.thermal_zone_.Set("", GetArenaForAllocation());
126 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
127 }
128
~ThermalTemperatureFtraceEvent()129 ThermalTemperatureFtraceEvent::~ThermalTemperatureFtraceEvent() {
130 // @@protoc_insertion_point(destructor:perfetto.protos.ThermalTemperatureFtraceEvent)
131 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
132 (void)arena;
133 return;
134 }
135 SharedDtor();
136 }
137
SharedDtor()138 inline void ThermalTemperatureFtraceEvent::SharedDtor() {
139 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
140 _impl_.thermal_zone_.Destroy();
141 }
142
SetCachedSize(int size) const143 void ThermalTemperatureFtraceEvent::SetCachedSize(int size) const {
144 _impl_._cached_size_.Set(size);
145 }
146
Clear()147 void ThermalTemperatureFtraceEvent::Clear() {
148 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ThermalTemperatureFtraceEvent)
149 ::uint32_t cached_has_bits = 0;
150 // Prevent compiler warnings about cached_has_bits being unused
151 (void) cached_has_bits;
152
153 cached_has_bits = _impl_._has_bits_[0];
154 if (cached_has_bits & 0x00000001u) {
155 _impl_.thermal_zone_.ClearNonDefaultToEmpty();
156 }
157 if (cached_has_bits & 0x0000000eu) {
158 ::memset(&_impl_.id_, 0, static_cast<size_t>(
159 reinterpret_cast<char*>(&_impl_.temp_prev_) -
160 reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.temp_prev_));
161 }
162 _impl_._has_bits_.Clear();
163 _internal_metadata_.Clear<std::string>();
164 }
165
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)166 const char* ThermalTemperatureFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
167 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
168 _Internal::HasBits has_bits{};
169 while (!ctx->Done(&ptr)) {
170 ::uint32_t tag;
171 ptr = ::_pbi::ReadTag(ptr, &tag);
172 switch (tag >> 3) {
173 // optional int32 id = 1;
174 case 1:
175 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
176 _Internal::set_has_id(&has_bits);
177 _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
178 CHK_(ptr);
179 } else {
180 goto handle_unusual;
181 }
182 continue;
183 // optional int32 temp = 2;
184 case 2:
185 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
186 _Internal::set_has_temp(&has_bits);
187 _impl_.temp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
188 CHK_(ptr);
189 } else {
190 goto handle_unusual;
191 }
192 continue;
193 // optional int32 temp_prev = 3;
194 case 3:
195 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
196 _Internal::set_has_temp_prev(&has_bits);
197 _impl_.temp_prev_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
198 CHK_(ptr);
199 } else {
200 goto handle_unusual;
201 }
202 continue;
203 // optional string thermal_zone = 4;
204 case 4:
205 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
206 auto str = _internal_mutable_thermal_zone();
207 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
208 CHK_(ptr);
209 } else {
210 goto handle_unusual;
211 }
212 continue;
213 default:
214 goto handle_unusual;
215 } // switch
216 handle_unusual:
217 if ((tag == 0) || ((tag & 7) == 4)) {
218 CHK_(ptr);
219 ctx->SetLastTag(tag);
220 goto message_done;
221 }
222 ptr = UnknownFieldParse(
223 tag,
224 _internal_metadata_.mutable_unknown_fields<std::string>(),
225 ptr, ctx);
226 CHK_(ptr != nullptr);
227 } // while
228 message_done:
229 _impl_._has_bits_.Or(has_bits);
230 return ptr;
231 failure:
232 ptr = nullptr;
233 goto message_done;
234 #undef CHK_
235 }
236
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const237 ::uint8_t* ThermalTemperatureFtraceEvent::_InternalSerialize(
238 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
239 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ThermalTemperatureFtraceEvent)
240 ::uint32_t cached_has_bits = 0;
241 (void) cached_has_bits;
242
243 cached_has_bits = _impl_._has_bits_[0];
244 // optional int32 id = 1;
245 if (cached_has_bits & 0x00000002u) {
246 target = stream->EnsureSpace(target);
247 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_id(), target);
248 }
249
250 // optional int32 temp = 2;
251 if (cached_has_bits & 0x00000004u) {
252 target = stream->EnsureSpace(target);
253 target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_temp(), target);
254 }
255
256 // optional int32 temp_prev = 3;
257 if (cached_has_bits & 0x00000008u) {
258 target = stream->EnsureSpace(target);
259 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_temp_prev(), target);
260 }
261
262 // optional string thermal_zone = 4;
263 if (cached_has_bits & 0x00000001u) {
264 target = stream->WriteStringMaybeAliased(
265 4, this->_internal_thermal_zone(), target);
266 }
267
268 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
269 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
270 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
271 }
272 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ThermalTemperatureFtraceEvent)
273 return target;
274 }
275
ByteSizeLong() const276 size_t ThermalTemperatureFtraceEvent::ByteSizeLong() const {
277 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ThermalTemperatureFtraceEvent)
278 size_t total_size = 0;
279
280 ::uint32_t cached_has_bits = 0;
281 // Prevent compiler warnings about cached_has_bits being unused
282 (void) cached_has_bits;
283
284 cached_has_bits = _impl_._has_bits_[0];
285 if (cached_has_bits & 0x0000000fu) {
286 // optional string thermal_zone = 4;
287 if (cached_has_bits & 0x00000001u) {
288 total_size += 1 +
289 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
290 this->_internal_thermal_zone());
291 }
292
293 // optional int32 id = 1;
294 if (cached_has_bits & 0x00000002u) {
295 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_id());
296 }
297
298 // optional int32 temp = 2;
299 if (cached_has_bits & 0x00000004u) {
300 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_temp());
301 }
302
303 // optional int32 temp_prev = 3;
304 if (cached_has_bits & 0x00000008u) {
305 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_temp_prev());
306 }
307
308 }
309 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
310 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
311 }
312 int cached_size = ::_pbi::ToCachedSize(total_size);
313 SetCachedSize(cached_size);
314 return total_size;
315 }
316
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)317 void ThermalTemperatureFtraceEvent::CheckTypeAndMergeFrom(
318 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
319 MergeFrom(*::_pbi::DownCast<const ThermalTemperatureFtraceEvent*>(
320 &from));
321 }
322
MergeFrom(const ThermalTemperatureFtraceEvent & from)323 void ThermalTemperatureFtraceEvent::MergeFrom(const ThermalTemperatureFtraceEvent& from) {
324 ThermalTemperatureFtraceEvent* const _this = this;
325 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ThermalTemperatureFtraceEvent)
326 GOOGLE_DCHECK_NE(&from, _this);
327 ::uint32_t cached_has_bits = 0;
328 (void) cached_has_bits;
329
330 cached_has_bits = from._impl_._has_bits_[0];
331 if (cached_has_bits & 0x0000000fu) {
332 if (cached_has_bits & 0x00000001u) {
333 _this->_internal_set_thermal_zone(from._internal_thermal_zone());
334 }
335 if (cached_has_bits & 0x00000002u) {
336 _this->_impl_.id_ = from._impl_.id_;
337 }
338 if (cached_has_bits & 0x00000004u) {
339 _this->_impl_.temp_ = from._impl_.temp_;
340 }
341 if (cached_has_bits & 0x00000008u) {
342 _this->_impl_.temp_prev_ = from._impl_.temp_prev_;
343 }
344 _this->_impl_._has_bits_[0] |= cached_has_bits;
345 }
346 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
347 }
348
CopyFrom(const ThermalTemperatureFtraceEvent & from)349 void ThermalTemperatureFtraceEvent::CopyFrom(const ThermalTemperatureFtraceEvent& from) {
350 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ThermalTemperatureFtraceEvent)
351 if (&from == this) return;
352 Clear();
353 MergeFrom(from);
354 }
355
IsInitialized() const356 bool ThermalTemperatureFtraceEvent::IsInitialized() const {
357 return true;
358 }
359
InternalSwap(ThermalTemperatureFtraceEvent * other)360 void ThermalTemperatureFtraceEvent::InternalSwap(ThermalTemperatureFtraceEvent* other) {
361 using std::swap;
362 auto* lhs_arena = GetArenaForAllocation();
363 auto* rhs_arena = other->GetArenaForAllocation();
364 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
365 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
366 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
367 &_impl_.thermal_zone_, lhs_arena,
368 &other->_impl_.thermal_zone_, rhs_arena
369 );
370 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
371 PROTOBUF_FIELD_OFFSET(ThermalTemperatureFtraceEvent, _impl_.temp_prev_)
372 + sizeof(ThermalTemperatureFtraceEvent::_impl_.temp_prev_) // NOLINT
373 - PROTOBUF_FIELD_OFFSET(ThermalTemperatureFtraceEvent, _impl_.id_)>(
374 reinterpret_cast<char*>(&_impl_.id_),
375 reinterpret_cast<char*>(&other->_impl_.id_));
376 }
377
GetTypeName() const378 std::string ThermalTemperatureFtraceEvent::GetTypeName() const {
379 return "perfetto.protos.ThermalTemperatureFtraceEvent";
380 }
381
382
383 // ===================================================================
384
385 class CdevUpdateFtraceEvent::_Internal {
386 public:
387 using HasBits = decltype(std::declval<CdevUpdateFtraceEvent>()._impl_._has_bits_);
set_has_target(HasBits * has_bits)388 static void set_has_target(HasBits* has_bits) {
389 (*has_bits)[0] |= 2u;
390 }
set_has_type(HasBits * has_bits)391 static void set_has_type(HasBits* has_bits) {
392 (*has_bits)[0] |= 1u;
393 }
394 };
395
CdevUpdateFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)396 CdevUpdateFtraceEvent::CdevUpdateFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
397 bool is_message_owned)
398 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
399 SharedCtor(arena, is_message_owned);
400 // @@protoc_insertion_point(arena_constructor:perfetto.protos.CdevUpdateFtraceEvent)
401 }
CdevUpdateFtraceEvent(const CdevUpdateFtraceEvent & from)402 CdevUpdateFtraceEvent::CdevUpdateFtraceEvent(const CdevUpdateFtraceEvent& from)
403 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
404 CdevUpdateFtraceEvent* const _this = this; (void)_this;
405 new (&_impl_) Impl_{
406 decltype(_impl_._has_bits_){from._impl_._has_bits_}
407 , /*decltype(_impl_._cached_size_)*/{}
408 , decltype(_impl_.type_){}
409 , decltype(_impl_.target_){}};
410
411 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
412 _impl_.type_.InitDefault();
413 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
414 _impl_.type_.Set("", GetArenaForAllocation());
415 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
416 if (from._internal_has_type()) {
417 _this->_impl_.type_.Set(from._internal_type(),
418 _this->GetArenaForAllocation());
419 }
420 _this->_impl_.target_ = from._impl_.target_;
421 // @@protoc_insertion_point(copy_constructor:perfetto.protos.CdevUpdateFtraceEvent)
422 }
423
SharedCtor(::_pb::Arena * arena,bool is_message_owned)424 inline void CdevUpdateFtraceEvent::SharedCtor(
425 ::_pb::Arena* arena, bool is_message_owned) {
426 (void)arena;
427 (void)is_message_owned;
428 new (&_impl_) Impl_{
429 decltype(_impl_._has_bits_){}
430 , /*decltype(_impl_._cached_size_)*/{}
431 , decltype(_impl_.type_){}
432 , decltype(_impl_.target_){::uint64_t{0u}}
433 };
434 _impl_.type_.InitDefault();
435 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
436 _impl_.type_.Set("", GetArenaForAllocation());
437 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
438 }
439
~CdevUpdateFtraceEvent()440 CdevUpdateFtraceEvent::~CdevUpdateFtraceEvent() {
441 // @@protoc_insertion_point(destructor:perfetto.protos.CdevUpdateFtraceEvent)
442 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
443 (void)arena;
444 return;
445 }
446 SharedDtor();
447 }
448
SharedDtor()449 inline void CdevUpdateFtraceEvent::SharedDtor() {
450 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
451 _impl_.type_.Destroy();
452 }
453
SetCachedSize(int size) const454 void CdevUpdateFtraceEvent::SetCachedSize(int size) const {
455 _impl_._cached_size_.Set(size);
456 }
457
Clear()458 void CdevUpdateFtraceEvent::Clear() {
459 // @@protoc_insertion_point(message_clear_start:perfetto.protos.CdevUpdateFtraceEvent)
460 ::uint32_t cached_has_bits = 0;
461 // Prevent compiler warnings about cached_has_bits being unused
462 (void) cached_has_bits;
463
464 cached_has_bits = _impl_._has_bits_[0];
465 if (cached_has_bits & 0x00000001u) {
466 _impl_.type_.ClearNonDefaultToEmpty();
467 }
468 _impl_.target_ = ::uint64_t{0u};
469 _impl_._has_bits_.Clear();
470 _internal_metadata_.Clear<std::string>();
471 }
472
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)473 const char* CdevUpdateFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
474 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
475 _Internal::HasBits has_bits{};
476 while (!ctx->Done(&ptr)) {
477 ::uint32_t tag;
478 ptr = ::_pbi::ReadTag(ptr, &tag);
479 switch (tag >> 3) {
480 // optional uint64 target = 1;
481 case 1:
482 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
483 _Internal::set_has_target(&has_bits);
484 _impl_.target_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
485 CHK_(ptr);
486 } else {
487 goto handle_unusual;
488 }
489 continue;
490 // optional string type = 2;
491 case 2:
492 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
493 auto str = _internal_mutable_type();
494 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
495 CHK_(ptr);
496 } else {
497 goto handle_unusual;
498 }
499 continue;
500 default:
501 goto handle_unusual;
502 } // switch
503 handle_unusual:
504 if ((tag == 0) || ((tag & 7) == 4)) {
505 CHK_(ptr);
506 ctx->SetLastTag(tag);
507 goto message_done;
508 }
509 ptr = UnknownFieldParse(
510 tag,
511 _internal_metadata_.mutable_unknown_fields<std::string>(),
512 ptr, ctx);
513 CHK_(ptr != nullptr);
514 } // while
515 message_done:
516 _impl_._has_bits_.Or(has_bits);
517 return ptr;
518 failure:
519 ptr = nullptr;
520 goto message_done;
521 #undef CHK_
522 }
523
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const524 ::uint8_t* CdevUpdateFtraceEvent::_InternalSerialize(
525 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
526 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.CdevUpdateFtraceEvent)
527 ::uint32_t cached_has_bits = 0;
528 (void) cached_has_bits;
529
530 cached_has_bits = _impl_._has_bits_[0];
531 // optional uint64 target = 1;
532 if (cached_has_bits & 0x00000002u) {
533 target = stream->EnsureSpace(target);
534 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_target(), target);
535 }
536
537 // optional string type = 2;
538 if (cached_has_bits & 0x00000001u) {
539 target = stream->WriteStringMaybeAliased(
540 2, this->_internal_type(), target);
541 }
542
543 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
544 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
545 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
546 }
547 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.CdevUpdateFtraceEvent)
548 return target;
549 }
550
ByteSizeLong() const551 size_t CdevUpdateFtraceEvent::ByteSizeLong() const {
552 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.CdevUpdateFtraceEvent)
553 size_t total_size = 0;
554
555 ::uint32_t cached_has_bits = 0;
556 // Prevent compiler warnings about cached_has_bits being unused
557 (void) cached_has_bits;
558
559 cached_has_bits = _impl_._has_bits_[0];
560 if (cached_has_bits & 0x00000003u) {
561 // optional string type = 2;
562 if (cached_has_bits & 0x00000001u) {
563 total_size += 1 +
564 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
565 this->_internal_type());
566 }
567
568 // optional uint64 target = 1;
569 if (cached_has_bits & 0x00000002u) {
570 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_target());
571 }
572
573 }
574 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
575 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
576 }
577 int cached_size = ::_pbi::ToCachedSize(total_size);
578 SetCachedSize(cached_size);
579 return total_size;
580 }
581
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)582 void CdevUpdateFtraceEvent::CheckTypeAndMergeFrom(
583 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
584 MergeFrom(*::_pbi::DownCast<const CdevUpdateFtraceEvent*>(
585 &from));
586 }
587
MergeFrom(const CdevUpdateFtraceEvent & from)588 void CdevUpdateFtraceEvent::MergeFrom(const CdevUpdateFtraceEvent& from) {
589 CdevUpdateFtraceEvent* const _this = this;
590 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.CdevUpdateFtraceEvent)
591 GOOGLE_DCHECK_NE(&from, _this);
592 ::uint32_t cached_has_bits = 0;
593 (void) cached_has_bits;
594
595 cached_has_bits = from._impl_._has_bits_[0];
596 if (cached_has_bits & 0x00000003u) {
597 if (cached_has_bits & 0x00000001u) {
598 _this->_internal_set_type(from._internal_type());
599 }
600 if (cached_has_bits & 0x00000002u) {
601 _this->_impl_.target_ = from._impl_.target_;
602 }
603 _this->_impl_._has_bits_[0] |= cached_has_bits;
604 }
605 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
606 }
607
CopyFrom(const CdevUpdateFtraceEvent & from)608 void CdevUpdateFtraceEvent::CopyFrom(const CdevUpdateFtraceEvent& from) {
609 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.CdevUpdateFtraceEvent)
610 if (&from == this) return;
611 Clear();
612 MergeFrom(from);
613 }
614
IsInitialized() const615 bool CdevUpdateFtraceEvent::IsInitialized() const {
616 return true;
617 }
618
InternalSwap(CdevUpdateFtraceEvent * other)619 void CdevUpdateFtraceEvent::InternalSwap(CdevUpdateFtraceEvent* other) {
620 using std::swap;
621 auto* lhs_arena = GetArenaForAllocation();
622 auto* rhs_arena = other->GetArenaForAllocation();
623 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
624 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
625 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
626 &_impl_.type_, lhs_arena,
627 &other->_impl_.type_, rhs_arena
628 );
629 swap(_impl_.target_, other->_impl_.target_);
630 }
631
GetTypeName() const632 std::string CdevUpdateFtraceEvent::GetTypeName() const {
633 return "perfetto.protos.CdevUpdateFtraceEvent";
634 }
635
636
637 // @@protoc_insertion_point(namespace_scope)
638 } // namespace protos
639 } // namespace perfetto
640 PROTOBUF_NAMESPACE_OPEN
641 template<> PROTOBUF_NOINLINE ::perfetto::protos::ThermalTemperatureFtraceEvent*
CreateMaybeMessage(Arena * arena)642 Arena::CreateMaybeMessage< ::perfetto::protos::ThermalTemperatureFtraceEvent >(Arena* arena) {
643 return Arena::CreateMessageInternal< ::perfetto::protos::ThermalTemperatureFtraceEvent >(arena);
644 }
645 template<> PROTOBUF_NOINLINE ::perfetto::protos::CdevUpdateFtraceEvent*
CreateMaybeMessage(Arena * arena)646 Arena::CreateMaybeMessage< ::perfetto::protos::CdevUpdateFtraceEvent >(Arena* arena) {
647 return Arena::CreateMessageInternal< ::perfetto::protos::CdevUpdateFtraceEvent >(arena);
648 }
649 PROTOBUF_NAMESPACE_CLOSE
650
651 // @@protoc_insertion_point(global_scope)
652 #include <google/protobuf/port_undef.inc>
653