2019-07-28 10:31:56 +08:00
|
|
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
2013-08-18 17:42:25 +08:00
|
|
|
// source: test.proto
|
|
|
|
|
|
|
|
#ifndef PROTOBUF_test_2eproto__INCLUDED
|
|
|
|
#define PROTOBUF_test_2eproto__INCLUDED
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <google/protobuf/stubs/common.h>
|
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
#if GOOGLE_PROTOBUF_VERSION < 2006000
|
2013-08-18 17:42:25 +08:00
|
|
|
#error This file was generated by a newer version of protoc which is
|
|
|
|
#error incompatible with your Protocol Buffer headers. Please update
|
|
|
|
#error your headers.
|
|
|
|
#endif
|
2014-11-25 19:44:37 +08:00
|
|
|
#if 2006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
|
2013-08-18 17:42:25 +08:00
|
|
|
#error This file was generated by an older version of protoc which is
|
|
|
|
#error incompatible with your Protocol Buffer headers. Please
|
|
|
|
#error regenerate this file with a newer version of protoc.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <google/protobuf/generated_message_util.h>
|
|
|
|
#include <google/protobuf/message_lite.h>
|
|
|
|
#include <google/protobuf/repeated_field.h>
|
|
|
|
#include <google/protobuf/extension_set.h>
|
|
|
|
// @@protoc_insertion_point(includes)
|
|
|
|
|
|
|
|
namespace tutorial {
|
|
|
|
|
|
|
|
// Internal implementation detail -- do not call these.
|
|
|
|
void protobuf_AddDesc_test_2eproto();
|
|
|
|
void protobuf_AssignDesc_test_2eproto();
|
|
|
|
void protobuf_ShutdownFile_test_2eproto();
|
|
|
|
|
|
|
|
class Person;
|
|
|
|
class Person_PhoneNumber;
|
|
|
|
class AddressBook;
|
|
|
|
|
|
|
|
enum Person_PhoneType {
|
|
|
|
Person_PhoneType_MOBILE = 0,
|
|
|
|
Person_PhoneType_HOME = 1,
|
|
|
|
Person_PhoneType_WORK = 2
|
|
|
|
};
|
|
|
|
bool Person_PhoneType_IsValid(int value);
|
|
|
|
const Person_PhoneType Person_PhoneType_PhoneType_MIN = Person_PhoneType_MOBILE;
|
|
|
|
const Person_PhoneType Person_PhoneType_PhoneType_MAX = Person_PhoneType_WORK;
|
|
|
|
const int Person_PhoneType_PhoneType_ARRAYSIZE = Person_PhoneType_PhoneType_MAX + 1;
|
|
|
|
|
|
|
|
// ===================================================================
|
|
|
|
|
|
|
|
class Person_PhoneNumber : public ::google::protobuf::MessageLite {
|
|
|
|
public:
|
|
|
|
Person_PhoneNumber();
|
|
|
|
virtual ~Person_PhoneNumber();
|
|
|
|
|
|
|
|
Person_PhoneNumber(const Person_PhoneNumber& from);
|
|
|
|
|
|
|
|
inline Person_PhoneNumber& operator=(const Person_PhoneNumber& from) {
|
|
|
|
CopyFrom(from);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
inline const ::std::string& unknown_fields() const {
|
|
|
|
return _unknown_fields_;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline ::std::string* mutable_unknown_fields() {
|
|
|
|
return &_unknown_fields_;
|
|
|
|
}
|
|
|
|
|
2013-08-18 17:42:25 +08:00
|
|
|
static const Person_PhoneNumber& default_instance();
|
|
|
|
|
|
|
|
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
|
|
|
// Returns the internal default instance pointer. This function can
|
|
|
|
// return NULL thus should not be used by the user. This is intended
|
|
|
|
// for Protobuf internal code. Please use default_instance() declared
|
|
|
|
// above instead.
|
|
|
|
static inline const Person_PhoneNumber* internal_default_instance() {
|
|
|
|
return default_instance_;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void Swap(Person_PhoneNumber* other);
|
|
|
|
|
|
|
|
// implements Message ----------------------------------------------
|
|
|
|
|
|
|
|
Person_PhoneNumber* New() const;
|
|
|
|
void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
|
|
|
|
void CopyFrom(const Person_PhoneNumber& from);
|
|
|
|
void MergeFrom(const Person_PhoneNumber& from);
|
|
|
|
void Clear();
|
|
|
|
bool IsInitialized() const;
|
|
|
|
|
|
|
|
int ByteSize() const;
|
|
|
|
bool MergePartialFromCodedStream(
|
|
|
|
::google::protobuf::io::CodedInputStream* input);
|
|
|
|
void SerializeWithCachedSizes(
|
|
|
|
::google::protobuf::io::CodedOutputStream* output) const;
|
2014-11-25 19:44:37 +08:00
|
|
|
void DiscardUnknownFields();
|
2013-08-18 17:42:25 +08:00
|
|
|
int GetCachedSize() const { return _cached_size_; }
|
|
|
|
private:
|
|
|
|
void SharedCtor();
|
|
|
|
void SharedDtor();
|
|
|
|
void SetCachedSize(int size) const;
|
|
|
|
public:
|
|
|
|
::std::string GetTypeName() const;
|
|
|
|
|
|
|
|
// nested types ----------------------------------------------------
|
|
|
|
|
|
|
|
// accessors -------------------------------------------------------
|
|
|
|
|
|
|
|
// required string number = 1;
|
|
|
|
inline bool has_number() const;
|
|
|
|
inline void clear_number();
|
|
|
|
static const int kNumberFieldNumber = 1;
|
|
|
|
inline const ::std::string& number() const;
|
|
|
|
inline void set_number(const ::std::string& value);
|
|
|
|
inline void set_number(const char* value);
|
|
|
|
inline void set_number(const char* value, size_t size);
|
|
|
|
inline ::std::string* mutable_number();
|
|
|
|
inline ::std::string* release_number();
|
|
|
|
inline void set_allocated_number(::std::string* number);
|
|
|
|
|
|
|
|
// optional .tutorial.Person.PhoneType type = 2 [default = HOME];
|
|
|
|
inline bool has_type() const;
|
|
|
|
inline void clear_type();
|
|
|
|
static const int kTypeFieldNumber = 2;
|
|
|
|
inline ::tutorial::Person_PhoneType type() const;
|
|
|
|
inline void set_type(::tutorial::Person_PhoneType value);
|
|
|
|
|
|
|
|
// @@protoc_insertion_point(class_scope:tutorial.Person.PhoneNumber)
|
|
|
|
private:
|
|
|
|
inline void set_has_number();
|
|
|
|
inline void clear_has_number();
|
|
|
|
inline void set_has_type();
|
|
|
|
inline void clear_has_type();
|
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
::std::string _unknown_fields_;
|
2013-08-18 17:42:25 +08:00
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
::google::protobuf::uint32 _has_bits_[1];
|
2013-08-18 17:42:25 +08:00
|
|
|
mutable int _cached_size_;
|
2014-11-25 19:44:37 +08:00
|
|
|
::std::string* number_;
|
|
|
|
int type_;
|
2013-08-18 17:42:25 +08:00
|
|
|
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
|
|
|
friend void protobuf_AddDesc_test_2eproto_impl();
|
|
|
|
#else
|
|
|
|
friend void protobuf_AddDesc_test_2eproto();
|
|
|
|
#endif
|
|
|
|
friend void protobuf_AssignDesc_test_2eproto();
|
|
|
|
friend void protobuf_ShutdownFile_test_2eproto();
|
|
|
|
|
|
|
|
void InitAsDefaultInstance();
|
|
|
|
static Person_PhoneNumber* default_instance_;
|
|
|
|
};
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Person : public ::google::protobuf::MessageLite {
|
|
|
|
public:
|
|
|
|
Person();
|
|
|
|
virtual ~Person();
|
|
|
|
|
|
|
|
Person(const Person& from);
|
|
|
|
|
|
|
|
inline Person& operator=(const Person& from) {
|
|
|
|
CopyFrom(from);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
inline const ::std::string& unknown_fields() const {
|
|
|
|
return _unknown_fields_;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline ::std::string* mutable_unknown_fields() {
|
|
|
|
return &_unknown_fields_;
|
|
|
|
}
|
|
|
|
|
2013-08-18 17:42:25 +08:00
|
|
|
static const Person& default_instance();
|
|
|
|
|
|
|
|
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
|
|
|
// Returns the internal default instance pointer. This function can
|
|
|
|
// return NULL thus should not be used by the user. This is intended
|
|
|
|
// for Protobuf internal code. Please use default_instance() declared
|
|
|
|
// above instead.
|
|
|
|
static inline const Person* internal_default_instance() {
|
|
|
|
return default_instance_;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void Swap(Person* other);
|
|
|
|
|
|
|
|
// implements Message ----------------------------------------------
|
|
|
|
|
|
|
|
Person* New() const;
|
|
|
|
void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
|
|
|
|
void CopyFrom(const Person& from);
|
|
|
|
void MergeFrom(const Person& from);
|
|
|
|
void Clear();
|
|
|
|
bool IsInitialized() const;
|
|
|
|
|
|
|
|
int ByteSize() const;
|
|
|
|
bool MergePartialFromCodedStream(
|
|
|
|
::google::protobuf::io::CodedInputStream* input);
|
|
|
|
void SerializeWithCachedSizes(
|
|
|
|
::google::protobuf::io::CodedOutputStream* output) const;
|
2014-11-25 19:44:37 +08:00
|
|
|
void DiscardUnknownFields();
|
2013-08-18 17:42:25 +08:00
|
|
|
int GetCachedSize() const { return _cached_size_; }
|
|
|
|
private:
|
|
|
|
void SharedCtor();
|
|
|
|
void SharedDtor();
|
|
|
|
void SetCachedSize(int size) const;
|
|
|
|
public:
|
|
|
|
::std::string GetTypeName() const;
|
|
|
|
|
|
|
|
// nested types ----------------------------------------------------
|
|
|
|
|
|
|
|
typedef Person_PhoneNumber PhoneNumber;
|
|
|
|
|
|
|
|
typedef Person_PhoneType PhoneType;
|
|
|
|
static const PhoneType MOBILE = Person_PhoneType_MOBILE;
|
|
|
|
static const PhoneType HOME = Person_PhoneType_HOME;
|
|
|
|
static const PhoneType WORK = Person_PhoneType_WORK;
|
|
|
|
static inline bool PhoneType_IsValid(int value) {
|
|
|
|
return Person_PhoneType_IsValid(value);
|
|
|
|
}
|
|
|
|
static const PhoneType PhoneType_MIN =
|
|
|
|
Person_PhoneType_PhoneType_MIN;
|
|
|
|
static const PhoneType PhoneType_MAX =
|
|
|
|
Person_PhoneType_PhoneType_MAX;
|
|
|
|
static const int PhoneType_ARRAYSIZE =
|
|
|
|
Person_PhoneType_PhoneType_ARRAYSIZE;
|
|
|
|
|
|
|
|
// accessors -------------------------------------------------------
|
|
|
|
|
|
|
|
// required string name = 1;
|
|
|
|
inline bool has_name() const;
|
|
|
|
inline void clear_name();
|
|
|
|
static const int kNameFieldNumber = 1;
|
|
|
|
inline const ::std::string& name() const;
|
|
|
|
inline void set_name(const ::std::string& value);
|
|
|
|
inline void set_name(const char* value);
|
|
|
|
inline void set_name(const char* value, size_t size);
|
|
|
|
inline ::std::string* mutable_name();
|
|
|
|
inline ::std::string* release_name();
|
|
|
|
inline void set_allocated_name(::std::string* name);
|
|
|
|
|
|
|
|
// required int32 id = 2;
|
|
|
|
inline bool has_id() const;
|
|
|
|
inline void clear_id();
|
|
|
|
static const int kIdFieldNumber = 2;
|
|
|
|
inline ::google::protobuf::int32 id() const;
|
|
|
|
inline void set_id(::google::protobuf::int32 value);
|
|
|
|
|
|
|
|
// optional string email = 3;
|
|
|
|
inline bool has_email() const;
|
|
|
|
inline void clear_email();
|
|
|
|
static const int kEmailFieldNumber = 3;
|
|
|
|
inline const ::std::string& email() const;
|
|
|
|
inline void set_email(const ::std::string& value);
|
|
|
|
inline void set_email(const char* value);
|
|
|
|
inline void set_email(const char* value, size_t size);
|
|
|
|
inline ::std::string* mutable_email();
|
|
|
|
inline ::std::string* release_email();
|
|
|
|
inline void set_allocated_email(::std::string* email);
|
|
|
|
|
|
|
|
// repeated .tutorial.Person.PhoneNumber phone = 4;
|
|
|
|
inline int phone_size() const;
|
|
|
|
inline void clear_phone();
|
|
|
|
static const int kPhoneFieldNumber = 4;
|
|
|
|
inline const ::tutorial::Person_PhoneNumber& phone(int index) const;
|
|
|
|
inline ::tutorial::Person_PhoneNumber* mutable_phone(int index);
|
|
|
|
inline ::tutorial::Person_PhoneNumber* add_phone();
|
|
|
|
inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >&
|
|
|
|
phone() const;
|
|
|
|
inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >*
|
|
|
|
mutable_phone();
|
|
|
|
|
|
|
|
// @@protoc_insertion_point(class_scope:tutorial.Person)
|
|
|
|
private:
|
|
|
|
inline void set_has_name();
|
|
|
|
inline void clear_has_name();
|
|
|
|
inline void set_has_id();
|
|
|
|
inline void clear_has_id();
|
|
|
|
inline void set_has_email();
|
|
|
|
inline void clear_has_email();
|
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
::std::string _unknown_fields_;
|
|
|
|
|
|
|
|
::google::protobuf::uint32 _has_bits_[1];
|
|
|
|
mutable int _cached_size_;
|
2013-08-18 17:42:25 +08:00
|
|
|
::std::string* name_;
|
|
|
|
::std::string* email_;
|
|
|
|
::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber > phone_;
|
|
|
|
::google::protobuf::int32 id_;
|
|
|
|
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
|
|
|
friend void protobuf_AddDesc_test_2eproto_impl();
|
|
|
|
#else
|
|
|
|
friend void protobuf_AddDesc_test_2eproto();
|
|
|
|
#endif
|
|
|
|
friend void protobuf_AssignDesc_test_2eproto();
|
|
|
|
friend void protobuf_ShutdownFile_test_2eproto();
|
|
|
|
|
|
|
|
void InitAsDefaultInstance();
|
|
|
|
static Person* default_instance_;
|
|
|
|
};
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
|
|
|
|
class AddressBook : public ::google::protobuf::MessageLite {
|
|
|
|
public:
|
|
|
|
AddressBook();
|
|
|
|
virtual ~AddressBook();
|
|
|
|
|
|
|
|
AddressBook(const AddressBook& from);
|
|
|
|
|
|
|
|
inline AddressBook& operator=(const AddressBook& from) {
|
|
|
|
CopyFrom(from);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
inline const ::std::string& unknown_fields() const {
|
|
|
|
return _unknown_fields_;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline ::std::string* mutable_unknown_fields() {
|
|
|
|
return &_unknown_fields_;
|
|
|
|
}
|
|
|
|
|
2013-08-18 17:42:25 +08:00
|
|
|
static const AddressBook& default_instance();
|
|
|
|
|
|
|
|
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
|
|
|
// Returns the internal default instance pointer. This function can
|
|
|
|
// return NULL thus should not be used by the user. This is intended
|
|
|
|
// for Protobuf internal code. Please use default_instance() declared
|
|
|
|
// above instead.
|
|
|
|
static inline const AddressBook* internal_default_instance() {
|
|
|
|
return default_instance_;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void Swap(AddressBook* other);
|
|
|
|
|
|
|
|
// implements Message ----------------------------------------------
|
|
|
|
|
|
|
|
AddressBook* New() const;
|
|
|
|
void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
|
|
|
|
void CopyFrom(const AddressBook& from);
|
|
|
|
void MergeFrom(const AddressBook& from);
|
|
|
|
void Clear();
|
|
|
|
bool IsInitialized() const;
|
|
|
|
|
|
|
|
int ByteSize() const;
|
|
|
|
bool MergePartialFromCodedStream(
|
|
|
|
::google::protobuf::io::CodedInputStream* input);
|
|
|
|
void SerializeWithCachedSizes(
|
|
|
|
::google::protobuf::io::CodedOutputStream* output) const;
|
2014-11-25 19:44:37 +08:00
|
|
|
void DiscardUnknownFields();
|
2013-08-18 17:42:25 +08:00
|
|
|
int GetCachedSize() const { return _cached_size_; }
|
|
|
|
private:
|
|
|
|
void SharedCtor();
|
|
|
|
void SharedDtor();
|
|
|
|
void SetCachedSize(int size) const;
|
|
|
|
public:
|
|
|
|
::std::string GetTypeName() const;
|
|
|
|
|
|
|
|
// nested types ----------------------------------------------------
|
|
|
|
|
|
|
|
// accessors -------------------------------------------------------
|
|
|
|
|
|
|
|
// repeated .tutorial.Person person = 1;
|
|
|
|
inline int person_size() const;
|
|
|
|
inline void clear_person();
|
|
|
|
static const int kPersonFieldNumber = 1;
|
|
|
|
inline const ::tutorial::Person& person(int index) const;
|
|
|
|
inline ::tutorial::Person* mutable_person(int index);
|
|
|
|
inline ::tutorial::Person* add_person();
|
|
|
|
inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person >&
|
|
|
|
person() const;
|
|
|
|
inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person >*
|
|
|
|
mutable_person();
|
|
|
|
|
|
|
|
// @@protoc_insertion_point(class_scope:tutorial.AddressBook)
|
|
|
|
private:
|
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
::std::string _unknown_fields_;
|
2013-08-18 17:42:25 +08:00
|
|
|
|
2014-11-25 19:44:37 +08:00
|
|
|
::google::protobuf::uint32 _has_bits_[1];
|
2013-08-18 17:42:25 +08:00
|
|
|
mutable int _cached_size_;
|
2014-11-25 19:44:37 +08:00
|
|
|
::google::protobuf::RepeatedPtrField< ::tutorial::Person > person_;
|
2013-08-18 17:42:25 +08:00
|
|
|
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
|
|
|
friend void protobuf_AddDesc_test_2eproto_impl();
|
|
|
|
#else
|
|
|
|
friend void protobuf_AddDesc_test_2eproto();
|
|
|
|
#endif
|
|
|
|
friend void protobuf_AssignDesc_test_2eproto();
|
|
|
|
friend void protobuf_ShutdownFile_test_2eproto();
|
|
|
|
|
|
|
|
void InitAsDefaultInstance();
|
|
|
|
static AddressBook* default_instance_;
|
|
|
|
};
|
|
|
|
// ===================================================================
|
|
|
|
|
|
|
|
|
|
|
|
// ===================================================================
|
|
|
|
|
|
|
|
// Person_PhoneNumber
|
|
|
|
|
|
|
|
// required string number = 1;
|
|
|
|
inline bool Person_PhoneNumber::has_number() const {
|
|
|
|
return (_has_bits_[0] & 0x00000001u) != 0;
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::set_has_number() {
|
|
|
|
_has_bits_[0] |= 0x00000001u;
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::clear_has_number() {
|
|
|
|
_has_bits_[0] &= ~0x00000001u;
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::clear_number() {
|
2014-11-25 19:44:37 +08:00
|
|
|
if (number_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
number_->clear();
|
|
|
|
}
|
|
|
|
clear_has_number();
|
|
|
|
}
|
|
|
|
inline const ::std::string& Person_PhoneNumber::number() const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_get:tutorial.Person.PhoneNumber.number)
|
2013-08-18 17:42:25 +08:00
|
|
|
return *number_;
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::set_number(const ::std::string& value) {
|
|
|
|
set_has_number();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
number_ = new ::std::string;
|
|
|
|
}
|
|
|
|
number_->assign(value);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set:tutorial.Person.PhoneNumber.number)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::set_number(const char* value) {
|
|
|
|
set_has_number();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
number_ = new ::std::string;
|
|
|
|
}
|
|
|
|
number_->assign(value);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_char:tutorial.Person.PhoneNumber.number)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::set_number(const char* value, size_t size) {
|
|
|
|
set_has_number();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
number_ = new ::std::string;
|
|
|
|
}
|
|
|
|
number_->assign(reinterpret_cast<const char*>(value), size);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_pointer:tutorial.Person.PhoneNumber.number)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline ::std::string* Person_PhoneNumber::mutable_number() {
|
|
|
|
set_has_number();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
number_ = new ::std::string;
|
|
|
|
}
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_mutable:tutorial.Person.PhoneNumber.number)
|
2013-08-18 17:42:25 +08:00
|
|
|
return number_;
|
|
|
|
}
|
|
|
|
inline ::std::string* Person_PhoneNumber::release_number() {
|
|
|
|
clear_has_number();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
::std::string* temp = number_;
|
2014-11-25 19:44:37 +08:00
|
|
|
number_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
2013-08-18 17:42:25 +08:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::set_allocated_number(::std::string* number) {
|
2014-11-25 19:44:37 +08:00
|
|
|
if (number_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
delete number_;
|
|
|
|
}
|
|
|
|
if (number) {
|
|
|
|
set_has_number();
|
|
|
|
number_ = number;
|
|
|
|
} else {
|
|
|
|
clear_has_number();
|
2014-11-25 19:44:37 +08:00
|
|
|
number_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_allocated:tutorial.Person.PhoneNumber.number)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// optional .tutorial.Person.PhoneType type = 2 [default = HOME];
|
|
|
|
inline bool Person_PhoneNumber::has_type() const {
|
|
|
|
return (_has_bits_[0] & 0x00000002u) != 0;
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::set_has_type() {
|
|
|
|
_has_bits_[0] |= 0x00000002u;
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::clear_has_type() {
|
|
|
|
_has_bits_[0] &= ~0x00000002u;
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::clear_type() {
|
|
|
|
type_ = 1;
|
|
|
|
clear_has_type();
|
|
|
|
}
|
|
|
|
inline ::tutorial::Person_PhoneType Person_PhoneNumber::type() const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_get:tutorial.Person.PhoneNumber.type)
|
2013-08-18 17:42:25 +08:00
|
|
|
return static_cast< ::tutorial::Person_PhoneType >(type_);
|
|
|
|
}
|
|
|
|
inline void Person_PhoneNumber::set_type(::tutorial::Person_PhoneType value) {
|
|
|
|
assert(::tutorial::Person_PhoneType_IsValid(value));
|
|
|
|
set_has_type();
|
|
|
|
type_ = value;
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set:tutorial.Person.PhoneNumber.type)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Person
|
|
|
|
|
|
|
|
// required string name = 1;
|
|
|
|
inline bool Person::has_name() const {
|
|
|
|
return (_has_bits_[0] & 0x00000001u) != 0;
|
|
|
|
}
|
|
|
|
inline void Person::set_has_name() {
|
|
|
|
_has_bits_[0] |= 0x00000001u;
|
|
|
|
}
|
|
|
|
inline void Person::clear_has_name() {
|
|
|
|
_has_bits_[0] &= ~0x00000001u;
|
|
|
|
}
|
|
|
|
inline void Person::clear_name() {
|
2014-11-25 19:44:37 +08:00
|
|
|
if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
name_->clear();
|
|
|
|
}
|
|
|
|
clear_has_name();
|
|
|
|
}
|
|
|
|
inline const ::std::string& Person::name() const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_get:tutorial.Person.name)
|
2013-08-18 17:42:25 +08:00
|
|
|
return *name_;
|
|
|
|
}
|
|
|
|
inline void Person::set_name(const ::std::string& value) {
|
|
|
|
set_has_name();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
name_ = new ::std::string;
|
|
|
|
}
|
|
|
|
name_->assign(value);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set:tutorial.Person.name)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline void Person::set_name(const char* value) {
|
|
|
|
set_has_name();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
name_ = new ::std::string;
|
|
|
|
}
|
|
|
|
name_->assign(value);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_char:tutorial.Person.name)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline void Person::set_name(const char* value, size_t size) {
|
|
|
|
set_has_name();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
name_ = new ::std::string;
|
|
|
|
}
|
|
|
|
name_->assign(reinterpret_cast<const char*>(value), size);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_pointer:tutorial.Person.name)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline ::std::string* Person::mutable_name() {
|
|
|
|
set_has_name();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
name_ = new ::std::string;
|
|
|
|
}
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_mutable:tutorial.Person.name)
|
2013-08-18 17:42:25 +08:00
|
|
|
return name_;
|
|
|
|
}
|
|
|
|
inline ::std::string* Person::release_name() {
|
|
|
|
clear_has_name();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
::std::string* temp = name_;
|
2014-11-25 19:44:37 +08:00
|
|
|
name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
2013-08-18 17:42:25 +08:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inline void Person::set_allocated_name(::std::string* name) {
|
2014-11-25 19:44:37 +08:00
|
|
|
if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
delete name_;
|
|
|
|
}
|
|
|
|
if (name) {
|
|
|
|
set_has_name();
|
|
|
|
name_ = name;
|
|
|
|
} else {
|
|
|
|
clear_has_name();
|
2014-11-25 19:44:37 +08:00
|
|
|
name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_allocated:tutorial.Person.name)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// required int32 id = 2;
|
|
|
|
inline bool Person::has_id() const {
|
|
|
|
return (_has_bits_[0] & 0x00000002u) != 0;
|
|
|
|
}
|
|
|
|
inline void Person::set_has_id() {
|
|
|
|
_has_bits_[0] |= 0x00000002u;
|
|
|
|
}
|
|
|
|
inline void Person::clear_has_id() {
|
|
|
|
_has_bits_[0] &= ~0x00000002u;
|
|
|
|
}
|
|
|
|
inline void Person::clear_id() {
|
|
|
|
id_ = 0;
|
|
|
|
clear_has_id();
|
|
|
|
}
|
|
|
|
inline ::google::protobuf::int32 Person::id() const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_get:tutorial.Person.id)
|
2013-08-18 17:42:25 +08:00
|
|
|
return id_;
|
|
|
|
}
|
|
|
|
inline void Person::set_id(::google::protobuf::int32 value) {
|
|
|
|
set_has_id();
|
|
|
|
id_ = value;
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set:tutorial.Person.id)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// optional string email = 3;
|
|
|
|
inline bool Person::has_email() const {
|
|
|
|
return (_has_bits_[0] & 0x00000004u) != 0;
|
|
|
|
}
|
|
|
|
inline void Person::set_has_email() {
|
|
|
|
_has_bits_[0] |= 0x00000004u;
|
|
|
|
}
|
|
|
|
inline void Person::clear_has_email() {
|
|
|
|
_has_bits_[0] &= ~0x00000004u;
|
|
|
|
}
|
|
|
|
inline void Person::clear_email() {
|
2014-11-25 19:44:37 +08:00
|
|
|
if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
email_->clear();
|
|
|
|
}
|
|
|
|
clear_has_email();
|
|
|
|
}
|
|
|
|
inline const ::std::string& Person::email() const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_get:tutorial.Person.email)
|
2013-08-18 17:42:25 +08:00
|
|
|
return *email_;
|
|
|
|
}
|
|
|
|
inline void Person::set_email(const ::std::string& value) {
|
|
|
|
set_has_email();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
email_ = new ::std::string;
|
|
|
|
}
|
|
|
|
email_->assign(value);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set:tutorial.Person.email)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline void Person::set_email(const char* value) {
|
|
|
|
set_has_email();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
email_ = new ::std::string;
|
|
|
|
}
|
|
|
|
email_->assign(value);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_char:tutorial.Person.email)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline void Person::set_email(const char* value, size_t size) {
|
|
|
|
set_has_email();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
email_ = new ::std::string;
|
|
|
|
}
|
|
|
|
email_->assign(reinterpret_cast<const char*>(value), size);
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_pointer:tutorial.Person.email)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
inline ::std::string* Person::mutable_email() {
|
|
|
|
set_has_email();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
email_ = new ::std::string;
|
|
|
|
}
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_mutable:tutorial.Person.email)
|
2013-08-18 17:42:25 +08:00
|
|
|
return email_;
|
|
|
|
}
|
|
|
|
inline ::std::string* Person::release_email() {
|
|
|
|
clear_has_email();
|
2014-11-25 19:44:37 +08:00
|
|
|
if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
::std::string* temp = email_;
|
2014-11-25 19:44:37 +08:00
|
|
|
email_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
2013-08-18 17:42:25 +08:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inline void Person::set_allocated_email(::std::string* email) {
|
2014-11-25 19:44:37 +08:00
|
|
|
if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
2013-08-18 17:42:25 +08:00
|
|
|
delete email_;
|
|
|
|
}
|
|
|
|
if (email) {
|
|
|
|
set_has_email();
|
|
|
|
email_ = email;
|
|
|
|
} else {
|
|
|
|
clear_has_email();
|
2014-11-25 19:44:37 +08:00
|
|
|
email_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_set_allocated:tutorial.Person.email)
|
2013-08-18 17:42:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// repeated .tutorial.Person.PhoneNumber phone = 4;
|
|
|
|
inline int Person::phone_size() const {
|
|
|
|
return phone_.size();
|
|
|
|
}
|
|
|
|
inline void Person::clear_phone() {
|
|
|
|
phone_.Clear();
|
|
|
|
}
|
|
|
|
inline const ::tutorial::Person_PhoneNumber& Person::phone(int index) const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_get:tutorial.Person.phone)
|
2013-08-18 17:42:25 +08:00
|
|
|
return phone_.Get(index);
|
|
|
|
}
|
|
|
|
inline ::tutorial::Person_PhoneNumber* Person::mutable_phone(int index) {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_mutable:tutorial.Person.phone)
|
2013-08-18 17:42:25 +08:00
|
|
|
return phone_.Mutable(index);
|
|
|
|
}
|
|
|
|
inline ::tutorial::Person_PhoneNumber* Person::add_phone() {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_add:tutorial.Person.phone)
|
2013-08-18 17:42:25 +08:00
|
|
|
return phone_.Add();
|
|
|
|
}
|
|
|
|
inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >&
|
|
|
|
Person::phone() const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_list:tutorial.Person.phone)
|
2013-08-18 17:42:25 +08:00
|
|
|
return phone_;
|
|
|
|
}
|
|
|
|
inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >*
|
|
|
|
Person::mutable_phone() {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_mutable_list:tutorial.Person.phone)
|
2013-08-18 17:42:25 +08:00
|
|
|
return &phone_;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
|
|
|
|
// AddressBook
|
|
|
|
|
|
|
|
// repeated .tutorial.Person person = 1;
|
|
|
|
inline int AddressBook::person_size() const {
|
|
|
|
return person_.size();
|
|
|
|
}
|
|
|
|
inline void AddressBook::clear_person() {
|
|
|
|
person_.Clear();
|
|
|
|
}
|
|
|
|
inline const ::tutorial::Person& AddressBook::person(int index) const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_get:tutorial.AddressBook.person)
|
2013-08-18 17:42:25 +08:00
|
|
|
return person_.Get(index);
|
|
|
|
}
|
|
|
|
inline ::tutorial::Person* AddressBook::mutable_person(int index) {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_mutable:tutorial.AddressBook.person)
|
2013-08-18 17:42:25 +08:00
|
|
|
return person_.Mutable(index);
|
|
|
|
}
|
|
|
|
inline ::tutorial::Person* AddressBook::add_person() {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_add:tutorial.AddressBook.person)
|
2013-08-18 17:42:25 +08:00
|
|
|
return person_.Add();
|
|
|
|
}
|
|
|
|
inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person >&
|
|
|
|
AddressBook::person() const {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_list:tutorial.AddressBook.person)
|
2013-08-18 17:42:25 +08:00
|
|
|
return person_;
|
|
|
|
}
|
|
|
|
inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person >*
|
|
|
|
AddressBook::mutable_person() {
|
2014-11-25 19:44:37 +08:00
|
|
|
// @@protoc_insertion_point(field_mutable_list:tutorial.AddressBook.person)
|
2013-08-18 17:42:25 +08:00
|
|
|
return &person_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// @@protoc_insertion_point(namespace_scope)
|
|
|
|
|
|
|
|
} // namespace tutorial
|
|
|
|
|
|
|
|
// @@protoc_insertion_point(global_scope)
|
|
|
|
|
|
|
|
#endif // PROTOBUF_test_2eproto__INCLUDED
|