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