target.pb.cc 42 KB

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