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