1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/config/android/android_log_config.proto
3 
4 #include "protos/perfetto/config/android/android_log_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 {
AndroidLogConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR AndroidLogConfig::AndroidLogConfig(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.log_ids_)*/{}
28   , /*decltype(_impl_.filter_tags_)*/{}
29   , /*decltype(_impl_.min_prio_)*/0} {}
30 struct AndroidLogConfigDefaultTypeInternal {
AndroidLogConfigDefaultTypeInternalperfetto::protos::AndroidLogConfigDefaultTypeInternal31   PROTOBUF_CONSTEXPR AndroidLogConfigDefaultTypeInternal()
32       : _instance(::_pbi::ConstantInitialized{}) {}
~AndroidLogConfigDefaultTypeInternalperfetto::protos::AndroidLogConfigDefaultTypeInternal33   ~AndroidLogConfigDefaultTypeInternal() {}
34   union {  // NOLINT(misc-non-private-member-variables-in-classes)
35     AndroidLogConfig _instance;
36   };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AndroidLogConfigDefaultTypeInternal _AndroidLogConfig_default_instance_;
39 }  // namespace protos
40 }  // namespace perfetto
41 namespace perfetto {
42 namespace protos {
43 
44 // ===================================================================
45 
46 class AndroidLogConfig::_Internal {
47  public:
48   using HasBits = decltype(std::declval<AndroidLogConfig>()._impl_._has_bits_);
set_has_min_prio(HasBits * has_bits)49   static void set_has_min_prio(HasBits* has_bits) {
50     (*has_bits)[0] |= 1u;
51   }
52 };
53 
AndroidLogConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)54 AndroidLogConfig::AndroidLogConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
55                          bool is_message_owned)
56   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
57   SharedCtor(arena, is_message_owned);
58   // @@protoc_insertion_point(arena_constructor:perfetto.protos.AndroidLogConfig)
59 }
AndroidLogConfig(const AndroidLogConfig & from)60 AndroidLogConfig::AndroidLogConfig(const AndroidLogConfig& from)
61   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
62   AndroidLogConfig* const _this = this; (void)_this;
63   new (&_impl_) Impl_{
64       decltype(_impl_._has_bits_){from._impl_._has_bits_}
65     , /*decltype(_impl_._cached_size_)*/{}
66     , decltype(_impl_.log_ids_){from._impl_.log_ids_}
67     , decltype(_impl_.filter_tags_){from._impl_.filter_tags_}
68     , decltype(_impl_.min_prio_){}};
69 
70   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
71   _this->_impl_.min_prio_ = from._impl_.min_prio_;
72   // @@protoc_insertion_point(copy_constructor:perfetto.protos.AndroidLogConfig)
73 }
74 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)75 inline void AndroidLogConfig::SharedCtor(
76     ::_pb::Arena* arena, bool is_message_owned) {
77   (void)arena;
78   (void)is_message_owned;
79   new (&_impl_) Impl_{
80       decltype(_impl_._has_bits_){}
81     , /*decltype(_impl_._cached_size_)*/{}
82     , decltype(_impl_.log_ids_){arena}
83     , decltype(_impl_.filter_tags_){arena}
84     , decltype(_impl_.min_prio_){0}
85   };
86 }
87 
~AndroidLogConfig()88 AndroidLogConfig::~AndroidLogConfig() {
89   // @@protoc_insertion_point(destructor:perfetto.protos.AndroidLogConfig)
90   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
91   (void)arena;
92     return;
93   }
94   SharedDtor();
95 }
96 
SharedDtor()97 inline void AndroidLogConfig::SharedDtor() {
98   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
99   _impl_.log_ids_.~RepeatedField();
100   _impl_.filter_tags_.~RepeatedPtrField();
101 }
102 
SetCachedSize(int size) const103 void AndroidLogConfig::SetCachedSize(int size) const {
104   _impl_._cached_size_.Set(size);
105 }
106 
Clear()107 void AndroidLogConfig::Clear() {
108 // @@protoc_insertion_point(message_clear_start:perfetto.protos.AndroidLogConfig)
109   ::uint32_t cached_has_bits = 0;
110   // Prevent compiler warnings about cached_has_bits being unused
111   (void) cached_has_bits;
112 
113   _impl_.log_ids_.Clear();
114   _impl_.filter_tags_.Clear();
115   _impl_.min_prio_ = 0;
116   _impl_._has_bits_.Clear();
117   _internal_metadata_.Clear<std::string>();
118 }
119 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)120 const char* AndroidLogConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
121 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
122   _Internal::HasBits has_bits{};
123   while (!ctx->Done(&ptr)) {
124     ::uint32_t tag;
125     ptr = ::_pbi::ReadTag(ptr, &tag);
126     switch (tag >> 3) {
127       // repeated .perfetto.protos.AndroidLogId log_ids = 1;
128       case 1:
129         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
130           ptr -= 1;
131           do {
132             ptr += 1;
133             ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
134             CHK_(ptr);
135             if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::AndroidLogId_IsValid(val))) {
136               _internal_add_log_ids(static_cast<::perfetto::protos::AndroidLogId>(val));
137             } else {
138               ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
139             }
140             if (!ctx->DataAvailable(ptr)) break;
141           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8>(ptr));
142         } else if (static_cast<::uint8_t>(tag) == 10) {
143           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_log_ids(), ptr, ctx, ::perfetto::protos::AndroidLogId_IsValid, &_internal_metadata_, 1);
144           CHK_(ptr);
145         } else {
146           goto handle_unusual;
147         }
148         continue;
149       // optional .perfetto.protos.AndroidLogPriority min_prio = 3;
150       case 3:
151         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
152           ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
153           CHK_(ptr);
154           if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::AndroidLogPriority_IsValid(val))) {
155             _internal_set_min_prio(static_cast<::perfetto::protos::AndroidLogPriority>(val));
156           } else {
157             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
158           }
159         } else {
160           goto handle_unusual;
161         }
162         continue;
163       // repeated string filter_tags = 4;
164       case 4:
165         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
166           ptr -= 1;
167           do {
168             ptr += 1;
169             auto str = _internal_add_filter_tags();
170             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
171             CHK_(ptr);
172             if (!ctx->DataAvailable(ptr)) break;
173           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
174         } else {
175           goto handle_unusual;
176         }
177         continue;
178       default:
179         goto handle_unusual;
180     }  // switch
181   handle_unusual:
182     if ((tag == 0) || ((tag & 7) == 4)) {
183       CHK_(ptr);
184       ctx->SetLastTag(tag);
185       goto message_done;
186     }
187     ptr = UnknownFieldParse(
188         tag,
189         _internal_metadata_.mutable_unknown_fields<std::string>(),
190         ptr, ctx);
191     CHK_(ptr != nullptr);
192   }  // while
193 message_done:
194   _impl_._has_bits_.Or(has_bits);
195   return ptr;
196 failure:
197   ptr = nullptr;
198   goto message_done;
199 #undef CHK_
200 }
201 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const202 ::uint8_t* AndroidLogConfig::_InternalSerialize(
203     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
204   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.AndroidLogConfig)
205   ::uint32_t cached_has_bits = 0;
206   (void) cached_has_bits;
207 
208   // repeated .perfetto.protos.AndroidLogId log_ids = 1;
209   for (int i = 0, n = this->_internal_log_ids_size(); i < n; i++) {
210     target = stream->EnsureSpace(target);
211     target = ::_pbi::WireFormatLite::WriteEnumToArray(
212         1, this->_internal_log_ids(i), target);
213   }
214 
215   cached_has_bits = _impl_._has_bits_[0];
216   // optional .perfetto.protos.AndroidLogPriority min_prio = 3;
217   if (cached_has_bits & 0x00000001u) {
218     target = stream->EnsureSpace(target);
219     target = ::_pbi::WireFormatLite::WriteEnumToArray(
220       3, this->_internal_min_prio(), target);
221   }
222 
223   // repeated string filter_tags = 4;
224   for (int i = 0, n = this->_internal_filter_tags_size(); i < n; i++) {
225     const auto& s = this->_internal_filter_tags(i);
226     target = stream->WriteString(4, s, target);
227   }
228 
229   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
230     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
231         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
232   }
233   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.AndroidLogConfig)
234   return target;
235 }
236 
ByteSizeLong() const237 size_t AndroidLogConfig::ByteSizeLong() const {
238 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.AndroidLogConfig)
239   size_t total_size = 0;
240 
241   ::uint32_t cached_has_bits = 0;
242   // Prevent compiler warnings about cached_has_bits being unused
243   (void) cached_has_bits;
244 
245   // repeated .perfetto.protos.AndroidLogId log_ids = 1;
246   {
247     size_t data_size = 0;
248     unsigned int count = static_cast<unsigned int>(this->_internal_log_ids_size());for (unsigned int i = 0; i < count; i++) {
249       data_size += ::_pbi::WireFormatLite::EnumSize(
250         this->_internal_log_ids(static_cast<int>(i)));
251     }
252     total_size += (1UL * count) + data_size;
253   }
254 
255   // repeated string filter_tags = 4;
256   total_size += 1 *
257       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.filter_tags_.size());
258   for (int i = 0, n = _impl_.filter_tags_.size(); i < n; i++) {
259     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
260       _impl_.filter_tags_.Get(i));
261   }
262 
263   // optional .perfetto.protos.AndroidLogPriority min_prio = 3;
264   cached_has_bits = _impl_._has_bits_[0];
265   if (cached_has_bits & 0x00000001u) {
266     total_size += 1 +
267       ::_pbi::WireFormatLite::EnumSize(this->_internal_min_prio());
268   }
269 
270   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
271     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
272   }
273   int cached_size = ::_pbi::ToCachedSize(total_size);
274   SetCachedSize(cached_size);
275   return total_size;
276 }
277 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)278 void AndroidLogConfig::CheckTypeAndMergeFrom(
279     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
280   MergeFrom(*::_pbi::DownCast<const AndroidLogConfig*>(
281       &from));
282 }
283 
MergeFrom(const AndroidLogConfig & from)284 void AndroidLogConfig::MergeFrom(const AndroidLogConfig& from) {
285   AndroidLogConfig* const _this = this;
286   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.AndroidLogConfig)
287   GOOGLE_DCHECK_NE(&from, _this);
288   ::uint32_t cached_has_bits = 0;
289   (void) cached_has_bits;
290 
291   _this->_impl_.log_ids_.MergeFrom(from._impl_.log_ids_);
292   _this->_impl_.filter_tags_.MergeFrom(from._impl_.filter_tags_);
293   if (from._internal_has_min_prio()) {
294     _this->_internal_set_min_prio(from._internal_min_prio());
295   }
296   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
297 }
298 
CopyFrom(const AndroidLogConfig & from)299 void AndroidLogConfig::CopyFrom(const AndroidLogConfig& from) {
300 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.AndroidLogConfig)
301   if (&from == this) return;
302   Clear();
303   MergeFrom(from);
304 }
305 
IsInitialized() const306 bool AndroidLogConfig::IsInitialized() const {
307   return true;
308 }
309 
InternalSwap(AndroidLogConfig * other)310 void AndroidLogConfig::InternalSwap(AndroidLogConfig* other) {
311   using std::swap;
312   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
313   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
314   _impl_.log_ids_.InternalSwap(&other->_impl_.log_ids_);
315   _impl_.filter_tags_.InternalSwap(&other->_impl_.filter_tags_);
316   swap(_impl_.min_prio_, other->_impl_.min_prio_);
317 }
318 
GetTypeName() const319 std::string AndroidLogConfig::GetTypeName() const {
320   return "perfetto.protos.AndroidLogConfig";
321 }
322 
323 
324 // @@protoc_insertion_point(namespace_scope)
325 }  // namespace protos
326 }  // namespace perfetto
327 PROTOBUF_NAMESPACE_OPEN
328 template<> PROTOBUF_NOINLINE ::perfetto::protos::AndroidLogConfig*
CreateMaybeMessage(Arena * arena)329 Arena::CreateMaybeMessage< ::perfetto::protos::AndroidLogConfig >(Arena* arena) {
330   return Arena::CreateMessageInternal< ::perfetto::protos::AndroidLogConfig >(arena);
331 }
332 PROTOBUF_NAMESPACE_CLOSE
333 
334 // @@protoc_insertion_point(global_scope)
335 #include <google/protobuf/port_undef.inc>
336