unittest_embed_optimize_for.pb.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_embed_optimize_for.proto
  3. #ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fembed_5foptimize_5ffor_2eproto
  4. #define PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fembed_5foptimize_5ffor_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_optimize_for.pb.h>
  29. // @@protoc_insertion_point(includes)
  30. #define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fembed_5foptimize_5ffor_2eproto
  31. namespace protobuf_google_2fprotobuf_2funittest_5fembed_5foptimize_5ffor_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[1];
  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_5fembed_5foptimize_5ffor_2eproto
  43. namespace protobuf_unittest {
  44. class TestEmbedOptimizedForSize;
  45. class TestEmbedOptimizedForSizeDefaultTypeInternal;
  46. extern TestEmbedOptimizedForSizeDefaultTypeInternal _TestEmbedOptimizedForSize_default_instance_;
  47. } // namespace protobuf_unittest
  48. namespace google {
  49. namespace protobuf {
  50. template<> ::protobuf_unittest::TestEmbedOptimizedForSize* Arena::CreateMaybeMessage<::protobuf_unittest::TestEmbedOptimizedForSize>(Arena*);
  51. } // namespace protobuf
  52. } // namespace google
  53. namespace protobuf_unittest {
  54. // ===================================================================
  55. class TestEmbedOptimizedForSize : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf_unittest.TestEmbedOptimizedForSize) */ {
  56. public:
  57. TestEmbedOptimizedForSize();
  58. virtual ~TestEmbedOptimizedForSize();
  59. TestEmbedOptimizedForSize(const TestEmbedOptimizedForSize& from);
  60. inline TestEmbedOptimizedForSize& operator=(const TestEmbedOptimizedForSize& from) {
  61. CopyFrom(from);
  62. return *this;
  63. }
  64. #if LANG_CXX11
  65. TestEmbedOptimizedForSize(TestEmbedOptimizedForSize&& from) noexcept
  66. : TestEmbedOptimizedForSize() {
  67. *this = ::std::move(from);
  68. }
  69. inline TestEmbedOptimizedForSize& operator=(TestEmbedOptimizedForSize&& from) noexcept {
  70. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  71. if (this != &from) InternalSwap(&from);
  72. } else {
  73. CopyFrom(from);
  74. }
  75. return *this;
  76. }
  77. #endif
  78. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  79. return _internal_metadata_.unknown_fields();
  80. }
  81. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  82. return _internal_metadata_.mutable_unknown_fields();
  83. }
  84. static const ::google::protobuf::Descriptor* descriptor();
  85. static const TestEmbedOptimizedForSize& default_instance();
  86. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  87. static inline const TestEmbedOptimizedForSize* internal_default_instance() {
  88. return reinterpret_cast<const TestEmbedOptimizedForSize*>(
  89. &_TestEmbedOptimizedForSize_default_instance_);
  90. }
  91. static constexpr int kIndexInFileMessages =
  92. 0;
  93. void Swap(TestEmbedOptimizedForSize* other);
  94. friend void swap(TestEmbedOptimizedForSize& a, TestEmbedOptimizedForSize& b) {
  95. a.Swap(&b);
  96. }
  97. // implements Message ----------------------------------------------
  98. inline TestEmbedOptimizedForSize* New() const final {
  99. return CreateMaybeMessage<TestEmbedOptimizedForSize>(NULL);
  100. }
  101. TestEmbedOptimizedForSize* New(::google::protobuf::Arena* arena) const final {
  102. return CreateMaybeMessage<TestEmbedOptimizedForSize>(arena);
  103. }
  104. void CopyFrom(const ::google::protobuf::Message& from) final;
  105. void MergeFrom(const ::google::protobuf::Message& from) final;
  106. void CopyFrom(const TestEmbedOptimizedForSize& from);
  107. void MergeFrom(const TestEmbedOptimizedForSize& from);
  108. void Clear() final;
  109. bool IsInitialized() const final;
  110. size_t ByteSizeLong() const final;
  111. bool MergePartialFromCodedStream(
  112. ::google::protobuf::io::CodedInputStream* input) final;
  113. void SerializeWithCachedSizes(
  114. ::google::protobuf::io::CodedOutputStream* output) const final;
  115. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  116. bool deterministic, ::google::protobuf::uint8* target) const final;
  117. int GetCachedSize() const final { return _cached_size_.Get(); }
  118. private:
  119. void SharedCtor();
  120. void SharedDtor();
  121. void SetCachedSize(int size) const final;
  122. void InternalSwap(TestEmbedOptimizedForSize* other);
  123. private:
  124. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  125. return NULL;
  126. }
  127. inline void* MaybeArenaPtr() const {
  128. return NULL;
  129. }
  130. public:
  131. ::google::protobuf::Metadata GetMetadata() const final;
  132. // nested types ----------------------------------------------------
  133. // accessors -------------------------------------------------------
  134. // repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
  135. int repeated_message_size() const;
  136. void clear_repeated_message();
  137. static const int kRepeatedMessageFieldNumber = 2;
  138. ::protobuf_unittest::TestOptimizedForSize* mutable_repeated_message(int index);
  139. ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestOptimizedForSize >*
  140. mutable_repeated_message();
  141. const ::protobuf_unittest::TestOptimizedForSize& repeated_message(int index) const;
  142. ::protobuf_unittest::TestOptimizedForSize* add_repeated_message();
  143. const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestOptimizedForSize >&
  144. repeated_message() const;
  145. // optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
  146. bool has_optional_message() const;
  147. void clear_optional_message();
  148. static const int kOptionalMessageFieldNumber = 1;
  149. private:
  150. const ::protobuf_unittest::TestOptimizedForSize& _internal_optional_message() const;
  151. public:
  152. const ::protobuf_unittest::TestOptimizedForSize& optional_message() const;
  153. ::protobuf_unittest::TestOptimizedForSize* release_optional_message();
  154. ::protobuf_unittest::TestOptimizedForSize* mutable_optional_message();
  155. void set_allocated_optional_message(::protobuf_unittest::TestOptimizedForSize* optional_message);
  156. // @@protoc_insertion_point(class_scope:protobuf_unittest.TestEmbedOptimizedForSize)
  157. private:
  158. void set_has_optional_message();
  159. void clear_has_optional_message();
  160. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  161. ::google::protobuf::internal::HasBits<1> _has_bits_;
  162. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  163. ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestOptimizedForSize > repeated_message_;
  164. ::protobuf_unittest::TestOptimizedForSize* optional_message_;
  165. friend struct ::protobuf_google_2fprotobuf_2funittest_5fembed_5foptimize_5ffor_2eproto::TableStruct;
  166. };
  167. // ===================================================================
  168. // ===================================================================
  169. #ifdef __GNUC__
  170. #pragma GCC diagnostic push
  171. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  172. #endif // __GNUC__
  173. // TestEmbedOptimizedForSize
  174. // optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
  175. inline bool TestEmbedOptimizedForSize::has_optional_message() const {
  176. return (_has_bits_[0] & 0x00000001u) != 0;
  177. }
  178. inline void TestEmbedOptimizedForSize::set_has_optional_message() {
  179. _has_bits_[0] |= 0x00000001u;
  180. }
  181. inline void TestEmbedOptimizedForSize::clear_has_optional_message() {
  182. _has_bits_[0] &= ~0x00000001u;
  183. }
  184. inline const ::protobuf_unittest::TestOptimizedForSize& TestEmbedOptimizedForSize::_internal_optional_message() const {
  185. return *optional_message_;
  186. }
  187. inline const ::protobuf_unittest::TestOptimizedForSize& TestEmbedOptimizedForSize::optional_message() const {
  188. const ::protobuf_unittest::TestOptimizedForSize* p = optional_message_;
  189. // @@protoc_insertion_point(field_get:protobuf_unittest.TestEmbedOptimizedForSize.optional_message)
  190. return p != NULL ? *p : *reinterpret_cast<const ::protobuf_unittest::TestOptimizedForSize*>(
  191. &::protobuf_unittest::_TestOptimizedForSize_default_instance_);
  192. }
  193. inline ::protobuf_unittest::TestOptimizedForSize* TestEmbedOptimizedForSize::release_optional_message() {
  194. // @@protoc_insertion_point(field_release:protobuf_unittest.TestEmbedOptimizedForSize.optional_message)
  195. clear_has_optional_message();
  196. ::protobuf_unittest::TestOptimizedForSize* temp = optional_message_;
  197. optional_message_ = NULL;
  198. return temp;
  199. }
  200. inline ::protobuf_unittest::TestOptimizedForSize* TestEmbedOptimizedForSize::mutable_optional_message() {
  201. set_has_optional_message();
  202. if (optional_message_ == NULL) {
  203. auto* p = CreateMaybeMessage<::protobuf_unittest::TestOptimizedForSize>(GetArenaNoVirtual());
  204. optional_message_ = p;
  205. }
  206. // @@protoc_insertion_point(field_mutable:protobuf_unittest.TestEmbedOptimizedForSize.optional_message)
  207. return optional_message_;
  208. }
  209. inline void TestEmbedOptimizedForSize::set_allocated_optional_message(::protobuf_unittest::TestOptimizedForSize* optional_message) {
  210. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  211. if (message_arena == NULL) {
  212. delete reinterpret_cast< ::google::protobuf::MessageLite*>(optional_message_);
  213. }
  214. if (optional_message) {
  215. ::google::protobuf::Arena* submessage_arena = NULL;
  216. if (message_arena != submessage_arena) {
  217. optional_message = ::google::protobuf::internal::GetOwnedMessage(
  218. message_arena, optional_message, submessage_arena);
  219. }
  220. set_has_optional_message();
  221. } else {
  222. clear_has_optional_message();
  223. }
  224. optional_message_ = optional_message;
  225. // @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestEmbedOptimizedForSize.optional_message)
  226. }
  227. // repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
  228. inline int TestEmbedOptimizedForSize::repeated_message_size() const {
  229. return repeated_message_.size();
  230. }
  231. inline ::protobuf_unittest::TestOptimizedForSize* TestEmbedOptimizedForSize::mutable_repeated_message(int index) {
  232. // @@protoc_insertion_point(field_mutable:protobuf_unittest.TestEmbedOptimizedForSize.repeated_message)
  233. return repeated_message_.Mutable(index);
  234. }
  235. inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestOptimizedForSize >*
  236. TestEmbedOptimizedForSize::mutable_repeated_message() {
  237. // @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestEmbedOptimizedForSize.repeated_message)
  238. return &repeated_message_;
  239. }
  240. inline const ::protobuf_unittest::TestOptimizedForSize& TestEmbedOptimizedForSize::repeated_message(int index) const {
  241. // @@protoc_insertion_point(field_get:protobuf_unittest.TestEmbedOptimizedForSize.repeated_message)
  242. return repeated_message_.Get(index);
  243. }
  244. inline ::protobuf_unittest::TestOptimizedForSize* TestEmbedOptimizedForSize::add_repeated_message() {
  245. // @@protoc_insertion_point(field_add:protobuf_unittest.TestEmbedOptimizedForSize.repeated_message)
  246. return repeated_message_.Add();
  247. }
  248. inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestOptimizedForSize >&
  249. TestEmbedOptimizedForSize::repeated_message() const {
  250. // @@protoc_insertion_point(field_list:protobuf_unittest.TestEmbedOptimizedForSize.repeated_message)
  251. return repeated_message_;
  252. }
  253. #ifdef __GNUC__
  254. #pragma GCC diagnostic pop
  255. #endif // __GNUC__
  256. // @@protoc_insertion_point(namespace_scope)
  257. } // namespace protobuf_unittest
  258. // @@protoc_insertion_point(global_scope)
  259. #endif // PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fembed_5foptimize_5ffor_2eproto