1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/google_icc_trace.proto
3
4 #include "protos/perfetto/trace/ftrace/google_icc_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 {
GoogleIccEventFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR GoogleIccEventFtraceEvent::GoogleIccEventFtraceEvent(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.event_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.timestamp_)*/::uint64_t{0u}} {}
29 struct GoogleIccEventFtraceEventDefaultTypeInternal {
GoogleIccEventFtraceEventDefaultTypeInternalperfetto::protos::GoogleIccEventFtraceEventDefaultTypeInternal30 PROTOBUF_CONSTEXPR GoogleIccEventFtraceEventDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~GoogleIccEventFtraceEventDefaultTypeInternalperfetto::protos::GoogleIccEventFtraceEventDefaultTypeInternal32 ~GoogleIccEventFtraceEventDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 GoogleIccEventFtraceEvent _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GoogleIccEventFtraceEventDefaultTypeInternal _GoogleIccEventFtraceEvent_default_instance_;
38 } // namespace protos
39 } // namespace perfetto
40 namespace perfetto {
41 namespace protos {
42
43 // ===================================================================
44
45 class GoogleIccEventFtraceEvent::_Internal {
46 public:
47 using HasBits = decltype(std::declval<GoogleIccEventFtraceEvent>()._impl_._has_bits_);
set_has_event(HasBits * has_bits)48 static void set_has_event(HasBits* has_bits) {
49 (*has_bits)[0] |= 1u;
50 }
set_has_timestamp(HasBits * has_bits)51 static void set_has_timestamp(HasBits* has_bits) {
52 (*has_bits)[0] |= 2u;
53 }
54 };
55
GoogleIccEventFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)56 GoogleIccEventFtraceEvent::GoogleIccEventFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
57 bool is_message_owned)
58 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
59 SharedCtor(arena, is_message_owned);
60 // @@protoc_insertion_point(arena_constructor:perfetto.protos.GoogleIccEventFtraceEvent)
61 }
GoogleIccEventFtraceEvent(const GoogleIccEventFtraceEvent & from)62 GoogleIccEventFtraceEvent::GoogleIccEventFtraceEvent(const GoogleIccEventFtraceEvent& from)
63 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
64 GoogleIccEventFtraceEvent* const _this = this; (void)_this;
65 new (&_impl_) Impl_{
66 decltype(_impl_._has_bits_){from._impl_._has_bits_}
67 , /*decltype(_impl_._cached_size_)*/{}
68 , decltype(_impl_.event_){}
69 , decltype(_impl_.timestamp_){}};
70
71 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
72 _impl_.event_.InitDefault();
73 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
74 _impl_.event_.Set("", GetArenaForAllocation());
75 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
76 if (from._internal_has_event()) {
77 _this->_impl_.event_.Set(from._internal_event(),
78 _this->GetArenaForAllocation());
79 }
80 _this->_impl_.timestamp_ = from._impl_.timestamp_;
81 // @@protoc_insertion_point(copy_constructor:perfetto.protos.GoogleIccEventFtraceEvent)
82 }
83
SharedCtor(::_pb::Arena * arena,bool is_message_owned)84 inline void GoogleIccEventFtraceEvent::SharedCtor(
85 ::_pb::Arena* arena, bool is_message_owned) {
86 (void)arena;
87 (void)is_message_owned;
88 new (&_impl_) Impl_{
89 decltype(_impl_._has_bits_){}
90 , /*decltype(_impl_._cached_size_)*/{}
91 , decltype(_impl_.event_){}
92 , decltype(_impl_.timestamp_){::uint64_t{0u}}
93 };
94 _impl_.event_.InitDefault();
95 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
96 _impl_.event_.Set("", GetArenaForAllocation());
97 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
98 }
99
~GoogleIccEventFtraceEvent()100 GoogleIccEventFtraceEvent::~GoogleIccEventFtraceEvent() {
101 // @@protoc_insertion_point(destructor:perfetto.protos.GoogleIccEventFtraceEvent)
102 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
103 (void)arena;
104 return;
105 }
106 SharedDtor();
107 }
108
SharedDtor()109 inline void GoogleIccEventFtraceEvent::SharedDtor() {
110 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
111 _impl_.event_.Destroy();
112 }
113
SetCachedSize(int size) const114 void GoogleIccEventFtraceEvent::SetCachedSize(int size) const {
115 _impl_._cached_size_.Set(size);
116 }
117
Clear()118 void GoogleIccEventFtraceEvent::Clear() {
119 // @@protoc_insertion_point(message_clear_start:perfetto.protos.GoogleIccEventFtraceEvent)
120 ::uint32_t cached_has_bits = 0;
121 // Prevent compiler warnings about cached_has_bits being unused
122 (void) cached_has_bits;
123
124 cached_has_bits = _impl_._has_bits_[0];
125 if (cached_has_bits & 0x00000001u) {
126 _impl_.event_.ClearNonDefaultToEmpty();
127 }
128 _impl_.timestamp_ = ::uint64_t{0u};
129 _impl_._has_bits_.Clear();
130 _internal_metadata_.Clear<std::string>();
131 }
132
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)133 const char* GoogleIccEventFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
134 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
135 _Internal::HasBits has_bits{};
136 while (!ctx->Done(&ptr)) {
137 ::uint32_t tag;
138 ptr = ::_pbi::ReadTag(ptr, &tag);
139 switch (tag >> 3) {
140 // optional string event = 1;
141 case 1:
142 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
143 auto str = _internal_mutable_event();
144 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
145 CHK_(ptr);
146 } else {
147 goto handle_unusual;
148 }
149 continue;
150 // optional uint64 timestamp = 2;
151 case 2:
152 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
153 _Internal::set_has_timestamp(&has_bits);
154 _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
155 CHK_(ptr);
156 } else {
157 goto handle_unusual;
158 }
159 continue;
160 default:
161 goto handle_unusual;
162 } // switch
163 handle_unusual:
164 if ((tag == 0) || ((tag & 7) == 4)) {
165 CHK_(ptr);
166 ctx->SetLastTag(tag);
167 goto message_done;
168 }
169 ptr = UnknownFieldParse(
170 tag,
171 _internal_metadata_.mutable_unknown_fields<std::string>(),
172 ptr, ctx);
173 CHK_(ptr != nullptr);
174 } // while
175 message_done:
176 _impl_._has_bits_.Or(has_bits);
177 return ptr;
178 failure:
179 ptr = nullptr;
180 goto message_done;
181 #undef CHK_
182 }
183
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const184 ::uint8_t* GoogleIccEventFtraceEvent::_InternalSerialize(
185 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
186 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.GoogleIccEventFtraceEvent)
187 ::uint32_t cached_has_bits = 0;
188 (void) cached_has_bits;
189
190 cached_has_bits = _impl_._has_bits_[0];
191 // optional string event = 1;
192 if (cached_has_bits & 0x00000001u) {
193 target = stream->WriteStringMaybeAliased(
194 1, this->_internal_event(), target);
195 }
196
197 // optional uint64 timestamp = 2;
198 if (cached_has_bits & 0x00000002u) {
199 target = stream->EnsureSpace(target);
200 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_timestamp(), target);
201 }
202
203 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
204 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
205 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
206 }
207 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.GoogleIccEventFtraceEvent)
208 return target;
209 }
210
ByteSizeLong() const211 size_t GoogleIccEventFtraceEvent::ByteSizeLong() const {
212 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.GoogleIccEventFtraceEvent)
213 size_t total_size = 0;
214
215 ::uint32_t cached_has_bits = 0;
216 // Prevent compiler warnings about cached_has_bits being unused
217 (void) cached_has_bits;
218
219 cached_has_bits = _impl_._has_bits_[0];
220 if (cached_has_bits & 0x00000003u) {
221 // optional string event = 1;
222 if (cached_has_bits & 0x00000001u) {
223 total_size += 1 +
224 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
225 this->_internal_event());
226 }
227
228 // optional uint64 timestamp = 2;
229 if (cached_has_bits & 0x00000002u) {
230 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp());
231 }
232
233 }
234 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
235 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
236 }
237 int cached_size = ::_pbi::ToCachedSize(total_size);
238 SetCachedSize(cached_size);
239 return total_size;
240 }
241
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)242 void GoogleIccEventFtraceEvent::CheckTypeAndMergeFrom(
243 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
244 MergeFrom(*::_pbi::DownCast<const GoogleIccEventFtraceEvent*>(
245 &from));
246 }
247
MergeFrom(const GoogleIccEventFtraceEvent & from)248 void GoogleIccEventFtraceEvent::MergeFrom(const GoogleIccEventFtraceEvent& from) {
249 GoogleIccEventFtraceEvent* const _this = this;
250 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.GoogleIccEventFtraceEvent)
251 GOOGLE_DCHECK_NE(&from, _this);
252 ::uint32_t cached_has_bits = 0;
253 (void) cached_has_bits;
254
255 cached_has_bits = from._impl_._has_bits_[0];
256 if (cached_has_bits & 0x00000003u) {
257 if (cached_has_bits & 0x00000001u) {
258 _this->_internal_set_event(from._internal_event());
259 }
260 if (cached_has_bits & 0x00000002u) {
261 _this->_impl_.timestamp_ = from._impl_.timestamp_;
262 }
263 _this->_impl_._has_bits_[0] |= cached_has_bits;
264 }
265 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
266 }
267
CopyFrom(const GoogleIccEventFtraceEvent & from)268 void GoogleIccEventFtraceEvent::CopyFrom(const GoogleIccEventFtraceEvent& from) {
269 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.GoogleIccEventFtraceEvent)
270 if (&from == this) return;
271 Clear();
272 MergeFrom(from);
273 }
274
IsInitialized() const275 bool GoogleIccEventFtraceEvent::IsInitialized() const {
276 return true;
277 }
278
InternalSwap(GoogleIccEventFtraceEvent * other)279 void GoogleIccEventFtraceEvent::InternalSwap(GoogleIccEventFtraceEvent* other) {
280 using std::swap;
281 auto* lhs_arena = GetArenaForAllocation();
282 auto* rhs_arena = other->GetArenaForAllocation();
283 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
284 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
285 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
286 &_impl_.event_, lhs_arena,
287 &other->_impl_.event_, rhs_arena
288 );
289 swap(_impl_.timestamp_, other->_impl_.timestamp_);
290 }
291
GetTypeName() const292 std::string GoogleIccEventFtraceEvent::GetTypeName() const {
293 return "perfetto.protos.GoogleIccEventFtraceEvent";
294 }
295
296
297 // @@protoc_insertion_point(namespace_scope)
298 } // namespace protos
299 } // namespace perfetto
300 PROTOBUF_NAMESPACE_OPEN
301 template<> PROTOBUF_NOINLINE ::perfetto::protos::GoogleIccEventFtraceEvent*
CreateMaybeMessage(Arena * arena)302 Arena::CreateMaybeMessage< ::perfetto::protos::GoogleIccEventFtraceEvent >(Arena* arena) {
303 return Arena::CreateMessageInternal< ::perfetto::protos::GoogleIccEventFtraceEvent >(arena);
304 }
305 PROTOBUF_NAMESPACE_CLOSE
306
307 // @@protoc_insertion_point(global_scope)
308 #include <google/protobuf/port_undef.inc>
309