1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: custom_tab_session.proto
3
4 #include "custom_tab_session.pb.h"
5
6 #include <algorithm>
7
8 #include <google/protobuf/io/coded_stream.h>
9 #include <google/protobuf/extension_set.h>
10 #include <google/protobuf/wire_format_lite.h>
11 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
12 // @@protoc_insertion_point(includes)
13 #include <google/protobuf/port_def.inc>
14
15 PROTOBUF_PRAGMA_INIT_SEG
16
17 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
18 namespace _pbi = _pb::internal;
19
20 namespace metrics {
CustomTabSessionProto(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR CustomTabSessionProto::CustomTabSessionProto(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.package_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
26 , /*decltype(_impl_.time_sec_)*/int64_t{0}
27 , /*decltype(_impl_.session_duration_sec_)*/0
28 , /*decltype(_impl_.did_user_interact_)*/false
29 , /*decltype(_impl_.was_user_closed_)*/false
30 , /*decltype(_impl_.is_partial_)*/false} {}
31 struct CustomTabSessionProtoDefaultTypeInternal {
CustomTabSessionProtoDefaultTypeInternalmetrics::CustomTabSessionProtoDefaultTypeInternal32 PROTOBUF_CONSTEXPR CustomTabSessionProtoDefaultTypeInternal()
33 : _instance(::_pbi::ConstantInitialized{}) {}
~CustomTabSessionProtoDefaultTypeInternalmetrics::CustomTabSessionProtoDefaultTypeInternal34 ~CustomTabSessionProtoDefaultTypeInternal() {}
35 union {
36 CustomTabSessionProto _instance;
37 };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CustomTabSessionProtoDefaultTypeInternal _CustomTabSessionProto_default_instance_;
40 } // namespace metrics
41 namespace metrics {
42
43 // ===================================================================
44
45 class CustomTabSessionProto::_Internal {
46 public:
47 using HasBits = decltype(std::declval<CustomTabSessionProto>()._impl_._has_bits_);
set_has_time_sec(HasBits * has_bits)48 static void set_has_time_sec(HasBits* has_bits) {
49 (*has_bits)[0] |= 2u;
50 }
set_has_package_name(HasBits * has_bits)51 static void set_has_package_name(HasBits* has_bits) {
52 (*has_bits)[0] |= 1u;
53 }
set_has_session_duration_sec(HasBits * has_bits)54 static void set_has_session_duration_sec(HasBits* has_bits) {
55 (*has_bits)[0] |= 4u;
56 }
set_has_did_user_interact(HasBits * has_bits)57 static void set_has_did_user_interact(HasBits* has_bits) {
58 (*has_bits)[0] |= 8u;
59 }
set_has_was_user_closed(HasBits * has_bits)60 static void set_has_was_user_closed(HasBits* has_bits) {
61 (*has_bits)[0] |= 16u;
62 }
set_has_is_partial(HasBits * has_bits)63 static void set_has_is_partial(HasBits* has_bits) {
64 (*has_bits)[0] |= 32u;
65 }
66 };
67
CustomTabSessionProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)68 CustomTabSessionProto::CustomTabSessionProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
69 bool is_message_owned)
70 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
71 SharedCtor(arena, is_message_owned);
72 // @@protoc_insertion_point(arena_constructor:metrics.CustomTabSessionProto)
73 }
CustomTabSessionProto(const CustomTabSessionProto & from)74 CustomTabSessionProto::CustomTabSessionProto(const CustomTabSessionProto& from)
75 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
76 CustomTabSessionProto* const _this = this; (void)_this;
77 new (&_impl_) Impl_{
78 decltype(_impl_._has_bits_){from._impl_._has_bits_}
79 , /*decltype(_impl_._cached_size_)*/{}
80 , decltype(_impl_.package_name_){}
81 , decltype(_impl_.time_sec_){}
82 , decltype(_impl_.session_duration_sec_){}
83 , decltype(_impl_.did_user_interact_){}
84 , decltype(_impl_.was_user_closed_){}
85 , decltype(_impl_.is_partial_){}};
86
87 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
88 _impl_.package_name_.InitDefault();
89 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
90 _impl_.package_name_.Set("", GetArenaForAllocation());
91 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
92 if (from._internal_has_package_name()) {
93 _this->_impl_.package_name_.Set(from._internal_package_name(),
94 _this->GetArenaForAllocation());
95 }
96 ::memcpy(&_impl_.time_sec_, &from._impl_.time_sec_,
97 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.is_partial_) -
98 reinterpret_cast<char*>(&_impl_.time_sec_)) + sizeof(_impl_.is_partial_));
99 // @@protoc_insertion_point(copy_constructor:metrics.CustomTabSessionProto)
100 }
101
SharedCtor(::_pb::Arena * arena,bool is_message_owned)102 inline void CustomTabSessionProto::SharedCtor(
103 ::_pb::Arena* arena, bool is_message_owned) {
104 (void)arena;
105 (void)is_message_owned;
106 new (&_impl_) Impl_{
107 decltype(_impl_._has_bits_){}
108 , /*decltype(_impl_._cached_size_)*/{}
109 , decltype(_impl_.package_name_){}
110 , decltype(_impl_.time_sec_){int64_t{0}}
111 , decltype(_impl_.session_duration_sec_){0}
112 , decltype(_impl_.did_user_interact_){false}
113 , decltype(_impl_.was_user_closed_){false}
114 , decltype(_impl_.is_partial_){false}
115 };
116 _impl_.package_name_.InitDefault();
117 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
118 _impl_.package_name_.Set("", GetArenaForAllocation());
119 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
120 }
121
~CustomTabSessionProto()122 CustomTabSessionProto::~CustomTabSessionProto() {
123 // @@protoc_insertion_point(destructor:metrics.CustomTabSessionProto)
124 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
125 (void)arena;
126 return;
127 }
128 SharedDtor();
129 }
130
SharedDtor()131 inline void CustomTabSessionProto::SharedDtor() {
132 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
133 _impl_.package_name_.Destroy();
134 }
135
SetCachedSize(int size) const136 void CustomTabSessionProto::SetCachedSize(int size) const {
137 _impl_._cached_size_.Set(size);
138 }
139
Clear()140 void CustomTabSessionProto::Clear() {
141 // @@protoc_insertion_point(message_clear_start:metrics.CustomTabSessionProto)
142 uint32_t cached_has_bits = 0;
143 // Prevent compiler warnings about cached_has_bits being unused
144 (void) cached_has_bits;
145
146 cached_has_bits = _impl_._has_bits_[0];
147 if (cached_has_bits & 0x00000001u) {
148 _impl_.package_name_.ClearNonDefaultToEmpty();
149 }
150 if (cached_has_bits & 0x0000003eu) {
151 ::memset(&_impl_.time_sec_, 0, static_cast<size_t>(
152 reinterpret_cast<char*>(&_impl_.is_partial_) -
153 reinterpret_cast<char*>(&_impl_.time_sec_)) + sizeof(_impl_.is_partial_));
154 }
155 _impl_._has_bits_.Clear();
156 _internal_metadata_.Clear<std::string>();
157 }
158
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)159 const char* CustomTabSessionProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
160 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
161 _Internal::HasBits has_bits{};
162 while (!ctx->Done(&ptr)) {
163 uint32_t tag;
164 ptr = ::_pbi::ReadTag(ptr, &tag);
165 switch (tag >> 3) {
166 // optional int64 time_sec = 1;
167 case 1:
168 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
169 _Internal::set_has_time_sec(&has_bits);
170 _impl_.time_sec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
171 CHK_(ptr);
172 } else
173 goto handle_unusual;
174 continue;
175 // optional string package_name = 2;
176 case 2:
177 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
178 auto str = _internal_mutable_package_name();
179 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
180 CHK_(ptr);
181 } else
182 goto handle_unusual;
183 continue;
184 // optional int32 session_duration_sec = 3;
185 case 3:
186 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
187 _Internal::set_has_session_duration_sec(&has_bits);
188 _impl_.session_duration_sec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
189 CHK_(ptr);
190 } else
191 goto handle_unusual;
192 continue;
193 // optional bool did_user_interact = 4;
194 case 4:
195 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
196 _Internal::set_has_did_user_interact(&has_bits);
197 _impl_.did_user_interact_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
198 CHK_(ptr);
199 } else
200 goto handle_unusual;
201 continue;
202 // optional bool was_user_closed = 5;
203 case 5:
204 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
205 _Internal::set_has_was_user_closed(&has_bits);
206 _impl_.was_user_closed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
207 CHK_(ptr);
208 } else
209 goto handle_unusual;
210 continue;
211 // optional bool is_partial = 6;
212 case 6:
213 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
214 _Internal::set_has_is_partial(&has_bits);
215 _impl_.is_partial_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
216 CHK_(ptr);
217 } else
218 goto handle_unusual;
219 continue;
220 default:
221 goto handle_unusual;
222 } // switch
223 handle_unusual:
224 if ((tag == 0) || ((tag & 7) == 4)) {
225 CHK_(ptr);
226 ctx->SetLastTag(tag);
227 goto message_done;
228 }
229 ptr = UnknownFieldParse(
230 tag,
231 _internal_metadata_.mutable_unknown_fields<std::string>(),
232 ptr, ctx);
233 CHK_(ptr != nullptr);
234 } // while
235 message_done:
236 _impl_._has_bits_.Or(has_bits);
237 return ptr;
238 failure:
239 ptr = nullptr;
240 goto message_done;
241 #undef CHK_
242 }
243
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const244 uint8_t* CustomTabSessionProto::_InternalSerialize(
245 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
246 // @@protoc_insertion_point(serialize_to_array_start:metrics.CustomTabSessionProto)
247 uint32_t cached_has_bits = 0;
248 (void) cached_has_bits;
249
250 cached_has_bits = _impl_._has_bits_[0];
251 // optional int64 time_sec = 1;
252 if (cached_has_bits & 0x00000002u) {
253 target = stream->EnsureSpace(target);
254 target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_time_sec(), target);
255 }
256
257 // optional string package_name = 2;
258 if (cached_has_bits & 0x00000001u) {
259 target = stream->WriteStringMaybeAliased(
260 2, this->_internal_package_name(), target);
261 }
262
263 // optional int32 session_duration_sec = 3;
264 if (cached_has_bits & 0x00000004u) {
265 target = stream->EnsureSpace(target);
266 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_session_duration_sec(), target);
267 }
268
269 // optional bool did_user_interact = 4;
270 if (cached_has_bits & 0x00000008u) {
271 target = stream->EnsureSpace(target);
272 target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_did_user_interact(), target);
273 }
274
275 // optional bool was_user_closed = 5;
276 if (cached_has_bits & 0x00000010u) {
277 target = stream->EnsureSpace(target);
278 target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_was_user_closed(), target);
279 }
280
281 // optional bool is_partial = 6;
282 if (cached_has_bits & 0x00000020u) {
283 target = stream->EnsureSpace(target);
284 target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_is_partial(), target);
285 }
286
287 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
288 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
289 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
290 }
291 // @@protoc_insertion_point(serialize_to_array_end:metrics.CustomTabSessionProto)
292 return target;
293 }
294
ByteSizeLong() const295 size_t CustomTabSessionProto::ByteSizeLong() const {
296 // @@protoc_insertion_point(message_byte_size_start:metrics.CustomTabSessionProto)
297 size_t total_size = 0;
298
299 uint32_t cached_has_bits = 0;
300 // Prevent compiler warnings about cached_has_bits being unused
301 (void) cached_has_bits;
302
303 cached_has_bits = _impl_._has_bits_[0];
304 if (cached_has_bits & 0x0000003fu) {
305 // optional string package_name = 2;
306 if (cached_has_bits & 0x00000001u) {
307 total_size += 1 +
308 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
309 this->_internal_package_name());
310 }
311
312 // optional int64 time_sec = 1;
313 if (cached_has_bits & 0x00000002u) {
314 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_time_sec());
315 }
316
317 // optional int32 session_duration_sec = 3;
318 if (cached_has_bits & 0x00000004u) {
319 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_session_duration_sec());
320 }
321
322 // optional bool did_user_interact = 4;
323 if (cached_has_bits & 0x00000008u) {
324 total_size += 1 + 1;
325 }
326
327 // optional bool was_user_closed = 5;
328 if (cached_has_bits & 0x00000010u) {
329 total_size += 1 + 1;
330 }
331
332 // optional bool is_partial = 6;
333 if (cached_has_bits & 0x00000020u) {
334 total_size += 1 + 1;
335 }
336
337 }
338 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
339 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
340 }
341 int cached_size = ::_pbi::ToCachedSize(total_size);
342 SetCachedSize(cached_size);
343 return total_size;
344 }
345
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)346 void CustomTabSessionProto::CheckTypeAndMergeFrom(
347 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
348 MergeFrom(*::_pbi::DownCast<const CustomTabSessionProto*>(
349 &from));
350 }
351
MergeFrom(const CustomTabSessionProto & from)352 void CustomTabSessionProto::MergeFrom(const CustomTabSessionProto& from) {
353 CustomTabSessionProto* const _this = this;
354 // @@protoc_insertion_point(class_specific_merge_from_start:metrics.CustomTabSessionProto)
355 GOOGLE_DCHECK_NE(&from, _this);
356 uint32_t cached_has_bits = 0;
357 (void) cached_has_bits;
358
359 cached_has_bits = from._impl_._has_bits_[0];
360 if (cached_has_bits & 0x0000003fu) {
361 if (cached_has_bits & 0x00000001u) {
362 _this->_internal_set_package_name(from._internal_package_name());
363 }
364 if (cached_has_bits & 0x00000002u) {
365 _this->_impl_.time_sec_ = from._impl_.time_sec_;
366 }
367 if (cached_has_bits & 0x00000004u) {
368 _this->_impl_.session_duration_sec_ = from._impl_.session_duration_sec_;
369 }
370 if (cached_has_bits & 0x00000008u) {
371 _this->_impl_.did_user_interact_ = from._impl_.did_user_interact_;
372 }
373 if (cached_has_bits & 0x00000010u) {
374 _this->_impl_.was_user_closed_ = from._impl_.was_user_closed_;
375 }
376 if (cached_has_bits & 0x00000020u) {
377 _this->_impl_.is_partial_ = from._impl_.is_partial_;
378 }
379 _this->_impl_._has_bits_[0] |= cached_has_bits;
380 }
381 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
382 }
383
CopyFrom(const CustomTabSessionProto & from)384 void CustomTabSessionProto::CopyFrom(const CustomTabSessionProto& from) {
385 // @@protoc_insertion_point(class_specific_copy_from_start:metrics.CustomTabSessionProto)
386 if (&from == this) return;
387 Clear();
388 MergeFrom(from);
389 }
390
IsInitialized() const391 bool CustomTabSessionProto::IsInitialized() const {
392 return true;
393 }
394
InternalSwap(CustomTabSessionProto * other)395 void CustomTabSessionProto::InternalSwap(CustomTabSessionProto* other) {
396 using std::swap;
397 auto* lhs_arena = GetArenaForAllocation();
398 auto* rhs_arena = other->GetArenaForAllocation();
399 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
400 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
401 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
402 &_impl_.package_name_, lhs_arena,
403 &other->_impl_.package_name_, rhs_arena
404 );
405 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
406 PROTOBUF_FIELD_OFFSET(CustomTabSessionProto, _impl_.is_partial_)
407 + sizeof(CustomTabSessionProto::_impl_.is_partial_)
408 - PROTOBUF_FIELD_OFFSET(CustomTabSessionProto, _impl_.time_sec_)>(
409 reinterpret_cast<char*>(&_impl_.time_sec_),
410 reinterpret_cast<char*>(&other->_impl_.time_sec_));
411 }
412
GetTypeName() const413 std::string CustomTabSessionProto::GetTypeName() const {
414 return "metrics.CustomTabSessionProto";
415 }
416
417
418 // @@protoc_insertion_point(namespace_scope)
419 } // namespace metrics
420 PROTOBUF_NAMESPACE_OPEN
421 template<> PROTOBUF_NOINLINE ::metrics::CustomTabSessionProto*
CreateMaybeMessage(Arena * arena)422 Arena::CreateMaybeMessage< ::metrics::CustomTabSessionProto >(Arena* arena) {
423 return Arena::CreateMessageInternal< ::metrics::CustomTabSessionProto >(arena);
424 }
425 PROTOBUF_NAMESPACE_CLOSE
426
427 // @@protoc_insertion_point(global_scope)
428 #include <google/protobuf/port_undef.inc>
429