aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc
diff options
context:
space:
mode:
authorGravatar rsgowman <rgowman@google.com>2018-04-24 11:31:58 -0400
committerGravatar GitHub <noreply@github.com>2018-04-24 11:31:58 -0400
commit6dfc142888410ef6906970d8cb90f69c0992852a (patch)
tree72b1287cc6143f1d005d03cb710c60a9f3414fd8 /Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc
parenta04e782db87b86bacc6a232fae38dcd8d203f5b6 (diff)
Adjust serializer test to verify via libprotobuf. (#1039)
Previously, the tests would compare serialization results against a precomputed (via protoc) array of bytes. Now they serialize via our nanopb based class and deserialize via libprotobuf (and vice versa) and then ensure the result is the same as the input
Diffstat (limited to 'Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc')
-rw-r--r--Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc862
1 files changed, 862 insertions, 0 deletions
diff --git a/Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc b/Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc
new file mode 100644
index 0000000..04f2b26
--- /dev/null
+++ b/Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc
@@ -0,0 +1,862 @@
+/*
+ * Copyright 2018 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: firestore/local/maybe_document.proto
+
+#include "firestore/local/maybe_document.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/wire_format.h>
+// This is a temporary google only hack
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+#include "third_party/protobuf/version.h"
+#endif
+// @@protoc_insertion_point(includes)
+namespace firestore {
+namespace client {
+class NoDocumentDefaultTypeInternal {
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<NoDocument>
+ _instance;
+} _NoDocument_default_instance_;
+class MaybeDocumentDefaultTypeInternal {
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<MaybeDocument>
+ _instance;
+ const ::firestore::client::NoDocument* no_document_;
+ const ::google::firestore::v1beta1::Document* document_;
+} _MaybeDocument_default_instance_;
+} // namespace client
+} // namespace firestore
+namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto {
+void InitDefaultsNoDocumentImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+ ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
+#else
+ ::google::protobuf::internal::InitProtobufDefaults();
+#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+ protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
+ {
+ void* ptr = &::firestore::client::_NoDocument_default_instance_;
+ new (ptr) ::firestore::client::NoDocument();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::firestore::client::NoDocument::InitAsDefaultInstance();
+}
+
+void InitDefaultsNoDocument() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNoDocumentImpl);
+}
+
+void InitDefaultsMaybeDocumentImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+ ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
+#else
+ ::google::protobuf::internal::InitProtobufDefaults();
+#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+ protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
+ protobuf_google_2ffirestore_2fv1beta1_2fdocument_2eproto::InitDefaultsDocument();
+ {
+ void* ptr = &::firestore::client::_MaybeDocument_default_instance_;
+ new (ptr) ::firestore::client::MaybeDocument();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::firestore::client::MaybeDocument::InitAsDefaultInstance();
+}
+
+void InitDefaultsMaybeDocument() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMaybeDocumentImpl);
+}
+
+::google::protobuf::Metadata file_level_metadata[2];
+
+const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+ ~0u, // no _has_bits_
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, _internal_metadata_),
+ ~0u, // no _extensions_
+ ~0u, // no _oneof_case_
+ ~0u, // no _weak_field_map_
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, name_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, read_time_),
+ ~0u, // no _has_bits_
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _internal_metadata_),
+ ~0u, // no _extensions_
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _oneof_case_[0]),
+ ~0u, // no _weak_field_map_
+ offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, no_document_),
+ offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, document_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, document_type_),
+};
+static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+ { 0, -1, sizeof(::firestore::client::NoDocument)},
+ { 7, -1, sizeof(::firestore::client::MaybeDocument)},
+};
+
+static ::google::protobuf::Message const * const file_default_instances[] = {
+ reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_NoDocument_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_MaybeDocument_default_instance_),
+};
+
+void protobuf_AssignDescriptors() {
+ AddDescriptors();
+ ::google::protobuf::MessageFactory* factory = NULL;
+ AssignDescriptors(
+ "firestore/local/maybe_document.proto", schemas, file_default_instances, TableStruct::offsets, factory,
+ file_level_metadata, NULL, NULL);
+}
+
+void protobuf_AssignDescriptorsOnce() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
+}
+
+void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
+void protobuf_RegisterTypes(const ::std::string&) {
+ protobuf_AssignDescriptorsOnce();
+ ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
+}
+
+void AddDescriptorsImpl() {
+ InitDefaults();
+ static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+ "\n$firestore/local/maybe_document.proto\022\020"
+ "firestore.client\032\'google/firestore/v1bet"
+ "a1/document.proto\032\037google/protobuf/times"
+ "tamp.proto\"I\n\nNoDocument\022\014\n\004name\030\001 \001(\t\022-"
+ "\n\tread_time\030\002 \001(\0132\032.google.protobuf.Time"
+ "stamp\"\215\001\n\rMaybeDocument\0223\n\013no_document\030\001"
+ " \001(\0132\034.firestore.client.NoDocumentH\000\0226\n\010"
+ "document\030\002 \001(\0132\".google.firestore.v1beta"
+ "1.DocumentH\000B\017\n\rdocument_typeB/\n#com.goo"
+ "gle.firebase.firestore.protoP\001\242\002\005FSTPBb\006"
+ "proto3"
+ };
+ ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
+ descriptor, 406);
+ ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
+ "firestore/local/maybe_document.proto", &protobuf_RegisterTypes);
+ ::protobuf_google_2ffirestore_2fv1beta1_2fdocument_2eproto::AddDescriptors();
+ ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::AddDescriptors();
+}
+
+void AddDescriptors() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
+}
+// Force AddDescriptors() to be called at dynamic initialization time.
+struct StaticDescriptorInitializer {
+ StaticDescriptorInitializer() {
+ AddDescriptors();
+ }
+} static_descriptor_initializer;
+} // namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto
+namespace firestore {
+namespace client {
+
+// ===================================================================
+
+void NoDocument::InitAsDefaultInstance() {
+ ::firestore::client::_NoDocument_default_instance_._instance.get_mutable()->read_time_ = const_cast< ::google::protobuf::Timestamp*>(
+ ::google::protobuf::Timestamp::internal_default_instance());
+}
+void NoDocument::clear_read_time() {
+ if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
+ delete read_time_;
+ }
+ read_time_ = NULL;
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int NoDocument::kNameFieldNumber;
+const int NoDocument::kReadTimeFieldNumber;
+#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+NoDocument::NoDocument()
+ : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+ if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+ ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
+ }
+ SharedCtor();
+ // @@protoc_insertion_point(constructor:firestore.client.NoDocument)
+}
+NoDocument::NoDocument(const NoDocument& from)
+ : ::google::protobuf::Message(),
+ _internal_metadata_(NULL),
+ _cached_size_(0) {
+ _internal_metadata_.MergeFrom(from._internal_metadata_);
+ name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ if (from.name().size() > 0) {
+ name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ }
+ if (from.has_read_time()) {
+ read_time_ = new ::google::protobuf::Timestamp(*from.read_time_);
+ } else {
+ read_time_ = NULL;
+ }
+ // @@protoc_insertion_point(copy_constructor:firestore.client.NoDocument)
+}
+
+void NoDocument::SharedCtor() {
+ name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ read_time_ = NULL;
+ _cached_size_ = 0;
+}
+
+NoDocument::~NoDocument() {
+ // @@protoc_insertion_point(destructor:firestore.client.NoDocument)
+ SharedDtor();
+}
+
+void NoDocument::SharedDtor() {
+ name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ if (this != internal_default_instance()) delete read_time_;
+}
+
+void NoDocument::SetCachedSize(int size) const {
+ GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+ _cached_size_ = size;
+ GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* NoDocument::descriptor() {
+ ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const NoDocument& NoDocument::default_instance() {
+ ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
+ return *internal_default_instance();
+}
+
+NoDocument* NoDocument::New(::google::protobuf::Arena* arena) const {
+ NoDocument* n = new NoDocument;
+ if (arena != NULL) {
+ arena->Own(n);
+ }
+ return n;
+}
+
+void NoDocument::Clear() {
+// @@protoc_insertion_point(message_clear_start:firestore.client.NoDocument)
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ // Prevent compiler warnings about cached_has_bits being unused
+ (void) cached_has_bits;
+
+ name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
+ delete read_time_;
+ }
+ read_time_ = NULL;
+ _internal_metadata_.Clear();
+}
+
+bool NoDocument::MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
+ ::google::protobuf::uint32 tag;
+ // @@protoc_insertion_point(parse_start:firestore.client.NoDocument)
+ for (;;) {
+ ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+ tag = p.first;
+ if (!p.second) goto handle_unusual;
+ switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+ // string name = 1;
+ case 1: {
+ if (static_cast< ::google::protobuf::uint8>(tag) ==
+ static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
+ DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ input, this->mutable_name()));
+ DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ this->name().data(), static_cast<int>(this->name().length()),
+ ::google::protobuf::internal::WireFormatLite::PARSE,
+ "firestore.client.NoDocument.name"));
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
+ // .google.protobuf.Timestamp read_time = 2;
+ case 2: {
+ if (static_cast< ::google::protobuf::uint8>(tag) ==
+ static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
+ DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ input, mutable_read_time()));
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
+ default: {
+ handle_unusual:
+ if (tag == 0) {
+ goto success;
+ }
+ DO_(::google::protobuf::internal::WireFormat::SkipField(
+ input, tag, _internal_metadata_.mutable_unknown_fields()));
+ break;
+ }
+ }
+ }
+success:
+ // @@protoc_insertion_point(parse_success:firestore.client.NoDocument)
+ return true;
+failure:
+ // @@protoc_insertion_point(parse_failure:firestore.client.NoDocument)
+ return false;
+#undef DO_
+}
+
+void NoDocument::SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const {
+ // @@protoc_insertion_point(serialize_start:firestore.client.NoDocument)
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ (void) cached_has_bits;
+
+ // string name = 1;
+ if (this->name().size() > 0) {
+ ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ this->name().data(), static_cast<int>(this->name().length()),
+ ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ "firestore.client.NoDocument.name");
+ ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ 1, this->name(), output);
+ }
+
+ // .google.protobuf.Timestamp read_time = 2;
+ if (this->has_read_time()) {
+ ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ 2, *this->read_time_, output);
+ }
+
+ if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
+ ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+ (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
+ }
+ // @@protoc_insertion_point(serialize_end:firestore.client.NoDocument)
+}
+
+::google::protobuf::uint8* NoDocument::InternalSerializeWithCachedSizesToArray(
+ bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
+ // @@protoc_insertion_point(serialize_to_array_start:firestore.client.NoDocument)
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ (void) cached_has_bits;
+
+ // string name = 1;
+ if (this->name().size() > 0) {
+ ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ this->name().data(), static_cast<int>(this->name().length()),
+ ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ "firestore.client.NoDocument.name");
+ target =
+ ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ 1, this->name(), target);
+ }
+
+ // .google.protobuf.Timestamp read_time = 2;
+ if (this->has_read_time()) {
+ target = ::google::protobuf::internal::WireFormatLite::
+ InternalWriteMessageToArray(
+ 2, *this->read_time_, deterministic, target);
+ }
+
+ if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
+ target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+ (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
+ }
+ // @@protoc_insertion_point(serialize_to_array_end:firestore.client.NoDocument)
+ return target;
+}
+
+size_t NoDocument::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:firestore.client.NoDocument)
+ size_t total_size = 0;
+
+ if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
+ total_size +=
+ ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+ (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
+ }
+ // string name = 1;
+ if (this->name().size() > 0) {
+ total_size += 1 +
+ ::google::protobuf::internal::WireFormatLite::StringSize(
+ this->name());
+ }
+
+ // .google.protobuf.Timestamp read_time = 2;
+ if (this->has_read_time()) {
+ total_size += 1 +
+ ::google::protobuf::internal::WireFormatLite::MessageSize(
+ *this->read_time_);
+ }
+
+ int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+ GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+ _cached_size_ = cached_size;
+ GOOGLE_SAFE_CONCURRENT_WRITES_END();
+ return total_size;
+}
+
+void NoDocument::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:firestore.client.NoDocument)
+ GOOGLE_DCHECK_NE(&from, this);
+ const NoDocument* source =
+ ::google::protobuf::internal::DynamicCastToGenerated<const NoDocument>(
+ &from);
+ if (source == NULL) {
+ // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.NoDocument)
+ ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+ } else {
+ // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.NoDocument)
+ MergeFrom(*source);
+ }
+}
+
+void NoDocument::MergeFrom(const NoDocument& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.NoDocument)
+ GOOGLE_DCHECK_NE(&from, this);
+ _internal_metadata_.MergeFrom(from._internal_metadata_);
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ (void) cached_has_bits;
+
+ if (from.name().size() > 0) {
+
+ name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ }
+ if (from.has_read_time()) {
+ mutable_read_time()->::google::protobuf::Timestamp::MergeFrom(from.read_time());
+ }
+}
+
+void NoDocument::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:firestore.client.NoDocument)
+ if (&from == this) return;
+ Clear();
+ MergeFrom(from);
+}
+
+void NoDocument::CopyFrom(const NoDocument& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.NoDocument)
+ if (&from == this) return;
+ Clear();
+ MergeFrom(from);
+}
+
+bool NoDocument::IsInitialized() const {
+ return true;
+}
+
+void NoDocument::Swap(NoDocument* other) {
+ if (other == this) return;
+ InternalSwap(other);
+}
+void NoDocument::InternalSwap(NoDocument* other) {
+ using std::swap;
+ name_.Swap(&other->name_);
+ swap(read_time_, other->read_time_);
+ _internal_metadata_.Swap(&other->_internal_metadata_);
+ swap(_cached_size_, other->_cached_size_);
+}
+
+::google::protobuf::Metadata NoDocument::GetMetadata() const {
+ protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
+// ===================================================================
+
+void MaybeDocument::InitAsDefaultInstance() {
+ ::firestore::client::_MaybeDocument_default_instance_.no_document_ = const_cast< ::firestore::client::NoDocument*>(
+ ::firestore::client::NoDocument::internal_default_instance());
+ ::firestore::client::_MaybeDocument_default_instance_.document_ = const_cast< ::google::firestore::v1beta1::Document*>(
+ ::google::firestore::v1beta1::Document::internal_default_instance());
+}
+void MaybeDocument::set_allocated_no_document(::firestore::client::NoDocument* no_document) {
+ ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+ clear_document_type();
+ if (no_document) {
+ ::google::protobuf::Arena* submessage_arena = NULL;
+ if (message_arena != submessage_arena) {
+ no_document = ::google::protobuf::internal::GetOwnedMessage(
+ message_arena, no_document, submessage_arena);
+ }
+ set_has_no_document();
+ document_type_.no_document_ = no_document;
+ }
+ // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.no_document)
+}
+void MaybeDocument::set_allocated_document(::google::firestore::v1beta1::Document* document) {
+ ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+ clear_document_type();
+ if (document) {
+ ::google::protobuf::Arena* submessage_arena = NULL;
+ if (message_arena != submessage_arena) {
+ document = ::google::protobuf::internal::GetOwnedMessage(
+ message_arena, document, submessage_arena);
+ }
+ set_has_document();
+ document_type_.document_ = document;
+ }
+ // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.document)
+}
+void MaybeDocument::clear_document() {
+ if (has_document()) {
+ delete document_type_.document_;
+ clear_has_document_type();
+ }
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int MaybeDocument::kNoDocumentFieldNumber;
+const int MaybeDocument::kDocumentFieldNumber;
+#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+MaybeDocument::MaybeDocument()
+ : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+ if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+ ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
+ }
+ SharedCtor();
+ // @@protoc_insertion_point(constructor:firestore.client.MaybeDocument)
+}
+MaybeDocument::MaybeDocument(const MaybeDocument& from)
+ : ::google::protobuf::Message(),
+ _internal_metadata_(NULL),
+ _cached_size_(0) {
+ _internal_metadata_.MergeFrom(from._internal_metadata_);
+ clear_has_document_type();
+ switch (from.document_type_case()) {
+ case kNoDocument: {
+ mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
+ break;
+ }
+ case kDocument: {
+ mutable_document()->::google::firestore::v1beta1::Document::MergeFrom(from.document());
+ break;
+ }
+ case DOCUMENT_TYPE_NOT_SET: {
+ break;
+ }
+ }
+ // @@protoc_insertion_point(copy_constructor:firestore.client.MaybeDocument)
+}
+
+void MaybeDocument::SharedCtor() {
+ clear_has_document_type();
+ _cached_size_ = 0;
+}
+
+MaybeDocument::~MaybeDocument() {
+ // @@protoc_insertion_point(destructor:firestore.client.MaybeDocument)
+ SharedDtor();
+}
+
+void MaybeDocument::SharedDtor() {
+ if (has_document_type()) {
+ clear_document_type();
+ }
+}
+
+void MaybeDocument::SetCachedSize(int size) const {
+ GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+ _cached_size_ = size;
+ GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* MaybeDocument::descriptor() {
+ ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const MaybeDocument& MaybeDocument::default_instance() {
+ ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
+ return *internal_default_instance();
+}
+
+MaybeDocument* MaybeDocument::New(::google::protobuf::Arena* arena) const {
+ MaybeDocument* n = new MaybeDocument;
+ if (arena != NULL) {
+ arena->Own(n);
+ }
+ return n;
+}
+
+void MaybeDocument::clear_document_type() {
+// @@protoc_insertion_point(one_of_clear_start:firestore.client.MaybeDocument)
+ switch (document_type_case()) {
+ case kNoDocument: {
+ delete document_type_.no_document_;
+ break;
+ }
+ case kDocument: {
+ delete document_type_.document_;
+ break;
+ }
+ case DOCUMENT_TYPE_NOT_SET: {
+ break;
+ }
+ }
+ _oneof_case_[0] = DOCUMENT_TYPE_NOT_SET;
+}
+
+
+void MaybeDocument::Clear() {
+// @@protoc_insertion_point(message_clear_start:firestore.client.MaybeDocument)
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ // Prevent compiler warnings about cached_has_bits being unused
+ (void) cached_has_bits;
+
+ clear_document_type();
+ _internal_metadata_.Clear();
+}
+
+bool MaybeDocument::MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
+ ::google::protobuf::uint32 tag;
+ // @@protoc_insertion_point(parse_start:firestore.client.MaybeDocument)
+ for (;;) {
+ ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+ tag = p.first;
+ if (!p.second) goto handle_unusual;
+ switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+ // .firestore.client.NoDocument no_document = 1;
+ case 1: {
+ if (static_cast< ::google::protobuf::uint8>(tag) ==
+ static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
+ DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ input, mutable_no_document()));
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
+ // .google.firestore.v1beta1.Document document = 2;
+ case 2: {
+ if (static_cast< ::google::protobuf::uint8>(tag) ==
+ static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
+ DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ input, mutable_document()));
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
+ default: {
+ handle_unusual:
+ if (tag == 0) {
+ goto success;
+ }
+ DO_(::google::protobuf::internal::WireFormat::SkipField(
+ input, tag, _internal_metadata_.mutable_unknown_fields()));
+ break;
+ }
+ }
+ }
+success:
+ // @@protoc_insertion_point(parse_success:firestore.client.MaybeDocument)
+ return true;
+failure:
+ // @@protoc_insertion_point(parse_failure:firestore.client.MaybeDocument)
+ return false;
+#undef DO_
+}
+
+void MaybeDocument::SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const {
+ // @@protoc_insertion_point(serialize_start:firestore.client.MaybeDocument)
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ (void) cached_has_bits;
+
+ // .firestore.client.NoDocument no_document = 1;
+ if (has_no_document()) {
+ ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ 1, *document_type_.no_document_, output);
+ }
+
+ // .google.firestore.v1beta1.Document document = 2;
+ if (has_document()) {
+ ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ 2, *document_type_.document_, output);
+ }
+
+ if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
+ ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+ (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
+ }
+ // @@protoc_insertion_point(serialize_end:firestore.client.MaybeDocument)
+}
+
+::google::protobuf::uint8* MaybeDocument::InternalSerializeWithCachedSizesToArray(
+ bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
+ // @@protoc_insertion_point(serialize_to_array_start:firestore.client.MaybeDocument)
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ (void) cached_has_bits;
+
+ // .firestore.client.NoDocument no_document = 1;
+ if (has_no_document()) {
+ target = ::google::protobuf::internal::WireFormatLite::
+ InternalWriteMessageToArray(
+ 1, *document_type_.no_document_, deterministic, target);
+ }
+
+ // .google.firestore.v1beta1.Document document = 2;
+ if (has_document()) {
+ target = ::google::protobuf::internal::WireFormatLite::
+ InternalWriteMessageToArray(
+ 2, *document_type_.document_, deterministic, target);
+ }
+
+ if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
+ target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+ (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
+ }
+ // @@protoc_insertion_point(serialize_to_array_end:firestore.client.MaybeDocument)
+ return target;
+}
+
+size_t MaybeDocument::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:firestore.client.MaybeDocument)
+ size_t total_size = 0;
+
+ if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
+ total_size +=
+ ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+ (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
+ }
+ switch (document_type_case()) {
+ // .firestore.client.NoDocument no_document = 1;
+ case kNoDocument: {
+ total_size += 1 +
+ ::google::protobuf::internal::WireFormatLite::MessageSize(
+ *document_type_.no_document_);
+ break;
+ }
+ // .google.firestore.v1beta1.Document document = 2;
+ case kDocument: {
+ total_size += 1 +
+ ::google::protobuf::internal::WireFormatLite::MessageSize(
+ *document_type_.document_);
+ break;
+ }
+ case DOCUMENT_TYPE_NOT_SET: {
+ break;
+ }
+ }
+ int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+ GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+ _cached_size_ = cached_size;
+ GOOGLE_SAFE_CONCURRENT_WRITES_END();
+ return total_size;
+}
+
+void MaybeDocument::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:firestore.client.MaybeDocument)
+ GOOGLE_DCHECK_NE(&from, this);
+ const MaybeDocument* source =
+ ::google::protobuf::internal::DynamicCastToGenerated<const MaybeDocument>(
+ &from);
+ if (source == NULL) {
+ // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.MaybeDocument)
+ ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+ } else {
+ // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.MaybeDocument)
+ MergeFrom(*source);
+ }
+}
+
+void MaybeDocument::MergeFrom(const MaybeDocument& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.MaybeDocument)
+ GOOGLE_DCHECK_NE(&from, this);
+ _internal_metadata_.MergeFrom(from._internal_metadata_);
+ ::google::protobuf::uint32 cached_has_bits = 0;
+ (void) cached_has_bits;
+
+ switch (from.document_type_case()) {
+ case kNoDocument: {
+ mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
+ break;
+ }
+ case kDocument: {
+ mutable_document()->::google::firestore::v1beta1::Document::MergeFrom(from.document());
+ break;
+ }
+ case DOCUMENT_TYPE_NOT_SET: {
+ break;
+ }
+ }
+}
+
+void MaybeDocument::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:firestore.client.MaybeDocument)
+ if (&from == this) return;
+ Clear();
+ MergeFrom(from);
+}
+
+void MaybeDocument::CopyFrom(const MaybeDocument& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.MaybeDocument)
+ if (&from == this) return;
+ Clear();
+ MergeFrom(from);
+}
+
+bool MaybeDocument::IsInitialized() const {
+ return true;
+}
+
+void MaybeDocument::Swap(MaybeDocument* other) {
+ if (other == this) return;
+ InternalSwap(other);
+}
+void MaybeDocument::InternalSwap(MaybeDocument* other) {
+ using std::swap;
+ swap(document_type_, other->document_type_);
+ swap(_oneof_case_[0], other->_oneof_case_[0]);
+ _internal_metadata_.Swap(&other->_internal_metadata_);
+ swap(_cached_size_, other->_cached_size_);
+}
+
+::google::protobuf::Metadata MaybeDocument::GetMetadata() const {
+ protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+} // namespace client
+} // namespace firestore
+
+// @@protoc_insertion_point(global_scope)