// Generated by the protocol buffer compiler. DO NOT EDIT! #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include "person.pb.h" #include #include #include #include #include #include namespace { const ::google::protobuf::Descriptor* Person_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Person_reflection_ = NULL; } // namespace void protobuf_AssignDesc_person_2eproto() { protobuf_AddDesc_person_2eproto(); const ::google::protobuf::FileDescriptor* file = ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( "person.proto"); GOOGLE_CHECK(file != NULL); Person_descriptor_ = file->message_type(0); static const int Person_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, email_), }; Person_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( Person_descriptor_, Person::default_instance_, Person_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(Person)); } namespace { GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); inline void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, &protobuf_AssignDesc_person_2eproto); } void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Person_descriptor_, &Person::default_instance()); } } // namespace void protobuf_ShutdownFile_person_2eproto() { delete Person::default_instance_; delete Person_reflection_; } void protobuf_AddDesc_person_2eproto() { static bool already_here = false; if (already_here) return; already_here = true; GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( "\n\014person.proto\"1\n\006Person\022\n\n\002id\030\001 \002(\005\022\014\n\004" "name\030\002 \002(\t\022\r\n\005email\030\003 \001(\tB\002H\001", 69); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "person.proto", &protobuf_RegisterTypes); Person::default_instance_ = new Person(); Person::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_person_2eproto); } // Force AddDescriptors() to be called at static initialization time. struct StaticDescriptorInitializer_person_2eproto { StaticDescriptorInitializer_person_2eproto() { protobuf_AddDesc_person_2eproto(); } } static_descriptor_initializer_person_2eproto_; // =================================================================== const ::std::string Person::_default_name_; const ::std::string Person::_default_email_; #ifndef _MSC_VER const int Person::kIdFieldNumber; const int Person::kNameFieldNumber; const int Person::kEmailFieldNumber; #endif // !_MSC_VER Person::Person() { SharedCtor(); } void Person::InitAsDefaultInstance() { } Person::Person(const Person& from) { SharedCtor(); MergeFrom(from); } void Person::SharedCtor() { _cached_size_ = 0; id_ = 0; name_ = const_cast< ::std::string*>(&_default_name_); email_ = const_cast< ::std::string*>(&_default_email_); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } Person::~Person() { SharedDtor(); } void Person::SharedDtor() { if (name_ != &_default_name_) { delete name_; } if (email_ != &_default_email_) { delete email_; } if (this != default_instance_) { } } const ::google::protobuf::Descriptor* Person::descriptor() { protobuf_AssignDescriptorsOnce(); return Person_descriptor_; } const Person& Person::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_person_2eproto(); return *default_instance_; } Person* Person::default_instance_ = NULL; Person* Person::New() const { return new Person; } void Person::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { id_ = 0; if (_has_bit(1)) { if (name_ != &_default_name_) { name_->clear(); } } if (_has_bit(2)) { if (email_ != &_default_email_) { email_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool Person::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 id = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &id_)); _set_bit(0); if (input->ExpectTag(18)) goto parse_name; break; } // required string name = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(26)) goto parse_email; break; } // optional string email = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_email: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_email())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->email().data(), this->email().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void Person::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { ::google::protobuf::uint8* raw_buffer = output->GetDirectBufferForNBytesAndAdvance(_cached_size_); if (raw_buffer != NULL) { Person::SerializeWithCachedSizesToArray(raw_buffer); return; } // required int32 id = 1; if (_has_bit(0)) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->id(), output); } // required string name = 2; if (_has_bit(1)) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->name(), output); } // optional string email = 3; if (_has_bit(2)) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->email().data(), this->email().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->email(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* Person::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // required int32 id = 1; if (_has_bit(0)) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->id(), target); } // required string name = 2; if (_has_bit(1)) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->name(), target); } // optional string email = 3; if (_has_bit(2)) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->email().data(), this->email().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->email(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int Person::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // required int32 id = 1; if (has_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->id()); } // required string name = 2; if (has_name()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional string email = 3; if (has_email()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->email()); } } if (!unknown_fields().empty()) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( unknown_fields()); } _cached_size_ = total_size; return total_size; } void Person::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const Person* source = ::google::protobuf::internal::dynamic_cast_if_available( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void Person::MergeFrom(const Person& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from._has_bit(0)) { set_id(from.id()); } if (from._has_bit(1)) { set_name(from.name()); } if (from._has_bit(2)) { set_email(from.email()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void Person::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void Person::CopyFrom(const Person& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool Person::IsInitialized() const { if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; return true; } void Person::Swap(Person* other) { if (other != this) { std::swap(id_, other->id_); std::swap(name_, other->name_); std::swap(email_, other->email_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata Person::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = Person_descriptor_; metadata.reflection = Person_reflection_; return metadata; }