1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ukm/aggregate.proto
3
4 #include "ukm/aggregate.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 {
Aggregate_Metric(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR Aggregate_Metric::Aggregate_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_sum_)*/0
27 , /*decltype(_impl_.value_square_sum_)*/0
28 , /*decltype(_impl_.total_count_)*/uint64_t{0u}
29 , /*decltype(_impl_.dropped_due_to_limits_)*/uint64_t{0u}
30 , /*decltype(_impl_.dropped_due_to_sampling_)*/uint64_t{0u}
31 , /*decltype(_impl_.dropped_due_to_filter_)*/uint64_t{0u}
32 , /*decltype(_impl_.dropped_due_to_unconfigured_)*/uint64_t{0u}} {}
33 struct Aggregate_MetricDefaultTypeInternal {
Aggregate_MetricDefaultTypeInternalukm::Aggregate_MetricDefaultTypeInternal34 PROTOBUF_CONSTEXPR Aggregate_MetricDefaultTypeInternal()
35 : _instance(::_pbi::ConstantInitialized{}) {}
~Aggregate_MetricDefaultTypeInternalukm::Aggregate_MetricDefaultTypeInternal36 ~Aggregate_MetricDefaultTypeInternal() {}
37 union {
38 Aggregate_Metric _instance;
39 };
40 };
41 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Aggregate_MetricDefaultTypeInternal _Aggregate_Metric_default_instance_;
Aggregate(::_pbi::ConstantInitialized)42 PROTOBUF_CONSTEXPR Aggregate::Aggregate(
43 ::_pbi::ConstantInitialized): _impl_{
44 /*decltype(_impl_._has_bits_)*/{}
45 , /*decltype(_impl_._cached_size_)*/{}
46 , /*decltype(_impl_.metrics_)*/{}
47 , /*decltype(_impl_.source_id_)*/int64_t{0}
48 , /*decltype(_impl_.event_hash_)*/uint64_t{0u}
49 , /*decltype(_impl_.total_count_)*/uint64_t{0u}
50 , /*decltype(_impl_.dropped_due_to_limits_)*/uint64_t{0u}
51 , /*decltype(_impl_.dropped_due_to_sampling_)*/uint64_t{0u}
52 , /*decltype(_impl_.dropped_due_to_filter_)*/uint64_t{0u}
53 , /*decltype(_impl_.dropped_due_to_unconfigured_)*/uint64_t{0u}} {}
54 struct AggregateDefaultTypeInternal {
AggregateDefaultTypeInternalukm::AggregateDefaultTypeInternal55 PROTOBUF_CONSTEXPR AggregateDefaultTypeInternal()
56 : _instance(::_pbi::ConstantInitialized{}) {}
~AggregateDefaultTypeInternalukm::AggregateDefaultTypeInternal57 ~AggregateDefaultTypeInternal() {}
58 union {
59 Aggregate _instance;
60 };
61 };
62 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AggregateDefaultTypeInternal _Aggregate_default_instance_;
63 } // namespace ukm
64 namespace ukm {
65
66 // ===================================================================
67
68 class Aggregate_Metric::_Internal {
69 public:
70 using HasBits = decltype(std::declval<Aggregate_Metric>()._impl_._has_bits_);
set_has_metric_hash(HasBits * has_bits)71 static void set_has_metric_hash(HasBits* has_bits) {
72 (*has_bits)[0] |= 1u;
73 }
set_has_value_sum(HasBits * has_bits)74 static void set_has_value_sum(HasBits* has_bits) {
75 (*has_bits)[0] |= 2u;
76 }
set_has_value_square_sum(HasBits * has_bits)77 static void set_has_value_square_sum(HasBits* has_bits) {
78 (*has_bits)[0] |= 4u;
79 }
set_has_total_count(HasBits * has_bits)80 static void set_has_total_count(HasBits* has_bits) {
81 (*has_bits)[0] |= 8u;
82 }
set_has_dropped_due_to_limits(HasBits * has_bits)83 static void set_has_dropped_due_to_limits(HasBits* has_bits) {
84 (*has_bits)[0] |= 16u;
85 }
set_has_dropped_due_to_sampling(HasBits * has_bits)86 static void set_has_dropped_due_to_sampling(HasBits* has_bits) {
87 (*has_bits)[0] |= 32u;
88 }
set_has_dropped_due_to_filter(HasBits * has_bits)89 static void set_has_dropped_due_to_filter(HasBits* has_bits) {
90 (*has_bits)[0] |= 64u;
91 }
set_has_dropped_due_to_unconfigured(HasBits * has_bits)92 static void set_has_dropped_due_to_unconfigured(HasBits* has_bits) {
93 (*has_bits)[0] |= 128u;
94 }
95 };
96
Aggregate_Metric(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)97 Aggregate_Metric::Aggregate_Metric(::PROTOBUF_NAMESPACE_ID::Arena* arena,
98 bool is_message_owned)
99 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
100 SharedCtor(arena, is_message_owned);
101 // @@protoc_insertion_point(arena_constructor:ukm.Aggregate.Metric)
102 }
Aggregate_Metric(const Aggregate_Metric & from)103 Aggregate_Metric::Aggregate_Metric(const Aggregate_Metric& from)
104 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
105 Aggregate_Metric* const _this = this; (void)_this;
106 new (&_impl_) Impl_{
107 decltype(_impl_._has_bits_){from._impl_._has_bits_}
108 , /*decltype(_impl_._cached_size_)*/{}
109 , decltype(_impl_.metric_hash_){}
110 , decltype(_impl_.value_sum_){}
111 , decltype(_impl_.value_square_sum_){}
112 , decltype(_impl_.total_count_){}
113 , decltype(_impl_.dropped_due_to_limits_){}
114 , decltype(_impl_.dropped_due_to_sampling_){}
115 , decltype(_impl_.dropped_due_to_filter_){}
116 , decltype(_impl_.dropped_due_to_unconfigured_){}};
117
118 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
119 ::memcpy(&_impl_.metric_hash_, &from._impl_.metric_hash_,
120 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.dropped_due_to_unconfigured_) -
121 reinterpret_cast<char*>(&_impl_.metric_hash_)) + sizeof(_impl_.dropped_due_to_unconfigured_));
122 // @@protoc_insertion_point(copy_constructor:ukm.Aggregate.Metric)
123 }
124
SharedCtor(::_pb::Arena * arena,bool is_message_owned)125 inline void Aggregate_Metric::SharedCtor(
126 ::_pb::Arena* arena, bool is_message_owned) {
127 (void)arena;
128 (void)is_message_owned;
129 new (&_impl_) Impl_{
130 decltype(_impl_._has_bits_){}
131 , /*decltype(_impl_._cached_size_)*/{}
132 , decltype(_impl_.metric_hash_){uint64_t{0u}}
133 , decltype(_impl_.value_sum_){0}
134 , decltype(_impl_.value_square_sum_){0}
135 , decltype(_impl_.total_count_){uint64_t{0u}}
136 , decltype(_impl_.dropped_due_to_limits_){uint64_t{0u}}
137 , decltype(_impl_.dropped_due_to_sampling_){uint64_t{0u}}
138 , decltype(_impl_.dropped_due_to_filter_){uint64_t{0u}}
139 , decltype(_impl_.dropped_due_to_unconfigured_){uint64_t{0u}}
140 };
141 }
142
~Aggregate_Metric()143 Aggregate_Metric::~Aggregate_Metric() {
144 // @@protoc_insertion_point(destructor:ukm.Aggregate.Metric)
145 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
146 (void)arena;
147 return;
148 }
149 SharedDtor();
150 }
151
SharedDtor()152 inline void Aggregate_Metric::SharedDtor() {
153 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
154 }
155
SetCachedSize(int size) const156 void Aggregate_Metric::SetCachedSize(int size) const {
157 _impl_._cached_size_.Set(size);
158 }
159
Clear()160 void Aggregate_Metric::Clear() {
161 // @@protoc_insertion_point(message_clear_start:ukm.Aggregate.Metric)
162 uint32_t cached_has_bits = 0;
163 // Prevent compiler warnings about cached_has_bits being unused
164 (void) cached_has_bits;
165
166 cached_has_bits = _impl_._has_bits_[0];
167 if (cached_has_bits & 0x000000ffu) {
168 ::memset(&_impl_.metric_hash_, 0, static_cast<size_t>(
169 reinterpret_cast<char*>(&_impl_.dropped_due_to_unconfigured_) -
170 reinterpret_cast<char*>(&_impl_.metric_hash_)) + sizeof(_impl_.dropped_due_to_unconfigured_));
171 }
172 _impl_._has_bits_.Clear();
173 _internal_metadata_.Clear<std::string>();
174 }
175
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)176 const char* Aggregate_Metric::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
177 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
178 _Internal::HasBits has_bits{};
179 while (!ctx->Done(&ptr)) {
180 uint32_t tag;
181 ptr = ::_pbi::ReadTag(ptr, &tag);
182 switch (tag >> 3) {
183 // optional fixed64 metric_hash = 1;
184 case 1:
185 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 9)) {
186 _Internal::set_has_metric_hash(&has_bits);
187 _impl_.metric_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<uint64_t>(ptr);
188 ptr += sizeof(uint64_t);
189 } else
190 goto handle_unusual;
191 continue;
192 // optional double value_sum = 2;
193 case 2:
194 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 17)) {
195 _Internal::set_has_value_sum(&has_bits);
196 _impl_.value_sum_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
197 ptr += sizeof(double);
198 } else
199 goto handle_unusual;
200 continue;
201 // optional double value_square_sum = 3;
202 case 3:
203 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 25)) {
204 _Internal::set_has_value_square_sum(&has_bits);
205 _impl_.value_square_sum_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
206 ptr += sizeof(double);
207 } else
208 goto handle_unusual;
209 continue;
210 // optional uint64 total_count = 4;
211 case 4:
212 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
213 _Internal::set_has_total_count(&has_bits);
214 _impl_.total_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
215 CHK_(ptr);
216 } else
217 goto handle_unusual;
218 continue;
219 // optional uint64 dropped_due_to_limits = 5;
220 case 5:
221 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
222 _Internal::set_has_dropped_due_to_limits(&has_bits);
223 _impl_.dropped_due_to_limits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
224 CHK_(ptr);
225 } else
226 goto handle_unusual;
227 continue;
228 // optional uint64 dropped_due_to_sampling = 6;
229 case 6:
230 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
231 _Internal::set_has_dropped_due_to_sampling(&has_bits);
232 _impl_.dropped_due_to_sampling_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
233 CHK_(ptr);
234 } else
235 goto handle_unusual;
236 continue;
237 // optional uint64 dropped_due_to_filter = 8;
238 case 8:
239 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
240 _Internal::set_has_dropped_due_to_filter(&has_bits);
241 _impl_.dropped_due_to_filter_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
242 CHK_(ptr);
243 } else
244 goto handle_unusual;
245 continue;
246 // optional uint64 dropped_due_to_unconfigured = 9;
247 case 9:
248 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
249 _Internal::set_has_dropped_due_to_unconfigured(&has_bits);
250 _impl_.dropped_due_to_unconfigured_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
251 CHK_(ptr);
252 } else
253 goto handle_unusual;
254 continue;
255 default:
256 goto handle_unusual;
257 } // switch
258 handle_unusual:
259 if ((tag == 0) || ((tag & 7) == 4)) {
260 CHK_(ptr);
261 ctx->SetLastTag(tag);
262 goto message_done;
263 }
264 ptr = UnknownFieldParse(
265 tag,
266 _internal_metadata_.mutable_unknown_fields<std::string>(),
267 ptr, ctx);
268 CHK_(ptr != nullptr);
269 } // while
270 message_done:
271 _impl_._has_bits_.Or(has_bits);
272 return ptr;
273 failure:
274 ptr = nullptr;
275 goto message_done;
276 #undef CHK_
277 }
278
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const279 uint8_t* Aggregate_Metric::_InternalSerialize(
280 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
281 // @@protoc_insertion_point(serialize_to_array_start:ukm.Aggregate.Metric)
282 uint32_t cached_has_bits = 0;
283 (void) cached_has_bits;
284
285 cached_has_bits = _impl_._has_bits_[0];
286 // optional fixed64 metric_hash = 1;
287 if (cached_has_bits & 0x00000001u) {
288 target = stream->EnsureSpace(target);
289 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_metric_hash(), target);
290 }
291
292 // optional double value_sum = 2;
293 if (cached_has_bits & 0x00000002u) {
294 target = stream->EnsureSpace(target);
295 target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_value_sum(), target);
296 }
297
298 // optional double value_square_sum = 3;
299 if (cached_has_bits & 0x00000004u) {
300 target = stream->EnsureSpace(target);
301 target = ::_pbi::WireFormatLite::WriteDoubleToArray(3, this->_internal_value_square_sum(), target);
302 }
303
304 // optional uint64 total_count = 4;
305 if (cached_has_bits & 0x00000008u) {
306 target = stream->EnsureSpace(target);
307 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_total_count(), target);
308 }
309
310 // optional uint64 dropped_due_to_limits = 5;
311 if (cached_has_bits & 0x00000010u) {
312 target = stream->EnsureSpace(target);
313 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_dropped_due_to_limits(), target);
314 }
315
316 // optional uint64 dropped_due_to_sampling = 6;
317 if (cached_has_bits & 0x00000020u) {
318 target = stream->EnsureSpace(target);
319 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_dropped_due_to_sampling(), target);
320 }
321
322 // optional uint64 dropped_due_to_filter = 8;
323 if (cached_has_bits & 0x00000040u) {
324 target = stream->EnsureSpace(target);
325 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_dropped_due_to_filter(), target);
326 }
327
328 // optional uint64 dropped_due_to_unconfigured = 9;
329 if (cached_has_bits & 0x00000080u) {
330 target = stream->EnsureSpace(target);
331 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(9, this->_internal_dropped_due_to_unconfigured(), target);
332 }
333
334 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
335 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
336 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
337 }
338 // @@protoc_insertion_point(serialize_to_array_end:ukm.Aggregate.Metric)
339 return target;
340 }
341
ByteSizeLong() const342 size_t Aggregate_Metric::ByteSizeLong() const {
343 // @@protoc_insertion_point(message_byte_size_start:ukm.Aggregate.Metric)
344 size_t total_size = 0;
345
346 uint32_t cached_has_bits = 0;
347 // Prevent compiler warnings about cached_has_bits being unused
348 (void) cached_has_bits;
349
350 cached_has_bits = _impl_._has_bits_[0];
351 if (cached_has_bits & 0x000000ffu) {
352 // optional fixed64 metric_hash = 1;
353 if (cached_has_bits & 0x00000001u) {
354 total_size += 1 + 8;
355 }
356
357 // optional double value_sum = 2;
358 if (cached_has_bits & 0x00000002u) {
359 total_size += 1 + 8;
360 }
361
362 // optional double value_square_sum = 3;
363 if (cached_has_bits & 0x00000004u) {
364 total_size += 1 + 8;
365 }
366
367 // optional uint64 total_count = 4;
368 if (cached_has_bits & 0x00000008u) {
369 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_total_count());
370 }
371
372 // optional uint64 dropped_due_to_limits = 5;
373 if (cached_has_bits & 0x00000010u) {
374 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_limits());
375 }
376
377 // optional uint64 dropped_due_to_sampling = 6;
378 if (cached_has_bits & 0x00000020u) {
379 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_sampling());
380 }
381
382 // optional uint64 dropped_due_to_filter = 8;
383 if (cached_has_bits & 0x00000040u) {
384 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_filter());
385 }
386
387 // optional uint64 dropped_due_to_unconfigured = 9;
388 if (cached_has_bits & 0x00000080u) {
389 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_unconfigured());
390 }
391
392 }
393 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
394 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
395 }
396 int cached_size = ::_pbi::ToCachedSize(total_size);
397 SetCachedSize(cached_size);
398 return total_size;
399 }
400
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)401 void Aggregate_Metric::CheckTypeAndMergeFrom(
402 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
403 MergeFrom(*::_pbi::DownCast<const Aggregate_Metric*>(
404 &from));
405 }
406
MergeFrom(const Aggregate_Metric & from)407 void Aggregate_Metric::MergeFrom(const Aggregate_Metric& from) {
408 Aggregate_Metric* const _this = this;
409 // @@protoc_insertion_point(class_specific_merge_from_start:ukm.Aggregate.Metric)
410 GOOGLE_DCHECK_NE(&from, _this);
411 uint32_t cached_has_bits = 0;
412 (void) cached_has_bits;
413
414 cached_has_bits = from._impl_._has_bits_[0];
415 if (cached_has_bits & 0x000000ffu) {
416 if (cached_has_bits & 0x00000001u) {
417 _this->_impl_.metric_hash_ = from._impl_.metric_hash_;
418 }
419 if (cached_has_bits & 0x00000002u) {
420 _this->_impl_.value_sum_ = from._impl_.value_sum_;
421 }
422 if (cached_has_bits & 0x00000004u) {
423 _this->_impl_.value_square_sum_ = from._impl_.value_square_sum_;
424 }
425 if (cached_has_bits & 0x00000008u) {
426 _this->_impl_.total_count_ = from._impl_.total_count_;
427 }
428 if (cached_has_bits & 0x00000010u) {
429 _this->_impl_.dropped_due_to_limits_ = from._impl_.dropped_due_to_limits_;
430 }
431 if (cached_has_bits & 0x00000020u) {
432 _this->_impl_.dropped_due_to_sampling_ = from._impl_.dropped_due_to_sampling_;
433 }
434 if (cached_has_bits & 0x00000040u) {
435 _this->_impl_.dropped_due_to_filter_ = from._impl_.dropped_due_to_filter_;
436 }
437 if (cached_has_bits & 0x00000080u) {
438 _this->_impl_.dropped_due_to_unconfigured_ = from._impl_.dropped_due_to_unconfigured_;
439 }
440 _this->_impl_._has_bits_[0] |= cached_has_bits;
441 }
442 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
443 }
444
CopyFrom(const Aggregate_Metric & from)445 void Aggregate_Metric::CopyFrom(const Aggregate_Metric& from) {
446 // @@protoc_insertion_point(class_specific_copy_from_start:ukm.Aggregate.Metric)
447 if (&from == this) return;
448 Clear();
449 MergeFrom(from);
450 }
451
IsInitialized() const452 bool Aggregate_Metric::IsInitialized() const {
453 return true;
454 }
455
InternalSwap(Aggregate_Metric * other)456 void Aggregate_Metric::InternalSwap(Aggregate_Metric* other) {
457 using std::swap;
458 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
459 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
460 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
461 PROTOBUF_FIELD_OFFSET(Aggregate_Metric, _impl_.dropped_due_to_unconfigured_)
462 + sizeof(Aggregate_Metric::_impl_.dropped_due_to_unconfigured_)
463 - PROTOBUF_FIELD_OFFSET(Aggregate_Metric, _impl_.metric_hash_)>(
464 reinterpret_cast<char*>(&_impl_.metric_hash_),
465 reinterpret_cast<char*>(&other->_impl_.metric_hash_));
466 }
467
GetTypeName() const468 std::string Aggregate_Metric::GetTypeName() const {
469 return "ukm.Aggregate.Metric";
470 }
471
472
473 // ===================================================================
474
475 class Aggregate::_Internal {
476 public:
477 using HasBits = decltype(std::declval<Aggregate>()._impl_._has_bits_);
set_has_source_id(HasBits * has_bits)478 static void set_has_source_id(HasBits* has_bits) {
479 (*has_bits)[0] |= 1u;
480 }
set_has_event_hash(HasBits * has_bits)481 static void set_has_event_hash(HasBits* has_bits) {
482 (*has_bits)[0] |= 2u;
483 }
set_has_total_count(HasBits * has_bits)484 static void set_has_total_count(HasBits* has_bits) {
485 (*has_bits)[0] |= 4u;
486 }
set_has_dropped_due_to_limits(HasBits * has_bits)487 static void set_has_dropped_due_to_limits(HasBits* has_bits) {
488 (*has_bits)[0] |= 8u;
489 }
set_has_dropped_due_to_sampling(HasBits * has_bits)490 static void set_has_dropped_due_to_sampling(HasBits* has_bits) {
491 (*has_bits)[0] |= 16u;
492 }
set_has_dropped_due_to_filter(HasBits * has_bits)493 static void set_has_dropped_due_to_filter(HasBits* has_bits) {
494 (*has_bits)[0] |= 32u;
495 }
set_has_dropped_due_to_unconfigured(HasBits * has_bits)496 static void set_has_dropped_due_to_unconfigured(HasBits* has_bits) {
497 (*has_bits)[0] |= 64u;
498 }
499 };
500
Aggregate(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)501 Aggregate::Aggregate(::PROTOBUF_NAMESPACE_ID::Arena* arena,
502 bool is_message_owned)
503 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
504 SharedCtor(arena, is_message_owned);
505 // @@protoc_insertion_point(arena_constructor:ukm.Aggregate)
506 }
Aggregate(const Aggregate & from)507 Aggregate::Aggregate(const Aggregate& from)
508 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
509 Aggregate* const _this = this; (void)_this;
510 new (&_impl_) Impl_{
511 decltype(_impl_._has_bits_){from._impl_._has_bits_}
512 , /*decltype(_impl_._cached_size_)*/{}
513 , decltype(_impl_.metrics_){from._impl_.metrics_}
514 , decltype(_impl_.source_id_){}
515 , decltype(_impl_.event_hash_){}
516 , decltype(_impl_.total_count_){}
517 , decltype(_impl_.dropped_due_to_limits_){}
518 , decltype(_impl_.dropped_due_to_sampling_){}
519 , decltype(_impl_.dropped_due_to_filter_){}
520 , decltype(_impl_.dropped_due_to_unconfigured_){}};
521
522 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
523 ::memcpy(&_impl_.source_id_, &from._impl_.source_id_,
524 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.dropped_due_to_unconfigured_) -
525 reinterpret_cast<char*>(&_impl_.source_id_)) + sizeof(_impl_.dropped_due_to_unconfigured_));
526 // @@protoc_insertion_point(copy_constructor:ukm.Aggregate)
527 }
528
SharedCtor(::_pb::Arena * arena,bool is_message_owned)529 inline void Aggregate::SharedCtor(
530 ::_pb::Arena* arena, bool is_message_owned) {
531 (void)arena;
532 (void)is_message_owned;
533 new (&_impl_) Impl_{
534 decltype(_impl_._has_bits_){}
535 , /*decltype(_impl_._cached_size_)*/{}
536 , decltype(_impl_.metrics_){arena}
537 , decltype(_impl_.source_id_){int64_t{0}}
538 , decltype(_impl_.event_hash_){uint64_t{0u}}
539 , decltype(_impl_.total_count_){uint64_t{0u}}
540 , decltype(_impl_.dropped_due_to_limits_){uint64_t{0u}}
541 , decltype(_impl_.dropped_due_to_sampling_){uint64_t{0u}}
542 , decltype(_impl_.dropped_due_to_filter_){uint64_t{0u}}
543 , decltype(_impl_.dropped_due_to_unconfigured_){uint64_t{0u}}
544 };
545 }
546
~Aggregate()547 Aggregate::~Aggregate() {
548 // @@protoc_insertion_point(destructor:ukm.Aggregate)
549 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
550 (void)arena;
551 return;
552 }
553 SharedDtor();
554 }
555
SharedDtor()556 inline void Aggregate::SharedDtor() {
557 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
558 _impl_.metrics_.~RepeatedPtrField();
559 }
560
SetCachedSize(int size) const561 void Aggregate::SetCachedSize(int size) const {
562 _impl_._cached_size_.Set(size);
563 }
564
Clear()565 void Aggregate::Clear() {
566 // @@protoc_insertion_point(message_clear_start:ukm.Aggregate)
567 uint32_t cached_has_bits = 0;
568 // Prevent compiler warnings about cached_has_bits being unused
569 (void) cached_has_bits;
570
571 _impl_.metrics_.Clear();
572 cached_has_bits = _impl_._has_bits_[0];
573 if (cached_has_bits & 0x0000007fu) {
574 ::memset(&_impl_.source_id_, 0, static_cast<size_t>(
575 reinterpret_cast<char*>(&_impl_.dropped_due_to_unconfigured_) -
576 reinterpret_cast<char*>(&_impl_.source_id_)) + sizeof(_impl_.dropped_due_to_unconfigured_));
577 }
578 _impl_._has_bits_.Clear();
579 _internal_metadata_.Clear<std::string>();
580 }
581
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)582 const char* Aggregate::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
583 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
584 _Internal::HasBits has_bits{};
585 while (!ctx->Done(&ptr)) {
586 uint32_t tag;
587 ptr = ::_pbi::ReadTag(ptr, &tag);
588 switch (tag >> 3) {
589 // optional int64 source_id = 1;
590 case 1:
591 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
592 _Internal::set_has_source_id(&has_bits);
593 _impl_.source_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
594 CHK_(ptr);
595 } else
596 goto handle_unusual;
597 continue;
598 // optional fixed64 event_hash = 2;
599 case 2:
600 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 17)) {
601 _Internal::set_has_event_hash(&has_bits);
602 _impl_.event_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<uint64_t>(ptr);
603 ptr += sizeof(uint64_t);
604 } else
605 goto handle_unusual;
606 continue;
607 // optional uint64 total_count = 3;
608 case 3:
609 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
610 _Internal::set_has_total_count(&has_bits);
611 _impl_.total_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
612 CHK_(ptr);
613 } else
614 goto handle_unusual;
615 continue;
616 // optional uint64 dropped_due_to_limits = 4;
617 case 4:
618 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
619 _Internal::set_has_dropped_due_to_limits(&has_bits);
620 _impl_.dropped_due_to_limits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
621 CHK_(ptr);
622 } else
623 goto handle_unusual;
624 continue;
625 // optional uint64 dropped_due_to_sampling = 5;
626 case 5:
627 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
628 _Internal::set_has_dropped_due_to_sampling(&has_bits);
629 _impl_.dropped_due_to_sampling_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
630 CHK_(ptr);
631 } else
632 goto handle_unusual;
633 continue;
634 // repeated .ukm.Aggregate.Metric metrics = 6;
635 case 6:
636 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
637 ptr -= 1;
638 do {
639 ptr += 1;
640 ptr = ctx->ParseMessage(_internal_add_metrics(), ptr);
641 CHK_(ptr);
642 if (!ctx->DataAvailable(ptr)) break;
643 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
644 } else
645 goto handle_unusual;
646 continue;
647 // optional uint64 dropped_due_to_filter = 8;
648 case 8:
649 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
650 _Internal::set_has_dropped_due_to_filter(&has_bits);
651 _impl_.dropped_due_to_filter_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
652 CHK_(ptr);
653 } else
654 goto handle_unusual;
655 continue;
656 // optional uint64 dropped_due_to_unconfigured = 9;
657 case 9:
658 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
659 _Internal::set_has_dropped_due_to_unconfigured(&has_bits);
660 _impl_.dropped_due_to_unconfigured_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
661 CHK_(ptr);
662 } else
663 goto handle_unusual;
664 continue;
665 default:
666 goto handle_unusual;
667 } // switch
668 handle_unusual:
669 if ((tag == 0) || ((tag & 7) == 4)) {
670 CHK_(ptr);
671 ctx->SetLastTag(tag);
672 goto message_done;
673 }
674 ptr = UnknownFieldParse(
675 tag,
676 _internal_metadata_.mutable_unknown_fields<std::string>(),
677 ptr, ctx);
678 CHK_(ptr != nullptr);
679 } // while
680 message_done:
681 _impl_._has_bits_.Or(has_bits);
682 return ptr;
683 failure:
684 ptr = nullptr;
685 goto message_done;
686 #undef CHK_
687 }
688
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const689 uint8_t* Aggregate::_InternalSerialize(
690 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
691 // @@protoc_insertion_point(serialize_to_array_start:ukm.Aggregate)
692 uint32_t cached_has_bits = 0;
693 (void) cached_has_bits;
694
695 cached_has_bits = _impl_._has_bits_[0];
696 // optional int64 source_id = 1;
697 if (cached_has_bits & 0x00000001u) {
698 target = stream->EnsureSpace(target);
699 target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_source_id(), target);
700 }
701
702 // optional fixed64 event_hash = 2;
703 if (cached_has_bits & 0x00000002u) {
704 target = stream->EnsureSpace(target);
705 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(2, this->_internal_event_hash(), target);
706 }
707
708 // optional uint64 total_count = 3;
709 if (cached_has_bits & 0x00000004u) {
710 target = stream->EnsureSpace(target);
711 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_total_count(), target);
712 }
713
714 // optional uint64 dropped_due_to_limits = 4;
715 if (cached_has_bits & 0x00000008u) {
716 target = stream->EnsureSpace(target);
717 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_dropped_due_to_limits(), target);
718 }
719
720 // optional uint64 dropped_due_to_sampling = 5;
721 if (cached_has_bits & 0x00000010u) {
722 target = stream->EnsureSpace(target);
723 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_dropped_due_to_sampling(), target);
724 }
725
726 // repeated .ukm.Aggregate.Metric metrics = 6;
727 for (unsigned i = 0,
728 n = static_cast<unsigned>(this->_internal_metrics_size()); i < n; i++) {
729 const auto& repfield = this->_internal_metrics(i);
730 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
731 InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream);
732 }
733
734 // optional uint64 dropped_due_to_filter = 8;
735 if (cached_has_bits & 0x00000020u) {
736 target = stream->EnsureSpace(target);
737 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_dropped_due_to_filter(), target);
738 }
739
740 // optional uint64 dropped_due_to_unconfigured = 9;
741 if (cached_has_bits & 0x00000040u) {
742 target = stream->EnsureSpace(target);
743 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(9, this->_internal_dropped_due_to_unconfigured(), target);
744 }
745
746 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
747 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
748 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
749 }
750 // @@protoc_insertion_point(serialize_to_array_end:ukm.Aggregate)
751 return target;
752 }
753
ByteSizeLong() const754 size_t Aggregate::ByteSizeLong() const {
755 // @@protoc_insertion_point(message_byte_size_start:ukm.Aggregate)
756 size_t total_size = 0;
757
758 uint32_t cached_has_bits = 0;
759 // Prevent compiler warnings about cached_has_bits being unused
760 (void) cached_has_bits;
761
762 // repeated .ukm.Aggregate.Metric metrics = 6;
763 total_size += 1UL * this->_internal_metrics_size();
764 for (const auto& msg : this->_impl_.metrics_) {
765 total_size +=
766 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
767 }
768
769 cached_has_bits = _impl_._has_bits_[0];
770 if (cached_has_bits & 0x0000007fu) {
771 // optional int64 source_id = 1;
772 if (cached_has_bits & 0x00000001u) {
773 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_source_id());
774 }
775
776 // optional fixed64 event_hash = 2;
777 if (cached_has_bits & 0x00000002u) {
778 total_size += 1 + 8;
779 }
780
781 // optional uint64 total_count = 3;
782 if (cached_has_bits & 0x00000004u) {
783 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_total_count());
784 }
785
786 // optional uint64 dropped_due_to_limits = 4;
787 if (cached_has_bits & 0x00000008u) {
788 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_limits());
789 }
790
791 // optional uint64 dropped_due_to_sampling = 5;
792 if (cached_has_bits & 0x00000010u) {
793 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_sampling());
794 }
795
796 // optional uint64 dropped_due_to_filter = 8;
797 if (cached_has_bits & 0x00000020u) {
798 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_filter());
799 }
800
801 // optional uint64 dropped_due_to_unconfigured = 9;
802 if (cached_has_bits & 0x00000040u) {
803 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_dropped_due_to_unconfigured());
804 }
805
806 }
807 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
808 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
809 }
810 int cached_size = ::_pbi::ToCachedSize(total_size);
811 SetCachedSize(cached_size);
812 return total_size;
813 }
814
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)815 void Aggregate::CheckTypeAndMergeFrom(
816 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
817 MergeFrom(*::_pbi::DownCast<const Aggregate*>(
818 &from));
819 }
820
MergeFrom(const Aggregate & from)821 void Aggregate::MergeFrom(const Aggregate& from) {
822 Aggregate* const _this = this;
823 // @@protoc_insertion_point(class_specific_merge_from_start:ukm.Aggregate)
824 GOOGLE_DCHECK_NE(&from, _this);
825 uint32_t cached_has_bits = 0;
826 (void) cached_has_bits;
827
828 _this->_impl_.metrics_.MergeFrom(from._impl_.metrics_);
829 cached_has_bits = from._impl_._has_bits_[0];
830 if (cached_has_bits & 0x0000007fu) {
831 if (cached_has_bits & 0x00000001u) {
832 _this->_impl_.source_id_ = from._impl_.source_id_;
833 }
834 if (cached_has_bits & 0x00000002u) {
835 _this->_impl_.event_hash_ = from._impl_.event_hash_;
836 }
837 if (cached_has_bits & 0x00000004u) {
838 _this->_impl_.total_count_ = from._impl_.total_count_;
839 }
840 if (cached_has_bits & 0x00000008u) {
841 _this->_impl_.dropped_due_to_limits_ = from._impl_.dropped_due_to_limits_;
842 }
843 if (cached_has_bits & 0x00000010u) {
844 _this->_impl_.dropped_due_to_sampling_ = from._impl_.dropped_due_to_sampling_;
845 }
846 if (cached_has_bits & 0x00000020u) {
847 _this->_impl_.dropped_due_to_filter_ = from._impl_.dropped_due_to_filter_;
848 }
849 if (cached_has_bits & 0x00000040u) {
850 _this->_impl_.dropped_due_to_unconfigured_ = from._impl_.dropped_due_to_unconfigured_;
851 }
852 _this->_impl_._has_bits_[0] |= cached_has_bits;
853 }
854 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
855 }
856
CopyFrom(const Aggregate & from)857 void Aggregate::CopyFrom(const Aggregate& from) {
858 // @@protoc_insertion_point(class_specific_copy_from_start:ukm.Aggregate)
859 if (&from == this) return;
860 Clear();
861 MergeFrom(from);
862 }
863
IsInitialized() const864 bool Aggregate::IsInitialized() const {
865 return true;
866 }
867
InternalSwap(Aggregate * other)868 void Aggregate::InternalSwap(Aggregate* other) {
869 using std::swap;
870 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
871 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
872 _impl_.metrics_.InternalSwap(&other->_impl_.metrics_);
873 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
874 PROTOBUF_FIELD_OFFSET(Aggregate, _impl_.dropped_due_to_unconfigured_)
875 + sizeof(Aggregate::_impl_.dropped_due_to_unconfigured_)
876 - PROTOBUF_FIELD_OFFSET(Aggregate, _impl_.source_id_)>(
877 reinterpret_cast<char*>(&_impl_.source_id_),
878 reinterpret_cast<char*>(&other->_impl_.source_id_));
879 }
880
GetTypeName() const881 std::string Aggregate::GetTypeName() const {
882 return "ukm.Aggregate";
883 }
884
885
886 // @@protoc_insertion_point(namespace_scope)
887 } // namespace ukm
888 PROTOBUF_NAMESPACE_OPEN
889 template<> PROTOBUF_NOINLINE ::ukm::Aggregate_Metric*
CreateMaybeMessage(Arena * arena)890 Arena::CreateMaybeMessage< ::ukm::Aggregate_Metric >(Arena* arena) {
891 return Arena::CreateMessageInternal< ::ukm::Aggregate_Metric >(arena);
892 }
893 template<> PROTOBUF_NOINLINE ::ukm::Aggregate*
CreateMaybeMessage(Arena * arena)894 Arena::CreateMaybeMessage< ::ukm::Aggregate >(Arena* arena) {
895 return Arena::CreateMessageInternal< ::ukm::Aggregate >(arena);
896 }
897 PROTOBUF_NAMESPACE_CLOSE
898
899 // @@protoc_insertion_point(global_scope)
900 #include <google/protobuf/port_undef.inc>
901