1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/common/data_source_descriptor.proto
3
4 #include "protos/perfetto/common/data_source_descriptor.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 {
DataSourceDescriptor(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR DataSourceDescriptor::DataSourceDescriptor(
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_.gpu_counter_descriptor_)*/nullptr
29 , /*decltype(_impl_.track_event_descriptor_)*/nullptr
30 , /*decltype(_impl_.ftrace_descriptor_)*/nullptr
31 , /*decltype(_impl_.id_)*/::uint64_t{0u}
32 , /*decltype(_impl_.will_notify_on_stop_)*/false
33 , /*decltype(_impl_.will_notify_on_start_)*/false
34 , /*decltype(_impl_.handles_incremental_state_clear_)*/false
35 , /*decltype(_impl_.no_flush_)*/false} {}
36 struct DataSourceDescriptorDefaultTypeInternal {
DataSourceDescriptorDefaultTypeInternalperfetto::protos::DataSourceDescriptorDefaultTypeInternal37 PROTOBUF_CONSTEXPR DataSourceDescriptorDefaultTypeInternal()
38 : _instance(::_pbi::ConstantInitialized{}) {}
~DataSourceDescriptorDefaultTypeInternalperfetto::protos::DataSourceDescriptorDefaultTypeInternal39 ~DataSourceDescriptorDefaultTypeInternal() {}
40 union { // NOLINT(misc-non-private-member-variables-in-classes)
41 DataSourceDescriptor _instance;
42 };
43 };
44 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DataSourceDescriptorDefaultTypeInternal _DataSourceDescriptor_default_instance_;
45 } // namespace protos
46 } // namespace perfetto
47 namespace perfetto {
48 namespace protos {
49
50 // ===================================================================
51
52 class DataSourceDescriptor::_Internal {
53 public:
54 using HasBits = decltype(std::declval<DataSourceDescriptor>()._impl_._has_bits_);
set_has_name(HasBits * has_bits)55 static void set_has_name(HasBits* has_bits) {
56 (*has_bits)[0] |= 1u;
57 }
set_has_id(HasBits * has_bits)58 static void set_has_id(HasBits* has_bits) {
59 (*has_bits)[0] |= 16u;
60 }
set_has_will_notify_on_stop(HasBits * has_bits)61 static void set_has_will_notify_on_stop(HasBits* has_bits) {
62 (*has_bits)[0] |= 32u;
63 }
set_has_will_notify_on_start(HasBits * has_bits)64 static void set_has_will_notify_on_start(HasBits* has_bits) {
65 (*has_bits)[0] |= 64u;
66 }
set_has_handles_incremental_state_clear(HasBits * has_bits)67 static void set_has_handles_incremental_state_clear(HasBits* has_bits) {
68 (*has_bits)[0] |= 128u;
69 }
set_has_no_flush(HasBits * has_bits)70 static void set_has_no_flush(HasBits* has_bits) {
71 (*has_bits)[0] |= 256u;
72 }
73 static const ::perfetto::protos::GpuCounterDescriptor& gpu_counter_descriptor(const DataSourceDescriptor* msg);
set_has_gpu_counter_descriptor(HasBits * has_bits)74 static void set_has_gpu_counter_descriptor(HasBits* has_bits) {
75 (*has_bits)[0] |= 2u;
76 }
77 static const ::perfetto::protos::TrackEventDescriptor& track_event_descriptor(const DataSourceDescriptor* msg);
set_has_track_event_descriptor(HasBits * has_bits)78 static void set_has_track_event_descriptor(HasBits* has_bits) {
79 (*has_bits)[0] |= 4u;
80 }
81 static const ::perfetto::protos::FtraceDescriptor& ftrace_descriptor(const DataSourceDescriptor* msg);
set_has_ftrace_descriptor(HasBits * has_bits)82 static void set_has_ftrace_descriptor(HasBits* has_bits) {
83 (*has_bits)[0] |= 8u;
84 }
85 };
86
87 const ::perfetto::protos::GpuCounterDescriptor&
gpu_counter_descriptor(const DataSourceDescriptor * msg)88 DataSourceDescriptor::_Internal::gpu_counter_descriptor(const DataSourceDescriptor* msg) {
89 return *msg->_impl_.gpu_counter_descriptor_;
90 }
91 const ::perfetto::protos::TrackEventDescriptor&
track_event_descriptor(const DataSourceDescriptor * msg)92 DataSourceDescriptor::_Internal::track_event_descriptor(const DataSourceDescriptor* msg) {
93 return *msg->_impl_.track_event_descriptor_;
94 }
95 const ::perfetto::protos::FtraceDescriptor&
ftrace_descriptor(const DataSourceDescriptor * msg)96 DataSourceDescriptor::_Internal::ftrace_descriptor(const DataSourceDescriptor* msg) {
97 return *msg->_impl_.ftrace_descriptor_;
98 }
clear_gpu_counter_descriptor()99 void DataSourceDescriptor::clear_gpu_counter_descriptor() {
100 if (_impl_.gpu_counter_descriptor_ != nullptr) _impl_.gpu_counter_descriptor_->Clear();
101 _impl_._has_bits_[0] &= ~0x00000002u;
102 }
clear_track_event_descriptor()103 void DataSourceDescriptor::clear_track_event_descriptor() {
104 if (_impl_.track_event_descriptor_ != nullptr) _impl_.track_event_descriptor_->Clear();
105 _impl_._has_bits_[0] &= ~0x00000004u;
106 }
clear_ftrace_descriptor()107 void DataSourceDescriptor::clear_ftrace_descriptor() {
108 if (_impl_.ftrace_descriptor_ != nullptr) _impl_.ftrace_descriptor_->Clear();
109 _impl_._has_bits_[0] &= ~0x00000008u;
110 }
DataSourceDescriptor(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)111 DataSourceDescriptor::DataSourceDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
112 bool is_message_owned)
113 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
114 SharedCtor(arena, is_message_owned);
115 // @@protoc_insertion_point(arena_constructor:perfetto.protos.DataSourceDescriptor)
116 }
DataSourceDescriptor(const DataSourceDescriptor & from)117 DataSourceDescriptor::DataSourceDescriptor(const DataSourceDescriptor& from)
118 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
119 DataSourceDescriptor* const _this = this; (void)_this;
120 new (&_impl_) Impl_{
121 decltype(_impl_._has_bits_){from._impl_._has_bits_}
122 , /*decltype(_impl_._cached_size_)*/{}
123 , decltype(_impl_.name_){}
124 , decltype(_impl_.gpu_counter_descriptor_){nullptr}
125 , decltype(_impl_.track_event_descriptor_){nullptr}
126 , decltype(_impl_.ftrace_descriptor_){nullptr}
127 , decltype(_impl_.id_){}
128 , decltype(_impl_.will_notify_on_stop_){}
129 , decltype(_impl_.will_notify_on_start_){}
130 , decltype(_impl_.handles_incremental_state_clear_){}
131 , decltype(_impl_.no_flush_){}};
132
133 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
134 _impl_.name_.InitDefault();
135 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
136 _impl_.name_.Set("", GetArenaForAllocation());
137 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
138 if (from._internal_has_name()) {
139 _this->_impl_.name_.Set(from._internal_name(),
140 _this->GetArenaForAllocation());
141 }
142 if (from._internal_has_gpu_counter_descriptor()) {
143 _this->_impl_.gpu_counter_descriptor_ = new ::perfetto::protos::GpuCounterDescriptor(*from._impl_.gpu_counter_descriptor_);
144 }
145 if (from._internal_has_track_event_descriptor()) {
146 _this->_impl_.track_event_descriptor_ = new ::perfetto::protos::TrackEventDescriptor(*from._impl_.track_event_descriptor_);
147 }
148 if (from._internal_has_ftrace_descriptor()) {
149 _this->_impl_.ftrace_descriptor_ = new ::perfetto::protos::FtraceDescriptor(*from._impl_.ftrace_descriptor_);
150 }
151 ::memcpy(&_impl_.id_, &from._impl_.id_,
152 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.no_flush_) -
153 reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.no_flush_));
154 // @@protoc_insertion_point(copy_constructor:perfetto.protos.DataSourceDescriptor)
155 }
156
SharedCtor(::_pb::Arena * arena,bool is_message_owned)157 inline void DataSourceDescriptor::SharedCtor(
158 ::_pb::Arena* arena, bool is_message_owned) {
159 (void)arena;
160 (void)is_message_owned;
161 new (&_impl_) Impl_{
162 decltype(_impl_._has_bits_){}
163 , /*decltype(_impl_._cached_size_)*/{}
164 , decltype(_impl_.name_){}
165 , decltype(_impl_.gpu_counter_descriptor_){nullptr}
166 , decltype(_impl_.track_event_descriptor_){nullptr}
167 , decltype(_impl_.ftrace_descriptor_){nullptr}
168 , decltype(_impl_.id_){::uint64_t{0u}}
169 , decltype(_impl_.will_notify_on_stop_){false}
170 , decltype(_impl_.will_notify_on_start_){false}
171 , decltype(_impl_.handles_incremental_state_clear_){false}
172 , decltype(_impl_.no_flush_){false}
173 };
174 _impl_.name_.InitDefault();
175 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
176 _impl_.name_.Set("", GetArenaForAllocation());
177 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
178 }
179
~DataSourceDescriptor()180 DataSourceDescriptor::~DataSourceDescriptor() {
181 // @@protoc_insertion_point(destructor:perfetto.protos.DataSourceDescriptor)
182 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
183 (void)arena;
184 return;
185 }
186 SharedDtor();
187 }
188
SharedDtor()189 inline void DataSourceDescriptor::SharedDtor() {
190 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
191 _impl_.name_.Destroy();
192 if (this != internal_default_instance()) delete _impl_.gpu_counter_descriptor_;
193 if (this != internal_default_instance()) delete _impl_.track_event_descriptor_;
194 if (this != internal_default_instance()) delete _impl_.ftrace_descriptor_;
195 }
196
SetCachedSize(int size) const197 void DataSourceDescriptor::SetCachedSize(int size) const {
198 _impl_._cached_size_.Set(size);
199 }
200
Clear()201 void DataSourceDescriptor::Clear() {
202 // @@protoc_insertion_point(message_clear_start:perfetto.protos.DataSourceDescriptor)
203 ::uint32_t cached_has_bits = 0;
204 // Prevent compiler warnings about cached_has_bits being unused
205 (void) cached_has_bits;
206
207 cached_has_bits = _impl_._has_bits_[0];
208 if (cached_has_bits & 0x0000000fu) {
209 if (cached_has_bits & 0x00000001u) {
210 _impl_.name_.ClearNonDefaultToEmpty();
211 }
212 if (cached_has_bits & 0x00000002u) {
213 GOOGLE_DCHECK(_impl_.gpu_counter_descriptor_ != nullptr);
214 _impl_.gpu_counter_descriptor_->Clear();
215 }
216 if (cached_has_bits & 0x00000004u) {
217 GOOGLE_DCHECK(_impl_.track_event_descriptor_ != nullptr);
218 _impl_.track_event_descriptor_->Clear();
219 }
220 if (cached_has_bits & 0x00000008u) {
221 GOOGLE_DCHECK(_impl_.ftrace_descriptor_ != nullptr);
222 _impl_.ftrace_descriptor_->Clear();
223 }
224 }
225 if (cached_has_bits & 0x000000f0u) {
226 ::memset(&_impl_.id_, 0, static_cast<size_t>(
227 reinterpret_cast<char*>(&_impl_.handles_incremental_state_clear_) -
228 reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.handles_incremental_state_clear_));
229 }
230 _impl_.no_flush_ = false;
231 _impl_._has_bits_.Clear();
232 _internal_metadata_.Clear<std::string>();
233 }
234
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)235 const char* DataSourceDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
236 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
237 _Internal::HasBits has_bits{};
238 while (!ctx->Done(&ptr)) {
239 ::uint32_t tag;
240 ptr = ::_pbi::ReadTag(ptr, &tag);
241 switch (tag >> 3) {
242 // optional string name = 1;
243 case 1:
244 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
245 auto str = _internal_mutable_name();
246 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
247 CHK_(ptr);
248 } else {
249 goto handle_unusual;
250 }
251 continue;
252 // optional bool will_notify_on_stop = 2;
253 case 2:
254 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
255 _Internal::set_has_will_notify_on_stop(&has_bits);
256 _impl_.will_notify_on_stop_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
257 CHK_(ptr);
258 } else {
259 goto handle_unusual;
260 }
261 continue;
262 // optional bool will_notify_on_start = 3;
263 case 3:
264 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
265 _Internal::set_has_will_notify_on_start(&has_bits);
266 _impl_.will_notify_on_start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
267 CHK_(ptr);
268 } else {
269 goto handle_unusual;
270 }
271 continue;
272 // optional bool handles_incremental_state_clear = 4;
273 case 4:
274 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
275 _Internal::set_has_handles_incremental_state_clear(&has_bits);
276 _impl_.handles_incremental_state_clear_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
277 CHK_(ptr);
278 } else {
279 goto handle_unusual;
280 }
281 continue;
282 // optional .perfetto.protos.GpuCounterDescriptor gpu_counter_descriptor = 5 [lazy = true];
283 case 5:
284 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
285 ptr = ctx->ParseMessage(_internal_mutable_gpu_counter_descriptor(), ptr);
286 CHK_(ptr);
287 } else {
288 goto handle_unusual;
289 }
290 continue;
291 // optional .perfetto.protos.TrackEventDescriptor track_event_descriptor = 6 [lazy = true];
292 case 6:
293 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
294 ptr = ctx->ParseMessage(_internal_mutable_track_event_descriptor(), ptr);
295 CHK_(ptr);
296 } else {
297 goto handle_unusual;
298 }
299 continue;
300 // optional uint64 id = 7;
301 case 7:
302 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
303 _Internal::set_has_id(&has_bits);
304 _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
305 CHK_(ptr);
306 } else {
307 goto handle_unusual;
308 }
309 continue;
310 // optional .perfetto.protos.FtraceDescriptor ftrace_descriptor = 8 [lazy = true];
311 case 8:
312 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
313 ptr = ctx->ParseMessage(_internal_mutable_ftrace_descriptor(), ptr);
314 CHK_(ptr);
315 } else {
316 goto handle_unusual;
317 }
318 continue;
319 // optional bool no_flush = 9;
320 case 9:
321 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
322 _Internal::set_has_no_flush(&has_bits);
323 _impl_.no_flush_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
324 CHK_(ptr);
325 } else {
326 goto handle_unusual;
327 }
328 continue;
329 default:
330 goto handle_unusual;
331 } // switch
332 handle_unusual:
333 if ((tag == 0) || ((tag & 7) == 4)) {
334 CHK_(ptr);
335 ctx->SetLastTag(tag);
336 goto message_done;
337 }
338 ptr = UnknownFieldParse(
339 tag,
340 _internal_metadata_.mutable_unknown_fields<std::string>(),
341 ptr, ctx);
342 CHK_(ptr != nullptr);
343 } // while
344 message_done:
345 _impl_._has_bits_.Or(has_bits);
346 return ptr;
347 failure:
348 ptr = nullptr;
349 goto message_done;
350 #undef CHK_
351 }
352
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const353 ::uint8_t* DataSourceDescriptor::_InternalSerialize(
354 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
355 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.DataSourceDescriptor)
356 ::uint32_t cached_has_bits = 0;
357 (void) cached_has_bits;
358
359 cached_has_bits = _impl_._has_bits_[0];
360 // optional string name = 1;
361 if (cached_has_bits & 0x00000001u) {
362 target = stream->WriteStringMaybeAliased(
363 1, this->_internal_name(), target);
364 }
365
366 // optional bool will_notify_on_stop = 2;
367 if (cached_has_bits & 0x00000020u) {
368 target = stream->EnsureSpace(target);
369 target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_will_notify_on_stop(), target);
370 }
371
372 // optional bool will_notify_on_start = 3;
373 if (cached_has_bits & 0x00000040u) {
374 target = stream->EnsureSpace(target);
375 target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_will_notify_on_start(), target);
376 }
377
378 // optional bool handles_incremental_state_clear = 4;
379 if (cached_has_bits & 0x00000080u) {
380 target = stream->EnsureSpace(target);
381 target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_handles_incremental_state_clear(), target);
382 }
383
384 // optional .perfetto.protos.GpuCounterDescriptor gpu_counter_descriptor = 5 [lazy = true];
385 if (cached_has_bits & 0x00000002u) {
386 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
387 InternalWriteMessage(5, _Internal::gpu_counter_descriptor(this),
388 _Internal::gpu_counter_descriptor(this).GetCachedSize(), target, stream);
389 }
390
391 // optional .perfetto.protos.TrackEventDescriptor track_event_descriptor = 6 [lazy = true];
392 if (cached_has_bits & 0x00000004u) {
393 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
394 InternalWriteMessage(6, _Internal::track_event_descriptor(this),
395 _Internal::track_event_descriptor(this).GetCachedSize(), target, stream);
396 }
397
398 // optional uint64 id = 7;
399 if (cached_has_bits & 0x00000010u) {
400 target = stream->EnsureSpace(target);
401 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_id(), target);
402 }
403
404 // optional .perfetto.protos.FtraceDescriptor ftrace_descriptor = 8 [lazy = true];
405 if (cached_has_bits & 0x00000008u) {
406 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
407 InternalWriteMessage(8, _Internal::ftrace_descriptor(this),
408 _Internal::ftrace_descriptor(this).GetCachedSize(), target, stream);
409 }
410
411 // optional bool no_flush = 9;
412 if (cached_has_bits & 0x00000100u) {
413 target = stream->EnsureSpace(target);
414 target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_no_flush(), target);
415 }
416
417 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
418 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
419 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
420 }
421 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.DataSourceDescriptor)
422 return target;
423 }
424
ByteSizeLong() const425 size_t DataSourceDescriptor::ByteSizeLong() const {
426 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.DataSourceDescriptor)
427 size_t total_size = 0;
428
429 ::uint32_t cached_has_bits = 0;
430 // Prevent compiler warnings about cached_has_bits being unused
431 (void) cached_has_bits;
432
433 cached_has_bits = _impl_._has_bits_[0];
434 if (cached_has_bits & 0x000000ffu) {
435 // optional string name = 1;
436 if (cached_has_bits & 0x00000001u) {
437 total_size += 1 +
438 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
439 this->_internal_name());
440 }
441
442 // optional .perfetto.protos.GpuCounterDescriptor gpu_counter_descriptor = 5 [lazy = true];
443 if (cached_has_bits & 0x00000002u) {
444 total_size += 1 +
445 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
446 *_impl_.gpu_counter_descriptor_);
447 }
448
449 // optional .perfetto.protos.TrackEventDescriptor track_event_descriptor = 6 [lazy = true];
450 if (cached_has_bits & 0x00000004u) {
451 total_size += 1 +
452 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
453 *_impl_.track_event_descriptor_);
454 }
455
456 // optional .perfetto.protos.FtraceDescriptor ftrace_descriptor = 8 [lazy = true];
457 if (cached_has_bits & 0x00000008u) {
458 total_size += 1 +
459 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
460 *_impl_.ftrace_descriptor_);
461 }
462
463 // optional uint64 id = 7;
464 if (cached_has_bits & 0x00000010u) {
465 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id());
466 }
467
468 // optional bool will_notify_on_stop = 2;
469 if (cached_has_bits & 0x00000020u) {
470 total_size += 1 + 1;
471 }
472
473 // optional bool will_notify_on_start = 3;
474 if (cached_has_bits & 0x00000040u) {
475 total_size += 1 + 1;
476 }
477
478 // optional bool handles_incremental_state_clear = 4;
479 if (cached_has_bits & 0x00000080u) {
480 total_size += 1 + 1;
481 }
482
483 }
484 // optional bool no_flush = 9;
485 if (cached_has_bits & 0x00000100u) {
486 total_size += 1 + 1;
487 }
488
489 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
490 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
491 }
492 int cached_size = ::_pbi::ToCachedSize(total_size);
493 SetCachedSize(cached_size);
494 return total_size;
495 }
496
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)497 void DataSourceDescriptor::CheckTypeAndMergeFrom(
498 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
499 MergeFrom(*::_pbi::DownCast<const DataSourceDescriptor*>(
500 &from));
501 }
502
MergeFrom(const DataSourceDescriptor & from)503 void DataSourceDescriptor::MergeFrom(const DataSourceDescriptor& from) {
504 DataSourceDescriptor* const _this = this;
505 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.DataSourceDescriptor)
506 GOOGLE_DCHECK_NE(&from, _this);
507 ::uint32_t cached_has_bits = 0;
508 (void) cached_has_bits;
509
510 cached_has_bits = from._impl_._has_bits_[0];
511 if (cached_has_bits & 0x000000ffu) {
512 if (cached_has_bits & 0x00000001u) {
513 _this->_internal_set_name(from._internal_name());
514 }
515 if (cached_has_bits & 0x00000002u) {
516 _this->_internal_mutable_gpu_counter_descriptor()->::perfetto::protos::GpuCounterDescriptor::MergeFrom(
517 from._internal_gpu_counter_descriptor());
518 }
519 if (cached_has_bits & 0x00000004u) {
520 _this->_internal_mutable_track_event_descriptor()->::perfetto::protos::TrackEventDescriptor::MergeFrom(
521 from._internal_track_event_descriptor());
522 }
523 if (cached_has_bits & 0x00000008u) {
524 _this->_internal_mutable_ftrace_descriptor()->::perfetto::protos::FtraceDescriptor::MergeFrom(
525 from._internal_ftrace_descriptor());
526 }
527 if (cached_has_bits & 0x00000010u) {
528 _this->_impl_.id_ = from._impl_.id_;
529 }
530 if (cached_has_bits & 0x00000020u) {
531 _this->_impl_.will_notify_on_stop_ = from._impl_.will_notify_on_stop_;
532 }
533 if (cached_has_bits & 0x00000040u) {
534 _this->_impl_.will_notify_on_start_ = from._impl_.will_notify_on_start_;
535 }
536 if (cached_has_bits & 0x00000080u) {
537 _this->_impl_.handles_incremental_state_clear_ = from._impl_.handles_incremental_state_clear_;
538 }
539 _this->_impl_._has_bits_[0] |= cached_has_bits;
540 }
541 if (cached_has_bits & 0x00000100u) {
542 _this->_internal_set_no_flush(from._internal_no_flush());
543 }
544 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
545 }
546
CopyFrom(const DataSourceDescriptor & from)547 void DataSourceDescriptor::CopyFrom(const DataSourceDescriptor& from) {
548 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.DataSourceDescriptor)
549 if (&from == this) return;
550 Clear();
551 MergeFrom(from);
552 }
553
IsInitialized() const554 bool DataSourceDescriptor::IsInitialized() const {
555 return true;
556 }
557
InternalSwap(DataSourceDescriptor * other)558 void DataSourceDescriptor::InternalSwap(DataSourceDescriptor* other) {
559 using std::swap;
560 auto* lhs_arena = GetArenaForAllocation();
561 auto* rhs_arena = other->GetArenaForAllocation();
562 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
563 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
564 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
565 &_impl_.name_, lhs_arena,
566 &other->_impl_.name_, rhs_arena
567 );
568 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
569 PROTOBUF_FIELD_OFFSET(DataSourceDescriptor, _impl_.no_flush_)
570 + sizeof(DataSourceDescriptor::_impl_.no_flush_) // NOLINT
571 - PROTOBUF_FIELD_OFFSET(DataSourceDescriptor, _impl_.gpu_counter_descriptor_)>(
572 reinterpret_cast<char*>(&_impl_.gpu_counter_descriptor_),
573 reinterpret_cast<char*>(&other->_impl_.gpu_counter_descriptor_));
574 }
575
GetTypeName() const576 std::string DataSourceDescriptor::GetTypeName() const {
577 return "perfetto.protos.DataSourceDescriptor";
578 }
579
580
581 // @@protoc_insertion_point(namespace_scope)
582 } // namespace protos
583 } // namespace perfetto
584 PROTOBUF_NAMESPACE_OPEN
585 template<> PROTOBUF_NOINLINE ::perfetto::protos::DataSourceDescriptor*
CreateMaybeMessage(Arena * arena)586 Arena::CreateMaybeMessage< ::perfetto::protos::DataSourceDescriptor >(Arena* arena) {
587 return Arena::CreateMessageInternal< ::perfetto::protos::DataSourceDescriptor >(arena);
588 }
589 PROTOBUF_NAMESPACE_CLOSE
590
591 // @@protoc_insertion_point(global_scope)
592 #include <google/protobuf/port_undef.inc>
593