1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: printer_event.proto
3
4 #include "printer_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 {
PrinterEventProto(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR PrinterEventProto::PrinterEventProto(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.usb_printer_manufacturer_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
26 , /*decltype(_impl_.usb_printer_model_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
27 , /*decltype(_impl_.ipp_make_and_model_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.ppd_identifier_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
29 , /*decltype(_impl_.usb_vendor_id_)*/0
30 , /*decltype(_impl_.usb_model_id_)*/0
31 , /*decltype(_impl_.user_ppd_)*/false
32 , /*decltype(_impl_.event_type_)*/0} {}
33 struct PrinterEventProtoDefaultTypeInternal {
PrinterEventProtoDefaultTypeInternalmetrics::PrinterEventProtoDefaultTypeInternal34 PROTOBUF_CONSTEXPR PrinterEventProtoDefaultTypeInternal()
35 : _instance(::_pbi::ConstantInitialized{}) {}
~PrinterEventProtoDefaultTypeInternalmetrics::PrinterEventProtoDefaultTypeInternal36 ~PrinterEventProtoDefaultTypeInternal() {}
37 union {
38 PrinterEventProto _instance;
39 };
40 };
41 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PrinterEventProtoDefaultTypeInternal _PrinterEventProto_default_instance_;
42 } // namespace metrics
43 namespace metrics {
PrinterEventProto_EventType_IsValid(int value)44 bool PrinterEventProto_EventType_IsValid(int value) {
45 switch (value) {
46 case 0:
47 case 1:
48 case 2:
49 case 3:
50 case 4:
51 return true;
52 default:
53 return false;
54 }
55 }
56
57 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> PrinterEventProto_EventType_strings[5] = {};
58
59 static const char PrinterEventProto_EventType_names[] =
60 "PRINTER_DELETED"
61 "SETUP_ABANDONED"
62 "SETUP_AUTOMATIC"
63 "SETUP_MANUAL"
64 "UNKNOWN";
65
66 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry PrinterEventProto_EventType_entries[] = {
67 { {PrinterEventProto_EventType_names + 0, 15}, 4 },
68 { {PrinterEventProto_EventType_names + 15, 15}, 3 },
69 { {PrinterEventProto_EventType_names + 30, 15}, 1 },
70 { {PrinterEventProto_EventType_names + 45, 12}, 2 },
71 { {PrinterEventProto_EventType_names + 57, 7}, 0 },
72 };
73
74 static const int PrinterEventProto_EventType_entries_by_number[] = {
75 4, // 0 -> UNKNOWN
76 2, // 1 -> SETUP_AUTOMATIC
77 3, // 2 -> SETUP_MANUAL
78 1, // 3 -> SETUP_ABANDONED
79 0, // 4 -> PRINTER_DELETED
80 };
81
PrinterEventProto_EventType_Name(PrinterEventProto_EventType value)82 const std::string& PrinterEventProto_EventType_Name(
83 PrinterEventProto_EventType value) {
84 static const bool dummy =
85 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
86 PrinterEventProto_EventType_entries,
87 PrinterEventProto_EventType_entries_by_number,
88 5, PrinterEventProto_EventType_strings);
89 (void) dummy;
90 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
91 PrinterEventProto_EventType_entries,
92 PrinterEventProto_EventType_entries_by_number,
93 5, value);
94 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
95 PrinterEventProto_EventType_strings[idx].get();
96 }
PrinterEventProto_EventType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,PrinterEventProto_EventType * value)97 bool PrinterEventProto_EventType_Parse(
98 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PrinterEventProto_EventType* value) {
99 int int_value;
100 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
101 PrinterEventProto_EventType_entries, 5, name, &int_value);
102 if (success) {
103 *value = static_cast<PrinterEventProto_EventType>(int_value);
104 }
105 return success;
106 }
107 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
108 constexpr PrinterEventProto_EventType PrinterEventProto::UNKNOWN;
109 constexpr PrinterEventProto_EventType PrinterEventProto::SETUP_AUTOMATIC;
110 constexpr PrinterEventProto_EventType PrinterEventProto::SETUP_MANUAL;
111 constexpr PrinterEventProto_EventType PrinterEventProto::SETUP_ABANDONED;
112 constexpr PrinterEventProto_EventType PrinterEventProto::PRINTER_DELETED;
113 constexpr PrinterEventProto_EventType PrinterEventProto::EventType_MIN;
114 constexpr PrinterEventProto_EventType PrinterEventProto::EventType_MAX;
115 constexpr int PrinterEventProto::EventType_ARRAYSIZE;
116 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
117
118 // ===================================================================
119
120 class PrinterEventProto::_Internal {
121 public:
122 using HasBits = decltype(std::declval<PrinterEventProto>()._impl_._has_bits_);
set_has_usb_printer_manufacturer(HasBits * has_bits)123 static void set_has_usb_printer_manufacturer(HasBits* has_bits) {
124 (*has_bits)[0] |= 1u;
125 }
set_has_usb_printer_model(HasBits * has_bits)126 static void set_has_usb_printer_model(HasBits* has_bits) {
127 (*has_bits)[0] |= 2u;
128 }
set_has_usb_vendor_id(HasBits * has_bits)129 static void set_has_usb_vendor_id(HasBits* has_bits) {
130 (*has_bits)[0] |= 16u;
131 }
set_has_usb_model_id(HasBits * has_bits)132 static void set_has_usb_model_id(HasBits* has_bits) {
133 (*has_bits)[0] |= 32u;
134 }
set_has_ipp_make_and_model(HasBits * has_bits)135 static void set_has_ipp_make_and_model(HasBits* has_bits) {
136 (*has_bits)[0] |= 4u;
137 }
set_has_user_ppd(HasBits * has_bits)138 static void set_has_user_ppd(HasBits* has_bits) {
139 (*has_bits)[0] |= 64u;
140 }
set_has_ppd_identifier(HasBits * has_bits)141 static void set_has_ppd_identifier(HasBits* has_bits) {
142 (*has_bits)[0] |= 8u;
143 }
set_has_event_type(HasBits * has_bits)144 static void set_has_event_type(HasBits* has_bits) {
145 (*has_bits)[0] |= 128u;
146 }
147 };
148
PrinterEventProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)149 PrinterEventProto::PrinterEventProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
150 bool is_message_owned)
151 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
152 SharedCtor(arena, is_message_owned);
153 // @@protoc_insertion_point(arena_constructor:metrics.PrinterEventProto)
154 }
PrinterEventProto(const PrinterEventProto & from)155 PrinterEventProto::PrinterEventProto(const PrinterEventProto& from)
156 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
157 PrinterEventProto* const _this = this; (void)_this;
158 new (&_impl_) Impl_{
159 decltype(_impl_._has_bits_){from._impl_._has_bits_}
160 , /*decltype(_impl_._cached_size_)*/{}
161 , decltype(_impl_.usb_printer_manufacturer_){}
162 , decltype(_impl_.usb_printer_model_){}
163 , decltype(_impl_.ipp_make_and_model_){}
164 , decltype(_impl_.ppd_identifier_){}
165 , decltype(_impl_.usb_vendor_id_){}
166 , decltype(_impl_.usb_model_id_){}
167 , decltype(_impl_.user_ppd_){}
168 , decltype(_impl_.event_type_){}};
169
170 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
171 _impl_.usb_printer_manufacturer_.InitDefault();
172 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
173 _impl_.usb_printer_manufacturer_.Set("", GetArenaForAllocation());
174 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
175 if (from._internal_has_usb_printer_manufacturer()) {
176 _this->_impl_.usb_printer_manufacturer_.Set(from._internal_usb_printer_manufacturer(),
177 _this->GetArenaForAllocation());
178 }
179 _impl_.usb_printer_model_.InitDefault();
180 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
181 _impl_.usb_printer_model_.Set("", GetArenaForAllocation());
182 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
183 if (from._internal_has_usb_printer_model()) {
184 _this->_impl_.usb_printer_model_.Set(from._internal_usb_printer_model(),
185 _this->GetArenaForAllocation());
186 }
187 _impl_.ipp_make_and_model_.InitDefault();
188 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
189 _impl_.ipp_make_and_model_.Set("", GetArenaForAllocation());
190 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
191 if (from._internal_has_ipp_make_and_model()) {
192 _this->_impl_.ipp_make_and_model_.Set(from._internal_ipp_make_and_model(),
193 _this->GetArenaForAllocation());
194 }
195 _impl_.ppd_identifier_.InitDefault();
196 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
197 _impl_.ppd_identifier_.Set("", GetArenaForAllocation());
198 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
199 if (from._internal_has_ppd_identifier()) {
200 _this->_impl_.ppd_identifier_.Set(from._internal_ppd_identifier(),
201 _this->GetArenaForAllocation());
202 }
203 ::memcpy(&_impl_.usb_vendor_id_, &from._impl_.usb_vendor_id_,
204 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.event_type_) -
205 reinterpret_cast<char*>(&_impl_.usb_vendor_id_)) + sizeof(_impl_.event_type_));
206 // @@protoc_insertion_point(copy_constructor:metrics.PrinterEventProto)
207 }
208
SharedCtor(::_pb::Arena * arena,bool is_message_owned)209 inline void PrinterEventProto::SharedCtor(
210 ::_pb::Arena* arena, bool is_message_owned) {
211 (void)arena;
212 (void)is_message_owned;
213 new (&_impl_) Impl_{
214 decltype(_impl_._has_bits_){}
215 , /*decltype(_impl_._cached_size_)*/{}
216 , decltype(_impl_.usb_printer_manufacturer_){}
217 , decltype(_impl_.usb_printer_model_){}
218 , decltype(_impl_.ipp_make_and_model_){}
219 , decltype(_impl_.ppd_identifier_){}
220 , decltype(_impl_.usb_vendor_id_){0}
221 , decltype(_impl_.usb_model_id_){0}
222 , decltype(_impl_.user_ppd_){false}
223 , decltype(_impl_.event_type_){0}
224 };
225 _impl_.usb_printer_manufacturer_.InitDefault();
226 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
227 _impl_.usb_printer_manufacturer_.Set("", GetArenaForAllocation());
228 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
229 _impl_.usb_printer_model_.InitDefault();
230 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
231 _impl_.usb_printer_model_.Set("", GetArenaForAllocation());
232 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
233 _impl_.ipp_make_and_model_.InitDefault();
234 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
235 _impl_.ipp_make_and_model_.Set("", GetArenaForAllocation());
236 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
237 _impl_.ppd_identifier_.InitDefault();
238 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
239 _impl_.ppd_identifier_.Set("", GetArenaForAllocation());
240 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
241 }
242
~PrinterEventProto()243 PrinterEventProto::~PrinterEventProto() {
244 // @@protoc_insertion_point(destructor:metrics.PrinterEventProto)
245 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
246 (void)arena;
247 return;
248 }
249 SharedDtor();
250 }
251
SharedDtor()252 inline void PrinterEventProto::SharedDtor() {
253 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
254 _impl_.usb_printer_manufacturer_.Destroy();
255 _impl_.usb_printer_model_.Destroy();
256 _impl_.ipp_make_and_model_.Destroy();
257 _impl_.ppd_identifier_.Destroy();
258 }
259
SetCachedSize(int size) const260 void PrinterEventProto::SetCachedSize(int size) const {
261 _impl_._cached_size_.Set(size);
262 }
263
Clear()264 void PrinterEventProto::Clear() {
265 // @@protoc_insertion_point(message_clear_start:metrics.PrinterEventProto)
266 uint32_t cached_has_bits = 0;
267 // Prevent compiler warnings about cached_has_bits being unused
268 (void) cached_has_bits;
269
270 cached_has_bits = _impl_._has_bits_[0];
271 if (cached_has_bits & 0x0000000fu) {
272 if (cached_has_bits & 0x00000001u) {
273 _impl_.usb_printer_manufacturer_.ClearNonDefaultToEmpty();
274 }
275 if (cached_has_bits & 0x00000002u) {
276 _impl_.usb_printer_model_.ClearNonDefaultToEmpty();
277 }
278 if (cached_has_bits & 0x00000004u) {
279 _impl_.ipp_make_and_model_.ClearNonDefaultToEmpty();
280 }
281 if (cached_has_bits & 0x00000008u) {
282 _impl_.ppd_identifier_.ClearNonDefaultToEmpty();
283 }
284 }
285 if (cached_has_bits & 0x000000f0u) {
286 ::memset(&_impl_.usb_vendor_id_, 0, static_cast<size_t>(
287 reinterpret_cast<char*>(&_impl_.event_type_) -
288 reinterpret_cast<char*>(&_impl_.usb_vendor_id_)) + sizeof(_impl_.event_type_));
289 }
290 _impl_._has_bits_.Clear();
291 _internal_metadata_.Clear<std::string>();
292 }
293
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)294 const char* PrinterEventProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
295 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
296 _Internal::HasBits has_bits{};
297 while (!ctx->Done(&ptr)) {
298 uint32_t tag;
299 ptr = ::_pbi::ReadTag(ptr, &tag);
300 switch (tag >> 3) {
301 // optional string usb_printer_manufacturer = 1;
302 case 1:
303 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
304 auto str = _internal_mutable_usb_printer_manufacturer();
305 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
306 CHK_(ptr);
307 } else
308 goto handle_unusual;
309 continue;
310 // optional string usb_printer_model = 2;
311 case 2:
312 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
313 auto str = _internal_mutable_usb_printer_model();
314 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
315 CHK_(ptr);
316 } else
317 goto handle_unusual;
318 continue;
319 // optional int32 usb_vendor_id = 3;
320 case 3:
321 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
322 _Internal::set_has_usb_vendor_id(&has_bits);
323 _impl_.usb_vendor_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
324 CHK_(ptr);
325 } else
326 goto handle_unusual;
327 continue;
328 // optional int32 usb_model_id = 4;
329 case 4:
330 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
331 _Internal::set_has_usb_model_id(&has_bits);
332 _impl_.usb_model_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
333 CHK_(ptr);
334 } else
335 goto handle_unusual;
336 continue;
337 // optional string ipp_make_and_model = 5;
338 case 5:
339 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
340 auto str = _internal_mutable_ipp_make_and_model();
341 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
342 CHK_(ptr);
343 } else
344 goto handle_unusual;
345 continue;
346 // optional bool user_ppd = 6;
347 case 6:
348 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
349 _Internal::set_has_user_ppd(&has_bits);
350 _impl_.user_ppd_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
351 CHK_(ptr);
352 } else
353 goto handle_unusual;
354 continue;
355 // optional string ppd_identifier = 7;
356 case 7:
357 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
358 auto str = _internal_mutable_ppd_identifier();
359 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
360 CHK_(ptr);
361 } else
362 goto handle_unusual;
363 continue;
364 // optional .metrics.PrinterEventProto.EventType event_type = 8;
365 case 8:
366 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
367 uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
368 CHK_(ptr);
369 if (PROTOBUF_PREDICT_TRUE(::metrics::PrinterEventProto_EventType_IsValid(val))) {
370 _internal_set_event_type(static_cast<::metrics::PrinterEventProto_EventType>(val));
371 } else {
372 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
373 }
374 } else
375 goto handle_unusual;
376 continue;
377 default:
378 goto handle_unusual;
379 } // switch
380 handle_unusual:
381 if ((tag == 0) || ((tag & 7) == 4)) {
382 CHK_(ptr);
383 ctx->SetLastTag(tag);
384 goto message_done;
385 }
386 ptr = UnknownFieldParse(
387 tag,
388 _internal_metadata_.mutable_unknown_fields<std::string>(),
389 ptr, ctx);
390 CHK_(ptr != nullptr);
391 } // while
392 message_done:
393 _impl_._has_bits_.Or(has_bits);
394 return ptr;
395 failure:
396 ptr = nullptr;
397 goto message_done;
398 #undef CHK_
399 }
400
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const401 uint8_t* PrinterEventProto::_InternalSerialize(
402 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
403 // @@protoc_insertion_point(serialize_to_array_start:metrics.PrinterEventProto)
404 uint32_t cached_has_bits = 0;
405 (void) cached_has_bits;
406
407 cached_has_bits = _impl_._has_bits_[0];
408 // optional string usb_printer_manufacturer = 1;
409 if (cached_has_bits & 0x00000001u) {
410 target = stream->WriteStringMaybeAliased(
411 1, this->_internal_usb_printer_manufacturer(), target);
412 }
413
414 // optional string usb_printer_model = 2;
415 if (cached_has_bits & 0x00000002u) {
416 target = stream->WriteStringMaybeAliased(
417 2, this->_internal_usb_printer_model(), target);
418 }
419
420 // optional int32 usb_vendor_id = 3;
421 if (cached_has_bits & 0x00000010u) {
422 target = stream->EnsureSpace(target);
423 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_usb_vendor_id(), target);
424 }
425
426 // optional int32 usb_model_id = 4;
427 if (cached_has_bits & 0x00000020u) {
428 target = stream->EnsureSpace(target);
429 target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_usb_model_id(), target);
430 }
431
432 // optional string ipp_make_and_model = 5;
433 if (cached_has_bits & 0x00000004u) {
434 target = stream->WriteStringMaybeAliased(
435 5, this->_internal_ipp_make_and_model(), target);
436 }
437
438 // optional bool user_ppd = 6;
439 if (cached_has_bits & 0x00000040u) {
440 target = stream->EnsureSpace(target);
441 target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_user_ppd(), target);
442 }
443
444 // optional string ppd_identifier = 7;
445 if (cached_has_bits & 0x00000008u) {
446 target = stream->WriteStringMaybeAliased(
447 7, this->_internal_ppd_identifier(), target);
448 }
449
450 // optional .metrics.PrinterEventProto.EventType event_type = 8;
451 if (cached_has_bits & 0x00000080u) {
452 target = stream->EnsureSpace(target);
453 target = ::_pbi::WireFormatLite::WriteEnumToArray(
454 8, this->_internal_event_type(), target);
455 }
456
457 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
458 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
459 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
460 }
461 // @@protoc_insertion_point(serialize_to_array_end:metrics.PrinterEventProto)
462 return target;
463 }
464
ByteSizeLong() const465 size_t PrinterEventProto::ByteSizeLong() const {
466 // @@protoc_insertion_point(message_byte_size_start:metrics.PrinterEventProto)
467 size_t total_size = 0;
468
469 uint32_t cached_has_bits = 0;
470 // Prevent compiler warnings about cached_has_bits being unused
471 (void) cached_has_bits;
472
473 cached_has_bits = _impl_._has_bits_[0];
474 if (cached_has_bits & 0x000000ffu) {
475 // optional string usb_printer_manufacturer = 1;
476 if (cached_has_bits & 0x00000001u) {
477 total_size += 1 +
478 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
479 this->_internal_usb_printer_manufacturer());
480 }
481
482 // optional string usb_printer_model = 2;
483 if (cached_has_bits & 0x00000002u) {
484 total_size += 1 +
485 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
486 this->_internal_usb_printer_model());
487 }
488
489 // optional string ipp_make_and_model = 5;
490 if (cached_has_bits & 0x00000004u) {
491 total_size += 1 +
492 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
493 this->_internal_ipp_make_and_model());
494 }
495
496 // optional string ppd_identifier = 7;
497 if (cached_has_bits & 0x00000008u) {
498 total_size += 1 +
499 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
500 this->_internal_ppd_identifier());
501 }
502
503 // optional int32 usb_vendor_id = 3;
504 if (cached_has_bits & 0x00000010u) {
505 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_usb_vendor_id());
506 }
507
508 // optional int32 usb_model_id = 4;
509 if (cached_has_bits & 0x00000020u) {
510 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_usb_model_id());
511 }
512
513 // optional bool user_ppd = 6;
514 if (cached_has_bits & 0x00000040u) {
515 total_size += 1 + 1;
516 }
517
518 // optional .metrics.PrinterEventProto.EventType event_type = 8;
519 if (cached_has_bits & 0x00000080u) {
520 total_size += 1 +
521 ::_pbi::WireFormatLite::EnumSize(this->_internal_event_type());
522 }
523
524 }
525 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
526 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
527 }
528 int cached_size = ::_pbi::ToCachedSize(total_size);
529 SetCachedSize(cached_size);
530 return total_size;
531 }
532
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)533 void PrinterEventProto::CheckTypeAndMergeFrom(
534 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
535 MergeFrom(*::_pbi::DownCast<const PrinterEventProto*>(
536 &from));
537 }
538
MergeFrom(const PrinterEventProto & from)539 void PrinterEventProto::MergeFrom(const PrinterEventProto& from) {
540 PrinterEventProto* const _this = this;
541 // @@protoc_insertion_point(class_specific_merge_from_start:metrics.PrinterEventProto)
542 GOOGLE_DCHECK_NE(&from, _this);
543 uint32_t cached_has_bits = 0;
544 (void) cached_has_bits;
545
546 cached_has_bits = from._impl_._has_bits_[0];
547 if (cached_has_bits & 0x000000ffu) {
548 if (cached_has_bits & 0x00000001u) {
549 _this->_internal_set_usb_printer_manufacturer(from._internal_usb_printer_manufacturer());
550 }
551 if (cached_has_bits & 0x00000002u) {
552 _this->_internal_set_usb_printer_model(from._internal_usb_printer_model());
553 }
554 if (cached_has_bits & 0x00000004u) {
555 _this->_internal_set_ipp_make_and_model(from._internal_ipp_make_and_model());
556 }
557 if (cached_has_bits & 0x00000008u) {
558 _this->_internal_set_ppd_identifier(from._internal_ppd_identifier());
559 }
560 if (cached_has_bits & 0x00000010u) {
561 _this->_impl_.usb_vendor_id_ = from._impl_.usb_vendor_id_;
562 }
563 if (cached_has_bits & 0x00000020u) {
564 _this->_impl_.usb_model_id_ = from._impl_.usb_model_id_;
565 }
566 if (cached_has_bits & 0x00000040u) {
567 _this->_impl_.user_ppd_ = from._impl_.user_ppd_;
568 }
569 if (cached_has_bits & 0x00000080u) {
570 _this->_impl_.event_type_ = from._impl_.event_type_;
571 }
572 _this->_impl_._has_bits_[0] |= cached_has_bits;
573 }
574 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
575 }
576
CopyFrom(const PrinterEventProto & from)577 void PrinterEventProto::CopyFrom(const PrinterEventProto& from) {
578 // @@protoc_insertion_point(class_specific_copy_from_start:metrics.PrinterEventProto)
579 if (&from == this) return;
580 Clear();
581 MergeFrom(from);
582 }
583
IsInitialized() const584 bool PrinterEventProto::IsInitialized() const {
585 return true;
586 }
587
InternalSwap(PrinterEventProto * other)588 void PrinterEventProto::InternalSwap(PrinterEventProto* other) {
589 using std::swap;
590 auto* lhs_arena = GetArenaForAllocation();
591 auto* rhs_arena = other->GetArenaForAllocation();
592 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
593 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
594 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
595 &_impl_.usb_printer_manufacturer_, lhs_arena,
596 &other->_impl_.usb_printer_manufacturer_, rhs_arena
597 );
598 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
599 &_impl_.usb_printer_model_, lhs_arena,
600 &other->_impl_.usb_printer_model_, rhs_arena
601 );
602 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
603 &_impl_.ipp_make_and_model_, lhs_arena,
604 &other->_impl_.ipp_make_and_model_, rhs_arena
605 );
606 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
607 &_impl_.ppd_identifier_, lhs_arena,
608 &other->_impl_.ppd_identifier_, rhs_arena
609 );
610 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
611 PROTOBUF_FIELD_OFFSET(PrinterEventProto, _impl_.event_type_)
612 + sizeof(PrinterEventProto::_impl_.event_type_)
613 - PROTOBUF_FIELD_OFFSET(PrinterEventProto, _impl_.usb_vendor_id_)>(
614 reinterpret_cast<char*>(&_impl_.usb_vendor_id_),
615 reinterpret_cast<char*>(&other->_impl_.usb_vendor_id_));
616 }
617
GetTypeName() const618 std::string PrinterEventProto::GetTypeName() const {
619 return "metrics.PrinterEventProto";
620 }
621
622
623 // @@protoc_insertion_point(namespace_scope)
624 } // namespace metrics
625 PROTOBUF_NAMESPACE_OPEN
626 template<> PROTOBUF_NOINLINE ::metrics::PrinterEventProto*
CreateMaybeMessage(Arena * arena)627 Arena::CreateMaybeMessage< ::metrics::PrinterEventProto >(Arena* arena) {
628 return Arena::CreateMessageInternal< ::metrics::PrinterEventProto >(arena);
629 }
630 PROTOBUF_NAMESPACE_CLOSE
631
632 // @@protoc_insertion_point(global_scope)
633 #include <google/protobuf/port_undef.inc>
634