/tags/protobuf-gdc/test-cases/a.h
http://d-protobuf.googlecode.com/ · C Header · 310 lines · 232 code · 58 blank · 20 comment · 12 complexity · f840e8ed62b906abc08880ff260fe836 MD5 · raw file
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- #ifndef PROTOBUF_test_2epro__INCLUDED
- #define PROTOBUF_test_2epro__INCLUDED
- #include <string>
- #include <google/protobuf/stubs/common.h>
- #if GOOGLE_PROTOBUF_VERSION < 2000003
- #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 2000003 < 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 <google/protobuf/generated_message_reflection.h>
- #include <google/protobuf/repeated_field.h>
- #include <google/protobuf/extension_set.h>
- // Internal implementation detail -- do not call these.
- void protobuf_BuildDesc_test_2epro();
- void protobuf_BuildDesc_test_2epro_AssignGlobalDescriptors(
- ::google::protobuf::FileDescriptor* file);
- class SearchRequest;
- class Foo;
- // ===================================================================
- class SearchRequest : public ::google::protobuf::Message {
- public:
- SearchRequest();
- virtual ~SearchRequest();
-
- SearchRequest(const SearchRequest& from);
-
- inline SearchRequest& operator=(const SearchRequest& from) {
- CopyFrom(from);
- return *this;
- }
-
- inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
- return _unknown_fields_;
- }
-
- inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
- return &_unknown_fields_;
- }
-
- static const ::google::protobuf::Descriptor* descriptor();
- static const SearchRequest& default_instance();
- void Swap(SearchRequest* other);
-
- // implements Message ----------------------------------------------
-
- SearchRequest* New() const;
- int GetCachedSize() const { return _cached_size_; }
- private:
- void SetCachedSize(int size) const { _cached_size_ = size; }
- public:
-
- const ::google::protobuf::Descriptor* GetDescriptor() const;
- const ::google::protobuf::Reflection* GetReflection() const;
-
- // nested types ----------------------------------------------------
-
- // accessors -------------------------------------------------------
-
- // optional bytes query = 1;
- inline bool has_query() const;
- inline void clear_query();
- inline const ::std::string& query() const;
- inline void set_query(const ::std::string& value);
- inline void set_query(const char* value);
- inline void set_query(const void* value, size_t size);
- inline ::std::string* mutable_query();
-
- private:
- ::google::protobuf::UnknownFieldSet _unknown_fields_;
- mutable int _cached_size_;
-
- ::std::string* query_;
- static const ::std::string _default_query_;
- friend void protobuf_BuildDesc_test_2epro_AssignGlobalDescriptors(
- const ::google::protobuf::FileDescriptor* file);
- ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
-
- // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
- inline bool _has_bit(int index) const {
- return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
- }
- inline void _set_bit(int index) {
- _has_bits_[index / 32] |= (1u << (index % 32));
- }
- inline void _clear_bit(int index) {
- _has_bits_[index / 32] &= ~(1u << (index % 32));
- }
-
- void InitAsDefaultInstance();
- static SearchRequest* default_instance_;
- };
- // -------------------------------------------------------------------
- class Foo : public ::google::protobuf::Message {
- public:
- Foo();
- virtual ~Foo();
-
- Foo(const Foo& from);
-
- inline Foo& operator=(const Foo& from) {
- CopyFrom(from);
- return *this;
- }
-
- inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
- return _unknown_fields_;
- }
-
- inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
- return &_unknown_fields_;
- }
-
- static const ::google::protobuf::Descriptor* descriptor();
- static const Foo& default_instance();
- void Swap(Foo* other);
-
- // implements Message ----------------------------------------------
-
- Foo* New() const;
- int GetCachedSize() const { return _cached_size_; }
- private:
- void SetCachedSize(int size) const { _cached_size_ = size; }
- public:
-
- const ::google::protobuf::Descriptor* GetDescriptor() const;
- const ::google::protobuf::Reflection* GetReflection() const;
-
- // nested types ----------------------------------------------------
-
- // accessors -------------------------------------------------------
-
- template <typename _proto_TypeTraits>
- inline bool HasExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id) const {
- return _extensions_.Has(id.number());
- }
-
- template <typename _proto_TypeTraits>
- inline void ClearExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id) {
- _extensions_.ClearExtension(id.number());
- }
-
- template <typename _proto_TypeTraits>
- inline int ExtensionSize(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id) const {
- return _extensions_.ExtensionSize(id.number());
- }
-
- template <typename _proto_TypeTraits>
- inline typename _proto_TypeTraits::ConstType GetExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id) const {
- return _proto_TypeTraits::Get(id.number(), _extensions_);
- }
-
- template <typename _proto_TypeTraits>
- inline typename _proto_TypeTraits::MutableType MutableExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id) {
- return _proto_TypeTraits::Mutable(id.number(), &_extensions_);
- }
-
- template <typename _proto_TypeTraits>
- inline void SetExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id,
- typename _proto_TypeTraits::ConstType value) {
- _proto_TypeTraits::Set(id.number(), value, &_extensions_);
- }
-
- template <typename _proto_TypeTraits>
- inline typename _proto_TypeTraits::ConstType GetExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id,
- int index) const {
- return _proto_TypeTraits::Get(id.number(), _extensions_, index);
- }
-
- template <typename _proto_TypeTraits>
- inline typename _proto_TypeTraits::MutableType MutableExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id,
- int index) {
- return _proto_TypeTraits::Mutable(id.number(),index,&_extensions_);
- }
-
- template <typename _proto_TypeTraits>
- inline void SetExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id,
- int index, typename _proto_TypeTraits::ConstType value) {
- _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
- }
-
- template <typename _proto_TypeTraits>
- inline typename _proto_TypeTraits::MutableType AddExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id) {
- return _proto_TypeTraits::Add(id.number(), &_extensions_);
- }
-
- template <typename _proto_TypeTraits>
- inline void AddExtension(
- const ::google::protobuf::internal::ExtensionIdentifier<
- Foo, _proto_TypeTraits>& id,
- typename _proto_TypeTraits::ConstType value) {
- _proto_TypeTraits::Add(id.number(), value, &_extensions_);
- }
- private:
- ::google::protobuf::internal::ExtensionSet _extensions_;
- ::google::protobuf::UnknownFieldSet _unknown_fields_;
- mutable int _cached_size_;
-
- friend void protobuf_BuildDesc_test_2epro_AssignGlobalDescriptors(
- const ::google::protobuf::FileDescriptor* file);
- ::google::protobuf::uint32 _has_bits_[1];
-
- // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
- inline bool _has_bit(int index) const {
- return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
- }
- inline void _set_bit(int index) {
- _has_bits_[index / 32] |= (1u << (index % 32));
- }
- inline void _clear_bit(int index) {
- _has_bits_[index / 32] &= ~(1u << (index % 32));
- }
-
- void InitAsDefaultInstance();
- static Foo* default_instance_;
- };
- // ===================================================================
- // ===================================================================
- extern ::google::protobuf::internal::ExtensionIdentifier< ::Foo,
- ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 > > bar;
- // ===================================================================
- // SearchRequest
- // optional bytes query = 1;
- inline bool SearchRequest::has_query() const {
- return _has_bit(0);
- }
- inline void SearchRequest::clear_query() {
- if (query_ != &_default_query_) {
- query_->clear();
- }
- _clear_bit(0);
- }
- inline const ::std::string& SearchRequest::query() const {
- return *query_;
- }
- inline void SearchRequest::set_query(const ::std::string& value) {
- _set_bit(0);
- if (query_ == &_default_query_) {
- query_ = new ::std::string;
- }
- query_->assign(value);
- }
- inline void SearchRequest::set_query(const char* value) {
- _set_bit(0);
- if (query_ == &_default_query_) {
- query_ = new ::std::string;
- }
- query_->assign(value);
- }
- inline void SearchRequest::set_query(const void* value, size_t size) {
- _set_bit(0);
- if (query_ == &_default_query_) {
- query_ = new ::std::string;
- }
- query_->assign(reinterpret_cast<const char*>(value), size);
- }
- inline ::std::string* SearchRequest::mutable_query() {
- _set_bit(0);
- if (query_ == &_default_query_) {
- query_ = new ::std::string;
- }
- return query_;
- }
- // -------------------------------------------------------------------
- // Foo
- #endif // PROTOBUF_test_2epro__INCLUDED