mutation.pb.cc 28 KB

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