/bin/cpp/custom/rpc/rpc.pb.h

https://github.com/Ehnn/proto · C Header · 221 lines · 160 code · 42 blank · 19 comment · 11 complexity · dc41a0aa2b69cd2ccea89859437d4bf2 MD5 · raw file

  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: custom/rpc/rpc.proto
  3. #ifndef PROTOBUF_custom_2frpc_2frpc_2eproto__INCLUDED
  4. #define PROTOBUF_custom_2frpc_2frpc_2eproto__INCLUDED
  5. #include <string>
  6. #include <google/protobuf/stubs/common.h>
  7. #if GOOGLE_PROTOBUF_VERSION < 2003000
  8. #error This file was generated by a newer version of protoc which is
  9. #error incompatible with your Protocol Buffer headers. Please update
  10. #error your headers.
  11. #endif
  12. #if 2003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
  13. #error This file was generated by an older version of protoc which is
  14. #error incompatible with your Protocol Buffer headers. Please
  15. #error regenerate this file with a newer version of protoc.
  16. #endif
  17. #include <google/protobuf/generated_message_util.h>
  18. #include <google/protobuf/repeated_field.h>
  19. #include <google/protobuf/extension_set.h>
  20. #include <google/protobuf/generated_message_reflection.h>
  21. // @@protoc_insertion_point(includes)
  22. namespace custom {
  23. namespace rpc {
  24. // Internal implementation detail -- do not call these.
  25. void protobuf_AddDesc_custom_2frpc_2frpc_2eproto();
  26. void protobuf_AssignDesc_custom_2frpc_2frpc_2eproto();
  27. void protobuf_ShutdownFile_custom_2frpc_2frpc_2eproto();
  28. class Packet;
  29. // ===================================================================
  30. class Packet : public ::google::protobuf::Message {
  31. public:
  32. Packet();
  33. virtual ~Packet();
  34. Packet(const Packet& from);
  35. inline Packet& operator=(const Packet& from) {
  36. CopyFrom(from);
  37. return *this;
  38. }
  39. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  40. return _unknown_fields_;
  41. }
  42. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  43. return &_unknown_fields_;
  44. }
  45. static const ::google::protobuf::Descriptor* descriptor();
  46. static const Packet& default_instance();
  47. void Swap(Packet* other);
  48. // implements Message ----------------------------------------------
  49. Packet* New() const;
  50. void CopyFrom(const ::google::protobuf::Message& from);
  51. void MergeFrom(const ::google::protobuf::Message& from);
  52. void CopyFrom(const Packet& from);
  53. void MergeFrom(const Packet& from);
  54. void Clear();
  55. bool IsInitialized() const;
  56. int ByteSize() const;
  57. bool MergePartialFromCodedStream(
  58. ::google::protobuf::io::CodedInputStream* input);
  59. void SerializeWithCachedSizes(
  60. ::google::protobuf::io::CodedOutputStream* output) const;
  61. ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
  62. int GetCachedSize() const { return _cached_size_; }
  63. private:
  64. void SharedCtor();
  65. void SharedDtor();
  66. void SetCachedSize(int size) const;
  67. public:
  68. ::google::protobuf::Metadata GetMetadata() const;
  69. // nested types ----------------------------------------------------
  70. // accessors -------------------------------------------------------
  71. // required uint64 size = 1;
  72. inline bool has_size() const;
  73. inline void clear_size();
  74. static const int kSizeFieldNumber = 1;
  75. inline ::google::protobuf::uint64 size() const;
  76. inline void set_size(::google::protobuf::uint64 value);
  77. // optional bytes payload = 2;
  78. inline bool has_payload() const;
  79. inline void clear_payload();
  80. static const int kPayloadFieldNumber = 2;
  81. inline const ::std::string& payload() const;
  82. inline void set_payload(const ::std::string& value);
  83. inline void set_payload(const char* value);
  84. inline void set_payload(const void* value, size_t size);
  85. inline ::std::string* mutable_payload();
  86. // @@protoc_insertion_point(class_scope:custom.rpc.Packet)
  87. private:
  88. ::google::protobuf::UnknownFieldSet _unknown_fields_;
  89. mutable int _cached_size_;
  90. ::google::protobuf::uint64 size_;
  91. ::std::string* payload_;
  92. static const ::std::string _default_payload_;
  93. friend void protobuf_AddDesc_custom_2frpc_2frpc_2eproto();
  94. friend void protobuf_AssignDesc_custom_2frpc_2frpc_2eproto();
  95. friend void protobuf_ShutdownFile_custom_2frpc_2frpc_2eproto();
  96. ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
  97. // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
  98. inline bool _has_bit(int index) const {
  99. return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
  100. }
  101. inline void _set_bit(int index) {
  102. _has_bits_[index / 32] |= (1u << (index % 32));
  103. }
  104. inline void _clear_bit(int index) {
  105. _has_bits_[index / 32] &= ~(1u << (index % 32));
  106. }
  107. void InitAsDefaultInstance();
  108. static Packet* default_instance_;
  109. };
  110. // ===================================================================
  111. // ===================================================================
  112. // Packet
  113. // required uint64 size = 1;
  114. inline bool Packet::has_size() const {
  115. return _has_bit(0);
  116. }
  117. inline void Packet::clear_size() {
  118. size_ = GOOGLE_ULONGLONG(0);
  119. _clear_bit(0);
  120. }
  121. inline ::google::protobuf::uint64 Packet::size() const {
  122. return size_;
  123. }
  124. inline void Packet::set_size(::google::protobuf::uint64 value) {
  125. _set_bit(0);
  126. size_ = value;
  127. }
  128. // optional bytes payload = 2;
  129. inline bool Packet::has_payload() const {
  130. return _has_bit(1);
  131. }
  132. inline void Packet::clear_payload() {
  133. if (payload_ != &_default_payload_) {
  134. payload_->clear();
  135. }
  136. _clear_bit(1);
  137. }
  138. inline const ::std::string& Packet::payload() const {
  139. return *payload_;
  140. }
  141. inline void Packet::set_payload(const ::std::string& value) {
  142. _set_bit(1);
  143. if (payload_ == &_default_payload_) {
  144. payload_ = new ::std::string;
  145. }
  146. payload_->assign(value);
  147. }
  148. inline void Packet::set_payload(const char* value) {
  149. _set_bit(1);
  150. if (payload_ == &_default_payload_) {
  151. payload_ = new ::std::string;
  152. }
  153. payload_->assign(value);
  154. }
  155. inline void Packet::set_payload(const void* value, size_t size) {
  156. _set_bit(1);
  157. if (payload_ == &_default_payload_) {
  158. payload_ = new ::std::string;
  159. }
  160. payload_->assign(reinterpret_cast<const char*>(value), size);
  161. }
  162. inline ::std::string* Packet::mutable_payload() {
  163. _set_bit(1);
  164. if (payload_ == &_default_payload_) {
  165. payload_ = new ::std::string;
  166. }
  167. return payload_;
  168. }
  169. // @@protoc_insertion_point(namespace_scope)
  170. } // namespace rpc
  171. } // namespace custom
  172. #ifndef SWIG
  173. namespace google {
  174. namespace protobuf {
  175. } // namespace google
  176. } // namespace protobuf
  177. #endif // SWIG
  178. // @@protoc_insertion_point(global_scope)
  179. #endif // PROTOBUF_custom_2frpc_2frpc_2eproto__INCLUDED