1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/android/windowmanager_config.proto
3
4 #include "protos/perfetto/config/android/windowmanager_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 {
WindowManagerConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR WindowManagerConfig::WindowManagerConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.log_frequency_)*/0
28 , /*decltype(_impl_.log_level_)*/0} {}
29 struct WindowManagerConfigDefaultTypeInternal {
WindowManagerConfigDefaultTypeInternalperfetto::protos::WindowManagerConfigDefaultTypeInternal30 PROTOBUF_CONSTEXPR WindowManagerConfigDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~WindowManagerConfigDefaultTypeInternalperfetto::protos::WindowManagerConfigDefaultTypeInternal32 ~WindowManagerConfigDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 WindowManagerConfig _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WindowManagerConfigDefaultTypeInternal _WindowManagerConfig_default_instance_;
38 } // namespace protos
39 } // namespace perfetto
40 namespace perfetto {
41 namespace protos {
WindowManagerConfig_LogFrequency_IsValid(int value)42 bool WindowManagerConfig_LogFrequency_IsValid(int value) {
43 switch (value) {
44 case 0:
45 case 1:
46 case 2:
47 case 3:
48 return true;
49 default:
50 return false;
51 }
52 }
53
54 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> WindowManagerConfig_LogFrequency_strings[4] = {};
55
56 static const char WindowManagerConfig_LogFrequency_names[] =
57 "LOG_FREQUENCY_FRAME"
58 "LOG_FREQUENCY_SINGLE_DUMP"
59 "LOG_FREQUENCY_TRANSACTION"
60 "LOG_FREQUENCY_UNSPECIFIED";
61
62 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry WindowManagerConfig_LogFrequency_entries[] = {
63 { {WindowManagerConfig_LogFrequency_names + 0, 19}, 1 },
64 { {WindowManagerConfig_LogFrequency_names + 19, 25}, 3 },
65 { {WindowManagerConfig_LogFrequency_names + 44, 25}, 2 },
66 { {WindowManagerConfig_LogFrequency_names + 69, 25}, 0 },
67 };
68
69 static const int WindowManagerConfig_LogFrequency_entries_by_number[] = {
70 3, // 0 -> LOG_FREQUENCY_UNSPECIFIED
71 0, // 1 -> LOG_FREQUENCY_FRAME
72 2, // 2 -> LOG_FREQUENCY_TRANSACTION
73 1, // 3 -> LOG_FREQUENCY_SINGLE_DUMP
74 };
75
WindowManagerConfig_LogFrequency_Name(WindowManagerConfig_LogFrequency value)76 const std::string& WindowManagerConfig_LogFrequency_Name(
77 WindowManagerConfig_LogFrequency value) {
78 static const bool dummy =
79 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
80 WindowManagerConfig_LogFrequency_entries,
81 WindowManagerConfig_LogFrequency_entries_by_number,
82 4, WindowManagerConfig_LogFrequency_strings);
83 (void) dummy;
84 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
85 WindowManagerConfig_LogFrequency_entries,
86 WindowManagerConfig_LogFrequency_entries_by_number,
87 4, value);
88 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
89 WindowManagerConfig_LogFrequency_strings[idx].get();
90 }
WindowManagerConfig_LogFrequency_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,WindowManagerConfig_LogFrequency * value)91 bool WindowManagerConfig_LogFrequency_Parse(
92 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, WindowManagerConfig_LogFrequency* value) {
93 int int_value;
94 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
95 WindowManagerConfig_LogFrequency_entries, 4, name, &int_value);
96 if (success) {
97 *value = static_cast<WindowManagerConfig_LogFrequency>(int_value);
98 }
99 return success;
100 }
101 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
102 constexpr WindowManagerConfig_LogFrequency WindowManagerConfig::LOG_FREQUENCY_UNSPECIFIED;
103 constexpr WindowManagerConfig_LogFrequency WindowManagerConfig::LOG_FREQUENCY_FRAME;
104 constexpr WindowManagerConfig_LogFrequency WindowManagerConfig::LOG_FREQUENCY_TRANSACTION;
105 constexpr WindowManagerConfig_LogFrequency WindowManagerConfig::LOG_FREQUENCY_SINGLE_DUMP;
106 constexpr WindowManagerConfig_LogFrequency WindowManagerConfig::LogFrequency_MIN;
107 constexpr WindowManagerConfig_LogFrequency WindowManagerConfig::LogFrequency_MAX;
108 constexpr int WindowManagerConfig::LogFrequency_ARRAYSIZE;
109 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
WindowManagerConfig_LogLevel_IsValid(int value)110 bool WindowManagerConfig_LogLevel_IsValid(int value) {
111 switch (value) {
112 case 0:
113 case 1:
114 case 2:
115 case 3:
116 return true;
117 default:
118 return false;
119 }
120 }
121
122 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> WindowManagerConfig_LogLevel_strings[4] = {};
123
124 static const char WindowManagerConfig_LogLevel_names[] =
125 "LOG_LEVEL_CRITICAL"
126 "LOG_LEVEL_DEBUG"
127 "LOG_LEVEL_UNSPECIFIED"
128 "LOG_LEVEL_VERBOSE";
129
130 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry WindowManagerConfig_LogLevel_entries[] = {
131 { {WindowManagerConfig_LogLevel_names + 0, 18}, 3 },
132 { {WindowManagerConfig_LogLevel_names + 18, 15}, 2 },
133 { {WindowManagerConfig_LogLevel_names + 33, 21}, 0 },
134 { {WindowManagerConfig_LogLevel_names + 54, 17}, 1 },
135 };
136
137 static const int WindowManagerConfig_LogLevel_entries_by_number[] = {
138 2, // 0 -> LOG_LEVEL_UNSPECIFIED
139 3, // 1 -> LOG_LEVEL_VERBOSE
140 1, // 2 -> LOG_LEVEL_DEBUG
141 0, // 3 -> LOG_LEVEL_CRITICAL
142 };
143
WindowManagerConfig_LogLevel_Name(WindowManagerConfig_LogLevel value)144 const std::string& WindowManagerConfig_LogLevel_Name(
145 WindowManagerConfig_LogLevel value) {
146 static const bool dummy =
147 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
148 WindowManagerConfig_LogLevel_entries,
149 WindowManagerConfig_LogLevel_entries_by_number,
150 4, WindowManagerConfig_LogLevel_strings);
151 (void) dummy;
152 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
153 WindowManagerConfig_LogLevel_entries,
154 WindowManagerConfig_LogLevel_entries_by_number,
155 4, value);
156 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
157 WindowManagerConfig_LogLevel_strings[idx].get();
158 }
WindowManagerConfig_LogLevel_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,WindowManagerConfig_LogLevel * value)159 bool WindowManagerConfig_LogLevel_Parse(
160 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, WindowManagerConfig_LogLevel* value) {
161 int int_value;
162 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
163 WindowManagerConfig_LogLevel_entries, 4, name, &int_value);
164 if (success) {
165 *value = static_cast<WindowManagerConfig_LogLevel>(int_value);
166 }
167 return success;
168 }
169 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
170 constexpr WindowManagerConfig_LogLevel WindowManagerConfig::LOG_LEVEL_UNSPECIFIED;
171 constexpr WindowManagerConfig_LogLevel WindowManagerConfig::LOG_LEVEL_VERBOSE;
172 constexpr WindowManagerConfig_LogLevel WindowManagerConfig::LOG_LEVEL_DEBUG;
173 constexpr WindowManagerConfig_LogLevel WindowManagerConfig::LOG_LEVEL_CRITICAL;
174 constexpr WindowManagerConfig_LogLevel WindowManagerConfig::LogLevel_MIN;
175 constexpr WindowManagerConfig_LogLevel WindowManagerConfig::LogLevel_MAX;
176 constexpr int WindowManagerConfig::LogLevel_ARRAYSIZE;
177 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
178
179 // ===================================================================
180
181 class WindowManagerConfig::_Internal {
182 public:
183 using HasBits = decltype(std::declval<WindowManagerConfig>()._impl_._has_bits_);
set_has_log_frequency(HasBits * has_bits)184 static void set_has_log_frequency(HasBits* has_bits) {
185 (*has_bits)[0] |= 1u;
186 }
set_has_log_level(HasBits * has_bits)187 static void set_has_log_level(HasBits* has_bits) {
188 (*has_bits)[0] |= 2u;
189 }
190 };
191
WindowManagerConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)192 WindowManagerConfig::WindowManagerConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
193 bool is_message_owned)
194 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
195 SharedCtor(arena, is_message_owned);
196 // @@protoc_insertion_point(arena_constructor:perfetto.protos.WindowManagerConfig)
197 }
WindowManagerConfig(const WindowManagerConfig & from)198 WindowManagerConfig::WindowManagerConfig(const WindowManagerConfig& from)
199 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
200 WindowManagerConfig* const _this = this; (void)_this;
201 new (&_impl_) Impl_{
202 decltype(_impl_._has_bits_){from._impl_._has_bits_}
203 , /*decltype(_impl_._cached_size_)*/{}
204 , decltype(_impl_.log_frequency_){}
205 , decltype(_impl_.log_level_){}};
206
207 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
208 ::memcpy(&_impl_.log_frequency_, &from._impl_.log_frequency_,
209 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.log_level_) -
210 reinterpret_cast<char*>(&_impl_.log_frequency_)) + sizeof(_impl_.log_level_));
211 // @@protoc_insertion_point(copy_constructor:perfetto.protos.WindowManagerConfig)
212 }
213
SharedCtor(::_pb::Arena * arena,bool is_message_owned)214 inline void WindowManagerConfig::SharedCtor(
215 ::_pb::Arena* arena, bool is_message_owned) {
216 (void)arena;
217 (void)is_message_owned;
218 new (&_impl_) Impl_{
219 decltype(_impl_._has_bits_){}
220 , /*decltype(_impl_._cached_size_)*/{}
221 , decltype(_impl_.log_frequency_){0}
222 , decltype(_impl_.log_level_){0}
223 };
224 }
225
~WindowManagerConfig()226 WindowManagerConfig::~WindowManagerConfig() {
227 // @@protoc_insertion_point(destructor:perfetto.protos.WindowManagerConfig)
228 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
229 (void)arena;
230 return;
231 }
232 SharedDtor();
233 }
234
SharedDtor()235 inline void WindowManagerConfig::SharedDtor() {
236 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
237 }
238
SetCachedSize(int size) const239 void WindowManagerConfig::SetCachedSize(int size) const {
240 _impl_._cached_size_.Set(size);
241 }
242
Clear()243 void WindowManagerConfig::Clear() {
244 // @@protoc_insertion_point(message_clear_start:perfetto.protos.WindowManagerConfig)
245 ::uint32_t cached_has_bits = 0;
246 // Prevent compiler warnings about cached_has_bits being unused
247 (void) cached_has_bits;
248
249 cached_has_bits = _impl_._has_bits_[0];
250 if (cached_has_bits & 0x00000003u) {
251 ::memset(&_impl_.log_frequency_, 0, static_cast<size_t>(
252 reinterpret_cast<char*>(&_impl_.log_level_) -
253 reinterpret_cast<char*>(&_impl_.log_frequency_)) + sizeof(_impl_.log_level_));
254 }
255 _impl_._has_bits_.Clear();
256 _internal_metadata_.Clear<std::string>();
257 }
258
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)259 const char* WindowManagerConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
260 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
261 _Internal::HasBits has_bits{};
262 while (!ctx->Done(&ptr)) {
263 ::uint32_t tag;
264 ptr = ::_pbi::ReadTag(ptr, &tag);
265 switch (tag >> 3) {
266 // optional .perfetto.protos.WindowManagerConfig.LogFrequency log_frequency = 1;
267 case 1:
268 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
269 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
270 CHK_(ptr);
271 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::WindowManagerConfig_LogFrequency_IsValid(val))) {
272 _internal_set_log_frequency(static_cast<::perfetto::protos::WindowManagerConfig_LogFrequency>(val));
273 } else {
274 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
275 }
276 } else {
277 goto handle_unusual;
278 }
279 continue;
280 // optional .perfetto.protos.WindowManagerConfig.LogLevel log_level = 2;
281 case 2:
282 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
283 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
284 CHK_(ptr);
285 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::WindowManagerConfig_LogLevel_IsValid(val))) {
286 _internal_set_log_level(static_cast<::perfetto::protos::WindowManagerConfig_LogLevel>(val));
287 } else {
288 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
289 }
290 } else {
291 goto handle_unusual;
292 }
293 continue;
294 default:
295 goto handle_unusual;
296 } // switch
297 handle_unusual:
298 if ((tag == 0) || ((tag & 7) == 4)) {
299 CHK_(ptr);
300 ctx->SetLastTag(tag);
301 goto message_done;
302 }
303 ptr = UnknownFieldParse(
304 tag,
305 _internal_metadata_.mutable_unknown_fields<std::string>(),
306 ptr, ctx);
307 CHK_(ptr != nullptr);
308 } // while
309 message_done:
310 _impl_._has_bits_.Or(has_bits);
311 return ptr;
312 failure:
313 ptr = nullptr;
314 goto message_done;
315 #undef CHK_
316 }
317
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const318 ::uint8_t* WindowManagerConfig::_InternalSerialize(
319 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
320 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.WindowManagerConfig)
321 ::uint32_t cached_has_bits = 0;
322 (void) cached_has_bits;
323
324 cached_has_bits = _impl_._has_bits_[0];
325 // optional .perfetto.protos.WindowManagerConfig.LogFrequency log_frequency = 1;
326 if (cached_has_bits & 0x00000001u) {
327 target = stream->EnsureSpace(target);
328 target = ::_pbi::WireFormatLite::WriteEnumToArray(
329 1, this->_internal_log_frequency(), target);
330 }
331
332 // optional .perfetto.protos.WindowManagerConfig.LogLevel log_level = 2;
333 if (cached_has_bits & 0x00000002u) {
334 target = stream->EnsureSpace(target);
335 target = ::_pbi::WireFormatLite::WriteEnumToArray(
336 2, this->_internal_log_level(), target);
337 }
338
339 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
340 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
341 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
342 }
343 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.WindowManagerConfig)
344 return target;
345 }
346
ByteSizeLong() const347 size_t WindowManagerConfig::ByteSizeLong() const {
348 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.WindowManagerConfig)
349 size_t total_size = 0;
350
351 ::uint32_t cached_has_bits = 0;
352 // Prevent compiler warnings about cached_has_bits being unused
353 (void) cached_has_bits;
354
355 cached_has_bits = _impl_._has_bits_[0];
356 if (cached_has_bits & 0x00000003u) {
357 // optional .perfetto.protos.WindowManagerConfig.LogFrequency log_frequency = 1;
358 if (cached_has_bits & 0x00000001u) {
359 total_size += 1 +
360 ::_pbi::WireFormatLite::EnumSize(this->_internal_log_frequency());
361 }
362
363 // optional .perfetto.protos.WindowManagerConfig.LogLevel log_level = 2;
364 if (cached_has_bits & 0x00000002u) {
365 total_size += 1 +
366 ::_pbi::WireFormatLite::EnumSize(this->_internal_log_level());
367 }
368
369 }
370 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
371 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
372 }
373 int cached_size = ::_pbi::ToCachedSize(total_size);
374 SetCachedSize(cached_size);
375 return total_size;
376 }
377
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)378 void WindowManagerConfig::CheckTypeAndMergeFrom(
379 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
380 MergeFrom(*::_pbi::DownCast<const WindowManagerConfig*>(
381 &from));
382 }
383
MergeFrom(const WindowManagerConfig & from)384 void WindowManagerConfig::MergeFrom(const WindowManagerConfig& from) {
385 WindowManagerConfig* const _this = this;
386 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.WindowManagerConfig)
387 GOOGLE_DCHECK_NE(&from, _this);
388 ::uint32_t cached_has_bits = 0;
389 (void) cached_has_bits;
390
391 cached_has_bits = from._impl_._has_bits_[0];
392 if (cached_has_bits & 0x00000003u) {
393 if (cached_has_bits & 0x00000001u) {
394 _this->_impl_.log_frequency_ = from._impl_.log_frequency_;
395 }
396 if (cached_has_bits & 0x00000002u) {
397 _this->_impl_.log_level_ = from._impl_.log_level_;
398 }
399 _this->_impl_._has_bits_[0] |= cached_has_bits;
400 }
401 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
402 }
403
CopyFrom(const WindowManagerConfig & from)404 void WindowManagerConfig::CopyFrom(const WindowManagerConfig& from) {
405 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.WindowManagerConfig)
406 if (&from == this) return;
407 Clear();
408 MergeFrom(from);
409 }
410
IsInitialized() const411 bool WindowManagerConfig::IsInitialized() const {
412 return true;
413 }
414
InternalSwap(WindowManagerConfig * other)415 void WindowManagerConfig::InternalSwap(WindowManagerConfig* other) {
416 using std::swap;
417 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
418 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
419 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
420 PROTOBUF_FIELD_OFFSET(WindowManagerConfig, _impl_.log_level_)
421 + sizeof(WindowManagerConfig::_impl_.log_level_) // NOLINT
422 - PROTOBUF_FIELD_OFFSET(WindowManagerConfig, _impl_.log_frequency_)>(
423 reinterpret_cast<char*>(&_impl_.log_frequency_),
424 reinterpret_cast<char*>(&other->_impl_.log_frequency_));
425 }
426
GetTypeName() const427 std::string WindowManagerConfig::GetTypeName() const {
428 return "perfetto.protos.WindowManagerConfig";
429 }
430
431
432 // @@protoc_insertion_point(namespace_scope)
433 } // namespace protos
434 } // namespace perfetto
435 PROTOBUF_NAMESPACE_OPEN
436 template<> PROTOBUF_NOINLINE ::perfetto::protos::WindowManagerConfig*
CreateMaybeMessage(Arena * arena)437 Arena::CreateMaybeMessage< ::perfetto::protos::WindowManagerConfig >(Arena* arena) {
438 return Arena::CreateMessageInternal< ::perfetto::protos::WindowManagerConfig >(arena);
439 }
440 PROTOBUF_NAMESPACE_CLOSE
441
442 // @@protoc_insertion_point(global_scope)
443 #include <google/protobuf/port_undef.inc>
444