1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/android/protolog_config.proto
3
4 #include "protos/perfetto/config/android/protolog_config.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 {
ProtoLogConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ProtoLogConfig::ProtoLogConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.group_overrides_)*/{}
28 , /*decltype(_impl_.tracing_mode_)*/0
29 , /*decltype(_impl_.default_log_from_level_)*/0} {}
30 struct ProtoLogConfigDefaultTypeInternal {
ProtoLogConfigDefaultTypeInternalperfetto::protos::ProtoLogConfigDefaultTypeInternal31 PROTOBUF_CONSTEXPR ProtoLogConfigDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~ProtoLogConfigDefaultTypeInternalperfetto::protos::ProtoLogConfigDefaultTypeInternal33 ~ProtoLogConfigDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 ProtoLogConfig _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProtoLogConfigDefaultTypeInternal _ProtoLogConfig_default_instance_;
ProtoLogGroup(::_pbi::ConstantInitialized)39 PROTOBUF_CONSTEXPR ProtoLogGroup::ProtoLogGroup(
40 ::_pbi::ConstantInitialized): _impl_{
41 /*decltype(_impl_._has_bits_)*/{}
42 , /*decltype(_impl_._cached_size_)*/{}
43 , /*decltype(_impl_.group_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
44 , /*decltype(_impl_.log_from_)*/0
45 , /*decltype(_impl_.collect_stacktrace_)*/false} {}
46 struct ProtoLogGroupDefaultTypeInternal {
ProtoLogGroupDefaultTypeInternalperfetto::protos::ProtoLogGroupDefaultTypeInternal47 PROTOBUF_CONSTEXPR ProtoLogGroupDefaultTypeInternal()
48 : _instance(::_pbi::ConstantInitialized{}) {}
~ProtoLogGroupDefaultTypeInternalperfetto::protos::ProtoLogGroupDefaultTypeInternal49 ~ProtoLogGroupDefaultTypeInternal() {}
50 union { // NOLINT(misc-non-private-member-variables-in-classes)
51 ProtoLogGroup _instance;
52 };
53 };
54 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProtoLogGroupDefaultTypeInternal _ProtoLogGroup_default_instance_;
55 } // namespace protos
56 } // namespace perfetto
57 namespace perfetto {
58 namespace protos {
ProtoLogConfig_TracingMode_IsValid(int value)59 bool ProtoLogConfig_TracingMode_IsValid(int value) {
60 switch (value) {
61 case 0:
62 case 1:
63 return true;
64 default:
65 return false;
66 }
67 }
68
69 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ProtoLogConfig_TracingMode_strings[2] = {};
70
71 static const char ProtoLogConfig_TracingMode_names[] =
72 "DEFAULT"
73 "ENABLE_ALL";
74
75 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ProtoLogConfig_TracingMode_entries[] = {
76 { {ProtoLogConfig_TracingMode_names + 0, 7}, 0 },
77 { {ProtoLogConfig_TracingMode_names + 7, 10}, 1 },
78 };
79
80 static const int ProtoLogConfig_TracingMode_entries_by_number[] = {
81 0, // 0 -> DEFAULT
82 1, // 1 -> ENABLE_ALL
83 };
84
ProtoLogConfig_TracingMode_Name(ProtoLogConfig_TracingMode value)85 const std::string& ProtoLogConfig_TracingMode_Name(
86 ProtoLogConfig_TracingMode value) {
87 static const bool dummy =
88 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
89 ProtoLogConfig_TracingMode_entries,
90 ProtoLogConfig_TracingMode_entries_by_number,
91 2, ProtoLogConfig_TracingMode_strings);
92 (void) dummy;
93 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
94 ProtoLogConfig_TracingMode_entries,
95 ProtoLogConfig_TracingMode_entries_by_number,
96 2, value);
97 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
98 ProtoLogConfig_TracingMode_strings[idx].get();
99 }
ProtoLogConfig_TracingMode_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ProtoLogConfig_TracingMode * value)100 bool ProtoLogConfig_TracingMode_Parse(
101 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ProtoLogConfig_TracingMode* value) {
102 int int_value;
103 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
104 ProtoLogConfig_TracingMode_entries, 2, name, &int_value);
105 if (success) {
106 *value = static_cast<ProtoLogConfig_TracingMode>(int_value);
107 }
108 return success;
109 }
110 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
111 constexpr ProtoLogConfig_TracingMode ProtoLogConfig::DEFAULT;
112 constexpr ProtoLogConfig_TracingMode ProtoLogConfig::ENABLE_ALL;
113 constexpr ProtoLogConfig_TracingMode ProtoLogConfig::TracingMode_MIN;
114 constexpr ProtoLogConfig_TracingMode ProtoLogConfig::TracingMode_MAX;
115 constexpr int ProtoLogConfig::TracingMode_ARRAYSIZE;
116 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
117
118 // ===================================================================
119
120 class ProtoLogConfig::_Internal {
121 public:
122 using HasBits = decltype(std::declval<ProtoLogConfig>()._impl_._has_bits_);
set_has_tracing_mode(HasBits * has_bits)123 static void set_has_tracing_mode(HasBits* has_bits) {
124 (*has_bits)[0] |= 1u;
125 }
set_has_default_log_from_level(HasBits * has_bits)126 static void set_has_default_log_from_level(HasBits* has_bits) {
127 (*has_bits)[0] |= 2u;
128 }
129 };
130
ProtoLogConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)131 ProtoLogConfig::ProtoLogConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
132 bool is_message_owned)
133 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
134 SharedCtor(arena, is_message_owned);
135 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProtoLogConfig)
136 }
ProtoLogConfig(const ProtoLogConfig & from)137 ProtoLogConfig::ProtoLogConfig(const ProtoLogConfig& from)
138 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
139 ProtoLogConfig* const _this = this; (void)_this;
140 new (&_impl_) Impl_{
141 decltype(_impl_._has_bits_){from._impl_._has_bits_}
142 , /*decltype(_impl_._cached_size_)*/{}
143 , decltype(_impl_.group_overrides_){from._impl_.group_overrides_}
144 , decltype(_impl_.tracing_mode_){}
145 , decltype(_impl_.default_log_from_level_){}};
146
147 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
148 ::memcpy(&_impl_.tracing_mode_, &from._impl_.tracing_mode_,
149 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.default_log_from_level_) -
150 reinterpret_cast<char*>(&_impl_.tracing_mode_)) + sizeof(_impl_.default_log_from_level_));
151 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProtoLogConfig)
152 }
153
SharedCtor(::_pb::Arena * arena,bool is_message_owned)154 inline void ProtoLogConfig::SharedCtor(
155 ::_pb::Arena* arena, bool is_message_owned) {
156 (void)arena;
157 (void)is_message_owned;
158 new (&_impl_) Impl_{
159 decltype(_impl_._has_bits_){}
160 , /*decltype(_impl_._cached_size_)*/{}
161 , decltype(_impl_.group_overrides_){arena}
162 , decltype(_impl_.tracing_mode_){0}
163 , decltype(_impl_.default_log_from_level_){0}
164 };
165 }
166
~ProtoLogConfig()167 ProtoLogConfig::~ProtoLogConfig() {
168 // @@protoc_insertion_point(destructor:perfetto.protos.ProtoLogConfig)
169 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
170 (void)arena;
171 return;
172 }
173 SharedDtor();
174 }
175
SharedDtor()176 inline void ProtoLogConfig::SharedDtor() {
177 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
178 _impl_.group_overrides_.~RepeatedPtrField();
179 }
180
SetCachedSize(int size) const181 void ProtoLogConfig::SetCachedSize(int size) const {
182 _impl_._cached_size_.Set(size);
183 }
184
Clear()185 void ProtoLogConfig::Clear() {
186 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProtoLogConfig)
187 ::uint32_t cached_has_bits = 0;
188 // Prevent compiler warnings about cached_has_bits being unused
189 (void) cached_has_bits;
190
191 _impl_.group_overrides_.Clear();
192 cached_has_bits = _impl_._has_bits_[0];
193 if (cached_has_bits & 0x00000003u) {
194 ::memset(&_impl_.tracing_mode_, 0, static_cast<size_t>(
195 reinterpret_cast<char*>(&_impl_.default_log_from_level_) -
196 reinterpret_cast<char*>(&_impl_.tracing_mode_)) + sizeof(_impl_.default_log_from_level_));
197 }
198 _impl_._has_bits_.Clear();
199 _internal_metadata_.Clear<std::string>();
200 }
201
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)202 const char* ProtoLogConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
203 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
204 _Internal::HasBits has_bits{};
205 while (!ctx->Done(&ptr)) {
206 ::uint32_t tag;
207 ptr = ::_pbi::ReadTag(ptr, &tag);
208 switch (tag >> 3) {
209 // repeated .perfetto.protos.ProtoLogGroup group_overrides = 1;
210 case 1:
211 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
212 ptr -= 1;
213 do {
214 ptr += 1;
215 ptr = ctx->ParseMessage(_internal_add_group_overrides(), ptr);
216 CHK_(ptr);
217 if (!ctx->DataAvailable(ptr)) break;
218 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
219 } else {
220 goto handle_unusual;
221 }
222 continue;
223 // optional .perfetto.protos.ProtoLogConfig.TracingMode tracing_mode = 2;
224 case 2:
225 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
226 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
227 CHK_(ptr);
228 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::ProtoLogConfig_TracingMode_IsValid(val))) {
229 _internal_set_tracing_mode(static_cast<::perfetto::protos::ProtoLogConfig_TracingMode>(val));
230 } else {
231 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
232 }
233 } else {
234 goto handle_unusual;
235 }
236 continue;
237 // optional .perfetto.protos.ProtoLogLevel default_log_from_level = 3;
238 case 3:
239 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
240 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
241 CHK_(ptr);
242 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::ProtoLogLevel_IsValid(val))) {
243 _internal_set_default_log_from_level(static_cast<::perfetto::protos::ProtoLogLevel>(val));
244 } else {
245 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
246 }
247 } else {
248 goto handle_unusual;
249 }
250 continue;
251 default:
252 goto handle_unusual;
253 } // switch
254 handle_unusual:
255 if ((tag == 0) || ((tag & 7) == 4)) {
256 CHK_(ptr);
257 ctx->SetLastTag(tag);
258 goto message_done;
259 }
260 ptr = UnknownFieldParse(
261 tag,
262 _internal_metadata_.mutable_unknown_fields<std::string>(),
263 ptr, ctx);
264 CHK_(ptr != nullptr);
265 } // while
266 message_done:
267 _impl_._has_bits_.Or(has_bits);
268 return ptr;
269 failure:
270 ptr = nullptr;
271 goto message_done;
272 #undef CHK_
273 }
274
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const275 ::uint8_t* ProtoLogConfig::_InternalSerialize(
276 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
277 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProtoLogConfig)
278 ::uint32_t cached_has_bits = 0;
279 (void) cached_has_bits;
280
281 // repeated .perfetto.protos.ProtoLogGroup group_overrides = 1;
282 for (unsigned i = 0,
283 n = static_cast<unsigned>(this->_internal_group_overrides_size()); i < n; i++) {
284 const auto& repfield = this->_internal_group_overrides(i);
285 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
286 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
287 }
288
289 cached_has_bits = _impl_._has_bits_[0];
290 // optional .perfetto.protos.ProtoLogConfig.TracingMode tracing_mode = 2;
291 if (cached_has_bits & 0x00000001u) {
292 target = stream->EnsureSpace(target);
293 target = ::_pbi::WireFormatLite::WriteEnumToArray(
294 2, this->_internal_tracing_mode(), target);
295 }
296
297 // optional .perfetto.protos.ProtoLogLevel default_log_from_level = 3;
298 if (cached_has_bits & 0x00000002u) {
299 target = stream->EnsureSpace(target);
300 target = ::_pbi::WireFormatLite::WriteEnumToArray(
301 3, this->_internal_default_log_from_level(), target);
302 }
303
304 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
305 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
306 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
307 }
308 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProtoLogConfig)
309 return target;
310 }
311
ByteSizeLong() const312 size_t ProtoLogConfig::ByteSizeLong() const {
313 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProtoLogConfig)
314 size_t total_size = 0;
315
316 ::uint32_t cached_has_bits = 0;
317 // Prevent compiler warnings about cached_has_bits being unused
318 (void) cached_has_bits;
319
320 // repeated .perfetto.protos.ProtoLogGroup group_overrides = 1;
321 total_size += 1UL * this->_internal_group_overrides_size();
322 for (const auto& msg : this->_impl_.group_overrides_) {
323 total_size +=
324 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
325 }
326
327 cached_has_bits = _impl_._has_bits_[0];
328 if (cached_has_bits & 0x00000003u) {
329 // optional .perfetto.protos.ProtoLogConfig.TracingMode tracing_mode = 2;
330 if (cached_has_bits & 0x00000001u) {
331 total_size += 1 +
332 ::_pbi::WireFormatLite::EnumSize(this->_internal_tracing_mode());
333 }
334
335 // optional .perfetto.protos.ProtoLogLevel default_log_from_level = 3;
336 if (cached_has_bits & 0x00000002u) {
337 total_size += 1 +
338 ::_pbi::WireFormatLite::EnumSize(this->_internal_default_log_from_level());
339 }
340
341 }
342 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
343 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
344 }
345 int cached_size = ::_pbi::ToCachedSize(total_size);
346 SetCachedSize(cached_size);
347 return total_size;
348 }
349
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)350 void ProtoLogConfig::CheckTypeAndMergeFrom(
351 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
352 MergeFrom(*::_pbi::DownCast<const ProtoLogConfig*>(
353 &from));
354 }
355
MergeFrom(const ProtoLogConfig & from)356 void ProtoLogConfig::MergeFrom(const ProtoLogConfig& from) {
357 ProtoLogConfig* const _this = this;
358 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProtoLogConfig)
359 GOOGLE_DCHECK_NE(&from, _this);
360 ::uint32_t cached_has_bits = 0;
361 (void) cached_has_bits;
362
363 _this->_impl_.group_overrides_.MergeFrom(from._impl_.group_overrides_);
364 cached_has_bits = from._impl_._has_bits_[0];
365 if (cached_has_bits & 0x00000003u) {
366 if (cached_has_bits & 0x00000001u) {
367 _this->_impl_.tracing_mode_ = from._impl_.tracing_mode_;
368 }
369 if (cached_has_bits & 0x00000002u) {
370 _this->_impl_.default_log_from_level_ = from._impl_.default_log_from_level_;
371 }
372 _this->_impl_._has_bits_[0] |= cached_has_bits;
373 }
374 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
375 }
376
CopyFrom(const ProtoLogConfig & from)377 void ProtoLogConfig::CopyFrom(const ProtoLogConfig& from) {
378 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProtoLogConfig)
379 if (&from == this) return;
380 Clear();
381 MergeFrom(from);
382 }
383
IsInitialized() const384 bool ProtoLogConfig::IsInitialized() const {
385 return true;
386 }
387
InternalSwap(ProtoLogConfig * other)388 void ProtoLogConfig::InternalSwap(ProtoLogConfig* other) {
389 using std::swap;
390 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
391 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
392 _impl_.group_overrides_.InternalSwap(&other->_impl_.group_overrides_);
393 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
394 PROTOBUF_FIELD_OFFSET(ProtoLogConfig, _impl_.default_log_from_level_)
395 + sizeof(ProtoLogConfig::_impl_.default_log_from_level_) // NOLINT
396 - PROTOBUF_FIELD_OFFSET(ProtoLogConfig, _impl_.tracing_mode_)>(
397 reinterpret_cast<char*>(&_impl_.tracing_mode_),
398 reinterpret_cast<char*>(&other->_impl_.tracing_mode_));
399 }
400
GetTypeName() const401 std::string ProtoLogConfig::GetTypeName() const {
402 return "perfetto.protos.ProtoLogConfig";
403 }
404
405
406 // ===================================================================
407
408 class ProtoLogGroup::_Internal {
409 public:
410 using HasBits = decltype(std::declval<ProtoLogGroup>()._impl_._has_bits_);
set_has_group_name(HasBits * has_bits)411 static void set_has_group_name(HasBits* has_bits) {
412 (*has_bits)[0] |= 1u;
413 }
set_has_log_from(HasBits * has_bits)414 static void set_has_log_from(HasBits* has_bits) {
415 (*has_bits)[0] |= 2u;
416 }
set_has_collect_stacktrace(HasBits * has_bits)417 static void set_has_collect_stacktrace(HasBits* has_bits) {
418 (*has_bits)[0] |= 4u;
419 }
420 };
421
ProtoLogGroup(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)422 ProtoLogGroup::ProtoLogGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena,
423 bool is_message_owned)
424 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
425 SharedCtor(arena, is_message_owned);
426 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProtoLogGroup)
427 }
ProtoLogGroup(const ProtoLogGroup & from)428 ProtoLogGroup::ProtoLogGroup(const ProtoLogGroup& from)
429 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
430 ProtoLogGroup* const _this = this; (void)_this;
431 new (&_impl_) Impl_{
432 decltype(_impl_._has_bits_){from._impl_._has_bits_}
433 , /*decltype(_impl_._cached_size_)*/{}
434 , decltype(_impl_.group_name_){}
435 , decltype(_impl_.log_from_){}
436 , decltype(_impl_.collect_stacktrace_){}};
437
438 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
439 _impl_.group_name_.InitDefault();
440 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
441 _impl_.group_name_.Set("", GetArenaForAllocation());
442 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
443 if (from._internal_has_group_name()) {
444 _this->_impl_.group_name_.Set(from._internal_group_name(),
445 _this->GetArenaForAllocation());
446 }
447 ::memcpy(&_impl_.log_from_, &from._impl_.log_from_,
448 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.collect_stacktrace_) -
449 reinterpret_cast<char*>(&_impl_.log_from_)) + sizeof(_impl_.collect_stacktrace_));
450 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProtoLogGroup)
451 }
452
SharedCtor(::_pb::Arena * arena,bool is_message_owned)453 inline void ProtoLogGroup::SharedCtor(
454 ::_pb::Arena* arena, bool is_message_owned) {
455 (void)arena;
456 (void)is_message_owned;
457 new (&_impl_) Impl_{
458 decltype(_impl_._has_bits_){}
459 , /*decltype(_impl_._cached_size_)*/{}
460 , decltype(_impl_.group_name_){}
461 , decltype(_impl_.log_from_){0}
462 , decltype(_impl_.collect_stacktrace_){false}
463 };
464 _impl_.group_name_.InitDefault();
465 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
466 _impl_.group_name_.Set("", GetArenaForAllocation());
467 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
468 }
469
~ProtoLogGroup()470 ProtoLogGroup::~ProtoLogGroup() {
471 // @@protoc_insertion_point(destructor:perfetto.protos.ProtoLogGroup)
472 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
473 (void)arena;
474 return;
475 }
476 SharedDtor();
477 }
478
SharedDtor()479 inline void ProtoLogGroup::SharedDtor() {
480 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
481 _impl_.group_name_.Destroy();
482 }
483
SetCachedSize(int size) const484 void ProtoLogGroup::SetCachedSize(int size) const {
485 _impl_._cached_size_.Set(size);
486 }
487
Clear()488 void ProtoLogGroup::Clear() {
489 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProtoLogGroup)
490 ::uint32_t cached_has_bits = 0;
491 // Prevent compiler warnings about cached_has_bits being unused
492 (void) cached_has_bits;
493
494 cached_has_bits = _impl_._has_bits_[0];
495 if (cached_has_bits & 0x00000001u) {
496 _impl_.group_name_.ClearNonDefaultToEmpty();
497 }
498 if (cached_has_bits & 0x00000006u) {
499 ::memset(&_impl_.log_from_, 0, static_cast<size_t>(
500 reinterpret_cast<char*>(&_impl_.collect_stacktrace_) -
501 reinterpret_cast<char*>(&_impl_.log_from_)) + sizeof(_impl_.collect_stacktrace_));
502 }
503 _impl_._has_bits_.Clear();
504 _internal_metadata_.Clear<std::string>();
505 }
506
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)507 const char* ProtoLogGroup::_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 string group_name = 1;
515 case 1:
516 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
517 auto str = _internal_mutable_group_name();
518 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
519 CHK_(ptr);
520 } else {
521 goto handle_unusual;
522 }
523 continue;
524 // optional .perfetto.protos.ProtoLogLevel log_from = 2;
525 case 2:
526 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
527 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
528 CHK_(ptr);
529 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::ProtoLogLevel_IsValid(val))) {
530 _internal_set_log_from(static_cast<::perfetto::protos::ProtoLogLevel>(val));
531 } else {
532 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
533 }
534 } else {
535 goto handle_unusual;
536 }
537 continue;
538 // optional bool collect_stacktrace = 3;
539 case 3:
540 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
541 _Internal::set_has_collect_stacktrace(&has_bits);
542 _impl_.collect_stacktrace_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
543 CHK_(ptr);
544 } else {
545 goto handle_unusual;
546 }
547 continue;
548 default:
549 goto handle_unusual;
550 } // switch
551 handle_unusual:
552 if ((tag == 0) || ((tag & 7) == 4)) {
553 CHK_(ptr);
554 ctx->SetLastTag(tag);
555 goto message_done;
556 }
557 ptr = UnknownFieldParse(
558 tag,
559 _internal_metadata_.mutable_unknown_fields<std::string>(),
560 ptr, ctx);
561 CHK_(ptr != nullptr);
562 } // while
563 message_done:
564 _impl_._has_bits_.Or(has_bits);
565 return ptr;
566 failure:
567 ptr = nullptr;
568 goto message_done;
569 #undef CHK_
570 }
571
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const572 ::uint8_t* ProtoLogGroup::_InternalSerialize(
573 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
574 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProtoLogGroup)
575 ::uint32_t cached_has_bits = 0;
576 (void) cached_has_bits;
577
578 cached_has_bits = _impl_._has_bits_[0];
579 // optional string group_name = 1;
580 if (cached_has_bits & 0x00000001u) {
581 target = stream->WriteStringMaybeAliased(
582 1, this->_internal_group_name(), target);
583 }
584
585 // optional .perfetto.protos.ProtoLogLevel log_from = 2;
586 if (cached_has_bits & 0x00000002u) {
587 target = stream->EnsureSpace(target);
588 target = ::_pbi::WireFormatLite::WriteEnumToArray(
589 2, this->_internal_log_from(), target);
590 }
591
592 // optional bool collect_stacktrace = 3;
593 if (cached_has_bits & 0x00000004u) {
594 target = stream->EnsureSpace(target);
595 target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_collect_stacktrace(), target);
596 }
597
598 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
599 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
600 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
601 }
602 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProtoLogGroup)
603 return target;
604 }
605
ByteSizeLong() const606 size_t ProtoLogGroup::ByteSizeLong() const {
607 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProtoLogGroup)
608 size_t total_size = 0;
609
610 ::uint32_t cached_has_bits = 0;
611 // Prevent compiler warnings about cached_has_bits being unused
612 (void) cached_has_bits;
613
614 cached_has_bits = _impl_._has_bits_[0];
615 if (cached_has_bits & 0x00000007u) {
616 // optional string group_name = 1;
617 if (cached_has_bits & 0x00000001u) {
618 total_size += 1 +
619 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
620 this->_internal_group_name());
621 }
622
623 // optional .perfetto.protos.ProtoLogLevel log_from = 2;
624 if (cached_has_bits & 0x00000002u) {
625 total_size += 1 +
626 ::_pbi::WireFormatLite::EnumSize(this->_internal_log_from());
627 }
628
629 // optional bool collect_stacktrace = 3;
630 if (cached_has_bits & 0x00000004u) {
631 total_size += 1 + 1;
632 }
633
634 }
635 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
636 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
637 }
638 int cached_size = ::_pbi::ToCachedSize(total_size);
639 SetCachedSize(cached_size);
640 return total_size;
641 }
642
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)643 void ProtoLogGroup::CheckTypeAndMergeFrom(
644 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
645 MergeFrom(*::_pbi::DownCast<const ProtoLogGroup*>(
646 &from));
647 }
648
MergeFrom(const ProtoLogGroup & from)649 void ProtoLogGroup::MergeFrom(const ProtoLogGroup& from) {
650 ProtoLogGroup* const _this = this;
651 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProtoLogGroup)
652 GOOGLE_DCHECK_NE(&from, _this);
653 ::uint32_t cached_has_bits = 0;
654 (void) cached_has_bits;
655
656 cached_has_bits = from._impl_._has_bits_[0];
657 if (cached_has_bits & 0x00000007u) {
658 if (cached_has_bits & 0x00000001u) {
659 _this->_internal_set_group_name(from._internal_group_name());
660 }
661 if (cached_has_bits & 0x00000002u) {
662 _this->_impl_.log_from_ = from._impl_.log_from_;
663 }
664 if (cached_has_bits & 0x00000004u) {
665 _this->_impl_.collect_stacktrace_ = from._impl_.collect_stacktrace_;
666 }
667 _this->_impl_._has_bits_[0] |= cached_has_bits;
668 }
669 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
670 }
671
CopyFrom(const ProtoLogGroup & from)672 void ProtoLogGroup::CopyFrom(const ProtoLogGroup& from) {
673 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProtoLogGroup)
674 if (&from == this) return;
675 Clear();
676 MergeFrom(from);
677 }
678
IsInitialized() const679 bool ProtoLogGroup::IsInitialized() const {
680 return true;
681 }
682
InternalSwap(ProtoLogGroup * other)683 void ProtoLogGroup::InternalSwap(ProtoLogGroup* other) {
684 using std::swap;
685 auto* lhs_arena = GetArenaForAllocation();
686 auto* rhs_arena = other->GetArenaForAllocation();
687 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
688 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
689 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
690 &_impl_.group_name_, lhs_arena,
691 &other->_impl_.group_name_, rhs_arena
692 );
693 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
694 PROTOBUF_FIELD_OFFSET(ProtoLogGroup, _impl_.collect_stacktrace_)
695 + sizeof(ProtoLogGroup::_impl_.collect_stacktrace_) // NOLINT
696 - PROTOBUF_FIELD_OFFSET(ProtoLogGroup, _impl_.log_from_)>(
697 reinterpret_cast<char*>(&_impl_.log_from_),
698 reinterpret_cast<char*>(&other->_impl_.log_from_));
699 }
700
GetTypeName() const701 std::string ProtoLogGroup::GetTypeName() const {
702 return "perfetto.protos.ProtoLogGroup";
703 }
704
705
706 // @@protoc_insertion_point(namespace_scope)
707 } // namespace protos
708 } // namespace perfetto
709 PROTOBUF_NAMESPACE_OPEN
710 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProtoLogConfig*
CreateMaybeMessage(Arena * arena)711 Arena::CreateMaybeMessage< ::perfetto::protos::ProtoLogConfig >(Arena* arena) {
712 return Arena::CreateMessageInternal< ::perfetto::protos::ProtoLogConfig >(arena);
713 }
714 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProtoLogGroup*
CreateMaybeMessage(Arena * arena)715 Arena::CreateMaybeMessage< ::perfetto::protos::ProtoLogGroup >(Arena* arena) {
716 return Arena::CreateMessageInternal< ::perfetto::protos::ProtoLogGroup >(arena);
717 }
718 PROTOBUF_NAMESPACE_CLOSE
719
720 // @@protoc_insertion_point(global_scope)
721 #include <google/protobuf/port_undef.inc>
722