unittest_mset.pb.h 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_mset.proto
  3. #ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fmset_2eproto
  4. #define PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fmset_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_mset_wire_format.pb.h>
  29. // @@protoc_insertion_point(includes)
  30. #define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_2eproto
  31. namespace protobuf_google_2fprotobuf_2funittest_5fmset_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[5];
  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_5fmset_2eproto
  43. namespace protobuf_unittest {
  44. class RawMessageSet;
  45. class RawMessageSetDefaultTypeInternal;
  46. extern RawMessageSetDefaultTypeInternal _RawMessageSet_default_instance_;
  47. class RawMessageSet_Item;
  48. class RawMessageSet_ItemDefaultTypeInternal;
  49. extern RawMessageSet_ItemDefaultTypeInternal _RawMessageSet_Item_default_instance_;
  50. class TestMessageSetContainer;
  51. class TestMessageSetContainerDefaultTypeInternal;
  52. extern TestMessageSetContainerDefaultTypeInternal _TestMessageSetContainer_default_instance_;
  53. class TestMessageSetExtension1;
  54. class TestMessageSetExtension1DefaultTypeInternal;
  55. extern TestMessageSetExtension1DefaultTypeInternal _TestMessageSetExtension1_default_instance_;
  56. class TestMessageSetExtension2;
  57. class TestMessageSetExtension2DefaultTypeInternal;
  58. extern TestMessageSetExtension2DefaultTypeInternal _TestMessageSetExtension2_default_instance_;
  59. } // namespace protobuf_unittest
  60. namespace google {
  61. namespace protobuf {
  62. template<> ::protobuf_unittest::RawMessageSet* Arena::CreateMaybeMessage<::protobuf_unittest::RawMessageSet>(Arena*);
  63. template<> ::protobuf_unittest::RawMessageSet_Item* Arena::CreateMaybeMessage<::protobuf_unittest::RawMessageSet_Item>(Arena*);
  64. template<> ::protobuf_unittest::TestMessageSetContainer* Arena::CreateMaybeMessage<::protobuf_unittest::TestMessageSetContainer>(Arena*);
  65. template<> ::protobuf_unittest::TestMessageSetExtension1* Arena::CreateMaybeMessage<::protobuf_unittest::TestMessageSetExtension1>(Arena*);
  66. template<> ::protobuf_unittest::TestMessageSetExtension2* Arena::CreateMaybeMessage<::protobuf_unittest::TestMessageSetExtension2>(Arena*);
  67. } // namespace protobuf
  68. } // namespace google
  69. namespace protobuf_unittest {
  70. // ===================================================================
  71. class TestMessageSetContainer : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf_unittest.TestMessageSetContainer) */ {
  72. public:
  73. TestMessageSetContainer();
  74. virtual ~TestMessageSetContainer();
  75. TestMessageSetContainer(const TestMessageSetContainer& from);
  76. inline TestMessageSetContainer& operator=(const TestMessageSetContainer& from) {
  77. CopyFrom(from);
  78. return *this;
  79. }
  80. #if LANG_CXX11
  81. TestMessageSetContainer(TestMessageSetContainer&& from) noexcept
  82. : TestMessageSetContainer() {
  83. *this = ::std::move(from);
  84. }
  85. inline TestMessageSetContainer& operator=(TestMessageSetContainer&& from) noexcept {
  86. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  87. if (this != &from) InternalSwap(&from);
  88. } else {
  89. CopyFrom(from);
  90. }
  91. return *this;
  92. }
  93. #endif
  94. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  95. return _internal_metadata_.unknown_fields();
  96. }
  97. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  98. return _internal_metadata_.mutable_unknown_fields();
  99. }
  100. inline ::google::protobuf::Arena* GetArena() const final {
  101. return GetArenaNoVirtual();
  102. }
  103. inline void* GetMaybeArenaPointer() const final {
  104. return MaybeArenaPtr();
  105. }
  106. static const ::google::protobuf::Descriptor* descriptor();
  107. static const TestMessageSetContainer& default_instance();
  108. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  109. static inline const TestMessageSetContainer* internal_default_instance() {
  110. return reinterpret_cast<const TestMessageSetContainer*>(
  111. &_TestMessageSetContainer_default_instance_);
  112. }
  113. static constexpr int kIndexInFileMessages =
  114. 0;
  115. void UnsafeArenaSwap(TestMessageSetContainer* other);
  116. void Swap(TestMessageSetContainer* other);
  117. friend void swap(TestMessageSetContainer& a, TestMessageSetContainer& b) {
  118. a.Swap(&b);
  119. }
  120. // implements Message ----------------------------------------------
  121. inline TestMessageSetContainer* New() const final {
  122. return CreateMaybeMessage<TestMessageSetContainer>(NULL);
  123. }
  124. TestMessageSetContainer* New(::google::protobuf::Arena* arena) const final {
  125. return CreateMaybeMessage<TestMessageSetContainer>(arena);
  126. }
  127. void CopyFrom(const ::google::protobuf::Message& from) final;
  128. void MergeFrom(const ::google::protobuf::Message& from) final;
  129. void CopyFrom(const TestMessageSetContainer& from);
  130. void MergeFrom(const TestMessageSetContainer& from);
  131. void Clear() final;
  132. bool IsInitialized() const final;
  133. size_t ByteSizeLong() const final;
  134. bool MergePartialFromCodedStream(
  135. ::google::protobuf::io::CodedInputStream* input) final;
  136. void SerializeWithCachedSizes(
  137. ::google::protobuf::io::CodedOutputStream* output) const final;
  138. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  139. bool deterministic, ::google::protobuf::uint8* target) const final;
  140. int GetCachedSize() const final { return _cached_size_.Get(); }
  141. private:
  142. void SharedCtor();
  143. void SharedDtor();
  144. void SetCachedSize(int size) const final;
  145. void InternalSwap(TestMessageSetContainer* other);
  146. protected:
  147. explicit TestMessageSetContainer(::google::protobuf::Arena* arena);
  148. private:
  149. static void ArenaDtor(void* object);
  150. inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  151. private:
  152. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  153. return _internal_metadata_.arena();
  154. }
  155. inline void* MaybeArenaPtr() const {
  156. return _internal_metadata_.raw_arena_ptr();
  157. }
  158. public:
  159. ::google::protobuf::Metadata GetMetadata() const final;
  160. // nested types ----------------------------------------------------
  161. // accessors -------------------------------------------------------
  162. // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
  163. bool has_message_set() const;
  164. void clear_message_set();
  165. static const int kMessageSetFieldNumber = 1;
  166. private:
  167. const ::proto2_wireformat_unittest::TestMessageSet& _internal_message_set() const;
  168. public:
  169. const ::proto2_wireformat_unittest::TestMessageSet& message_set() const;
  170. ::proto2_wireformat_unittest::TestMessageSet* release_message_set();
  171. ::proto2_wireformat_unittest::TestMessageSet* mutable_message_set();
  172. void set_allocated_message_set(::proto2_wireformat_unittest::TestMessageSet* message_set);
  173. void unsafe_arena_set_allocated_message_set(
  174. ::proto2_wireformat_unittest::TestMessageSet* message_set);
  175. ::proto2_wireformat_unittest::TestMessageSet* unsafe_arena_release_message_set();
  176. // @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageSetContainer)
  177. private:
  178. void set_has_message_set();
  179. void clear_has_message_set();
  180. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  181. template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  182. typedef void InternalArenaConstructable_;
  183. typedef void DestructorSkippable_;
  184. ::google::protobuf::internal::HasBits<1> _has_bits_;
  185. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  186. ::proto2_wireformat_unittest::TestMessageSet* message_set_;
  187. friend struct ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::TableStruct;
  188. };
  189. // -------------------------------------------------------------------
  190. class TestMessageSetExtension1 : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf_unittest.TestMessageSetExtension1) */ {
  191. public:
  192. TestMessageSetExtension1();
  193. virtual ~TestMessageSetExtension1();
  194. TestMessageSetExtension1(const TestMessageSetExtension1& from);
  195. inline TestMessageSetExtension1& operator=(const TestMessageSetExtension1& from) {
  196. CopyFrom(from);
  197. return *this;
  198. }
  199. #if LANG_CXX11
  200. TestMessageSetExtension1(TestMessageSetExtension1&& from) noexcept
  201. : TestMessageSetExtension1() {
  202. *this = ::std::move(from);
  203. }
  204. inline TestMessageSetExtension1& operator=(TestMessageSetExtension1&& from) noexcept {
  205. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  206. if (this != &from) InternalSwap(&from);
  207. } else {
  208. CopyFrom(from);
  209. }
  210. return *this;
  211. }
  212. #endif
  213. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  214. return _internal_metadata_.unknown_fields();
  215. }
  216. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  217. return _internal_metadata_.mutable_unknown_fields();
  218. }
  219. inline ::google::protobuf::Arena* GetArena() const final {
  220. return GetArenaNoVirtual();
  221. }
  222. inline void* GetMaybeArenaPointer() const final {
  223. return MaybeArenaPtr();
  224. }
  225. static const ::google::protobuf::Descriptor* descriptor();
  226. static const TestMessageSetExtension1& default_instance();
  227. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  228. static inline const TestMessageSetExtension1* internal_default_instance() {
  229. return reinterpret_cast<const TestMessageSetExtension1*>(
  230. &_TestMessageSetExtension1_default_instance_);
  231. }
  232. static constexpr int kIndexInFileMessages =
  233. 1;
  234. void UnsafeArenaSwap(TestMessageSetExtension1* other);
  235. void Swap(TestMessageSetExtension1* other);
  236. friend void swap(TestMessageSetExtension1& a, TestMessageSetExtension1& b) {
  237. a.Swap(&b);
  238. }
  239. // implements Message ----------------------------------------------
  240. inline TestMessageSetExtension1* New() const final {
  241. return CreateMaybeMessage<TestMessageSetExtension1>(NULL);
  242. }
  243. TestMessageSetExtension1* New(::google::protobuf::Arena* arena) const final {
  244. return CreateMaybeMessage<TestMessageSetExtension1>(arena);
  245. }
  246. void CopyFrom(const ::google::protobuf::Message& from) final;
  247. void MergeFrom(const ::google::protobuf::Message& from) final;
  248. void CopyFrom(const TestMessageSetExtension1& from);
  249. void MergeFrom(const TestMessageSetExtension1& from);
  250. void Clear() final;
  251. bool IsInitialized() const final;
  252. size_t ByteSizeLong() const final;
  253. bool MergePartialFromCodedStream(
  254. ::google::protobuf::io::CodedInputStream* input) final;
  255. void SerializeWithCachedSizes(
  256. ::google::protobuf::io::CodedOutputStream* output) const final;
  257. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  258. bool deterministic, ::google::protobuf::uint8* target) const final;
  259. int GetCachedSize() const final { return _cached_size_.Get(); }
  260. private:
  261. void SharedCtor();
  262. void SharedDtor();
  263. void SetCachedSize(int size) const final;
  264. void InternalSwap(TestMessageSetExtension1* other);
  265. protected:
  266. explicit TestMessageSetExtension1(::google::protobuf::Arena* arena);
  267. private:
  268. static void ArenaDtor(void* object);
  269. inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  270. private:
  271. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  272. return _internal_metadata_.arena();
  273. }
  274. inline void* MaybeArenaPtr() const {
  275. return _internal_metadata_.raw_arena_ptr();
  276. }
  277. public:
  278. ::google::protobuf::Metadata GetMetadata() const final;
  279. // nested types ----------------------------------------------------
  280. // accessors -------------------------------------------------------
  281. // optional int32 i = 15;
  282. bool has_i() const;
  283. void clear_i();
  284. static const int kIFieldNumber = 15;
  285. ::google::protobuf::int32 i() const;
  286. void set_i(::google::protobuf::int32 value);
  287. static const int kMessageSetExtensionFieldNumber = 1545008;
  288. static ::google::protobuf::internal::ExtensionIdentifier< ::proto2_wireformat_unittest::TestMessageSet,
  289. ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestMessageSetExtension1 >, 11, false >
  290. message_set_extension;
  291. // @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageSetExtension1)
  292. private:
  293. void set_has_i();
  294. void clear_has_i();
  295. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  296. template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  297. typedef void InternalArenaConstructable_;
  298. typedef void DestructorSkippable_;
  299. ::google::protobuf::internal::HasBits<1> _has_bits_;
  300. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  301. ::google::protobuf::int32 i_;
  302. friend struct ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::TableStruct;
  303. };
  304. // -------------------------------------------------------------------
  305. class TestMessageSetExtension2 : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf_unittest.TestMessageSetExtension2) */ {
  306. public:
  307. TestMessageSetExtension2();
  308. virtual ~TestMessageSetExtension2();
  309. TestMessageSetExtension2(const TestMessageSetExtension2& from);
  310. inline TestMessageSetExtension2& operator=(const TestMessageSetExtension2& from) {
  311. CopyFrom(from);
  312. return *this;
  313. }
  314. #if LANG_CXX11
  315. TestMessageSetExtension2(TestMessageSetExtension2&& from) noexcept
  316. : TestMessageSetExtension2() {
  317. *this = ::std::move(from);
  318. }
  319. inline TestMessageSetExtension2& operator=(TestMessageSetExtension2&& from) noexcept {
  320. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  321. if (this != &from) InternalSwap(&from);
  322. } else {
  323. CopyFrom(from);
  324. }
  325. return *this;
  326. }
  327. #endif
  328. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  329. return _internal_metadata_.unknown_fields();
  330. }
  331. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  332. return _internal_metadata_.mutable_unknown_fields();
  333. }
  334. inline ::google::protobuf::Arena* GetArena() const final {
  335. return GetArenaNoVirtual();
  336. }
  337. inline void* GetMaybeArenaPointer() const final {
  338. return MaybeArenaPtr();
  339. }
  340. static const ::google::protobuf::Descriptor* descriptor();
  341. static const TestMessageSetExtension2& default_instance();
  342. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  343. static inline const TestMessageSetExtension2* internal_default_instance() {
  344. return reinterpret_cast<const TestMessageSetExtension2*>(
  345. &_TestMessageSetExtension2_default_instance_);
  346. }
  347. static constexpr int kIndexInFileMessages =
  348. 2;
  349. void UnsafeArenaSwap(TestMessageSetExtension2* other);
  350. void Swap(TestMessageSetExtension2* other);
  351. friend void swap(TestMessageSetExtension2& a, TestMessageSetExtension2& b) {
  352. a.Swap(&b);
  353. }
  354. // implements Message ----------------------------------------------
  355. inline TestMessageSetExtension2* New() const final {
  356. return CreateMaybeMessage<TestMessageSetExtension2>(NULL);
  357. }
  358. TestMessageSetExtension2* New(::google::protobuf::Arena* arena) const final {
  359. return CreateMaybeMessage<TestMessageSetExtension2>(arena);
  360. }
  361. void CopyFrom(const ::google::protobuf::Message& from) final;
  362. void MergeFrom(const ::google::protobuf::Message& from) final;
  363. void CopyFrom(const TestMessageSetExtension2& from);
  364. void MergeFrom(const TestMessageSetExtension2& from);
  365. void Clear() final;
  366. bool IsInitialized() const final;
  367. size_t ByteSizeLong() const final;
  368. bool MergePartialFromCodedStream(
  369. ::google::protobuf::io::CodedInputStream* input) final;
  370. void SerializeWithCachedSizes(
  371. ::google::protobuf::io::CodedOutputStream* output) const final;
  372. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  373. bool deterministic, ::google::protobuf::uint8* target) const final;
  374. int GetCachedSize() const final { return _cached_size_.Get(); }
  375. private:
  376. void SharedCtor();
  377. void SharedDtor();
  378. void SetCachedSize(int size) const final;
  379. void InternalSwap(TestMessageSetExtension2* other);
  380. protected:
  381. explicit TestMessageSetExtension2(::google::protobuf::Arena* arena);
  382. private:
  383. static void ArenaDtor(void* object);
  384. inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  385. private:
  386. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  387. return _internal_metadata_.arena();
  388. }
  389. inline void* MaybeArenaPtr() const {
  390. return _internal_metadata_.raw_arena_ptr();
  391. }
  392. public:
  393. ::google::protobuf::Metadata GetMetadata() const final;
  394. // nested types ----------------------------------------------------
  395. // accessors -------------------------------------------------------
  396. // optional string str = 25;
  397. bool has_str() const;
  398. void clear_str();
  399. static const int kStrFieldNumber = 25;
  400. const ::std::string& str() const;
  401. void set_str(const ::std::string& value);
  402. #if LANG_CXX11
  403. void set_str(::std::string&& value);
  404. #endif
  405. void set_str(const char* value);
  406. void set_str(const char* value, size_t size);
  407. ::std::string* mutable_str();
  408. ::std::string* release_str();
  409. void set_allocated_str(::std::string* str);
  410. PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  411. " string fields are deprecated and will be removed in a"
  412. " future release.")
  413. ::std::string* unsafe_arena_release_str();
  414. PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  415. " string fields are deprecated and will be removed in a"
  416. " future release.")
  417. void unsafe_arena_set_allocated_str(
  418. ::std::string* str);
  419. static const int kMessageSetExtensionFieldNumber = 1547769;
  420. static ::google::protobuf::internal::ExtensionIdentifier< ::proto2_wireformat_unittest::TestMessageSet,
  421. ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestMessageSetExtension2 >, 11, false >
  422. message_set_extension;
  423. // @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageSetExtension2)
  424. private:
  425. void set_has_str();
  426. void clear_has_str();
  427. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  428. template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  429. typedef void InternalArenaConstructable_;
  430. typedef void DestructorSkippable_;
  431. ::google::protobuf::internal::HasBits<1> _has_bits_;
  432. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  433. ::google::protobuf::internal::ArenaStringPtr str_;
  434. friend struct ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::TableStruct;
  435. };
  436. // -------------------------------------------------------------------
  437. class RawMessageSet_Item : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf_unittest.RawMessageSet.Item) */ {
  438. public:
  439. RawMessageSet_Item();
  440. virtual ~RawMessageSet_Item();
  441. RawMessageSet_Item(const RawMessageSet_Item& from);
  442. inline RawMessageSet_Item& operator=(const RawMessageSet_Item& from) {
  443. CopyFrom(from);
  444. return *this;
  445. }
  446. #if LANG_CXX11
  447. RawMessageSet_Item(RawMessageSet_Item&& from) noexcept
  448. : RawMessageSet_Item() {
  449. *this = ::std::move(from);
  450. }
  451. inline RawMessageSet_Item& operator=(RawMessageSet_Item&& from) noexcept {
  452. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  453. if (this != &from) InternalSwap(&from);
  454. } else {
  455. CopyFrom(from);
  456. }
  457. return *this;
  458. }
  459. #endif
  460. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  461. return _internal_metadata_.unknown_fields();
  462. }
  463. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  464. return _internal_metadata_.mutable_unknown_fields();
  465. }
  466. inline ::google::protobuf::Arena* GetArena() const final {
  467. return GetArenaNoVirtual();
  468. }
  469. inline void* GetMaybeArenaPointer() const final {
  470. return MaybeArenaPtr();
  471. }
  472. static const ::google::protobuf::Descriptor* descriptor();
  473. static const RawMessageSet_Item& default_instance();
  474. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  475. static inline const RawMessageSet_Item* internal_default_instance() {
  476. return reinterpret_cast<const RawMessageSet_Item*>(
  477. &_RawMessageSet_Item_default_instance_);
  478. }
  479. static constexpr int kIndexInFileMessages =
  480. 3;
  481. void UnsafeArenaSwap(RawMessageSet_Item* other);
  482. void Swap(RawMessageSet_Item* other);
  483. friend void swap(RawMessageSet_Item& a, RawMessageSet_Item& b) {
  484. a.Swap(&b);
  485. }
  486. // implements Message ----------------------------------------------
  487. inline RawMessageSet_Item* New() const final {
  488. return CreateMaybeMessage<RawMessageSet_Item>(NULL);
  489. }
  490. RawMessageSet_Item* New(::google::protobuf::Arena* arena) const final {
  491. return CreateMaybeMessage<RawMessageSet_Item>(arena);
  492. }
  493. void CopyFrom(const ::google::protobuf::Message& from) final;
  494. void MergeFrom(const ::google::protobuf::Message& from) final;
  495. void CopyFrom(const RawMessageSet_Item& from);
  496. void MergeFrom(const RawMessageSet_Item& from);
  497. void Clear() final;
  498. bool IsInitialized() const final;
  499. size_t ByteSizeLong() const final;
  500. bool MergePartialFromCodedStream(
  501. ::google::protobuf::io::CodedInputStream* input) final;
  502. void SerializeWithCachedSizes(
  503. ::google::protobuf::io::CodedOutputStream* output) const final;
  504. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  505. bool deterministic, ::google::protobuf::uint8* target) const final;
  506. int GetCachedSize() const final { return _cached_size_.Get(); }
  507. private:
  508. void SharedCtor();
  509. void SharedDtor();
  510. void SetCachedSize(int size) const final;
  511. void InternalSwap(RawMessageSet_Item* other);
  512. protected:
  513. explicit RawMessageSet_Item(::google::protobuf::Arena* arena);
  514. private:
  515. static void ArenaDtor(void* object);
  516. inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  517. private:
  518. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  519. return _internal_metadata_.arena();
  520. }
  521. inline void* MaybeArenaPtr() const {
  522. return _internal_metadata_.raw_arena_ptr();
  523. }
  524. public:
  525. ::google::protobuf::Metadata GetMetadata() const final;
  526. // nested types ----------------------------------------------------
  527. // accessors -------------------------------------------------------
  528. // required bytes message = 3;
  529. bool has_message() const;
  530. void clear_message();
  531. static const int kMessageFieldNumber = 3;
  532. const ::std::string& message() const;
  533. void set_message(const ::std::string& value);
  534. #if LANG_CXX11
  535. void set_message(::std::string&& value);
  536. #endif
  537. void set_message(const char* value);
  538. void set_message(const void* value, size_t size);
  539. ::std::string* mutable_message();
  540. ::std::string* release_message();
  541. void set_allocated_message(::std::string* message);
  542. PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  543. " string fields are deprecated and will be removed in a"
  544. " future release.")
  545. ::std::string* unsafe_arena_release_message();
  546. PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  547. " string fields are deprecated and will be removed in a"
  548. " future release.")
  549. void unsafe_arena_set_allocated_message(
  550. ::std::string* message);
  551. // required int32 type_id = 2;
  552. bool has_type_id() const;
  553. void clear_type_id();
  554. static const int kTypeIdFieldNumber = 2;
  555. ::google::protobuf::int32 type_id() const;
  556. void set_type_id(::google::protobuf::int32 value);
  557. // @@protoc_insertion_point(class_scope:protobuf_unittest.RawMessageSet.Item)
  558. private:
  559. void set_has_type_id();
  560. void clear_has_type_id();
  561. void set_has_message();
  562. void clear_has_message();
  563. // helper for ByteSizeLong()
  564. size_t RequiredFieldsByteSizeFallback() const;
  565. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  566. template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  567. typedef void InternalArenaConstructable_;
  568. typedef void DestructorSkippable_;
  569. ::google::protobuf::internal::HasBits<1> _has_bits_;
  570. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  571. ::google::protobuf::internal::ArenaStringPtr message_;
  572. ::google::protobuf::int32 type_id_;
  573. friend struct ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::TableStruct;
  574. };
  575. // -------------------------------------------------------------------
  576. class RawMessageSet : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:protobuf_unittest.RawMessageSet) */ {
  577. public:
  578. RawMessageSet();
  579. virtual ~RawMessageSet();
  580. RawMessageSet(const RawMessageSet& from);
  581. inline RawMessageSet& operator=(const RawMessageSet& from) {
  582. CopyFrom(from);
  583. return *this;
  584. }
  585. #if LANG_CXX11
  586. RawMessageSet(RawMessageSet&& from) noexcept
  587. : RawMessageSet() {
  588. *this = ::std::move(from);
  589. }
  590. inline RawMessageSet& operator=(RawMessageSet&& from) noexcept {
  591. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  592. if (this != &from) InternalSwap(&from);
  593. } else {
  594. CopyFrom(from);
  595. }
  596. return *this;
  597. }
  598. #endif
  599. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  600. return _internal_metadata_.unknown_fields();
  601. }
  602. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  603. return _internal_metadata_.mutable_unknown_fields();
  604. }
  605. inline ::google::protobuf::Arena* GetArena() const final {
  606. return GetArenaNoVirtual();
  607. }
  608. inline void* GetMaybeArenaPointer() const final {
  609. return MaybeArenaPtr();
  610. }
  611. static const ::google::protobuf::Descriptor* descriptor();
  612. static const RawMessageSet& default_instance();
  613. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  614. static inline const RawMessageSet* internal_default_instance() {
  615. return reinterpret_cast<const RawMessageSet*>(
  616. &_RawMessageSet_default_instance_);
  617. }
  618. static constexpr int kIndexInFileMessages =
  619. 4;
  620. void UnsafeArenaSwap(RawMessageSet* other);
  621. void Swap(RawMessageSet* other);
  622. friend void swap(RawMessageSet& a, RawMessageSet& b) {
  623. a.Swap(&b);
  624. }
  625. // implements Message ----------------------------------------------
  626. inline RawMessageSet* New() const final {
  627. return CreateMaybeMessage<RawMessageSet>(NULL);
  628. }
  629. RawMessageSet* New(::google::protobuf::Arena* arena) const final {
  630. return CreateMaybeMessage<RawMessageSet>(arena);
  631. }
  632. void CopyFrom(const ::google::protobuf::Message& from) final;
  633. void MergeFrom(const ::google::protobuf::Message& from) final;
  634. void CopyFrom(const RawMessageSet& from);
  635. void MergeFrom(const RawMessageSet& from);
  636. void Clear() final;
  637. bool IsInitialized() const final;
  638. size_t ByteSizeLong() const final;
  639. bool MergePartialFromCodedStream(
  640. ::google::protobuf::io::CodedInputStream* input) final;
  641. void SerializeWithCachedSizes(
  642. ::google::protobuf::io::CodedOutputStream* output) const final;
  643. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  644. bool deterministic, ::google::protobuf::uint8* target) const final;
  645. int GetCachedSize() const final { return _cached_size_.Get(); }
  646. private:
  647. void SharedCtor();
  648. void SharedDtor();
  649. void SetCachedSize(int size) const final;
  650. void InternalSwap(RawMessageSet* other);
  651. protected:
  652. explicit RawMessageSet(::google::protobuf::Arena* arena);
  653. private:
  654. static void ArenaDtor(void* object);
  655. inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  656. private:
  657. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  658. return _internal_metadata_.arena();
  659. }
  660. inline void* MaybeArenaPtr() const {
  661. return _internal_metadata_.raw_arena_ptr();
  662. }
  663. public:
  664. ::google::protobuf::Metadata GetMetadata() const final;
  665. // nested types ----------------------------------------------------
  666. typedef RawMessageSet_Item Item;
  667. // accessors -------------------------------------------------------
  668. // repeated group Item = 1 { ... };
  669. int item_size() const;
  670. void clear_item();
  671. static const int kItemFieldNumber = 1;
  672. ::protobuf_unittest::RawMessageSet_Item* mutable_item(int index);
  673. ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::RawMessageSet_Item >*
  674. mutable_item();
  675. const ::protobuf_unittest::RawMessageSet_Item& item(int index) const;
  676. ::protobuf_unittest::RawMessageSet_Item* add_item();
  677. const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::RawMessageSet_Item >&
  678. item() const;
  679. // @@protoc_insertion_point(class_scope:protobuf_unittest.RawMessageSet)
  680. private:
  681. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  682. template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  683. typedef void InternalArenaConstructable_;
  684. typedef void DestructorSkippable_;
  685. ::google::protobuf::internal::HasBits<1> _has_bits_;
  686. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  687. ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::RawMessageSet_Item > item_;
  688. friend struct ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::TableStruct;
  689. };
  690. // ===================================================================
  691. // ===================================================================
  692. #ifdef __GNUC__
  693. #pragma GCC diagnostic push
  694. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  695. #endif // __GNUC__
  696. // TestMessageSetContainer
  697. // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
  698. inline bool TestMessageSetContainer::has_message_set() const {
  699. return (_has_bits_[0] & 0x00000001u) != 0;
  700. }
  701. inline void TestMessageSetContainer::set_has_message_set() {
  702. _has_bits_[0] |= 0x00000001u;
  703. }
  704. inline void TestMessageSetContainer::clear_has_message_set() {
  705. _has_bits_[0] &= ~0x00000001u;
  706. }
  707. inline const ::proto2_wireformat_unittest::TestMessageSet& TestMessageSetContainer::_internal_message_set() const {
  708. return *message_set_;
  709. }
  710. inline const ::proto2_wireformat_unittest::TestMessageSet& TestMessageSetContainer::message_set() const {
  711. const ::proto2_wireformat_unittest::TestMessageSet* p = message_set_;
  712. // @@protoc_insertion_point(field_get:protobuf_unittest.TestMessageSetContainer.message_set)
  713. return p != NULL ? *p : *reinterpret_cast<const ::proto2_wireformat_unittest::TestMessageSet*>(
  714. &::proto2_wireformat_unittest::_TestMessageSet_default_instance_);
  715. }
  716. inline ::proto2_wireformat_unittest::TestMessageSet* TestMessageSetContainer::release_message_set() {
  717. // @@protoc_insertion_point(field_release:protobuf_unittest.TestMessageSetContainer.message_set)
  718. clear_has_message_set();
  719. ::proto2_wireformat_unittest::TestMessageSet* temp = message_set_;
  720. if (GetArenaNoVirtual() != NULL) {
  721. temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);
  722. }
  723. message_set_ = NULL;
  724. return temp;
  725. }
  726. inline ::proto2_wireformat_unittest::TestMessageSet* TestMessageSetContainer::unsafe_arena_release_message_set() {
  727. // @@protoc_insertion_point(field_unsafe_arena_release:protobuf_unittest.TestMessageSetContainer.message_set)
  728. clear_has_message_set();
  729. ::proto2_wireformat_unittest::TestMessageSet* temp = message_set_;
  730. message_set_ = NULL;
  731. return temp;
  732. }
  733. inline ::proto2_wireformat_unittest::TestMessageSet* TestMessageSetContainer::mutable_message_set() {
  734. set_has_message_set();
  735. if (message_set_ == NULL) {
  736. auto* p = CreateMaybeMessage<::proto2_wireformat_unittest::TestMessageSet>(GetArenaNoVirtual());
  737. message_set_ = p;
  738. }
  739. // @@protoc_insertion_point(field_mutable:protobuf_unittest.TestMessageSetContainer.message_set)
  740. return message_set_;
  741. }
  742. inline void TestMessageSetContainer::set_allocated_message_set(::proto2_wireformat_unittest::TestMessageSet* message_set) {
  743. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  744. if (message_arena == NULL) {
  745. delete reinterpret_cast< ::google::protobuf::MessageLite*>(message_set_);
  746. }
  747. if (message_set) {
  748. ::google::protobuf::Arena* submessage_arena =
  749. reinterpret_cast<::google::protobuf::MessageLite*>(message_set)->GetArena();
  750. if (message_arena != submessage_arena) {
  751. message_set = ::google::protobuf::internal::GetOwnedMessage(
  752. message_arena, message_set, submessage_arena);
  753. }
  754. set_has_message_set();
  755. } else {
  756. clear_has_message_set();
  757. }
  758. message_set_ = message_set;
  759. // @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestMessageSetContainer.message_set)
  760. }
  761. // -------------------------------------------------------------------
  762. // TestMessageSetExtension1
  763. // optional int32 i = 15;
  764. inline bool TestMessageSetExtension1::has_i() const {
  765. return (_has_bits_[0] & 0x00000001u) != 0;
  766. }
  767. inline void TestMessageSetExtension1::set_has_i() {
  768. _has_bits_[0] |= 0x00000001u;
  769. }
  770. inline void TestMessageSetExtension1::clear_has_i() {
  771. _has_bits_[0] &= ~0x00000001u;
  772. }
  773. inline void TestMessageSetExtension1::clear_i() {
  774. i_ = 0;
  775. clear_has_i();
  776. }
  777. inline ::google::protobuf::int32 TestMessageSetExtension1::i() const {
  778. // @@protoc_insertion_point(field_get:protobuf_unittest.TestMessageSetExtension1.i)
  779. return i_;
  780. }
  781. inline void TestMessageSetExtension1::set_i(::google::protobuf::int32 value) {
  782. set_has_i();
  783. i_ = value;
  784. // @@protoc_insertion_point(field_set:protobuf_unittest.TestMessageSetExtension1.i)
  785. }
  786. // -------------------------------------------------------------------
  787. // TestMessageSetExtension2
  788. // optional string str = 25;
  789. inline bool TestMessageSetExtension2::has_str() const {
  790. return (_has_bits_[0] & 0x00000001u) != 0;
  791. }
  792. inline void TestMessageSetExtension2::set_has_str() {
  793. _has_bits_[0] |= 0x00000001u;
  794. }
  795. inline void TestMessageSetExtension2::clear_has_str() {
  796. _has_bits_[0] &= ~0x00000001u;
  797. }
  798. inline void TestMessageSetExtension2::clear_str() {
  799. str_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  800. clear_has_str();
  801. }
  802. inline const ::std::string& TestMessageSetExtension2::str() const {
  803. // @@protoc_insertion_point(field_get:protobuf_unittest.TestMessageSetExtension2.str)
  804. return str_.Get();
  805. }
  806. inline void TestMessageSetExtension2::set_str(const ::std::string& value) {
  807. set_has_str();
  808. str_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  809. // @@protoc_insertion_point(field_set:protobuf_unittest.TestMessageSetExtension2.str)
  810. }
  811. #if LANG_CXX11
  812. inline void TestMessageSetExtension2::set_str(::std::string&& value) {
  813. set_has_str();
  814. str_.Set(
  815. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
  816. // @@protoc_insertion_point(field_set_rvalue:protobuf_unittest.TestMessageSetExtension2.str)
  817. }
  818. #endif
  819. inline void TestMessageSetExtension2::set_str(const char* value) {
  820. GOOGLE_DCHECK(value != NULL);
  821. set_has_str();
  822. str_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
  823. GetArenaNoVirtual());
  824. // @@protoc_insertion_point(field_set_char:protobuf_unittest.TestMessageSetExtension2.str)
  825. }
  826. inline void TestMessageSetExtension2::set_str(const char* value,
  827. size_t size) {
  828. set_has_str();
  829. str_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
  830. reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  831. // @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestMessageSetExtension2.str)
  832. }
  833. inline ::std::string* TestMessageSetExtension2::mutable_str() {
  834. set_has_str();
  835. // @@protoc_insertion_point(field_mutable:protobuf_unittest.TestMessageSetExtension2.str)
  836. return str_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  837. }
  838. inline ::std::string* TestMessageSetExtension2::release_str() {
  839. // @@protoc_insertion_point(field_release:protobuf_unittest.TestMessageSetExtension2.str)
  840. if (!has_str()) {
  841. return NULL;
  842. }
  843. clear_has_str();
  844. return str_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  845. }
  846. inline void TestMessageSetExtension2::set_allocated_str(::std::string* str) {
  847. if (str != NULL) {
  848. set_has_str();
  849. } else {
  850. clear_has_str();
  851. }
  852. str_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), str,
  853. GetArenaNoVirtual());
  854. // @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestMessageSetExtension2.str)
  855. }
  856. inline ::std::string* TestMessageSetExtension2::unsafe_arena_release_str() {
  857. // @@protoc_insertion_point(field_unsafe_arena_release:protobuf_unittest.TestMessageSetExtension2.str)
  858. GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  859. clear_has_str();
  860. return str_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  861. GetArenaNoVirtual());
  862. }
  863. inline void TestMessageSetExtension2::unsafe_arena_set_allocated_str(
  864. ::std::string* str) {
  865. GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  866. if (str != NULL) {
  867. set_has_str();
  868. } else {
  869. clear_has_str();
  870. }
  871. str_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  872. str, GetArenaNoVirtual());
  873. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestMessageSetExtension2.str)
  874. }
  875. // -------------------------------------------------------------------
  876. // RawMessageSet_Item
  877. // required int32 type_id = 2;
  878. inline bool RawMessageSet_Item::has_type_id() const {
  879. return (_has_bits_[0] & 0x00000002u) != 0;
  880. }
  881. inline void RawMessageSet_Item::set_has_type_id() {
  882. _has_bits_[0] |= 0x00000002u;
  883. }
  884. inline void RawMessageSet_Item::clear_has_type_id() {
  885. _has_bits_[0] &= ~0x00000002u;
  886. }
  887. inline void RawMessageSet_Item::clear_type_id() {
  888. type_id_ = 0;
  889. clear_has_type_id();
  890. }
  891. inline ::google::protobuf::int32 RawMessageSet_Item::type_id() const {
  892. // @@protoc_insertion_point(field_get:protobuf_unittest.RawMessageSet.Item.type_id)
  893. return type_id_;
  894. }
  895. inline void RawMessageSet_Item::set_type_id(::google::protobuf::int32 value) {
  896. set_has_type_id();
  897. type_id_ = value;
  898. // @@protoc_insertion_point(field_set:protobuf_unittest.RawMessageSet.Item.type_id)
  899. }
  900. // required bytes message = 3;
  901. inline bool RawMessageSet_Item::has_message() const {
  902. return (_has_bits_[0] & 0x00000001u) != 0;
  903. }
  904. inline void RawMessageSet_Item::set_has_message() {
  905. _has_bits_[0] |= 0x00000001u;
  906. }
  907. inline void RawMessageSet_Item::clear_has_message() {
  908. _has_bits_[0] &= ~0x00000001u;
  909. }
  910. inline void RawMessageSet_Item::clear_message() {
  911. message_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  912. clear_has_message();
  913. }
  914. inline const ::std::string& RawMessageSet_Item::message() const {
  915. // @@protoc_insertion_point(field_get:protobuf_unittest.RawMessageSet.Item.message)
  916. return message_.Get();
  917. }
  918. inline void RawMessageSet_Item::set_message(const ::std::string& value) {
  919. set_has_message();
  920. message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  921. // @@protoc_insertion_point(field_set:protobuf_unittest.RawMessageSet.Item.message)
  922. }
  923. #if LANG_CXX11
  924. inline void RawMessageSet_Item::set_message(::std::string&& value) {
  925. set_has_message();
  926. message_.Set(
  927. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
  928. // @@protoc_insertion_point(field_set_rvalue:protobuf_unittest.RawMessageSet.Item.message)
  929. }
  930. #endif
  931. inline void RawMessageSet_Item::set_message(const char* value) {
  932. GOOGLE_DCHECK(value != NULL);
  933. set_has_message();
  934. message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
  935. GetArenaNoVirtual());
  936. // @@protoc_insertion_point(field_set_char:protobuf_unittest.RawMessageSet.Item.message)
  937. }
  938. inline void RawMessageSet_Item::set_message(const void* value,
  939. size_t size) {
  940. set_has_message();
  941. message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
  942. reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  943. // @@protoc_insertion_point(field_set_pointer:protobuf_unittest.RawMessageSet.Item.message)
  944. }
  945. inline ::std::string* RawMessageSet_Item::mutable_message() {
  946. set_has_message();
  947. // @@protoc_insertion_point(field_mutable:protobuf_unittest.RawMessageSet.Item.message)
  948. return message_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  949. }
  950. inline ::std::string* RawMessageSet_Item::release_message() {
  951. // @@protoc_insertion_point(field_release:protobuf_unittest.RawMessageSet.Item.message)
  952. if (!has_message()) {
  953. return NULL;
  954. }
  955. clear_has_message();
  956. return message_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  957. }
  958. inline void RawMessageSet_Item::set_allocated_message(::std::string* message) {
  959. if (message != NULL) {
  960. set_has_message();
  961. } else {
  962. clear_has_message();
  963. }
  964. message_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), message,
  965. GetArenaNoVirtual());
  966. // @@protoc_insertion_point(field_set_allocated:protobuf_unittest.RawMessageSet.Item.message)
  967. }
  968. inline ::std::string* RawMessageSet_Item::unsafe_arena_release_message() {
  969. // @@protoc_insertion_point(field_unsafe_arena_release:protobuf_unittest.RawMessageSet.Item.message)
  970. GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  971. clear_has_message();
  972. return message_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  973. GetArenaNoVirtual());
  974. }
  975. inline void RawMessageSet_Item::unsafe_arena_set_allocated_message(
  976. ::std::string* message) {
  977. GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  978. if (message != NULL) {
  979. set_has_message();
  980. } else {
  981. clear_has_message();
  982. }
  983. message_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  984. message, GetArenaNoVirtual());
  985. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.RawMessageSet.Item.message)
  986. }
  987. // -------------------------------------------------------------------
  988. // RawMessageSet
  989. // repeated group Item = 1 { ... };
  990. inline int RawMessageSet::item_size() const {
  991. return item_.size();
  992. }
  993. inline void RawMessageSet::clear_item() {
  994. item_.Clear();
  995. }
  996. inline ::protobuf_unittest::RawMessageSet_Item* RawMessageSet::mutable_item(int index) {
  997. // @@protoc_insertion_point(field_mutable:protobuf_unittest.RawMessageSet.item)
  998. return item_.Mutable(index);
  999. }
  1000. inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::RawMessageSet_Item >*
  1001. RawMessageSet::mutable_item() {
  1002. // @@protoc_insertion_point(field_mutable_list:protobuf_unittest.RawMessageSet.item)
  1003. return &item_;
  1004. }
  1005. inline const ::protobuf_unittest::RawMessageSet_Item& RawMessageSet::item(int index) const {
  1006. // @@protoc_insertion_point(field_get:protobuf_unittest.RawMessageSet.item)
  1007. return item_.Get(index);
  1008. }
  1009. inline ::protobuf_unittest::RawMessageSet_Item* RawMessageSet::add_item() {
  1010. // @@protoc_insertion_point(field_add:protobuf_unittest.RawMessageSet.item)
  1011. return item_.Add();
  1012. }
  1013. inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::RawMessageSet_Item >&
  1014. RawMessageSet::item() const {
  1015. // @@protoc_insertion_point(field_list:protobuf_unittest.RawMessageSet.item)
  1016. return item_;
  1017. }
  1018. #ifdef __GNUC__
  1019. #pragma GCC diagnostic pop
  1020. #endif // __GNUC__
  1021. // -------------------------------------------------------------------
  1022. // -------------------------------------------------------------------
  1023. // -------------------------------------------------------------------
  1024. // -------------------------------------------------------------------
  1025. // @@protoc_insertion_point(namespace_scope)
  1026. } // namespace protobuf_unittest
  1027. // @@protoc_insertion_point(global_scope)
  1028. #endif // PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fmset_2eproto