unittest_arena.pb.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_arena.proto
  3. #ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5farena_2eproto
  4. #define PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5farena_2eproto
  5. #include <string>
  6. #include <google/protobuf/stubs/common.h>
  7. #if GOOGLE_PROTOBUF_VERSION < 3006001
  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 3006001 < 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/io/coded_stream.h>
  18. #include <google/protobuf/arena.h>
  19. #include <google/protobuf/arenastring.h>
  20. #include <google/protobuf/generated_message_table_driven.h>
  21. #include <google/protobuf/generated_message_util.h>
  22. #include <google/protobuf/inlined_string_field.h>
  23. #include <google/protobuf/metadata.h>
  24. #include <google/protobuf/message.h>
  25. #include <google/protobuf/repeated_field.h> // IWYU pragma: export
  26. #include <google/protobuf/extension_set.h> // IWYU pragma: export
  27. #include <google/protobuf/unknown_field_set.h>
  28. #include <google/protobuf/unittest_no_arena_import.pb.h>
  29. // @@protoc_insertion_point(includes)
  30. #define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5farena_2eproto
  31. namespace protobuf_google_2fprotobuf_2funittest_5farena_2eproto {
  32. // Internal implementation detail -- do not use these members.
  33. struct TableStruct {
  34. static const ::google::protobuf::internal::ParseTableField entries[];
  35. static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
  36. static const ::google::protobuf::internal::ParseTable schema[2];
  37. static const ::google::protobuf::internal::FieldMetadata field_metadata[];
  38. static const ::google::protobuf::internal::SerializationTable serialization_table[];
  39. static const ::google::protobuf::uint32 offsets[];
  40. };
  41. void AddDescriptors();
  42. } // namespace protobuf_google_2fprotobuf_2funittest_5farena_2eproto
  43. namespace proto2_arena_unittest {
  44. class ArenaMessage;
  45. class ArenaMessageDefaultTypeInternal;
  46. extern ArenaMessageDefaultTypeInternal _ArenaMessage_default_instance_;
  47. class NestedMessage;
  48. class NestedMessageDefaultTypeInternal;
  49. extern NestedMessageDefaultTypeInternal _NestedMessage_default_instance_;
  50. } // namespace proto2_arena_unittest
  51. namespace google {
  52. namespace protobuf {
  53. template<> ::proto2_arena_unittest::ArenaMessage* Arena::CreateMaybeMessage<::proto2_arena_unittest::ArenaMessage>(Arena*);
  54. template<> ::proto2_arena_unittest::NestedMessage* Arena::CreateMaybeMessage<::proto2_arena_unittest::NestedMessage>(Arena*);
  55. } // namespace protobuf
  56. } // namespace google
  57. namespace proto2_arena_unittest {
  58. // ===================================================================
  59. class NestedMessage : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto2_arena_unittest.NestedMessage) */ {
  60. public:
  61. NestedMessage();
  62. virtual ~NestedMessage();
  63. NestedMessage(const NestedMessage& from);
  64. inline NestedMessage& operator=(const NestedMessage& from) {
  65. CopyFrom(from);
  66. return *this;
  67. }
  68. #if LANG_CXX11
  69. NestedMessage(NestedMessage&& from) noexcept
  70. : NestedMessage() {
  71. *this = ::std::move(from);
  72. }
  73. inline NestedMessage& operator=(NestedMessage&& from) noexcept {
  74. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  75. if (this != &from) InternalSwap(&from);
  76. } else {
  77. CopyFrom(from);
  78. }
  79. return *this;
  80. }
  81. #endif
  82. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  83. return _internal_metadata_.unknown_fields();
  84. }
  85. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  86. return _internal_metadata_.mutable_unknown_fields();
  87. }
  88. inline ::google::protobuf::Arena* GetArena() const final {
  89. return GetArenaNoVirtual();
  90. }
  91. inline void* GetMaybeArenaPointer() const final {
  92. return MaybeArenaPtr();
  93. }
  94. static const ::google::protobuf::Descriptor* descriptor();
  95. static const NestedMessage& default_instance();
  96. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  97. static inline const NestedMessage* internal_default_instance() {
  98. return reinterpret_cast<const NestedMessage*>(
  99. &_NestedMessage_default_instance_);
  100. }
  101. static constexpr int kIndexInFileMessages =
  102. 0;
  103. void UnsafeArenaSwap(NestedMessage* other);
  104. void Swap(NestedMessage* other);
  105. friend void swap(NestedMessage& a, NestedMessage& b) {
  106. a.Swap(&b);
  107. }
  108. // implements Message ----------------------------------------------
  109. inline NestedMessage* New() const final {
  110. return CreateMaybeMessage<NestedMessage>(NULL);
  111. }
  112. NestedMessage* New(::google::protobuf::Arena* arena) const final {
  113. return CreateMaybeMessage<NestedMessage>(arena);
  114. }
  115. void CopyFrom(const ::google::protobuf::Message& from) final;
  116. void MergeFrom(const ::google::protobuf::Message& from) final;
  117. void CopyFrom(const NestedMessage& from);
  118. void MergeFrom(const NestedMessage& from);
  119. void Clear() final;
  120. bool IsInitialized() const final;
  121. size_t ByteSizeLong() const final;
  122. bool MergePartialFromCodedStream(
  123. ::google::protobuf::io::CodedInputStream* input) final;
  124. void SerializeWithCachedSizes(
  125. ::google::protobuf::io::CodedOutputStream* output) const final;
  126. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  127. bool deterministic, ::google::protobuf::uint8* target) const final;
  128. int GetCachedSize() const final { return _cached_size_.Get(); }
  129. private:
  130. void SharedCtor();
  131. void SharedDtor();
  132. void SetCachedSize(int size) const final;
  133. void InternalSwap(NestedMessage* other);
  134. protected:
  135. explicit NestedMessage(::google::protobuf::Arena* arena);
  136. private:
  137. static void ArenaDtor(void* object);
  138. inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  139. private:
  140. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  141. return _internal_metadata_.arena();
  142. }
  143. inline void* MaybeArenaPtr() const {
  144. return _internal_metadata_.raw_arena_ptr();
  145. }
  146. public:
  147. ::google::protobuf::Metadata GetMetadata() const final;
  148. // nested types ----------------------------------------------------
  149. // accessors -------------------------------------------------------
  150. // optional int32 d = 1;
  151. bool has_d() const;
  152. void clear_d();
  153. static const int kDFieldNumber = 1;
  154. ::google::protobuf::int32 d() const;
  155. void set_d(::google::protobuf::int32 value);
  156. // @@protoc_insertion_point(class_scope:proto2_arena_unittest.NestedMessage)
  157. private:
  158. void set_has_d();
  159. void clear_has_d();
  160. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  161. template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  162. typedef void InternalArenaConstructable_;
  163. typedef void DestructorSkippable_;
  164. ::google::protobuf::internal::HasBits<1> _has_bits_;
  165. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  166. ::google::protobuf::int32 d_;
  167. friend struct ::protobuf_google_2fprotobuf_2funittest_5farena_2eproto::TableStruct;
  168. };
  169. // -------------------------------------------------------------------
  170. class ArenaMessage : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto2_arena_unittest.ArenaMessage) */ {
  171. public:
  172. ArenaMessage();
  173. virtual ~ArenaMessage();
  174. ArenaMessage(const ArenaMessage& from);
  175. inline ArenaMessage& operator=(const ArenaMessage& from) {
  176. CopyFrom(from);
  177. return *this;
  178. }
  179. #if LANG_CXX11
  180. ArenaMessage(ArenaMessage&& from) noexcept
  181. : ArenaMessage() {
  182. *this = ::std::move(from);
  183. }
  184. inline ArenaMessage& operator=(ArenaMessage&& from) noexcept {
  185. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  186. if (this != &from) InternalSwap(&from);
  187. } else {
  188. CopyFrom(from);
  189. }
  190. return *this;
  191. }
  192. #endif
  193. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  194. return _internal_metadata_.unknown_fields();
  195. }
  196. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  197. return _internal_metadata_.mutable_unknown_fields();
  198. }
  199. inline ::google::protobuf::Arena* GetArena() const final {
  200. return GetArenaNoVirtual();
  201. }
  202. inline void* GetMaybeArenaPointer() const final {
  203. return MaybeArenaPtr();
  204. }
  205. static const ::google::protobuf::Descriptor* descriptor();
  206. static const ArenaMessage& default_instance();
  207. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  208. static inline const ArenaMessage* internal_default_instance() {
  209. return reinterpret_cast<const ArenaMessage*>(
  210. &_ArenaMessage_default_instance_);
  211. }
  212. static constexpr int kIndexInFileMessages =
  213. 1;
  214. void UnsafeArenaSwap(ArenaMessage* other);
  215. void Swap(ArenaMessage* other);
  216. friend void swap(ArenaMessage& a, ArenaMessage& b) {
  217. a.Swap(&b);
  218. }
  219. // implements Message ----------------------------------------------
  220. inline ArenaMessage* New() const final {
  221. return CreateMaybeMessage<ArenaMessage>(NULL);
  222. }
  223. ArenaMessage* New(::google::protobuf::Arena* arena) const final {
  224. return CreateMaybeMessage<ArenaMessage>(arena);
  225. }
  226. void CopyFrom(const ::google::protobuf::Message& from) final;
  227. void MergeFrom(const ::google::protobuf::Message& from) final;
  228. void CopyFrom(const ArenaMessage& from);
  229. void MergeFrom(const ArenaMessage& from);
  230. void Clear() final;
  231. bool IsInitialized() const final;
  232. size_t ByteSizeLong() const final;
  233. bool MergePartialFromCodedStream(
  234. ::google::protobuf::io::CodedInputStream* input) final;
  235. void SerializeWithCachedSizes(
  236. ::google::protobuf::io::CodedOutputStream* output) const final;
  237. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  238. bool deterministic, ::google::protobuf::uint8* target) const final;
  239. int GetCachedSize() const final { return _cached_size_.Get(); }
  240. private:
  241. void SharedCtor();
  242. void SharedDtor();
  243. void SetCachedSize(int size) const final;
  244. void InternalSwap(ArenaMessage* other);
  245. protected:
  246. explicit ArenaMessage(::google::protobuf::Arena* arena);
  247. private:
  248. static void ArenaDtor(void* object);
  249. inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  250. private:
  251. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  252. return _internal_metadata_.arena();
  253. }
  254. inline void* MaybeArenaPtr() const {
  255. return _internal_metadata_.raw_arena_ptr();
  256. }
  257. public:
  258. ::google::protobuf::Metadata GetMetadata() const final;
  259. // nested types ----------------------------------------------------
  260. // accessors -------------------------------------------------------
  261. // repeated .proto2_arena_unittest.NestedMessage repeated_nested_message = 1;
  262. int repeated_nested_message_size() const;
  263. void clear_repeated_nested_message();
  264. static const int kRepeatedNestedMessageFieldNumber = 1;
  265. ::proto2_arena_unittest::NestedMessage* mutable_repeated_nested_message(int index);
  266. ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::NestedMessage >*
  267. mutable_repeated_nested_message();
  268. const ::proto2_arena_unittest::NestedMessage& repeated_nested_message(int index) const;
  269. ::proto2_arena_unittest::NestedMessage* add_repeated_nested_message();
  270. const ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::NestedMessage >&
  271. repeated_nested_message() const;
  272. // repeated .proto2_arena_unittest.ImportNoArenaNestedMessage repeated_import_no_arena_message = 2;
  273. int repeated_import_no_arena_message_size() const;
  274. void clear_repeated_import_no_arena_message();
  275. static const int kRepeatedImportNoArenaMessageFieldNumber = 2;
  276. ::proto2_arena_unittest::ImportNoArenaNestedMessage* mutable_repeated_import_no_arena_message(int index);
  277. ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::ImportNoArenaNestedMessage >*
  278. mutable_repeated_import_no_arena_message();
  279. const ::proto2_arena_unittest::ImportNoArenaNestedMessage& repeated_import_no_arena_message(int index) const;
  280. ::proto2_arena_unittest::ImportNoArenaNestedMessage* add_repeated_import_no_arena_message();
  281. const ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::ImportNoArenaNestedMessage >&
  282. repeated_import_no_arena_message() const;
  283. // @@protoc_insertion_point(class_scope:proto2_arena_unittest.ArenaMessage)
  284. private:
  285. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  286. template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  287. typedef void InternalArenaConstructable_;
  288. typedef void DestructorSkippable_;
  289. ::google::protobuf::internal::HasBits<1> _has_bits_;
  290. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  291. ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::NestedMessage > repeated_nested_message_;
  292. ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::ImportNoArenaNestedMessage > repeated_import_no_arena_message_;
  293. friend struct ::protobuf_google_2fprotobuf_2funittest_5farena_2eproto::TableStruct;
  294. };
  295. // ===================================================================
  296. // ===================================================================
  297. #ifdef __GNUC__
  298. #pragma GCC diagnostic push
  299. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  300. #endif // __GNUC__
  301. // NestedMessage
  302. // optional int32 d = 1;
  303. inline bool NestedMessage::has_d() const {
  304. return (_has_bits_[0] & 0x00000001u) != 0;
  305. }
  306. inline void NestedMessage::set_has_d() {
  307. _has_bits_[0] |= 0x00000001u;
  308. }
  309. inline void NestedMessage::clear_has_d() {
  310. _has_bits_[0] &= ~0x00000001u;
  311. }
  312. inline void NestedMessage::clear_d() {
  313. d_ = 0;
  314. clear_has_d();
  315. }
  316. inline ::google::protobuf::int32 NestedMessage::d() const {
  317. // @@protoc_insertion_point(field_get:proto2_arena_unittest.NestedMessage.d)
  318. return d_;
  319. }
  320. inline void NestedMessage::set_d(::google::protobuf::int32 value) {
  321. set_has_d();
  322. d_ = value;
  323. // @@protoc_insertion_point(field_set:proto2_arena_unittest.NestedMessage.d)
  324. }
  325. // -------------------------------------------------------------------
  326. // ArenaMessage
  327. // repeated .proto2_arena_unittest.NestedMessage repeated_nested_message = 1;
  328. inline int ArenaMessage::repeated_nested_message_size() const {
  329. return repeated_nested_message_.size();
  330. }
  331. inline void ArenaMessage::clear_repeated_nested_message() {
  332. repeated_nested_message_.Clear();
  333. }
  334. inline ::proto2_arena_unittest::NestedMessage* ArenaMessage::mutable_repeated_nested_message(int index) {
  335. // @@protoc_insertion_point(field_mutable:proto2_arena_unittest.ArenaMessage.repeated_nested_message)
  336. return repeated_nested_message_.Mutable(index);
  337. }
  338. inline ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::NestedMessage >*
  339. ArenaMessage::mutable_repeated_nested_message() {
  340. // @@protoc_insertion_point(field_mutable_list:proto2_arena_unittest.ArenaMessage.repeated_nested_message)
  341. return &repeated_nested_message_;
  342. }
  343. inline const ::proto2_arena_unittest::NestedMessage& ArenaMessage::repeated_nested_message(int index) const {
  344. // @@protoc_insertion_point(field_get:proto2_arena_unittest.ArenaMessage.repeated_nested_message)
  345. return repeated_nested_message_.Get(index);
  346. }
  347. inline ::proto2_arena_unittest::NestedMessage* ArenaMessage::add_repeated_nested_message() {
  348. // @@protoc_insertion_point(field_add:proto2_arena_unittest.ArenaMessage.repeated_nested_message)
  349. return repeated_nested_message_.Add();
  350. }
  351. inline const ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::NestedMessage >&
  352. ArenaMessage::repeated_nested_message() const {
  353. // @@protoc_insertion_point(field_list:proto2_arena_unittest.ArenaMessage.repeated_nested_message)
  354. return repeated_nested_message_;
  355. }
  356. // repeated .proto2_arena_unittest.ImportNoArenaNestedMessage repeated_import_no_arena_message = 2;
  357. inline int ArenaMessage::repeated_import_no_arena_message_size() const {
  358. return repeated_import_no_arena_message_.size();
  359. }
  360. inline ::proto2_arena_unittest::ImportNoArenaNestedMessage* ArenaMessage::mutable_repeated_import_no_arena_message(int index) {
  361. // @@protoc_insertion_point(field_mutable:proto2_arena_unittest.ArenaMessage.repeated_import_no_arena_message)
  362. return repeated_import_no_arena_message_.Mutable(index);
  363. }
  364. inline ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::ImportNoArenaNestedMessage >*
  365. ArenaMessage::mutable_repeated_import_no_arena_message() {
  366. // @@protoc_insertion_point(field_mutable_list:proto2_arena_unittest.ArenaMessage.repeated_import_no_arena_message)
  367. return &repeated_import_no_arena_message_;
  368. }
  369. inline const ::proto2_arena_unittest::ImportNoArenaNestedMessage& ArenaMessage::repeated_import_no_arena_message(int index) const {
  370. // @@protoc_insertion_point(field_get:proto2_arena_unittest.ArenaMessage.repeated_import_no_arena_message)
  371. return repeated_import_no_arena_message_.Get(index);
  372. }
  373. inline ::proto2_arena_unittest::ImportNoArenaNestedMessage* ArenaMessage::add_repeated_import_no_arena_message() {
  374. // @@protoc_insertion_point(field_add:proto2_arena_unittest.ArenaMessage.repeated_import_no_arena_message)
  375. return repeated_import_no_arena_message_.Add();
  376. }
  377. inline const ::google::protobuf::RepeatedPtrField< ::proto2_arena_unittest::ImportNoArenaNestedMessage >&
  378. ArenaMessage::repeated_import_no_arena_message() const {
  379. // @@protoc_insertion_point(field_list:proto2_arena_unittest.ArenaMessage.repeated_import_no_arena_message)
  380. return repeated_import_no_arena_message_;
  381. }
  382. #ifdef __GNUC__
  383. #pragma GCC diagnostic pop
  384. #endif // __GNUC__
  385. // -------------------------------------------------------------------
  386. // @@protoc_insertion_point(namespace_scope)
  387. } // namespace proto2_arena_unittest
  388. // @@protoc_insertion_point(global_scope)
  389. #endif // PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5farena_2eproto