oneofs.pb.h 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/util/internal/testdata/oneofs.proto
  3. #ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto
  4. #define PROTOBUF_INCLUDED_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_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/any.pb.h>
  29. #include <google/protobuf/struct.pb.h>
  30. #include <google/protobuf/timestamp.pb.h>
  31. // @@protoc_insertion_point(includes)
  32. #define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto
  33. namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto {
  34. // Internal implementation detail -- do not use these members.
  35. struct TableStruct {
  36. static const ::google::protobuf::internal::ParseTableField entries[];
  37. static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
  38. static const ::google::protobuf::internal::ParseTable schema[5];
  39. static const ::google::protobuf::internal::FieldMetadata field_metadata[];
  40. static const ::google::protobuf::internal::SerializationTable serialization_table[];
  41. static const ::google::protobuf::uint32 offsets[];
  42. };
  43. void AddDescriptors();
  44. } // namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto
  45. namespace google {
  46. namespace protobuf {
  47. namespace testing {
  48. namespace oneofs {
  49. class Data;
  50. class DataDefaultTypeInternal;
  51. extern DataDefaultTypeInternal _Data_default_instance_;
  52. class MoreData;
  53. class MoreDataDefaultTypeInternal;
  54. extern MoreDataDefaultTypeInternal _MoreData_default_instance_;
  55. class OneOfsRequest;
  56. class OneOfsRequestDefaultTypeInternal;
  57. extern OneOfsRequestDefaultTypeInternal _OneOfsRequest_default_instance_;
  58. class RequestWithSimpleOneof;
  59. class RequestWithSimpleOneofDefaultTypeInternal;
  60. extern RequestWithSimpleOneofDefaultTypeInternal _RequestWithSimpleOneof_default_instance_;
  61. class Response;
  62. class ResponseDefaultTypeInternal;
  63. extern ResponseDefaultTypeInternal _Response_default_instance_;
  64. } // namespace oneofs
  65. } // namespace testing
  66. } // namespace protobuf
  67. } // namespace google
  68. namespace google {
  69. namespace protobuf {
  70. template<> ::google::protobuf::testing::oneofs::Data* Arena::CreateMaybeMessage<::google::protobuf::testing::oneofs::Data>(Arena*);
  71. template<> ::google::protobuf::testing::oneofs::MoreData* Arena::CreateMaybeMessage<::google::protobuf::testing::oneofs::MoreData>(Arena*);
  72. template<> ::google::protobuf::testing::oneofs::OneOfsRequest* Arena::CreateMaybeMessage<::google::protobuf::testing::oneofs::OneOfsRequest>(Arena*);
  73. template<> ::google::protobuf::testing::oneofs::RequestWithSimpleOneof* Arena::CreateMaybeMessage<::google::protobuf::testing::oneofs::RequestWithSimpleOneof>(Arena*);
  74. template<> ::google::protobuf::testing::oneofs::Response* Arena::CreateMaybeMessage<::google::protobuf::testing::oneofs::Response>(Arena*);
  75. } // namespace protobuf
  76. } // namespace google
  77. namespace google {
  78. namespace protobuf {
  79. namespace testing {
  80. namespace oneofs {
  81. // ===================================================================
  82. class OneOfsRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.testing.oneofs.OneOfsRequest) */ {
  83. public:
  84. OneOfsRequest();
  85. virtual ~OneOfsRequest();
  86. OneOfsRequest(const OneOfsRequest& from);
  87. inline OneOfsRequest& operator=(const OneOfsRequest& from) {
  88. CopyFrom(from);
  89. return *this;
  90. }
  91. #if LANG_CXX11
  92. OneOfsRequest(OneOfsRequest&& from) noexcept
  93. : OneOfsRequest() {
  94. *this = ::std::move(from);
  95. }
  96. inline OneOfsRequest& operator=(OneOfsRequest&& from) noexcept {
  97. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  98. if (this != &from) InternalSwap(&from);
  99. } else {
  100. CopyFrom(from);
  101. }
  102. return *this;
  103. }
  104. #endif
  105. static const ::google::protobuf::Descriptor* descriptor();
  106. static const OneOfsRequest& default_instance();
  107. enum DataCase {
  108. kStrData = 2,
  109. kIntData = 3,
  110. kMessageData = 4,
  111. kMoreData = 5,
  112. kStructData = 6,
  113. kValueData = 7,
  114. kListValueData = 8,
  115. kTsData = 9,
  116. DATA_NOT_SET = 0,
  117. };
  118. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  119. static inline const OneOfsRequest* internal_default_instance() {
  120. return reinterpret_cast<const OneOfsRequest*>(
  121. &_OneOfsRequest_default_instance_);
  122. }
  123. static constexpr int kIndexInFileMessages =
  124. 0;
  125. void Swap(OneOfsRequest* other);
  126. friend void swap(OneOfsRequest& a, OneOfsRequest& b) {
  127. a.Swap(&b);
  128. }
  129. // implements Message ----------------------------------------------
  130. inline OneOfsRequest* New() const final {
  131. return CreateMaybeMessage<OneOfsRequest>(NULL);
  132. }
  133. OneOfsRequest* New(::google::protobuf::Arena* arena) const final {
  134. return CreateMaybeMessage<OneOfsRequest>(arena);
  135. }
  136. void CopyFrom(const ::google::protobuf::Message& from) final;
  137. void MergeFrom(const ::google::protobuf::Message& from) final;
  138. void CopyFrom(const OneOfsRequest& from);
  139. void MergeFrom(const OneOfsRequest& from);
  140. void Clear() final;
  141. bool IsInitialized() const final;
  142. size_t ByteSizeLong() const final;
  143. bool MergePartialFromCodedStream(
  144. ::google::protobuf::io::CodedInputStream* input) final;
  145. void SerializeWithCachedSizes(
  146. ::google::protobuf::io::CodedOutputStream* output) const final;
  147. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  148. bool deterministic, ::google::protobuf::uint8* target) const final;
  149. int GetCachedSize() const final { return _cached_size_.Get(); }
  150. private:
  151. void SharedCtor();
  152. void SharedDtor();
  153. void SetCachedSize(int size) const final;
  154. void InternalSwap(OneOfsRequest* other);
  155. private:
  156. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  157. return NULL;
  158. }
  159. inline void* MaybeArenaPtr() const {
  160. return NULL;
  161. }
  162. public:
  163. ::google::protobuf::Metadata GetMetadata() const final;
  164. // nested types ----------------------------------------------------
  165. // accessors -------------------------------------------------------
  166. // string value = 1;
  167. void clear_value();
  168. static const int kValueFieldNumber = 1;
  169. const ::std::string& value() const;
  170. void set_value(const ::std::string& value);
  171. #if LANG_CXX11
  172. void set_value(::std::string&& value);
  173. #endif
  174. void set_value(const char* value);
  175. void set_value(const char* value, size_t size);
  176. ::std::string* mutable_value();
  177. ::std::string* release_value();
  178. void set_allocated_value(::std::string* value);
  179. // .google.protobuf.Any any_data = 19;
  180. bool has_any_data() const;
  181. void clear_any_data();
  182. static const int kAnyDataFieldNumber = 19;
  183. private:
  184. const ::google::protobuf::Any& _internal_any_data() const;
  185. public:
  186. const ::google::protobuf::Any& any_data() const;
  187. ::google::protobuf::Any* release_any_data();
  188. ::google::protobuf::Any* mutable_any_data();
  189. void set_allocated_any_data(::google::protobuf::Any* any_data);
  190. // string str_data = 2;
  191. private:
  192. bool has_str_data() const;
  193. public:
  194. void clear_str_data();
  195. static const int kStrDataFieldNumber = 2;
  196. const ::std::string& str_data() const;
  197. void set_str_data(const ::std::string& value);
  198. #if LANG_CXX11
  199. void set_str_data(::std::string&& value);
  200. #endif
  201. void set_str_data(const char* value);
  202. void set_str_data(const char* value, size_t size);
  203. ::std::string* mutable_str_data();
  204. ::std::string* release_str_data();
  205. void set_allocated_str_data(::std::string* str_data);
  206. // int32 int_data = 3;
  207. private:
  208. bool has_int_data() const;
  209. public:
  210. void clear_int_data();
  211. static const int kIntDataFieldNumber = 3;
  212. ::google::protobuf::int32 int_data() const;
  213. void set_int_data(::google::protobuf::int32 value);
  214. // .google.protobuf.testing.oneofs.Data message_data = 4;
  215. bool has_message_data() const;
  216. void clear_message_data();
  217. static const int kMessageDataFieldNumber = 4;
  218. private:
  219. const ::google::protobuf::testing::oneofs::Data& _internal_message_data() const;
  220. public:
  221. const ::google::protobuf::testing::oneofs::Data& message_data() const;
  222. ::google::protobuf::testing::oneofs::Data* release_message_data();
  223. ::google::protobuf::testing::oneofs::Data* mutable_message_data();
  224. void set_allocated_message_data(::google::protobuf::testing::oneofs::Data* message_data);
  225. // .google.protobuf.testing.oneofs.MoreData more_data = 5;
  226. bool has_more_data() const;
  227. void clear_more_data();
  228. static const int kMoreDataFieldNumber = 5;
  229. private:
  230. const ::google::protobuf::testing::oneofs::MoreData& _internal_more_data() const;
  231. public:
  232. const ::google::protobuf::testing::oneofs::MoreData& more_data() const;
  233. ::google::protobuf::testing::oneofs::MoreData* release_more_data();
  234. ::google::protobuf::testing::oneofs::MoreData* mutable_more_data();
  235. void set_allocated_more_data(::google::protobuf::testing::oneofs::MoreData* more_data);
  236. // .google.protobuf.Struct struct_data = 6;
  237. bool has_struct_data() const;
  238. void clear_struct_data();
  239. static const int kStructDataFieldNumber = 6;
  240. private:
  241. const ::google::protobuf::Struct& _internal_struct_data() const;
  242. public:
  243. const ::google::protobuf::Struct& struct_data() const;
  244. ::google::protobuf::Struct* release_struct_data();
  245. ::google::protobuf::Struct* mutable_struct_data();
  246. void set_allocated_struct_data(::google::protobuf::Struct* struct_data);
  247. // .google.protobuf.Value value_data = 7;
  248. bool has_value_data() const;
  249. void clear_value_data();
  250. static const int kValueDataFieldNumber = 7;
  251. private:
  252. const ::google::protobuf::Value& _internal_value_data() const;
  253. public:
  254. const ::google::protobuf::Value& value_data() const;
  255. ::google::protobuf::Value* release_value_data();
  256. ::google::protobuf::Value* mutable_value_data();
  257. void set_allocated_value_data(::google::protobuf::Value* value_data);
  258. // .google.protobuf.ListValue list_value_data = 8;
  259. bool has_list_value_data() const;
  260. void clear_list_value_data();
  261. static const int kListValueDataFieldNumber = 8;
  262. private:
  263. const ::google::protobuf::ListValue& _internal_list_value_data() const;
  264. public:
  265. const ::google::protobuf::ListValue& list_value_data() const;
  266. ::google::protobuf::ListValue* release_list_value_data();
  267. ::google::protobuf::ListValue* mutable_list_value_data();
  268. void set_allocated_list_value_data(::google::protobuf::ListValue* list_value_data);
  269. // .google.protobuf.Timestamp ts_data = 9;
  270. bool has_ts_data() const;
  271. void clear_ts_data();
  272. static const int kTsDataFieldNumber = 9;
  273. private:
  274. const ::google::protobuf::Timestamp& _internal_ts_data() const;
  275. public:
  276. const ::google::protobuf::Timestamp& ts_data() const;
  277. ::google::protobuf::Timestamp* release_ts_data();
  278. ::google::protobuf::Timestamp* mutable_ts_data();
  279. void set_allocated_ts_data(::google::protobuf::Timestamp* ts_data);
  280. void clear_data();
  281. DataCase data_case() const;
  282. // @@protoc_insertion_point(class_scope:google.protobuf.testing.oneofs.OneOfsRequest)
  283. private:
  284. void set_has_str_data();
  285. void set_has_int_data();
  286. void set_has_message_data();
  287. void set_has_more_data();
  288. void set_has_struct_data();
  289. void set_has_value_data();
  290. void set_has_list_value_data();
  291. void set_has_ts_data();
  292. inline bool has_data() const;
  293. inline void clear_has_data();
  294. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  295. ::google::protobuf::internal::ArenaStringPtr value_;
  296. ::google::protobuf::Any* any_data_;
  297. union DataUnion {
  298. DataUnion() {}
  299. ::google::protobuf::internal::ArenaStringPtr str_data_;
  300. ::google::protobuf::int32 int_data_;
  301. ::google::protobuf::testing::oneofs::Data* message_data_;
  302. ::google::protobuf::testing::oneofs::MoreData* more_data_;
  303. ::google::protobuf::Struct* struct_data_;
  304. ::google::protobuf::Value* value_data_;
  305. ::google::protobuf::ListValue* list_value_data_;
  306. ::google::protobuf::Timestamp* ts_data_;
  307. } data_;
  308. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  309. ::google::protobuf::uint32 _oneof_case_[1];
  310. friend struct ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto::TableStruct;
  311. };
  312. // -------------------------------------------------------------------
  313. class RequestWithSimpleOneof : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.testing.oneofs.RequestWithSimpleOneof) */ {
  314. public:
  315. RequestWithSimpleOneof();
  316. virtual ~RequestWithSimpleOneof();
  317. RequestWithSimpleOneof(const RequestWithSimpleOneof& from);
  318. inline RequestWithSimpleOneof& operator=(const RequestWithSimpleOneof& from) {
  319. CopyFrom(from);
  320. return *this;
  321. }
  322. #if LANG_CXX11
  323. RequestWithSimpleOneof(RequestWithSimpleOneof&& from) noexcept
  324. : RequestWithSimpleOneof() {
  325. *this = ::std::move(from);
  326. }
  327. inline RequestWithSimpleOneof& operator=(RequestWithSimpleOneof&& from) noexcept {
  328. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  329. if (this != &from) InternalSwap(&from);
  330. } else {
  331. CopyFrom(from);
  332. }
  333. return *this;
  334. }
  335. #endif
  336. static const ::google::protobuf::Descriptor* descriptor();
  337. static const RequestWithSimpleOneof& default_instance();
  338. enum DataCase {
  339. kStrData = 2,
  340. kIntData = 3,
  341. kMessageData = 4,
  342. kMoreData = 5,
  343. DATA_NOT_SET = 0,
  344. };
  345. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  346. static inline const RequestWithSimpleOneof* internal_default_instance() {
  347. return reinterpret_cast<const RequestWithSimpleOneof*>(
  348. &_RequestWithSimpleOneof_default_instance_);
  349. }
  350. static constexpr int kIndexInFileMessages =
  351. 1;
  352. void Swap(RequestWithSimpleOneof* other);
  353. friend void swap(RequestWithSimpleOneof& a, RequestWithSimpleOneof& b) {
  354. a.Swap(&b);
  355. }
  356. // implements Message ----------------------------------------------
  357. inline RequestWithSimpleOneof* New() const final {
  358. return CreateMaybeMessage<RequestWithSimpleOneof>(NULL);
  359. }
  360. RequestWithSimpleOneof* New(::google::protobuf::Arena* arena) const final {
  361. return CreateMaybeMessage<RequestWithSimpleOneof>(arena);
  362. }
  363. void CopyFrom(const ::google::protobuf::Message& from) final;
  364. void MergeFrom(const ::google::protobuf::Message& from) final;
  365. void CopyFrom(const RequestWithSimpleOneof& from);
  366. void MergeFrom(const RequestWithSimpleOneof& from);
  367. void Clear() final;
  368. bool IsInitialized() const final;
  369. size_t ByteSizeLong() const final;
  370. bool MergePartialFromCodedStream(
  371. ::google::protobuf::io::CodedInputStream* input) final;
  372. void SerializeWithCachedSizes(
  373. ::google::protobuf::io::CodedOutputStream* output) const final;
  374. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  375. bool deterministic, ::google::protobuf::uint8* target) const final;
  376. int GetCachedSize() const final { return _cached_size_.Get(); }
  377. private:
  378. void SharedCtor();
  379. void SharedDtor();
  380. void SetCachedSize(int size) const final;
  381. void InternalSwap(RequestWithSimpleOneof* other);
  382. private:
  383. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  384. return NULL;
  385. }
  386. inline void* MaybeArenaPtr() const {
  387. return NULL;
  388. }
  389. public:
  390. ::google::protobuf::Metadata GetMetadata() const final;
  391. // nested types ----------------------------------------------------
  392. // accessors -------------------------------------------------------
  393. // string value = 1;
  394. void clear_value();
  395. static const int kValueFieldNumber = 1;
  396. const ::std::string& value() const;
  397. void set_value(const ::std::string& value);
  398. #if LANG_CXX11
  399. void set_value(::std::string&& value);
  400. #endif
  401. void set_value(const char* value);
  402. void set_value(const char* value, size_t size);
  403. ::std::string* mutable_value();
  404. ::std::string* release_value();
  405. void set_allocated_value(::std::string* value);
  406. // string str_data = 2;
  407. private:
  408. bool has_str_data() const;
  409. public:
  410. void clear_str_data();
  411. static const int kStrDataFieldNumber = 2;
  412. const ::std::string& str_data() const;
  413. void set_str_data(const ::std::string& value);
  414. #if LANG_CXX11
  415. void set_str_data(::std::string&& value);
  416. #endif
  417. void set_str_data(const char* value);
  418. void set_str_data(const char* value, size_t size);
  419. ::std::string* mutable_str_data();
  420. ::std::string* release_str_data();
  421. void set_allocated_str_data(::std::string* str_data);
  422. // int32 int_data = 3;
  423. private:
  424. bool has_int_data() const;
  425. public:
  426. void clear_int_data();
  427. static const int kIntDataFieldNumber = 3;
  428. ::google::protobuf::int32 int_data() const;
  429. void set_int_data(::google::protobuf::int32 value);
  430. // .google.protobuf.testing.oneofs.Data message_data = 4;
  431. bool has_message_data() const;
  432. void clear_message_data();
  433. static const int kMessageDataFieldNumber = 4;
  434. private:
  435. const ::google::protobuf::testing::oneofs::Data& _internal_message_data() const;
  436. public:
  437. const ::google::protobuf::testing::oneofs::Data& message_data() const;
  438. ::google::protobuf::testing::oneofs::Data* release_message_data();
  439. ::google::protobuf::testing::oneofs::Data* mutable_message_data();
  440. void set_allocated_message_data(::google::protobuf::testing::oneofs::Data* message_data);
  441. // .google.protobuf.testing.oneofs.MoreData more_data = 5;
  442. bool has_more_data() const;
  443. void clear_more_data();
  444. static const int kMoreDataFieldNumber = 5;
  445. private:
  446. const ::google::protobuf::testing::oneofs::MoreData& _internal_more_data() const;
  447. public:
  448. const ::google::protobuf::testing::oneofs::MoreData& more_data() const;
  449. ::google::protobuf::testing::oneofs::MoreData* release_more_data();
  450. ::google::protobuf::testing::oneofs::MoreData* mutable_more_data();
  451. void set_allocated_more_data(::google::protobuf::testing::oneofs::MoreData* more_data);
  452. void clear_data();
  453. DataCase data_case() const;
  454. // @@protoc_insertion_point(class_scope:google.protobuf.testing.oneofs.RequestWithSimpleOneof)
  455. private:
  456. void set_has_str_data();
  457. void set_has_int_data();
  458. void set_has_message_data();
  459. void set_has_more_data();
  460. inline bool has_data() const;
  461. inline void clear_has_data();
  462. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  463. ::google::protobuf::internal::ArenaStringPtr value_;
  464. union DataUnion {
  465. DataUnion() {}
  466. ::google::protobuf::internal::ArenaStringPtr str_data_;
  467. ::google::protobuf::int32 int_data_;
  468. ::google::protobuf::testing::oneofs::Data* message_data_;
  469. ::google::protobuf::testing::oneofs::MoreData* more_data_;
  470. } data_;
  471. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  472. ::google::protobuf::uint32 _oneof_case_[1];
  473. friend struct ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto::TableStruct;
  474. };
  475. // -------------------------------------------------------------------
  476. class Data : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.testing.oneofs.Data) */ {
  477. public:
  478. Data();
  479. virtual ~Data();
  480. Data(const Data& from);
  481. inline Data& operator=(const Data& from) {
  482. CopyFrom(from);
  483. return *this;
  484. }
  485. #if LANG_CXX11
  486. Data(Data&& from) noexcept
  487. : Data() {
  488. *this = ::std::move(from);
  489. }
  490. inline Data& operator=(Data&& from) noexcept {
  491. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  492. if (this != &from) InternalSwap(&from);
  493. } else {
  494. CopyFrom(from);
  495. }
  496. return *this;
  497. }
  498. #endif
  499. static const ::google::protobuf::Descriptor* descriptor();
  500. static const Data& default_instance();
  501. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  502. static inline const Data* internal_default_instance() {
  503. return reinterpret_cast<const Data*>(
  504. &_Data_default_instance_);
  505. }
  506. static constexpr int kIndexInFileMessages =
  507. 2;
  508. void Swap(Data* other);
  509. friend void swap(Data& a, Data& b) {
  510. a.Swap(&b);
  511. }
  512. // implements Message ----------------------------------------------
  513. inline Data* New() const final {
  514. return CreateMaybeMessage<Data>(NULL);
  515. }
  516. Data* New(::google::protobuf::Arena* arena) const final {
  517. return CreateMaybeMessage<Data>(arena);
  518. }
  519. void CopyFrom(const ::google::protobuf::Message& from) final;
  520. void MergeFrom(const ::google::protobuf::Message& from) final;
  521. void CopyFrom(const Data& from);
  522. void MergeFrom(const Data& from);
  523. void Clear() final;
  524. bool IsInitialized() const final;
  525. size_t ByteSizeLong() const final;
  526. bool MergePartialFromCodedStream(
  527. ::google::protobuf::io::CodedInputStream* input) final;
  528. void SerializeWithCachedSizes(
  529. ::google::protobuf::io::CodedOutputStream* output) const final;
  530. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  531. bool deterministic, ::google::protobuf::uint8* target) const final;
  532. int GetCachedSize() const final { return _cached_size_.Get(); }
  533. private:
  534. void SharedCtor();
  535. void SharedDtor();
  536. void SetCachedSize(int size) const final;
  537. void InternalSwap(Data* other);
  538. private:
  539. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  540. return NULL;
  541. }
  542. inline void* MaybeArenaPtr() const {
  543. return NULL;
  544. }
  545. public:
  546. ::google::protobuf::Metadata GetMetadata() const final;
  547. // nested types ----------------------------------------------------
  548. // accessors -------------------------------------------------------
  549. // int32 data_value = 1;
  550. void clear_data_value();
  551. static const int kDataValueFieldNumber = 1;
  552. ::google::protobuf::int32 data_value() const;
  553. void set_data_value(::google::protobuf::int32 value);
  554. // @@protoc_insertion_point(class_scope:google.protobuf.testing.oneofs.Data)
  555. private:
  556. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  557. ::google::protobuf::int32 data_value_;
  558. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  559. friend struct ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto::TableStruct;
  560. };
  561. // -------------------------------------------------------------------
  562. class MoreData : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.testing.oneofs.MoreData) */ {
  563. public:
  564. MoreData();
  565. virtual ~MoreData();
  566. MoreData(const MoreData& from);
  567. inline MoreData& operator=(const MoreData& from) {
  568. CopyFrom(from);
  569. return *this;
  570. }
  571. #if LANG_CXX11
  572. MoreData(MoreData&& from) noexcept
  573. : MoreData() {
  574. *this = ::std::move(from);
  575. }
  576. inline MoreData& operator=(MoreData&& from) noexcept {
  577. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  578. if (this != &from) InternalSwap(&from);
  579. } else {
  580. CopyFrom(from);
  581. }
  582. return *this;
  583. }
  584. #endif
  585. static const ::google::protobuf::Descriptor* descriptor();
  586. static const MoreData& default_instance();
  587. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  588. static inline const MoreData* internal_default_instance() {
  589. return reinterpret_cast<const MoreData*>(
  590. &_MoreData_default_instance_);
  591. }
  592. static constexpr int kIndexInFileMessages =
  593. 3;
  594. void Swap(MoreData* other);
  595. friend void swap(MoreData& a, MoreData& b) {
  596. a.Swap(&b);
  597. }
  598. // implements Message ----------------------------------------------
  599. inline MoreData* New() const final {
  600. return CreateMaybeMessage<MoreData>(NULL);
  601. }
  602. MoreData* New(::google::protobuf::Arena* arena) const final {
  603. return CreateMaybeMessage<MoreData>(arena);
  604. }
  605. void CopyFrom(const ::google::protobuf::Message& from) final;
  606. void MergeFrom(const ::google::protobuf::Message& from) final;
  607. void CopyFrom(const MoreData& from);
  608. void MergeFrom(const MoreData& from);
  609. void Clear() final;
  610. bool IsInitialized() const final;
  611. size_t ByteSizeLong() const final;
  612. bool MergePartialFromCodedStream(
  613. ::google::protobuf::io::CodedInputStream* input) final;
  614. void SerializeWithCachedSizes(
  615. ::google::protobuf::io::CodedOutputStream* output) const final;
  616. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  617. bool deterministic, ::google::protobuf::uint8* target) const final;
  618. int GetCachedSize() const final { return _cached_size_.Get(); }
  619. private:
  620. void SharedCtor();
  621. void SharedDtor();
  622. void SetCachedSize(int size) const final;
  623. void InternalSwap(MoreData* other);
  624. private:
  625. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  626. return NULL;
  627. }
  628. inline void* MaybeArenaPtr() const {
  629. return NULL;
  630. }
  631. public:
  632. ::google::protobuf::Metadata GetMetadata() const final;
  633. // nested types ----------------------------------------------------
  634. // accessors -------------------------------------------------------
  635. // string str_value = 1;
  636. void clear_str_value();
  637. static const int kStrValueFieldNumber = 1;
  638. const ::std::string& str_value() const;
  639. void set_str_value(const ::std::string& value);
  640. #if LANG_CXX11
  641. void set_str_value(::std::string&& value);
  642. #endif
  643. void set_str_value(const char* value);
  644. void set_str_value(const char* value, size_t size);
  645. ::std::string* mutable_str_value();
  646. ::std::string* release_str_value();
  647. void set_allocated_str_value(::std::string* str_value);
  648. // @@protoc_insertion_point(class_scope:google.protobuf.testing.oneofs.MoreData)
  649. private:
  650. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  651. ::google::protobuf::internal::ArenaStringPtr str_value_;
  652. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  653. friend struct ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto::TableStruct;
  654. };
  655. // -------------------------------------------------------------------
  656. class Response : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.testing.oneofs.Response) */ {
  657. public:
  658. Response();
  659. virtual ~Response();
  660. Response(const Response& from);
  661. inline Response& operator=(const Response& from) {
  662. CopyFrom(from);
  663. return *this;
  664. }
  665. #if LANG_CXX11
  666. Response(Response&& from) noexcept
  667. : Response() {
  668. *this = ::std::move(from);
  669. }
  670. inline Response& operator=(Response&& from) noexcept {
  671. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  672. if (this != &from) InternalSwap(&from);
  673. } else {
  674. CopyFrom(from);
  675. }
  676. return *this;
  677. }
  678. #endif
  679. static const ::google::protobuf::Descriptor* descriptor();
  680. static const Response& default_instance();
  681. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  682. static inline const Response* internal_default_instance() {
  683. return reinterpret_cast<const Response*>(
  684. &_Response_default_instance_);
  685. }
  686. static constexpr int kIndexInFileMessages =
  687. 4;
  688. void Swap(Response* other);
  689. friend void swap(Response& a, Response& b) {
  690. a.Swap(&b);
  691. }
  692. // implements Message ----------------------------------------------
  693. inline Response* New() const final {
  694. return CreateMaybeMessage<Response>(NULL);
  695. }
  696. Response* New(::google::protobuf::Arena* arena) const final {
  697. return CreateMaybeMessage<Response>(arena);
  698. }
  699. void CopyFrom(const ::google::protobuf::Message& from) final;
  700. void MergeFrom(const ::google::protobuf::Message& from) final;
  701. void CopyFrom(const Response& from);
  702. void MergeFrom(const Response& from);
  703. void Clear() final;
  704. bool IsInitialized() const final;
  705. size_t ByteSizeLong() const final;
  706. bool MergePartialFromCodedStream(
  707. ::google::protobuf::io::CodedInputStream* input) final;
  708. void SerializeWithCachedSizes(
  709. ::google::protobuf::io::CodedOutputStream* output) const final;
  710. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  711. bool deterministic, ::google::protobuf::uint8* target) const final;
  712. int GetCachedSize() const final { return _cached_size_.Get(); }
  713. private:
  714. void SharedCtor();
  715. void SharedDtor();
  716. void SetCachedSize(int size) const final;
  717. void InternalSwap(Response* other);
  718. private:
  719. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  720. return NULL;
  721. }
  722. inline void* MaybeArenaPtr() const {
  723. return NULL;
  724. }
  725. public:
  726. ::google::protobuf::Metadata GetMetadata() const final;
  727. // nested types ----------------------------------------------------
  728. // accessors -------------------------------------------------------
  729. // string value = 1;
  730. void clear_value();
  731. static const int kValueFieldNumber = 1;
  732. const ::std::string& value() const;
  733. void set_value(const ::std::string& value);
  734. #if LANG_CXX11
  735. void set_value(::std::string&& value);
  736. #endif
  737. void set_value(const char* value);
  738. void set_value(const char* value, size_t size);
  739. ::std::string* mutable_value();
  740. ::std::string* release_value();
  741. void set_allocated_value(::std::string* value);
  742. // @@protoc_insertion_point(class_scope:google.protobuf.testing.oneofs.Response)
  743. private:
  744. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  745. ::google::protobuf::internal::ArenaStringPtr value_;
  746. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  747. friend struct ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto::TableStruct;
  748. };
  749. // ===================================================================
  750. // ===================================================================
  751. #ifdef __GNUC__
  752. #pragma GCC diagnostic push
  753. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  754. #endif // __GNUC__
  755. // OneOfsRequest
  756. // string value = 1;
  757. inline void OneOfsRequest::clear_value() {
  758. value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  759. }
  760. inline const ::std::string& OneOfsRequest::value() const {
  761. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.value)
  762. return value_.GetNoArena();
  763. }
  764. inline void OneOfsRequest::set_value(const ::std::string& value) {
  765. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  766. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.OneOfsRequest.value)
  767. }
  768. #if LANG_CXX11
  769. inline void OneOfsRequest::set_value(::std::string&& value) {
  770. value_.SetNoArena(
  771. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  772. // @@protoc_insertion_point(field_set_rvalue:google.protobuf.testing.oneofs.OneOfsRequest.value)
  773. }
  774. #endif
  775. inline void OneOfsRequest::set_value(const char* value) {
  776. GOOGLE_DCHECK(value != NULL);
  777. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  778. // @@protoc_insertion_point(field_set_char:google.protobuf.testing.oneofs.OneOfsRequest.value)
  779. }
  780. inline void OneOfsRequest::set_value(const char* value, size_t size) {
  781. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  782. ::std::string(reinterpret_cast<const char*>(value), size));
  783. // @@protoc_insertion_point(field_set_pointer:google.protobuf.testing.oneofs.OneOfsRequest.value)
  784. }
  785. inline ::std::string* OneOfsRequest::mutable_value() {
  786. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.value)
  787. return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  788. }
  789. inline ::std::string* OneOfsRequest::release_value() {
  790. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.value)
  791. return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  792. }
  793. inline void OneOfsRequest::set_allocated_value(::std::string* value) {
  794. if (value != NULL) {
  795. } else {
  796. }
  797. value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  798. // @@protoc_insertion_point(field_set_allocated:google.protobuf.testing.oneofs.OneOfsRequest.value)
  799. }
  800. // string str_data = 2;
  801. inline bool OneOfsRequest::has_str_data() const {
  802. return data_case() == kStrData;
  803. }
  804. inline void OneOfsRequest::set_has_str_data() {
  805. _oneof_case_[0] = kStrData;
  806. }
  807. inline void OneOfsRequest::clear_str_data() {
  808. if (has_str_data()) {
  809. data_.str_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  810. clear_has_data();
  811. }
  812. }
  813. inline const ::std::string& OneOfsRequest::str_data() const {
  814. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  815. if (has_str_data()) {
  816. return data_.str_data_.GetNoArena();
  817. }
  818. return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
  819. }
  820. inline void OneOfsRequest::set_str_data(const ::std::string& value) {
  821. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  822. if (!has_str_data()) {
  823. clear_data();
  824. set_has_str_data();
  825. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  826. }
  827. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  828. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  829. }
  830. #if LANG_CXX11
  831. inline void OneOfsRequest::set_str_data(::std::string&& value) {
  832. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  833. if (!has_str_data()) {
  834. clear_data();
  835. set_has_str_data();
  836. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  837. }
  838. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  839. // @@protoc_insertion_point(field_set_rvalue:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  840. }
  841. #endif
  842. inline void OneOfsRequest::set_str_data(const char* value) {
  843. GOOGLE_DCHECK(value != NULL);
  844. if (!has_str_data()) {
  845. clear_data();
  846. set_has_str_data();
  847. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  848. }
  849. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  850. ::std::string(value));
  851. // @@protoc_insertion_point(field_set_char:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  852. }
  853. inline void OneOfsRequest::set_str_data(const char* value, size_t size) {
  854. if (!has_str_data()) {
  855. clear_data();
  856. set_has_str_data();
  857. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  858. }
  859. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
  860. reinterpret_cast<const char*>(value), size));
  861. // @@protoc_insertion_point(field_set_pointer:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  862. }
  863. inline ::std::string* OneOfsRequest::mutable_str_data() {
  864. if (!has_str_data()) {
  865. clear_data();
  866. set_has_str_data();
  867. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  868. }
  869. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  870. return data_.str_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  871. }
  872. inline ::std::string* OneOfsRequest::release_str_data() {
  873. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  874. if (has_str_data()) {
  875. clear_has_data();
  876. return data_.str_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  877. } else {
  878. return NULL;
  879. }
  880. }
  881. inline void OneOfsRequest::set_allocated_str_data(::std::string* str_data) {
  882. if (!has_str_data()) {
  883. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  884. }
  885. clear_data();
  886. if (str_data != NULL) {
  887. set_has_str_data();
  888. data_.str_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), str_data);
  889. }
  890. // @@protoc_insertion_point(field_set_allocated:google.protobuf.testing.oneofs.OneOfsRequest.str_data)
  891. }
  892. // int32 int_data = 3;
  893. inline bool OneOfsRequest::has_int_data() const {
  894. return data_case() == kIntData;
  895. }
  896. inline void OneOfsRequest::set_has_int_data() {
  897. _oneof_case_[0] = kIntData;
  898. }
  899. inline void OneOfsRequest::clear_int_data() {
  900. if (has_int_data()) {
  901. data_.int_data_ = 0;
  902. clear_has_data();
  903. }
  904. }
  905. inline ::google::protobuf::int32 OneOfsRequest::int_data() const {
  906. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.int_data)
  907. if (has_int_data()) {
  908. return data_.int_data_;
  909. }
  910. return 0;
  911. }
  912. inline void OneOfsRequest::set_int_data(::google::protobuf::int32 value) {
  913. if (!has_int_data()) {
  914. clear_data();
  915. set_has_int_data();
  916. }
  917. data_.int_data_ = value;
  918. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.OneOfsRequest.int_data)
  919. }
  920. // .google.protobuf.testing.oneofs.Data message_data = 4;
  921. inline bool OneOfsRequest::has_message_data() const {
  922. return data_case() == kMessageData;
  923. }
  924. inline void OneOfsRequest::set_has_message_data() {
  925. _oneof_case_[0] = kMessageData;
  926. }
  927. inline void OneOfsRequest::clear_message_data() {
  928. if (has_message_data()) {
  929. delete data_.message_data_;
  930. clear_has_data();
  931. }
  932. }
  933. inline const ::google::protobuf::testing::oneofs::Data& OneOfsRequest::_internal_message_data() const {
  934. return *data_.message_data_;
  935. }
  936. inline ::google::protobuf::testing::oneofs::Data* OneOfsRequest::release_message_data() {
  937. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.message_data)
  938. if (has_message_data()) {
  939. clear_has_data();
  940. ::google::protobuf::testing::oneofs::Data* temp = data_.message_data_;
  941. data_.message_data_ = NULL;
  942. return temp;
  943. } else {
  944. return NULL;
  945. }
  946. }
  947. inline const ::google::protobuf::testing::oneofs::Data& OneOfsRequest::message_data() const {
  948. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.message_data)
  949. return has_message_data()
  950. ? *data_.message_data_
  951. : *reinterpret_cast< ::google::protobuf::testing::oneofs::Data*>(&::google::protobuf::testing::oneofs::_Data_default_instance_);
  952. }
  953. inline ::google::protobuf::testing::oneofs::Data* OneOfsRequest::mutable_message_data() {
  954. if (!has_message_data()) {
  955. clear_data();
  956. set_has_message_data();
  957. data_.message_data_ = CreateMaybeMessage< ::google::protobuf::testing::oneofs::Data >(
  958. GetArenaNoVirtual());
  959. }
  960. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.message_data)
  961. return data_.message_data_;
  962. }
  963. // .google.protobuf.testing.oneofs.MoreData more_data = 5;
  964. inline bool OneOfsRequest::has_more_data() const {
  965. return data_case() == kMoreData;
  966. }
  967. inline void OneOfsRequest::set_has_more_data() {
  968. _oneof_case_[0] = kMoreData;
  969. }
  970. inline void OneOfsRequest::clear_more_data() {
  971. if (has_more_data()) {
  972. delete data_.more_data_;
  973. clear_has_data();
  974. }
  975. }
  976. inline const ::google::protobuf::testing::oneofs::MoreData& OneOfsRequest::_internal_more_data() const {
  977. return *data_.more_data_;
  978. }
  979. inline ::google::protobuf::testing::oneofs::MoreData* OneOfsRequest::release_more_data() {
  980. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.more_data)
  981. if (has_more_data()) {
  982. clear_has_data();
  983. ::google::protobuf::testing::oneofs::MoreData* temp = data_.more_data_;
  984. data_.more_data_ = NULL;
  985. return temp;
  986. } else {
  987. return NULL;
  988. }
  989. }
  990. inline const ::google::protobuf::testing::oneofs::MoreData& OneOfsRequest::more_data() const {
  991. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.more_data)
  992. return has_more_data()
  993. ? *data_.more_data_
  994. : *reinterpret_cast< ::google::protobuf::testing::oneofs::MoreData*>(&::google::protobuf::testing::oneofs::_MoreData_default_instance_);
  995. }
  996. inline ::google::protobuf::testing::oneofs::MoreData* OneOfsRequest::mutable_more_data() {
  997. if (!has_more_data()) {
  998. clear_data();
  999. set_has_more_data();
  1000. data_.more_data_ = CreateMaybeMessage< ::google::protobuf::testing::oneofs::MoreData >(
  1001. GetArenaNoVirtual());
  1002. }
  1003. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.more_data)
  1004. return data_.more_data_;
  1005. }
  1006. // .google.protobuf.Struct struct_data = 6;
  1007. inline bool OneOfsRequest::has_struct_data() const {
  1008. return data_case() == kStructData;
  1009. }
  1010. inline void OneOfsRequest::set_has_struct_data() {
  1011. _oneof_case_[0] = kStructData;
  1012. }
  1013. inline const ::google::protobuf::Struct& OneOfsRequest::_internal_struct_data() const {
  1014. return *data_.struct_data_;
  1015. }
  1016. inline ::google::protobuf::Struct* OneOfsRequest::release_struct_data() {
  1017. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.struct_data)
  1018. if (has_struct_data()) {
  1019. clear_has_data();
  1020. ::google::protobuf::Struct* temp = data_.struct_data_;
  1021. data_.struct_data_ = NULL;
  1022. return temp;
  1023. } else {
  1024. return NULL;
  1025. }
  1026. }
  1027. inline const ::google::protobuf::Struct& OneOfsRequest::struct_data() const {
  1028. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.struct_data)
  1029. return has_struct_data()
  1030. ? *data_.struct_data_
  1031. : *reinterpret_cast< ::google::protobuf::Struct*>(&::google::protobuf::_Struct_default_instance_);
  1032. }
  1033. inline ::google::protobuf::Struct* OneOfsRequest::mutable_struct_data() {
  1034. if (!has_struct_data()) {
  1035. clear_data();
  1036. set_has_struct_data();
  1037. data_.struct_data_ = CreateMaybeMessage< ::google::protobuf::Struct >(
  1038. GetArenaNoVirtual());
  1039. }
  1040. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.struct_data)
  1041. return data_.struct_data_;
  1042. }
  1043. // .google.protobuf.Value value_data = 7;
  1044. inline bool OneOfsRequest::has_value_data() const {
  1045. return data_case() == kValueData;
  1046. }
  1047. inline void OneOfsRequest::set_has_value_data() {
  1048. _oneof_case_[0] = kValueData;
  1049. }
  1050. inline const ::google::protobuf::Value& OneOfsRequest::_internal_value_data() const {
  1051. return *data_.value_data_;
  1052. }
  1053. inline ::google::protobuf::Value* OneOfsRequest::release_value_data() {
  1054. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.value_data)
  1055. if (has_value_data()) {
  1056. clear_has_data();
  1057. ::google::protobuf::Value* temp = data_.value_data_;
  1058. data_.value_data_ = NULL;
  1059. return temp;
  1060. } else {
  1061. return NULL;
  1062. }
  1063. }
  1064. inline const ::google::protobuf::Value& OneOfsRequest::value_data() const {
  1065. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.value_data)
  1066. return has_value_data()
  1067. ? *data_.value_data_
  1068. : *reinterpret_cast< ::google::protobuf::Value*>(&::google::protobuf::_Value_default_instance_);
  1069. }
  1070. inline ::google::protobuf::Value* OneOfsRequest::mutable_value_data() {
  1071. if (!has_value_data()) {
  1072. clear_data();
  1073. set_has_value_data();
  1074. data_.value_data_ = CreateMaybeMessage< ::google::protobuf::Value >(
  1075. GetArenaNoVirtual());
  1076. }
  1077. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.value_data)
  1078. return data_.value_data_;
  1079. }
  1080. // .google.protobuf.ListValue list_value_data = 8;
  1081. inline bool OneOfsRequest::has_list_value_data() const {
  1082. return data_case() == kListValueData;
  1083. }
  1084. inline void OneOfsRequest::set_has_list_value_data() {
  1085. _oneof_case_[0] = kListValueData;
  1086. }
  1087. inline const ::google::protobuf::ListValue& OneOfsRequest::_internal_list_value_data() const {
  1088. return *data_.list_value_data_;
  1089. }
  1090. inline ::google::protobuf::ListValue* OneOfsRequest::release_list_value_data() {
  1091. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.list_value_data)
  1092. if (has_list_value_data()) {
  1093. clear_has_data();
  1094. ::google::protobuf::ListValue* temp = data_.list_value_data_;
  1095. data_.list_value_data_ = NULL;
  1096. return temp;
  1097. } else {
  1098. return NULL;
  1099. }
  1100. }
  1101. inline const ::google::protobuf::ListValue& OneOfsRequest::list_value_data() const {
  1102. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.list_value_data)
  1103. return has_list_value_data()
  1104. ? *data_.list_value_data_
  1105. : *reinterpret_cast< ::google::protobuf::ListValue*>(&::google::protobuf::_ListValue_default_instance_);
  1106. }
  1107. inline ::google::protobuf::ListValue* OneOfsRequest::mutable_list_value_data() {
  1108. if (!has_list_value_data()) {
  1109. clear_data();
  1110. set_has_list_value_data();
  1111. data_.list_value_data_ = CreateMaybeMessage< ::google::protobuf::ListValue >(
  1112. GetArenaNoVirtual());
  1113. }
  1114. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.list_value_data)
  1115. return data_.list_value_data_;
  1116. }
  1117. // .google.protobuf.Timestamp ts_data = 9;
  1118. inline bool OneOfsRequest::has_ts_data() const {
  1119. return data_case() == kTsData;
  1120. }
  1121. inline void OneOfsRequest::set_has_ts_data() {
  1122. _oneof_case_[0] = kTsData;
  1123. }
  1124. inline const ::google::protobuf::Timestamp& OneOfsRequest::_internal_ts_data() const {
  1125. return *data_.ts_data_;
  1126. }
  1127. inline ::google::protobuf::Timestamp* OneOfsRequest::release_ts_data() {
  1128. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.ts_data)
  1129. if (has_ts_data()) {
  1130. clear_has_data();
  1131. ::google::protobuf::Timestamp* temp = data_.ts_data_;
  1132. data_.ts_data_ = NULL;
  1133. return temp;
  1134. } else {
  1135. return NULL;
  1136. }
  1137. }
  1138. inline const ::google::protobuf::Timestamp& OneOfsRequest::ts_data() const {
  1139. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.ts_data)
  1140. return has_ts_data()
  1141. ? *data_.ts_data_
  1142. : *reinterpret_cast< ::google::protobuf::Timestamp*>(&::google::protobuf::_Timestamp_default_instance_);
  1143. }
  1144. inline ::google::protobuf::Timestamp* OneOfsRequest::mutable_ts_data() {
  1145. if (!has_ts_data()) {
  1146. clear_data();
  1147. set_has_ts_data();
  1148. data_.ts_data_ = CreateMaybeMessage< ::google::protobuf::Timestamp >(
  1149. GetArenaNoVirtual());
  1150. }
  1151. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.ts_data)
  1152. return data_.ts_data_;
  1153. }
  1154. // .google.protobuf.Any any_data = 19;
  1155. inline bool OneOfsRequest::has_any_data() const {
  1156. return this != internal_default_instance() && any_data_ != NULL;
  1157. }
  1158. inline const ::google::protobuf::Any& OneOfsRequest::_internal_any_data() const {
  1159. return *any_data_;
  1160. }
  1161. inline const ::google::protobuf::Any& OneOfsRequest::any_data() const {
  1162. const ::google::protobuf::Any* p = any_data_;
  1163. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.OneOfsRequest.any_data)
  1164. return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::Any*>(
  1165. &::google::protobuf::_Any_default_instance_);
  1166. }
  1167. inline ::google::protobuf::Any* OneOfsRequest::release_any_data() {
  1168. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.OneOfsRequest.any_data)
  1169. ::google::protobuf::Any* temp = any_data_;
  1170. any_data_ = NULL;
  1171. return temp;
  1172. }
  1173. inline ::google::protobuf::Any* OneOfsRequest::mutable_any_data() {
  1174. if (any_data_ == NULL) {
  1175. auto* p = CreateMaybeMessage<::google::protobuf::Any>(GetArenaNoVirtual());
  1176. any_data_ = p;
  1177. }
  1178. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.OneOfsRequest.any_data)
  1179. return any_data_;
  1180. }
  1181. inline void OneOfsRequest::set_allocated_any_data(::google::protobuf::Any* any_data) {
  1182. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  1183. if (message_arena == NULL) {
  1184. delete reinterpret_cast< ::google::protobuf::MessageLite*>(any_data_);
  1185. }
  1186. if (any_data) {
  1187. ::google::protobuf::Arena* submessage_arena = NULL;
  1188. if (message_arena != submessage_arena) {
  1189. any_data = ::google::protobuf::internal::GetOwnedMessage(
  1190. message_arena, any_data, submessage_arena);
  1191. }
  1192. } else {
  1193. }
  1194. any_data_ = any_data;
  1195. // @@protoc_insertion_point(field_set_allocated:google.protobuf.testing.oneofs.OneOfsRequest.any_data)
  1196. }
  1197. inline bool OneOfsRequest::has_data() const {
  1198. return data_case() != DATA_NOT_SET;
  1199. }
  1200. inline void OneOfsRequest::clear_has_data() {
  1201. _oneof_case_[0] = DATA_NOT_SET;
  1202. }
  1203. inline OneOfsRequest::DataCase OneOfsRequest::data_case() const {
  1204. return OneOfsRequest::DataCase(_oneof_case_[0]);
  1205. }
  1206. // -------------------------------------------------------------------
  1207. // RequestWithSimpleOneof
  1208. // string value = 1;
  1209. inline void RequestWithSimpleOneof::clear_value() {
  1210. value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1211. }
  1212. inline const ::std::string& RequestWithSimpleOneof::value() const {
  1213. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1214. return value_.GetNoArena();
  1215. }
  1216. inline void RequestWithSimpleOneof::set_value(const ::std::string& value) {
  1217. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1218. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1219. }
  1220. #if LANG_CXX11
  1221. inline void RequestWithSimpleOneof::set_value(::std::string&& value) {
  1222. value_.SetNoArena(
  1223. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1224. // @@protoc_insertion_point(field_set_rvalue:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1225. }
  1226. #endif
  1227. inline void RequestWithSimpleOneof::set_value(const char* value) {
  1228. GOOGLE_DCHECK(value != NULL);
  1229. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  1230. // @@protoc_insertion_point(field_set_char:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1231. }
  1232. inline void RequestWithSimpleOneof::set_value(const char* value, size_t size) {
  1233. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1234. ::std::string(reinterpret_cast<const char*>(value), size));
  1235. // @@protoc_insertion_point(field_set_pointer:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1236. }
  1237. inline ::std::string* RequestWithSimpleOneof::mutable_value() {
  1238. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1239. return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1240. }
  1241. inline ::std::string* RequestWithSimpleOneof::release_value() {
  1242. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1243. return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1244. }
  1245. inline void RequestWithSimpleOneof::set_allocated_value(::std::string* value) {
  1246. if (value != NULL) {
  1247. } else {
  1248. }
  1249. value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1250. // @@protoc_insertion_point(field_set_allocated:google.protobuf.testing.oneofs.RequestWithSimpleOneof.value)
  1251. }
  1252. // string str_data = 2;
  1253. inline bool RequestWithSimpleOneof::has_str_data() const {
  1254. return data_case() == kStrData;
  1255. }
  1256. inline void RequestWithSimpleOneof::set_has_str_data() {
  1257. _oneof_case_[0] = kStrData;
  1258. }
  1259. inline void RequestWithSimpleOneof::clear_str_data() {
  1260. if (has_str_data()) {
  1261. data_.str_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1262. clear_has_data();
  1263. }
  1264. }
  1265. inline const ::std::string& RequestWithSimpleOneof::str_data() const {
  1266. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1267. if (has_str_data()) {
  1268. return data_.str_data_.GetNoArena();
  1269. }
  1270. return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
  1271. }
  1272. inline void RequestWithSimpleOneof::set_str_data(const ::std::string& value) {
  1273. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1274. if (!has_str_data()) {
  1275. clear_data();
  1276. set_has_str_data();
  1277. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1278. }
  1279. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1280. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1281. }
  1282. #if LANG_CXX11
  1283. inline void RequestWithSimpleOneof::set_str_data(::std::string&& value) {
  1284. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1285. if (!has_str_data()) {
  1286. clear_data();
  1287. set_has_str_data();
  1288. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1289. }
  1290. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1291. // @@protoc_insertion_point(field_set_rvalue:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1292. }
  1293. #endif
  1294. inline void RequestWithSimpleOneof::set_str_data(const char* value) {
  1295. GOOGLE_DCHECK(value != NULL);
  1296. if (!has_str_data()) {
  1297. clear_data();
  1298. set_has_str_data();
  1299. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1300. }
  1301. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1302. ::std::string(value));
  1303. // @@protoc_insertion_point(field_set_char:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1304. }
  1305. inline void RequestWithSimpleOneof::set_str_data(const char* value, size_t size) {
  1306. if (!has_str_data()) {
  1307. clear_data();
  1308. set_has_str_data();
  1309. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1310. }
  1311. data_.str_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
  1312. reinterpret_cast<const char*>(value), size));
  1313. // @@protoc_insertion_point(field_set_pointer:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1314. }
  1315. inline ::std::string* RequestWithSimpleOneof::mutable_str_data() {
  1316. if (!has_str_data()) {
  1317. clear_data();
  1318. set_has_str_data();
  1319. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1320. }
  1321. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1322. return data_.str_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1323. }
  1324. inline ::std::string* RequestWithSimpleOneof::release_str_data() {
  1325. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1326. if (has_str_data()) {
  1327. clear_has_data();
  1328. return data_.str_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1329. } else {
  1330. return NULL;
  1331. }
  1332. }
  1333. inline void RequestWithSimpleOneof::set_allocated_str_data(::std::string* str_data) {
  1334. if (!has_str_data()) {
  1335. data_.str_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1336. }
  1337. clear_data();
  1338. if (str_data != NULL) {
  1339. set_has_str_data();
  1340. data_.str_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), str_data);
  1341. }
  1342. // @@protoc_insertion_point(field_set_allocated:google.protobuf.testing.oneofs.RequestWithSimpleOneof.str_data)
  1343. }
  1344. // int32 int_data = 3;
  1345. inline bool RequestWithSimpleOneof::has_int_data() const {
  1346. return data_case() == kIntData;
  1347. }
  1348. inline void RequestWithSimpleOneof::set_has_int_data() {
  1349. _oneof_case_[0] = kIntData;
  1350. }
  1351. inline void RequestWithSimpleOneof::clear_int_data() {
  1352. if (has_int_data()) {
  1353. data_.int_data_ = 0;
  1354. clear_has_data();
  1355. }
  1356. }
  1357. inline ::google::protobuf::int32 RequestWithSimpleOneof::int_data() const {
  1358. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.RequestWithSimpleOneof.int_data)
  1359. if (has_int_data()) {
  1360. return data_.int_data_;
  1361. }
  1362. return 0;
  1363. }
  1364. inline void RequestWithSimpleOneof::set_int_data(::google::protobuf::int32 value) {
  1365. if (!has_int_data()) {
  1366. clear_data();
  1367. set_has_int_data();
  1368. }
  1369. data_.int_data_ = value;
  1370. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.RequestWithSimpleOneof.int_data)
  1371. }
  1372. // .google.protobuf.testing.oneofs.Data message_data = 4;
  1373. inline bool RequestWithSimpleOneof::has_message_data() const {
  1374. return data_case() == kMessageData;
  1375. }
  1376. inline void RequestWithSimpleOneof::set_has_message_data() {
  1377. _oneof_case_[0] = kMessageData;
  1378. }
  1379. inline void RequestWithSimpleOneof::clear_message_data() {
  1380. if (has_message_data()) {
  1381. delete data_.message_data_;
  1382. clear_has_data();
  1383. }
  1384. }
  1385. inline const ::google::protobuf::testing::oneofs::Data& RequestWithSimpleOneof::_internal_message_data() const {
  1386. return *data_.message_data_;
  1387. }
  1388. inline ::google::protobuf::testing::oneofs::Data* RequestWithSimpleOneof::release_message_data() {
  1389. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.RequestWithSimpleOneof.message_data)
  1390. if (has_message_data()) {
  1391. clear_has_data();
  1392. ::google::protobuf::testing::oneofs::Data* temp = data_.message_data_;
  1393. data_.message_data_ = NULL;
  1394. return temp;
  1395. } else {
  1396. return NULL;
  1397. }
  1398. }
  1399. inline const ::google::protobuf::testing::oneofs::Data& RequestWithSimpleOneof::message_data() const {
  1400. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.RequestWithSimpleOneof.message_data)
  1401. return has_message_data()
  1402. ? *data_.message_data_
  1403. : *reinterpret_cast< ::google::protobuf::testing::oneofs::Data*>(&::google::protobuf::testing::oneofs::_Data_default_instance_);
  1404. }
  1405. inline ::google::protobuf::testing::oneofs::Data* RequestWithSimpleOneof::mutable_message_data() {
  1406. if (!has_message_data()) {
  1407. clear_data();
  1408. set_has_message_data();
  1409. data_.message_data_ = CreateMaybeMessage< ::google::protobuf::testing::oneofs::Data >(
  1410. GetArenaNoVirtual());
  1411. }
  1412. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.RequestWithSimpleOneof.message_data)
  1413. return data_.message_data_;
  1414. }
  1415. // .google.protobuf.testing.oneofs.MoreData more_data = 5;
  1416. inline bool RequestWithSimpleOneof::has_more_data() const {
  1417. return data_case() == kMoreData;
  1418. }
  1419. inline void RequestWithSimpleOneof::set_has_more_data() {
  1420. _oneof_case_[0] = kMoreData;
  1421. }
  1422. inline void RequestWithSimpleOneof::clear_more_data() {
  1423. if (has_more_data()) {
  1424. delete data_.more_data_;
  1425. clear_has_data();
  1426. }
  1427. }
  1428. inline const ::google::protobuf::testing::oneofs::MoreData& RequestWithSimpleOneof::_internal_more_data() const {
  1429. return *data_.more_data_;
  1430. }
  1431. inline ::google::protobuf::testing::oneofs::MoreData* RequestWithSimpleOneof::release_more_data() {
  1432. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.RequestWithSimpleOneof.more_data)
  1433. if (has_more_data()) {
  1434. clear_has_data();
  1435. ::google::protobuf::testing::oneofs::MoreData* temp = data_.more_data_;
  1436. data_.more_data_ = NULL;
  1437. return temp;
  1438. } else {
  1439. return NULL;
  1440. }
  1441. }
  1442. inline const ::google::protobuf::testing::oneofs::MoreData& RequestWithSimpleOneof::more_data() const {
  1443. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.RequestWithSimpleOneof.more_data)
  1444. return has_more_data()
  1445. ? *data_.more_data_
  1446. : *reinterpret_cast< ::google::protobuf::testing::oneofs::MoreData*>(&::google::protobuf::testing::oneofs::_MoreData_default_instance_);
  1447. }
  1448. inline ::google::protobuf::testing::oneofs::MoreData* RequestWithSimpleOneof::mutable_more_data() {
  1449. if (!has_more_data()) {
  1450. clear_data();
  1451. set_has_more_data();
  1452. data_.more_data_ = CreateMaybeMessage< ::google::protobuf::testing::oneofs::MoreData >(
  1453. GetArenaNoVirtual());
  1454. }
  1455. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.RequestWithSimpleOneof.more_data)
  1456. return data_.more_data_;
  1457. }
  1458. inline bool RequestWithSimpleOneof::has_data() const {
  1459. return data_case() != DATA_NOT_SET;
  1460. }
  1461. inline void RequestWithSimpleOneof::clear_has_data() {
  1462. _oneof_case_[0] = DATA_NOT_SET;
  1463. }
  1464. inline RequestWithSimpleOneof::DataCase RequestWithSimpleOneof::data_case() const {
  1465. return RequestWithSimpleOneof::DataCase(_oneof_case_[0]);
  1466. }
  1467. // -------------------------------------------------------------------
  1468. // Data
  1469. // int32 data_value = 1;
  1470. inline void Data::clear_data_value() {
  1471. data_value_ = 0;
  1472. }
  1473. inline ::google::protobuf::int32 Data::data_value() const {
  1474. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.Data.data_value)
  1475. return data_value_;
  1476. }
  1477. inline void Data::set_data_value(::google::protobuf::int32 value) {
  1478. data_value_ = value;
  1479. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.Data.data_value)
  1480. }
  1481. // -------------------------------------------------------------------
  1482. // MoreData
  1483. // string str_value = 1;
  1484. inline void MoreData::clear_str_value() {
  1485. str_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1486. }
  1487. inline const ::std::string& MoreData::str_value() const {
  1488. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.MoreData.str_value)
  1489. return str_value_.GetNoArena();
  1490. }
  1491. inline void MoreData::set_str_value(const ::std::string& value) {
  1492. str_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1493. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.MoreData.str_value)
  1494. }
  1495. #if LANG_CXX11
  1496. inline void MoreData::set_str_value(::std::string&& value) {
  1497. str_value_.SetNoArena(
  1498. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1499. // @@protoc_insertion_point(field_set_rvalue:google.protobuf.testing.oneofs.MoreData.str_value)
  1500. }
  1501. #endif
  1502. inline void MoreData::set_str_value(const char* value) {
  1503. GOOGLE_DCHECK(value != NULL);
  1504. str_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  1505. // @@protoc_insertion_point(field_set_char:google.protobuf.testing.oneofs.MoreData.str_value)
  1506. }
  1507. inline void MoreData::set_str_value(const char* value, size_t size) {
  1508. str_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1509. ::std::string(reinterpret_cast<const char*>(value), size));
  1510. // @@protoc_insertion_point(field_set_pointer:google.protobuf.testing.oneofs.MoreData.str_value)
  1511. }
  1512. inline ::std::string* MoreData::mutable_str_value() {
  1513. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.MoreData.str_value)
  1514. return str_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1515. }
  1516. inline ::std::string* MoreData::release_str_value() {
  1517. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.MoreData.str_value)
  1518. return str_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1519. }
  1520. inline void MoreData::set_allocated_str_value(::std::string* str_value) {
  1521. if (str_value != NULL) {
  1522. } else {
  1523. }
  1524. str_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), str_value);
  1525. // @@protoc_insertion_point(field_set_allocated:google.protobuf.testing.oneofs.MoreData.str_value)
  1526. }
  1527. // -------------------------------------------------------------------
  1528. // Response
  1529. // string value = 1;
  1530. inline void Response::clear_value() {
  1531. value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1532. }
  1533. inline const ::std::string& Response::value() const {
  1534. // @@protoc_insertion_point(field_get:google.protobuf.testing.oneofs.Response.value)
  1535. return value_.GetNoArena();
  1536. }
  1537. inline void Response::set_value(const ::std::string& value) {
  1538. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1539. // @@protoc_insertion_point(field_set:google.protobuf.testing.oneofs.Response.value)
  1540. }
  1541. #if LANG_CXX11
  1542. inline void Response::set_value(::std::string&& value) {
  1543. value_.SetNoArena(
  1544. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1545. // @@protoc_insertion_point(field_set_rvalue:google.protobuf.testing.oneofs.Response.value)
  1546. }
  1547. #endif
  1548. inline void Response::set_value(const char* value) {
  1549. GOOGLE_DCHECK(value != NULL);
  1550. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  1551. // @@protoc_insertion_point(field_set_char:google.protobuf.testing.oneofs.Response.value)
  1552. }
  1553. inline void Response::set_value(const char* value, size_t size) {
  1554. value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1555. ::std::string(reinterpret_cast<const char*>(value), size));
  1556. // @@protoc_insertion_point(field_set_pointer:google.protobuf.testing.oneofs.Response.value)
  1557. }
  1558. inline ::std::string* Response::mutable_value() {
  1559. // @@protoc_insertion_point(field_mutable:google.protobuf.testing.oneofs.Response.value)
  1560. return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1561. }
  1562. inline ::std::string* Response::release_value() {
  1563. // @@protoc_insertion_point(field_release:google.protobuf.testing.oneofs.Response.value)
  1564. return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1565. }
  1566. inline void Response::set_allocated_value(::std::string* value) {
  1567. if (value != NULL) {
  1568. } else {
  1569. }
  1570. value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1571. // @@protoc_insertion_point(field_set_allocated:google.protobuf.testing.oneofs.Response.value)
  1572. }
  1573. #ifdef __GNUC__
  1574. #pragma GCC diagnostic pop
  1575. #endif // __GNUC__
  1576. // -------------------------------------------------------------------
  1577. // -------------------------------------------------------------------
  1578. // -------------------------------------------------------------------
  1579. // -------------------------------------------------------------------
  1580. // @@protoc_insertion_point(namespace_scope)
  1581. } // namespace oneofs
  1582. } // namespace testing
  1583. } // namespace protobuf
  1584. } // namespace google
  1585. // @@protoc_insertion_point(global_scope)
  1586. #endif // PROTOBUF_INCLUDED_google_2fprotobuf_2futil_2finternal_2ftestdata_2foneofs_2eproto