1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: icing/legacy/index/proto/icing-dynamic-trie-header.proto
3
4 #include "icing/legacy/index/proto/icing-dynamic-trie-header.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace icing {
IcingDynamicTrieHeader(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR IcingDynamicTrieHeader::IcingDynamicTrieHeader(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_._has_bits_)*/{}
25 , /*decltype(_impl_._cached_size_)*/{}
26 , /*decltype(_impl_.free_lists_)*/{}
27 , /*decltype(_impl_.version_)*/0u
28 , /*decltype(_impl_.value_size_)*/0u
29 , /*decltype(_impl_.max_nodes_)*/0u
30 , /*decltype(_impl_.max_nexts_)*/0u
31 , /*decltype(_impl_.max_suffixes_size_)*/0u
32 , /*decltype(_impl_.num_nodes_)*/0u
33 , /*decltype(_impl_.num_nexts_)*/0u
34 , /*decltype(_impl_.suffixes_size_)*/0u
35 , /*decltype(_impl_.num_keys_)*/0u
36 , /*decltype(_impl_.deprecated_is_flushing_)*/false} {}
37 struct IcingDynamicTrieHeaderDefaultTypeInternal {
IcingDynamicTrieHeaderDefaultTypeInternalicing::IcingDynamicTrieHeaderDefaultTypeInternal38 PROTOBUF_CONSTEXPR IcingDynamicTrieHeaderDefaultTypeInternal()
39 : _instance(::_pbi::ConstantInitialized{}) {}
~IcingDynamicTrieHeaderDefaultTypeInternalicing::IcingDynamicTrieHeaderDefaultTypeInternal40 ~IcingDynamicTrieHeaderDefaultTypeInternal() {}
41 union { // NOLINT(misc-non-private-member-variables-in-classes)
42 IcingDynamicTrieHeader _instance;
43 };
44 };
45 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IcingDynamicTrieHeaderDefaultTypeInternal _IcingDynamicTrieHeader_default_instance_;
46 } // namespace icing
47 namespace icing {
48
49 // ===================================================================
50
51 class IcingDynamicTrieHeader::_Internal {
52 public:
53 using HasBits = decltype(std::declval<IcingDynamicTrieHeader>()._impl_._has_bits_);
set_has_version(HasBits * has_bits)54 static void set_has_version(HasBits* has_bits) {
55 (*has_bits)[0] |= 1u;
56 }
set_has_value_size(HasBits * has_bits)57 static void set_has_value_size(HasBits* has_bits) {
58 (*has_bits)[0] |= 2u;
59 }
set_has_max_nodes(HasBits * has_bits)60 static void set_has_max_nodes(HasBits* has_bits) {
61 (*has_bits)[0] |= 4u;
62 }
set_has_max_nexts(HasBits * has_bits)63 static void set_has_max_nexts(HasBits* has_bits) {
64 (*has_bits)[0] |= 8u;
65 }
set_has_max_suffixes_size(HasBits * has_bits)66 static void set_has_max_suffixes_size(HasBits* has_bits) {
67 (*has_bits)[0] |= 16u;
68 }
set_has_num_nodes(HasBits * has_bits)69 static void set_has_num_nodes(HasBits* has_bits) {
70 (*has_bits)[0] |= 32u;
71 }
set_has_num_nexts(HasBits * has_bits)72 static void set_has_num_nexts(HasBits* has_bits) {
73 (*has_bits)[0] |= 64u;
74 }
set_has_suffixes_size(HasBits * has_bits)75 static void set_has_suffixes_size(HasBits* has_bits) {
76 (*has_bits)[0] |= 128u;
77 }
set_has_num_keys(HasBits * has_bits)78 static void set_has_num_keys(HasBits* has_bits) {
79 (*has_bits)[0] |= 256u;
80 }
set_has_deprecated_is_flushing(HasBits * has_bits)81 static void set_has_deprecated_is_flushing(HasBits* has_bits) {
82 (*has_bits)[0] |= 512u;
83 }
84 };
85
IcingDynamicTrieHeader(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)86 IcingDynamicTrieHeader::IcingDynamicTrieHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena,
87 bool is_message_owned)
88 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
89 SharedCtor(arena, is_message_owned);
90 // @@protoc_insertion_point(arena_constructor:icing.IcingDynamicTrieHeader)
91 }
IcingDynamicTrieHeader(const IcingDynamicTrieHeader & from)92 IcingDynamicTrieHeader::IcingDynamicTrieHeader(const IcingDynamicTrieHeader& from)
93 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
94 IcingDynamicTrieHeader* const _this = this; (void)_this;
95 new (&_impl_) Impl_{
96 decltype(_impl_._has_bits_){from._impl_._has_bits_}
97 , /*decltype(_impl_._cached_size_)*/{}
98 , decltype(_impl_.free_lists_){from._impl_.free_lists_}
99 , decltype(_impl_.version_){}
100 , decltype(_impl_.value_size_){}
101 , decltype(_impl_.max_nodes_){}
102 , decltype(_impl_.max_nexts_){}
103 , decltype(_impl_.max_suffixes_size_){}
104 , decltype(_impl_.num_nodes_){}
105 , decltype(_impl_.num_nexts_){}
106 , decltype(_impl_.suffixes_size_){}
107 , decltype(_impl_.num_keys_){}
108 , decltype(_impl_.deprecated_is_flushing_){}};
109
110 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
111 ::memcpy(&_impl_.version_, &from._impl_.version_,
112 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.deprecated_is_flushing_) -
113 reinterpret_cast<char*>(&_impl_.version_)) + sizeof(_impl_.deprecated_is_flushing_));
114 // @@protoc_insertion_point(copy_constructor:icing.IcingDynamicTrieHeader)
115 }
116
SharedCtor(::_pb::Arena * arena,bool is_message_owned)117 inline void IcingDynamicTrieHeader::SharedCtor(
118 ::_pb::Arena* arena, bool is_message_owned) {
119 (void)arena;
120 (void)is_message_owned;
121 new (&_impl_) Impl_{
122 decltype(_impl_._has_bits_){}
123 , /*decltype(_impl_._cached_size_)*/{}
124 , decltype(_impl_.free_lists_){arena}
125 , decltype(_impl_.version_){0u}
126 , decltype(_impl_.value_size_){0u}
127 , decltype(_impl_.max_nodes_){0u}
128 , decltype(_impl_.max_nexts_){0u}
129 , decltype(_impl_.max_suffixes_size_){0u}
130 , decltype(_impl_.num_nodes_){0u}
131 , decltype(_impl_.num_nexts_){0u}
132 , decltype(_impl_.suffixes_size_){0u}
133 , decltype(_impl_.num_keys_){0u}
134 , decltype(_impl_.deprecated_is_flushing_){false}
135 };
136 }
137
~IcingDynamicTrieHeader()138 IcingDynamicTrieHeader::~IcingDynamicTrieHeader() {
139 // @@protoc_insertion_point(destructor:icing.IcingDynamicTrieHeader)
140 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
141 (void)arena;
142 return;
143 }
144 SharedDtor();
145 }
146
SharedDtor()147 inline void IcingDynamicTrieHeader::SharedDtor() {
148 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
149 _impl_.free_lists_.~RepeatedField();
150 }
151
SetCachedSize(int size) const152 void IcingDynamicTrieHeader::SetCachedSize(int size) const {
153 _impl_._cached_size_.Set(size);
154 }
155
Clear()156 void IcingDynamicTrieHeader::Clear() {
157 // @@protoc_insertion_point(message_clear_start:icing.IcingDynamicTrieHeader)
158 ::uint32_t cached_has_bits = 0;
159 // Prevent compiler warnings about cached_has_bits being unused
160 (void) cached_has_bits;
161
162 _impl_.free_lists_.Clear();
163 cached_has_bits = _impl_._has_bits_[0];
164 if (cached_has_bits & 0x000000ffu) {
165 ::memset(&_impl_.version_, 0, static_cast<size_t>(
166 reinterpret_cast<char*>(&_impl_.suffixes_size_) -
167 reinterpret_cast<char*>(&_impl_.version_)) + sizeof(_impl_.suffixes_size_));
168 }
169 if (cached_has_bits & 0x00000300u) {
170 ::memset(&_impl_.num_keys_, 0, static_cast<size_t>(
171 reinterpret_cast<char*>(&_impl_.deprecated_is_flushing_) -
172 reinterpret_cast<char*>(&_impl_.num_keys_)) + sizeof(_impl_.deprecated_is_flushing_));
173 }
174 _impl_._has_bits_.Clear();
175 _internal_metadata_.Clear<std::string>();
176 }
177
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)178 const char* IcingDynamicTrieHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
179 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
180 _Internal::HasBits has_bits{};
181 while (!ctx->Done(&ptr)) {
182 ::uint32_t tag;
183 ptr = ::_pbi::ReadTag(ptr, &tag);
184 switch (tag >> 3) {
185 // optional uint32 version = 1;
186 case 1:
187 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
188 _Internal::set_has_version(&has_bits);
189 _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
190 CHK_(ptr);
191 } else {
192 goto handle_unusual;
193 }
194 continue;
195 // optional uint32 value_size = 2;
196 case 2:
197 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
198 _Internal::set_has_value_size(&has_bits);
199 _impl_.value_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
200 CHK_(ptr);
201 } else {
202 goto handle_unusual;
203 }
204 continue;
205 // optional uint32 max_nodes = 3;
206 case 3:
207 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
208 _Internal::set_has_max_nodes(&has_bits);
209 _impl_.max_nodes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
210 CHK_(ptr);
211 } else {
212 goto handle_unusual;
213 }
214 continue;
215 // optional uint32 max_nexts = 4;
216 case 4:
217 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
218 _Internal::set_has_max_nexts(&has_bits);
219 _impl_.max_nexts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
220 CHK_(ptr);
221 } else {
222 goto handle_unusual;
223 }
224 continue;
225 // optional uint32 max_suffixes_size = 5;
226 case 5:
227 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
228 _Internal::set_has_max_suffixes_size(&has_bits);
229 _impl_.max_suffixes_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
230 CHK_(ptr);
231 } else {
232 goto handle_unusual;
233 }
234 continue;
235 // optional uint32 num_nodes = 6;
236 case 6:
237 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
238 _Internal::set_has_num_nodes(&has_bits);
239 _impl_.num_nodes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
240 CHK_(ptr);
241 } else {
242 goto handle_unusual;
243 }
244 continue;
245 // optional uint32 num_nexts = 7;
246 case 7:
247 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
248 _Internal::set_has_num_nexts(&has_bits);
249 _impl_.num_nexts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
250 CHK_(ptr);
251 } else {
252 goto handle_unusual;
253 }
254 continue;
255 // optional uint32 suffixes_size = 8;
256 case 8:
257 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
258 _Internal::set_has_suffixes_size(&has_bits);
259 _impl_.suffixes_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
260 CHK_(ptr);
261 } else {
262 goto handle_unusual;
263 }
264 continue;
265 // repeated uint32 free_lists = 9;
266 case 9:
267 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
268 ptr -= 1;
269 do {
270 ptr += 1;
271 _internal_add_free_lists(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
272 CHK_(ptr);
273 if (!ctx->DataAvailable(ptr)) break;
274 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<72>(ptr));
275 } else if (static_cast<::uint8_t>(tag) == 74) {
276 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_free_lists(), ptr, ctx);
277 CHK_(ptr);
278 } else {
279 goto handle_unusual;
280 }
281 continue;
282 // optional uint32 num_keys = 10;
283 case 10:
284 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
285 _Internal::set_has_num_keys(&has_bits);
286 _impl_.num_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
287 CHK_(ptr);
288 } else {
289 goto handle_unusual;
290 }
291 continue;
292 // optional bool deprecated_is_flushing = 11 [deprecated = true];
293 case 11:
294 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
295 _Internal::set_has_deprecated_is_flushing(&has_bits);
296 _impl_.deprecated_is_flushing_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
297 CHK_(ptr);
298 } else {
299 goto handle_unusual;
300 }
301 continue;
302 default:
303 goto handle_unusual;
304 } // switch
305 handle_unusual:
306 if ((tag == 0) || ((tag & 7) == 4)) {
307 CHK_(ptr);
308 ctx->SetLastTag(tag);
309 goto message_done;
310 }
311 ptr = UnknownFieldParse(
312 tag,
313 _internal_metadata_.mutable_unknown_fields<std::string>(),
314 ptr, ctx);
315 CHK_(ptr != nullptr);
316 } // while
317 message_done:
318 _impl_._has_bits_.Or(has_bits);
319 return ptr;
320 failure:
321 ptr = nullptr;
322 goto message_done;
323 #undef CHK_
324 }
325
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const326 ::uint8_t* IcingDynamicTrieHeader::_InternalSerialize(
327 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
328 // @@protoc_insertion_point(serialize_to_array_start:icing.IcingDynamicTrieHeader)
329 ::uint32_t cached_has_bits = 0;
330 (void) cached_has_bits;
331
332 cached_has_bits = _impl_._has_bits_[0];
333 // optional uint32 version = 1;
334 if (cached_has_bits & 0x00000001u) {
335 target = stream->EnsureSpace(target);
336 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target);
337 }
338
339 // optional uint32 value_size = 2;
340 if (cached_has_bits & 0x00000002u) {
341 target = stream->EnsureSpace(target);
342 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_value_size(), target);
343 }
344
345 // optional uint32 max_nodes = 3;
346 if (cached_has_bits & 0x00000004u) {
347 target = stream->EnsureSpace(target);
348 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_max_nodes(), target);
349 }
350
351 // optional uint32 max_nexts = 4;
352 if (cached_has_bits & 0x00000008u) {
353 target = stream->EnsureSpace(target);
354 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_max_nexts(), target);
355 }
356
357 // optional uint32 max_suffixes_size = 5;
358 if (cached_has_bits & 0x00000010u) {
359 target = stream->EnsureSpace(target);
360 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_max_suffixes_size(), target);
361 }
362
363 // optional uint32 num_nodes = 6;
364 if (cached_has_bits & 0x00000020u) {
365 target = stream->EnsureSpace(target);
366 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_num_nodes(), target);
367 }
368
369 // optional uint32 num_nexts = 7;
370 if (cached_has_bits & 0x00000040u) {
371 target = stream->EnsureSpace(target);
372 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_num_nexts(), target);
373 }
374
375 // optional uint32 suffixes_size = 8;
376 if (cached_has_bits & 0x00000080u) {
377 target = stream->EnsureSpace(target);
378 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_suffixes_size(), target);
379 }
380
381 // repeated uint32 free_lists = 9;
382 for (int i = 0, n = this->_internal_free_lists_size(); i < n; i++) {
383 target = stream->EnsureSpace(target);
384 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(9, this->_internal_free_lists(i), target);
385 }
386
387 // optional uint32 num_keys = 10;
388 if (cached_has_bits & 0x00000100u) {
389 target = stream->EnsureSpace(target);
390 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(10, this->_internal_num_keys(), target);
391 }
392
393 // optional bool deprecated_is_flushing = 11 [deprecated = true];
394 if (cached_has_bits & 0x00000200u) {
395 target = stream->EnsureSpace(target);
396 target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_deprecated_is_flushing(), target);
397 }
398
399 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
400 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
401 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
402 }
403 // @@protoc_insertion_point(serialize_to_array_end:icing.IcingDynamicTrieHeader)
404 return target;
405 }
406
ByteSizeLong() const407 size_t IcingDynamicTrieHeader::ByteSizeLong() const {
408 // @@protoc_insertion_point(message_byte_size_start:icing.IcingDynamicTrieHeader)
409 size_t total_size = 0;
410
411 ::uint32_t cached_has_bits = 0;
412 // Prevent compiler warnings about cached_has_bits being unused
413 (void) cached_has_bits;
414
415 // repeated uint32 free_lists = 9;
416 {
417 size_t data_size = ::_pbi::WireFormatLite::
418 UInt32Size(this->_impl_.free_lists_);
419 total_size += 1 *
420 ::_pbi::FromIntSize(this->_internal_free_lists_size());
421 total_size += data_size;
422 }
423
424 cached_has_bits = _impl_._has_bits_[0];
425 if (cached_has_bits & 0x000000ffu) {
426 // optional uint32 version = 1;
427 if (cached_has_bits & 0x00000001u) {
428 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version());
429 }
430
431 // optional uint32 value_size = 2;
432 if (cached_has_bits & 0x00000002u) {
433 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_value_size());
434 }
435
436 // optional uint32 max_nodes = 3;
437 if (cached_has_bits & 0x00000004u) {
438 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_nodes());
439 }
440
441 // optional uint32 max_nexts = 4;
442 if (cached_has_bits & 0x00000008u) {
443 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_nexts());
444 }
445
446 // optional uint32 max_suffixes_size = 5;
447 if (cached_has_bits & 0x00000010u) {
448 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_suffixes_size());
449 }
450
451 // optional uint32 num_nodes = 6;
452 if (cached_has_bits & 0x00000020u) {
453 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_num_nodes());
454 }
455
456 // optional uint32 num_nexts = 7;
457 if (cached_has_bits & 0x00000040u) {
458 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_num_nexts());
459 }
460
461 // optional uint32 suffixes_size = 8;
462 if (cached_has_bits & 0x00000080u) {
463 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_suffixes_size());
464 }
465
466 }
467 if (cached_has_bits & 0x00000300u) {
468 // optional uint32 num_keys = 10;
469 if (cached_has_bits & 0x00000100u) {
470 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_num_keys());
471 }
472
473 // optional bool deprecated_is_flushing = 11 [deprecated = true];
474 if (cached_has_bits & 0x00000200u) {
475 total_size += 1 + 1;
476 }
477
478 }
479 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
480 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
481 }
482 int cached_size = ::_pbi::ToCachedSize(total_size);
483 SetCachedSize(cached_size);
484 return total_size;
485 }
486
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)487 void IcingDynamicTrieHeader::CheckTypeAndMergeFrom(
488 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
489 MergeFrom(*::_pbi::DownCast<const IcingDynamicTrieHeader*>(
490 &from));
491 }
492
MergeFrom(const IcingDynamicTrieHeader & from)493 void IcingDynamicTrieHeader::MergeFrom(const IcingDynamicTrieHeader& from) {
494 IcingDynamicTrieHeader* const _this = this;
495 // @@protoc_insertion_point(class_specific_merge_from_start:icing.IcingDynamicTrieHeader)
496 GOOGLE_DCHECK_NE(&from, _this);
497 ::uint32_t cached_has_bits = 0;
498 (void) cached_has_bits;
499
500 _this->_impl_.free_lists_.MergeFrom(from._impl_.free_lists_);
501 cached_has_bits = from._impl_._has_bits_[0];
502 if (cached_has_bits & 0x000000ffu) {
503 if (cached_has_bits & 0x00000001u) {
504 _this->_impl_.version_ = from._impl_.version_;
505 }
506 if (cached_has_bits & 0x00000002u) {
507 _this->_impl_.value_size_ = from._impl_.value_size_;
508 }
509 if (cached_has_bits & 0x00000004u) {
510 _this->_impl_.max_nodes_ = from._impl_.max_nodes_;
511 }
512 if (cached_has_bits & 0x00000008u) {
513 _this->_impl_.max_nexts_ = from._impl_.max_nexts_;
514 }
515 if (cached_has_bits & 0x00000010u) {
516 _this->_impl_.max_suffixes_size_ = from._impl_.max_suffixes_size_;
517 }
518 if (cached_has_bits & 0x00000020u) {
519 _this->_impl_.num_nodes_ = from._impl_.num_nodes_;
520 }
521 if (cached_has_bits & 0x00000040u) {
522 _this->_impl_.num_nexts_ = from._impl_.num_nexts_;
523 }
524 if (cached_has_bits & 0x00000080u) {
525 _this->_impl_.suffixes_size_ = from._impl_.suffixes_size_;
526 }
527 _this->_impl_._has_bits_[0] |= cached_has_bits;
528 }
529 if (cached_has_bits & 0x00000300u) {
530 if (cached_has_bits & 0x00000100u) {
531 _this->_impl_.num_keys_ = from._impl_.num_keys_;
532 }
533 if (cached_has_bits & 0x00000200u) {
534 _this->_impl_.deprecated_is_flushing_ = from._impl_.deprecated_is_flushing_;
535 }
536 _this->_impl_._has_bits_[0] |= cached_has_bits;
537 }
538 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
539 }
540
CopyFrom(const IcingDynamicTrieHeader & from)541 void IcingDynamicTrieHeader::CopyFrom(const IcingDynamicTrieHeader& from) {
542 // @@protoc_insertion_point(class_specific_copy_from_start:icing.IcingDynamicTrieHeader)
543 if (&from == this) return;
544 Clear();
545 MergeFrom(from);
546 }
547
IsInitialized() const548 bool IcingDynamicTrieHeader::IsInitialized() const {
549 return true;
550 }
551
InternalSwap(IcingDynamicTrieHeader * other)552 void IcingDynamicTrieHeader::InternalSwap(IcingDynamicTrieHeader* other) {
553 using std::swap;
554 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
555 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
556 _impl_.free_lists_.InternalSwap(&other->_impl_.free_lists_);
557 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
558 PROTOBUF_FIELD_OFFSET(IcingDynamicTrieHeader, _impl_.deprecated_is_flushing_)
559 + sizeof(IcingDynamicTrieHeader::_impl_.deprecated_is_flushing_) // NOLINT
560 - PROTOBUF_FIELD_OFFSET(IcingDynamicTrieHeader, _impl_.version_)>(
561 reinterpret_cast<char*>(&_impl_.version_),
562 reinterpret_cast<char*>(&other->_impl_.version_));
563 }
564
GetTypeName() const565 std::string IcingDynamicTrieHeader::GetTypeName() const {
566 return "icing.IcingDynamicTrieHeader";
567 }
568
569
570 // @@protoc_insertion_point(namespace_scope)
571 } // namespace icing
572 PROTOBUF_NAMESPACE_OPEN
573 template<> PROTOBUF_NOINLINE ::icing::IcingDynamicTrieHeader*
CreateMaybeMessage(Arena * arena)574 Arena::CreateMaybeMessage< ::icing::IcingDynamicTrieHeader >(Arena* arena) {
575 return Arena::CreateMessageInternal< ::icing::IcingDynamicTrieHeader >(arena);
576 }
577 PROTOBUF_NAMESPACE_CLOSE
578
579 // @@protoc_insertion_point(global_scope)
580 #include <google/protobuf/port_undef.inc>
581