1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ukm/web_features.proto
3
4 #include "ukm/web_features.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 {
HighLevelWebFeatures(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR HighLevelWebFeatures::HighLevelWebFeatures(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.bit_vector_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
26 , /*decltype(_impl_.source_id_)*/int64_t{0}
27 , /*decltype(_impl_.encoding_version_)*/0u} {}
28 struct HighLevelWebFeaturesDefaultTypeInternal {
HighLevelWebFeaturesDefaultTypeInternalukm::HighLevelWebFeaturesDefaultTypeInternal29 PROTOBUF_CONSTEXPR HighLevelWebFeaturesDefaultTypeInternal()
30 : _instance(::_pbi::ConstantInitialized{}) {}
~HighLevelWebFeaturesDefaultTypeInternalukm::HighLevelWebFeaturesDefaultTypeInternal31 ~HighLevelWebFeaturesDefaultTypeInternal() {}
32 union {
33 HighLevelWebFeatures _instance;
34 };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HighLevelWebFeaturesDefaultTypeInternal _HighLevelWebFeatures_default_instance_;
37 } // namespace ukm
38 namespace ukm {
39
40 // ===================================================================
41
42 class HighLevelWebFeatures::_Internal {
43 public:
44 using HasBits = decltype(std::declval<HighLevelWebFeatures>()._impl_._has_bits_);
set_has_bit_vector(HasBits * has_bits)45 static void set_has_bit_vector(HasBits* has_bits) {
46 (*has_bits)[0] |= 1u;
47 }
set_has_source_id(HasBits * has_bits)48 static void set_has_source_id(HasBits* has_bits) {
49 (*has_bits)[0] |= 2u;
50 }
set_has_encoding_version(HasBits * has_bits)51 static void set_has_encoding_version(HasBits* has_bits) {
52 (*has_bits)[0] |= 4u;
53 }
54 };
55
HighLevelWebFeatures(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)56 HighLevelWebFeatures::HighLevelWebFeatures(::PROTOBUF_NAMESPACE_ID::Arena* arena,
57 bool is_message_owned)
58 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
59 SharedCtor(arena, is_message_owned);
60 // @@protoc_insertion_point(arena_constructor:ukm.HighLevelWebFeatures)
61 }
HighLevelWebFeatures(const HighLevelWebFeatures & from)62 HighLevelWebFeatures::HighLevelWebFeatures(const HighLevelWebFeatures& from)
63 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
64 HighLevelWebFeatures* const _this = this; (void)_this;
65 new (&_impl_) Impl_{
66 decltype(_impl_._has_bits_){from._impl_._has_bits_}
67 , /*decltype(_impl_._cached_size_)*/{}
68 , decltype(_impl_.bit_vector_){}
69 , decltype(_impl_.source_id_){}
70 , decltype(_impl_.encoding_version_){}};
71
72 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
73 _impl_.bit_vector_.InitDefault();
74 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
75 _impl_.bit_vector_.Set("", GetArenaForAllocation());
76 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
77 if (from._internal_has_bit_vector()) {
78 _this->_impl_.bit_vector_.Set(from._internal_bit_vector(),
79 _this->GetArenaForAllocation());
80 }
81 ::memcpy(&_impl_.source_id_, &from._impl_.source_id_,
82 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.encoding_version_) -
83 reinterpret_cast<char*>(&_impl_.source_id_)) + sizeof(_impl_.encoding_version_));
84 // @@protoc_insertion_point(copy_constructor:ukm.HighLevelWebFeatures)
85 }
86
SharedCtor(::_pb::Arena * arena,bool is_message_owned)87 inline void HighLevelWebFeatures::SharedCtor(
88 ::_pb::Arena* arena, bool is_message_owned) {
89 (void)arena;
90 (void)is_message_owned;
91 new (&_impl_) Impl_{
92 decltype(_impl_._has_bits_){}
93 , /*decltype(_impl_._cached_size_)*/{}
94 , decltype(_impl_.bit_vector_){}
95 , decltype(_impl_.source_id_){int64_t{0}}
96 , decltype(_impl_.encoding_version_){0u}
97 };
98 _impl_.bit_vector_.InitDefault();
99 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
100 _impl_.bit_vector_.Set("", GetArenaForAllocation());
101 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
102 }
103
~HighLevelWebFeatures()104 HighLevelWebFeatures::~HighLevelWebFeatures() {
105 // @@protoc_insertion_point(destructor:ukm.HighLevelWebFeatures)
106 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
107 (void)arena;
108 return;
109 }
110 SharedDtor();
111 }
112
SharedDtor()113 inline void HighLevelWebFeatures::SharedDtor() {
114 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
115 _impl_.bit_vector_.Destroy();
116 }
117
SetCachedSize(int size) const118 void HighLevelWebFeatures::SetCachedSize(int size) const {
119 _impl_._cached_size_.Set(size);
120 }
121
Clear()122 void HighLevelWebFeatures::Clear() {
123 // @@protoc_insertion_point(message_clear_start:ukm.HighLevelWebFeatures)
124 uint32_t cached_has_bits = 0;
125 // Prevent compiler warnings about cached_has_bits being unused
126 (void) cached_has_bits;
127
128 cached_has_bits = _impl_._has_bits_[0];
129 if (cached_has_bits & 0x00000001u) {
130 _impl_.bit_vector_.ClearNonDefaultToEmpty();
131 }
132 if (cached_has_bits & 0x00000006u) {
133 ::memset(&_impl_.source_id_, 0, static_cast<size_t>(
134 reinterpret_cast<char*>(&_impl_.encoding_version_) -
135 reinterpret_cast<char*>(&_impl_.source_id_)) + sizeof(_impl_.encoding_version_));
136 }
137 _impl_._has_bits_.Clear();
138 _internal_metadata_.Clear<std::string>();
139 }
140
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)141 const char* HighLevelWebFeatures::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
142 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
143 _Internal::HasBits has_bits{};
144 while (!ctx->Done(&ptr)) {
145 uint32_t tag;
146 ptr = ::_pbi::ReadTag(ptr, &tag);
147 switch (tag >> 3) {
148 // optional bytes bit_vector = 1;
149 case 1:
150 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
151 auto str = _internal_mutable_bit_vector();
152 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
153 CHK_(ptr);
154 } else
155 goto handle_unusual;
156 continue;
157 // optional int64 source_id = 2;
158 case 2:
159 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
160 _Internal::set_has_source_id(&has_bits);
161 _impl_.source_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
162 CHK_(ptr);
163 } else
164 goto handle_unusual;
165 continue;
166 // optional uint32 encoding_version = 3 [default = 0];
167 case 3:
168 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
169 _Internal::set_has_encoding_version(&has_bits);
170 _impl_.encoding_version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
171 CHK_(ptr);
172 } else
173 goto handle_unusual;
174 continue;
175 default:
176 goto handle_unusual;
177 } // switch
178 handle_unusual:
179 if ((tag == 0) || ((tag & 7) == 4)) {
180 CHK_(ptr);
181 ctx->SetLastTag(tag);
182 goto message_done;
183 }
184 ptr = UnknownFieldParse(
185 tag,
186 _internal_metadata_.mutable_unknown_fields<std::string>(),
187 ptr, ctx);
188 CHK_(ptr != nullptr);
189 } // while
190 message_done:
191 _impl_._has_bits_.Or(has_bits);
192 return ptr;
193 failure:
194 ptr = nullptr;
195 goto message_done;
196 #undef CHK_
197 }
198
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const199 uint8_t* HighLevelWebFeatures::_InternalSerialize(
200 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
201 // @@protoc_insertion_point(serialize_to_array_start:ukm.HighLevelWebFeatures)
202 uint32_t cached_has_bits = 0;
203 (void) cached_has_bits;
204
205 cached_has_bits = _impl_._has_bits_[0];
206 // optional bytes bit_vector = 1;
207 if (cached_has_bits & 0x00000001u) {
208 target = stream->WriteBytesMaybeAliased(
209 1, this->_internal_bit_vector(), target);
210 }
211
212 // optional int64 source_id = 2;
213 if (cached_has_bits & 0x00000002u) {
214 target = stream->EnsureSpace(target);
215 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_source_id(), target);
216 }
217
218 // optional uint32 encoding_version = 3 [default = 0];
219 if (cached_has_bits & 0x00000004u) {
220 target = stream->EnsureSpace(target);
221 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_encoding_version(), target);
222 }
223
224 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
225 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
226 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
227 }
228 // @@protoc_insertion_point(serialize_to_array_end:ukm.HighLevelWebFeatures)
229 return target;
230 }
231
ByteSizeLong() const232 size_t HighLevelWebFeatures::ByteSizeLong() const {
233 // @@protoc_insertion_point(message_byte_size_start:ukm.HighLevelWebFeatures)
234 size_t total_size = 0;
235
236 uint32_t cached_has_bits = 0;
237 // Prevent compiler warnings about cached_has_bits being unused
238 (void) cached_has_bits;
239
240 cached_has_bits = _impl_._has_bits_[0];
241 if (cached_has_bits & 0x00000007u) {
242 // optional bytes bit_vector = 1;
243 if (cached_has_bits & 0x00000001u) {
244 total_size += 1 +
245 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
246 this->_internal_bit_vector());
247 }
248
249 // optional int64 source_id = 2;
250 if (cached_has_bits & 0x00000002u) {
251 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_source_id());
252 }
253
254 // optional uint32 encoding_version = 3 [default = 0];
255 if (cached_has_bits & 0x00000004u) {
256 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_encoding_version());
257 }
258
259 }
260 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
261 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
262 }
263 int cached_size = ::_pbi::ToCachedSize(total_size);
264 SetCachedSize(cached_size);
265 return total_size;
266 }
267
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)268 void HighLevelWebFeatures::CheckTypeAndMergeFrom(
269 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
270 MergeFrom(*::_pbi::DownCast<const HighLevelWebFeatures*>(
271 &from));
272 }
273
MergeFrom(const HighLevelWebFeatures & from)274 void HighLevelWebFeatures::MergeFrom(const HighLevelWebFeatures& from) {
275 HighLevelWebFeatures* const _this = this;
276 // @@protoc_insertion_point(class_specific_merge_from_start:ukm.HighLevelWebFeatures)
277 GOOGLE_DCHECK_NE(&from, _this);
278 uint32_t cached_has_bits = 0;
279 (void) cached_has_bits;
280
281 cached_has_bits = from._impl_._has_bits_[0];
282 if (cached_has_bits & 0x00000007u) {
283 if (cached_has_bits & 0x00000001u) {
284 _this->_internal_set_bit_vector(from._internal_bit_vector());
285 }
286 if (cached_has_bits & 0x00000002u) {
287 _this->_impl_.source_id_ = from._impl_.source_id_;
288 }
289 if (cached_has_bits & 0x00000004u) {
290 _this->_impl_.encoding_version_ = from._impl_.encoding_version_;
291 }
292 _this->_impl_._has_bits_[0] |= cached_has_bits;
293 }
294 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
295 }
296
CopyFrom(const HighLevelWebFeatures & from)297 void HighLevelWebFeatures::CopyFrom(const HighLevelWebFeatures& from) {
298 // @@protoc_insertion_point(class_specific_copy_from_start:ukm.HighLevelWebFeatures)
299 if (&from == this) return;
300 Clear();
301 MergeFrom(from);
302 }
303
IsInitialized() const304 bool HighLevelWebFeatures::IsInitialized() const {
305 return true;
306 }
307
InternalSwap(HighLevelWebFeatures * other)308 void HighLevelWebFeatures::InternalSwap(HighLevelWebFeatures* other) {
309 using std::swap;
310 auto* lhs_arena = GetArenaForAllocation();
311 auto* rhs_arena = other->GetArenaForAllocation();
312 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
313 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
314 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
315 &_impl_.bit_vector_, lhs_arena,
316 &other->_impl_.bit_vector_, rhs_arena
317 );
318 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
319 PROTOBUF_FIELD_OFFSET(HighLevelWebFeatures, _impl_.encoding_version_)
320 + sizeof(HighLevelWebFeatures::_impl_.encoding_version_)
321 - PROTOBUF_FIELD_OFFSET(HighLevelWebFeatures, _impl_.source_id_)>(
322 reinterpret_cast<char*>(&_impl_.source_id_),
323 reinterpret_cast<char*>(&other->_impl_.source_id_));
324 }
325
GetTypeName() const326 std::string HighLevelWebFeatures::GetTypeName() const {
327 return "ukm.HighLevelWebFeatures";
328 }
329
330
331 // @@protoc_insertion_point(namespace_scope)
332 } // namespace ukm
333 PROTOBUF_NAMESPACE_OPEN
334 template<> PROTOBUF_NOINLINE ::ukm::HighLevelWebFeatures*
CreateMaybeMessage(Arena * arena)335 Arena::CreateMaybeMessage< ::ukm::HighLevelWebFeatures >(Arena* arena) {
336 return Arena::CreateMessageInternal< ::ukm::HighLevelWebFeatures >(arena);
337 }
338 PROTOBUF_NAMESPACE_CLOSE
339
340 // @@protoc_insertion_point(global_scope)
341 #include <google/protobuf/port_undef.inc>
342