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