// Generated by the protocol buffer compiler. DO NOT EDIT! // source: test.proto #ifndef PROTOBUF_test_2eproto__INCLUDED #define PROTOBUF_test_2eproto__INCLUDED #include #include #if GOOGLE_PROTOBUF_VERSION < 2006000 #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 #if 2006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #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 #include #include #include // @@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; } inline const ::std::string& unknown_fields() const { return _unknown_fields_; } inline ::std::string* mutable_unknown_fields() { return &_unknown_fields_; } 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; void DiscardUnknownFields(); 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(); ::std::string _unknown_fields_; ::google::protobuf::uint32 _has_bits_[1]; mutable int _cached_size_; ::std::string* number_; int type_; #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; } inline const ::std::string& unknown_fields() const { return _unknown_fields_; } inline ::std::string* mutable_unknown_fields() { return &_unknown_fields_; } 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; void DiscardUnknownFields(); 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(); ::std::string _unknown_fields_; ::google::protobuf::uint32 _has_bits_[1]; mutable int _cached_size_; ::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; } inline const ::std::string& unknown_fields() const { return _unknown_fields_; } inline ::std::string* mutable_unknown_fields() { return &_unknown_fields_; } 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; void DiscardUnknownFields(); 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: ::std::string _unknown_fields_; ::google::protobuf::uint32 _has_bits_[1]; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::tutorial::Person > person_; #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() { if (number_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { number_->clear(); } clear_has_number(); } inline const ::std::string& Person_PhoneNumber::number() const { // @@protoc_insertion_point(field_get:tutorial.Person.PhoneNumber.number) return *number_; } inline void Person_PhoneNumber::set_number(const ::std::string& value) { set_has_number(); if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { number_ = new ::std::string; } number_->assign(value); // @@protoc_insertion_point(field_set:tutorial.Person.PhoneNumber.number) } inline void Person_PhoneNumber::set_number(const char* value) { set_has_number(); if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { number_ = new ::std::string; } number_->assign(value); // @@protoc_insertion_point(field_set_char:tutorial.Person.PhoneNumber.number) } inline void Person_PhoneNumber::set_number(const char* value, size_t size) { set_has_number(); if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { number_ = new ::std::string; } number_->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:tutorial.Person.PhoneNumber.number) } inline ::std::string* Person_PhoneNumber::mutable_number() { set_has_number(); if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { number_ = new ::std::string; } // @@protoc_insertion_point(field_mutable:tutorial.Person.PhoneNumber.number) return number_; } inline ::std::string* Person_PhoneNumber::release_number() { clear_has_number(); if (number_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { return NULL; } else { ::std::string* temp = number_; number_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); return temp; } } inline void Person_PhoneNumber::set_allocated_number(::std::string* number) { if (number_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete number_; } if (number) { set_has_number(); number_ = number; } else { clear_has_number(); number_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } // @@protoc_insertion_point(field_set_allocated:tutorial.Person.PhoneNumber.number) } // 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 { // @@protoc_insertion_point(field_get:tutorial.Person.PhoneNumber.type) 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; // @@protoc_insertion_point(field_set:tutorial.Person.PhoneNumber.type) } // ------------------------------------------------------------------- // 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() { if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } clear_has_name(); } inline const ::std::string& Person::name() const { // @@protoc_insertion_point(field_get:tutorial.Person.name) return *name_; } inline void Person::set_name(const ::std::string& value) { set_has_name(); if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); // @@protoc_insertion_point(field_set:tutorial.Person.name) } inline void Person::set_name(const char* value) { set_has_name(); if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); // @@protoc_insertion_point(field_set_char:tutorial.Person.name) } inline void Person::set_name(const char* value, size_t size) { set_has_name(); if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:tutorial.Person.name) } inline ::std::string* Person::mutable_name() { set_has_name(); if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } // @@protoc_insertion_point(field_mutable:tutorial.Person.name) return name_; } inline ::std::string* Person::release_name() { clear_has_name(); if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { return NULL; } else { ::std::string* temp = name_; name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); return temp; } } inline void Person::set_allocated_name(::std::string* name) { if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (name) { set_has_name(); name_ = name; } else { clear_has_name(); name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } // @@protoc_insertion_point(field_set_allocated:tutorial.Person.name) } // 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 { // @@protoc_insertion_point(field_get:tutorial.Person.id) return id_; } inline void Person::set_id(::google::protobuf::int32 value) { set_has_id(); id_ = value; // @@protoc_insertion_point(field_set:tutorial.Person.id) } // 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() { if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { email_->clear(); } clear_has_email(); } inline const ::std::string& Person::email() const { // @@protoc_insertion_point(field_get:tutorial.Person.email) return *email_; } inline void Person::set_email(const ::std::string& value) { set_has_email(); if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { email_ = new ::std::string; } email_->assign(value); // @@protoc_insertion_point(field_set:tutorial.Person.email) } inline void Person::set_email(const char* value) { set_has_email(); if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { email_ = new ::std::string; } email_->assign(value); // @@protoc_insertion_point(field_set_char:tutorial.Person.email) } inline void Person::set_email(const char* value, size_t size) { set_has_email(); if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { email_ = new ::std::string; } email_->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:tutorial.Person.email) } inline ::std::string* Person::mutable_email() { set_has_email(); if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { email_ = new ::std::string; } // @@protoc_insertion_point(field_mutable:tutorial.Person.email) return email_; } inline ::std::string* Person::release_email() { clear_has_email(); if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { return NULL; } else { ::std::string* temp = email_; email_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); return temp; } } inline void Person::set_allocated_email(::std::string* email) { if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete email_; } if (email) { set_has_email(); email_ = email; } else { clear_has_email(); email_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } // @@protoc_insertion_point(field_set_allocated:tutorial.Person.email) } // 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 { // @@protoc_insertion_point(field_get:tutorial.Person.phone) return phone_.Get(index); } inline ::tutorial::Person_PhoneNumber* Person::mutable_phone(int index) { // @@protoc_insertion_point(field_mutable:tutorial.Person.phone) return phone_.Mutable(index); } inline ::tutorial::Person_PhoneNumber* Person::add_phone() { // @@protoc_insertion_point(field_add:tutorial.Person.phone) return phone_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >& Person::phone() const { // @@protoc_insertion_point(field_list:tutorial.Person.phone) return phone_; } inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >* Person::mutable_phone() { // @@protoc_insertion_point(field_mutable_list:tutorial.Person.phone) 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 { // @@protoc_insertion_point(field_get:tutorial.AddressBook.person) return person_.Get(index); } inline ::tutorial::Person* AddressBook::mutable_person(int index) { // @@protoc_insertion_point(field_mutable:tutorial.AddressBook.person) return person_.Mutable(index); } inline ::tutorial::Person* AddressBook::add_person() { // @@protoc_insertion_point(field_add:tutorial.AddressBook.person) return person_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person >& AddressBook::person() const { // @@protoc_insertion_point(field_list:tutorial.AddressBook.person) return person_; } inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person >* AddressBook::mutable_person() { // @@protoc_insertion_point(field_mutable_list:tutorial.AddressBook.person) return &person_; } // @@protoc_insertion_point(namespace_scope) } // namespace tutorial // @@protoc_insertion_point(global_scope) #endif // PROTOBUF_test_2eproto__INCLUDED