unittest_no_field_presence.pb.h 135 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_no_field_presence.proto
  3. #ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto
  4. #define PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_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/generated_enum_reflection.h>
  28. #include <google/protobuf/unknown_field_set.h>
  29. #include <google/protobuf/unittest.pb.h>
  30. // @@protoc_insertion_point(includes)
  31. #define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto
  32. namespace protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto {
  33. // Internal implementation detail -- do not use these members.
  34. struct TableStruct {
  35. static const ::google::protobuf::internal::ParseTableField entries[];
  36. static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
  37. static const ::google::protobuf::internal::ParseTable schema[4];
  38. static const ::google::protobuf::internal::FieldMetadata field_metadata[];
  39. static const ::google::protobuf::internal::SerializationTable serialization_table[];
  40. static const ::google::protobuf::uint32 offsets[];
  41. };
  42. void AddDescriptors();
  43. } // namespace protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto
  44. namespace proto2_nofieldpresence_unittest {
  45. class ForeignMessage;
  46. class ForeignMessageDefaultTypeInternal;
  47. extern ForeignMessageDefaultTypeInternal _ForeignMessage_default_instance_;
  48. class TestAllTypes;
  49. class TestAllTypesDefaultTypeInternal;
  50. extern TestAllTypesDefaultTypeInternal _TestAllTypes_default_instance_;
  51. class TestAllTypes_NestedMessage;
  52. class TestAllTypes_NestedMessageDefaultTypeInternal;
  53. extern TestAllTypes_NestedMessageDefaultTypeInternal _TestAllTypes_NestedMessage_default_instance_;
  54. class TestProto2Required;
  55. class TestProto2RequiredDefaultTypeInternal;
  56. extern TestProto2RequiredDefaultTypeInternal _TestProto2Required_default_instance_;
  57. } // namespace proto2_nofieldpresence_unittest
  58. namespace google {
  59. namespace protobuf {
  60. template<> ::proto2_nofieldpresence_unittest::ForeignMessage* Arena::CreateMaybeMessage<::proto2_nofieldpresence_unittest::ForeignMessage>(Arena*);
  61. template<> ::proto2_nofieldpresence_unittest::TestAllTypes* Arena::CreateMaybeMessage<::proto2_nofieldpresence_unittest::TestAllTypes>(Arena*);
  62. template<> ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* Arena::CreateMaybeMessage<::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage>(Arena*);
  63. template<> ::proto2_nofieldpresence_unittest::TestProto2Required* Arena::CreateMaybeMessage<::proto2_nofieldpresence_unittest::TestProto2Required>(Arena*);
  64. } // namespace protobuf
  65. } // namespace google
  66. namespace proto2_nofieldpresence_unittest {
  67. enum TestAllTypes_NestedEnum {
  68. TestAllTypes_NestedEnum_FOO = 0,
  69. TestAllTypes_NestedEnum_BAR = 1,
  70. TestAllTypes_NestedEnum_BAZ = 2,
  71. TestAllTypes_NestedEnum_TestAllTypes_NestedEnum_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
  72. TestAllTypes_NestedEnum_TestAllTypes_NestedEnum_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
  73. };
  74. bool TestAllTypes_NestedEnum_IsValid(int value);
  75. const TestAllTypes_NestedEnum TestAllTypes_NestedEnum_NestedEnum_MIN = TestAllTypes_NestedEnum_FOO;
  76. const TestAllTypes_NestedEnum TestAllTypes_NestedEnum_NestedEnum_MAX = TestAllTypes_NestedEnum_BAZ;
  77. const int TestAllTypes_NestedEnum_NestedEnum_ARRAYSIZE = TestAllTypes_NestedEnum_NestedEnum_MAX + 1;
  78. const ::google::protobuf::EnumDescriptor* TestAllTypes_NestedEnum_descriptor();
  79. inline const ::std::string& TestAllTypes_NestedEnum_Name(TestAllTypes_NestedEnum value) {
  80. return ::google::protobuf::internal::NameOfEnum(
  81. TestAllTypes_NestedEnum_descriptor(), value);
  82. }
  83. inline bool TestAllTypes_NestedEnum_Parse(
  84. const ::std::string& name, TestAllTypes_NestedEnum* value) {
  85. return ::google::protobuf::internal::ParseNamedEnum<TestAllTypes_NestedEnum>(
  86. TestAllTypes_NestedEnum_descriptor(), name, value);
  87. }
  88. enum ForeignEnum {
  89. FOREIGN_FOO = 0,
  90. FOREIGN_BAR = 1,
  91. FOREIGN_BAZ = 2,
  92. ForeignEnum_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
  93. ForeignEnum_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
  94. };
  95. bool ForeignEnum_IsValid(int value);
  96. const ForeignEnum ForeignEnum_MIN = FOREIGN_FOO;
  97. const ForeignEnum ForeignEnum_MAX = FOREIGN_BAZ;
  98. const int ForeignEnum_ARRAYSIZE = ForeignEnum_MAX + 1;
  99. const ::google::protobuf::EnumDescriptor* ForeignEnum_descriptor();
  100. inline const ::std::string& ForeignEnum_Name(ForeignEnum value) {
  101. return ::google::protobuf::internal::NameOfEnum(
  102. ForeignEnum_descriptor(), value);
  103. }
  104. inline bool ForeignEnum_Parse(
  105. const ::std::string& name, ForeignEnum* value) {
  106. return ::google::protobuf::internal::ParseNamedEnum<ForeignEnum>(
  107. ForeignEnum_descriptor(), name, value);
  108. }
  109. // ===================================================================
  110. class TestAllTypes_NestedMessage : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage) */ {
  111. public:
  112. TestAllTypes_NestedMessage();
  113. virtual ~TestAllTypes_NestedMessage();
  114. TestAllTypes_NestedMessage(const TestAllTypes_NestedMessage& from);
  115. inline TestAllTypes_NestedMessage& operator=(const TestAllTypes_NestedMessage& from) {
  116. CopyFrom(from);
  117. return *this;
  118. }
  119. #if LANG_CXX11
  120. TestAllTypes_NestedMessage(TestAllTypes_NestedMessage&& from) noexcept
  121. : TestAllTypes_NestedMessage() {
  122. *this = ::std::move(from);
  123. }
  124. inline TestAllTypes_NestedMessage& operator=(TestAllTypes_NestedMessage&& from) noexcept {
  125. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  126. if (this != &from) InternalSwap(&from);
  127. } else {
  128. CopyFrom(from);
  129. }
  130. return *this;
  131. }
  132. #endif
  133. static const ::google::protobuf::Descriptor* descriptor();
  134. static const TestAllTypes_NestedMessage& default_instance();
  135. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  136. static inline const TestAllTypes_NestedMessage* internal_default_instance() {
  137. return reinterpret_cast<const TestAllTypes_NestedMessage*>(
  138. &_TestAllTypes_NestedMessage_default_instance_);
  139. }
  140. static constexpr int kIndexInFileMessages =
  141. 0;
  142. void Swap(TestAllTypes_NestedMessage* other);
  143. friend void swap(TestAllTypes_NestedMessage& a, TestAllTypes_NestedMessage& b) {
  144. a.Swap(&b);
  145. }
  146. // implements Message ----------------------------------------------
  147. inline TestAllTypes_NestedMessage* New() const final {
  148. return CreateMaybeMessage<TestAllTypes_NestedMessage>(NULL);
  149. }
  150. TestAllTypes_NestedMessage* New(::google::protobuf::Arena* arena) const final {
  151. return CreateMaybeMessage<TestAllTypes_NestedMessage>(arena);
  152. }
  153. void CopyFrom(const ::google::protobuf::Message& from) final;
  154. void MergeFrom(const ::google::protobuf::Message& from) final;
  155. void CopyFrom(const TestAllTypes_NestedMessage& from);
  156. void MergeFrom(const TestAllTypes_NestedMessage& from);
  157. void Clear() final;
  158. bool IsInitialized() const final;
  159. size_t ByteSizeLong() const final;
  160. bool MergePartialFromCodedStream(
  161. ::google::protobuf::io::CodedInputStream* input) final;
  162. void SerializeWithCachedSizes(
  163. ::google::protobuf::io::CodedOutputStream* output) const final;
  164. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  165. bool deterministic, ::google::protobuf::uint8* target) const final;
  166. int GetCachedSize() const final { return _cached_size_.Get(); }
  167. private:
  168. void SharedCtor();
  169. void SharedDtor();
  170. void SetCachedSize(int size) const final;
  171. void InternalSwap(TestAllTypes_NestedMessage* other);
  172. private:
  173. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  174. return NULL;
  175. }
  176. inline void* MaybeArenaPtr() const {
  177. return NULL;
  178. }
  179. public:
  180. ::google::protobuf::Metadata GetMetadata() const final;
  181. // nested types ----------------------------------------------------
  182. // accessors -------------------------------------------------------
  183. // int32 bb = 1;
  184. void clear_bb();
  185. static const int kBbFieldNumber = 1;
  186. ::google::protobuf::int32 bb() const;
  187. void set_bb(::google::protobuf::int32 value);
  188. // @@protoc_insertion_point(class_scope:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  189. private:
  190. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  191. ::google::protobuf::int32 bb_;
  192. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  193. friend struct ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::TableStruct;
  194. };
  195. // -------------------------------------------------------------------
  196. class TestAllTypes : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto2_nofieldpresence_unittest.TestAllTypes) */ {
  197. public:
  198. TestAllTypes();
  199. virtual ~TestAllTypes();
  200. TestAllTypes(const TestAllTypes& from);
  201. inline TestAllTypes& operator=(const TestAllTypes& from) {
  202. CopyFrom(from);
  203. return *this;
  204. }
  205. #if LANG_CXX11
  206. TestAllTypes(TestAllTypes&& from) noexcept
  207. : TestAllTypes() {
  208. *this = ::std::move(from);
  209. }
  210. inline TestAllTypes& operator=(TestAllTypes&& from) noexcept {
  211. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  212. if (this != &from) InternalSwap(&from);
  213. } else {
  214. CopyFrom(from);
  215. }
  216. return *this;
  217. }
  218. #endif
  219. static const ::google::protobuf::Descriptor* descriptor();
  220. static const TestAllTypes& default_instance();
  221. enum OneofFieldCase {
  222. kOneofUint32 = 111,
  223. kOneofNestedMessage = 112,
  224. kOneofString = 113,
  225. kOneofEnum = 114,
  226. ONEOF_FIELD_NOT_SET = 0,
  227. };
  228. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  229. static inline const TestAllTypes* internal_default_instance() {
  230. return reinterpret_cast<const TestAllTypes*>(
  231. &_TestAllTypes_default_instance_);
  232. }
  233. static constexpr int kIndexInFileMessages =
  234. 1;
  235. void Swap(TestAllTypes* other);
  236. friend void swap(TestAllTypes& a, TestAllTypes& b) {
  237. a.Swap(&b);
  238. }
  239. // implements Message ----------------------------------------------
  240. inline TestAllTypes* New() const final {
  241. return CreateMaybeMessage<TestAllTypes>(NULL);
  242. }
  243. TestAllTypes* New(::google::protobuf::Arena* arena) const final {
  244. return CreateMaybeMessage<TestAllTypes>(arena);
  245. }
  246. void CopyFrom(const ::google::protobuf::Message& from) final;
  247. void MergeFrom(const ::google::protobuf::Message& from) final;
  248. void CopyFrom(const TestAllTypes& from);
  249. void MergeFrom(const TestAllTypes& 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(TestAllTypes* other);
  265. private:
  266. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  267. return NULL;
  268. }
  269. inline void* MaybeArenaPtr() const {
  270. return NULL;
  271. }
  272. public:
  273. ::google::protobuf::Metadata GetMetadata() const final;
  274. // nested types ----------------------------------------------------
  275. typedef TestAllTypes_NestedMessage NestedMessage;
  276. typedef TestAllTypes_NestedEnum NestedEnum;
  277. static const NestedEnum FOO =
  278. TestAllTypes_NestedEnum_FOO;
  279. static const NestedEnum BAR =
  280. TestAllTypes_NestedEnum_BAR;
  281. static const NestedEnum BAZ =
  282. TestAllTypes_NestedEnum_BAZ;
  283. static inline bool NestedEnum_IsValid(int value) {
  284. return TestAllTypes_NestedEnum_IsValid(value);
  285. }
  286. static const NestedEnum NestedEnum_MIN =
  287. TestAllTypes_NestedEnum_NestedEnum_MIN;
  288. static const NestedEnum NestedEnum_MAX =
  289. TestAllTypes_NestedEnum_NestedEnum_MAX;
  290. static const int NestedEnum_ARRAYSIZE =
  291. TestAllTypes_NestedEnum_NestedEnum_ARRAYSIZE;
  292. static inline const ::google::protobuf::EnumDescriptor*
  293. NestedEnum_descriptor() {
  294. return TestAllTypes_NestedEnum_descriptor();
  295. }
  296. static inline const ::std::string& NestedEnum_Name(NestedEnum value) {
  297. return TestAllTypes_NestedEnum_Name(value);
  298. }
  299. static inline bool NestedEnum_Parse(const ::std::string& name,
  300. NestedEnum* value) {
  301. return TestAllTypes_NestedEnum_Parse(name, value);
  302. }
  303. // accessors -------------------------------------------------------
  304. // repeated int32 repeated_int32 = 31;
  305. int repeated_int32_size() const;
  306. void clear_repeated_int32();
  307. static const int kRepeatedInt32FieldNumber = 31;
  308. ::google::protobuf::int32 repeated_int32(int index) const;
  309. void set_repeated_int32(int index, ::google::protobuf::int32 value);
  310. void add_repeated_int32(::google::protobuf::int32 value);
  311. const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
  312. repeated_int32() const;
  313. ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  314. mutable_repeated_int32();
  315. // repeated int64 repeated_int64 = 32;
  316. int repeated_int64_size() const;
  317. void clear_repeated_int64();
  318. static const int kRepeatedInt64FieldNumber = 32;
  319. ::google::protobuf::int64 repeated_int64(int index) const;
  320. void set_repeated_int64(int index, ::google::protobuf::int64 value);
  321. void add_repeated_int64(::google::protobuf::int64 value);
  322. const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
  323. repeated_int64() const;
  324. ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
  325. mutable_repeated_int64();
  326. // repeated uint32 repeated_uint32 = 33;
  327. int repeated_uint32_size() const;
  328. void clear_repeated_uint32();
  329. static const int kRepeatedUint32FieldNumber = 33;
  330. ::google::protobuf::uint32 repeated_uint32(int index) const;
  331. void set_repeated_uint32(int index, ::google::protobuf::uint32 value);
  332. void add_repeated_uint32(::google::protobuf::uint32 value);
  333. const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
  334. repeated_uint32() const;
  335. ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
  336. mutable_repeated_uint32();
  337. // repeated uint64 repeated_uint64 = 34;
  338. int repeated_uint64_size() const;
  339. void clear_repeated_uint64();
  340. static const int kRepeatedUint64FieldNumber = 34;
  341. ::google::protobuf::uint64 repeated_uint64(int index) const;
  342. void set_repeated_uint64(int index, ::google::protobuf::uint64 value);
  343. void add_repeated_uint64(::google::protobuf::uint64 value);
  344. const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
  345. repeated_uint64() const;
  346. ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
  347. mutable_repeated_uint64();
  348. // repeated sint32 repeated_sint32 = 35;
  349. int repeated_sint32_size() const;
  350. void clear_repeated_sint32();
  351. static const int kRepeatedSint32FieldNumber = 35;
  352. ::google::protobuf::int32 repeated_sint32(int index) const;
  353. void set_repeated_sint32(int index, ::google::protobuf::int32 value);
  354. void add_repeated_sint32(::google::protobuf::int32 value);
  355. const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
  356. repeated_sint32() const;
  357. ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  358. mutable_repeated_sint32();
  359. // repeated sint64 repeated_sint64 = 36;
  360. int repeated_sint64_size() const;
  361. void clear_repeated_sint64();
  362. static const int kRepeatedSint64FieldNumber = 36;
  363. ::google::protobuf::int64 repeated_sint64(int index) const;
  364. void set_repeated_sint64(int index, ::google::protobuf::int64 value);
  365. void add_repeated_sint64(::google::protobuf::int64 value);
  366. const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
  367. repeated_sint64() const;
  368. ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
  369. mutable_repeated_sint64();
  370. // repeated fixed32 repeated_fixed32 = 37;
  371. int repeated_fixed32_size() const;
  372. void clear_repeated_fixed32();
  373. static const int kRepeatedFixed32FieldNumber = 37;
  374. ::google::protobuf::uint32 repeated_fixed32(int index) const;
  375. void set_repeated_fixed32(int index, ::google::protobuf::uint32 value);
  376. void add_repeated_fixed32(::google::protobuf::uint32 value);
  377. const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
  378. repeated_fixed32() const;
  379. ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
  380. mutable_repeated_fixed32();
  381. // repeated fixed64 repeated_fixed64 = 38;
  382. int repeated_fixed64_size() const;
  383. void clear_repeated_fixed64();
  384. static const int kRepeatedFixed64FieldNumber = 38;
  385. ::google::protobuf::uint64 repeated_fixed64(int index) const;
  386. void set_repeated_fixed64(int index, ::google::protobuf::uint64 value);
  387. void add_repeated_fixed64(::google::protobuf::uint64 value);
  388. const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
  389. repeated_fixed64() const;
  390. ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
  391. mutable_repeated_fixed64();
  392. // repeated sfixed32 repeated_sfixed32 = 39;
  393. int repeated_sfixed32_size() const;
  394. void clear_repeated_sfixed32();
  395. static const int kRepeatedSfixed32FieldNumber = 39;
  396. ::google::protobuf::int32 repeated_sfixed32(int index) const;
  397. void set_repeated_sfixed32(int index, ::google::protobuf::int32 value);
  398. void add_repeated_sfixed32(::google::protobuf::int32 value);
  399. const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
  400. repeated_sfixed32() const;
  401. ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  402. mutable_repeated_sfixed32();
  403. // repeated sfixed64 repeated_sfixed64 = 40;
  404. int repeated_sfixed64_size() const;
  405. void clear_repeated_sfixed64();
  406. static const int kRepeatedSfixed64FieldNumber = 40;
  407. ::google::protobuf::int64 repeated_sfixed64(int index) const;
  408. void set_repeated_sfixed64(int index, ::google::protobuf::int64 value);
  409. void add_repeated_sfixed64(::google::protobuf::int64 value);
  410. const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
  411. repeated_sfixed64() const;
  412. ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
  413. mutable_repeated_sfixed64();
  414. // repeated float repeated_float = 41;
  415. int repeated_float_size() const;
  416. void clear_repeated_float();
  417. static const int kRepeatedFloatFieldNumber = 41;
  418. float repeated_float(int index) const;
  419. void set_repeated_float(int index, float value);
  420. void add_repeated_float(float value);
  421. const ::google::protobuf::RepeatedField< float >&
  422. repeated_float() const;
  423. ::google::protobuf::RepeatedField< float >*
  424. mutable_repeated_float();
  425. // repeated double repeated_double = 42;
  426. int repeated_double_size() const;
  427. void clear_repeated_double();
  428. static const int kRepeatedDoubleFieldNumber = 42;
  429. double repeated_double(int index) const;
  430. void set_repeated_double(int index, double value);
  431. void add_repeated_double(double value);
  432. const ::google::protobuf::RepeatedField< double >&
  433. repeated_double() const;
  434. ::google::protobuf::RepeatedField< double >*
  435. mutable_repeated_double();
  436. // repeated bool repeated_bool = 43;
  437. int repeated_bool_size() const;
  438. void clear_repeated_bool();
  439. static const int kRepeatedBoolFieldNumber = 43;
  440. bool repeated_bool(int index) const;
  441. void set_repeated_bool(int index, bool value);
  442. void add_repeated_bool(bool value);
  443. const ::google::protobuf::RepeatedField< bool >&
  444. repeated_bool() const;
  445. ::google::protobuf::RepeatedField< bool >*
  446. mutable_repeated_bool();
  447. // repeated string repeated_string = 44;
  448. int repeated_string_size() const;
  449. void clear_repeated_string();
  450. static const int kRepeatedStringFieldNumber = 44;
  451. const ::std::string& repeated_string(int index) const;
  452. ::std::string* mutable_repeated_string(int index);
  453. void set_repeated_string(int index, const ::std::string& value);
  454. #if LANG_CXX11
  455. void set_repeated_string(int index, ::std::string&& value);
  456. #endif
  457. void set_repeated_string(int index, const char* value);
  458. void set_repeated_string(int index, const char* value, size_t size);
  459. ::std::string* add_repeated_string();
  460. void add_repeated_string(const ::std::string& value);
  461. #if LANG_CXX11
  462. void add_repeated_string(::std::string&& value);
  463. #endif
  464. void add_repeated_string(const char* value);
  465. void add_repeated_string(const char* value, size_t size);
  466. const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_string() const;
  467. ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_string();
  468. // repeated bytes repeated_bytes = 45;
  469. int repeated_bytes_size() const;
  470. void clear_repeated_bytes();
  471. static const int kRepeatedBytesFieldNumber = 45;
  472. const ::std::string& repeated_bytes(int index) const;
  473. ::std::string* mutable_repeated_bytes(int index);
  474. void set_repeated_bytes(int index, const ::std::string& value);
  475. #if LANG_CXX11
  476. void set_repeated_bytes(int index, ::std::string&& value);
  477. #endif
  478. void set_repeated_bytes(int index, const char* value);
  479. void set_repeated_bytes(int index, const void* value, size_t size);
  480. ::std::string* add_repeated_bytes();
  481. void add_repeated_bytes(const ::std::string& value);
  482. #if LANG_CXX11
  483. void add_repeated_bytes(::std::string&& value);
  484. #endif
  485. void add_repeated_bytes(const char* value);
  486. void add_repeated_bytes(const void* value, size_t size);
  487. const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_bytes() const;
  488. ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_bytes();
  489. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  490. int repeated_nested_message_size() const;
  491. void clear_repeated_nested_message();
  492. static const int kRepeatedNestedMessageFieldNumber = 48;
  493. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* mutable_repeated_nested_message(int index);
  494. ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >*
  495. mutable_repeated_nested_message();
  496. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& repeated_nested_message(int index) const;
  497. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* add_repeated_nested_message();
  498. const ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >&
  499. repeated_nested_message() const;
  500. // repeated .proto2_nofieldpresence_unittest.ForeignMessage repeated_foreign_message = 49;
  501. int repeated_foreign_message_size() const;
  502. void clear_repeated_foreign_message();
  503. static const int kRepeatedForeignMessageFieldNumber = 49;
  504. ::proto2_nofieldpresence_unittest::ForeignMessage* mutable_repeated_foreign_message(int index);
  505. ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::ForeignMessage >*
  506. mutable_repeated_foreign_message();
  507. const ::proto2_nofieldpresence_unittest::ForeignMessage& repeated_foreign_message(int index) const;
  508. ::proto2_nofieldpresence_unittest::ForeignMessage* add_repeated_foreign_message();
  509. const ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::ForeignMessage >&
  510. repeated_foreign_message() const;
  511. // repeated .protobuf_unittest.TestAllTypes repeated_proto2_message = 50;
  512. int repeated_proto2_message_size() const;
  513. void clear_repeated_proto2_message();
  514. static const int kRepeatedProto2MessageFieldNumber = 50;
  515. ::protobuf_unittest::TestAllTypes* mutable_repeated_proto2_message(int index);
  516. ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
  517. mutable_repeated_proto2_message();
  518. const ::protobuf_unittest::TestAllTypes& repeated_proto2_message(int index) const;
  519. ::protobuf_unittest::TestAllTypes* add_repeated_proto2_message();
  520. const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
  521. repeated_proto2_message() const;
  522. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  523. int repeated_nested_enum_size() const;
  524. void clear_repeated_nested_enum();
  525. static const int kRepeatedNestedEnumFieldNumber = 51;
  526. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum repeated_nested_enum(int index) const;
  527. void set_repeated_nested_enum(int index, ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value);
  528. void add_repeated_nested_enum(::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value);
  529. const ::google::protobuf::RepeatedField<int>& repeated_nested_enum() const;
  530. ::google::protobuf::RepeatedField<int>* mutable_repeated_nested_enum();
  531. // repeated .proto2_nofieldpresence_unittest.ForeignEnum repeated_foreign_enum = 52;
  532. int repeated_foreign_enum_size() const;
  533. void clear_repeated_foreign_enum();
  534. static const int kRepeatedForeignEnumFieldNumber = 52;
  535. ::proto2_nofieldpresence_unittest::ForeignEnum repeated_foreign_enum(int index) const;
  536. void set_repeated_foreign_enum(int index, ::proto2_nofieldpresence_unittest::ForeignEnum value);
  537. void add_repeated_foreign_enum(::proto2_nofieldpresence_unittest::ForeignEnum value);
  538. const ::google::protobuf::RepeatedField<int>& repeated_foreign_enum() const;
  539. ::google::protobuf::RepeatedField<int>* mutable_repeated_foreign_enum();
  540. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  541. int repeated_string_piece_size() const;
  542. void clear_repeated_string_piece();
  543. static const int kRepeatedStringPieceFieldNumber = 54;
  544. private:
  545. // Hidden due to unknown ctype option.
  546. const ::std::string& repeated_string_piece(int index) const;
  547. ::std::string* mutable_repeated_string_piece(int index);
  548. void set_repeated_string_piece(int index, const ::std::string& value);
  549. #if LANG_CXX11
  550. void set_repeated_string_piece(int index, ::std::string&& value);
  551. #endif
  552. void set_repeated_string_piece(int index, const char* value);
  553. void set_repeated_string_piece(int index, const char* value, size_t size);
  554. ::std::string* add_repeated_string_piece();
  555. void add_repeated_string_piece(const ::std::string& value);
  556. #if LANG_CXX11
  557. void add_repeated_string_piece(::std::string&& value);
  558. #endif
  559. void add_repeated_string_piece(const char* value);
  560. void add_repeated_string_piece(const char* value, size_t size);
  561. const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_string_piece() const;
  562. ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_string_piece();
  563. public:
  564. // repeated string repeated_cord = 55 [ctype = CORD];
  565. int repeated_cord_size() const;
  566. void clear_repeated_cord();
  567. static const int kRepeatedCordFieldNumber = 55;
  568. private:
  569. // Hidden due to unknown ctype option.
  570. const ::std::string& repeated_cord(int index) const;
  571. ::std::string* mutable_repeated_cord(int index);
  572. void set_repeated_cord(int index, const ::std::string& value);
  573. #if LANG_CXX11
  574. void set_repeated_cord(int index, ::std::string&& value);
  575. #endif
  576. void set_repeated_cord(int index, const char* value);
  577. void set_repeated_cord(int index, const char* value, size_t size);
  578. ::std::string* add_repeated_cord();
  579. void add_repeated_cord(const ::std::string& value);
  580. #if LANG_CXX11
  581. void add_repeated_cord(::std::string&& value);
  582. #endif
  583. void add_repeated_cord(const char* value);
  584. void add_repeated_cord(const char* value, size_t size);
  585. const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_cord() const;
  586. ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_cord();
  587. public:
  588. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  589. int repeated_lazy_message_size() const;
  590. void clear_repeated_lazy_message();
  591. static const int kRepeatedLazyMessageFieldNumber = 57;
  592. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* mutable_repeated_lazy_message(int index);
  593. ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >*
  594. mutable_repeated_lazy_message();
  595. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& repeated_lazy_message(int index) const;
  596. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* add_repeated_lazy_message();
  597. const ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >&
  598. repeated_lazy_message() const;
  599. // string optional_string = 14;
  600. void clear_optional_string();
  601. static const int kOptionalStringFieldNumber = 14;
  602. const ::std::string& optional_string() const;
  603. void set_optional_string(const ::std::string& value);
  604. #if LANG_CXX11
  605. void set_optional_string(::std::string&& value);
  606. #endif
  607. void set_optional_string(const char* value);
  608. void set_optional_string(const char* value, size_t size);
  609. ::std::string* mutable_optional_string();
  610. ::std::string* release_optional_string();
  611. void set_allocated_optional_string(::std::string* optional_string);
  612. // bytes optional_bytes = 15;
  613. void clear_optional_bytes();
  614. static const int kOptionalBytesFieldNumber = 15;
  615. const ::std::string& optional_bytes() const;
  616. void set_optional_bytes(const ::std::string& value);
  617. #if LANG_CXX11
  618. void set_optional_bytes(::std::string&& value);
  619. #endif
  620. void set_optional_bytes(const char* value);
  621. void set_optional_bytes(const void* value, size_t size);
  622. ::std::string* mutable_optional_bytes();
  623. ::std::string* release_optional_bytes();
  624. void set_allocated_optional_bytes(::std::string* optional_bytes);
  625. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  626. void clear_optional_string_piece();
  627. static const int kOptionalStringPieceFieldNumber = 24;
  628. private:
  629. // Hidden due to unknown ctype option.
  630. const ::std::string& optional_string_piece() const;
  631. void set_optional_string_piece(const ::std::string& value);
  632. #if LANG_CXX11
  633. void set_optional_string_piece(::std::string&& value);
  634. #endif
  635. void set_optional_string_piece(const char* value);
  636. void set_optional_string_piece(const char* value, size_t size);
  637. ::std::string* mutable_optional_string_piece();
  638. ::std::string* release_optional_string_piece();
  639. void set_allocated_optional_string_piece(::std::string* optional_string_piece);
  640. public:
  641. // string optional_cord = 25 [ctype = CORD];
  642. void clear_optional_cord();
  643. static const int kOptionalCordFieldNumber = 25;
  644. private:
  645. // Hidden due to unknown ctype option.
  646. const ::std::string& optional_cord() const;
  647. void set_optional_cord(const ::std::string& value);
  648. #if LANG_CXX11
  649. void set_optional_cord(::std::string&& value);
  650. #endif
  651. void set_optional_cord(const char* value);
  652. void set_optional_cord(const char* value, size_t size);
  653. ::std::string* mutable_optional_cord();
  654. ::std::string* release_optional_cord();
  655. void set_allocated_optional_cord(::std::string* optional_cord);
  656. public:
  657. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  658. bool has_optional_nested_message() const;
  659. void clear_optional_nested_message();
  660. static const int kOptionalNestedMessageFieldNumber = 18;
  661. private:
  662. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& _internal_optional_nested_message() const;
  663. public:
  664. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& optional_nested_message() const;
  665. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* release_optional_nested_message();
  666. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* mutable_optional_nested_message();
  667. void set_allocated_optional_nested_message(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* optional_nested_message);
  668. // .proto2_nofieldpresence_unittest.ForeignMessage optional_foreign_message = 19;
  669. bool has_optional_foreign_message() const;
  670. void clear_optional_foreign_message();
  671. static const int kOptionalForeignMessageFieldNumber = 19;
  672. private:
  673. const ::proto2_nofieldpresence_unittest::ForeignMessage& _internal_optional_foreign_message() const;
  674. public:
  675. const ::proto2_nofieldpresence_unittest::ForeignMessage& optional_foreign_message() const;
  676. ::proto2_nofieldpresence_unittest::ForeignMessage* release_optional_foreign_message();
  677. ::proto2_nofieldpresence_unittest::ForeignMessage* mutable_optional_foreign_message();
  678. void set_allocated_optional_foreign_message(::proto2_nofieldpresence_unittest::ForeignMessage* optional_foreign_message);
  679. // .protobuf_unittest.TestAllTypes optional_proto2_message = 20;
  680. bool has_optional_proto2_message() const;
  681. void clear_optional_proto2_message();
  682. static const int kOptionalProto2MessageFieldNumber = 20;
  683. private:
  684. const ::protobuf_unittest::TestAllTypes& _internal_optional_proto2_message() const;
  685. public:
  686. const ::protobuf_unittest::TestAllTypes& optional_proto2_message() const;
  687. ::protobuf_unittest::TestAllTypes* release_optional_proto2_message();
  688. ::protobuf_unittest::TestAllTypes* mutable_optional_proto2_message();
  689. void set_allocated_optional_proto2_message(::protobuf_unittest::TestAllTypes* optional_proto2_message);
  690. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_lazy_message = 30 [lazy = true];
  691. bool has_optional_lazy_message() const;
  692. void clear_optional_lazy_message();
  693. static const int kOptionalLazyMessageFieldNumber = 30;
  694. private:
  695. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& _internal_optional_lazy_message() const;
  696. public:
  697. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& optional_lazy_message() const;
  698. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* release_optional_lazy_message();
  699. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* mutable_optional_lazy_message();
  700. void set_allocated_optional_lazy_message(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* optional_lazy_message);
  701. // int64 optional_int64 = 2;
  702. void clear_optional_int64();
  703. static const int kOptionalInt64FieldNumber = 2;
  704. ::google::protobuf::int64 optional_int64() const;
  705. void set_optional_int64(::google::protobuf::int64 value);
  706. // int32 optional_int32 = 1;
  707. void clear_optional_int32();
  708. static const int kOptionalInt32FieldNumber = 1;
  709. ::google::protobuf::int32 optional_int32() const;
  710. void set_optional_int32(::google::protobuf::int32 value);
  711. // uint32 optional_uint32 = 3;
  712. void clear_optional_uint32();
  713. static const int kOptionalUint32FieldNumber = 3;
  714. ::google::protobuf::uint32 optional_uint32() const;
  715. void set_optional_uint32(::google::protobuf::uint32 value);
  716. // uint64 optional_uint64 = 4;
  717. void clear_optional_uint64();
  718. static const int kOptionalUint64FieldNumber = 4;
  719. ::google::protobuf::uint64 optional_uint64() const;
  720. void set_optional_uint64(::google::protobuf::uint64 value);
  721. // sint64 optional_sint64 = 6;
  722. void clear_optional_sint64();
  723. static const int kOptionalSint64FieldNumber = 6;
  724. ::google::protobuf::int64 optional_sint64() const;
  725. void set_optional_sint64(::google::protobuf::int64 value);
  726. // sint32 optional_sint32 = 5;
  727. void clear_optional_sint32();
  728. static const int kOptionalSint32FieldNumber = 5;
  729. ::google::protobuf::int32 optional_sint32() const;
  730. void set_optional_sint32(::google::protobuf::int32 value);
  731. // fixed32 optional_fixed32 = 7;
  732. void clear_optional_fixed32();
  733. static const int kOptionalFixed32FieldNumber = 7;
  734. ::google::protobuf::uint32 optional_fixed32() const;
  735. void set_optional_fixed32(::google::protobuf::uint32 value);
  736. // fixed64 optional_fixed64 = 8;
  737. void clear_optional_fixed64();
  738. static const int kOptionalFixed64FieldNumber = 8;
  739. ::google::protobuf::uint64 optional_fixed64() const;
  740. void set_optional_fixed64(::google::protobuf::uint64 value);
  741. // sfixed64 optional_sfixed64 = 10;
  742. void clear_optional_sfixed64();
  743. static const int kOptionalSfixed64FieldNumber = 10;
  744. ::google::protobuf::int64 optional_sfixed64() const;
  745. void set_optional_sfixed64(::google::protobuf::int64 value);
  746. // sfixed32 optional_sfixed32 = 9;
  747. void clear_optional_sfixed32();
  748. static const int kOptionalSfixed32FieldNumber = 9;
  749. ::google::protobuf::int32 optional_sfixed32() const;
  750. void set_optional_sfixed32(::google::protobuf::int32 value);
  751. // float optional_float = 11;
  752. void clear_optional_float();
  753. static const int kOptionalFloatFieldNumber = 11;
  754. float optional_float() const;
  755. void set_optional_float(float value);
  756. // double optional_double = 12;
  757. void clear_optional_double();
  758. static const int kOptionalDoubleFieldNumber = 12;
  759. double optional_double() const;
  760. void set_optional_double(double value);
  761. // bool optional_bool = 13;
  762. void clear_optional_bool();
  763. static const int kOptionalBoolFieldNumber = 13;
  764. bool optional_bool() const;
  765. void set_optional_bool(bool value);
  766. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  767. void clear_optional_nested_enum();
  768. static const int kOptionalNestedEnumFieldNumber = 21;
  769. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum optional_nested_enum() const;
  770. void set_optional_nested_enum(::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value);
  771. // .proto2_nofieldpresence_unittest.ForeignEnum optional_foreign_enum = 22;
  772. void clear_optional_foreign_enum();
  773. static const int kOptionalForeignEnumFieldNumber = 22;
  774. ::proto2_nofieldpresence_unittest::ForeignEnum optional_foreign_enum() const;
  775. void set_optional_foreign_enum(::proto2_nofieldpresence_unittest::ForeignEnum value);
  776. // uint32 oneof_uint32 = 111;
  777. private:
  778. bool has_oneof_uint32() const;
  779. public:
  780. void clear_oneof_uint32();
  781. static const int kOneofUint32FieldNumber = 111;
  782. ::google::protobuf::uint32 oneof_uint32() const;
  783. void set_oneof_uint32(::google::protobuf::uint32 value);
  784. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  785. bool has_oneof_nested_message() const;
  786. void clear_oneof_nested_message();
  787. static const int kOneofNestedMessageFieldNumber = 112;
  788. private:
  789. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& _internal_oneof_nested_message() const;
  790. public:
  791. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& oneof_nested_message() const;
  792. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* release_oneof_nested_message();
  793. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* mutable_oneof_nested_message();
  794. void set_allocated_oneof_nested_message(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* oneof_nested_message);
  795. // string oneof_string = 113;
  796. private:
  797. bool has_oneof_string() const;
  798. public:
  799. void clear_oneof_string();
  800. static const int kOneofStringFieldNumber = 113;
  801. const ::std::string& oneof_string() const;
  802. void set_oneof_string(const ::std::string& value);
  803. #if LANG_CXX11
  804. void set_oneof_string(::std::string&& value);
  805. #endif
  806. void set_oneof_string(const char* value);
  807. void set_oneof_string(const char* value, size_t size);
  808. ::std::string* mutable_oneof_string();
  809. ::std::string* release_oneof_string();
  810. void set_allocated_oneof_string(::std::string* oneof_string);
  811. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum oneof_enum = 114;
  812. private:
  813. bool has_oneof_enum() const;
  814. public:
  815. void clear_oneof_enum();
  816. static const int kOneofEnumFieldNumber = 114;
  817. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum oneof_enum() const;
  818. void set_oneof_enum(::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value);
  819. void clear_oneof_field();
  820. OneofFieldCase oneof_field_case() const;
  821. // @@protoc_insertion_point(class_scope:proto2_nofieldpresence_unittest.TestAllTypes)
  822. private:
  823. void set_has_oneof_uint32();
  824. void set_has_oneof_nested_message();
  825. void set_has_oneof_string();
  826. void set_has_oneof_enum();
  827. inline bool has_oneof_field() const;
  828. inline void clear_has_oneof_field();
  829. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  830. ::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_int32_;
  831. mutable int _repeated_int32_cached_byte_size_;
  832. ::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_int64_;
  833. mutable int _repeated_int64_cached_byte_size_;
  834. ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > repeated_uint32_;
  835. mutable int _repeated_uint32_cached_byte_size_;
  836. ::google::protobuf::RepeatedField< ::google::protobuf::uint64 > repeated_uint64_;
  837. mutable int _repeated_uint64_cached_byte_size_;
  838. ::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_sint32_;
  839. mutable int _repeated_sint32_cached_byte_size_;
  840. ::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_sint64_;
  841. mutable int _repeated_sint64_cached_byte_size_;
  842. ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > repeated_fixed32_;
  843. mutable int _repeated_fixed32_cached_byte_size_;
  844. ::google::protobuf::RepeatedField< ::google::protobuf::uint64 > repeated_fixed64_;
  845. mutable int _repeated_fixed64_cached_byte_size_;
  846. ::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_sfixed32_;
  847. mutable int _repeated_sfixed32_cached_byte_size_;
  848. ::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_sfixed64_;
  849. mutable int _repeated_sfixed64_cached_byte_size_;
  850. ::google::protobuf::RepeatedField< float > repeated_float_;
  851. mutable int _repeated_float_cached_byte_size_;
  852. ::google::protobuf::RepeatedField< double > repeated_double_;
  853. mutable int _repeated_double_cached_byte_size_;
  854. ::google::protobuf::RepeatedField< bool > repeated_bool_;
  855. mutable int _repeated_bool_cached_byte_size_;
  856. ::google::protobuf::RepeatedPtrField< ::std::string> repeated_string_;
  857. ::google::protobuf::RepeatedPtrField< ::std::string> repeated_bytes_;
  858. ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage > repeated_nested_message_;
  859. ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::ForeignMessage > repeated_foreign_message_;
  860. ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes > repeated_proto2_message_;
  861. ::google::protobuf::RepeatedField<int> repeated_nested_enum_;
  862. mutable int _repeated_nested_enum_cached_byte_size_;
  863. ::google::protobuf::RepeatedField<int> repeated_foreign_enum_;
  864. mutable int _repeated_foreign_enum_cached_byte_size_;
  865. ::google::protobuf::RepeatedPtrField< ::std::string> repeated_string_piece_;
  866. ::google::protobuf::RepeatedPtrField< ::std::string> repeated_cord_;
  867. ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage > repeated_lazy_message_;
  868. ::google::protobuf::internal::ArenaStringPtr optional_string_;
  869. ::google::protobuf::internal::ArenaStringPtr optional_bytes_;
  870. ::google::protobuf::internal::ArenaStringPtr optional_string_piece_;
  871. ::google::protobuf::internal::ArenaStringPtr optional_cord_;
  872. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* optional_nested_message_;
  873. ::proto2_nofieldpresence_unittest::ForeignMessage* optional_foreign_message_;
  874. ::protobuf_unittest::TestAllTypes* optional_proto2_message_;
  875. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* optional_lazy_message_;
  876. ::google::protobuf::int64 optional_int64_;
  877. ::google::protobuf::int32 optional_int32_;
  878. ::google::protobuf::uint32 optional_uint32_;
  879. ::google::protobuf::uint64 optional_uint64_;
  880. ::google::protobuf::int64 optional_sint64_;
  881. ::google::protobuf::int32 optional_sint32_;
  882. ::google::protobuf::uint32 optional_fixed32_;
  883. ::google::protobuf::uint64 optional_fixed64_;
  884. ::google::protobuf::int64 optional_sfixed64_;
  885. ::google::protobuf::int32 optional_sfixed32_;
  886. float optional_float_;
  887. double optional_double_;
  888. bool optional_bool_;
  889. int optional_nested_enum_;
  890. int optional_foreign_enum_;
  891. union OneofFieldUnion {
  892. OneofFieldUnion() {}
  893. ::google::protobuf::uint32 oneof_uint32_;
  894. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* oneof_nested_message_;
  895. ::google::protobuf::internal::ArenaStringPtr oneof_string_;
  896. int oneof_enum_;
  897. } oneof_field_;
  898. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  899. ::google::protobuf::uint32 _oneof_case_[1];
  900. friend struct ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::TableStruct;
  901. };
  902. // -------------------------------------------------------------------
  903. class TestProto2Required : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto2_nofieldpresence_unittest.TestProto2Required) */ {
  904. public:
  905. TestProto2Required();
  906. virtual ~TestProto2Required();
  907. TestProto2Required(const TestProto2Required& from);
  908. inline TestProto2Required& operator=(const TestProto2Required& from) {
  909. CopyFrom(from);
  910. return *this;
  911. }
  912. #if LANG_CXX11
  913. TestProto2Required(TestProto2Required&& from) noexcept
  914. : TestProto2Required() {
  915. *this = ::std::move(from);
  916. }
  917. inline TestProto2Required& operator=(TestProto2Required&& from) noexcept {
  918. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  919. if (this != &from) InternalSwap(&from);
  920. } else {
  921. CopyFrom(from);
  922. }
  923. return *this;
  924. }
  925. #endif
  926. static const ::google::protobuf::Descriptor* descriptor();
  927. static const TestProto2Required& default_instance();
  928. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  929. static inline const TestProto2Required* internal_default_instance() {
  930. return reinterpret_cast<const TestProto2Required*>(
  931. &_TestProto2Required_default_instance_);
  932. }
  933. static constexpr int kIndexInFileMessages =
  934. 2;
  935. void Swap(TestProto2Required* other);
  936. friend void swap(TestProto2Required& a, TestProto2Required& b) {
  937. a.Swap(&b);
  938. }
  939. // implements Message ----------------------------------------------
  940. inline TestProto2Required* New() const final {
  941. return CreateMaybeMessage<TestProto2Required>(NULL);
  942. }
  943. TestProto2Required* New(::google::protobuf::Arena* arena) const final {
  944. return CreateMaybeMessage<TestProto2Required>(arena);
  945. }
  946. void CopyFrom(const ::google::protobuf::Message& from) final;
  947. void MergeFrom(const ::google::protobuf::Message& from) final;
  948. void CopyFrom(const TestProto2Required& from);
  949. void MergeFrom(const TestProto2Required& from);
  950. void Clear() final;
  951. bool IsInitialized() const final;
  952. size_t ByteSizeLong() const final;
  953. bool MergePartialFromCodedStream(
  954. ::google::protobuf::io::CodedInputStream* input) final;
  955. void SerializeWithCachedSizes(
  956. ::google::protobuf::io::CodedOutputStream* output) const final;
  957. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  958. bool deterministic, ::google::protobuf::uint8* target) const final;
  959. int GetCachedSize() const final { return _cached_size_.Get(); }
  960. private:
  961. void SharedCtor();
  962. void SharedDtor();
  963. void SetCachedSize(int size) const final;
  964. void InternalSwap(TestProto2Required* other);
  965. private:
  966. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  967. return NULL;
  968. }
  969. inline void* MaybeArenaPtr() const {
  970. return NULL;
  971. }
  972. public:
  973. ::google::protobuf::Metadata GetMetadata() const final;
  974. // nested types ----------------------------------------------------
  975. // accessors -------------------------------------------------------
  976. // .protobuf_unittest.TestRequired proto2 = 1;
  977. bool has_proto2() const;
  978. void clear_proto2();
  979. static const int kProto2FieldNumber = 1;
  980. private:
  981. const ::protobuf_unittest::TestRequired& _internal_proto2() const;
  982. public:
  983. const ::protobuf_unittest::TestRequired& proto2() const;
  984. ::protobuf_unittest::TestRequired* release_proto2();
  985. ::protobuf_unittest::TestRequired* mutable_proto2();
  986. void set_allocated_proto2(::protobuf_unittest::TestRequired* proto2);
  987. // @@protoc_insertion_point(class_scope:proto2_nofieldpresence_unittest.TestProto2Required)
  988. private:
  989. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  990. ::protobuf_unittest::TestRequired* proto2_;
  991. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  992. friend struct ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::TableStruct;
  993. };
  994. // -------------------------------------------------------------------
  995. class ForeignMessage : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto2_nofieldpresence_unittest.ForeignMessage) */ {
  996. public:
  997. ForeignMessage();
  998. virtual ~ForeignMessage();
  999. ForeignMessage(const ForeignMessage& from);
  1000. inline ForeignMessage& operator=(const ForeignMessage& from) {
  1001. CopyFrom(from);
  1002. return *this;
  1003. }
  1004. #if LANG_CXX11
  1005. ForeignMessage(ForeignMessage&& from) noexcept
  1006. : ForeignMessage() {
  1007. *this = ::std::move(from);
  1008. }
  1009. inline ForeignMessage& operator=(ForeignMessage&& from) noexcept {
  1010. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  1011. if (this != &from) InternalSwap(&from);
  1012. } else {
  1013. CopyFrom(from);
  1014. }
  1015. return *this;
  1016. }
  1017. #endif
  1018. static const ::google::protobuf::Descriptor* descriptor();
  1019. static const ForeignMessage& default_instance();
  1020. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  1021. static inline const ForeignMessage* internal_default_instance() {
  1022. return reinterpret_cast<const ForeignMessage*>(
  1023. &_ForeignMessage_default_instance_);
  1024. }
  1025. static constexpr int kIndexInFileMessages =
  1026. 3;
  1027. void Swap(ForeignMessage* other);
  1028. friend void swap(ForeignMessage& a, ForeignMessage& b) {
  1029. a.Swap(&b);
  1030. }
  1031. // implements Message ----------------------------------------------
  1032. inline ForeignMessage* New() const final {
  1033. return CreateMaybeMessage<ForeignMessage>(NULL);
  1034. }
  1035. ForeignMessage* New(::google::protobuf::Arena* arena) const final {
  1036. return CreateMaybeMessage<ForeignMessage>(arena);
  1037. }
  1038. void CopyFrom(const ::google::protobuf::Message& from) final;
  1039. void MergeFrom(const ::google::protobuf::Message& from) final;
  1040. void CopyFrom(const ForeignMessage& from);
  1041. void MergeFrom(const ForeignMessage& from);
  1042. void Clear() final;
  1043. bool IsInitialized() const final;
  1044. size_t ByteSizeLong() const final;
  1045. bool MergePartialFromCodedStream(
  1046. ::google::protobuf::io::CodedInputStream* input) final;
  1047. void SerializeWithCachedSizes(
  1048. ::google::protobuf::io::CodedOutputStream* output) const final;
  1049. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  1050. bool deterministic, ::google::protobuf::uint8* target) const final;
  1051. int GetCachedSize() const final { return _cached_size_.Get(); }
  1052. private:
  1053. void SharedCtor();
  1054. void SharedDtor();
  1055. void SetCachedSize(int size) const final;
  1056. void InternalSwap(ForeignMessage* other);
  1057. private:
  1058. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  1059. return NULL;
  1060. }
  1061. inline void* MaybeArenaPtr() const {
  1062. return NULL;
  1063. }
  1064. public:
  1065. ::google::protobuf::Metadata GetMetadata() const final;
  1066. // nested types ----------------------------------------------------
  1067. // accessors -------------------------------------------------------
  1068. // int32 c = 1;
  1069. void clear_c();
  1070. static const int kCFieldNumber = 1;
  1071. ::google::protobuf::int32 c() const;
  1072. void set_c(::google::protobuf::int32 value);
  1073. // @@protoc_insertion_point(class_scope:proto2_nofieldpresence_unittest.ForeignMessage)
  1074. private:
  1075. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  1076. ::google::protobuf::int32 c_;
  1077. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  1078. friend struct ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::TableStruct;
  1079. };
  1080. // ===================================================================
  1081. // ===================================================================
  1082. #ifdef __GNUC__
  1083. #pragma GCC diagnostic push
  1084. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  1085. #endif // __GNUC__
  1086. // TestAllTypes_NestedMessage
  1087. // int32 bb = 1;
  1088. inline void TestAllTypes_NestedMessage::clear_bb() {
  1089. bb_ = 0;
  1090. }
  1091. inline ::google::protobuf::int32 TestAllTypes_NestedMessage::bb() const {
  1092. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage.bb)
  1093. return bb_;
  1094. }
  1095. inline void TestAllTypes_NestedMessage::set_bb(::google::protobuf::int32 value) {
  1096. bb_ = value;
  1097. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage.bb)
  1098. }
  1099. // -------------------------------------------------------------------
  1100. // TestAllTypes
  1101. // int32 optional_int32 = 1;
  1102. inline void TestAllTypes::clear_optional_int32() {
  1103. optional_int32_ = 0;
  1104. }
  1105. inline ::google::protobuf::int32 TestAllTypes::optional_int32() const {
  1106. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_int32)
  1107. return optional_int32_;
  1108. }
  1109. inline void TestAllTypes::set_optional_int32(::google::protobuf::int32 value) {
  1110. optional_int32_ = value;
  1111. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_int32)
  1112. }
  1113. // int64 optional_int64 = 2;
  1114. inline void TestAllTypes::clear_optional_int64() {
  1115. optional_int64_ = GOOGLE_LONGLONG(0);
  1116. }
  1117. inline ::google::protobuf::int64 TestAllTypes::optional_int64() const {
  1118. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_int64)
  1119. return optional_int64_;
  1120. }
  1121. inline void TestAllTypes::set_optional_int64(::google::protobuf::int64 value) {
  1122. optional_int64_ = value;
  1123. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_int64)
  1124. }
  1125. // uint32 optional_uint32 = 3;
  1126. inline void TestAllTypes::clear_optional_uint32() {
  1127. optional_uint32_ = 0u;
  1128. }
  1129. inline ::google::protobuf::uint32 TestAllTypes::optional_uint32() const {
  1130. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_uint32)
  1131. return optional_uint32_;
  1132. }
  1133. inline void TestAllTypes::set_optional_uint32(::google::protobuf::uint32 value) {
  1134. optional_uint32_ = value;
  1135. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_uint32)
  1136. }
  1137. // uint64 optional_uint64 = 4;
  1138. inline void TestAllTypes::clear_optional_uint64() {
  1139. optional_uint64_ = GOOGLE_ULONGLONG(0);
  1140. }
  1141. inline ::google::protobuf::uint64 TestAllTypes::optional_uint64() const {
  1142. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_uint64)
  1143. return optional_uint64_;
  1144. }
  1145. inline void TestAllTypes::set_optional_uint64(::google::protobuf::uint64 value) {
  1146. optional_uint64_ = value;
  1147. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_uint64)
  1148. }
  1149. // sint32 optional_sint32 = 5;
  1150. inline void TestAllTypes::clear_optional_sint32() {
  1151. optional_sint32_ = 0;
  1152. }
  1153. inline ::google::protobuf::int32 TestAllTypes::optional_sint32() const {
  1154. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_sint32)
  1155. return optional_sint32_;
  1156. }
  1157. inline void TestAllTypes::set_optional_sint32(::google::protobuf::int32 value) {
  1158. optional_sint32_ = value;
  1159. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_sint32)
  1160. }
  1161. // sint64 optional_sint64 = 6;
  1162. inline void TestAllTypes::clear_optional_sint64() {
  1163. optional_sint64_ = GOOGLE_LONGLONG(0);
  1164. }
  1165. inline ::google::protobuf::int64 TestAllTypes::optional_sint64() const {
  1166. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_sint64)
  1167. return optional_sint64_;
  1168. }
  1169. inline void TestAllTypes::set_optional_sint64(::google::protobuf::int64 value) {
  1170. optional_sint64_ = value;
  1171. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_sint64)
  1172. }
  1173. // fixed32 optional_fixed32 = 7;
  1174. inline void TestAllTypes::clear_optional_fixed32() {
  1175. optional_fixed32_ = 0u;
  1176. }
  1177. inline ::google::protobuf::uint32 TestAllTypes::optional_fixed32() const {
  1178. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_fixed32)
  1179. return optional_fixed32_;
  1180. }
  1181. inline void TestAllTypes::set_optional_fixed32(::google::protobuf::uint32 value) {
  1182. optional_fixed32_ = value;
  1183. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_fixed32)
  1184. }
  1185. // fixed64 optional_fixed64 = 8;
  1186. inline void TestAllTypes::clear_optional_fixed64() {
  1187. optional_fixed64_ = GOOGLE_ULONGLONG(0);
  1188. }
  1189. inline ::google::protobuf::uint64 TestAllTypes::optional_fixed64() const {
  1190. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_fixed64)
  1191. return optional_fixed64_;
  1192. }
  1193. inline void TestAllTypes::set_optional_fixed64(::google::protobuf::uint64 value) {
  1194. optional_fixed64_ = value;
  1195. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_fixed64)
  1196. }
  1197. // sfixed32 optional_sfixed32 = 9;
  1198. inline void TestAllTypes::clear_optional_sfixed32() {
  1199. optional_sfixed32_ = 0;
  1200. }
  1201. inline ::google::protobuf::int32 TestAllTypes::optional_sfixed32() const {
  1202. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_sfixed32)
  1203. return optional_sfixed32_;
  1204. }
  1205. inline void TestAllTypes::set_optional_sfixed32(::google::protobuf::int32 value) {
  1206. optional_sfixed32_ = value;
  1207. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_sfixed32)
  1208. }
  1209. // sfixed64 optional_sfixed64 = 10;
  1210. inline void TestAllTypes::clear_optional_sfixed64() {
  1211. optional_sfixed64_ = GOOGLE_LONGLONG(0);
  1212. }
  1213. inline ::google::protobuf::int64 TestAllTypes::optional_sfixed64() const {
  1214. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_sfixed64)
  1215. return optional_sfixed64_;
  1216. }
  1217. inline void TestAllTypes::set_optional_sfixed64(::google::protobuf::int64 value) {
  1218. optional_sfixed64_ = value;
  1219. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_sfixed64)
  1220. }
  1221. // float optional_float = 11;
  1222. inline void TestAllTypes::clear_optional_float() {
  1223. optional_float_ = 0;
  1224. }
  1225. inline float TestAllTypes::optional_float() const {
  1226. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_float)
  1227. return optional_float_;
  1228. }
  1229. inline void TestAllTypes::set_optional_float(float value) {
  1230. optional_float_ = value;
  1231. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_float)
  1232. }
  1233. // double optional_double = 12;
  1234. inline void TestAllTypes::clear_optional_double() {
  1235. optional_double_ = 0;
  1236. }
  1237. inline double TestAllTypes::optional_double() const {
  1238. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_double)
  1239. return optional_double_;
  1240. }
  1241. inline void TestAllTypes::set_optional_double(double value) {
  1242. optional_double_ = value;
  1243. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_double)
  1244. }
  1245. // bool optional_bool = 13;
  1246. inline void TestAllTypes::clear_optional_bool() {
  1247. optional_bool_ = false;
  1248. }
  1249. inline bool TestAllTypes::optional_bool() const {
  1250. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_bool)
  1251. return optional_bool_;
  1252. }
  1253. inline void TestAllTypes::set_optional_bool(bool value) {
  1254. optional_bool_ = value;
  1255. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_bool)
  1256. }
  1257. // string optional_string = 14;
  1258. inline void TestAllTypes::clear_optional_string() {
  1259. optional_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1260. }
  1261. inline const ::std::string& TestAllTypes::optional_string() const {
  1262. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1263. return optional_string_.GetNoArena();
  1264. }
  1265. inline void TestAllTypes::set_optional_string(const ::std::string& value) {
  1266. optional_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1267. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1268. }
  1269. #if LANG_CXX11
  1270. inline void TestAllTypes::set_optional_string(::std::string&& value) {
  1271. optional_string_.SetNoArena(
  1272. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1273. // @@protoc_insertion_point(field_set_rvalue:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1274. }
  1275. #endif
  1276. inline void TestAllTypes::set_optional_string(const char* value) {
  1277. GOOGLE_DCHECK(value != NULL);
  1278. optional_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  1279. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1280. }
  1281. inline void TestAllTypes::set_optional_string(const char* value, size_t size) {
  1282. optional_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1283. ::std::string(reinterpret_cast<const char*>(value), size));
  1284. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1285. }
  1286. inline ::std::string* TestAllTypes::mutable_optional_string() {
  1287. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1288. return optional_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1289. }
  1290. inline ::std::string* TestAllTypes::release_optional_string() {
  1291. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1292. return optional_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1293. }
  1294. inline void TestAllTypes::set_allocated_optional_string(::std::string* optional_string) {
  1295. if (optional_string != NULL) {
  1296. } else {
  1297. }
  1298. optional_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_string);
  1299. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_string)
  1300. }
  1301. // bytes optional_bytes = 15;
  1302. inline void TestAllTypes::clear_optional_bytes() {
  1303. optional_bytes_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1304. }
  1305. inline const ::std::string& TestAllTypes::optional_bytes() const {
  1306. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1307. return optional_bytes_.GetNoArena();
  1308. }
  1309. inline void TestAllTypes::set_optional_bytes(const ::std::string& value) {
  1310. optional_bytes_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1311. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1312. }
  1313. #if LANG_CXX11
  1314. inline void TestAllTypes::set_optional_bytes(::std::string&& value) {
  1315. optional_bytes_.SetNoArena(
  1316. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1317. // @@protoc_insertion_point(field_set_rvalue:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1318. }
  1319. #endif
  1320. inline void TestAllTypes::set_optional_bytes(const char* value) {
  1321. GOOGLE_DCHECK(value != NULL);
  1322. optional_bytes_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  1323. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1324. }
  1325. inline void TestAllTypes::set_optional_bytes(const void* value, size_t size) {
  1326. optional_bytes_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1327. ::std::string(reinterpret_cast<const char*>(value), size));
  1328. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1329. }
  1330. inline ::std::string* TestAllTypes::mutable_optional_bytes() {
  1331. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1332. return optional_bytes_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1333. }
  1334. inline ::std::string* TestAllTypes::release_optional_bytes() {
  1335. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1336. return optional_bytes_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1337. }
  1338. inline void TestAllTypes::set_allocated_optional_bytes(::std::string* optional_bytes) {
  1339. if (optional_bytes != NULL) {
  1340. } else {
  1341. }
  1342. optional_bytes_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_bytes);
  1343. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_bytes)
  1344. }
  1345. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  1346. inline bool TestAllTypes::has_optional_nested_message() const {
  1347. return this != internal_default_instance() && optional_nested_message_ != NULL;
  1348. }
  1349. inline void TestAllTypes::clear_optional_nested_message() {
  1350. if (GetArenaNoVirtual() == NULL && optional_nested_message_ != NULL) {
  1351. delete optional_nested_message_;
  1352. }
  1353. optional_nested_message_ = NULL;
  1354. }
  1355. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::_internal_optional_nested_message() const {
  1356. return *optional_nested_message_;
  1357. }
  1358. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::optional_nested_message() const {
  1359. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* p = optional_nested_message_;
  1360. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_nested_message)
  1361. return p != NULL ? *p : *reinterpret_cast<const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage*>(
  1362. &::proto2_nofieldpresence_unittest::_TestAllTypes_NestedMessage_default_instance_);
  1363. }
  1364. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::release_optional_nested_message() {
  1365. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_nested_message)
  1366. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* temp = optional_nested_message_;
  1367. optional_nested_message_ = NULL;
  1368. return temp;
  1369. }
  1370. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_optional_nested_message() {
  1371. if (optional_nested_message_ == NULL) {
  1372. auto* p = CreateMaybeMessage<::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage>(GetArenaNoVirtual());
  1373. optional_nested_message_ = p;
  1374. }
  1375. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_nested_message)
  1376. return optional_nested_message_;
  1377. }
  1378. inline void TestAllTypes::set_allocated_optional_nested_message(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* optional_nested_message) {
  1379. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  1380. if (message_arena == NULL) {
  1381. delete optional_nested_message_;
  1382. }
  1383. if (optional_nested_message) {
  1384. ::google::protobuf::Arena* submessage_arena = NULL;
  1385. if (message_arena != submessage_arena) {
  1386. optional_nested_message = ::google::protobuf::internal::GetOwnedMessage(
  1387. message_arena, optional_nested_message, submessage_arena);
  1388. }
  1389. } else {
  1390. }
  1391. optional_nested_message_ = optional_nested_message;
  1392. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_nested_message)
  1393. }
  1394. // .proto2_nofieldpresence_unittest.ForeignMessage optional_foreign_message = 19;
  1395. inline bool TestAllTypes::has_optional_foreign_message() const {
  1396. return this != internal_default_instance() && optional_foreign_message_ != NULL;
  1397. }
  1398. inline void TestAllTypes::clear_optional_foreign_message() {
  1399. if (GetArenaNoVirtual() == NULL && optional_foreign_message_ != NULL) {
  1400. delete optional_foreign_message_;
  1401. }
  1402. optional_foreign_message_ = NULL;
  1403. }
  1404. inline const ::proto2_nofieldpresence_unittest::ForeignMessage& TestAllTypes::_internal_optional_foreign_message() const {
  1405. return *optional_foreign_message_;
  1406. }
  1407. inline const ::proto2_nofieldpresence_unittest::ForeignMessage& TestAllTypes::optional_foreign_message() const {
  1408. const ::proto2_nofieldpresence_unittest::ForeignMessage* p = optional_foreign_message_;
  1409. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_foreign_message)
  1410. return p != NULL ? *p : *reinterpret_cast<const ::proto2_nofieldpresence_unittest::ForeignMessage*>(
  1411. &::proto2_nofieldpresence_unittest::_ForeignMessage_default_instance_);
  1412. }
  1413. inline ::proto2_nofieldpresence_unittest::ForeignMessage* TestAllTypes::release_optional_foreign_message() {
  1414. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_foreign_message)
  1415. ::proto2_nofieldpresence_unittest::ForeignMessage* temp = optional_foreign_message_;
  1416. optional_foreign_message_ = NULL;
  1417. return temp;
  1418. }
  1419. inline ::proto2_nofieldpresence_unittest::ForeignMessage* TestAllTypes::mutable_optional_foreign_message() {
  1420. if (optional_foreign_message_ == NULL) {
  1421. auto* p = CreateMaybeMessage<::proto2_nofieldpresence_unittest::ForeignMessage>(GetArenaNoVirtual());
  1422. optional_foreign_message_ = p;
  1423. }
  1424. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_foreign_message)
  1425. return optional_foreign_message_;
  1426. }
  1427. inline void TestAllTypes::set_allocated_optional_foreign_message(::proto2_nofieldpresence_unittest::ForeignMessage* optional_foreign_message) {
  1428. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  1429. if (message_arena == NULL) {
  1430. delete optional_foreign_message_;
  1431. }
  1432. if (optional_foreign_message) {
  1433. ::google::protobuf::Arena* submessage_arena = NULL;
  1434. if (message_arena != submessage_arena) {
  1435. optional_foreign_message = ::google::protobuf::internal::GetOwnedMessage(
  1436. message_arena, optional_foreign_message, submessage_arena);
  1437. }
  1438. } else {
  1439. }
  1440. optional_foreign_message_ = optional_foreign_message;
  1441. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_foreign_message)
  1442. }
  1443. // .protobuf_unittest.TestAllTypes optional_proto2_message = 20;
  1444. inline bool TestAllTypes::has_optional_proto2_message() const {
  1445. return this != internal_default_instance() && optional_proto2_message_ != NULL;
  1446. }
  1447. inline const ::protobuf_unittest::TestAllTypes& TestAllTypes::_internal_optional_proto2_message() const {
  1448. return *optional_proto2_message_;
  1449. }
  1450. inline const ::protobuf_unittest::TestAllTypes& TestAllTypes::optional_proto2_message() const {
  1451. const ::protobuf_unittest::TestAllTypes* p = optional_proto2_message_;
  1452. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_proto2_message)
  1453. return p != NULL ? *p : *reinterpret_cast<const ::protobuf_unittest::TestAllTypes*>(
  1454. &::protobuf_unittest::_TestAllTypes_default_instance_);
  1455. }
  1456. inline ::protobuf_unittest::TestAllTypes* TestAllTypes::release_optional_proto2_message() {
  1457. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_proto2_message)
  1458. ::protobuf_unittest::TestAllTypes* temp = optional_proto2_message_;
  1459. optional_proto2_message_ = NULL;
  1460. return temp;
  1461. }
  1462. inline ::protobuf_unittest::TestAllTypes* TestAllTypes::mutable_optional_proto2_message() {
  1463. if (optional_proto2_message_ == NULL) {
  1464. auto* p = CreateMaybeMessage<::protobuf_unittest::TestAllTypes>(GetArenaNoVirtual());
  1465. optional_proto2_message_ = p;
  1466. }
  1467. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_proto2_message)
  1468. return optional_proto2_message_;
  1469. }
  1470. inline void TestAllTypes::set_allocated_optional_proto2_message(::protobuf_unittest::TestAllTypes* optional_proto2_message) {
  1471. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  1472. if (message_arena == NULL) {
  1473. delete reinterpret_cast< ::google::protobuf::MessageLite*>(optional_proto2_message_);
  1474. }
  1475. if (optional_proto2_message) {
  1476. ::google::protobuf::Arena* submessage_arena =
  1477. reinterpret_cast<::google::protobuf::MessageLite*>(optional_proto2_message)->GetArena();
  1478. if (message_arena != submessage_arena) {
  1479. optional_proto2_message = ::google::protobuf::internal::GetOwnedMessage(
  1480. message_arena, optional_proto2_message, submessage_arena);
  1481. }
  1482. } else {
  1483. }
  1484. optional_proto2_message_ = optional_proto2_message;
  1485. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_proto2_message)
  1486. }
  1487. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  1488. inline void TestAllTypes::clear_optional_nested_enum() {
  1489. optional_nested_enum_ = 0;
  1490. }
  1491. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum TestAllTypes::optional_nested_enum() const {
  1492. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_nested_enum)
  1493. return static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(optional_nested_enum_);
  1494. }
  1495. inline void TestAllTypes::set_optional_nested_enum(::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value) {
  1496. optional_nested_enum_ = value;
  1497. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_nested_enum)
  1498. }
  1499. // .proto2_nofieldpresence_unittest.ForeignEnum optional_foreign_enum = 22;
  1500. inline void TestAllTypes::clear_optional_foreign_enum() {
  1501. optional_foreign_enum_ = 0;
  1502. }
  1503. inline ::proto2_nofieldpresence_unittest::ForeignEnum TestAllTypes::optional_foreign_enum() const {
  1504. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_foreign_enum)
  1505. return static_cast< ::proto2_nofieldpresence_unittest::ForeignEnum >(optional_foreign_enum_);
  1506. }
  1507. inline void TestAllTypes::set_optional_foreign_enum(::proto2_nofieldpresence_unittest::ForeignEnum value) {
  1508. optional_foreign_enum_ = value;
  1509. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_foreign_enum)
  1510. }
  1511. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  1512. inline void TestAllTypes::clear_optional_string_piece() {
  1513. optional_string_piece_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1514. }
  1515. inline const ::std::string& TestAllTypes::optional_string_piece() const {
  1516. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1517. return optional_string_piece_.GetNoArena();
  1518. }
  1519. inline void TestAllTypes::set_optional_string_piece(const ::std::string& value) {
  1520. optional_string_piece_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1521. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1522. }
  1523. #if LANG_CXX11
  1524. inline void TestAllTypes::set_optional_string_piece(::std::string&& value) {
  1525. optional_string_piece_.SetNoArena(
  1526. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1527. // @@protoc_insertion_point(field_set_rvalue:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1528. }
  1529. #endif
  1530. inline void TestAllTypes::set_optional_string_piece(const char* value) {
  1531. GOOGLE_DCHECK(value != NULL);
  1532. optional_string_piece_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  1533. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1534. }
  1535. inline void TestAllTypes::set_optional_string_piece(const char* value, size_t size) {
  1536. optional_string_piece_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1537. ::std::string(reinterpret_cast<const char*>(value), size));
  1538. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1539. }
  1540. inline ::std::string* TestAllTypes::mutable_optional_string_piece() {
  1541. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1542. return optional_string_piece_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1543. }
  1544. inline ::std::string* TestAllTypes::release_optional_string_piece() {
  1545. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1546. return optional_string_piece_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1547. }
  1548. inline void TestAllTypes::set_allocated_optional_string_piece(::std::string* optional_string_piece) {
  1549. if (optional_string_piece != NULL) {
  1550. } else {
  1551. }
  1552. optional_string_piece_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_string_piece);
  1553. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece)
  1554. }
  1555. // string optional_cord = 25 [ctype = CORD];
  1556. inline void TestAllTypes::clear_optional_cord() {
  1557. optional_cord_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1558. }
  1559. inline const ::std::string& TestAllTypes::optional_cord() const {
  1560. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1561. return optional_cord_.GetNoArena();
  1562. }
  1563. inline void TestAllTypes::set_optional_cord(const ::std::string& value) {
  1564. optional_cord_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  1565. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1566. }
  1567. #if LANG_CXX11
  1568. inline void TestAllTypes::set_optional_cord(::std::string&& value) {
  1569. optional_cord_.SetNoArena(
  1570. &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  1571. // @@protoc_insertion_point(field_set_rvalue:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1572. }
  1573. #endif
  1574. inline void TestAllTypes::set_optional_cord(const char* value) {
  1575. GOOGLE_DCHECK(value != NULL);
  1576. optional_cord_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  1577. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1578. }
  1579. inline void TestAllTypes::set_optional_cord(const char* value, size_t size) {
  1580. optional_cord_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1581. ::std::string(reinterpret_cast<const char*>(value), size));
  1582. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1583. }
  1584. inline ::std::string* TestAllTypes::mutable_optional_cord() {
  1585. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1586. return optional_cord_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1587. }
  1588. inline ::std::string* TestAllTypes::release_optional_cord() {
  1589. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1590. return optional_cord_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1591. }
  1592. inline void TestAllTypes::set_allocated_optional_cord(::std::string* optional_cord) {
  1593. if (optional_cord != NULL) {
  1594. } else {
  1595. }
  1596. optional_cord_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_cord);
  1597. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_cord)
  1598. }
  1599. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_lazy_message = 30 [lazy = true];
  1600. inline bool TestAllTypes::has_optional_lazy_message() const {
  1601. return this != internal_default_instance() && optional_lazy_message_ != NULL;
  1602. }
  1603. inline void TestAllTypes::clear_optional_lazy_message() {
  1604. if (GetArenaNoVirtual() == NULL && optional_lazy_message_ != NULL) {
  1605. delete optional_lazy_message_;
  1606. }
  1607. optional_lazy_message_ = NULL;
  1608. }
  1609. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::_internal_optional_lazy_message() const {
  1610. return *optional_lazy_message_;
  1611. }
  1612. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::optional_lazy_message() const {
  1613. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* p = optional_lazy_message_;
  1614. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.optional_lazy_message)
  1615. return p != NULL ? *p : *reinterpret_cast<const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage*>(
  1616. &::proto2_nofieldpresence_unittest::_TestAllTypes_NestedMessage_default_instance_);
  1617. }
  1618. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::release_optional_lazy_message() {
  1619. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.optional_lazy_message)
  1620. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* temp = optional_lazy_message_;
  1621. optional_lazy_message_ = NULL;
  1622. return temp;
  1623. }
  1624. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_optional_lazy_message() {
  1625. if (optional_lazy_message_ == NULL) {
  1626. auto* p = CreateMaybeMessage<::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage>(GetArenaNoVirtual());
  1627. optional_lazy_message_ = p;
  1628. }
  1629. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.optional_lazy_message)
  1630. return optional_lazy_message_;
  1631. }
  1632. inline void TestAllTypes::set_allocated_optional_lazy_message(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* optional_lazy_message) {
  1633. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  1634. if (message_arena == NULL) {
  1635. delete optional_lazy_message_;
  1636. }
  1637. if (optional_lazy_message) {
  1638. ::google::protobuf::Arena* submessage_arena = NULL;
  1639. if (message_arena != submessage_arena) {
  1640. optional_lazy_message = ::google::protobuf::internal::GetOwnedMessage(
  1641. message_arena, optional_lazy_message, submessage_arena);
  1642. }
  1643. } else {
  1644. }
  1645. optional_lazy_message_ = optional_lazy_message;
  1646. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.optional_lazy_message)
  1647. }
  1648. // repeated int32 repeated_int32 = 31;
  1649. inline int TestAllTypes::repeated_int32_size() const {
  1650. return repeated_int32_.size();
  1651. }
  1652. inline void TestAllTypes::clear_repeated_int32() {
  1653. repeated_int32_.Clear();
  1654. }
  1655. inline ::google::protobuf::int32 TestAllTypes::repeated_int32(int index) const {
  1656. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int32)
  1657. return repeated_int32_.Get(index);
  1658. }
  1659. inline void TestAllTypes::set_repeated_int32(int index, ::google::protobuf::int32 value) {
  1660. repeated_int32_.Set(index, value);
  1661. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int32)
  1662. }
  1663. inline void TestAllTypes::add_repeated_int32(::google::protobuf::int32 value) {
  1664. repeated_int32_.Add(value);
  1665. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int32)
  1666. }
  1667. inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
  1668. TestAllTypes::repeated_int32() const {
  1669. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int32)
  1670. return repeated_int32_;
  1671. }
  1672. inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  1673. TestAllTypes::mutable_repeated_int32() {
  1674. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int32)
  1675. return &repeated_int32_;
  1676. }
  1677. // repeated int64 repeated_int64 = 32;
  1678. inline int TestAllTypes::repeated_int64_size() const {
  1679. return repeated_int64_.size();
  1680. }
  1681. inline void TestAllTypes::clear_repeated_int64() {
  1682. repeated_int64_.Clear();
  1683. }
  1684. inline ::google::protobuf::int64 TestAllTypes::repeated_int64(int index) const {
  1685. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int64)
  1686. return repeated_int64_.Get(index);
  1687. }
  1688. inline void TestAllTypes::set_repeated_int64(int index, ::google::protobuf::int64 value) {
  1689. repeated_int64_.Set(index, value);
  1690. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int64)
  1691. }
  1692. inline void TestAllTypes::add_repeated_int64(::google::protobuf::int64 value) {
  1693. repeated_int64_.Add(value);
  1694. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int64)
  1695. }
  1696. inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
  1697. TestAllTypes::repeated_int64() const {
  1698. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int64)
  1699. return repeated_int64_;
  1700. }
  1701. inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
  1702. TestAllTypes::mutable_repeated_int64() {
  1703. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_int64)
  1704. return &repeated_int64_;
  1705. }
  1706. // repeated uint32 repeated_uint32 = 33;
  1707. inline int TestAllTypes::repeated_uint32_size() const {
  1708. return repeated_uint32_.size();
  1709. }
  1710. inline void TestAllTypes::clear_repeated_uint32() {
  1711. repeated_uint32_.Clear();
  1712. }
  1713. inline ::google::protobuf::uint32 TestAllTypes::repeated_uint32(int index) const {
  1714. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint32)
  1715. return repeated_uint32_.Get(index);
  1716. }
  1717. inline void TestAllTypes::set_repeated_uint32(int index, ::google::protobuf::uint32 value) {
  1718. repeated_uint32_.Set(index, value);
  1719. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint32)
  1720. }
  1721. inline void TestAllTypes::add_repeated_uint32(::google::protobuf::uint32 value) {
  1722. repeated_uint32_.Add(value);
  1723. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint32)
  1724. }
  1725. inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
  1726. TestAllTypes::repeated_uint32() const {
  1727. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint32)
  1728. return repeated_uint32_;
  1729. }
  1730. inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
  1731. TestAllTypes::mutable_repeated_uint32() {
  1732. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint32)
  1733. return &repeated_uint32_;
  1734. }
  1735. // repeated uint64 repeated_uint64 = 34;
  1736. inline int TestAllTypes::repeated_uint64_size() const {
  1737. return repeated_uint64_.size();
  1738. }
  1739. inline void TestAllTypes::clear_repeated_uint64() {
  1740. repeated_uint64_.Clear();
  1741. }
  1742. inline ::google::protobuf::uint64 TestAllTypes::repeated_uint64(int index) const {
  1743. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint64)
  1744. return repeated_uint64_.Get(index);
  1745. }
  1746. inline void TestAllTypes::set_repeated_uint64(int index, ::google::protobuf::uint64 value) {
  1747. repeated_uint64_.Set(index, value);
  1748. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint64)
  1749. }
  1750. inline void TestAllTypes::add_repeated_uint64(::google::protobuf::uint64 value) {
  1751. repeated_uint64_.Add(value);
  1752. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint64)
  1753. }
  1754. inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
  1755. TestAllTypes::repeated_uint64() const {
  1756. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint64)
  1757. return repeated_uint64_;
  1758. }
  1759. inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
  1760. TestAllTypes::mutable_repeated_uint64() {
  1761. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_uint64)
  1762. return &repeated_uint64_;
  1763. }
  1764. // repeated sint32 repeated_sint32 = 35;
  1765. inline int TestAllTypes::repeated_sint32_size() const {
  1766. return repeated_sint32_.size();
  1767. }
  1768. inline void TestAllTypes::clear_repeated_sint32() {
  1769. repeated_sint32_.Clear();
  1770. }
  1771. inline ::google::protobuf::int32 TestAllTypes::repeated_sint32(int index) const {
  1772. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint32)
  1773. return repeated_sint32_.Get(index);
  1774. }
  1775. inline void TestAllTypes::set_repeated_sint32(int index, ::google::protobuf::int32 value) {
  1776. repeated_sint32_.Set(index, value);
  1777. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint32)
  1778. }
  1779. inline void TestAllTypes::add_repeated_sint32(::google::protobuf::int32 value) {
  1780. repeated_sint32_.Add(value);
  1781. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint32)
  1782. }
  1783. inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
  1784. TestAllTypes::repeated_sint32() const {
  1785. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint32)
  1786. return repeated_sint32_;
  1787. }
  1788. inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  1789. TestAllTypes::mutable_repeated_sint32() {
  1790. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint32)
  1791. return &repeated_sint32_;
  1792. }
  1793. // repeated sint64 repeated_sint64 = 36;
  1794. inline int TestAllTypes::repeated_sint64_size() const {
  1795. return repeated_sint64_.size();
  1796. }
  1797. inline void TestAllTypes::clear_repeated_sint64() {
  1798. repeated_sint64_.Clear();
  1799. }
  1800. inline ::google::protobuf::int64 TestAllTypes::repeated_sint64(int index) const {
  1801. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint64)
  1802. return repeated_sint64_.Get(index);
  1803. }
  1804. inline void TestAllTypes::set_repeated_sint64(int index, ::google::protobuf::int64 value) {
  1805. repeated_sint64_.Set(index, value);
  1806. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint64)
  1807. }
  1808. inline void TestAllTypes::add_repeated_sint64(::google::protobuf::int64 value) {
  1809. repeated_sint64_.Add(value);
  1810. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint64)
  1811. }
  1812. inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
  1813. TestAllTypes::repeated_sint64() const {
  1814. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint64)
  1815. return repeated_sint64_;
  1816. }
  1817. inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
  1818. TestAllTypes::mutable_repeated_sint64() {
  1819. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sint64)
  1820. return &repeated_sint64_;
  1821. }
  1822. // repeated fixed32 repeated_fixed32 = 37;
  1823. inline int TestAllTypes::repeated_fixed32_size() const {
  1824. return repeated_fixed32_.size();
  1825. }
  1826. inline void TestAllTypes::clear_repeated_fixed32() {
  1827. repeated_fixed32_.Clear();
  1828. }
  1829. inline ::google::protobuf::uint32 TestAllTypes::repeated_fixed32(int index) const {
  1830. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed32)
  1831. return repeated_fixed32_.Get(index);
  1832. }
  1833. inline void TestAllTypes::set_repeated_fixed32(int index, ::google::protobuf::uint32 value) {
  1834. repeated_fixed32_.Set(index, value);
  1835. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed32)
  1836. }
  1837. inline void TestAllTypes::add_repeated_fixed32(::google::protobuf::uint32 value) {
  1838. repeated_fixed32_.Add(value);
  1839. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed32)
  1840. }
  1841. inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
  1842. TestAllTypes::repeated_fixed32() const {
  1843. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed32)
  1844. return repeated_fixed32_;
  1845. }
  1846. inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
  1847. TestAllTypes::mutable_repeated_fixed32() {
  1848. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed32)
  1849. return &repeated_fixed32_;
  1850. }
  1851. // repeated fixed64 repeated_fixed64 = 38;
  1852. inline int TestAllTypes::repeated_fixed64_size() const {
  1853. return repeated_fixed64_.size();
  1854. }
  1855. inline void TestAllTypes::clear_repeated_fixed64() {
  1856. repeated_fixed64_.Clear();
  1857. }
  1858. inline ::google::protobuf::uint64 TestAllTypes::repeated_fixed64(int index) const {
  1859. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed64)
  1860. return repeated_fixed64_.Get(index);
  1861. }
  1862. inline void TestAllTypes::set_repeated_fixed64(int index, ::google::protobuf::uint64 value) {
  1863. repeated_fixed64_.Set(index, value);
  1864. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed64)
  1865. }
  1866. inline void TestAllTypes::add_repeated_fixed64(::google::protobuf::uint64 value) {
  1867. repeated_fixed64_.Add(value);
  1868. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed64)
  1869. }
  1870. inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
  1871. TestAllTypes::repeated_fixed64() const {
  1872. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed64)
  1873. return repeated_fixed64_;
  1874. }
  1875. inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
  1876. TestAllTypes::mutable_repeated_fixed64() {
  1877. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_fixed64)
  1878. return &repeated_fixed64_;
  1879. }
  1880. // repeated sfixed32 repeated_sfixed32 = 39;
  1881. inline int TestAllTypes::repeated_sfixed32_size() const {
  1882. return repeated_sfixed32_.size();
  1883. }
  1884. inline void TestAllTypes::clear_repeated_sfixed32() {
  1885. repeated_sfixed32_.Clear();
  1886. }
  1887. inline ::google::protobuf::int32 TestAllTypes::repeated_sfixed32(int index) const {
  1888. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed32)
  1889. return repeated_sfixed32_.Get(index);
  1890. }
  1891. inline void TestAllTypes::set_repeated_sfixed32(int index, ::google::protobuf::int32 value) {
  1892. repeated_sfixed32_.Set(index, value);
  1893. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed32)
  1894. }
  1895. inline void TestAllTypes::add_repeated_sfixed32(::google::protobuf::int32 value) {
  1896. repeated_sfixed32_.Add(value);
  1897. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed32)
  1898. }
  1899. inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
  1900. TestAllTypes::repeated_sfixed32() const {
  1901. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed32)
  1902. return repeated_sfixed32_;
  1903. }
  1904. inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  1905. TestAllTypes::mutable_repeated_sfixed32() {
  1906. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed32)
  1907. return &repeated_sfixed32_;
  1908. }
  1909. // repeated sfixed64 repeated_sfixed64 = 40;
  1910. inline int TestAllTypes::repeated_sfixed64_size() const {
  1911. return repeated_sfixed64_.size();
  1912. }
  1913. inline void TestAllTypes::clear_repeated_sfixed64() {
  1914. repeated_sfixed64_.Clear();
  1915. }
  1916. inline ::google::protobuf::int64 TestAllTypes::repeated_sfixed64(int index) const {
  1917. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed64)
  1918. return repeated_sfixed64_.Get(index);
  1919. }
  1920. inline void TestAllTypes::set_repeated_sfixed64(int index, ::google::protobuf::int64 value) {
  1921. repeated_sfixed64_.Set(index, value);
  1922. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed64)
  1923. }
  1924. inline void TestAllTypes::add_repeated_sfixed64(::google::protobuf::int64 value) {
  1925. repeated_sfixed64_.Add(value);
  1926. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed64)
  1927. }
  1928. inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
  1929. TestAllTypes::repeated_sfixed64() const {
  1930. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed64)
  1931. return repeated_sfixed64_;
  1932. }
  1933. inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
  1934. TestAllTypes::mutable_repeated_sfixed64() {
  1935. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_sfixed64)
  1936. return &repeated_sfixed64_;
  1937. }
  1938. // repeated float repeated_float = 41;
  1939. inline int TestAllTypes::repeated_float_size() const {
  1940. return repeated_float_.size();
  1941. }
  1942. inline void TestAllTypes::clear_repeated_float() {
  1943. repeated_float_.Clear();
  1944. }
  1945. inline float TestAllTypes::repeated_float(int index) const {
  1946. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_float)
  1947. return repeated_float_.Get(index);
  1948. }
  1949. inline void TestAllTypes::set_repeated_float(int index, float value) {
  1950. repeated_float_.Set(index, value);
  1951. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_float)
  1952. }
  1953. inline void TestAllTypes::add_repeated_float(float value) {
  1954. repeated_float_.Add(value);
  1955. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_float)
  1956. }
  1957. inline const ::google::protobuf::RepeatedField< float >&
  1958. TestAllTypes::repeated_float() const {
  1959. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_float)
  1960. return repeated_float_;
  1961. }
  1962. inline ::google::protobuf::RepeatedField< float >*
  1963. TestAllTypes::mutable_repeated_float() {
  1964. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_float)
  1965. return &repeated_float_;
  1966. }
  1967. // repeated double repeated_double = 42;
  1968. inline int TestAllTypes::repeated_double_size() const {
  1969. return repeated_double_.size();
  1970. }
  1971. inline void TestAllTypes::clear_repeated_double() {
  1972. repeated_double_.Clear();
  1973. }
  1974. inline double TestAllTypes::repeated_double(int index) const {
  1975. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_double)
  1976. return repeated_double_.Get(index);
  1977. }
  1978. inline void TestAllTypes::set_repeated_double(int index, double value) {
  1979. repeated_double_.Set(index, value);
  1980. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_double)
  1981. }
  1982. inline void TestAllTypes::add_repeated_double(double value) {
  1983. repeated_double_.Add(value);
  1984. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_double)
  1985. }
  1986. inline const ::google::protobuf::RepeatedField< double >&
  1987. TestAllTypes::repeated_double() const {
  1988. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_double)
  1989. return repeated_double_;
  1990. }
  1991. inline ::google::protobuf::RepeatedField< double >*
  1992. TestAllTypes::mutable_repeated_double() {
  1993. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_double)
  1994. return &repeated_double_;
  1995. }
  1996. // repeated bool repeated_bool = 43;
  1997. inline int TestAllTypes::repeated_bool_size() const {
  1998. return repeated_bool_.size();
  1999. }
  2000. inline void TestAllTypes::clear_repeated_bool() {
  2001. repeated_bool_.Clear();
  2002. }
  2003. inline bool TestAllTypes::repeated_bool(int index) const {
  2004. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bool)
  2005. return repeated_bool_.Get(index);
  2006. }
  2007. inline void TestAllTypes::set_repeated_bool(int index, bool value) {
  2008. repeated_bool_.Set(index, value);
  2009. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bool)
  2010. }
  2011. inline void TestAllTypes::add_repeated_bool(bool value) {
  2012. repeated_bool_.Add(value);
  2013. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bool)
  2014. }
  2015. inline const ::google::protobuf::RepeatedField< bool >&
  2016. TestAllTypes::repeated_bool() const {
  2017. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bool)
  2018. return repeated_bool_;
  2019. }
  2020. inline ::google::protobuf::RepeatedField< bool >*
  2021. TestAllTypes::mutable_repeated_bool() {
  2022. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bool)
  2023. return &repeated_bool_;
  2024. }
  2025. // repeated string repeated_string = 44;
  2026. inline int TestAllTypes::repeated_string_size() const {
  2027. return repeated_string_.size();
  2028. }
  2029. inline void TestAllTypes::clear_repeated_string() {
  2030. repeated_string_.Clear();
  2031. }
  2032. inline const ::std::string& TestAllTypes::repeated_string(int index) const {
  2033. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2034. return repeated_string_.Get(index);
  2035. }
  2036. inline ::std::string* TestAllTypes::mutable_repeated_string(int index) {
  2037. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2038. return repeated_string_.Mutable(index);
  2039. }
  2040. inline void TestAllTypes::set_repeated_string(int index, const ::std::string& value) {
  2041. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2042. repeated_string_.Mutable(index)->assign(value);
  2043. }
  2044. #if LANG_CXX11
  2045. inline void TestAllTypes::set_repeated_string(int index, ::std::string&& value) {
  2046. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2047. repeated_string_.Mutable(index)->assign(std::move(value));
  2048. }
  2049. #endif
  2050. inline void TestAllTypes::set_repeated_string(int index, const char* value) {
  2051. GOOGLE_DCHECK(value != NULL);
  2052. repeated_string_.Mutable(index)->assign(value);
  2053. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2054. }
  2055. inline void TestAllTypes::set_repeated_string(int index, const char* value, size_t size) {
  2056. repeated_string_.Mutable(index)->assign(
  2057. reinterpret_cast<const char*>(value), size);
  2058. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2059. }
  2060. inline ::std::string* TestAllTypes::add_repeated_string() {
  2061. // @@protoc_insertion_point(field_add_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2062. return repeated_string_.Add();
  2063. }
  2064. inline void TestAllTypes::add_repeated_string(const ::std::string& value) {
  2065. repeated_string_.Add()->assign(value);
  2066. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2067. }
  2068. #if LANG_CXX11
  2069. inline void TestAllTypes::add_repeated_string(::std::string&& value) {
  2070. repeated_string_.Add(std::move(value));
  2071. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2072. }
  2073. #endif
  2074. inline void TestAllTypes::add_repeated_string(const char* value) {
  2075. GOOGLE_DCHECK(value != NULL);
  2076. repeated_string_.Add()->assign(value);
  2077. // @@protoc_insertion_point(field_add_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2078. }
  2079. inline void TestAllTypes::add_repeated_string(const char* value, size_t size) {
  2080. repeated_string_.Add()->assign(reinterpret_cast<const char*>(value), size);
  2081. // @@protoc_insertion_point(field_add_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2082. }
  2083. inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
  2084. TestAllTypes::repeated_string() const {
  2085. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2086. return repeated_string_;
  2087. }
  2088. inline ::google::protobuf::RepeatedPtrField< ::std::string>*
  2089. TestAllTypes::mutable_repeated_string() {
  2090. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string)
  2091. return &repeated_string_;
  2092. }
  2093. // repeated bytes repeated_bytes = 45;
  2094. inline int TestAllTypes::repeated_bytes_size() const {
  2095. return repeated_bytes_.size();
  2096. }
  2097. inline void TestAllTypes::clear_repeated_bytes() {
  2098. repeated_bytes_.Clear();
  2099. }
  2100. inline const ::std::string& TestAllTypes::repeated_bytes(int index) const {
  2101. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2102. return repeated_bytes_.Get(index);
  2103. }
  2104. inline ::std::string* TestAllTypes::mutable_repeated_bytes(int index) {
  2105. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2106. return repeated_bytes_.Mutable(index);
  2107. }
  2108. inline void TestAllTypes::set_repeated_bytes(int index, const ::std::string& value) {
  2109. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2110. repeated_bytes_.Mutable(index)->assign(value);
  2111. }
  2112. #if LANG_CXX11
  2113. inline void TestAllTypes::set_repeated_bytes(int index, ::std::string&& value) {
  2114. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2115. repeated_bytes_.Mutable(index)->assign(std::move(value));
  2116. }
  2117. #endif
  2118. inline void TestAllTypes::set_repeated_bytes(int index, const char* value) {
  2119. GOOGLE_DCHECK(value != NULL);
  2120. repeated_bytes_.Mutable(index)->assign(value);
  2121. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2122. }
  2123. inline void TestAllTypes::set_repeated_bytes(int index, const void* value, size_t size) {
  2124. repeated_bytes_.Mutable(index)->assign(
  2125. reinterpret_cast<const char*>(value), size);
  2126. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2127. }
  2128. inline ::std::string* TestAllTypes::add_repeated_bytes() {
  2129. // @@protoc_insertion_point(field_add_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2130. return repeated_bytes_.Add();
  2131. }
  2132. inline void TestAllTypes::add_repeated_bytes(const ::std::string& value) {
  2133. repeated_bytes_.Add()->assign(value);
  2134. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2135. }
  2136. #if LANG_CXX11
  2137. inline void TestAllTypes::add_repeated_bytes(::std::string&& value) {
  2138. repeated_bytes_.Add(std::move(value));
  2139. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2140. }
  2141. #endif
  2142. inline void TestAllTypes::add_repeated_bytes(const char* value) {
  2143. GOOGLE_DCHECK(value != NULL);
  2144. repeated_bytes_.Add()->assign(value);
  2145. // @@protoc_insertion_point(field_add_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2146. }
  2147. inline void TestAllTypes::add_repeated_bytes(const void* value, size_t size) {
  2148. repeated_bytes_.Add()->assign(reinterpret_cast<const char*>(value), size);
  2149. // @@protoc_insertion_point(field_add_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2150. }
  2151. inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
  2152. TestAllTypes::repeated_bytes() const {
  2153. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2154. return repeated_bytes_;
  2155. }
  2156. inline ::google::protobuf::RepeatedPtrField< ::std::string>*
  2157. TestAllTypes::mutable_repeated_bytes() {
  2158. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_bytes)
  2159. return &repeated_bytes_;
  2160. }
  2161. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  2162. inline int TestAllTypes::repeated_nested_message_size() const {
  2163. return repeated_nested_message_.size();
  2164. }
  2165. inline void TestAllTypes::clear_repeated_nested_message() {
  2166. repeated_nested_message_.Clear();
  2167. }
  2168. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_repeated_nested_message(int index) {
  2169. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_message)
  2170. return repeated_nested_message_.Mutable(index);
  2171. }
  2172. inline ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >*
  2173. TestAllTypes::mutable_repeated_nested_message() {
  2174. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_message)
  2175. return &repeated_nested_message_;
  2176. }
  2177. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::repeated_nested_message(int index) const {
  2178. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_message)
  2179. return repeated_nested_message_.Get(index);
  2180. }
  2181. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::add_repeated_nested_message() {
  2182. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_message)
  2183. return repeated_nested_message_.Add();
  2184. }
  2185. inline const ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >&
  2186. TestAllTypes::repeated_nested_message() const {
  2187. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_message)
  2188. return repeated_nested_message_;
  2189. }
  2190. // repeated .proto2_nofieldpresence_unittest.ForeignMessage repeated_foreign_message = 49;
  2191. inline int TestAllTypes::repeated_foreign_message_size() const {
  2192. return repeated_foreign_message_.size();
  2193. }
  2194. inline void TestAllTypes::clear_repeated_foreign_message() {
  2195. repeated_foreign_message_.Clear();
  2196. }
  2197. inline ::proto2_nofieldpresence_unittest::ForeignMessage* TestAllTypes::mutable_repeated_foreign_message(int index) {
  2198. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_message)
  2199. return repeated_foreign_message_.Mutable(index);
  2200. }
  2201. inline ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::ForeignMessage >*
  2202. TestAllTypes::mutable_repeated_foreign_message() {
  2203. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_message)
  2204. return &repeated_foreign_message_;
  2205. }
  2206. inline const ::proto2_nofieldpresence_unittest::ForeignMessage& TestAllTypes::repeated_foreign_message(int index) const {
  2207. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_message)
  2208. return repeated_foreign_message_.Get(index);
  2209. }
  2210. inline ::proto2_nofieldpresence_unittest::ForeignMessage* TestAllTypes::add_repeated_foreign_message() {
  2211. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_message)
  2212. return repeated_foreign_message_.Add();
  2213. }
  2214. inline const ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::ForeignMessage >&
  2215. TestAllTypes::repeated_foreign_message() const {
  2216. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_message)
  2217. return repeated_foreign_message_;
  2218. }
  2219. // repeated .protobuf_unittest.TestAllTypes repeated_proto2_message = 50;
  2220. inline int TestAllTypes::repeated_proto2_message_size() const {
  2221. return repeated_proto2_message_.size();
  2222. }
  2223. inline ::protobuf_unittest::TestAllTypes* TestAllTypes::mutable_repeated_proto2_message(int index) {
  2224. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_proto2_message)
  2225. return repeated_proto2_message_.Mutable(index);
  2226. }
  2227. inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
  2228. TestAllTypes::mutable_repeated_proto2_message() {
  2229. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_proto2_message)
  2230. return &repeated_proto2_message_;
  2231. }
  2232. inline const ::protobuf_unittest::TestAllTypes& TestAllTypes::repeated_proto2_message(int index) const {
  2233. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_proto2_message)
  2234. return repeated_proto2_message_.Get(index);
  2235. }
  2236. inline ::protobuf_unittest::TestAllTypes* TestAllTypes::add_repeated_proto2_message() {
  2237. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_proto2_message)
  2238. return repeated_proto2_message_.Add();
  2239. }
  2240. inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
  2241. TestAllTypes::repeated_proto2_message() const {
  2242. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_proto2_message)
  2243. return repeated_proto2_message_;
  2244. }
  2245. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  2246. inline int TestAllTypes::repeated_nested_enum_size() const {
  2247. return repeated_nested_enum_.size();
  2248. }
  2249. inline void TestAllTypes::clear_repeated_nested_enum() {
  2250. repeated_nested_enum_.Clear();
  2251. }
  2252. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum TestAllTypes::repeated_nested_enum(int index) const {
  2253. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_enum)
  2254. return static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(repeated_nested_enum_.Get(index));
  2255. }
  2256. inline void TestAllTypes::set_repeated_nested_enum(int index, ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value) {
  2257. repeated_nested_enum_.Set(index, value);
  2258. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_enum)
  2259. }
  2260. inline void TestAllTypes::add_repeated_nested_enum(::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value) {
  2261. repeated_nested_enum_.Add(value);
  2262. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_enum)
  2263. }
  2264. inline const ::google::protobuf::RepeatedField<int>&
  2265. TestAllTypes::repeated_nested_enum() const {
  2266. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_enum)
  2267. return repeated_nested_enum_;
  2268. }
  2269. inline ::google::protobuf::RepeatedField<int>*
  2270. TestAllTypes::mutable_repeated_nested_enum() {
  2271. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_nested_enum)
  2272. return &repeated_nested_enum_;
  2273. }
  2274. // repeated .proto2_nofieldpresence_unittest.ForeignEnum repeated_foreign_enum = 52;
  2275. inline int TestAllTypes::repeated_foreign_enum_size() const {
  2276. return repeated_foreign_enum_.size();
  2277. }
  2278. inline void TestAllTypes::clear_repeated_foreign_enum() {
  2279. repeated_foreign_enum_.Clear();
  2280. }
  2281. inline ::proto2_nofieldpresence_unittest::ForeignEnum TestAllTypes::repeated_foreign_enum(int index) const {
  2282. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_enum)
  2283. return static_cast< ::proto2_nofieldpresence_unittest::ForeignEnum >(repeated_foreign_enum_.Get(index));
  2284. }
  2285. inline void TestAllTypes::set_repeated_foreign_enum(int index, ::proto2_nofieldpresence_unittest::ForeignEnum value) {
  2286. repeated_foreign_enum_.Set(index, value);
  2287. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_enum)
  2288. }
  2289. inline void TestAllTypes::add_repeated_foreign_enum(::proto2_nofieldpresence_unittest::ForeignEnum value) {
  2290. repeated_foreign_enum_.Add(value);
  2291. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_enum)
  2292. }
  2293. inline const ::google::protobuf::RepeatedField<int>&
  2294. TestAllTypes::repeated_foreign_enum() const {
  2295. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_enum)
  2296. return repeated_foreign_enum_;
  2297. }
  2298. inline ::google::protobuf::RepeatedField<int>*
  2299. TestAllTypes::mutable_repeated_foreign_enum() {
  2300. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_foreign_enum)
  2301. return &repeated_foreign_enum_;
  2302. }
  2303. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  2304. inline int TestAllTypes::repeated_string_piece_size() const {
  2305. return repeated_string_piece_.size();
  2306. }
  2307. inline void TestAllTypes::clear_repeated_string_piece() {
  2308. repeated_string_piece_.Clear();
  2309. }
  2310. inline const ::std::string& TestAllTypes::repeated_string_piece(int index) const {
  2311. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2312. return repeated_string_piece_.Get(index);
  2313. }
  2314. inline ::std::string* TestAllTypes::mutable_repeated_string_piece(int index) {
  2315. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2316. return repeated_string_piece_.Mutable(index);
  2317. }
  2318. inline void TestAllTypes::set_repeated_string_piece(int index, const ::std::string& value) {
  2319. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2320. repeated_string_piece_.Mutable(index)->assign(value);
  2321. }
  2322. #if LANG_CXX11
  2323. inline void TestAllTypes::set_repeated_string_piece(int index, ::std::string&& value) {
  2324. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2325. repeated_string_piece_.Mutable(index)->assign(std::move(value));
  2326. }
  2327. #endif
  2328. inline void TestAllTypes::set_repeated_string_piece(int index, const char* value) {
  2329. GOOGLE_DCHECK(value != NULL);
  2330. repeated_string_piece_.Mutable(index)->assign(value);
  2331. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2332. }
  2333. inline void TestAllTypes::set_repeated_string_piece(int index, const char* value, size_t size) {
  2334. repeated_string_piece_.Mutable(index)->assign(
  2335. reinterpret_cast<const char*>(value), size);
  2336. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2337. }
  2338. inline ::std::string* TestAllTypes::add_repeated_string_piece() {
  2339. // @@protoc_insertion_point(field_add_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2340. return repeated_string_piece_.Add();
  2341. }
  2342. inline void TestAllTypes::add_repeated_string_piece(const ::std::string& value) {
  2343. repeated_string_piece_.Add()->assign(value);
  2344. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2345. }
  2346. #if LANG_CXX11
  2347. inline void TestAllTypes::add_repeated_string_piece(::std::string&& value) {
  2348. repeated_string_piece_.Add(std::move(value));
  2349. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2350. }
  2351. #endif
  2352. inline void TestAllTypes::add_repeated_string_piece(const char* value) {
  2353. GOOGLE_DCHECK(value != NULL);
  2354. repeated_string_piece_.Add()->assign(value);
  2355. // @@protoc_insertion_point(field_add_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2356. }
  2357. inline void TestAllTypes::add_repeated_string_piece(const char* value, size_t size) {
  2358. repeated_string_piece_.Add()->assign(reinterpret_cast<const char*>(value), size);
  2359. // @@protoc_insertion_point(field_add_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2360. }
  2361. inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
  2362. TestAllTypes::repeated_string_piece() const {
  2363. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2364. return repeated_string_piece_;
  2365. }
  2366. inline ::google::protobuf::RepeatedPtrField< ::std::string>*
  2367. TestAllTypes::mutable_repeated_string_piece() {
  2368. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece)
  2369. return &repeated_string_piece_;
  2370. }
  2371. // repeated string repeated_cord = 55 [ctype = CORD];
  2372. inline int TestAllTypes::repeated_cord_size() const {
  2373. return repeated_cord_.size();
  2374. }
  2375. inline void TestAllTypes::clear_repeated_cord() {
  2376. repeated_cord_.Clear();
  2377. }
  2378. inline const ::std::string& TestAllTypes::repeated_cord(int index) const {
  2379. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2380. return repeated_cord_.Get(index);
  2381. }
  2382. inline ::std::string* TestAllTypes::mutable_repeated_cord(int index) {
  2383. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2384. return repeated_cord_.Mutable(index);
  2385. }
  2386. inline void TestAllTypes::set_repeated_cord(int index, const ::std::string& value) {
  2387. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2388. repeated_cord_.Mutable(index)->assign(value);
  2389. }
  2390. #if LANG_CXX11
  2391. inline void TestAllTypes::set_repeated_cord(int index, ::std::string&& value) {
  2392. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2393. repeated_cord_.Mutable(index)->assign(std::move(value));
  2394. }
  2395. #endif
  2396. inline void TestAllTypes::set_repeated_cord(int index, const char* value) {
  2397. GOOGLE_DCHECK(value != NULL);
  2398. repeated_cord_.Mutable(index)->assign(value);
  2399. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2400. }
  2401. inline void TestAllTypes::set_repeated_cord(int index, const char* value, size_t size) {
  2402. repeated_cord_.Mutable(index)->assign(
  2403. reinterpret_cast<const char*>(value), size);
  2404. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2405. }
  2406. inline ::std::string* TestAllTypes::add_repeated_cord() {
  2407. // @@protoc_insertion_point(field_add_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2408. return repeated_cord_.Add();
  2409. }
  2410. inline void TestAllTypes::add_repeated_cord(const ::std::string& value) {
  2411. repeated_cord_.Add()->assign(value);
  2412. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2413. }
  2414. #if LANG_CXX11
  2415. inline void TestAllTypes::add_repeated_cord(::std::string&& value) {
  2416. repeated_cord_.Add(std::move(value));
  2417. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2418. }
  2419. #endif
  2420. inline void TestAllTypes::add_repeated_cord(const char* value) {
  2421. GOOGLE_DCHECK(value != NULL);
  2422. repeated_cord_.Add()->assign(value);
  2423. // @@protoc_insertion_point(field_add_char:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2424. }
  2425. inline void TestAllTypes::add_repeated_cord(const char* value, size_t size) {
  2426. repeated_cord_.Add()->assign(reinterpret_cast<const char*>(value), size);
  2427. // @@protoc_insertion_point(field_add_pointer:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2428. }
  2429. inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
  2430. TestAllTypes::repeated_cord() const {
  2431. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2432. return repeated_cord_;
  2433. }
  2434. inline ::google::protobuf::RepeatedPtrField< ::std::string>*
  2435. TestAllTypes::mutable_repeated_cord() {
  2436. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord)
  2437. return &repeated_cord_;
  2438. }
  2439. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  2440. inline int TestAllTypes::repeated_lazy_message_size() const {
  2441. return repeated_lazy_message_.size();
  2442. }
  2443. inline void TestAllTypes::clear_repeated_lazy_message() {
  2444. repeated_lazy_message_.Clear();
  2445. }
  2446. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_repeated_lazy_message(int index) {
  2447. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.repeated_lazy_message)
  2448. return repeated_lazy_message_.Mutable(index);
  2449. }
  2450. inline ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >*
  2451. TestAllTypes::mutable_repeated_lazy_message() {
  2452. // @@protoc_insertion_point(field_mutable_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_lazy_message)
  2453. return &repeated_lazy_message_;
  2454. }
  2455. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::repeated_lazy_message(int index) const {
  2456. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.repeated_lazy_message)
  2457. return repeated_lazy_message_.Get(index);
  2458. }
  2459. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::add_repeated_lazy_message() {
  2460. // @@protoc_insertion_point(field_add:proto2_nofieldpresence_unittest.TestAllTypes.repeated_lazy_message)
  2461. return repeated_lazy_message_.Add();
  2462. }
  2463. inline const ::google::protobuf::RepeatedPtrField< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >&
  2464. TestAllTypes::repeated_lazy_message() const {
  2465. // @@protoc_insertion_point(field_list:proto2_nofieldpresence_unittest.TestAllTypes.repeated_lazy_message)
  2466. return repeated_lazy_message_;
  2467. }
  2468. // uint32 oneof_uint32 = 111;
  2469. inline bool TestAllTypes::has_oneof_uint32() const {
  2470. return oneof_field_case() == kOneofUint32;
  2471. }
  2472. inline void TestAllTypes::set_has_oneof_uint32() {
  2473. _oneof_case_[0] = kOneofUint32;
  2474. }
  2475. inline void TestAllTypes::clear_oneof_uint32() {
  2476. if (has_oneof_uint32()) {
  2477. oneof_field_.oneof_uint32_ = 0u;
  2478. clear_has_oneof_field();
  2479. }
  2480. }
  2481. inline ::google::protobuf::uint32 TestAllTypes::oneof_uint32() const {
  2482. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.oneof_uint32)
  2483. if (has_oneof_uint32()) {
  2484. return oneof_field_.oneof_uint32_;
  2485. }
  2486. return 0u;
  2487. }
  2488. inline void TestAllTypes::set_oneof_uint32(::google::protobuf::uint32 value) {
  2489. if (!has_oneof_uint32()) {
  2490. clear_oneof_field();
  2491. set_has_oneof_uint32();
  2492. }
  2493. oneof_field_.oneof_uint32_ = value;
  2494. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.oneof_uint32)
  2495. }
  2496. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  2497. inline bool TestAllTypes::has_oneof_nested_message() const {
  2498. return oneof_field_case() == kOneofNestedMessage;
  2499. }
  2500. inline void TestAllTypes::set_has_oneof_nested_message() {
  2501. _oneof_case_[0] = kOneofNestedMessage;
  2502. }
  2503. inline void TestAllTypes::clear_oneof_nested_message() {
  2504. if (has_oneof_nested_message()) {
  2505. delete oneof_field_.oneof_nested_message_;
  2506. clear_has_oneof_field();
  2507. }
  2508. }
  2509. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::_internal_oneof_nested_message() const {
  2510. return *oneof_field_.oneof_nested_message_;
  2511. }
  2512. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::release_oneof_nested_message() {
  2513. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.oneof_nested_message)
  2514. if (has_oneof_nested_message()) {
  2515. clear_has_oneof_field();
  2516. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* temp = oneof_field_.oneof_nested_message_;
  2517. oneof_field_.oneof_nested_message_ = NULL;
  2518. return temp;
  2519. } else {
  2520. return NULL;
  2521. }
  2522. }
  2523. inline const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage& TestAllTypes::oneof_nested_message() const {
  2524. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.oneof_nested_message)
  2525. return has_oneof_nested_message()
  2526. ? *oneof_field_.oneof_nested_message_
  2527. : *reinterpret_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage*>(&::proto2_nofieldpresence_unittest::_TestAllTypes_NestedMessage_default_instance_);
  2528. }
  2529. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_oneof_nested_message() {
  2530. if (!has_oneof_nested_message()) {
  2531. clear_oneof_field();
  2532. set_has_oneof_nested_message();
  2533. oneof_field_.oneof_nested_message_ = CreateMaybeMessage< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >(
  2534. GetArenaNoVirtual());
  2535. }
  2536. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.oneof_nested_message)
  2537. return oneof_field_.oneof_nested_message_;
  2538. }
  2539. // string oneof_string = 113;
  2540. inline bool TestAllTypes::has_oneof_string() const {
  2541. return oneof_field_case() == kOneofString;
  2542. }
  2543. inline void TestAllTypes::set_has_oneof_string() {
  2544. _oneof_case_[0] = kOneofString;
  2545. }
  2546. inline void TestAllTypes::clear_oneof_string() {
  2547. if (has_oneof_string()) {
  2548. oneof_field_.oneof_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2549. clear_has_oneof_field();
  2550. }
  2551. }
  2552. inline const ::std::string& TestAllTypes::oneof_string() const {
  2553. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2554. if (has_oneof_string()) {
  2555. return oneof_field_.oneof_string_.GetNoArena();
  2556. }
  2557. return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
  2558. }
  2559. inline void TestAllTypes::set_oneof_string(const ::std::string& value) {
  2560. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2561. if (!has_oneof_string()) {
  2562. clear_oneof_field();
  2563. set_has_oneof_string();
  2564. oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2565. }
  2566. oneof_field_.oneof_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  2567. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2568. }
  2569. #if LANG_CXX11
  2570. inline void TestAllTypes::set_oneof_string(::std::string&& value) {
  2571. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2572. if (!has_oneof_string()) {
  2573. clear_oneof_field();
  2574. set_has_oneof_string();
  2575. oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2576. }
  2577. oneof_field_.oneof_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  2578. // @@protoc_insertion_point(field_set_rvalue:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2579. }
  2580. #endif
  2581. inline void TestAllTypes::set_oneof_string(const char* value) {
  2582. GOOGLE_DCHECK(value != NULL);
  2583. if (!has_oneof_string()) {
  2584. clear_oneof_field();
  2585. set_has_oneof_string();
  2586. oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2587. }
  2588. oneof_field_.oneof_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  2589. ::std::string(value));
  2590. // @@protoc_insertion_point(field_set_char:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2591. }
  2592. inline void TestAllTypes::set_oneof_string(const char* value, size_t size) {
  2593. if (!has_oneof_string()) {
  2594. clear_oneof_field();
  2595. set_has_oneof_string();
  2596. oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2597. }
  2598. oneof_field_.oneof_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
  2599. reinterpret_cast<const char*>(value), size));
  2600. // @@protoc_insertion_point(field_set_pointer:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2601. }
  2602. inline ::std::string* TestAllTypes::mutable_oneof_string() {
  2603. if (!has_oneof_string()) {
  2604. clear_oneof_field();
  2605. set_has_oneof_string();
  2606. oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2607. }
  2608. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2609. return oneof_field_.oneof_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2610. }
  2611. inline ::std::string* TestAllTypes::release_oneof_string() {
  2612. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2613. if (has_oneof_string()) {
  2614. clear_has_oneof_field();
  2615. return oneof_field_.oneof_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2616. } else {
  2617. return NULL;
  2618. }
  2619. }
  2620. inline void TestAllTypes::set_allocated_oneof_string(::std::string* oneof_string) {
  2621. if (!has_oneof_string()) {
  2622. oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  2623. }
  2624. clear_oneof_field();
  2625. if (oneof_string != NULL) {
  2626. set_has_oneof_string();
  2627. oneof_field_.oneof_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), oneof_string);
  2628. }
  2629. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.oneof_string)
  2630. }
  2631. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum oneof_enum = 114;
  2632. inline bool TestAllTypes::has_oneof_enum() const {
  2633. return oneof_field_case() == kOneofEnum;
  2634. }
  2635. inline void TestAllTypes::set_has_oneof_enum() {
  2636. _oneof_case_[0] = kOneofEnum;
  2637. }
  2638. inline void TestAllTypes::clear_oneof_enum() {
  2639. if (has_oneof_enum()) {
  2640. oneof_field_.oneof_enum_ = 0;
  2641. clear_has_oneof_field();
  2642. }
  2643. }
  2644. inline ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum TestAllTypes::oneof_enum() const {
  2645. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestAllTypes.oneof_enum)
  2646. if (has_oneof_enum()) {
  2647. return static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(oneof_field_.oneof_enum_);
  2648. }
  2649. return static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(0);
  2650. }
  2651. inline void TestAllTypes::set_oneof_enum(::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum value) {
  2652. if (!has_oneof_enum()) {
  2653. clear_oneof_field();
  2654. set_has_oneof_enum();
  2655. }
  2656. oneof_field_.oneof_enum_ = value;
  2657. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.TestAllTypes.oneof_enum)
  2658. }
  2659. inline bool TestAllTypes::has_oneof_field() const {
  2660. return oneof_field_case() != ONEOF_FIELD_NOT_SET;
  2661. }
  2662. inline void TestAllTypes::clear_has_oneof_field() {
  2663. _oneof_case_[0] = ONEOF_FIELD_NOT_SET;
  2664. }
  2665. inline TestAllTypes::OneofFieldCase TestAllTypes::oneof_field_case() const {
  2666. return TestAllTypes::OneofFieldCase(_oneof_case_[0]);
  2667. }
  2668. // -------------------------------------------------------------------
  2669. // TestProto2Required
  2670. // .protobuf_unittest.TestRequired proto2 = 1;
  2671. inline bool TestProto2Required::has_proto2() const {
  2672. return this != internal_default_instance() && proto2_ != NULL;
  2673. }
  2674. inline const ::protobuf_unittest::TestRequired& TestProto2Required::_internal_proto2() const {
  2675. return *proto2_;
  2676. }
  2677. inline const ::protobuf_unittest::TestRequired& TestProto2Required::proto2() const {
  2678. const ::protobuf_unittest::TestRequired* p = proto2_;
  2679. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.TestProto2Required.proto2)
  2680. return p != NULL ? *p : *reinterpret_cast<const ::protobuf_unittest::TestRequired*>(
  2681. &::protobuf_unittest::_TestRequired_default_instance_);
  2682. }
  2683. inline ::protobuf_unittest::TestRequired* TestProto2Required::release_proto2() {
  2684. // @@protoc_insertion_point(field_release:proto2_nofieldpresence_unittest.TestProto2Required.proto2)
  2685. ::protobuf_unittest::TestRequired* temp = proto2_;
  2686. proto2_ = NULL;
  2687. return temp;
  2688. }
  2689. inline ::protobuf_unittest::TestRequired* TestProto2Required::mutable_proto2() {
  2690. if (proto2_ == NULL) {
  2691. auto* p = CreateMaybeMessage<::protobuf_unittest::TestRequired>(GetArenaNoVirtual());
  2692. proto2_ = p;
  2693. }
  2694. // @@protoc_insertion_point(field_mutable:proto2_nofieldpresence_unittest.TestProto2Required.proto2)
  2695. return proto2_;
  2696. }
  2697. inline void TestProto2Required::set_allocated_proto2(::protobuf_unittest::TestRequired* proto2) {
  2698. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  2699. if (message_arena == NULL) {
  2700. delete reinterpret_cast< ::google::protobuf::MessageLite*>(proto2_);
  2701. }
  2702. if (proto2) {
  2703. ::google::protobuf::Arena* submessage_arena =
  2704. reinterpret_cast<::google::protobuf::MessageLite*>(proto2)->GetArena();
  2705. if (message_arena != submessage_arena) {
  2706. proto2 = ::google::protobuf::internal::GetOwnedMessage(
  2707. message_arena, proto2, submessage_arena);
  2708. }
  2709. } else {
  2710. }
  2711. proto2_ = proto2;
  2712. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestProto2Required.proto2)
  2713. }
  2714. // -------------------------------------------------------------------
  2715. // ForeignMessage
  2716. // int32 c = 1;
  2717. inline void ForeignMessage::clear_c() {
  2718. c_ = 0;
  2719. }
  2720. inline ::google::protobuf::int32 ForeignMessage::c() const {
  2721. // @@protoc_insertion_point(field_get:proto2_nofieldpresence_unittest.ForeignMessage.c)
  2722. return c_;
  2723. }
  2724. inline void ForeignMessage::set_c(::google::protobuf::int32 value) {
  2725. c_ = value;
  2726. // @@protoc_insertion_point(field_set:proto2_nofieldpresence_unittest.ForeignMessage.c)
  2727. }
  2728. #ifdef __GNUC__
  2729. #pragma GCC diagnostic pop
  2730. #endif // __GNUC__
  2731. // -------------------------------------------------------------------
  2732. // -------------------------------------------------------------------
  2733. // -------------------------------------------------------------------
  2734. // @@protoc_insertion_point(namespace_scope)
  2735. } // namespace proto2_nofieldpresence_unittest
  2736. namespace google {
  2737. namespace protobuf {
  2738. template <> struct is_proto_enum< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum> : ::std::true_type {};
  2739. template <>
  2740. inline const EnumDescriptor* GetEnumDescriptor< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum>() {
  2741. return ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum_descriptor();
  2742. }
  2743. template <> struct is_proto_enum< ::proto2_nofieldpresence_unittest::ForeignEnum> : ::std::true_type {};
  2744. template <>
  2745. inline const EnumDescriptor* GetEnumDescriptor< ::proto2_nofieldpresence_unittest::ForeignEnum>() {
  2746. return ::proto2_nofieldpresence_unittest::ForeignEnum_descriptor();
  2747. }
  2748. } // namespace protobuf
  2749. } // namespace google
  2750. // @@protoc_insertion_point(global_scope)
  2751. #endif // PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto