1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/trigger.proto
3 
4 #include "protos/perfetto/trace/trigger.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 {
Trigger(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR Trigger::Trigger(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.trigger_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28   , /*decltype(_impl_.producer_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
29   , /*decltype(_impl_.trusted_producer_uid_)*/0} {}
30 struct TriggerDefaultTypeInternal {
TriggerDefaultTypeInternalperfetto::protos::TriggerDefaultTypeInternal31   PROTOBUF_CONSTEXPR TriggerDefaultTypeInternal()
32       : _instance(::_pbi::ConstantInitialized{}) {}
~TriggerDefaultTypeInternalperfetto::protos::TriggerDefaultTypeInternal33   ~TriggerDefaultTypeInternal() {}
34   union {  // NOLINT(misc-non-private-member-variables-in-classes)
35     Trigger _instance;
36   };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TriggerDefaultTypeInternal _Trigger_default_instance_;
39 }  // namespace protos
40 }  // namespace perfetto
41 namespace perfetto {
42 namespace protos {
43 
44 // ===================================================================
45 
46 class Trigger::_Internal {
47  public:
48   using HasBits = decltype(std::declval<Trigger>()._impl_._has_bits_);
set_has_trigger_name(HasBits * has_bits)49   static void set_has_trigger_name(HasBits* has_bits) {
50     (*has_bits)[0] |= 1u;
51   }
set_has_producer_name(HasBits * has_bits)52   static void set_has_producer_name(HasBits* has_bits) {
53     (*has_bits)[0] |= 2u;
54   }
set_has_trusted_producer_uid(HasBits * has_bits)55   static void set_has_trusted_producer_uid(HasBits* has_bits) {
56     (*has_bits)[0] |= 4u;
57   }
58 };
59 
Trigger(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)60 Trigger::Trigger(::PROTOBUF_NAMESPACE_ID::Arena* arena,
61                          bool is_message_owned)
62   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
63   SharedCtor(arena, is_message_owned);
64   // @@protoc_insertion_point(arena_constructor:perfetto.protos.Trigger)
65 }
Trigger(const Trigger & from)66 Trigger::Trigger(const Trigger& from)
67   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
68   Trigger* const _this = this; (void)_this;
69   new (&_impl_) Impl_{
70       decltype(_impl_._has_bits_){from._impl_._has_bits_}
71     , /*decltype(_impl_._cached_size_)*/{}
72     , decltype(_impl_.trigger_name_){}
73     , decltype(_impl_.producer_name_){}
74     , decltype(_impl_.trusted_producer_uid_){}};
75 
76   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
77   _impl_.trigger_name_.InitDefault();
78   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
79     _impl_.trigger_name_.Set("", GetArenaForAllocation());
80   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
81   if (from._internal_has_trigger_name()) {
82     _this->_impl_.trigger_name_.Set(from._internal_trigger_name(),
83       _this->GetArenaForAllocation());
84   }
85   _impl_.producer_name_.InitDefault();
86   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
87     _impl_.producer_name_.Set("", GetArenaForAllocation());
88   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
89   if (from._internal_has_producer_name()) {
90     _this->_impl_.producer_name_.Set(from._internal_producer_name(),
91       _this->GetArenaForAllocation());
92   }
93   _this->_impl_.trusted_producer_uid_ = from._impl_.trusted_producer_uid_;
94   // @@protoc_insertion_point(copy_constructor:perfetto.protos.Trigger)
95 }
96 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)97 inline void Trigger::SharedCtor(
98     ::_pb::Arena* arena, bool is_message_owned) {
99   (void)arena;
100   (void)is_message_owned;
101   new (&_impl_) Impl_{
102       decltype(_impl_._has_bits_){}
103     , /*decltype(_impl_._cached_size_)*/{}
104     , decltype(_impl_.trigger_name_){}
105     , decltype(_impl_.producer_name_){}
106     , decltype(_impl_.trusted_producer_uid_){0}
107   };
108   _impl_.trigger_name_.InitDefault();
109   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
110     _impl_.trigger_name_.Set("", GetArenaForAllocation());
111   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
112   _impl_.producer_name_.InitDefault();
113   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
114     _impl_.producer_name_.Set("", GetArenaForAllocation());
115   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
116 }
117 
~Trigger()118 Trigger::~Trigger() {
119   // @@protoc_insertion_point(destructor:perfetto.protos.Trigger)
120   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
121   (void)arena;
122     return;
123   }
124   SharedDtor();
125 }
126 
SharedDtor()127 inline void Trigger::SharedDtor() {
128   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
129   _impl_.trigger_name_.Destroy();
130   _impl_.producer_name_.Destroy();
131 }
132 
SetCachedSize(int size) const133 void Trigger::SetCachedSize(int size) const {
134   _impl_._cached_size_.Set(size);
135 }
136 
Clear()137 void Trigger::Clear() {
138 // @@protoc_insertion_point(message_clear_start:perfetto.protos.Trigger)
139   ::uint32_t cached_has_bits = 0;
140   // Prevent compiler warnings about cached_has_bits being unused
141   (void) cached_has_bits;
142 
143   cached_has_bits = _impl_._has_bits_[0];
144   if (cached_has_bits & 0x00000003u) {
145     if (cached_has_bits & 0x00000001u) {
146       _impl_.trigger_name_.ClearNonDefaultToEmpty();
147     }
148     if (cached_has_bits & 0x00000002u) {
149       _impl_.producer_name_.ClearNonDefaultToEmpty();
150     }
151   }
152   _impl_.trusted_producer_uid_ = 0;
153   _impl_._has_bits_.Clear();
154   _internal_metadata_.Clear<std::string>();
155 }
156 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)157 const char* Trigger::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
158 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
159   _Internal::HasBits has_bits{};
160   while (!ctx->Done(&ptr)) {
161     ::uint32_t tag;
162     ptr = ::_pbi::ReadTag(ptr, &tag);
163     switch (tag >> 3) {
164       // optional string trigger_name = 1;
165       case 1:
166         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
167           auto str = _internal_mutable_trigger_name();
168           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
169           CHK_(ptr);
170         } else {
171           goto handle_unusual;
172         }
173         continue;
174       // optional string producer_name = 2;
175       case 2:
176         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
177           auto str = _internal_mutable_producer_name();
178           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
179           CHK_(ptr);
180         } else {
181           goto handle_unusual;
182         }
183         continue;
184       // optional int32 trusted_producer_uid = 3;
185       case 3:
186         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
187           _Internal::set_has_trusted_producer_uid(&has_bits);
188           _impl_.trusted_producer_uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
189           CHK_(ptr);
190         } else {
191           goto handle_unusual;
192         }
193         continue;
194       default:
195         goto handle_unusual;
196     }  // switch
197   handle_unusual:
198     if ((tag == 0) || ((tag & 7) == 4)) {
199       CHK_(ptr);
200       ctx->SetLastTag(tag);
201       goto message_done;
202     }
203     ptr = UnknownFieldParse(
204         tag,
205         _internal_metadata_.mutable_unknown_fields<std::string>(),
206         ptr, ctx);
207     CHK_(ptr != nullptr);
208   }  // while
209 message_done:
210   _impl_._has_bits_.Or(has_bits);
211   return ptr;
212 failure:
213   ptr = nullptr;
214   goto message_done;
215 #undef CHK_
216 }
217 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const218 ::uint8_t* Trigger::_InternalSerialize(
219     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
220   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.Trigger)
221   ::uint32_t cached_has_bits = 0;
222   (void) cached_has_bits;
223 
224   cached_has_bits = _impl_._has_bits_[0];
225   // optional string trigger_name = 1;
226   if (cached_has_bits & 0x00000001u) {
227     target = stream->WriteStringMaybeAliased(
228         1, this->_internal_trigger_name(), target);
229   }
230 
231   // optional string producer_name = 2;
232   if (cached_has_bits & 0x00000002u) {
233     target = stream->WriteStringMaybeAliased(
234         2, this->_internal_producer_name(), target);
235   }
236 
237   // optional int32 trusted_producer_uid = 3;
238   if (cached_has_bits & 0x00000004u) {
239     target = stream->EnsureSpace(target);
240     target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_trusted_producer_uid(), target);
241   }
242 
243   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
244     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
245         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
246   }
247   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.Trigger)
248   return target;
249 }
250 
ByteSizeLong() const251 size_t Trigger::ByteSizeLong() const {
252 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.Trigger)
253   size_t total_size = 0;
254 
255   ::uint32_t cached_has_bits = 0;
256   // Prevent compiler warnings about cached_has_bits being unused
257   (void) cached_has_bits;
258 
259   cached_has_bits = _impl_._has_bits_[0];
260   if (cached_has_bits & 0x00000007u) {
261     // optional string trigger_name = 1;
262     if (cached_has_bits & 0x00000001u) {
263       total_size += 1 +
264         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
265           this->_internal_trigger_name());
266     }
267 
268     // optional string producer_name = 2;
269     if (cached_has_bits & 0x00000002u) {
270       total_size += 1 +
271         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
272           this->_internal_producer_name());
273     }
274 
275     // optional int32 trusted_producer_uid = 3;
276     if (cached_has_bits & 0x00000004u) {
277       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_trusted_producer_uid());
278     }
279 
280   }
281   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
282     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
283   }
284   int cached_size = ::_pbi::ToCachedSize(total_size);
285   SetCachedSize(cached_size);
286   return total_size;
287 }
288 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)289 void Trigger::CheckTypeAndMergeFrom(
290     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
291   MergeFrom(*::_pbi::DownCast<const Trigger*>(
292       &from));
293 }
294 
MergeFrom(const Trigger & from)295 void Trigger::MergeFrom(const Trigger& from) {
296   Trigger* const _this = this;
297   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.Trigger)
298   GOOGLE_DCHECK_NE(&from, _this);
299   ::uint32_t cached_has_bits = 0;
300   (void) cached_has_bits;
301 
302   cached_has_bits = from._impl_._has_bits_[0];
303   if (cached_has_bits & 0x00000007u) {
304     if (cached_has_bits & 0x00000001u) {
305       _this->_internal_set_trigger_name(from._internal_trigger_name());
306     }
307     if (cached_has_bits & 0x00000002u) {
308       _this->_internal_set_producer_name(from._internal_producer_name());
309     }
310     if (cached_has_bits & 0x00000004u) {
311       _this->_impl_.trusted_producer_uid_ = from._impl_.trusted_producer_uid_;
312     }
313     _this->_impl_._has_bits_[0] |= cached_has_bits;
314   }
315   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
316 }
317 
CopyFrom(const Trigger & from)318 void Trigger::CopyFrom(const Trigger& from) {
319 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.Trigger)
320   if (&from == this) return;
321   Clear();
322   MergeFrom(from);
323 }
324 
IsInitialized() const325 bool Trigger::IsInitialized() const {
326   return true;
327 }
328 
InternalSwap(Trigger * other)329 void Trigger::InternalSwap(Trigger* other) {
330   using std::swap;
331   auto* lhs_arena = GetArenaForAllocation();
332   auto* rhs_arena = other->GetArenaForAllocation();
333   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
334   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
335   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
336       &_impl_.trigger_name_, lhs_arena,
337       &other->_impl_.trigger_name_, rhs_arena
338   );
339   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
340       &_impl_.producer_name_, lhs_arena,
341       &other->_impl_.producer_name_, rhs_arena
342   );
343   swap(_impl_.trusted_producer_uid_, other->_impl_.trusted_producer_uid_);
344 }
345 
GetTypeName() const346 std::string Trigger::GetTypeName() const {
347   return "perfetto.protos.Trigger";
348 }
349 
350 
351 // @@protoc_insertion_point(namespace_scope)
352 }  // namespace protos
353 }  // namespace perfetto
354 PROTOBUF_NAMESPACE_OPEN
355 template<> PROTOBUF_NOINLINE ::perfetto::protos::Trigger*
CreateMaybeMessage(Arena * arena)356 Arena::CreateMaybeMessage< ::perfetto::protos::Trigger >(Arena* arena) {
357   return Arena::CreateMessageInternal< ::perfetto::protos::Trigger >(arena);
358 }
359 PROTOBUF_NAMESPACE_CLOSE
360 
361 // @@protoc_insertion_point(global_scope)
362 #include <google/protobuf/port_undef.inc>
363