maybe_document.pb.cc 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316
  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/maybe_document.proto
  18. #include "firestore/local/maybe_document.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 NoDocumentDefaultTypeInternal {
  37. public:
  38. ::google::protobuf::internal::ExplicitlyConstructed<NoDocument>
  39. _instance;
  40. } _NoDocument_default_instance_;
  41. class UnknownDocumentDefaultTypeInternal {
  42. public:
  43. ::google::protobuf::internal::ExplicitlyConstructed<UnknownDocument>
  44. _instance;
  45. } _UnknownDocument_default_instance_;
  46. class MaybeDocumentDefaultTypeInternal {
  47. public:
  48. ::google::protobuf::internal::ExplicitlyConstructed<MaybeDocument>
  49. _instance;
  50. const ::firestore::client::NoDocument* no_document_;
  51. const ::google::firestore::v1::Document* document_;
  52. const ::firestore::client::UnknownDocument* unknown_document_;
  53. } _MaybeDocument_default_instance_;
  54. } // namespace client
  55. } // namespace firestore
  56. namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto {
  57. void InitDefaultsNoDocumentImpl() {
  58. GOOGLE_PROTOBUF_VERIFY_VERSION;
  59. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  60. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  61. #else
  62. ::google::protobuf::internal::InitProtobufDefaults();
  63. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  64. protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
  65. {
  66. void* ptr = &::firestore::client::_NoDocument_default_instance_;
  67. new (ptr) ::firestore::client::NoDocument();
  68. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  69. }
  70. ::firestore::client::NoDocument::InitAsDefaultInstance();
  71. }
  72. void InitDefaultsNoDocument() {
  73. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  74. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNoDocumentImpl);
  75. }
  76. void InitDefaultsUnknownDocumentImpl() {
  77. GOOGLE_PROTOBUF_VERIFY_VERSION;
  78. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  79. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  80. #else
  81. ::google::protobuf::internal::InitProtobufDefaults();
  82. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  83. protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
  84. {
  85. void* ptr = &::firestore::client::_UnknownDocument_default_instance_;
  86. new (ptr) ::firestore::client::UnknownDocument();
  87. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  88. }
  89. ::firestore::client::UnknownDocument::InitAsDefaultInstance();
  90. }
  91. void InitDefaultsUnknownDocument() {
  92. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  93. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsUnknownDocumentImpl);
  94. }
  95. void InitDefaultsMaybeDocumentImpl() {
  96. GOOGLE_PROTOBUF_VERIFY_VERSION;
  97. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  98. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  99. #else
  100. ::google::protobuf::internal::InitProtobufDefaults();
  101. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  102. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  103. protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsDocument();
  104. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsUnknownDocument();
  105. {
  106. void* ptr = &::firestore::client::_MaybeDocument_default_instance_;
  107. new (ptr) ::firestore::client::MaybeDocument();
  108. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  109. }
  110. ::firestore::client::MaybeDocument::InitAsDefaultInstance();
  111. }
  112. void InitDefaultsMaybeDocument() {
  113. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  114. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMaybeDocumentImpl);
  115. }
  116. ::google::protobuf::Metadata file_level_metadata[3];
  117. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  118. ~0u, // no _has_bits_
  119. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, _internal_metadata_),
  120. ~0u, // no _extensions_
  121. ~0u, // no _oneof_case_
  122. ~0u, // no _weak_field_map_
  123. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, name_),
  124. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, read_time_),
  125. ~0u, // no _has_bits_
  126. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::UnknownDocument, _internal_metadata_),
  127. ~0u, // no _extensions_
  128. ~0u, // no _oneof_case_
  129. ~0u, // no _weak_field_map_
  130. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::UnknownDocument, name_),
  131. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::UnknownDocument, version_),
  132. ~0u, // no _has_bits_
  133. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _internal_metadata_),
  134. ~0u, // no _extensions_
  135. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _oneof_case_[0]),
  136. ~0u, // no _weak_field_map_
  137. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, no_document_),
  138. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, document_),
  139. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, unknown_document_),
  140. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, has_committed_mutations_),
  141. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, document_type_),
  142. };
  143. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  144. { 0, -1, sizeof(::firestore::client::NoDocument)},
  145. { 7, -1, sizeof(::firestore::client::UnknownDocument)},
  146. { 14, -1, sizeof(::firestore::client::MaybeDocument)},
  147. };
  148. static ::google::protobuf::Message const * const file_default_instances[] = {
  149. reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_NoDocument_default_instance_),
  150. reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_UnknownDocument_default_instance_),
  151. reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_MaybeDocument_default_instance_),
  152. };
  153. void protobuf_AssignDescriptors() {
  154. AddDescriptors();
  155. ::google::protobuf::MessageFactory* factory = NULL;
  156. AssignDescriptors(
  157. "firestore/local/maybe_document.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  158. file_level_metadata, NULL, NULL);
  159. }
  160. void protobuf_AssignDescriptorsOnce() {
  161. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  162. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  163. }
  164. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  165. void protobuf_RegisterTypes(const ::std::string&) {
  166. protobuf_AssignDescriptorsOnce();
  167. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3);
  168. }
  169. void AddDescriptorsImpl() {
  170. InitDefaults();
  171. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  172. "\n$firestore/local/maybe_document.proto\022\020"
  173. "firestore.client\032\"google/firestore/v1/do"
  174. "cument.proto\032\037google/protobuf/timestamp."
  175. "proto\"I\n\nNoDocument\022\014\n\004name\030\001 \001(\t\022-\n\trea"
  176. "d_time\030\002 \001(\0132\032.google.protobuf.Timestamp"
  177. "\"L\n\017UnknownDocument\022\014\n\004name\030\001 \001(\t\022+\n\007ver"
  178. "sion\030\002 \001(\0132\032.google.protobuf.Timestamp\"\350"
  179. "\001\n\rMaybeDocument\0223\n\013no_document\030\001 \001(\0132\034."
  180. "firestore.client.NoDocumentH\000\0221\n\010documen"
  181. "t\030\002 \001(\0132\035.google.firestore.v1.DocumentH\000"
  182. "\022=\n\020unknown_document\030\003 \001(\0132!.firestore.c"
  183. "lient.UnknownDocumentH\000\022\037\n\027has_committed"
  184. "_mutations\030\004 \001(\010B\017\n\rdocument_typeB/\n#com"
  185. ".google.firebase.firestore.protoP\001\242\002\005FST"
  186. "PBb\006proto3"
  187. };
  188. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  189. descriptor, 570);
  190. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  191. "firestore/local/maybe_document.proto", &protobuf_RegisterTypes);
  192. ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::AddDescriptors();
  193. ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::AddDescriptors();
  194. }
  195. void AddDescriptors() {
  196. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  197. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  198. }
  199. // Force AddDescriptors() to be called at dynamic initialization time.
  200. struct StaticDescriptorInitializer {
  201. StaticDescriptorInitializer() {
  202. AddDescriptors();
  203. }
  204. } static_descriptor_initializer;
  205. } // namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto
  206. namespace firestore {
  207. namespace client {
  208. // ===================================================================
  209. void NoDocument::InitAsDefaultInstance() {
  210. ::firestore::client::_NoDocument_default_instance_._instance.get_mutable()->read_time_ = const_cast< ::google::protobuf::Timestamp*>(
  211. ::google::protobuf::Timestamp::internal_default_instance());
  212. }
  213. void NoDocument::clear_read_time() {
  214. if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
  215. delete read_time_;
  216. }
  217. read_time_ = NULL;
  218. }
  219. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  220. const int NoDocument::kNameFieldNumber;
  221. const int NoDocument::kReadTimeFieldNumber;
  222. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  223. NoDocument::NoDocument()
  224. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  225. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  226. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  227. }
  228. SharedCtor();
  229. // @@protoc_insertion_point(constructor:firestore.client.NoDocument)
  230. }
  231. NoDocument::NoDocument(const NoDocument& from)
  232. : ::google::protobuf::Message(),
  233. _internal_metadata_(NULL),
  234. _cached_size_(0) {
  235. _internal_metadata_.MergeFrom(from._internal_metadata_);
  236. name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  237. if (from.name().size() > 0) {
  238. name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  239. }
  240. if (from.has_read_time()) {
  241. read_time_ = new ::google::protobuf::Timestamp(*from.read_time_);
  242. } else {
  243. read_time_ = NULL;
  244. }
  245. // @@protoc_insertion_point(copy_constructor:firestore.client.NoDocument)
  246. }
  247. void NoDocument::SharedCtor() {
  248. name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  249. read_time_ = NULL;
  250. _cached_size_ = 0;
  251. }
  252. NoDocument::~NoDocument() {
  253. // @@protoc_insertion_point(destructor:firestore.client.NoDocument)
  254. SharedDtor();
  255. }
  256. void NoDocument::SharedDtor() {
  257. name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  258. if (this != internal_default_instance()) delete read_time_;
  259. }
  260. void NoDocument::SetCachedSize(int size) const {
  261. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  262. _cached_size_ = size;
  263. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  264. }
  265. const ::google::protobuf::Descriptor* NoDocument::descriptor() {
  266. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  267. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  268. }
  269. const NoDocument& NoDocument::default_instance() {
  270. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  271. return *internal_default_instance();
  272. }
  273. NoDocument* NoDocument::New(::google::protobuf::Arena* arena) const {
  274. NoDocument* n = new NoDocument;
  275. if (arena != NULL) {
  276. arena->Own(n);
  277. }
  278. return n;
  279. }
  280. void NoDocument::Clear() {
  281. // @@protoc_insertion_point(message_clear_start:firestore.client.NoDocument)
  282. ::google::protobuf::uint32 cached_has_bits = 0;
  283. // Prevent compiler warnings about cached_has_bits being unused
  284. (void) cached_has_bits;
  285. name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  286. if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
  287. delete read_time_;
  288. }
  289. read_time_ = NULL;
  290. _internal_metadata_.Clear();
  291. }
  292. bool NoDocument::MergePartialFromCodedStream(
  293. ::google::protobuf::io::CodedInputStream* input) {
  294. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  295. ::google::protobuf::uint32 tag;
  296. // @@protoc_insertion_point(parse_start:firestore.client.NoDocument)
  297. for (;;) {
  298. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  299. tag = p.first;
  300. if (!p.second) goto handle_unusual;
  301. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  302. // string name = 1;
  303. case 1: {
  304. if (static_cast< ::google::protobuf::uint8>(tag) ==
  305. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  306. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  307. input, this->mutable_name()));
  308. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  309. this->name().data(), static_cast<int>(this->name().length()),
  310. ::google::protobuf::internal::WireFormatLite::PARSE,
  311. "firestore.client.NoDocument.name"));
  312. } else {
  313. goto handle_unusual;
  314. }
  315. break;
  316. }
  317. // .google.protobuf.Timestamp read_time = 2;
  318. case 2: {
  319. if (static_cast< ::google::protobuf::uint8>(tag) ==
  320. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  321. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  322. input, mutable_read_time()));
  323. } else {
  324. goto handle_unusual;
  325. }
  326. break;
  327. }
  328. default: {
  329. handle_unusual:
  330. if (tag == 0) {
  331. goto success;
  332. }
  333. DO_(::google::protobuf::internal::WireFormat::SkipField(
  334. input, tag, _internal_metadata_.mutable_unknown_fields()));
  335. break;
  336. }
  337. }
  338. }
  339. success:
  340. // @@protoc_insertion_point(parse_success:firestore.client.NoDocument)
  341. return true;
  342. failure:
  343. // @@protoc_insertion_point(parse_failure:firestore.client.NoDocument)
  344. return false;
  345. #undef DO_
  346. }
  347. void NoDocument::SerializeWithCachedSizes(
  348. ::google::protobuf::io::CodedOutputStream* output) const {
  349. // @@protoc_insertion_point(serialize_start:firestore.client.NoDocument)
  350. ::google::protobuf::uint32 cached_has_bits = 0;
  351. (void) cached_has_bits;
  352. // string name = 1;
  353. if (this->name().size() > 0) {
  354. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  355. this->name().data(), static_cast<int>(this->name().length()),
  356. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  357. "firestore.client.NoDocument.name");
  358. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  359. 1, this->name(), output);
  360. }
  361. // .google.protobuf.Timestamp read_time = 2;
  362. if (this->has_read_time()) {
  363. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  364. 2, *this->read_time_, output);
  365. }
  366. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  367. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  368. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  369. }
  370. // @@protoc_insertion_point(serialize_end:firestore.client.NoDocument)
  371. }
  372. ::google::protobuf::uint8* NoDocument::InternalSerializeWithCachedSizesToArray(
  373. bool deterministic, ::google::protobuf::uint8* target) const {
  374. (void)deterministic; // Unused
  375. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.NoDocument)
  376. ::google::protobuf::uint32 cached_has_bits = 0;
  377. (void) cached_has_bits;
  378. // string name = 1;
  379. if (this->name().size() > 0) {
  380. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  381. this->name().data(), static_cast<int>(this->name().length()),
  382. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  383. "firestore.client.NoDocument.name");
  384. target =
  385. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  386. 1, this->name(), target);
  387. }
  388. // .google.protobuf.Timestamp read_time = 2;
  389. if (this->has_read_time()) {
  390. target = ::google::protobuf::internal::WireFormatLite::
  391. InternalWriteMessageToArray(
  392. 2, *this->read_time_, deterministic, target);
  393. }
  394. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  395. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  396. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  397. }
  398. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.NoDocument)
  399. return target;
  400. }
  401. size_t NoDocument::ByteSizeLong() const {
  402. // @@protoc_insertion_point(message_byte_size_start:firestore.client.NoDocument)
  403. size_t total_size = 0;
  404. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  405. total_size +=
  406. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  407. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  408. }
  409. // string name = 1;
  410. if (this->name().size() > 0) {
  411. total_size += 1 +
  412. ::google::protobuf::internal::WireFormatLite::StringSize(
  413. this->name());
  414. }
  415. // .google.protobuf.Timestamp read_time = 2;
  416. if (this->has_read_time()) {
  417. total_size += 1 +
  418. ::google::protobuf::internal::WireFormatLite::MessageSize(
  419. *this->read_time_);
  420. }
  421. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  422. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  423. _cached_size_ = cached_size;
  424. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  425. return total_size;
  426. }
  427. void NoDocument::MergeFrom(const ::google::protobuf::Message& from) {
  428. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.NoDocument)
  429. GOOGLE_DCHECK_NE(&from, this);
  430. const NoDocument* source =
  431. ::google::protobuf::internal::DynamicCastToGenerated<const NoDocument>(
  432. &from);
  433. if (source == NULL) {
  434. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.NoDocument)
  435. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  436. } else {
  437. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.NoDocument)
  438. MergeFrom(*source);
  439. }
  440. }
  441. void NoDocument::MergeFrom(const NoDocument& from) {
  442. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.NoDocument)
  443. GOOGLE_DCHECK_NE(&from, this);
  444. _internal_metadata_.MergeFrom(from._internal_metadata_);
  445. ::google::protobuf::uint32 cached_has_bits = 0;
  446. (void) cached_has_bits;
  447. if (from.name().size() > 0) {
  448. name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  449. }
  450. if (from.has_read_time()) {
  451. mutable_read_time()->::google::protobuf::Timestamp::MergeFrom(from.read_time());
  452. }
  453. }
  454. void NoDocument::CopyFrom(const ::google::protobuf::Message& from) {
  455. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.NoDocument)
  456. if (&from == this) return;
  457. Clear();
  458. MergeFrom(from);
  459. }
  460. void NoDocument::CopyFrom(const NoDocument& from) {
  461. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.NoDocument)
  462. if (&from == this) return;
  463. Clear();
  464. MergeFrom(from);
  465. }
  466. bool NoDocument::IsInitialized() const {
  467. return true;
  468. }
  469. void NoDocument::Swap(NoDocument* other) {
  470. if (other == this) return;
  471. InternalSwap(other);
  472. }
  473. void NoDocument::InternalSwap(NoDocument* other) {
  474. using std::swap;
  475. name_.Swap(&other->name_);
  476. swap(read_time_, other->read_time_);
  477. _internal_metadata_.Swap(&other->_internal_metadata_);
  478. swap(_cached_size_, other->_cached_size_);
  479. }
  480. ::google::protobuf::Metadata NoDocument::GetMetadata() const {
  481. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  482. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
  483. }
  484. // ===================================================================
  485. void UnknownDocument::InitAsDefaultInstance() {
  486. ::firestore::client::_UnknownDocument_default_instance_._instance.get_mutable()->version_ = const_cast< ::google::protobuf::Timestamp*>(
  487. ::google::protobuf::Timestamp::internal_default_instance());
  488. }
  489. void UnknownDocument::clear_version() {
  490. if (GetArenaNoVirtual() == NULL && version_ != NULL) {
  491. delete version_;
  492. }
  493. version_ = NULL;
  494. }
  495. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  496. const int UnknownDocument::kNameFieldNumber;
  497. const int UnknownDocument::kVersionFieldNumber;
  498. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  499. UnknownDocument::UnknownDocument()
  500. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  501. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  502. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsUnknownDocument();
  503. }
  504. SharedCtor();
  505. // @@protoc_insertion_point(constructor:firestore.client.UnknownDocument)
  506. }
  507. UnknownDocument::UnknownDocument(const UnknownDocument& from)
  508. : ::google::protobuf::Message(),
  509. _internal_metadata_(NULL),
  510. _cached_size_(0) {
  511. _internal_metadata_.MergeFrom(from._internal_metadata_);
  512. name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  513. if (from.name().size() > 0) {
  514. name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  515. }
  516. if (from.has_version()) {
  517. version_ = new ::google::protobuf::Timestamp(*from.version_);
  518. } else {
  519. version_ = NULL;
  520. }
  521. // @@protoc_insertion_point(copy_constructor:firestore.client.UnknownDocument)
  522. }
  523. void UnknownDocument::SharedCtor() {
  524. name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  525. version_ = NULL;
  526. _cached_size_ = 0;
  527. }
  528. UnknownDocument::~UnknownDocument() {
  529. // @@protoc_insertion_point(destructor:firestore.client.UnknownDocument)
  530. SharedDtor();
  531. }
  532. void UnknownDocument::SharedDtor() {
  533. name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  534. if (this != internal_default_instance()) delete version_;
  535. }
  536. void UnknownDocument::SetCachedSize(int size) const {
  537. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  538. _cached_size_ = size;
  539. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  540. }
  541. const ::google::protobuf::Descriptor* UnknownDocument::descriptor() {
  542. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  543. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  544. }
  545. const UnknownDocument& UnknownDocument::default_instance() {
  546. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsUnknownDocument();
  547. return *internal_default_instance();
  548. }
  549. UnknownDocument* UnknownDocument::New(::google::protobuf::Arena* arena) const {
  550. UnknownDocument* n = new UnknownDocument;
  551. if (arena != NULL) {
  552. arena->Own(n);
  553. }
  554. return n;
  555. }
  556. void UnknownDocument::Clear() {
  557. // @@protoc_insertion_point(message_clear_start:firestore.client.UnknownDocument)
  558. ::google::protobuf::uint32 cached_has_bits = 0;
  559. // Prevent compiler warnings about cached_has_bits being unused
  560. (void) cached_has_bits;
  561. name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  562. if (GetArenaNoVirtual() == NULL && version_ != NULL) {
  563. delete version_;
  564. }
  565. version_ = NULL;
  566. _internal_metadata_.Clear();
  567. }
  568. bool UnknownDocument::MergePartialFromCodedStream(
  569. ::google::protobuf::io::CodedInputStream* input) {
  570. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  571. ::google::protobuf::uint32 tag;
  572. // @@protoc_insertion_point(parse_start:firestore.client.UnknownDocument)
  573. for (;;) {
  574. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  575. tag = p.first;
  576. if (!p.second) goto handle_unusual;
  577. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  578. // string name = 1;
  579. case 1: {
  580. if (static_cast< ::google::protobuf::uint8>(tag) ==
  581. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  582. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  583. input, this->mutable_name()));
  584. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  585. this->name().data(), static_cast<int>(this->name().length()),
  586. ::google::protobuf::internal::WireFormatLite::PARSE,
  587. "firestore.client.UnknownDocument.name"));
  588. } else {
  589. goto handle_unusual;
  590. }
  591. break;
  592. }
  593. // .google.protobuf.Timestamp version = 2;
  594. case 2: {
  595. if (static_cast< ::google::protobuf::uint8>(tag) ==
  596. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  597. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  598. input, mutable_version()));
  599. } else {
  600. goto handle_unusual;
  601. }
  602. break;
  603. }
  604. default: {
  605. handle_unusual:
  606. if (tag == 0) {
  607. goto success;
  608. }
  609. DO_(::google::protobuf::internal::WireFormat::SkipField(
  610. input, tag, _internal_metadata_.mutable_unknown_fields()));
  611. break;
  612. }
  613. }
  614. }
  615. success:
  616. // @@protoc_insertion_point(parse_success:firestore.client.UnknownDocument)
  617. return true;
  618. failure:
  619. // @@protoc_insertion_point(parse_failure:firestore.client.UnknownDocument)
  620. return false;
  621. #undef DO_
  622. }
  623. void UnknownDocument::SerializeWithCachedSizes(
  624. ::google::protobuf::io::CodedOutputStream* output) const {
  625. // @@protoc_insertion_point(serialize_start:firestore.client.UnknownDocument)
  626. ::google::protobuf::uint32 cached_has_bits = 0;
  627. (void) cached_has_bits;
  628. // string name = 1;
  629. if (this->name().size() > 0) {
  630. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  631. this->name().data(), static_cast<int>(this->name().length()),
  632. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  633. "firestore.client.UnknownDocument.name");
  634. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  635. 1, this->name(), output);
  636. }
  637. // .google.protobuf.Timestamp version = 2;
  638. if (this->has_version()) {
  639. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  640. 2, *this->version_, output);
  641. }
  642. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  643. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  644. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  645. }
  646. // @@protoc_insertion_point(serialize_end:firestore.client.UnknownDocument)
  647. }
  648. ::google::protobuf::uint8* UnknownDocument::InternalSerializeWithCachedSizesToArray(
  649. bool deterministic, ::google::protobuf::uint8* target) const {
  650. (void)deterministic; // Unused
  651. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.UnknownDocument)
  652. ::google::protobuf::uint32 cached_has_bits = 0;
  653. (void) cached_has_bits;
  654. // string name = 1;
  655. if (this->name().size() > 0) {
  656. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  657. this->name().data(), static_cast<int>(this->name().length()),
  658. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  659. "firestore.client.UnknownDocument.name");
  660. target =
  661. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  662. 1, this->name(), target);
  663. }
  664. // .google.protobuf.Timestamp version = 2;
  665. if (this->has_version()) {
  666. target = ::google::protobuf::internal::WireFormatLite::
  667. InternalWriteMessageToArray(
  668. 2, *this->version_, deterministic, target);
  669. }
  670. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  671. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  672. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  673. }
  674. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.UnknownDocument)
  675. return target;
  676. }
  677. size_t UnknownDocument::ByteSizeLong() const {
  678. // @@protoc_insertion_point(message_byte_size_start:firestore.client.UnknownDocument)
  679. size_t total_size = 0;
  680. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  681. total_size +=
  682. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  683. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  684. }
  685. // string name = 1;
  686. if (this->name().size() > 0) {
  687. total_size += 1 +
  688. ::google::protobuf::internal::WireFormatLite::StringSize(
  689. this->name());
  690. }
  691. // .google.protobuf.Timestamp version = 2;
  692. if (this->has_version()) {
  693. total_size += 1 +
  694. ::google::protobuf::internal::WireFormatLite::MessageSize(
  695. *this->version_);
  696. }
  697. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  698. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  699. _cached_size_ = cached_size;
  700. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  701. return total_size;
  702. }
  703. void UnknownDocument::MergeFrom(const ::google::protobuf::Message& from) {
  704. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.UnknownDocument)
  705. GOOGLE_DCHECK_NE(&from, this);
  706. const UnknownDocument* source =
  707. ::google::protobuf::internal::DynamicCastToGenerated<const UnknownDocument>(
  708. &from);
  709. if (source == NULL) {
  710. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.UnknownDocument)
  711. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  712. } else {
  713. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.UnknownDocument)
  714. MergeFrom(*source);
  715. }
  716. }
  717. void UnknownDocument::MergeFrom(const UnknownDocument& from) {
  718. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.UnknownDocument)
  719. GOOGLE_DCHECK_NE(&from, this);
  720. _internal_metadata_.MergeFrom(from._internal_metadata_);
  721. ::google::protobuf::uint32 cached_has_bits = 0;
  722. (void) cached_has_bits;
  723. if (from.name().size() > 0) {
  724. name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  725. }
  726. if (from.has_version()) {
  727. mutable_version()->::google::protobuf::Timestamp::MergeFrom(from.version());
  728. }
  729. }
  730. void UnknownDocument::CopyFrom(const ::google::protobuf::Message& from) {
  731. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.UnknownDocument)
  732. if (&from == this) return;
  733. Clear();
  734. MergeFrom(from);
  735. }
  736. void UnknownDocument::CopyFrom(const UnknownDocument& from) {
  737. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.UnknownDocument)
  738. if (&from == this) return;
  739. Clear();
  740. MergeFrom(from);
  741. }
  742. bool UnknownDocument::IsInitialized() const {
  743. return true;
  744. }
  745. void UnknownDocument::Swap(UnknownDocument* other) {
  746. if (other == this) return;
  747. InternalSwap(other);
  748. }
  749. void UnknownDocument::InternalSwap(UnknownDocument* other) {
  750. using std::swap;
  751. name_.Swap(&other->name_);
  752. swap(version_, other->version_);
  753. _internal_metadata_.Swap(&other->_internal_metadata_);
  754. swap(_cached_size_, other->_cached_size_);
  755. }
  756. ::google::protobuf::Metadata UnknownDocument::GetMetadata() const {
  757. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  758. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
  759. }
  760. // ===================================================================
  761. void MaybeDocument::InitAsDefaultInstance() {
  762. ::firestore::client::_MaybeDocument_default_instance_.no_document_ = const_cast< ::firestore::client::NoDocument*>(
  763. ::firestore::client::NoDocument::internal_default_instance());
  764. ::firestore::client::_MaybeDocument_default_instance_.document_ = const_cast< ::google::firestore::v1::Document*>(
  765. ::google::firestore::v1::Document::internal_default_instance());
  766. ::firestore::client::_MaybeDocument_default_instance_.unknown_document_ = const_cast< ::firestore::client::UnknownDocument*>(
  767. ::firestore::client::UnknownDocument::internal_default_instance());
  768. }
  769. void MaybeDocument::set_allocated_no_document(::firestore::client::NoDocument* no_document) {
  770. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  771. clear_document_type();
  772. if (no_document) {
  773. ::google::protobuf::Arena* submessage_arena = NULL;
  774. if (message_arena != submessage_arena) {
  775. no_document = ::google::protobuf::internal::GetOwnedMessage(
  776. message_arena, no_document, submessage_arena);
  777. }
  778. set_has_no_document();
  779. document_type_.no_document_ = no_document;
  780. }
  781. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.no_document)
  782. }
  783. void MaybeDocument::set_allocated_document(::google::firestore::v1::Document* document) {
  784. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  785. clear_document_type();
  786. if (document) {
  787. ::google::protobuf::Arena* submessage_arena = NULL;
  788. if (message_arena != submessage_arena) {
  789. document = ::google::protobuf::internal::GetOwnedMessage(
  790. message_arena, document, submessage_arena);
  791. }
  792. set_has_document();
  793. document_type_.document_ = document;
  794. }
  795. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.document)
  796. }
  797. void MaybeDocument::clear_document() {
  798. if (has_document()) {
  799. delete document_type_.document_;
  800. clear_has_document_type();
  801. }
  802. }
  803. void MaybeDocument::set_allocated_unknown_document(::firestore::client::UnknownDocument* unknown_document) {
  804. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  805. clear_document_type();
  806. if (unknown_document) {
  807. ::google::protobuf::Arena* submessage_arena = NULL;
  808. if (message_arena != submessage_arena) {
  809. unknown_document = ::google::protobuf::internal::GetOwnedMessage(
  810. message_arena, unknown_document, submessage_arena);
  811. }
  812. set_has_unknown_document();
  813. document_type_.unknown_document_ = unknown_document;
  814. }
  815. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.unknown_document)
  816. }
  817. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  818. const int MaybeDocument::kNoDocumentFieldNumber;
  819. const int MaybeDocument::kDocumentFieldNumber;
  820. const int MaybeDocument::kUnknownDocumentFieldNumber;
  821. const int MaybeDocument::kHasCommittedMutationsFieldNumber;
  822. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  823. MaybeDocument::MaybeDocument()
  824. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  825. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  826. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
  827. }
  828. SharedCtor();
  829. // @@protoc_insertion_point(constructor:firestore.client.MaybeDocument)
  830. }
  831. MaybeDocument::MaybeDocument(const MaybeDocument& from)
  832. : ::google::protobuf::Message(),
  833. _internal_metadata_(NULL),
  834. _cached_size_(0) {
  835. _internal_metadata_.MergeFrom(from._internal_metadata_);
  836. has_committed_mutations_ = from.has_committed_mutations_;
  837. clear_has_document_type();
  838. switch (from.document_type_case()) {
  839. case kNoDocument: {
  840. mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
  841. break;
  842. }
  843. case kDocument: {
  844. mutable_document()->::google::firestore::v1::Document::MergeFrom(from.document());
  845. break;
  846. }
  847. case kUnknownDocument: {
  848. mutable_unknown_document()->::firestore::client::UnknownDocument::MergeFrom(from.unknown_document());
  849. break;
  850. }
  851. case DOCUMENT_TYPE_NOT_SET: {
  852. break;
  853. }
  854. }
  855. // @@protoc_insertion_point(copy_constructor:firestore.client.MaybeDocument)
  856. }
  857. void MaybeDocument::SharedCtor() {
  858. has_committed_mutations_ = false;
  859. clear_has_document_type();
  860. _cached_size_ = 0;
  861. }
  862. MaybeDocument::~MaybeDocument() {
  863. // @@protoc_insertion_point(destructor:firestore.client.MaybeDocument)
  864. SharedDtor();
  865. }
  866. void MaybeDocument::SharedDtor() {
  867. if (has_document_type()) {
  868. clear_document_type();
  869. }
  870. }
  871. void MaybeDocument::SetCachedSize(int size) const {
  872. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  873. _cached_size_ = size;
  874. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  875. }
  876. const ::google::protobuf::Descriptor* MaybeDocument::descriptor() {
  877. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  878. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  879. }
  880. const MaybeDocument& MaybeDocument::default_instance() {
  881. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
  882. return *internal_default_instance();
  883. }
  884. MaybeDocument* MaybeDocument::New(::google::protobuf::Arena* arena) const {
  885. MaybeDocument* n = new MaybeDocument;
  886. if (arena != NULL) {
  887. arena->Own(n);
  888. }
  889. return n;
  890. }
  891. void MaybeDocument::clear_document_type() {
  892. // @@protoc_insertion_point(one_of_clear_start:firestore.client.MaybeDocument)
  893. switch (document_type_case()) {
  894. case kNoDocument: {
  895. delete document_type_.no_document_;
  896. break;
  897. }
  898. case kDocument: {
  899. delete document_type_.document_;
  900. break;
  901. }
  902. case kUnknownDocument: {
  903. delete document_type_.unknown_document_;
  904. break;
  905. }
  906. case DOCUMENT_TYPE_NOT_SET: {
  907. break;
  908. }
  909. }
  910. _oneof_case_[0] = DOCUMENT_TYPE_NOT_SET;
  911. }
  912. void MaybeDocument::Clear() {
  913. // @@protoc_insertion_point(message_clear_start:firestore.client.MaybeDocument)
  914. ::google::protobuf::uint32 cached_has_bits = 0;
  915. // Prevent compiler warnings about cached_has_bits being unused
  916. (void) cached_has_bits;
  917. has_committed_mutations_ = false;
  918. clear_document_type();
  919. _internal_metadata_.Clear();
  920. }
  921. bool MaybeDocument::MergePartialFromCodedStream(
  922. ::google::protobuf::io::CodedInputStream* input) {
  923. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  924. ::google::protobuf::uint32 tag;
  925. // @@protoc_insertion_point(parse_start:firestore.client.MaybeDocument)
  926. for (;;) {
  927. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  928. tag = p.first;
  929. if (!p.second) goto handle_unusual;
  930. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  931. // .firestore.client.NoDocument no_document = 1;
  932. case 1: {
  933. if (static_cast< ::google::protobuf::uint8>(tag) ==
  934. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  935. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  936. input, mutable_no_document()));
  937. } else {
  938. goto handle_unusual;
  939. }
  940. break;
  941. }
  942. // .google.firestore.v1.Document document = 2;
  943. case 2: {
  944. if (static_cast< ::google::protobuf::uint8>(tag) ==
  945. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  946. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  947. input, mutable_document()));
  948. } else {
  949. goto handle_unusual;
  950. }
  951. break;
  952. }
  953. // .firestore.client.UnknownDocument unknown_document = 3;
  954. case 3: {
  955. if (static_cast< ::google::protobuf::uint8>(tag) ==
  956. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  957. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  958. input, mutable_unknown_document()));
  959. } else {
  960. goto handle_unusual;
  961. }
  962. break;
  963. }
  964. // bool has_committed_mutations = 4;
  965. case 4: {
  966. if (static_cast< ::google::protobuf::uint8>(tag) ==
  967. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  968. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  969. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  970. input, &has_committed_mutations_)));
  971. } else {
  972. goto handle_unusual;
  973. }
  974. break;
  975. }
  976. default: {
  977. handle_unusual:
  978. if (tag == 0) {
  979. goto success;
  980. }
  981. DO_(::google::protobuf::internal::WireFormat::SkipField(
  982. input, tag, _internal_metadata_.mutable_unknown_fields()));
  983. break;
  984. }
  985. }
  986. }
  987. success:
  988. // @@protoc_insertion_point(parse_success:firestore.client.MaybeDocument)
  989. return true;
  990. failure:
  991. // @@protoc_insertion_point(parse_failure:firestore.client.MaybeDocument)
  992. return false;
  993. #undef DO_
  994. }
  995. void MaybeDocument::SerializeWithCachedSizes(
  996. ::google::protobuf::io::CodedOutputStream* output) const {
  997. // @@protoc_insertion_point(serialize_start:firestore.client.MaybeDocument)
  998. ::google::protobuf::uint32 cached_has_bits = 0;
  999. (void) cached_has_bits;
  1000. // .firestore.client.NoDocument no_document = 1;
  1001. if (has_no_document()) {
  1002. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1003. 1, *document_type_.no_document_, output);
  1004. }
  1005. // .google.firestore.v1.Document document = 2;
  1006. if (has_document()) {
  1007. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1008. 2, *document_type_.document_, output);
  1009. }
  1010. // .firestore.client.UnknownDocument unknown_document = 3;
  1011. if (has_unknown_document()) {
  1012. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1013. 3, *document_type_.unknown_document_, output);
  1014. }
  1015. // bool has_committed_mutations = 4;
  1016. if (this->has_committed_mutations() != 0) {
  1017. ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->has_committed_mutations(), output);
  1018. }
  1019. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1020. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1021. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1022. }
  1023. // @@protoc_insertion_point(serialize_end:firestore.client.MaybeDocument)
  1024. }
  1025. ::google::protobuf::uint8* MaybeDocument::InternalSerializeWithCachedSizesToArray(
  1026. bool deterministic, ::google::protobuf::uint8* target) const {
  1027. (void)deterministic; // Unused
  1028. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.MaybeDocument)
  1029. ::google::protobuf::uint32 cached_has_bits = 0;
  1030. (void) cached_has_bits;
  1031. // .firestore.client.NoDocument no_document = 1;
  1032. if (has_no_document()) {
  1033. target = ::google::protobuf::internal::WireFormatLite::
  1034. InternalWriteMessageToArray(
  1035. 1, *document_type_.no_document_, deterministic, target);
  1036. }
  1037. // .google.firestore.v1.Document document = 2;
  1038. if (has_document()) {
  1039. target = ::google::protobuf::internal::WireFormatLite::
  1040. InternalWriteMessageToArray(
  1041. 2, *document_type_.document_, deterministic, target);
  1042. }
  1043. // .firestore.client.UnknownDocument unknown_document = 3;
  1044. if (has_unknown_document()) {
  1045. target = ::google::protobuf::internal::WireFormatLite::
  1046. InternalWriteMessageToArray(
  1047. 3, *document_type_.unknown_document_, deterministic, target);
  1048. }
  1049. // bool has_committed_mutations = 4;
  1050. if (this->has_committed_mutations() != 0) {
  1051. target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->has_committed_mutations(), target);
  1052. }
  1053. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1054. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1055. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  1056. }
  1057. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.MaybeDocument)
  1058. return target;
  1059. }
  1060. size_t MaybeDocument::ByteSizeLong() const {
  1061. // @@protoc_insertion_point(message_byte_size_start:firestore.client.MaybeDocument)
  1062. size_t total_size = 0;
  1063. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1064. total_size +=
  1065. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1066. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  1067. }
  1068. // bool has_committed_mutations = 4;
  1069. if (this->has_committed_mutations() != 0) {
  1070. total_size += 1 + 1;
  1071. }
  1072. switch (document_type_case()) {
  1073. // .firestore.client.NoDocument no_document = 1;
  1074. case kNoDocument: {
  1075. total_size += 1 +
  1076. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1077. *document_type_.no_document_);
  1078. break;
  1079. }
  1080. // .google.firestore.v1.Document document = 2;
  1081. case kDocument: {
  1082. total_size += 1 +
  1083. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1084. *document_type_.document_);
  1085. break;
  1086. }
  1087. // .firestore.client.UnknownDocument unknown_document = 3;
  1088. case kUnknownDocument: {
  1089. total_size += 1 +
  1090. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1091. *document_type_.unknown_document_);
  1092. break;
  1093. }
  1094. case DOCUMENT_TYPE_NOT_SET: {
  1095. break;
  1096. }
  1097. }
  1098. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1099. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  1100. _cached_size_ = cached_size;
  1101. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  1102. return total_size;
  1103. }
  1104. void MaybeDocument::MergeFrom(const ::google::protobuf::Message& from) {
  1105. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.MaybeDocument)
  1106. GOOGLE_DCHECK_NE(&from, this);
  1107. const MaybeDocument* source =
  1108. ::google::protobuf::internal::DynamicCastToGenerated<const MaybeDocument>(
  1109. &from);
  1110. if (source == NULL) {
  1111. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.MaybeDocument)
  1112. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1113. } else {
  1114. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.MaybeDocument)
  1115. MergeFrom(*source);
  1116. }
  1117. }
  1118. void MaybeDocument::MergeFrom(const MaybeDocument& from) {
  1119. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.MaybeDocument)
  1120. GOOGLE_DCHECK_NE(&from, this);
  1121. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1122. ::google::protobuf::uint32 cached_has_bits = 0;
  1123. (void) cached_has_bits;
  1124. if (from.has_committed_mutations() != 0) {
  1125. set_has_committed_mutations(from.has_committed_mutations());
  1126. }
  1127. switch (from.document_type_case()) {
  1128. case kNoDocument: {
  1129. mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
  1130. break;
  1131. }
  1132. case kDocument: {
  1133. mutable_document()->::google::firestore::v1::Document::MergeFrom(from.document());
  1134. break;
  1135. }
  1136. case kUnknownDocument: {
  1137. mutable_unknown_document()->::firestore::client::UnknownDocument::MergeFrom(from.unknown_document());
  1138. break;
  1139. }
  1140. case DOCUMENT_TYPE_NOT_SET: {
  1141. break;
  1142. }
  1143. }
  1144. }
  1145. void MaybeDocument::CopyFrom(const ::google::protobuf::Message& from) {
  1146. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.MaybeDocument)
  1147. if (&from == this) return;
  1148. Clear();
  1149. MergeFrom(from);
  1150. }
  1151. void MaybeDocument::CopyFrom(const MaybeDocument& from) {
  1152. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.MaybeDocument)
  1153. if (&from == this) return;
  1154. Clear();
  1155. MergeFrom(from);
  1156. }
  1157. bool MaybeDocument::IsInitialized() const {
  1158. return true;
  1159. }
  1160. void MaybeDocument::Swap(MaybeDocument* other) {
  1161. if (other == this) return;
  1162. InternalSwap(other);
  1163. }
  1164. void MaybeDocument::InternalSwap(MaybeDocument* other) {
  1165. using std::swap;
  1166. swap(has_committed_mutations_, other->has_committed_mutations_);
  1167. swap(document_type_, other->document_type_);
  1168. swap(_oneof_case_[0], other->_oneof_case_[0]);
  1169. _internal_metadata_.Swap(&other->_internal_metadata_);
  1170. swap(_cached_size_, other->_cached_size_);
  1171. }
  1172. ::google::protobuf::Metadata MaybeDocument::GetMetadata() const {
  1173. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  1174. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
  1175. }
  1176. // @@protoc_insertion_point(namespace_scope)
  1177. } // namespace client
  1178. } // namespace firestore
  1179. // @@protoc_insertion_point(global_scope)