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