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