-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathmutation.pb.cc
715 lines (648 loc) · 28.1 KB
/
mutation.pb.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: firestore/local/mutation.proto
#include "firestore/local/mutation.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/generated_message_tctable_impl.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace firestore {
namespace client {
inline constexpr MutationQueue::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: last_stream_token_(
&::google::protobuf::internal::fixed_address_empty_string,
::_pbi::ConstantInitialized()),
last_acknowledged_batch_id_{0},
_cached_size_{0} {}
template <typename>
PROTOBUF_CONSTEXPR MutationQueue::MutationQueue(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct MutationQueueDefaultTypeInternal {
PROTOBUF_CONSTEXPR MutationQueueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~MutationQueueDefaultTypeInternal() {}
union {
MutationQueue _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MutationQueueDefaultTypeInternal _MutationQueue_default_instance_;
inline constexpr WriteBatch::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: _cached_size_{0},
writes_{},
base_writes_{},
local_write_time_{nullptr},
batch_id_{0} {}
template <typename>
PROTOBUF_CONSTEXPR WriteBatch::WriteBatch(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct WriteBatchDefaultTypeInternal {
PROTOBUF_CONSTEXPR WriteBatchDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~WriteBatchDefaultTypeInternal() {}
union {
WriteBatch _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WriteBatchDefaultTypeInternal _WriteBatch_default_instance_;
} // namespace client
} // namespace firestore
static ::_pb::Metadata file_level_metadata_firestore_2flocal_2fmutation_2eproto[2];
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_firestore_2flocal_2fmutation_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_firestore_2flocal_2fmutation_2eproto = nullptr;
const ::uint32_t TableStruct_firestore_2flocal_2fmutation_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::firestore::client::MutationQueue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::firestore::client::MutationQueue, _impl_.last_acknowledged_batch_id_),
PROTOBUF_FIELD_OFFSET(::firestore::client::MutationQueue, _impl_.last_stream_token_),
PROTOBUF_FIELD_OFFSET(::firestore::client::WriteBatch, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::firestore::client::WriteBatch, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::firestore::client::WriteBatch, _impl_.batch_id_),
PROTOBUF_FIELD_OFFSET(::firestore::client::WriteBatch, _impl_.writes_),
PROTOBUF_FIELD_OFFSET(::firestore::client::WriteBatch, _impl_.local_write_time_),
PROTOBUF_FIELD_OFFSET(::firestore::client::WriteBatch, _impl_.base_writes_),
~0u,
~0u,
0,
~0u,
};
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::firestore::client::MutationQueue)},
{10, 22, -1, sizeof(::firestore::client::WriteBatch)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::firestore::client::_MutationQueue_default_instance_._instance,
&::firestore::client::_WriteBatch_default_instance_._instance,
};
const char descriptor_table_protodef_firestore_2flocal_2fmutation_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\036firestore/local/mutation.proto\022\020firest"
"ore.client\032\037google/firestore/v1/write.pr"
"oto\032\037google/protobuf/timestamp.proto\"N\n\r"
"MutationQueue\022\"\n\032last_acknowledged_batch"
"_id\030\001 \001(\005\022\031\n\021last_stream_token\030\002 \001(\014\"\261\001\n"
"\nWriteBatch\022\020\n\010batch_id\030\001 \001(\005\022*\n\006writes\030"
"\002 \003(\0132\032.google.firestore.v1.Write\0224\n\020loc"
"al_write_time\030\003 \001(\0132\032.google.protobuf.Ti"
"mestamp\022/\n\013base_writes\030\004 \003(\0132\032.google.fi"
"restore.v1.WriteB/\n#com.google.firebase."
"firestore.protoP\001\242\002\005FSTPBb\006proto3"
};
static const ::_pbi::DescriptorTable* const descriptor_table_firestore_2flocal_2fmutation_2eproto_deps[2] =
{
&::descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto,
&::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto,
};
static ::absl::once_flag descriptor_table_firestore_2flocal_2fmutation_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_firestore_2flocal_2fmutation_2eproto = {
false,
false,
433,
descriptor_table_protodef_firestore_2flocal_2fmutation_2eproto,
"firestore/local/mutation.proto",
&descriptor_table_firestore_2flocal_2fmutation_2eproto_once,
descriptor_table_firestore_2flocal_2fmutation_2eproto_deps,
2,
2,
schemas,
file_default_instances,
TableStruct_firestore_2flocal_2fmutation_2eproto::offsets,
file_level_metadata_firestore_2flocal_2fmutation_2eproto,
file_level_enum_descriptors_firestore_2flocal_2fmutation_2eproto,
file_level_service_descriptors_firestore_2flocal_2fmutation_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_firestore_2flocal_2fmutation_2eproto_getter() {
return &descriptor_table_firestore_2flocal_2fmutation_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_firestore_2flocal_2fmutation_2eproto(&descriptor_table_firestore_2flocal_2fmutation_2eproto);
namespace firestore {
namespace client {
// ===================================================================
class MutationQueue::_Internal {
public:
};
MutationQueue::MutationQueue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:firestore.client.MutationQueue)
}
inline PROTOBUF_NDEBUG_INLINE MutationQueue::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
const Impl_& from)
: last_stream_token_(arena, from.last_stream_token_),
_cached_size_{0} {}
MutationQueue::MutationQueue(
::google::protobuf::Arena* arena,
const MutationQueue& from)
: ::google::protobuf::Message(arena) {
MutationQueue* const _this = this;
(void)_this;
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
_impl_.last_acknowledged_batch_id_ = from._impl_.last_acknowledged_batch_id_;
// @@protoc_insertion_point(copy_constructor:firestore.client.MutationQueue)
}
inline PROTOBUF_NDEBUG_INLINE MutationQueue::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: last_stream_token_(arena),
_cached_size_{0} {}
inline void MutationQueue::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
_impl_.last_acknowledged_batch_id_ = {};
}
MutationQueue::~MutationQueue() {
// @@protoc_insertion_point(destructor:firestore.client.MutationQueue)
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void MutationQueue::SharedDtor() {
ABSL_DCHECK(GetArena() == nullptr);
_impl_.last_stream_token_.Destroy();
_impl_.~Impl_();
}
PROTOBUF_NOINLINE void MutationQueue::Clear() {
// @@protoc_insertion_point(message_clear_start:firestore.client.MutationQueue)
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.last_stream_token_.ClearToEmpty();
_impl_.last_acknowledged_batch_id_ = 0;
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* MutationQueue::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<1, 2, 0, 0, 2> MutationQueue::_table_ = {
{
0, // no _has_bits_
0, // no _extensions_
2, 8, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967292, // skipmap
offsetof(decltype(_table_), field_entries),
2, // num_field_entries
0, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries
&_MutationQueue_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// bytes last_stream_token = 2;
{::_pbi::TcParser::FastBS1,
{18, 63, 0, PROTOBUF_FIELD_OFFSET(MutationQueue, _impl_.last_stream_token_)}},
// int32 last_acknowledged_batch_id = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(MutationQueue, _impl_.last_acknowledged_batch_id_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(MutationQueue, _impl_.last_acknowledged_batch_id_)}},
}}, {{
65535, 65535
}}, {{
// int32 last_acknowledged_batch_id = 1;
{PROTOBUF_FIELD_OFFSET(MutationQueue, _impl_.last_acknowledged_batch_id_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kInt32)},
// bytes last_stream_token = 2;
{PROTOBUF_FIELD_OFFSET(MutationQueue, _impl_.last_stream_token_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)},
}},
// no aux_entries
{{
}},
};
::uint8_t* MutationQueue::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:firestore.client.MutationQueue)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// int32 last_acknowledged_batch_id = 1;
if (this->_internal_last_acknowledged_batch_id() != 0) {
target = ::google::protobuf::internal::WireFormatLite::
WriteInt32ToArrayWithField<1>(
stream, this->_internal_last_acknowledged_batch_id(), target);
}
// bytes last_stream_token = 2;
if (!this->_internal_last_stream_token().empty()) {
const std::string& _s = this->_internal_last_stream_token();
target = stream->WriteBytesMaybeAliased(2, _s, target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:firestore.client.MutationQueue)
return target;
}
::size_t MutationQueue::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:firestore.client.MutationQueue)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes last_stream_token = 2;
if (!this->_internal_last_stream_token().empty()) {
total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize(
this->_internal_last_stream_token());
}
// int32 last_acknowledged_batch_id = 1;
if (this->_internal_last_acknowledged_batch_id() != 0) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
this->_internal_last_acknowledged_batch_id());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::google::protobuf::Message::ClassData MutationQueue::_class_data_ = {
MutationQueue::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
};
const ::google::protobuf::Message::ClassData* MutationQueue::GetClassData() const {
return &_class_data_;
}
void MutationQueue::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<MutationQueue*>(&to_msg);
auto& from = static_cast<const MutationQueue&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.MutationQueue)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_last_stream_token().empty()) {
_this->_internal_set_last_stream_token(from._internal_last_stream_token());
}
if (from._internal_last_acknowledged_batch_id() != 0) {
_this->_internal_set_last_acknowledged_batch_id(from._internal_last_acknowledged_batch_id());
}
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void MutationQueue::CopyFrom(const MutationQueue& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.MutationQueue)
if (&from == this) return;
Clear();
MergeFrom(from);
}
PROTOBUF_NOINLINE bool MutationQueue::IsInitialized() const {
return true;
}
::_pbi::CachedSize* MutationQueue::AccessCachedSize() const {
return &_impl_._cached_size_;
}
void MutationQueue::InternalSwap(MutationQueue* PROTOBUF_RESTRICT other) {
using std::swap;
auto* arena = GetArena();
ABSL_DCHECK_EQ(arena, other->GetArena());
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.last_stream_token_, &other->_impl_.last_stream_token_, arena);
swap(_impl_.last_acknowledged_batch_id_, other->_impl_.last_acknowledged_batch_id_);
}
::google::protobuf::Metadata MutationQueue::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_firestore_2flocal_2fmutation_2eproto_getter, &descriptor_table_firestore_2flocal_2fmutation_2eproto_once,
file_level_metadata_firestore_2flocal_2fmutation_2eproto[0]);
}
// ===================================================================
class WriteBatch::_Internal {
public:
using HasBits = decltype(std::declval<WriteBatch>()._impl_._has_bits_);
static constexpr ::int32_t kHasBitsOffset =
8 * PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_._has_bits_);
static const ::google::protobuf::Timestamp& local_write_time(const WriteBatch* msg);
static void set_has_local_write_time(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
const ::google::protobuf::Timestamp& WriteBatch::_Internal::local_write_time(const WriteBatch* msg) {
return *msg->_impl_.local_write_time_;
}
void WriteBatch::clear_writes() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.writes_.Clear();
}
void WriteBatch::clear_local_write_time() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (_impl_.local_write_time_ != nullptr) _impl_.local_write_time_->Clear();
_impl_._has_bits_[0] &= ~0x00000001u;
}
void WriteBatch::clear_base_writes() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.base_writes_.Clear();
}
WriteBatch::WriteBatch(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:firestore.client.WriteBatch)
}
inline PROTOBUF_NDEBUG_INLINE WriteBatch::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
const Impl_& from)
: _has_bits_{from._has_bits_},
_cached_size_{0},
writes_{visibility, arena, from.writes_},
base_writes_{visibility, arena, from.base_writes_} {}
WriteBatch::WriteBatch(
::google::protobuf::Arena* arena,
const WriteBatch& from)
: ::google::protobuf::Message(arena) {
WriteBatch* const _this = this;
(void)_this;
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
::uint32_t cached_has_bits = _impl_._has_bits_[0];
_impl_.local_write_time_ = (cached_has_bits & 0x00000001u)
? CreateMaybeMessage<::google::protobuf::Timestamp>(arena, *from._impl_.local_write_time_)
: nullptr;
_impl_.batch_id_ = from._impl_.batch_id_;
// @@protoc_insertion_point(copy_constructor:firestore.client.WriteBatch)
}
inline PROTOBUF_NDEBUG_INLINE WriteBatch::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: _cached_size_{0},
writes_{visibility, arena},
base_writes_{visibility, arena} {}
inline void WriteBatch::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
::memset(reinterpret_cast<char *>(&_impl_) +
offsetof(Impl_, local_write_time_),
0,
offsetof(Impl_, batch_id_) -
offsetof(Impl_, local_write_time_) +
sizeof(Impl_::batch_id_));
}
WriteBatch::~WriteBatch() {
// @@protoc_insertion_point(destructor:firestore.client.WriteBatch)
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void WriteBatch::SharedDtor() {
ABSL_DCHECK(GetArena() == nullptr);
delete _impl_.local_write_time_;
_impl_.~Impl_();
}
PROTOBUF_NOINLINE void WriteBatch::Clear() {
// @@protoc_insertion_point(message_clear_start:firestore.client.WriteBatch)
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.writes_.Clear();
_impl_.base_writes_.Clear();
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
ABSL_DCHECK(_impl_.local_write_time_ != nullptr);
_impl_.local_write_time_->Clear();
}
_impl_.batch_id_ = 0;
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* WriteBatch::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<2, 4, 3, 0, 2> WriteBatch::_table_ = {
{
PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_._has_bits_),
0, // no _extensions_
4, 24, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967280, // skipmap
offsetof(decltype(_table_), field_entries),
4, // num_field_entries
3, // num_aux_entries
offsetof(decltype(_table_), aux_entries),
&_WriteBatch_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// repeated .google.firestore.v1.Write base_writes = 4;
{::_pbi::TcParser::FastMtR1,
{34, 63, 2, PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.base_writes_)}},
// int32 batch_id = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(WriteBatch, _impl_.batch_id_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.batch_id_)}},
// repeated .google.firestore.v1.Write writes = 2;
{::_pbi::TcParser::FastMtR1,
{18, 63, 0, PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.writes_)}},
// .google.protobuf.Timestamp local_write_time = 3;
{::_pbi::TcParser::FastMtS1,
{26, 0, 1, PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.local_write_time_)}},
}}, {{
65535, 65535
}}, {{
// int32 batch_id = 1;
{PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.batch_id_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kInt32)},
// repeated .google.firestore.v1.Write writes = 2;
{PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.writes_), -1, 0,
(0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
// .google.protobuf.Timestamp local_write_time = 3;
{PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.local_write_time_), _Internal::kHasBitsOffset + 0, 1,
(0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
// repeated .google.firestore.v1.Write base_writes = 4;
{PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.base_writes_), -1, 2,
(0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
}}, {{
{::_pbi::TcParser::GetTable<::google::firestore::v1::Write>()},
{::_pbi::TcParser::GetTable<::google::protobuf::Timestamp>()},
{::_pbi::TcParser::GetTable<::google::firestore::v1::Write>()},
}}, {{
}},
};
::uint8_t* WriteBatch::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:firestore.client.WriteBatch)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// int32 batch_id = 1;
if (this->_internal_batch_id() != 0) {
target = ::google::protobuf::internal::WireFormatLite::
WriteInt32ToArrayWithField<1>(
stream, this->_internal_batch_id(), target);
}
// repeated .google.firestore.v1.Write writes = 2;
for (unsigned i = 0,
n = static_cast<unsigned>(this->_internal_writes_size()); i < n; i++) {
const auto& repfield = this->_internal_writes().Get(i);
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
}
cached_has_bits = _impl_._has_bits_[0];
// .google.protobuf.Timestamp local_write_time = 3;
if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
3, _Internal::local_write_time(this),
_Internal::local_write_time(this).GetCachedSize(), target, stream);
}
// repeated .google.firestore.v1.Write base_writes = 4;
for (unsigned i = 0,
n = static_cast<unsigned>(this->_internal_base_writes_size()); i < n; i++) {
const auto& repfield = this->_internal_base_writes().Get(i);
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:firestore.client.WriteBatch)
return target;
}
::size_t WriteBatch::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:firestore.client.WriteBatch)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .google.firestore.v1.Write writes = 2;
total_size += 1UL * this->_internal_writes_size();
for (const auto& msg : this->_internal_writes()) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSize(msg);
}
// repeated .google.firestore.v1.Write base_writes = 4;
total_size += 1UL * this->_internal_base_writes_size();
for (const auto& msg : this->_internal_base_writes()) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSize(msg);
}
// .google.protobuf.Timestamp local_write_time = 3;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size +=
1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.local_write_time_);
}
// int32 batch_id = 1;
if (this->_internal_batch_id() != 0) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
this->_internal_batch_id());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::google::protobuf::Message::ClassData WriteBatch::_class_data_ = {
WriteBatch::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
};
const ::google::protobuf::Message::ClassData* WriteBatch::GetClassData() const {
return &_class_data_;
}
void WriteBatch::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<WriteBatch*>(&to_msg);
auto& from = static_cast<const WriteBatch&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.WriteBatch)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
_this->_internal_mutable_writes()->MergeFrom(
from._internal_writes());
_this->_internal_mutable_base_writes()->MergeFrom(
from._internal_base_writes());
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_internal_mutable_local_write_time()->::google::protobuf::Timestamp::MergeFrom(
from._internal_local_write_time());
}
if (from._internal_batch_id() != 0) {
_this->_internal_set_batch_id(from._internal_batch_id());
}
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void WriteBatch::CopyFrom(const WriteBatch& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.WriteBatch)
if (&from == this) return;
Clear();
MergeFrom(from);
}
PROTOBUF_NOINLINE bool WriteBatch::IsInitialized() const {
return true;
}
::_pbi::CachedSize* WriteBatch::AccessCachedSize() const {
return &_impl_._cached_size_;
}
void WriteBatch::InternalSwap(WriteBatch* PROTOBUF_RESTRICT other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
_impl_.writes_.InternalSwap(&other->_impl_.writes_);
_impl_.base_writes_.InternalSwap(&other->_impl_.base_writes_);
::google::protobuf::internal::memswap<
PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.batch_id_)
+ sizeof(WriteBatch::_impl_.batch_id_)
- PROTOBUF_FIELD_OFFSET(WriteBatch, _impl_.local_write_time_)>(
reinterpret_cast<char*>(&_impl_.local_write_time_),
reinterpret_cast<char*>(&other->_impl_.local_write_time_));
}
::google::protobuf::Metadata WriteBatch::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_firestore_2flocal_2fmutation_2eproto_getter, &descriptor_table_firestore_2flocal_2fmutation_2eproto_once,
file_level_metadata_firestore_2flocal_2fmutation_2eproto[1]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace client
} // namespace firestore
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"