1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: user_action_event.proto
3 
4 #include "user_action_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 {
UserActionEventProto(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR UserActionEventProto::UserActionEventProto(
22     ::_pbi::ConstantInitialized): _impl_{
23     /*decltype(_impl_._has_bits_)*/{}
24   , /*decltype(_impl_._cached_size_)*/{}
25   , /*decltype(_impl_.name_hash_)*/uint64_t{0u}
26   , /*decltype(_impl_.time_sec_)*/int64_t{0}} {}
27 struct UserActionEventProtoDefaultTypeInternal {
UserActionEventProtoDefaultTypeInternalmetrics::UserActionEventProtoDefaultTypeInternal28   PROTOBUF_CONSTEXPR UserActionEventProtoDefaultTypeInternal()
29       : _instance(::_pbi::ConstantInitialized{}) {}
~UserActionEventProtoDefaultTypeInternalmetrics::UserActionEventProtoDefaultTypeInternal30   ~UserActionEventProtoDefaultTypeInternal() {}
31   union {
32     UserActionEventProto _instance;
33   };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UserActionEventProtoDefaultTypeInternal _UserActionEventProto_default_instance_;
36 }  // namespace metrics
37 namespace metrics {
38 
39 // ===================================================================
40 
41 class UserActionEventProto::_Internal {
42  public:
43   using HasBits = decltype(std::declval<UserActionEventProto>()._impl_._has_bits_);
set_has_name_hash(HasBits * has_bits)44   static void set_has_name_hash(HasBits* has_bits) {
45     (*has_bits)[0] |= 1u;
46   }
set_has_time_sec(HasBits * has_bits)47   static void set_has_time_sec(HasBits* has_bits) {
48     (*has_bits)[0] |= 2u;
49   }
50 };
51 
UserActionEventProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)52 UserActionEventProto::UserActionEventProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
53                          bool is_message_owned)
54   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
55   SharedCtor(arena, is_message_owned);
56   // @@protoc_insertion_point(arena_constructor:metrics.UserActionEventProto)
57 }
UserActionEventProto(const UserActionEventProto & from)58 UserActionEventProto::UserActionEventProto(const UserActionEventProto& from)
59   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
60   UserActionEventProto* const _this = this; (void)_this;
61   new (&_impl_) Impl_{
62       decltype(_impl_._has_bits_){from._impl_._has_bits_}
63     , /*decltype(_impl_._cached_size_)*/{}
64     , decltype(_impl_.name_hash_){}
65     , decltype(_impl_.time_sec_){}};
66 
67   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
68   ::memcpy(&_impl_.name_hash_, &from._impl_.name_hash_,
69     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.time_sec_) -
70     reinterpret_cast<char*>(&_impl_.name_hash_)) + sizeof(_impl_.time_sec_));
71   // @@protoc_insertion_point(copy_constructor:metrics.UserActionEventProto)
72 }
73 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)74 inline void UserActionEventProto::SharedCtor(
75     ::_pb::Arena* arena, bool is_message_owned) {
76   (void)arena;
77   (void)is_message_owned;
78   new (&_impl_) Impl_{
79       decltype(_impl_._has_bits_){}
80     , /*decltype(_impl_._cached_size_)*/{}
81     , decltype(_impl_.name_hash_){uint64_t{0u}}
82     , decltype(_impl_.time_sec_){int64_t{0}}
83   };
84 }
85 
~UserActionEventProto()86 UserActionEventProto::~UserActionEventProto() {
87   // @@protoc_insertion_point(destructor:metrics.UserActionEventProto)
88   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
89   (void)arena;
90     return;
91   }
92   SharedDtor();
93 }
94 
SharedDtor()95 inline void UserActionEventProto::SharedDtor() {
96   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
97 }
98 
SetCachedSize(int size) const99 void UserActionEventProto::SetCachedSize(int size) const {
100   _impl_._cached_size_.Set(size);
101 }
102 
Clear()103 void UserActionEventProto::Clear() {
104 // @@protoc_insertion_point(message_clear_start:metrics.UserActionEventProto)
105   uint32_t cached_has_bits = 0;
106   // Prevent compiler warnings about cached_has_bits being unused
107   (void) cached_has_bits;
108 
109   cached_has_bits = _impl_._has_bits_[0];
110   if (cached_has_bits & 0x00000003u) {
111     ::memset(&_impl_.name_hash_, 0, static_cast<size_t>(
112         reinterpret_cast<char*>(&_impl_.time_sec_) -
113         reinterpret_cast<char*>(&_impl_.name_hash_)) + sizeof(_impl_.time_sec_));
114   }
115   _impl_._has_bits_.Clear();
116   _internal_metadata_.Clear<std::string>();
117 }
118 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)119 const char* UserActionEventProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
120 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
121   _Internal::HasBits has_bits{};
122   while (!ctx->Done(&ptr)) {
123     uint32_t tag;
124     ptr = ::_pbi::ReadTag(ptr, &tag);
125     switch (tag >> 3) {
126       // optional fixed64 name_hash = 1;
127       case 1:
128         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 9)) {
129           _Internal::set_has_name_hash(&has_bits);
130           _impl_.name_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<uint64_t>(ptr);
131           ptr += sizeof(uint64_t);
132         } else
133           goto handle_unusual;
134         continue;
135       // optional int64 time_sec = 2;
136       case 2:
137         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
138           _Internal::set_has_time_sec(&has_bits);
139           _impl_.time_sec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
140           CHK_(ptr);
141         } else
142           goto handle_unusual;
143         continue;
144       default:
145         goto handle_unusual;
146     }  // switch
147   handle_unusual:
148     if ((tag == 0) || ((tag & 7) == 4)) {
149       CHK_(ptr);
150       ctx->SetLastTag(tag);
151       goto message_done;
152     }
153     ptr = UnknownFieldParse(
154         tag,
155         _internal_metadata_.mutable_unknown_fields<std::string>(),
156         ptr, ctx);
157     CHK_(ptr != nullptr);
158   }  // while
159 message_done:
160   _impl_._has_bits_.Or(has_bits);
161   return ptr;
162 failure:
163   ptr = nullptr;
164   goto message_done;
165 #undef CHK_
166 }
167 
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const168 uint8_t* UserActionEventProto::_InternalSerialize(
169     uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
170   // @@protoc_insertion_point(serialize_to_array_start:metrics.UserActionEventProto)
171   uint32_t cached_has_bits = 0;
172   (void) cached_has_bits;
173 
174   cached_has_bits = _impl_._has_bits_[0];
175   // optional fixed64 name_hash = 1;
176   if (cached_has_bits & 0x00000001u) {
177     target = stream->EnsureSpace(target);
178     target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_name_hash(), target);
179   }
180 
181   // optional int64 time_sec = 2;
182   if (cached_has_bits & 0x00000002u) {
183     target = stream->EnsureSpace(target);
184     target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_time_sec(), target);
185   }
186 
187   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
188     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
189         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
190   }
191   // @@protoc_insertion_point(serialize_to_array_end:metrics.UserActionEventProto)
192   return target;
193 }
194 
ByteSizeLong() const195 size_t UserActionEventProto::ByteSizeLong() const {
196 // @@protoc_insertion_point(message_byte_size_start:metrics.UserActionEventProto)
197   size_t total_size = 0;
198 
199   uint32_t cached_has_bits = 0;
200   // Prevent compiler warnings about cached_has_bits being unused
201   (void) cached_has_bits;
202 
203   cached_has_bits = _impl_._has_bits_[0];
204   if (cached_has_bits & 0x00000003u) {
205     // optional fixed64 name_hash = 1;
206     if (cached_has_bits & 0x00000001u) {
207       total_size += 1 + 8;
208     }
209 
210     // optional int64 time_sec = 2;
211     if (cached_has_bits & 0x00000002u) {
212       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_time_sec());
213     }
214 
215   }
216   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
217     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
218   }
219   int cached_size = ::_pbi::ToCachedSize(total_size);
220   SetCachedSize(cached_size);
221   return total_size;
222 }
223 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)224 void UserActionEventProto::CheckTypeAndMergeFrom(
225     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
226   MergeFrom(*::_pbi::DownCast<const UserActionEventProto*>(
227       &from));
228 }
229 
MergeFrom(const UserActionEventProto & from)230 void UserActionEventProto::MergeFrom(const UserActionEventProto& from) {
231   UserActionEventProto* const _this = this;
232   // @@protoc_insertion_point(class_specific_merge_from_start:metrics.UserActionEventProto)
233   GOOGLE_DCHECK_NE(&from, _this);
234   uint32_t cached_has_bits = 0;
235   (void) cached_has_bits;
236 
237   cached_has_bits = from._impl_._has_bits_[0];
238   if (cached_has_bits & 0x00000003u) {
239     if (cached_has_bits & 0x00000001u) {
240       _this->_impl_.name_hash_ = from._impl_.name_hash_;
241     }
242     if (cached_has_bits & 0x00000002u) {
243       _this->_impl_.time_sec_ = from._impl_.time_sec_;
244     }
245     _this->_impl_._has_bits_[0] |= cached_has_bits;
246   }
247   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
248 }
249 
CopyFrom(const UserActionEventProto & from)250 void UserActionEventProto::CopyFrom(const UserActionEventProto& from) {
251 // @@protoc_insertion_point(class_specific_copy_from_start:metrics.UserActionEventProto)
252   if (&from == this) return;
253   Clear();
254   MergeFrom(from);
255 }
256 
IsInitialized() const257 bool UserActionEventProto::IsInitialized() const {
258   return true;
259 }
260 
InternalSwap(UserActionEventProto * other)261 void UserActionEventProto::InternalSwap(UserActionEventProto* other) {
262   using std::swap;
263   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
264   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
265   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
266       PROTOBUF_FIELD_OFFSET(UserActionEventProto, _impl_.time_sec_)
267       + sizeof(UserActionEventProto::_impl_.time_sec_)
268       - PROTOBUF_FIELD_OFFSET(UserActionEventProto, _impl_.name_hash_)>(
269           reinterpret_cast<char*>(&_impl_.name_hash_),
270           reinterpret_cast<char*>(&other->_impl_.name_hash_));
271 }
272 
GetTypeName() const273 std::string UserActionEventProto::GetTypeName() const {
274   return "metrics.UserActionEventProto";
275 }
276 
277 
278 // @@protoc_insertion_point(namespace_scope)
279 }  // namespace metrics
280 PROTOBUF_NAMESPACE_OPEN
281 template<> PROTOBUF_NOINLINE ::metrics::UserActionEventProto*
CreateMaybeMessage(Arena * arena)282 Arena::CreateMaybeMessage< ::metrics::UserActionEventProto >(Arena* arena) {
283   return Arena::CreateMessageInternal< ::metrics::UserActionEventProto >(arena);
284 }
285 PROTOBUF_NAMESPACE_CLOSE
286 
287 // @@protoc_insertion_point(global_scope)
288 #include <google/protobuf/port_undef.inc>
289