target.pb.cc 45 KB

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