1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: ukm/entry.proto
3 
4 #include "ukm/entry.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 ukm {
Entry_Metric(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR Entry_Metric::Entry_Metric(
22     ::_pbi::ConstantInitialized): _impl_{
23     /*decltype(_impl_._has_bits_)*/{}
24   , /*decltype(_impl_._cached_size_)*/{}
25   , /*decltype(_impl_.metric_hash_)*/uint64_t{0u}
26   , /*decltype(_impl_.value_)*/int64_t{0}} {}
27 struct Entry_MetricDefaultTypeInternal {
Entry_MetricDefaultTypeInternalukm::Entry_MetricDefaultTypeInternal28   PROTOBUF_CONSTEXPR Entry_MetricDefaultTypeInternal()
29       : _instance(::_pbi::ConstantInitialized{}) {}
~Entry_MetricDefaultTypeInternalukm::Entry_MetricDefaultTypeInternal30   ~Entry_MetricDefaultTypeInternal() {}
31   union {
32     Entry_Metric _instance;
33   };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Entry_MetricDefaultTypeInternal _Entry_Metric_default_instance_;
Entry(::_pbi::ConstantInitialized)36 PROTOBUF_CONSTEXPR Entry::Entry(
37     ::_pbi::ConstantInitialized): _impl_{
38     /*decltype(_impl_._has_bits_)*/{}
39   , /*decltype(_impl_._cached_size_)*/{}
40   , /*decltype(_impl_.metrics_)*/{}
41   , /*decltype(_impl_.deprecated_id_)*/0
42   , /*decltype(_impl_.deprecated_parent_id_)*/0
43   , /*decltype(_impl_.source_id_)*/int64_t{0}
44   , /*decltype(_impl_.event_hash_)*/uint64_t{0u}} {}
45 struct EntryDefaultTypeInternal {
EntryDefaultTypeInternalukm::EntryDefaultTypeInternal46   PROTOBUF_CONSTEXPR EntryDefaultTypeInternal()
47       : _instance(::_pbi::ConstantInitialized{}) {}
~EntryDefaultTypeInternalukm::EntryDefaultTypeInternal48   ~EntryDefaultTypeInternal() {}
49   union {
50     Entry _instance;
51   };
52 };
53 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EntryDefaultTypeInternal _Entry_default_instance_;
54 }  // namespace ukm
55 namespace ukm {
56 
57 // ===================================================================
58 
59 class Entry_Metric::_Internal {
60  public:
61   using HasBits = decltype(std::declval<Entry_Metric>()._impl_._has_bits_);
set_has_metric_hash(HasBits * has_bits)62   static void set_has_metric_hash(HasBits* has_bits) {
63     (*has_bits)[0] |= 1u;
64   }
set_has_value(HasBits * has_bits)65   static void set_has_value(HasBits* has_bits) {
66     (*has_bits)[0] |= 2u;
67   }
68 };
69 
Entry_Metric(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)70 Entry_Metric::Entry_Metric(::PROTOBUF_NAMESPACE_ID::Arena* arena,
71                          bool is_message_owned)
72   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
73   SharedCtor(arena, is_message_owned);
74   // @@protoc_insertion_point(arena_constructor:ukm.Entry.Metric)
75 }
Entry_Metric(const Entry_Metric & from)76 Entry_Metric::Entry_Metric(const Entry_Metric& from)
77   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
78   Entry_Metric* const _this = this; (void)_this;
79   new (&_impl_) Impl_{
80       decltype(_impl_._has_bits_){from._impl_._has_bits_}
81     , /*decltype(_impl_._cached_size_)*/{}
82     , decltype(_impl_.metric_hash_){}
83     , decltype(_impl_.value_){}};
84 
85   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
86   ::memcpy(&_impl_.metric_hash_, &from._impl_.metric_hash_,
87     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.value_) -
88     reinterpret_cast<char*>(&_impl_.metric_hash_)) + sizeof(_impl_.value_));
89   // @@protoc_insertion_point(copy_constructor:ukm.Entry.Metric)
90 }
91 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)92 inline void Entry_Metric::SharedCtor(
93     ::_pb::Arena* arena, bool is_message_owned) {
94   (void)arena;
95   (void)is_message_owned;
96   new (&_impl_) Impl_{
97       decltype(_impl_._has_bits_){}
98     , /*decltype(_impl_._cached_size_)*/{}
99     , decltype(_impl_.metric_hash_){uint64_t{0u}}
100     , decltype(_impl_.value_){int64_t{0}}
101   };
102 }
103 
~Entry_Metric()104 Entry_Metric::~Entry_Metric() {
105   // @@protoc_insertion_point(destructor:ukm.Entry.Metric)
106   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
107   (void)arena;
108     return;
109   }
110   SharedDtor();
111 }
112 
SharedDtor()113 inline void Entry_Metric::SharedDtor() {
114   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
115 }
116 
SetCachedSize(int size) const117 void Entry_Metric::SetCachedSize(int size) const {
118   _impl_._cached_size_.Set(size);
119 }
120 
Clear()121 void Entry_Metric::Clear() {
122 // @@protoc_insertion_point(message_clear_start:ukm.Entry.Metric)
123   uint32_t cached_has_bits = 0;
124   // Prevent compiler warnings about cached_has_bits being unused
125   (void) cached_has_bits;
126 
127   cached_has_bits = _impl_._has_bits_[0];
128   if (cached_has_bits & 0x00000003u) {
129     ::memset(&_impl_.metric_hash_, 0, static_cast<size_t>(
130         reinterpret_cast<char*>(&_impl_.value_) -
131         reinterpret_cast<char*>(&_impl_.metric_hash_)) + sizeof(_impl_.value_));
132   }
133   _impl_._has_bits_.Clear();
134   _internal_metadata_.Clear<std::string>();
135 }
136 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)137 const char* Entry_Metric::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
138 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
139   _Internal::HasBits has_bits{};
140   while (!ctx->Done(&ptr)) {
141     uint32_t tag;
142     ptr = ::_pbi::ReadTag(ptr, &tag);
143     switch (tag >> 3) {
144       // optional fixed64 metric_hash = 1;
145       case 1:
146         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 9)) {
147           _Internal::set_has_metric_hash(&has_bits);
148           _impl_.metric_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<uint64_t>(ptr);
149           ptr += sizeof(uint64_t);
150         } else
151           goto handle_unusual;
152         continue;
153       // optional int64 value = 2;
154       case 2:
155         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
156           _Internal::set_has_value(&has_bits);
157           _impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
158           CHK_(ptr);
159         } else
160           goto handle_unusual;
161         continue;
162       default:
163         goto handle_unusual;
164     }  // switch
165   handle_unusual:
166     if ((tag == 0) || ((tag & 7) == 4)) {
167       CHK_(ptr);
168       ctx->SetLastTag(tag);
169       goto message_done;
170     }
171     ptr = UnknownFieldParse(
172         tag,
173         _internal_metadata_.mutable_unknown_fields<std::string>(),
174         ptr, ctx);
175     CHK_(ptr != nullptr);
176   }  // while
177 message_done:
178   _impl_._has_bits_.Or(has_bits);
179   return ptr;
180 failure:
181   ptr = nullptr;
182   goto message_done;
183 #undef CHK_
184 }
185 
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const186 uint8_t* Entry_Metric::_InternalSerialize(
187     uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
188   // @@protoc_insertion_point(serialize_to_array_start:ukm.Entry.Metric)
189   uint32_t cached_has_bits = 0;
190   (void) cached_has_bits;
191 
192   cached_has_bits = _impl_._has_bits_[0];
193   // optional fixed64 metric_hash = 1;
194   if (cached_has_bits & 0x00000001u) {
195     target = stream->EnsureSpace(target);
196     target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_metric_hash(), target);
197   }
198 
199   // optional int64 value = 2;
200   if (cached_has_bits & 0x00000002u) {
201     target = stream->EnsureSpace(target);
202     target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_value(), target);
203   }
204 
205   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
206     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
207         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
208   }
209   // @@protoc_insertion_point(serialize_to_array_end:ukm.Entry.Metric)
210   return target;
211 }
212 
ByteSizeLong() const213 size_t Entry_Metric::ByteSizeLong() const {
214 // @@protoc_insertion_point(message_byte_size_start:ukm.Entry.Metric)
215   size_t total_size = 0;
216 
217   uint32_t cached_has_bits = 0;
218   // Prevent compiler warnings about cached_has_bits being unused
219   (void) cached_has_bits;
220 
221   cached_has_bits = _impl_._has_bits_[0];
222   if (cached_has_bits & 0x00000003u) {
223     // optional fixed64 metric_hash = 1;
224     if (cached_has_bits & 0x00000001u) {
225       total_size += 1 + 8;
226     }
227 
228     // optional int64 value = 2;
229     if (cached_has_bits & 0x00000002u) {
230       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_value());
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 Entry_Metric::CheckTypeAndMergeFrom(
243     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
244   MergeFrom(*::_pbi::DownCast<const Entry_Metric*>(
245       &from));
246 }
247 
MergeFrom(const Entry_Metric & from)248 void Entry_Metric::MergeFrom(const Entry_Metric& from) {
249   Entry_Metric* const _this = this;
250   // @@protoc_insertion_point(class_specific_merge_from_start:ukm.Entry.Metric)
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->_impl_.metric_hash_ = from._impl_.metric_hash_;
259     }
260     if (cached_has_bits & 0x00000002u) {
261       _this->_impl_.value_ = from._impl_.value_;
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 Entry_Metric & from)268 void Entry_Metric::CopyFrom(const Entry_Metric& from) {
269 // @@protoc_insertion_point(class_specific_copy_from_start:ukm.Entry.Metric)
270   if (&from == this) return;
271   Clear();
272   MergeFrom(from);
273 }
274 
IsInitialized() const275 bool Entry_Metric::IsInitialized() const {
276   return true;
277 }
278 
InternalSwap(Entry_Metric * other)279 void Entry_Metric::InternalSwap(Entry_Metric* other) {
280   using std::swap;
281   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
282   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
283   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
284       PROTOBUF_FIELD_OFFSET(Entry_Metric, _impl_.value_)
285       + sizeof(Entry_Metric::_impl_.value_)
286       - PROTOBUF_FIELD_OFFSET(Entry_Metric, _impl_.metric_hash_)>(
287           reinterpret_cast<char*>(&_impl_.metric_hash_),
288           reinterpret_cast<char*>(&other->_impl_.metric_hash_));
289 }
290 
GetTypeName() const291 std::string Entry_Metric::GetTypeName() const {
292   return "ukm.Entry.Metric";
293 }
294 
295 
296 // ===================================================================
297 
298 class Entry::_Internal {
299  public:
300   using HasBits = decltype(std::declval<Entry>()._impl_._has_bits_);
set_has_deprecated_id(HasBits * has_bits)301   static void set_has_deprecated_id(HasBits* has_bits) {
302     (*has_bits)[0] |= 1u;
303   }
set_has_deprecated_parent_id(HasBits * has_bits)304   static void set_has_deprecated_parent_id(HasBits* has_bits) {
305     (*has_bits)[0] |= 2u;
306   }
set_has_source_id(HasBits * has_bits)307   static void set_has_source_id(HasBits* has_bits) {
308     (*has_bits)[0] |= 4u;
309   }
set_has_event_hash(HasBits * has_bits)310   static void set_has_event_hash(HasBits* has_bits) {
311     (*has_bits)[0] |= 8u;
312   }
313 };
314 
Entry(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)315 Entry::Entry(::PROTOBUF_NAMESPACE_ID::Arena* arena,
316                          bool is_message_owned)
317   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
318   SharedCtor(arena, is_message_owned);
319   // @@protoc_insertion_point(arena_constructor:ukm.Entry)
320 }
Entry(const Entry & from)321 Entry::Entry(const Entry& from)
322   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
323   Entry* const _this = this; (void)_this;
324   new (&_impl_) Impl_{
325       decltype(_impl_._has_bits_){from._impl_._has_bits_}
326     , /*decltype(_impl_._cached_size_)*/{}
327     , decltype(_impl_.metrics_){from._impl_.metrics_}
328     , decltype(_impl_.deprecated_id_){}
329     , decltype(_impl_.deprecated_parent_id_){}
330     , decltype(_impl_.source_id_){}
331     , decltype(_impl_.event_hash_){}};
332 
333   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
334   ::memcpy(&_impl_.deprecated_id_, &from._impl_.deprecated_id_,
335     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.event_hash_) -
336     reinterpret_cast<char*>(&_impl_.deprecated_id_)) + sizeof(_impl_.event_hash_));
337   // @@protoc_insertion_point(copy_constructor:ukm.Entry)
338 }
339 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)340 inline void Entry::SharedCtor(
341     ::_pb::Arena* arena, bool is_message_owned) {
342   (void)arena;
343   (void)is_message_owned;
344   new (&_impl_) Impl_{
345       decltype(_impl_._has_bits_){}
346     , /*decltype(_impl_._cached_size_)*/{}
347     , decltype(_impl_.metrics_){arena}
348     , decltype(_impl_.deprecated_id_){0}
349     , decltype(_impl_.deprecated_parent_id_){0}
350     , decltype(_impl_.source_id_){int64_t{0}}
351     , decltype(_impl_.event_hash_){uint64_t{0u}}
352   };
353 }
354 
~Entry()355 Entry::~Entry() {
356   // @@protoc_insertion_point(destructor:ukm.Entry)
357   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
358   (void)arena;
359     return;
360   }
361   SharedDtor();
362 }
363 
SharedDtor()364 inline void Entry::SharedDtor() {
365   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
366   _impl_.metrics_.~RepeatedPtrField();
367 }
368 
SetCachedSize(int size) const369 void Entry::SetCachedSize(int size) const {
370   _impl_._cached_size_.Set(size);
371 }
372 
Clear()373 void Entry::Clear() {
374 // @@protoc_insertion_point(message_clear_start:ukm.Entry)
375   uint32_t cached_has_bits = 0;
376   // Prevent compiler warnings about cached_has_bits being unused
377   (void) cached_has_bits;
378 
379   _impl_.metrics_.Clear();
380   cached_has_bits = _impl_._has_bits_[0];
381   if (cached_has_bits & 0x0000000fu) {
382     ::memset(&_impl_.deprecated_id_, 0, static_cast<size_t>(
383         reinterpret_cast<char*>(&_impl_.event_hash_) -
384         reinterpret_cast<char*>(&_impl_.deprecated_id_)) + sizeof(_impl_.event_hash_));
385   }
386   _impl_._has_bits_.Clear();
387   _internal_metadata_.Clear<std::string>();
388 }
389 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)390 const char* Entry::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
391 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
392   _Internal::HasBits has_bits{};
393   while (!ctx->Done(&ptr)) {
394     uint32_t tag;
395     ptr = ::_pbi::ReadTag(ptr, &tag);
396     switch (tag >> 3) {
397       // optional int32 DEPRECATED_id = 1 [deprecated = true];
398       case 1:
399         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
400           _Internal::set_has_deprecated_id(&has_bits);
401           _impl_.deprecated_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
402           CHK_(ptr);
403         } else
404           goto handle_unusual;
405         continue;
406       // optional int32 DEPRECATED_parent_id = 2 [deprecated = true];
407       case 2:
408         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
409           _Internal::set_has_deprecated_parent_id(&has_bits);
410           _impl_.deprecated_parent_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
411           CHK_(ptr);
412         } else
413           goto handle_unusual;
414         continue;
415       // optional int64 source_id = 3;
416       case 3:
417         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
418           _Internal::set_has_source_id(&has_bits);
419           _impl_.source_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
420           CHK_(ptr);
421         } else
422           goto handle_unusual;
423         continue;
424       // optional fixed64 event_hash = 4;
425       case 4:
426         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 33)) {
427           _Internal::set_has_event_hash(&has_bits);
428           _impl_.event_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<uint64_t>(ptr);
429           ptr += sizeof(uint64_t);
430         } else
431           goto handle_unusual;
432         continue;
433       // repeated .ukm.Entry.Metric metrics = 5;
434       case 5:
435         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
436           ptr -= 1;
437           do {
438             ptr += 1;
439             ptr = ctx->ParseMessage(_internal_add_metrics(), ptr);
440             CHK_(ptr);
441             if (!ctx->DataAvailable(ptr)) break;
442           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
443         } else
444           goto handle_unusual;
445         continue;
446       default:
447         goto handle_unusual;
448     }  // switch
449   handle_unusual:
450     if ((tag == 0) || ((tag & 7) == 4)) {
451       CHK_(ptr);
452       ctx->SetLastTag(tag);
453       goto message_done;
454     }
455     ptr = UnknownFieldParse(
456         tag,
457         _internal_metadata_.mutable_unknown_fields<std::string>(),
458         ptr, ctx);
459     CHK_(ptr != nullptr);
460   }  // while
461 message_done:
462   _impl_._has_bits_.Or(has_bits);
463   return ptr;
464 failure:
465   ptr = nullptr;
466   goto message_done;
467 #undef CHK_
468 }
469 
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const470 uint8_t* Entry::_InternalSerialize(
471     uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
472   // @@protoc_insertion_point(serialize_to_array_start:ukm.Entry)
473   uint32_t cached_has_bits = 0;
474   (void) cached_has_bits;
475 
476   cached_has_bits = _impl_._has_bits_[0];
477   // optional int32 DEPRECATED_id = 1 [deprecated = true];
478   if (cached_has_bits & 0x00000001u) {
479     target = stream->EnsureSpace(target);
480     target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_deprecated_id(), target);
481   }
482 
483   // optional int32 DEPRECATED_parent_id = 2 [deprecated = true];
484   if (cached_has_bits & 0x00000002u) {
485     target = stream->EnsureSpace(target);
486     target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_deprecated_parent_id(), target);
487   }
488 
489   // optional int64 source_id = 3;
490   if (cached_has_bits & 0x00000004u) {
491     target = stream->EnsureSpace(target);
492     target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_source_id(), target);
493   }
494 
495   // optional fixed64 event_hash = 4;
496   if (cached_has_bits & 0x00000008u) {
497     target = stream->EnsureSpace(target);
498     target = ::_pbi::WireFormatLite::WriteFixed64ToArray(4, this->_internal_event_hash(), target);
499   }
500 
501   // repeated .ukm.Entry.Metric metrics = 5;
502   for (unsigned i = 0,
503       n = static_cast<unsigned>(this->_internal_metrics_size()); i < n; i++) {
504     const auto& repfield = this->_internal_metrics(i);
505     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
506         InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream);
507   }
508 
509   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
510     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
511         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
512   }
513   // @@protoc_insertion_point(serialize_to_array_end:ukm.Entry)
514   return target;
515 }
516 
ByteSizeLong() const517 size_t Entry::ByteSizeLong() const {
518 // @@protoc_insertion_point(message_byte_size_start:ukm.Entry)
519   size_t total_size = 0;
520 
521   uint32_t cached_has_bits = 0;
522   // Prevent compiler warnings about cached_has_bits being unused
523   (void) cached_has_bits;
524 
525   // repeated .ukm.Entry.Metric metrics = 5;
526   total_size += 1UL * this->_internal_metrics_size();
527   for (const auto& msg : this->_impl_.metrics_) {
528     total_size +=
529       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
530   }
531 
532   cached_has_bits = _impl_._has_bits_[0];
533   if (cached_has_bits & 0x0000000fu) {
534     // optional int32 DEPRECATED_id = 1 [deprecated = true];
535     if (cached_has_bits & 0x00000001u) {
536       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_deprecated_id());
537     }
538 
539     // optional int32 DEPRECATED_parent_id = 2 [deprecated = true];
540     if (cached_has_bits & 0x00000002u) {
541       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_deprecated_parent_id());
542     }
543 
544     // optional int64 source_id = 3;
545     if (cached_has_bits & 0x00000004u) {
546       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_source_id());
547     }
548 
549     // optional fixed64 event_hash = 4;
550     if (cached_has_bits & 0x00000008u) {
551       total_size += 1 + 8;
552     }
553 
554   }
555   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
556     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
557   }
558   int cached_size = ::_pbi::ToCachedSize(total_size);
559   SetCachedSize(cached_size);
560   return total_size;
561 }
562 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)563 void Entry::CheckTypeAndMergeFrom(
564     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
565   MergeFrom(*::_pbi::DownCast<const Entry*>(
566       &from));
567 }
568 
MergeFrom(const Entry & from)569 void Entry::MergeFrom(const Entry& from) {
570   Entry* const _this = this;
571   // @@protoc_insertion_point(class_specific_merge_from_start:ukm.Entry)
572   GOOGLE_DCHECK_NE(&from, _this);
573   uint32_t cached_has_bits = 0;
574   (void) cached_has_bits;
575 
576   _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_);
577   cached_has_bits = from._impl_._has_bits_[0];
578   if (cached_has_bits & 0x0000000fu) {
579     if (cached_has_bits & 0x00000001u) {
580       _this->_impl_.deprecated_id_ = from._impl_.deprecated_id_;
581     }
582     if (cached_has_bits & 0x00000002u) {
583       _this->_impl_.deprecated_parent_id_ = from._impl_.deprecated_parent_id_;
584     }
585     if (cached_has_bits & 0x00000004u) {
586       _this->_impl_.source_id_ = from._impl_.source_id_;
587     }
588     if (cached_has_bits & 0x00000008u) {
589       _this->_impl_.event_hash_ = from._impl_.event_hash_;
590     }
591     _this->_impl_._has_bits_[0] |= cached_has_bits;
592   }
593   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
594 }
595 
CopyFrom(const Entry & from)596 void Entry::CopyFrom(const Entry& from) {
597 // @@protoc_insertion_point(class_specific_copy_from_start:ukm.Entry)
598   if (&from == this) return;
599   Clear();
600   MergeFrom(from);
601 }
602 
IsInitialized() const603 bool Entry::IsInitialized() const {
604   return true;
605 }
606 
InternalSwap(Entry * other)607 void Entry::InternalSwap(Entry* other) {
608   using std::swap;
609   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
610   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
611   _impl_.metrics_.InternalSwap(&other->_impl_.metrics_);
612   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
613       PROTOBUF_FIELD_OFFSET(Entry, _impl_.event_hash_)
614       + sizeof(Entry::_impl_.event_hash_)
615       - PROTOBUF_FIELD_OFFSET(Entry, _impl_.deprecated_id_)>(
616           reinterpret_cast<char*>(&_impl_.deprecated_id_),
617           reinterpret_cast<char*>(&other->_impl_.deprecated_id_));
618 }
619 
GetTypeName() const620 std::string Entry::GetTypeName() const {
621   return "ukm.Entry";
622 }
623 
624 
625 // @@protoc_insertion_point(namespace_scope)
626 }  // namespace ukm
627 PROTOBUF_NAMESPACE_OPEN
628 template<> PROTOBUF_NOINLINE ::ukm::Entry_Metric*
CreateMaybeMessage(Arena * arena)629 Arena::CreateMaybeMessage< ::ukm::Entry_Metric >(Arena* arena) {
630   return Arena::CreateMessageInternal< ::ukm::Entry_Metric >(arena);
631 }
632 template<> PROTOBUF_NOINLINE ::ukm::Entry*
CreateMaybeMessage(Arena * arena)633 Arena::CreateMaybeMessage< ::ukm::Entry >(Arena* arena) {
634   return Arena::CreateMessageInternal< ::ukm::Entry >(arena);
635 }
636 PROTOBUF_NAMESPACE_CLOSE
637 
638 // @@protoc_insertion_point(global_scope)
639 #include <google/protobuf/port_undef.inc>
640