1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/statsd/statsd_atom.proto
3
4 #include "protos/perfetto/trace/statsd/statsd_atom.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 {
Atom(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR Atom::Atom(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._cached_size_)*/{}} {}
26 struct AtomDefaultTypeInternal {
AtomDefaultTypeInternalperfetto::protos::AtomDefaultTypeInternal27 PROTOBUF_CONSTEXPR AtomDefaultTypeInternal()
28 : _instance(::_pbi::ConstantInitialized{}) {}
~AtomDefaultTypeInternalperfetto::protos::AtomDefaultTypeInternal29 ~AtomDefaultTypeInternal() {}
30 union { // NOLINT(misc-non-private-member-variables-in-classes)
31 Atom _instance;
32 };
33 };
34 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AtomDefaultTypeInternal _Atom_default_instance_;
StatsdAtom(::_pbi::ConstantInitialized)35 PROTOBUF_CONSTEXPR StatsdAtom::StatsdAtom(
36 ::_pbi::ConstantInitialized): _impl_{
37 /*decltype(_impl_.atom_)*/{}
38 , /*decltype(_impl_.timestamp_nanos_)*/{}
39 , /*decltype(_impl_._cached_size_)*/{}} {}
40 struct StatsdAtomDefaultTypeInternal {
StatsdAtomDefaultTypeInternalperfetto::protos::StatsdAtomDefaultTypeInternal41 PROTOBUF_CONSTEXPR StatsdAtomDefaultTypeInternal()
42 : _instance(::_pbi::ConstantInitialized{}) {}
~StatsdAtomDefaultTypeInternalperfetto::protos::StatsdAtomDefaultTypeInternal43 ~StatsdAtomDefaultTypeInternal() {}
44 union { // NOLINT(misc-non-private-member-variables-in-classes)
45 StatsdAtom _instance;
46 };
47 };
48 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatsdAtomDefaultTypeInternal _StatsdAtom_default_instance_;
49 } // namespace protos
50 } // namespace perfetto
51 namespace perfetto {
52 namespace protos {
53
54 // ===================================================================
55
56 class Atom::_Internal {
57 public:
58 };
59
Atom(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)60 Atom::Atom(::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.Atom)
65 }
Atom(const Atom & from)66 Atom::Atom(const Atom& from)
67 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
68 Atom* const _this = this; (void)_this;
69 new (&_impl_) Impl_{
70 /*decltype(_impl_._cached_size_)*/{}};
71
72 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
73 // @@protoc_insertion_point(copy_constructor:perfetto.protos.Atom)
74 }
75
SharedCtor(::_pb::Arena * arena,bool is_message_owned)76 inline void Atom::SharedCtor(
77 ::_pb::Arena* arena, bool is_message_owned) {
78 (void)arena;
79 (void)is_message_owned;
80 new (&_impl_) Impl_{
81 /*decltype(_impl_._cached_size_)*/{}
82 };
83 }
84
~Atom()85 Atom::~Atom() {
86 // @@protoc_insertion_point(destructor:perfetto.protos.Atom)
87 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
88 (void)arena;
89 return;
90 }
91 SharedDtor();
92 }
93
SharedDtor()94 inline void Atom::SharedDtor() {
95 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
96 }
97
SetCachedSize(int size) const98 void Atom::SetCachedSize(int size) const {
99 _impl_._cached_size_.Set(size);
100 }
101
Clear()102 void Atom::Clear() {
103 // @@protoc_insertion_point(message_clear_start:perfetto.protos.Atom)
104 ::uint32_t cached_has_bits = 0;
105 // Prevent compiler warnings about cached_has_bits being unused
106 (void) cached_has_bits;
107
108 _internal_metadata_.Clear<std::string>();
109 }
110
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)111 const char* Atom::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
112 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
113 while (!ctx->Done(&ptr)) {
114 ::uint32_t tag;
115 ptr = ::_pbi::ReadTag(ptr, &tag);
116 if ((tag == 0) || ((tag & 7) == 4)) {
117 CHK_(ptr);
118 ctx->SetLastTag(tag);
119 goto message_done;
120 }
121 ptr = UnknownFieldParse(
122 tag,
123 _internal_metadata_.mutable_unknown_fields<std::string>(),
124 ptr, ctx);
125 CHK_(ptr != nullptr);
126 } // while
127 message_done:
128 return ptr;
129 failure:
130 ptr = nullptr;
131 goto message_done;
132 #undef CHK_
133 }
134
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const135 ::uint8_t* Atom::_InternalSerialize(
136 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
137 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.Atom)
138 ::uint32_t cached_has_bits = 0;
139 (void) cached_has_bits;
140
141 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
142 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
143 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
144 }
145 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.Atom)
146 return target;
147 }
148
ByteSizeLong() const149 size_t Atom::ByteSizeLong() const {
150 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.Atom)
151 size_t total_size = 0;
152
153 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
154 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
155 }
156 int cached_size = ::_pbi::ToCachedSize(total_size);
157 SetCachedSize(cached_size);
158 return total_size;
159 }
160
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)161 void Atom::CheckTypeAndMergeFrom(
162 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
163 MergeFrom(*::_pbi::DownCast<const Atom*>(
164 &from));
165 }
166
MergeFrom(const Atom & from)167 void Atom::MergeFrom(const Atom& from) {
168 Atom* const _this = this;
169 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.Atom)
170 GOOGLE_DCHECK_NE(&from, _this);
171 ::uint32_t cached_has_bits = 0;
172 (void) cached_has_bits;
173
174 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
175 }
176
CopyFrom(const Atom & from)177 void Atom::CopyFrom(const Atom& from) {
178 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.Atom)
179 if (&from == this) return;
180 Clear();
181 MergeFrom(from);
182 }
183
IsInitialized() const184 bool Atom::IsInitialized() const {
185 return true;
186 }
187
InternalSwap(Atom * other)188 void Atom::InternalSwap(Atom* other) {
189 using std::swap;
190 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
191 }
192
GetTypeName() const193 std::string Atom::GetTypeName() const {
194 return "perfetto.protos.Atom";
195 }
196
197
198 // ===================================================================
199
200 class StatsdAtom::_Internal {
201 public:
202 };
203
StatsdAtom(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)204 StatsdAtom::StatsdAtom(::PROTOBUF_NAMESPACE_ID::Arena* arena,
205 bool is_message_owned)
206 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
207 SharedCtor(arena, is_message_owned);
208 // @@protoc_insertion_point(arena_constructor:perfetto.protos.StatsdAtom)
209 }
StatsdAtom(const StatsdAtom & from)210 StatsdAtom::StatsdAtom(const StatsdAtom& from)
211 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
212 StatsdAtom* const _this = this; (void)_this;
213 new (&_impl_) Impl_{
214 decltype(_impl_.atom_){from._impl_.atom_}
215 , decltype(_impl_.timestamp_nanos_){from._impl_.timestamp_nanos_}
216 , /*decltype(_impl_._cached_size_)*/{}};
217
218 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
219 // @@protoc_insertion_point(copy_constructor:perfetto.protos.StatsdAtom)
220 }
221
SharedCtor(::_pb::Arena * arena,bool is_message_owned)222 inline void StatsdAtom::SharedCtor(
223 ::_pb::Arena* arena, bool is_message_owned) {
224 (void)arena;
225 (void)is_message_owned;
226 new (&_impl_) Impl_{
227 decltype(_impl_.atom_){arena}
228 , decltype(_impl_.timestamp_nanos_){arena}
229 , /*decltype(_impl_._cached_size_)*/{}
230 };
231 }
232
~StatsdAtom()233 StatsdAtom::~StatsdAtom() {
234 // @@protoc_insertion_point(destructor:perfetto.protos.StatsdAtom)
235 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
236 (void)arena;
237 return;
238 }
239 SharedDtor();
240 }
241
SharedDtor()242 inline void StatsdAtom::SharedDtor() {
243 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
244 _impl_.atom_.~RepeatedPtrField();
245 _impl_.timestamp_nanos_.~RepeatedField();
246 }
247
SetCachedSize(int size) const248 void StatsdAtom::SetCachedSize(int size) const {
249 _impl_._cached_size_.Set(size);
250 }
251
Clear()252 void StatsdAtom::Clear() {
253 // @@protoc_insertion_point(message_clear_start:perfetto.protos.StatsdAtom)
254 ::uint32_t cached_has_bits = 0;
255 // Prevent compiler warnings about cached_has_bits being unused
256 (void) cached_has_bits;
257
258 _impl_.atom_.Clear();
259 _impl_.timestamp_nanos_.Clear();
260 _internal_metadata_.Clear<std::string>();
261 }
262
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)263 const char* StatsdAtom::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
264 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
265 while (!ctx->Done(&ptr)) {
266 ::uint32_t tag;
267 ptr = ::_pbi::ReadTag(ptr, &tag);
268 switch (tag >> 3) {
269 // repeated .perfetto.protos.Atom atom = 1;
270 case 1:
271 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
272 ptr -= 1;
273 do {
274 ptr += 1;
275 ptr = ctx->ParseMessage(_internal_add_atom(), ptr);
276 CHK_(ptr);
277 if (!ctx->DataAvailable(ptr)) break;
278 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
279 } else {
280 goto handle_unusual;
281 }
282 continue;
283 // repeated int64 timestamp_nanos = 2;
284 case 2:
285 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
286 ptr -= 1;
287 do {
288 ptr += 1;
289 _internal_add_timestamp_nanos(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
290 CHK_(ptr);
291 if (!ctx->DataAvailable(ptr)) break;
292 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
293 } else if (static_cast<::uint8_t>(tag) == 18) {
294 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_timestamp_nanos(), ptr, ctx);
295 CHK_(ptr);
296 } else {
297 goto handle_unusual;
298 }
299 continue;
300 default:
301 goto handle_unusual;
302 } // switch
303 handle_unusual:
304 if ((tag == 0) || ((tag & 7) == 4)) {
305 CHK_(ptr);
306 ctx->SetLastTag(tag);
307 goto message_done;
308 }
309 ptr = UnknownFieldParse(
310 tag,
311 _internal_metadata_.mutable_unknown_fields<std::string>(),
312 ptr, ctx);
313 CHK_(ptr != nullptr);
314 } // while
315 message_done:
316 return ptr;
317 failure:
318 ptr = nullptr;
319 goto message_done;
320 #undef CHK_
321 }
322
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const323 ::uint8_t* StatsdAtom::_InternalSerialize(
324 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
325 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.StatsdAtom)
326 ::uint32_t cached_has_bits = 0;
327 (void) cached_has_bits;
328
329 // repeated .perfetto.protos.Atom atom = 1;
330 for (unsigned i = 0,
331 n = static_cast<unsigned>(this->_internal_atom_size()); i < n; i++) {
332 const auto& repfield = this->_internal_atom(i);
333 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
334 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
335 }
336
337 // repeated int64 timestamp_nanos = 2;
338 for (int i = 0, n = this->_internal_timestamp_nanos_size(); i < n; i++) {
339 target = stream->EnsureSpace(target);
340 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_timestamp_nanos(i), target);
341 }
342
343 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
344 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
345 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
346 }
347 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.StatsdAtom)
348 return target;
349 }
350
ByteSizeLong() const351 size_t StatsdAtom::ByteSizeLong() const {
352 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.StatsdAtom)
353 size_t total_size = 0;
354
355 ::uint32_t cached_has_bits = 0;
356 // Prevent compiler warnings about cached_has_bits being unused
357 (void) cached_has_bits;
358
359 // repeated .perfetto.protos.Atom atom = 1;
360 total_size += 1UL * this->_internal_atom_size();
361 for (const auto& msg : this->_impl_.atom_) {
362 total_size +=
363 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
364 }
365
366 // repeated int64 timestamp_nanos = 2;
367 {
368 size_t data_size = ::_pbi::WireFormatLite::
369 Int64Size(this->_impl_.timestamp_nanos_);
370 total_size += 1 *
371 ::_pbi::FromIntSize(this->_internal_timestamp_nanos_size());
372 total_size += data_size;
373 }
374
375 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
376 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
377 }
378 int cached_size = ::_pbi::ToCachedSize(total_size);
379 SetCachedSize(cached_size);
380 return total_size;
381 }
382
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)383 void StatsdAtom::CheckTypeAndMergeFrom(
384 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
385 MergeFrom(*::_pbi::DownCast<const StatsdAtom*>(
386 &from));
387 }
388
MergeFrom(const StatsdAtom & from)389 void StatsdAtom::MergeFrom(const StatsdAtom& from) {
390 StatsdAtom* const _this = this;
391 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.StatsdAtom)
392 GOOGLE_DCHECK_NE(&from, _this);
393 ::uint32_t cached_has_bits = 0;
394 (void) cached_has_bits;
395
396 _this->_impl_.atom_.MergeFrom(from._impl_.atom_);
397 _this->_impl_.timestamp_nanos_.MergeFrom(from._impl_.timestamp_nanos_);
398 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
399 }
400
CopyFrom(const StatsdAtom & from)401 void StatsdAtom::CopyFrom(const StatsdAtom& from) {
402 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.StatsdAtom)
403 if (&from == this) return;
404 Clear();
405 MergeFrom(from);
406 }
407
IsInitialized() const408 bool StatsdAtom::IsInitialized() const {
409 return true;
410 }
411
InternalSwap(StatsdAtom * other)412 void StatsdAtom::InternalSwap(StatsdAtom* other) {
413 using std::swap;
414 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
415 _impl_.atom_.InternalSwap(&other->_impl_.atom_);
416 _impl_.timestamp_nanos_.InternalSwap(&other->_impl_.timestamp_nanos_);
417 }
418
GetTypeName() const419 std::string StatsdAtom::GetTypeName() const {
420 return "perfetto.protos.StatsdAtom";
421 }
422
423
424 // @@protoc_insertion_point(namespace_scope)
425 } // namespace protos
426 } // namespace perfetto
427 PROTOBUF_NAMESPACE_OPEN
428 template<> PROTOBUF_NOINLINE ::perfetto::protos::Atom*
CreateMaybeMessage(Arena * arena)429 Arena::CreateMaybeMessage< ::perfetto::protos::Atom >(Arena* arena) {
430 return Arena::CreateMessageInternal< ::perfetto::protos::Atom >(arena);
431 }
432 template<> PROTOBUF_NOINLINE ::perfetto::protos::StatsdAtom*
CreateMaybeMessage(Arena * arena)433 Arena::CreateMaybeMessage< ::perfetto::protos::StatsdAtom >(Arena* arena) {
434 return Arena::CreateMessageInternal< ::perfetto::protos::StatsdAtom >(arena);
435 }
436 PROTOBUF_NAMESPACE_CLOSE
437
438 // @@protoc_insertion_point(global_scope)
439 #include <google/protobuf/port_undef.inc>
440