target.pb.cc 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  1. /*
  2. * Copyright 2018 Google
  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/target.proto
  18. #include "firestore/local/target.pb.h"
  19. #include <algorithm>
  20. #include <google/protobuf/stubs/common.h>
  21. #include <google/protobuf/io/coded_stream.h>
  22. #include <google/protobuf/extension_set.h>
  23. #include <google/protobuf/wire_format_lite.h>
  24. #include <google/protobuf/descriptor.h>
  25. #include <google/protobuf/generated_message_reflection.h>
  26. #include <google/protobuf/reflection_ops.h>
  27. #include <google/protobuf/wire_format.h>
  28. // @@protoc_insertion_point(includes)
  29. #include <google/protobuf/port_def.inc>
  30. extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2ffirestore_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Target_DocumentsTarget_google_2ffirestore_2fv1_2ffirestore_2eproto;
  31. extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2ffirestore_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Target_QueryTarget_google_2ffirestore_2fv1_2ffirestore_2eproto;
  32. extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftimestamp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto;
  33. namespace firestore {
  34. namespace client {
  35. class TargetDefaultTypeInternal {
  36. public:
  37. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Target> _instance;
  38. const ::google::firestore::v1::Target_QueryTarget* query_;
  39. const ::google::firestore::v1::Target_DocumentsTarget* documents_;
  40. } _Target_default_instance_;
  41. class TargetGlobalDefaultTypeInternal {
  42. public:
  43. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TargetGlobal> _instance;
  44. } _TargetGlobal_default_instance_;
  45. } // namespace client
  46. } // namespace firestore
  47. static void InitDefaultsscc_info_Target_firestore_2flocal_2ftarget_2eproto() {
  48. GOOGLE_PROTOBUF_VERIFY_VERSION;
  49. {
  50. void* ptr = &::firestore::client::_Target_default_instance_;
  51. new (ptr) ::firestore::client::Target();
  52. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  53. }
  54. ::firestore::client::Target::InitAsDefaultInstance();
  55. }
  56. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_Target_firestore_2flocal_2ftarget_2eproto =
  57. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_Target_firestore_2flocal_2ftarget_2eproto}, {
  58. &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,
  59. &scc_info_Target_QueryTarget_google_2ffirestore_2fv1_2ffirestore_2eproto.base,
  60. &scc_info_Target_DocumentsTarget_google_2ffirestore_2fv1_2ffirestore_2eproto.base,}};
  61. static void InitDefaultsscc_info_TargetGlobal_firestore_2flocal_2ftarget_2eproto() {
  62. GOOGLE_PROTOBUF_VERIFY_VERSION;
  63. {
  64. void* ptr = &::firestore::client::_TargetGlobal_default_instance_;
  65. new (ptr) ::firestore::client::TargetGlobal();
  66. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  67. }
  68. ::firestore::client::TargetGlobal::InitAsDefaultInstance();
  69. }
  70. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TargetGlobal_firestore_2flocal_2ftarget_2eproto =
  71. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_TargetGlobal_firestore_2flocal_2ftarget_2eproto}, {
  72. &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,}};
  73. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_firestore_2flocal_2ftarget_2eproto[2];
  74. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_firestore_2flocal_2ftarget_2eproto = nullptr;
  75. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_firestore_2flocal_2ftarget_2eproto = nullptr;
  76. const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_firestore_2flocal_2ftarget_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  77. ~0u, // no _has_bits_
  78. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, _internal_metadata_),
  79. ~0u, // no _extensions_
  80. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, _oneof_case_[0]),
  81. ~0u, // no _weak_field_map_
  82. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, target_id_),
  83. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, snapshot_version_),
  84. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, resume_token_),
  85. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, last_listen_sequence_number_),
  86. offsetof(::firestore::client::TargetDefaultTypeInternal, query_),
  87. offsetof(::firestore::client::TargetDefaultTypeInternal, documents_),
  88. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, last_limbo_free_snapshot_version_),
  89. PROTOBUF_FIELD_OFFSET(::firestore::client::Target, target_type_),
  90. ~0u, // no _has_bits_
  91. PROTOBUF_FIELD_OFFSET(::firestore::client::TargetGlobal, _internal_metadata_),
  92. ~0u, // no _extensions_
  93. ~0u, // no _oneof_case_
  94. ~0u, // no _weak_field_map_
  95. PROTOBUF_FIELD_OFFSET(::firestore::client::TargetGlobal, highest_target_id_),
  96. PROTOBUF_FIELD_OFFSET(::firestore::client::TargetGlobal, highest_listen_sequence_number_),
  97. PROTOBUF_FIELD_OFFSET(::firestore::client::TargetGlobal, last_remote_snapshot_version_),
  98. PROTOBUF_FIELD_OFFSET(::firestore::client::TargetGlobal, target_count_),
  99. };
  100. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  101. { 0, -1, sizeof(::firestore::client::Target)},
  102. { 13, -1, sizeof(::firestore::client::TargetGlobal)},
  103. };
  104. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  105. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::firestore::client::_Target_default_instance_),
  106. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::firestore::client::_TargetGlobal_default_instance_),
  107. };
  108. const char descriptor_table_protodef_firestore_2flocal_2ftarget_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  109. "\n\034firestore/local/target.proto\022\020firestor"
  110. "e.client\032#google/firestore/v1/firestore."
  111. "proto\032\037google/protobuf/timestamp.proto\"\335"
  112. "\002\n\006Target\022\021\n\ttarget_id\030\001 \001(\005\0224\n\020snapshot"
  113. "_version\030\002 \001(\0132\032.google.protobuf.Timesta"
  114. "mp\022\024\n\014resume_token\030\003 \001(\014\022#\n\033last_listen_"
  115. "sequence_number\030\004 \001(\003\0228\n\005query\030\005 \001(\0132\'.g"
  116. "oogle.firestore.v1.Target.QueryTargetH\000\022"
  117. "@\n\tdocuments\030\006 \001(\0132+.google.firestore.v1"
  118. ".Target.DocumentsTargetH\000\022D\n last_limbo_"
  119. "free_snapshot_version\030\007 \001(\0132\032.google.pro"
  120. "tobuf.TimestampB\r\n\013target_type\"\251\001\n\014Targe"
  121. "tGlobal\022\031\n\021highest_target_id\030\001 \001(\005\022&\n\036hi"
  122. "ghest_listen_sequence_number\030\002 \001(\003\022@\n\034la"
  123. "st_remote_snapshot_version\030\003 \001(\0132\032.googl"
  124. "e.protobuf.Timestamp\022\024\n\014target_count\030\004 \001"
  125. "(\005B/\n#com.google.firebase.firestore.prot"
  126. "oP\001\242\002\005FSTPBb\006proto3"
  127. ;
  128. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_firestore_2flocal_2ftarget_2eproto_deps[2] = {
  129. &::descriptor_table_google_2ffirestore_2fv1_2ffirestore_2eproto,
  130. &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto,
  131. };
  132. static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_firestore_2flocal_2ftarget_2eproto_sccs[2] = {
  133. &scc_info_Target_firestore_2flocal_2ftarget_2eproto.base,
  134. &scc_info_TargetGlobal_firestore_2flocal_2ftarget_2eproto.base,
  135. };
  136. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_firestore_2flocal_2ftarget_2eproto_once;
  137. static bool descriptor_table_firestore_2flocal_2ftarget_2eproto_initialized = false;
  138. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_firestore_2flocal_2ftarget_2eproto = {
  139. &descriptor_table_firestore_2flocal_2ftarget_2eproto_initialized, descriptor_table_protodef_firestore_2flocal_2ftarget_2eproto, "firestore/local/target.proto", 699,
  140. &descriptor_table_firestore_2flocal_2ftarget_2eproto_once, descriptor_table_firestore_2flocal_2ftarget_2eproto_sccs, descriptor_table_firestore_2flocal_2ftarget_2eproto_deps, 2, 2,
  141. schemas, file_default_instances, TableStruct_firestore_2flocal_2ftarget_2eproto::offsets,
  142. file_level_metadata_firestore_2flocal_2ftarget_2eproto, 2, file_level_enum_descriptors_firestore_2flocal_2ftarget_2eproto, file_level_service_descriptors_firestore_2flocal_2ftarget_2eproto,
  143. };
  144. // Force running AddDescriptors() at dynamic initialization time.
  145. static bool dynamic_init_dummy_firestore_2flocal_2ftarget_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_firestore_2flocal_2ftarget_2eproto), true);
  146. namespace firestore {
  147. namespace client {
  148. // ===================================================================
  149. void Target::InitAsDefaultInstance() {
  150. ::firestore::client::_Target_default_instance_._instance.get_mutable()->snapshot_version_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  151. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  152. ::firestore::client::_Target_default_instance_.query_ = const_cast< ::google::firestore::v1::Target_QueryTarget*>(
  153. ::google::firestore::v1::Target_QueryTarget::internal_default_instance());
  154. ::firestore::client::_Target_default_instance_.documents_ = const_cast< ::google::firestore::v1::Target_DocumentsTarget*>(
  155. ::google::firestore::v1::Target_DocumentsTarget::internal_default_instance());
  156. ::firestore::client::_Target_default_instance_._instance.get_mutable()->last_limbo_free_snapshot_version_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  157. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  158. }
  159. class Target::_Internal {
  160. public:
  161. static const PROTOBUF_NAMESPACE_ID::Timestamp& snapshot_version(const Target* msg);
  162. static const ::google::firestore::v1::Target_QueryTarget& query(const Target* msg);
  163. static const ::google::firestore::v1::Target_DocumentsTarget& documents(const Target* msg);
  164. static const PROTOBUF_NAMESPACE_ID::Timestamp& last_limbo_free_snapshot_version(const Target* msg);
  165. };
  166. const PROTOBUF_NAMESPACE_ID::Timestamp&
  167. Target::_Internal::snapshot_version(const Target* msg) {
  168. return *msg->snapshot_version_;
  169. }
  170. const ::google::firestore::v1::Target_QueryTarget&
  171. Target::_Internal::query(const Target* msg) {
  172. return *msg->target_type_.query_;
  173. }
  174. const ::google::firestore::v1::Target_DocumentsTarget&
  175. Target::_Internal::documents(const Target* msg) {
  176. return *msg->target_type_.documents_;
  177. }
  178. const PROTOBUF_NAMESPACE_ID::Timestamp&
  179. Target::_Internal::last_limbo_free_snapshot_version(const Target* msg) {
  180. return *msg->last_limbo_free_snapshot_version_;
  181. }
  182. void Target::clear_snapshot_version() {
  183. if (GetArenaNoVirtual() == nullptr && snapshot_version_ != nullptr) {
  184. delete snapshot_version_;
  185. }
  186. snapshot_version_ = nullptr;
  187. }
  188. void Target::set_allocated_query(::google::firestore::v1::Target_QueryTarget* query) {
  189. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  190. clear_target_type();
  191. if (query) {
  192. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  193. if (message_arena != submessage_arena) {
  194. query = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  195. message_arena, query, submessage_arena);
  196. }
  197. set_has_query();
  198. target_type_.query_ = query;
  199. }
  200. // @@protoc_insertion_point(field_set_allocated:firestore.client.Target.query)
  201. }
  202. void Target::clear_query() {
  203. if (has_query()) {
  204. delete target_type_.query_;
  205. clear_has_target_type();
  206. }
  207. }
  208. void Target::set_allocated_documents(::google::firestore::v1::Target_DocumentsTarget* documents) {
  209. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  210. clear_target_type();
  211. if (documents) {
  212. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  213. if (message_arena != submessage_arena) {
  214. documents = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  215. message_arena, documents, submessage_arena);
  216. }
  217. set_has_documents();
  218. target_type_.documents_ = documents;
  219. }
  220. // @@protoc_insertion_point(field_set_allocated:firestore.client.Target.documents)
  221. }
  222. void Target::clear_documents() {
  223. if (has_documents()) {
  224. delete target_type_.documents_;
  225. clear_has_target_type();
  226. }
  227. }
  228. void Target::clear_last_limbo_free_snapshot_version() {
  229. if (GetArenaNoVirtual() == nullptr && last_limbo_free_snapshot_version_ != nullptr) {
  230. delete last_limbo_free_snapshot_version_;
  231. }
  232. last_limbo_free_snapshot_version_ = nullptr;
  233. }
  234. Target::Target()
  235. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  236. SharedCtor();
  237. // @@protoc_insertion_point(constructor:firestore.client.Target)
  238. }
  239. Target::Target(const Target& from)
  240. : ::PROTOBUF_NAMESPACE_ID::Message(),
  241. _internal_metadata_(nullptr) {
  242. _internal_metadata_.MergeFrom(from._internal_metadata_);
  243. resume_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  244. if (!from.resume_token().empty()) {
  245. resume_token_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.resume_token_);
  246. }
  247. if (from.has_snapshot_version()) {
  248. snapshot_version_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.snapshot_version_);
  249. } else {
  250. snapshot_version_ = nullptr;
  251. }
  252. if (from.has_last_limbo_free_snapshot_version()) {
  253. last_limbo_free_snapshot_version_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.last_limbo_free_snapshot_version_);
  254. } else {
  255. last_limbo_free_snapshot_version_ = nullptr;
  256. }
  257. ::memcpy(&last_listen_sequence_number_, &from.last_listen_sequence_number_,
  258. static_cast<size_t>(reinterpret_cast<char*>(&target_id_) -
  259. reinterpret_cast<char*>(&last_listen_sequence_number_)) + sizeof(target_id_));
  260. clear_has_target_type();
  261. switch (from.target_type_case()) {
  262. case kQuery: {
  263. mutable_query()->::google::firestore::v1::Target_QueryTarget::MergeFrom(from.query());
  264. break;
  265. }
  266. case kDocuments: {
  267. mutable_documents()->::google::firestore::v1::Target_DocumentsTarget::MergeFrom(from.documents());
  268. break;
  269. }
  270. case TARGET_TYPE_NOT_SET: {
  271. break;
  272. }
  273. }
  274. // @@protoc_insertion_point(copy_constructor:firestore.client.Target)
  275. }
  276. void Target::SharedCtor() {
  277. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Target_firestore_2flocal_2ftarget_2eproto.base);
  278. resume_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  279. ::memset(&snapshot_version_, 0, static_cast<size_t>(
  280. reinterpret_cast<char*>(&target_id_) -
  281. reinterpret_cast<char*>(&snapshot_version_)) + sizeof(target_id_));
  282. clear_has_target_type();
  283. }
  284. Target::~Target() {
  285. // @@protoc_insertion_point(destructor:firestore.client.Target)
  286. SharedDtor();
  287. }
  288. void Target::SharedDtor() {
  289. resume_token_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  290. if (this != internal_default_instance()) delete snapshot_version_;
  291. if (this != internal_default_instance()) delete last_limbo_free_snapshot_version_;
  292. if (has_target_type()) {
  293. clear_target_type();
  294. }
  295. }
  296. void Target::SetCachedSize(int size) const {
  297. _cached_size_.Set(size);
  298. }
  299. const Target& Target::default_instance() {
  300. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Target_firestore_2flocal_2ftarget_2eproto.base);
  301. return *internal_default_instance();
  302. }
  303. void Target::clear_target_type() {
  304. // @@protoc_insertion_point(one_of_clear_start:firestore.client.Target)
  305. switch (target_type_case()) {
  306. case kQuery: {
  307. delete target_type_.query_;
  308. break;
  309. }
  310. case kDocuments: {
  311. delete target_type_.documents_;
  312. break;
  313. }
  314. case TARGET_TYPE_NOT_SET: {
  315. break;
  316. }
  317. }
  318. _oneof_case_[0] = TARGET_TYPE_NOT_SET;
  319. }
  320. void Target::Clear() {
  321. // @@protoc_insertion_point(message_clear_start:firestore.client.Target)
  322. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  323. // Prevent compiler warnings about cached_has_bits being unused
  324. (void) cached_has_bits;
  325. resume_token_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  326. if (GetArenaNoVirtual() == nullptr && snapshot_version_ != nullptr) {
  327. delete snapshot_version_;
  328. }
  329. snapshot_version_ = nullptr;
  330. if (GetArenaNoVirtual() == nullptr && last_limbo_free_snapshot_version_ != nullptr) {
  331. delete last_limbo_free_snapshot_version_;
  332. }
  333. last_limbo_free_snapshot_version_ = nullptr;
  334. ::memset(&last_listen_sequence_number_, 0, static_cast<size_t>(
  335. reinterpret_cast<char*>(&target_id_) -
  336. reinterpret_cast<char*>(&last_listen_sequence_number_)) + sizeof(target_id_));
  337. clear_target_type();
  338. _internal_metadata_.Clear();
  339. }
  340. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  341. const char* Target::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  342. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  343. while (!ctx->Done(&ptr)) {
  344. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  345. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  346. CHK_(ptr);
  347. switch (tag >> 3) {
  348. // int32 target_id = 1;
  349. case 1:
  350. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
  351. target_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  352. CHK_(ptr);
  353. } else goto handle_unusual;
  354. continue;
  355. // .google.protobuf.Timestamp snapshot_version = 2;
  356. case 2:
  357. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  358. ptr = ctx->ParseMessage(mutable_snapshot_version(), ptr);
  359. CHK_(ptr);
  360. } else goto handle_unusual;
  361. continue;
  362. // bytes resume_token = 3;
  363. case 3:
  364. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
  365. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_resume_token(), ptr, ctx);
  366. CHK_(ptr);
  367. } else goto handle_unusual;
  368. continue;
  369. // int64 last_listen_sequence_number = 4;
  370. case 4:
  371. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
  372. last_listen_sequence_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  373. CHK_(ptr);
  374. } else goto handle_unusual;
  375. continue;
  376. // .google.firestore.v1.Target.QueryTarget query = 5;
  377. case 5:
  378. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
  379. ptr = ctx->ParseMessage(mutable_query(), ptr);
  380. CHK_(ptr);
  381. } else goto handle_unusual;
  382. continue;
  383. // .google.firestore.v1.Target.DocumentsTarget documents = 6;
  384. case 6:
  385. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
  386. ptr = ctx->ParseMessage(mutable_documents(), ptr);
  387. CHK_(ptr);
  388. } else goto handle_unusual;
  389. continue;
  390. // .google.protobuf.Timestamp last_limbo_free_snapshot_version = 7;
  391. case 7:
  392. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
  393. ptr = ctx->ParseMessage(mutable_last_limbo_free_snapshot_version(), ptr);
  394. CHK_(ptr);
  395. } else goto handle_unusual;
  396. continue;
  397. default: {
  398. handle_unusual:
  399. if ((tag & 7) == 4 || tag == 0) {
  400. ctx->SetLastTag(tag);
  401. goto success;
  402. }
  403. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  404. CHK_(ptr != nullptr);
  405. continue;
  406. }
  407. } // switch
  408. } // while
  409. success:
  410. return ptr;
  411. failure:
  412. ptr = nullptr;
  413. goto success;
  414. #undef CHK_
  415. }
  416. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  417. bool Target::MergePartialFromCodedStream(
  418. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  419. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  420. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  421. // @@protoc_insertion_point(parse_start:firestore.client.Target)
  422. for (;;) {
  423. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  424. tag = p.first;
  425. if (!p.second) goto handle_unusual;
  426. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  427. // int32 target_id = 1;
  428. case 1: {
  429. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
  430. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  431. ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
  432. input, &target_id_)));
  433. } else {
  434. goto handle_unusual;
  435. }
  436. break;
  437. }
  438. // .google.protobuf.Timestamp snapshot_version = 2;
  439. case 2: {
  440. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
  441. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  442. input, mutable_snapshot_version()));
  443. } else {
  444. goto handle_unusual;
  445. }
  446. break;
  447. }
  448. // bytes resume_token = 3;
  449. case 3: {
  450. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
  451. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
  452. input, this->mutable_resume_token()));
  453. } else {
  454. goto handle_unusual;
  455. }
  456. break;
  457. }
  458. // int64 last_listen_sequence_number = 4;
  459. case 4: {
  460. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
  461. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  462. ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
  463. input, &last_listen_sequence_number_)));
  464. } else {
  465. goto handle_unusual;
  466. }
  467. break;
  468. }
  469. // .google.firestore.v1.Target.QueryTarget query = 5;
  470. case 5: {
  471. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
  472. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  473. input, mutable_query()));
  474. } else {
  475. goto handle_unusual;
  476. }
  477. break;
  478. }
  479. // .google.firestore.v1.Target.DocumentsTarget documents = 6;
  480. case 6: {
  481. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
  482. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  483. input, mutable_documents()));
  484. } else {
  485. goto handle_unusual;
  486. }
  487. break;
  488. }
  489. // .google.protobuf.Timestamp last_limbo_free_snapshot_version = 7;
  490. case 7: {
  491. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
  492. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  493. input, mutable_last_limbo_free_snapshot_version()));
  494. } else {
  495. goto handle_unusual;
  496. }
  497. break;
  498. }
  499. default: {
  500. handle_unusual:
  501. if (tag == 0) {
  502. goto success;
  503. }
  504. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  505. input, tag, _internal_metadata_.mutable_unknown_fields()));
  506. break;
  507. }
  508. }
  509. }
  510. success:
  511. // @@protoc_insertion_point(parse_success:firestore.client.Target)
  512. return true;
  513. failure:
  514. // @@protoc_insertion_point(parse_failure:firestore.client.Target)
  515. return false;
  516. #undef DO_
  517. }
  518. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  519. void Target::SerializeWithCachedSizes(
  520. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  521. // @@protoc_insertion_point(serialize_start:firestore.client.Target)
  522. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  523. (void) cached_has_bits;
  524. // int32 target_id = 1;
  525. if (this->target_id() != 0) {
  526. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(1, this->target_id(), output);
  527. }
  528. // .google.protobuf.Timestamp snapshot_version = 2;
  529. if (this->has_snapshot_version()) {
  530. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  531. 2, _Internal::snapshot_version(this), output);
  532. }
  533. // bytes resume_token = 3;
  534. if (this->resume_token().size() > 0) {
  535. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
  536. 3, this->resume_token(), output);
  537. }
  538. // int64 last_listen_sequence_number = 4;
  539. if (this->last_listen_sequence_number() != 0) {
  540. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->last_listen_sequence_number(), output);
  541. }
  542. // .google.firestore.v1.Target.QueryTarget query = 5;
  543. if (has_query()) {
  544. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  545. 5, _Internal::query(this), output);
  546. }
  547. // .google.firestore.v1.Target.DocumentsTarget documents = 6;
  548. if (has_documents()) {
  549. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  550. 6, _Internal::documents(this), output);
  551. }
  552. // .google.protobuf.Timestamp last_limbo_free_snapshot_version = 7;
  553. if (this->has_last_limbo_free_snapshot_version()) {
  554. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  555. 7, _Internal::last_limbo_free_snapshot_version(this), output);
  556. }
  557. if (_internal_metadata_.have_unknown_fields()) {
  558. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  559. _internal_metadata_.unknown_fields(), output);
  560. }
  561. // @@protoc_insertion_point(serialize_end:firestore.client.Target)
  562. }
  563. ::PROTOBUF_NAMESPACE_ID::uint8* Target::InternalSerializeWithCachedSizesToArray(
  564. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  565. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.Target)
  566. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  567. (void) cached_has_bits;
  568. // int32 target_id = 1;
  569. if (this->target_id() != 0) {
  570. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->target_id(), target);
  571. }
  572. // .google.protobuf.Timestamp snapshot_version = 2;
  573. if (this->has_snapshot_version()) {
  574. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  575. InternalWriteMessageToArray(
  576. 2, _Internal::snapshot_version(this), target);
  577. }
  578. // bytes resume_token = 3;
  579. if (this->resume_token().size() > 0) {
  580. target =
  581. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
  582. 3, this->resume_token(), target);
  583. }
  584. // int64 last_listen_sequence_number = 4;
  585. if (this->last_listen_sequence_number() != 0) {
  586. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->last_listen_sequence_number(), target);
  587. }
  588. // .google.firestore.v1.Target.QueryTarget query = 5;
  589. if (has_query()) {
  590. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  591. InternalWriteMessageToArray(
  592. 5, _Internal::query(this), target);
  593. }
  594. // .google.firestore.v1.Target.DocumentsTarget documents = 6;
  595. if (has_documents()) {
  596. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  597. InternalWriteMessageToArray(
  598. 6, _Internal::documents(this), target);
  599. }
  600. // .google.protobuf.Timestamp last_limbo_free_snapshot_version = 7;
  601. if (this->has_last_limbo_free_snapshot_version()) {
  602. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  603. InternalWriteMessageToArray(
  604. 7, _Internal::last_limbo_free_snapshot_version(this), target);
  605. }
  606. if (_internal_metadata_.have_unknown_fields()) {
  607. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  608. _internal_metadata_.unknown_fields(), target);
  609. }
  610. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.Target)
  611. return target;
  612. }
  613. size_t Target::ByteSizeLong() const {
  614. // @@protoc_insertion_point(message_byte_size_start:firestore.client.Target)
  615. size_t total_size = 0;
  616. if (_internal_metadata_.have_unknown_fields()) {
  617. total_size +=
  618. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  619. _internal_metadata_.unknown_fields());
  620. }
  621. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  622. // Prevent compiler warnings about cached_has_bits being unused
  623. (void) cached_has_bits;
  624. // bytes resume_token = 3;
  625. if (this->resume_token().size() > 0) {
  626. total_size += 1 +
  627. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
  628. this->resume_token());
  629. }
  630. // .google.protobuf.Timestamp snapshot_version = 2;
  631. if (this->has_snapshot_version()) {
  632. total_size += 1 +
  633. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  634. *snapshot_version_);
  635. }
  636. // .google.protobuf.Timestamp last_limbo_free_snapshot_version = 7;
  637. if (this->has_last_limbo_free_snapshot_version()) {
  638. total_size += 1 +
  639. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  640. *last_limbo_free_snapshot_version_);
  641. }
  642. // int64 last_listen_sequence_number = 4;
  643. if (this->last_listen_sequence_number() != 0) {
  644. total_size += 1 +
  645. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
  646. this->last_listen_sequence_number());
  647. }
  648. // int32 target_id = 1;
  649. if (this->target_id() != 0) {
  650. total_size += 1 +
  651. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  652. this->target_id());
  653. }
  654. switch (target_type_case()) {
  655. // .google.firestore.v1.Target.QueryTarget query = 5;
  656. case kQuery: {
  657. total_size += 1 +
  658. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  659. *target_type_.query_);
  660. break;
  661. }
  662. // .google.firestore.v1.Target.DocumentsTarget documents = 6;
  663. case kDocuments: {
  664. total_size += 1 +
  665. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  666. *target_type_.documents_);
  667. break;
  668. }
  669. case TARGET_TYPE_NOT_SET: {
  670. break;
  671. }
  672. }
  673. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  674. SetCachedSize(cached_size);
  675. return total_size;
  676. }
  677. void Target::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  678. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.Target)
  679. GOOGLE_DCHECK_NE(&from, this);
  680. const Target* source =
  681. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Target>(
  682. &from);
  683. if (source == nullptr) {
  684. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.Target)
  685. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  686. } else {
  687. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.Target)
  688. MergeFrom(*source);
  689. }
  690. }
  691. void Target::MergeFrom(const Target& from) {
  692. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.Target)
  693. GOOGLE_DCHECK_NE(&from, this);
  694. _internal_metadata_.MergeFrom(from._internal_metadata_);
  695. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  696. (void) cached_has_bits;
  697. if (from.resume_token().size() > 0) {
  698. resume_token_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.resume_token_);
  699. }
  700. if (from.has_snapshot_version()) {
  701. mutable_snapshot_version()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from.snapshot_version());
  702. }
  703. if (from.has_last_limbo_free_snapshot_version()) {
  704. mutable_last_limbo_free_snapshot_version()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from.last_limbo_free_snapshot_version());
  705. }
  706. if (from.last_listen_sequence_number() != 0) {
  707. set_last_listen_sequence_number(from.last_listen_sequence_number());
  708. }
  709. if (from.target_id() != 0) {
  710. set_target_id(from.target_id());
  711. }
  712. switch (from.target_type_case()) {
  713. case kQuery: {
  714. mutable_query()->::google::firestore::v1::Target_QueryTarget::MergeFrom(from.query());
  715. break;
  716. }
  717. case kDocuments: {
  718. mutable_documents()->::google::firestore::v1::Target_DocumentsTarget::MergeFrom(from.documents());
  719. break;
  720. }
  721. case TARGET_TYPE_NOT_SET: {
  722. break;
  723. }
  724. }
  725. }
  726. void Target::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  727. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.Target)
  728. if (&from == this) return;
  729. Clear();
  730. MergeFrom(from);
  731. }
  732. void Target::CopyFrom(const Target& from) {
  733. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.Target)
  734. if (&from == this) return;
  735. Clear();
  736. MergeFrom(from);
  737. }
  738. bool Target::IsInitialized() const {
  739. return true;
  740. }
  741. void Target::InternalSwap(Target* other) {
  742. using std::swap;
  743. _internal_metadata_.Swap(&other->_internal_metadata_);
  744. resume_token_.Swap(&other->resume_token_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  745. GetArenaNoVirtual());
  746. swap(snapshot_version_, other->snapshot_version_);
  747. swap(last_limbo_free_snapshot_version_, other->last_limbo_free_snapshot_version_);
  748. swap(last_listen_sequence_number_, other->last_listen_sequence_number_);
  749. swap(target_id_, other->target_id_);
  750. swap(target_type_, other->target_type_);
  751. swap(_oneof_case_[0], other->_oneof_case_[0]);
  752. }
  753. ::PROTOBUF_NAMESPACE_ID::Metadata Target::GetMetadata() const {
  754. return GetMetadataStatic();
  755. }
  756. // ===================================================================
  757. void TargetGlobal::InitAsDefaultInstance() {
  758. ::firestore::client::_TargetGlobal_default_instance_._instance.get_mutable()->last_remote_snapshot_version_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  759. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  760. }
  761. class TargetGlobal::_Internal {
  762. public:
  763. static const PROTOBUF_NAMESPACE_ID::Timestamp& last_remote_snapshot_version(const TargetGlobal* msg);
  764. };
  765. const PROTOBUF_NAMESPACE_ID::Timestamp&
  766. TargetGlobal::_Internal::last_remote_snapshot_version(const TargetGlobal* msg) {
  767. return *msg->last_remote_snapshot_version_;
  768. }
  769. void TargetGlobal::clear_last_remote_snapshot_version() {
  770. if (GetArenaNoVirtual() == nullptr && last_remote_snapshot_version_ != nullptr) {
  771. delete last_remote_snapshot_version_;
  772. }
  773. last_remote_snapshot_version_ = nullptr;
  774. }
  775. TargetGlobal::TargetGlobal()
  776. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  777. SharedCtor();
  778. // @@protoc_insertion_point(constructor:firestore.client.TargetGlobal)
  779. }
  780. TargetGlobal::TargetGlobal(const TargetGlobal& from)
  781. : ::PROTOBUF_NAMESPACE_ID::Message(),
  782. _internal_metadata_(nullptr) {
  783. _internal_metadata_.MergeFrom(from._internal_metadata_);
  784. if (from.has_last_remote_snapshot_version()) {
  785. last_remote_snapshot_version_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.last_remote_snapshot_version_);
  786. } else {
  787. last_remote_snapshot_version_ = nullptr;
  788. }
  789. ::memcpy(&highest_listen_sequence_number_, &from.highest_listen_sequence_number_,
  790. static_cast<size_t>(reinterpret_cast<char*>(&target_count_) -
  791. reinterpret_cast<char*>(&highest_listen_sequence_number_)) + sizeof(target_count_));
  792. // @@protoc_insertion_point(copy_constructor:firestore.client.TargetGlobal)
  793. }
  794. void TargetGlobal::SharedCtor() {
  795. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TargetGlobal_firestore_2flocal_2ftarget_2eproto.base);
  796. ::memset(&last_remote_snapshot_version_, 0, static_cast<size_t>(
  797. reinterpret_cast<char*>(&target_count_) -
  798. reinterpret_cast<char*>(&last_remote_snapshot_version_)) + sizeof(target_count_));
  799. }
  800. TargetGlobal::~TargetGlobal() {
  801. // @@protoc_insertion_point(destructor:firestore.client.TargetGlobal)
  802. SharedDtor();
  803. }
  804. void TargetGlobal::SharedDtor() {
  805. if (this != internal_default_instance()) delete last_remote_snapshot_version_;
  806. }
  807. void TargetGlobal::SetCachedSize(int size) const {
  808. _cached_size_.Set(size);
  809. }
  810. const TargetGlobal& TargetGlobal::default_instance() {
  811. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TargetGlobal_firestore_2flocal_2ftarget_2eproto.base);
  812. return *internal_default_instance();
  813. }
  814. void TargetGlobal::Clear() {
  815. // @@protoc_insertion_point(message_clear_start:firestore.client.TargetGlobal)
  816. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  817. // Prevent compiler warnings about cached_has_bits being unused
  818. (void) cached_has_bits;
  819. if (GetArenaNoVirtual() == nullptr && last_remote_snapshot_version_ != nullptr) {
  820. delete last_remote_snapshot_version_;
  821. }
  822. last_remote_snapshot_version_ = nullptr;
  823. ::memset(&highest_listen_sequence_number_, 0, static_cast<size_t>(
  824. reinterpret_cast<char*>(&target_count_) -
  825. reinterpret_cast<char*>(&highest_listen_sequence_number_)) + sizeof(target_count_));
  826. _internal_metadata_.Clear();
  827. }
  828. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  829. const char* TargetGlobal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  830. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  831. while (!ctx->Done(&ptr)) {
  832. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  833. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  834. CHK_(ptr);
  835. switch (tag >> 3) {
  836. // int32 highest_target_id = 1;
  837. case 1:
  838. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
  839. highest_target_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  840. CHK_(ptr);
  841. } else goto handle_unusual;
  842. continue;
  843. // int64 highest_listen_sequence_number = 2;
  844. case 2:
  845. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
  846. highest_listen_sequence_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  847. CHK_(ptr);
  848. } else goto handle_unusual;
  849. continue;
  850. // .google.protobuf.Timestamp last_remote_snapshot_version = 3;
  851. case 3:
  852. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
  853. ptr = ctx->ParseMessage(mutable_last_remote_snapshot_version(), ptr);
  854. CHK_(ptr);
  855. } else goto handle_unusual;
  856. continue;
  857. // int32 target_count = 4;
  858. case 4:
  859. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
  860. target_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  861. CHK_(ptr);
  862. } else goto handle_unusual;
  863. continue;
  864. default: {
  865. handle_unusual:
  866. if ((tag & 7) == 4 || tag == 0) {
  867. ctx->SetLastTag(tag);
  868. goto success;
  869. }
  870. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  871. CHK_(ptr != nullptr);
  872. continue;
  873. }
  874. } // switch
  875. } // while
  876. success:
  877. return ptr;
  878. failure:
  879. ptr = nullptr;
  880. goto success;
  881. #undef CHK_
  882. }
  883. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  884. bool TargetGlobal::MergePartialFromCodedStream(
  885. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  886. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  887. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  888. // @@protoc_insertion_point(parse_start:firestore.client.TargetGlobal)
  889. for (;;) {
  890. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  891. tag = p.first;
  892. if (!p.second) goto handle_unusual;
  893. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  894. // int32 highest_target_id = 1;
  895. case 1: {
  896. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
  897. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  898. ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
  899. input, &highest_target_id_)));
  900. } else {
  901. goto handle_unusual;
  902. }
  903. break;
  904. }
  905. // int64 highest_listen_sequence_number = 2;
  906. case 2: {
  907. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
  908. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  909. ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
  910. input, &highest_listen_sequence_number_)));
  911. } else {
  912. goto handle_unusual;
  913. }
  914. break;
  915. }
  916. // .google.protobuf.Timestamp last_remote_snapshot_version = 3;
  917. case 3: {
  918. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
  919. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  920. input, mutable_last_remote_snapshot_version()));
  921. } else {
  922. goto handle_unusual;
  923. }
  924. break;
  925. }
  926. // int32 target_count = 4;
  927. case 4: {
  928. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
  929. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  930. ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
  931. input, &target_count_)));
  932. } else {
  933. goto handle_unusual;
  934. }
  935. break;
  936. }
  937. default: {
  938. handle_unusual:
  939. if (tag == 0) {
  940. goto success;
  941. }
  942. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  943. input, tag, _internal_metadata_.mutable_unknown_fields()));
  944. break;
  945. }
  946. }
  947. }
  948. success:
  949. // @@protoc_insertion_point(parse_success:firestore.client.TargetGlobal)
  950. return true;
  951. failure:
  952. // @@protoc_insertion_point(parse_failure:firestore.client.TargetGlobal)
  953. return false;
  954. #undef DO_
  955. }
  956. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  957. void TargetGlobal::SerializeWithCachedSizes(
  958. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  959. // @@protoc_insertion_point(serialize_start:firestore.client.TargetGlobal)
  960. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  961. (void) cached_has_bits;
  962. // int32 highest_target_id = 1;
  963. if (this->highest_target_id() != 0) {
  964. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(1, this->highest_target_id(), output);
  965. }
  966. // int64 highest_listen_sequence_number = 2;
  967. if (this->highest_listen_sequence_number() != 0) {
  968. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->highest_listen_sequence_number(), output);
  969. }
  970. // .google.protobuf.Timestamp last_remote_snapshot_version = 3;
  971. if (this->has_last_remote_snapshot_version()) {
  972. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  973. 3, _Internal::last_remote_snapshot_version(this), output);
  974. }
  975. // int32 target_count = 4;
  976. if (this->target_count() != 0) {
  977. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(4, this->target_count(), output);
  978. }
  979. if (_internal_metadata_.have_unknown_fields()) {
  980. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  981. _internal_metadata_.unknown_fields(), output);
  982. }
  983. // @@protoc_insertion_point(serialize_end:firestore.client.TargetGlobal)
  984. }
  985. ::PROTOBUF_NAMESPACE_ID::uint8* TargetGlobal::InternalSerializeWithCachedSizesToArray(
  986. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  987. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.TargetGlobal)
  988. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  989. (void) cached_has_bits;
  990. // int32 highest_target_id = 1;
  991. if (this->highest_target_id() != 0) {
  992. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->highest_target_id(), target);
  993. }
  994. // int64 highest_listen_sequence_number = 2;
  995. if (this->highest_listen_sequence_number() != 0) {
  996. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->highest_listen_sequence_number(), target);
  997. }
  998. // .google.protobuf.Timestamp last_remote_snapshot_version = 3;
  999. if (this->has_last_remote_snapshot_version()) {
  1000. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1001. InternalWriteMessageToArray(
  1002. 3, _Internal::last_remote_snapshot_version(this), target);
  1003. }
  1004. // int32 target_count = 4;
  1005. if (this->target_count() != 0) {
  1006. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->target_count(), target);
  1007. }
  1008. if (_internal_metadata_.have_unknown_fields()) {
  1009. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  1010. _internal_metadata_.unknown_fields(), target);
  1011. }
  1012. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.TargetGlobal)
  1013. return target;
  1014. }
  1015. size_t TargetGlobal::ByteSizeLong() const {
  1016. // @@protoc_insertion_point(message_byte_size_start:firestore.client.TargetGlobal)
  1017. size_t total_size = 0;
  1018. if (_internal_metadata_.have_unknown_fields()) {
  1019. total_size +=
  1020. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  1021. _internal_metadata_.unknown_fields());
  1022. }
  1023. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1024. // Prevent compiler warnings about cached_has_bits being unused
  1025. (void) cached_has_bits;
  1026. // .google.protobuf.Timestamp last_remote_snapshot_version = 3;
  1027. if (this->has_last_remote_snapshot_version()) {
  1028. total_size += 1 +
  1029. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1030. *last_remote_snapshot_version_);
  1031. }
  1032. // int64 highest_listen_sequence_number = 2;
  1033. if (this->highest_listen_sequence_number() != 0) {
  1034. total_size += 1 +
  1035. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
  1036. this->highest_listen_sequence_number());
  1037. }
  1038. // int32 highest_target_id = 1;
  1039. if (this->highest_target_id() != 0) {
  1040. total_size += 1 +
  1041. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  1042. this->highest_target_id());
  1043. }
  1044. // int32 target_count = 4;
  1045. if (this->target_count() != 0) {
  1046. total_size += 1 +
  1047. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  1048. this->target_count());
  1049. }
  1050. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  1051. SetCachedSize(cached_size);
  1052. return total_size;
  1053. }
  1054. void TargetGlobal::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1055. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.TargetGlobal)
  1056. GOOGLE_DCHECK_NE(&from, this);
  1057. const TargetGlobal* source =
  1058. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TargetGlobal>(
  1059. &from);
  1060. if (source == nullptr) {
  1061. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.TargetGlobal)
  1062. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  1063. } else {
  1064. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.TargetGlobal)
  1065. MergeFrom(*source);
  1066. }
  1067. }
  1068. void TargetGlobal::MergeFrom(const TargetGlobal& from) {
  1069. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.TargetGlobal)
  1070. GOOGLE_DCHECK_NE(&from, this);
  1071. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1072. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1073. (void) cached_has_bits;
  1074. if (from.has_last_remote_snapshot_version()) {
  1075. mutable_last_remote_snapshot_version()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from.last_remote_snapshot_version());
  1076. }
  1077. if (from.highest_listen_sequence_number() != 0) {
  1078. set_highest_listen_sequence_number(from.highest_listen_sequence_number());
  1079. }
  1080. if (from.highest_target_id() != 0) {
  1081. set_highest_target_id(from.highest_target_id());
  1082. }
  1083. if (from.target_count() != 0) {
  1084. set_target_count(from.target_count());
  1085. }
  1086. }
  1087. void TargetGlobal::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1088. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.TargetGlobal)
  1089. if (&from == this) return;
  1090. Clear();
  1091. MergeFrom(from);
  1092. }
  1093. void TargetGlobal::CopyFrom(const TargetGlobal& from) {
  1094. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.TargetGlobal)
  1095. if (&from == this) return;
  1096. Clear();
  1097. MergeFrom(from);
  1098. }
  1099. bool TargetGlobal::IsInitialized() const {
  1100. return true;
  1101. }
  1102. void TargetGlobal::InternalSwap(TargetGlobal* other) {
  1103. using std::swap;
  1104. _internal_metadata_.Swap(&other->_internal_metadata_);
  1105. swap(last_remote_snapshot_version_, other->last_remote_snapshot_version_);
  1106. swap(highest_listen_sequence_number_, other->highest_listen_sequence_number_);
  1107. swap(highest_target_id_, other->highest_target_id_);
  1108. swap(target_count_, other->target_count_);
  1109. }
  1110. ::PROTOBUF_NAMESPACE_ID::Metadata TargetGlobal::GetMetadata() const {
  1111. return GetMetadataStatic();
  1112. }
  1113. // @@protoc_insertion_point(namespace_scope)
  1114. } // namespace client
  1115. } // namespace firestore
  1116. PROTOBUF_NAMESPACE_OPEN
  1117. template<> PROTOBUF_NOINLINE ::firestore::client::Target* Arena::CreateMaybeMessage< ::firestore::client::Target >(Arena* arena) {
  1118. return Arena::CreateInternal< ::firestore::client::Target >(arena);
  1119. }
  1120. template<> PROTOBUF_NOINLINE ::firestore::client::TargetGlobal* Arena::CreateMaybeMessage< ::firestore::client::TargetGlobal >(Arena* arena) {
  1121. return Arena::CreateInternal< ::firestore::client::TargetGlobal >(arena);
  1122. }
  1123. PROTOBUF_NAMESPACE_CLOSE
  1124. // @@protoc_insertion_point(global_scope)
  1125. #include <google/protobuf/port_undef.inc>