maybe_document.pb.cc 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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 MaybeDocumentDefaultTypeInternal {
  42. public:
  43. ::google::protobuf::internal::ExplicitlyConstructed<MaybeDocument>
  44. _instance;
  45. const ::firestore::client::NoDocument* no_document_;
  46. const ::google::firestore::v1beta1::Document* document_;
  47. } _MaybeDocument_default_instance_;
  48. } // namespace client
  49. } // namespace firestore
  50. namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto {
  51. void InitDefaultsNoDocumentImpl() {
  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. {
  60. void* ptr = &::firestore::client::_NoDocument_default_instance_;
  61. new (ptr) ::firestore::client::NoDocument();
  62. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  63. }
  64. ::firestore::client::NoDocument::InitAsDefaultInstance();
  65. }
  66. void InitDefaultsNoDocument() {
  67. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  68. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNoDocumentImpl);
  69. }
  70. void InitDefaultsMaybeDocumentImpl() {
  71. GOOGLE_PROTOBUF_VERIFY_VERSION;
  72. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  73. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  74. #else
  75. ::google::protobuf::internal::InitProtobufDefaults();
  76. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  77. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  78. protobuf_google_2ffirestore_2fv1beta1_2fdocument_2eproto::InitDefaultsDocument();
  79. {
  80. void* ptr = &::firestore::client::_MaybeDocument_default_instance_;
  81. new (ptr) ::firestore::client::MaybeDocument();
  82. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  83. }
  84. ::firestore::client::MaybeDocument::InitAsDefaultInstance();
  85. }
  86. void InitDefaultsMaybeDocument() {
  87. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  88. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMaybeDocumentImpl);
  89. }
  90. ::google::protobuf::Metadata file_level_metadata[2];
  91. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  92. ~0u, // no _has_bits_
  93. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, _internal_metadata_),
  94. ~0u, // no _extensions_
  95. ~0u, // no _oneof_case_
  96. ~0u, // no _weak_field_map_
  97. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, name_),
  98. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, read_time_),
  99. ~0u, // no _has_bits_
  100. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _internal_metadata_),
  101. ~0u, // no _extensions_
  102. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _oneof_case_[0]),
  103. ~0u, // no _weak_field_map_
  104. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, no_document_),
  105. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, document_),
  106. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, document_type_),
  107. };
  108. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  109. { 0, -1, sizeof(::firestore::client::NoDocument)},
  110. { 7, -1, sizeof(::firestore::client::MaybeDocument)},
  111. };
  112. static ::google::protobuf::Message const * const file_default_instances[] = {
  113. reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_NoDocument_default_instance_),
  114. reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_MaybeDocument_default_instance_),
  115. };
  116. void protobuf_AssignDescriptors() {
  117. AddDescriptors();
  118. ::google::protobuf::MessageFactory* factory = NULL;
  119. AssignDescriptors(
  120. "firestore/local/maybe_document.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  121. file_level_metadata, NULL, NULL);
  122. }
  123. void protobuf_AssignDescriptorsOnce() {
  124. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  125. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  126. }
  127. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  128. void protobuf_RegisterTypes(const ::std::string&) {
  129. protobuf_AssignDescriptorsOnce();
  130. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
  131. }
  132. void AddDescriptorsImpl() {
  133. InitDefaults();
  134. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  135. "\n$firestore/local/maybe_document.proto\022\020"
  136. "firestore.client\032\'google/firestore/v1bet"
  137. "a1/document.proto\032\037google/protobuf/times"
  138. "tamp.proto\"I\n\nNoDocument\022\014\n\004name\030\001 \001(\t\022-"
  139. "\n\tread_time\030\002 \001(\0132\032.google.protobuf.Time"
  140. "stamp\"\215\001\n\rMaybeDocument\0223\n\013no_document\030\001"
  141. " \001(\0132\034.firestore.client.NoDocumentH\000\0226\n\010"
  142. "document\030\002 \001(\0132\".google.firestore.v1beta"
  143. "1.DocumentH\000B\017\n\rdocument_typeB/\n#com.goo"
  144. "gle.firebase.firestore.protoP\001\242\002\005FSTPBb\006"
  145. "proto3"
  146. };
  147. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  148. descriptor, 406);
  149. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  150. "firestore/local/maybe_document.proto", &protobuf_RegisterTypes);
  151. ::protobuf_google_2ffirestore_2fv1beta1_2fdocument_2eproto::AddDescriptors();
  152. ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::AddDescriptors();
  153. }
  154. void AddDescriptors() {
  155. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  156. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  157. }
  158. // Force AddDescriptors() to be called at dynamic initialization time.
  159. struct StaticDescriptorInitializer {
  160. StaticDescriptorInitializer() {
  161. AddDescriptors();
  162. }
  163. } static_descriptor_initializer;
  164. } // namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto
  165. namespace firestore {
  166. namespace client {
  167. // ===================================================================
  168. void NoDocument::InitAsDefaultInstance() {
  169. ::firestore::client::_NoDocument_default_instance_._instance.get_mutable()->read_time_ = const_cast< ::google::protobuf::Timestamp*>(
  170. ::google::protobuf::Timestamp::internal_default_instance());
  171. }
  172. void NoDocument::clear_read_time() {
  173. if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
  174. delete read_time_;
  175. }
  176. read_time_ = NULL;
  177. }
  178. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  179. const int NoDocument::kNameFieldNumber;
  180. const int NoDocument::kReadTimeFieldNumber;
  181. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  182. NoDocument::NoDocument()
  183. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  184. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  185. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  186. }
  187. SharedCtor();
  188. // @@protoc_insertion_point(constructor:firestore.client.NoDocument)
  189. }
  190. NoDocument::NoDocument(const NoDocument& from)
  191. : ::google::protobuf::Message(),
  192. _internal_metadata_(NULL),
  193. _cached_size_(0) {
  194. _internal_metadata_.MergeFrom(from._internal_metadata_);
  195. name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  196. if (from.name().size() > 0) {
  197. name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  198. }
  199. if (from.has_read_time()) {
  200. read_time_ = new ::google::protobuf::Timestamp(*from.read_time_);
  201. } else {
  202. read_time_ = NULL;
  203. }
  204. // @@protoc_insertion_point(copy_constructor:firestore.client.NoDocument)
  205. }
  206. void NoDocument::SharedCtor() {
  207. name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  208. read_time_ = NULL;
  209. _cached_size_ = 0;
  210. }
  211. NoDocument::~NoDocument() {
  212. // @@protoc_insertion_point(destructor:firestore.client.NoDocument)
  213. SharedDtor();
  214. }
  215. void NoDocument::SharedDtor() {
  216. name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  217. if (this != internal_default_instance()) delete read_time_;
  218. }
  219. void NoDocument::SetCachedSize(int size) const {
  220. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  221. _cached_size_ = size;
  222. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  223. }
  224. const ::google::protobuf::Descriptor* NoDocument::descriptor() {
  225. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  226. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  227. }
  228. const NoDocument& NoDocument::default_instance() {
  229. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  230. return *internal_default_instance();
  231. }
  232. NoDocument* NoDocument::New(::google::protobuf::Arena* arena) const {
  233. NoDocument* n = new NoDocument;
  234. if (arena != NULL) {
  235. arena->Own(n);
  236. }
  237. return n;
  238. }
  239. void NoDocument::Clear() {
  240. // @@protoc_insertion_point(message_clear_start:firestore.client.NoDocument)
  241. ::google::protobuf::uint32 cached_has_bits = 0;
  242. // Prevent compiler warnings about cached_has_bits being unused
  243. (void) cached_has_bits;
  244. name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  245. if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
  246. delete read_time_;
  247. }
  248. read_time_ = NULL;
  249. _internal_metadata_.Clear();
  250. }
  251. bool NoDocument::MergePartialFromCodedStream(
  252. ::google::protobuf::io::CodedInputStream* input) {
  253. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  254. ::google::protobuf::uint32 tag;
  255. // @@protoc_insertion_point(parse_start:firestore.client.NoDocument)
  256. for (;;) {
  257. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  258. tag = p.first;
  259. if (!p.second) goto handle_unusual;
  260. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  261. // string name = 1;
  262. case 1: {
  263. if (static_cast< ::google::protobuf::uint8>(tag) ==
  264. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  265. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  266. input, this->mutable_name()));
  267. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  268. this->name().data(), static_cast<int>(this->name().length()),
  269. ::google::protobuf::internal::WireFormatLite::PARSE,
  270. "firestore.client.NoDocument.name"));
  271. } else {
  272. goto handle_unusual;
  273. }
  274. break;
  275. }
  276. // .google.protobuf.Timestamp read_time = 2;
  277. case 2: {
  278. if (static_cast< ::google::protobuf::uint8>(tag) ==
  279. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  280. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  281. input, mutable_read_time()));
  282. } else {
  283. goto handle_unusual;
  284. }
  285. break;
  286. }
  287. default: {
  288. handle_unusual:
  289. if (tag == 0) {
  290. goto success;
  291. }
  292. DO_(::google::protobuf::internal::WireFormat::SkipField(
  293. input, tag, _internal_metadata_.mutable_unknown_fields()));
  294. break;
  295. }
  296. }
  297. }
  298. success:
  299. // @@protoc_insertion_point(parse_success:firestore.client.NoDocument)
  300. return true;
  301. failure:
  302. // @@protoc_insertion_point(parse_failure:firestore.client.NoDocument)
  303. return false;
  304. #undef DO_
  305. }
  306. void NoDocument::SerializeWithCachedSizes(
  307. ::google::protobuf::io::CodedOutputStream* output) const {
  308. // @@protoc_insertion_point(serialize_start:firestore.client.NoDocument)
  309. ::google::protobuf::uint32 cached_has_bits = 0;
  310. (void) cached_has_bits;
  311. // string name = 1;
  312. if (this->name().size() > 0) {
  313. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  314. this->name().data(), static_cast<int>(this->name().length()),
  315. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  316. "firestore.client.NoDocument.name");
  317. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  318. 1, this->name(), output);
  319. }
  320. // .google.protobuf.Timestamp read_time = 2;
  321. if (this->has_read_time()) {
  322. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  323. 2, *this->read_time_, output);
  324. }
  325. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  326. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  327. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  328. }
  329. // @@protoc_insertion_point(serialize_end:firestore.client.NoDocument)
  330. }
  331. ::google::protobuf::uint8* NoDocument::InternalSerializeWithCachedSizesToArray(
  332. bool deterministic, ::google::protobuf::uint8* target) const {
  333. (void)deterministic; // Unused
  334. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.NoDocument)
  335. ::google::protobuf::uint32 cached_has_bits = 0;
  336. (void) cached_has_bits;
  337. // string name = 1;
  338. if (this->name().size() > 0) {
  339. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  340. this->name().data(), static_cast<int>(this->name().length()),
  341. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  342. "firestore.client.NoDocument.name");
  343. target =
  344. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  345. 1, this->name(), target);
  346. }
  347. // .google.protobuf.Timestamp read_time = 2;
  348. if (this->has_read_time()) {
  349. target = ::google::protobuf::internal::WireFormatLite::
  350. InternalWriteMessageToArray(
  351. 2, *this->read_time_, deterministic, target);
  352. }
  353. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  354. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  355. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  356. }
  357. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.NoDocument)
  358. return target;
  359. }
  360. size_t NoDocument::ByteSizeLong() const {
  361. // @@protoc_insertion_point(message_byte_size_start:firestore.client.NoDocument)
  362. size_t total_size = 0;
  363. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  364. total_size +=
  365. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  366. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  367. }
  368. // string name = 1;
  369. if (this->name().size() > 0) {
  370. total_size += 1 +
  371. ::google::protobuf::internal::WireFormatLite::StringSize(
  372. this->name());
  373. }
  374. // .google.protobuf.Timestamp read_time = 2;
  375. if (this->has_read_time()) {
  376. total_size += 1 +
  377. ::google::protobuf::internal::WireFormatLite::MessageSize(
  378. *this->read_time_);
  379. }
  380. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  381. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  382. _cached_size_ = cached_size;
  383. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  384. return total_size;
  385. }
  386. void NoDocument::MergeFrom(const ::google::protobuf::Message& from) {
  387. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.NoDocument)
  388. GOOGLE_DCHECK_NE(&from, this);
  389. const NoDocument* source =
  390. ::google::protobuf::internal::DynamicCastToGenerated<const NoDocument>(
  391. &from);
  392. if (source == NULL) {
  393. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.NoDocument)
  394. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  395. } else {
  396. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.NoDocument)
  397. MergeFrom(*source);
  398. }
  399. }
  400. void NoDocument::MergeFrom(const NoDocument& from) {
  401. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.NoDocument)
  402. GOOGLE_DCHECK_NE(&from, this);
  403. _internal_metadata_.MergeFrom(from._internal_metadata_);
  404. ::google::protobuf::uint32 cached_has_bits = 0;
  405. (void) cached_has_bits;
  406. if (from.name().size() > 0) {
  407. name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  408. }
  409. if (from.has_read_time()) {
  410. mutable_read_time()->::google::protobuf::Timestamp::MergeFrom(from.read_time());
  411. }
  412. }
  413. void NoDocument::CopyFrom(const ::google::protobuf::Message& from) {
  414. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.NoDocument)
  415. if (&from == this) return;
  416. Clear();
  417. MergeFrom(from);
  418. }
  419. void NoDocument::CopyFrom(const NoDocument& from) {
  420. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.NoDocument)
  421. if (&from == this) return;
  422. Clear();
  423. MergeFrom(from);
  424. }
  425. bool NoDocument::IsInitialized() const {
  426. return true;
  427. }
  428. void NoDocument::Swap(NoDocument* other) {
  429. if (other == this) return;
  430. InternalSwap(other);
  431. }
  432. void NoDocument::InternalSwap(NoDocument* other) {
  433. using std::swap;
  434. name_.Swap(&other->name_);
  435. swap(read_time_, other->read_time_);
  436. _internal_metadata_.Swap(&other->_internal_metadata_);
  437. swap(_cached_size_, other->_cached_size_);
  438. }
  439. ::google::protobuf::Metadata NoDocument::GetMetadata() const {
  440. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  441. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
  442. }
  443. // ===================================================================
  444. void MaybeDocument::InitAsDefaultInstance() {
  445. ::firestore::client::_MaybeDocument_default_instance_.no_document_ = const_cast< ::firestore::client::NoDocument*>(
  446. ::firestore::client::NoDocument::internal_default_instance());
  447. ::firestore::client::_MaybeDocument_default_instance_.document_ = const_cast< ::google::firestore::v1beta1::Document*>(
  448. ::google::firestore::v1beta1::Document::internal_default_instance());
  449. }
  450. void MaybeDocument::set_allocated_no_document(::firestore::client::NoDocument* no_document) {
  451. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  452. clear_document_type();
  453. if (no_document) {
  454. ::google::protobuf::Arena* submessage_arena = NULL;
  455. if (message_arena != submessage_arena) {
  456. no_document = ::google::protobuf::internal::GetOwnedMessage(
  457. message_arena, no_document, submessage_arena);
  458. }
  459. set_has_no_document();
  460. document_type_.no_document_ = no_document;
  461. }
  462. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.no_document)
  463. }
  464. void MaybeDocument::set_allocated_document(::google::firestore::v1beta1::Document* document) {
  465. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  466. clear_document_type();
  467. if (document) {
  468. ::google::protobuf::Arena* submessage_arena = NULL;
  469. if (message_arena != submessage_arena) {
  470. document = ::google::protobuf::internal::GetOwnedMessage(
  471. message_arena, document, submessage_arena);
  472. }
  473. set_has_document();
  474. document_type_.document_ = document;
  475. }
  476. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.document)
  477. }
  478. void MaybeDocument::clear_document() {
  479. if (has_document()) {
  480. delete document_type_.document_;
  481. clear_has_document_type();
  482. }
  483. }
  484. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  485. const int MaybeDocument::kNoDocumentFieldNumber;
  486. const int MaybeDocument::kDocumentFieldNumber;
  487. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  488. MaybeDocument::MaybeDocument()
  489. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  490. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  491. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
  492. }
  493. SharedCtor();
  494. // @@protoc_insertion_point(constructor:firestore.client.MaybeDocument)
  495. }
  496. MaybeDocument::MaybeDocument(const MaybeDocument& from)
  497. : ::google::protobuf::Message(),
  498. _internal_metadata_(NULL),
  499. _cached_size_(0) {
  500. _internal_metadata_.MergeFrom(from._internal_metadata_);
  501. clear_has_document_type();
  502. switch (from.document_type_case()) {
  503. case kNoDocument: {
  504. mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
  505. break;
  506. }
  507. case kDocument: {
  508. mutable_document()->::google::firestore::v1beta1::Document::MergeFrom(from.document());
  509. break;
  510. }
  511. case DOCUMENT_TYPE_NOT_SET: {
  512. break;
  513. }
  514. }
  515. // @@protoc_insertion_point(copy_constructor:firestore.client.MaybeDocument)
  516. }
  517. void MaybeDocument::SharedCtor() {
  518. clear_has_document_type();
  519. _cached_size_ = 0;
  520. }
  521. MaybeDocument::~MaybeDocument() {
  522. // @@protoc_insertion_point(destructor:firestore.client.MaybeDocument)
  523. SharedDtor();
  524. }
  525. void MaybeDocument::SharedDtor() {
  526. if (has_document_type()) {
  527. clear_document_type();
  528. }
  529. }
  530. void MaybeDocument::SetCachedSize(int size) const {
  531. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  532. _cached_size_ = size;
  533. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  534. }
  535. const ::google::protobuf::Descriptor* MaybeDocument::descriptor() {
  536. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  537. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  538. }
  539. const MaybeDocument& MaybeDocument::default_instance() {
  540. ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
  541. return *internal_default_instance();
  542. }
  543. MaybeDocument* MaybeDocument::New(::google::protobuf::Arena* arena) const {
  544. MaybeDocument* n = new MaybeDocument;
  545. if (arena != NULL) {
  546. arena->Own(n);
  547. }
  548. return n;
  549. }
  550. void MaybeDocument::clear_document_type() {
  551. // @@protoc_insertion_point(one_of_clear_start:firestore.client.MaybeDocument)
  552. switch (document_type_case()) {
  553. case kNoDocument: {
  554. delete document_type_.no_document_;
  555. break;
  556. }
  557. case kDocument: {
  558. delete document_type_.document_;
  559. break;
  560. }
  561. case DOCUMENT_TYPE_NOT_SET: {
  562. break;
  563. }
  564. }
  565. _oneof_case_[0] = DOCUMENT_TYPE_NOT_SET;
  566. }
  567. void MaybeDocument::Clear() {
  568. // @@protoc_insertion_point(message_clear_start:firestore.client.MaybeDocument)
  569. ::google::protobuf::uint32 cached_has_bits = 0;
  570. // Prevent compiler warnings about cached_has_bits being unused
  571. (void) cached_has_bits;
  572. clear_document_type();
  573. _internal_metadata_.Clear();
  574. }
  575. bool MaybeDocument::MergePartialFromCodedStream(
  576. ::google::protobuf::io::CodedInputStream* input) {
  577. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  578. ::google::protobuf::uint32 tag;
  579. // @@protoc_insertion_point(parse_start:firestore.client.MaybeDocument)
  580. for (;;) {
  581. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  582. tag = p.first;
  583. if (!p.second) goto handle_unusual;
  584. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  585. // .firestore.client.NoDocument no_document = 1;
  586. case 1: {
  587. if (static_cast< ::google::protobuf::uint8>(tag) ==
  588. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  589. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  590. input, mutable_no_document()));
  591. } else {
  592. goto handle_unusual;
  593. }
  594. break;
  595. }
  596. // .google.firestore.v1beta1.Document document = 2;
  597. case 2: {
  598. if (static_cast< ::google::protobuf::uint8>(tag) ==
  599. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  600. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  601. input, mutable_document()));
  602. } else {
  603. goto handle_unusual;
  604. }
  605. break;
  606. }
  607. default: {
  608. handle_unusual:
  609. if (tag == 0) {
  610. goto success;
  611. }
  612. DO_(::google::protobuf::internal::WireFormat::SkipField(
  613. input, tag, _internal_metadata_.mutable_unknown_fields()));
  614. break;
  615. }
  616. }
  617. }
  618. success:
  619. // @@protoc_insertion_point(parse_success:firestore.client.MaybeDocument)
  620. return true;
  621. failure:
  622. // @@protoc_insertion_point(parse_failure:firestore.client.MaybeDocument)
  623. return false;
  624. #undef DO_
  625. }
  626. void MaybeDocument::SerializeWithCachedSizes(
  627. ::google::protobuf::io::CodedOutputStream* output) const {
  628. // @@protoc_insertion_point(serialize_start:firestore.client.MaybeDocument)
  629. ::google::protobuf::uint32 cached_has_bits = 0;
  630. (void) cached_has_bits;
  631. // .firestore.client.NoDocument no_document = 1;
  632. if (has_no_document()) {
  633. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  634. 1, *document_type_.no_document_, output);
  635. }
  636. // .google.firestore.v1beta1.Document document = 2;
  637. if (has_document()) {
  638. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  639. 2, *document_type_.document_, output);
  640. }
  641. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  642. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  643. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  644. }
  645. // @@protoc_insertion_point(serialize_end:firestore.client.MaybeDocument)
  646. }
  647. ::google::protobuf::uint8* MaybeDocument::InternalSerializeWithCachedSizesToArray(
  648. bool deterministic, ::google::protobuf::uint8* target) const {
  649. (void)deterministic; // Unused
  650. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.MaybeDocument)
  651. ::google::protobuf::uint32 cached_has_bits = 0;
  652. (void) cached_has_bits;
  653. // .firestore.client.NoDocument no_document = 1;
  654. if (has_no_document()) {
  655. target = ::google::protobuf::internal::WireFormatLite::
  656. InternalWriteMessageToArray(
  657. 1, *document_type_.no_document_, deterministic, target);
  658. }
  659. // .google.firestore.v1beta1.Document document = 2;
  660. if (has_document()) {
  661. target = ::google::protobuf::internal::WireFormatLite::
  662. InternalWriteMessageToArray(
  663. 2, *document_type_.document_, deterministic, target);
  664. }
  665. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  666. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  667. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  668. }
  669. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.MaybeDocument)
  670. return target;
  671. }
  672. size_t MaybeDocument::ByteSizeLong() const {
  673. // @@protoc_insertion_point(message_byte_size_start:firestore.client.MaybeDocument)
  674. size_t total_size = 0;
  675. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  676. total_size +=
  677. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  678. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  679. }
  680. switch (document_type_case()) {
  681. // .firestore.client.NoDocument no_document = 1;
  682. case kNoDocument: {
  683. total_size += 1 +
  684. ::google::protobuf::internal::WireFormatLite::MessageSize(
  685. *document_type_.no_document_);
  686. break;
  687. }
  688. // .google.firestore.v1beta1.Document document = 2;
  689. case kDocument: {
  690. total_size += 1 +
  691. ::google::protobuf::internal::WireFormatLite::MessageSize(
  692. *document_type_.document_);
  693. break;
  694. }
  695. case DOCUMENT_TYPE_NOT_SET: {
  696. break;
  697. }
  698. }
  699. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  700. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  701. _cached_size_ = cached_size;
  702. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  703. return total_size;
  704. }
  705. void MaybeDocument::MergeFrom(const ::google::protobuf::Message& from) {
  706. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.MaybeDocument)
  707. GOOGLE_DCHECK_NE(&from, this);
  708. const MaybeDocument* source =
  709. ::google::protobuf::internal::DynamicCastToGenerated<const MaybeDocument>(
  710. &from);
  711. if (source == NULL) {
  712. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.MaybeDocument)
  713. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  714. } else {
  715. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.MaybeDocument)
  716. MergeFrom(*source);
  717. }
  718. }
  719. void MaybeDocument::MergeFrom(const MaybeDocument& from) {
  720. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.MaybeDocument)
  721. GOOGLE_DCHECK_NE(&from, this);
  722. _internal_metadata_.MergeFrom(from._internal_metadata_);
  723. ::google::protobuf::uint32 cached_has_bits = 0;
  724. (void) cached_has_bits;
  725. switch (from.document_type_case()) {
  726. case kNoDocument: {
  727. mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
  728. break;
  729. }
  730. case kDocument: {
  731. mutable_document()->::google::firestore::v1beta1::Document::MergeFrom(from.document());
  732. break;
  733. }
  734. case DOCUMENT_TYPE_NOT_SET: {
  735. break;
  736. }
  737. }
  738. }
  739. void MaybeDocument::CopyFrom(const ::google::protobuf::Message& from) {
  740. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.MaybeDocument)
  741. if (&from == this) return;
  742. Clear();
  743. MergeFrom(from);
  744. }
  745. void MaybeDocument::CopyFrom(const MaybeDocument& from) {
  746. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.MaybeDocument)
  747. if (&from == this) return;
  748. Clear();
  749. MergeFrom(from);
  750. }
  751. bool MaybeDocument::IsInitialized() const {
  752. return true;
  753. }
  754. void MaybeDocument::Swap(MaybeDocument* other) {
  755. if (other == this) return;
  756. InternalSwap(other);
  757. }
  758. void MaybeDocument::InternalSwap(MaybeDocument* other) {
  759. using std::swap;
  760. swap(document_type_, other->document_type_);
  761. swap(_oneof_case_[0], other->_oneof_case_[0]);
  762. _internal_metadata_.Swap(&other->_internal_metadata_);
  763. swap(_cached_size_, other->_cached_size_);
  764. }
  765. ::google::protobuf::Metadata MaybeDocument::GetMetadata() const {
  766. protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  767. return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
  768. }
  769. // @@protoc_insertion_point(namespace_scope)
  770. } // namespace client
  771. } // namespace firestore
  772. // @@protoc_insertion_point(global_scope)