unittest_no_field_presence.pb.cc 165 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_no_field_presence.proto
  3. #include <google/protobuf/unittest_no_field_presence.pb.h>
  4. #include <algorithm>
  5. #include <google/protobuf/stubs/common.h>
  6. #include <google/protobuf/stubs/port.h>
  7. #include <google/protobuf/io/coded_stream.h>
  8. #include <google/protobuf/wire_format_lite_inl.h>
  9. #include <google/protobuf/descriptor.h>
  10. #include <google/protobuf/generated_message_reflection.h>
  11. #include <google/protobuf/reflection_ops.h>
  12. #include <google/protobuf/wire_format.h>
  13. // This is a temporary google only hack
  14. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  15. #include "third_party/protobuf/version.h"
  16. #endif
  17. // @@protoc_insertion_point(includes)
  18. namespace protobuf_google_2fprotobuf_2funittest_2eproto {
  19. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestRequired;
  20. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_2eproto ::google::protobuf::internal::SCCInfo<6> scc_info_TestAllTypes;
  21. } // namespace protobuf_google_2fprotobuf_2funittest_2eproto
  22. namespace protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto {
  23. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ForeignMessage;
  24. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_NestedMessage;
  25. } // namespace protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto
  26. namespace proto2_nofieldpresence_unittest {
  27. class TestAllTypes_NestedMessageDefaultTypeInternal {
  28. public:
  29. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes_NestedMessage>
  30. _instance;
  31. } _TestAllTypes_NestedMessage_default_instance_;
  32. class TestAllTypesDefaultTypeInternal {
  33. public:
  34. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes>
  35. _instance;
  36. ::google::protobuf::uint32 oneof_uint32_;
  37. const ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* oneof_nested_message_;
  38. ::google::protobuf::internal::ArenaStringPtr oneof_string_;
  39. int oneof_enum_;
  40. } _TestAllTypes_default_instance_;
  41. class TestProto2RequiredDefaultTypeInternal {
  42. public:
  43. ::google::protobuf::internal::ExplicitlyConstructed<TestProto2Required>
  44. _instance;
  45. } _TestProto2Required_default_instance_;
  46. class ForeignMessageDefaultTypeInternal {
  47. public:
  48. ::google::protobuf::internal::ExplicitlyConstructed<ForeignMessage>
  49. _instance;
  50. } _ForeignMessage_default_instance_;
  51. } // namespace proto2_nofieldpresence_unittest
  52. namespace protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto {
  53. static void InitDefaultsTestAllTypes_NestedMessage() {
  54. GOOGLE_PROTOBUF_VERIFY_VERSION;
  55. {
  56. void* ptr = &::proto2_nofieldpresence_unittest::_TestAllTypes_NestedMessage_default_instance_;
  57. new (ptr) ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage();
  58. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  59. }
  60. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::InitAsDefaultInstance();
  61. }
  62. ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_NestedMessage =
  63. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestAllTypes_NestedMessage}, {}};
  64. static void InitDefaultsTestAllTypes() {
  65. GOOGLE_PROTOBUF_VERIFY_VERSION;
  66. {
  67. void* ptr = &::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_;
  68. new (ptr) ::proto2_nofieldpresence_unittest::TestAllTypes();
  69. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  70. }
  71. ::proto2_nofieldpresence_unittest::TestAllTypes::InitAsDefaultInstance();
  72. }
  73. ::google::protobuf::internal::SCCInfo<3> scc_info_TestAllTypes =
  74. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsTestAllTypes}, {
  75. &protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_TestAllTypes_NestedMessage.base,
  76. &protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_ForeignMessage.base,
  77. &protobuf_google_2fprotobuf_2funittest_2eproto::scc_info_TestAllTypes.base,}};
  78. static void InitDefaultsTestProto2Required() {
  79. GOOGLE_PROTOBUF_VERIFY_VERSION;
  80. {
  81. void* ptr = &::proto2_nofieldpresence_unittest::_TestProto2Required_default_instance_;
  82. new (ptr) ::proto2_nofieldpresence_unittest::TestProto2Required();
  83. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  84. }
  85. ::proto2_nofieldpresence_unittest::TestProto2Required::InitAsDefaultInstance();
  86. }
  87. ::google::protobuf::internal::SCCInfo<1> scc_info_TestProto2Required =
  88. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTestProto2Required}, {
  89. &protobuf_google_2fprotobuf_2funittest_2eproto::scc_info_TestRequired.base,}};
  90. static void InitDefaultsForeignMessage() {
  91. GOOGLE_PROTOBUF_VERIFY_VERSION;
  92. {
  93. void* ptr = &::proto2_nofieldpresence_unittest::_ForeignMessage_default_instance_;
  94. new (ptr) ::proto2_nofieldpresence_unittest::ForeignMessage();
  95. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  96. }
  97. ::proto2_nofieldpresence_unittest::ForeignMessage::InitAsDefaultInstance();
  98. }
  99. ::google::protobuf::internal::SCCInfo<0> scc_info_ForeignMessage =
  100. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsForeignMessage}, {}};
  101. void InitDefaults() {
  102. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes_NestedMessage.base);
  103. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes.base);
  104. ::google::protobuf::internal::InitSCC(&scc_info_TestProto2Required.base);
  105. ::google::protobuf::internal::InitSCC(&scc_info_ForeignMessage.base);
  106. }
  107. ::google::protobuf::Metadata file_level_metadata[4];
  108. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
  109. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  110. ~0u, // no _has_bits_
  111. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage, _internal_metadata_),
  112. ~0u, // no _extensions_
  113. ~0u, // no _oneof_case_
  114. ~0u, // no _weak_field_map_
  115. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage, bb_),
  116. ~0u, // no _has_bits_
  117. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, _internal_metadata_),
  118. ~0u, // no _extensions_
  119. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, _oneof_case_[0]),
  120. ~0u, // no _weak_field_map_
  121. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_int32_),
  122. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_int64_),
  123. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_uint32_),
  124. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_uint64_),
  125. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_sint32_),
  126. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_sint64_),
  127. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_fixed32_),
  128. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_fixed64_),
  129. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_sfixed32_),
  130. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_sfixed64_),
  131. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_float_),
  132. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_double_),
  133. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_bool_),
  134. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_string_),
  135. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_bytes_),
  136. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_nested_message_),
  137. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_foreign_message_),
  138. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_proto2_message_),
  139. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_nested_enum_),
  140. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_foreign_enum_),
  141. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_string_piece_),
  142. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_cord_),
  143. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, optional_lazy_message_),
  144. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_int32_),
  145. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_int64_),
  146. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_uint32_),
  147. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_uint64_),
  148. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_sint32_),
  149. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_sint64_),
  150. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_fixed32_),
  151. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_fixed64_),
  152. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_sfixed32_),
  153. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_sfixed64_),
  154. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_float_),
  155. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_double_),
  156. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_bool_),
  157. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_string_),
  158. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_bytes_),
  159. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_nested_message_),
  160. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_foreign_message_),
  161. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_proto2_message_),
  162. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_nested_enum_),
  163. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_foreign_enum_),
  164. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_string_piece_),
  165. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_cord_),
  166. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, repeated_lazy_message_),
  167. offsetof(::proto2_nofieldpresence_unittest::TestAllTypesDefaultTypeInternal, oneof_uint32_),
  168. offsetof(::proto2_nofieldpresence_unittest::TestAllTypesDefaultTypeInternal, oneof_nested_message_),
  169. offsetof(::proto2_nofieldpresence_unittest::TestAllTypesDefaultTypeInternal, oneof_string_),
  170. offsetof(::proto2_nofieldpresence_unittest::TestAllTypesDefaultTypeInternal, oneof_enum_),
  171. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestAllTypes, oneof_field_),
  172. ~0u, // no _has_bits_
  173. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestProto2Required, _internal_metadata_),
  174. ~0u, // no _extensions_
  175. ~0u, // no _oneof_case_
  176. ~0u, // no _weak_field_map_
  177. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::TestProto2Required, proto2_),
  178. ~0u, // no _has_bits_
  179. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::ForeignMessage, _internal_metadata_),
  180. ~0u, // no _extensions_
  181. ~0u, // no _oneof_case_
  182. ~0u, // no _weak_field_map_
  183. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_nofieldpresence_unittest::ForeignMessage, c_),
  184. };
  185. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  186. { 0, -1, sizeof(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage)},
  187. { 6, -1, sizeof(::proto2_nofieldpresence_unittest::TestAllTypes)},
  188. { 62, -1, sizeof(::proto2_nofieldpresence_unittest::TestProto2Required)},
  189. { 68, -1, sizeof(::proto2_nofieldpresence_unittest::ForeignMessage)},
  190. };
  191. static ::google::protobuf::Message const * const file_default_instances[] = {
  192. reinterpret_cast<const ::google::protobuf::Message*>(&::proto2_nofieldpresence_unittest::_TestAllTypes_NestedMessage_default_instance_),
  193. reinterpret_cast<const ::google::protobuf::Message*>(&::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_),
  194. reinterpret_cast<const ::google::protobuf::Message*>(&::proto2_nofieldpresence_unittest::_TestProto2Required_default_instance_),
  195. reinterpret_cast<const ::google::protobuf::Message*>(&::proto2_nofieldpresence_unittest::_ForeignMessage_default_instance_),
  196. };
  197. void protobuf_AssignDescriptors() {
  198. AddDescriptors();
  199. AssignDescriptors(
  200. "google/protobuf/unittest_no_field_presence.proto", schemas, file_default_instances, TableStruct::offsets,
  201. file_level_metadata, file_level_enum_descriptors, NULL);
  202. }
  203. void protobuf_AssignDescriptorsOnce() {
  204. static ::google::protobuf::internal::once_flag once;
  205. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  206. }
  207. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  208. void protobuf_RegisterTypes(const ::std::string&) {
  209. protobuf_AssignDescriptorsOnce();
  210. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
  211. }
  212. void AddDescriptorsImpl() {
  213. InitDefaults();
  214. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  215. "\n0google/protobuf/unittest_no_field_pres"
  216. "ence.proto\022\037proto2_nofieldpresence_unitt"
  217. "est\032\036google/protobuf/unittest.proto\"\232\021\n\014"
  218. "TestAllTypes\022\026\n\016optional_int32\030\001 \001(\005\022\026\n\016"
  219. "optional_int64\030\002 \001(\003\022\027\n\017optional_uint32\030"
  220. "\003 \001(\r\022\027\n\017optional_uint64\030\004 \001(\004\022\027\n\017option"
  221. "al_sint32\030\005 \001(\021\022\027\n\017optional_sint64\030\006 \001(\022"
  222. "\022\030\n\020optional_fixed32\030\007 \001(\007\022\030\n\020optional_f"
  223. "ixed64\030\010 \001(\006\022\031\n\021optional_sfixed32\030\t \001(\017\022"
  224. "\031\n\021optional_sfixed64\030\n \001(\020\022\026\n\016optional_f"
  225. "loat\030\013 \001(\002\022\027\n\017optional_double\030\014 \001(\001\022\025\n\ro"
  226. "ptional_bool\030\r \001(\010\022\027\n\017optional_string\030\016 "
  227. "\001(\t\022\026\n\016optional_bytes\030\017 \001(\014\022\\\n\027optional_"
  228. "nested_message\030\022 \001(\0132;.proto2_nofieldpre"
  229. "sence_unittest.TestAllTypes.NestedMessag"
  230. "e\022Q\n\030optional_foreign_message\030\023 \001(\0132/.pr"
  231. "oto2_nofieldpresence_unittest.ForeignMes"
  232. "sage\022@\n\027optional_proto2_message\030\024 \001(\0132\037."
  233. "protobuf_unittest.TestAllTypes\022V\n\024option"
  234. "al_nested_enum\030\025 \001(\01628.proto2_nofieldpre"
  235. "sence_unittest.TestAllTypes.NestedEnum\022K"
  236. "\n\025optional_foreign_enum\030\026 \001(\0162,.proto2_n"
  237. "ofieldpresence_unittest.ForeignEnum\022!\n\025o"
  238. "ptional_string_piece\030\030 \001(\tB\002\010\002\022\031\n\roption"
  239. "al_cord\030\031 \001(\tB\002\010\001\022^\n\025optional_lazy_messa"
  240. "ge\030\036 \001(\0132;.proto2_nofieldpresence_unitte"
  241. "st.TestAllTypes.NestedMessageB\002(\001\022\026\n\016rep"
  242. "eated_int32\030\037 \003(\005\022\026\n\016repeated_int64\030 \003("
  243. "\003\022\027\n\017repeated_uint32\030! \003(\r\022\027\n\017repeated_u"
  244. "int64\030\" \003(\004\022\027\n\017repeated_sint32\030# \003(\021\022\027\n\017"
  245. "repeated_sint64\030$ \003(\022\022\030\n\020repeated_fixed3"
  246. "2\030% \003(\007\022\030\n\020repeated_fixed64\030& \003(\006\022\031\n\021rep"
  247. "eated_sfixed32\030\' \003(\017\022\031\n\021repeated_sfixed6"
  248. "4\030( \003(\020\022\026\n\016repeated_float\030) \003(\002\022\027\n\017repea"
  249. "ted_double\030* \003(\001\022\025\n\rrepeated_bool\030+ \003(\010\022"
  250. "\027\n\017repeated_string\030, \003(\t\022\026\n\016repeated_byt"
  251. "es\030- \003(\014\022\\\n\027repeated_nested_message\0300 \003("
  252. "\0132;.proto2_nofieldpresence_unittest.Test"
  253. "AllTypes.NestedMessage\022Q\n\030repeated_forei"
  254. "gn_message\0301 \003(\0132/.proto2_nofieldpresenc"
  255. "e_unittest.ForeignMessage\022@\n\027repeated_pr"
  256. "oto2_message\0302 \003(\0132\037.protobuf_unittest.T"
  257. "estAllTypes\022V\n\024repeated_nested_enum\0303 \003("
  258. "\01628.proto2_nofieldpresence_unittest.Test"
  259. "AllTypes.NestedEnum\022K\n\025repeated_foreign_"
  260. "enum\0304 \003(\0162,.proto2_nofieldpresence_unit"
  261. "test.ForeignEnum\022!\n\025repeated_string_piec"
  262. "e\0306 \003(\tB\002\010\002\022\031\n\rrepeated_cord\0307 \003(\tB\002\010\001\022^"
  263. "\n\025repeated_lazy_message\0309 \003(\0132;.proto2_n"
  264. "ofieldpresence_unittest.TestAllTypes.Nes"
  265. "tedMessageB\002(\001\022\026\n\014oneof_uint32\030o \001(\rH\000\022["
  266. "\n\024oneof_nested_message\030p \001(\0132;.proto2_no"
  267. "fieldpresence_unittest.TestAllTypes.Nest"
  268. "edMessageH\000\022\026\n\014oneof_string\030q \001(\tH\000\022N\n\no"
  269. "neof_enum\030r \001(\01628.proto2_nofieldpresence"
  270. "_unittest.TestAllTypes.NestedEnumH\000\032\033\n\rN"
  271. "estedMessage\022\n\n\002bb\030\001 \001(\005\"\'\n\nNestedEnum\022\007"
  272. "\n\003FOO\020\000\022\007\n\003BAR\020\001\022\007\n\003BAZ\020\002B\r\n\013oneof_field"
  273. "\"E\n\022TestProto2Required\022/\n\006proto2\030\001 \001(\0132\037"
  274. ".protobuf_unittest.TestRequired\"\033\n\016Forei"
  275. "gnMessage\022\t\n\001c\030\001 \001(\005*@\n\013ForeignEnum\022\017\n\013F"
  276. "OREIGN_FOO\020\000\022\017\n\013FOREIGN_BAR\020\001\022\017\n\013FOREIGN"
  277. "_BAZ\020\002b\006proto3"
  278. };
  279. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  280. descriptor, 2494);
  281. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  282. "google/protobuf/unittest_no_field_presence.proto", &protobuf_RegisterTypes);
  283. ::protobuf_google_2fprotobuf_2funittest_2eproto::AddDescriptors();
  284. }
  285. void AddDescriptors() {
  286. static ::google::protobuf::internal::once_flag once;
  287. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  288. }
  289. // Force AddDescriptors() to be called at dynamic initialization time.
  290. struct StaticDescriptorInitializer {
  291. StaticDescriptorInitializer() {
  292. AddDescriptors();
  293. }
  294. } static_descriptor_initializer;
  295. } // namespace protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto
  296. namespace proto2_nofieldpresence_unittest {
  297. const ::google::protobuf::EnumDescriptor* TestAllTypes_NestedEnum_descriptor() {
  298. protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  299. return protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_enum_descriptors[0];
  300. }
  301. bool TestAllTypes_NestedEnum_IsValid(int value) {
  302. switch (value) {
  303. case 0:
  304. case 1:
  305. case 2:
  306. return true;
  307. default:
  308. return false;
  309. }
  310. }
  311. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  312. const TestAllTypes_NestedEnum TestAllTypes::FOO;
  313. const TestAllTypes_NestedEnum TestAllTypes::BAR;
  314. const TestAllTypes_NestedEnum TestAllTypes::BAZ;
  315. const TestAllTypes_NestedEnum TestAllTypes::NestedEnum_MIN;
  316. const TestAllTypes_NestedEnum TestAllTypes::NestedEnum_MAX;
  317. const int TestAllTypes::NestedEnum_ARRAYSIZE;
  318. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  319. const ::google::protobuf::EnumDescriptor* ForeignEnum_descriptor() {
  320. protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  321. return protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_enum_descriptors[1];
  322. }
  323. bool ForeignEnum_IsValid(int value) {
  324. switch (value) {
  325. case 0:
  326. case 1:
  327. case 2:
  328. return true;
  329. default:
  330. return false;
  331. }
  332. }
  333. // ===================================================================
  334. void TestAllTypes_NestedMessage::InitAsDefaultInstance() {
  335. }
  336. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  337. const int TestAllTypes_NestedMessage::kBbFieldNumber;
  338. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  339. TestAllTypes_NestedMessage::TestAllTypes_NestedMessage()
  340. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  341. ::google::protobuf::internal::InitSCC(
  342. &protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_TestAllTypes_NestedMessage.base);
  343. SharedCtor();
  344. // @@protoc_insertion_point(constructor:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  345. }
  346. TestAllTypes_NestedMessage::TestAllTypes_NestedMessage(const TestAllTypes_NestedMessage& from)
  347. : ::google::protobuf::Message(),
  348. _internal_metadata_(NULL) {
  349. _internal_metadata_.MergeFrom(from._internal_metadata_);
  350. bb_ = from.bb_;
  351. // @@protoc_insertion_point(copy_constructor:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  352. }
  353. void TestAllTypes_NestedMessage::SharedCtor() {
  354. bb_ = 0;
  355. }
  356. TestAllTypes_NestedMessage::~TestAllTypes_NestedMessage() {
  357. // @@protoc_insertion_point(destructor:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  358. SharedDtor();
  359. }
  360. void TestAllTypes_NestedMessage::SharedDtor() {
  361. }
  362. void TestAllTypes_NestedMessage::SetCachedSize(int size) const {
  363. _cached_size_.Set(size);
  364. }
  365. const ::google::protobuf::Descriptor* TestAllTypes_NestedMessage::descriptor() {
  366. ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  367. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  368. }
  369. const TestAllTypes_NestedMessage& TestAllTypes_NestedMessage::default_instance() {
  370. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_TestAllTypes_NestedMessage.base);
  371. return *internal_default_instance();
  372. }
  373. void TestAllTypes_NestedMessage::Clear() {
  374. // @@protoc_insertion_point(message_clear_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  375. ::google::protobuf::uint32 cached_has_bits = 0;
  376. // Prevent compiler warnings about cached_has_bits being unused
  377. (void) cached_has_bits;
  378. bb_ = 0;
  379. _internal_metadata_.Clear();
  380. }
  381. bool TestAllTypes_NestedMessage::MergePartialFromCodedStream(
  382. ::google::protobuf::io::CodedInputStream* input) {
  383. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  384. ::google::protobuf::uint32 tag;
  385. // @@protoc_insertion_point(parse_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  386. for (;;) {
  387. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  388. tag = p.first;
  389. if (!p.second) goto handle_unusual;
  390. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  391. // int32 bb = 1;
  392. case 1: {
  393. if (static_cast< ::google::protobuf::uint8>(tag) ==
  394. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  395. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  396. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  397. input, &bb_)));
  398. } else {
  399. goto handle_unusual;
  400. }
  401. break;
  402. }
  403. default: {
  404. handle_unusual:
  405. if (tag == 0) {
  406. goto success;
  407. }
  408. DO_(::google::protobuf::internal::WireFormat::SkipField(
  409. input, tag, _internal_metadata_.mutable_unknown_fields()));
  410. break;
  411. }
  412. }
  413. }
  414. success:
  415. // @@protoc_insertion_point(parse_success:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  416. return true;
  417. failure:
  418. // @@protoc_insertion_point(parse_failure:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  419. return false;
  420. #undef DO_
  421. }
  422. void TestAllTypes_NestedMessage::SerializeWithCachedSizes(
  423. ::google::protobuf::io::CodedOutputStream* output) const {
  424. // @@protoc_insertion_point(serialize_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  425. ::google::protobuf::uint32 cached_has_bits = 0;
  426. (void) cached_has_bits;
  427. // int32 bb = 1;
  428. if (this->bb() != 0) {
  429. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->bb(), output);
  430. }
  431. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  432. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  433. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  434. }
  435. // @@protoc_insertion_point(serialize_end:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  436. }
  437. ::google::protobuf::uint8* TestAllTypes_NestedMessage::InternalSerializeWithCachedSizesToArray(
  438. bool deterministic, ::google::protobuf::uint8* target) const {
  439. (void)deterministic; // Unused
  440. // @@protoc_insertion_point(serialize_to_array_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  441. ::google::protobuf::uint32 cached_has_bits = 0;
  442. (void) cached_has_bits;
  443. // int32 bb = 1;
  444. if (this->bb() != 0) {
  445. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->bb(), target);
  446. }
  447. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  448. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  449. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  450. }
  451. // @@protoc_insertion_point(serialize_to_array_end:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  452. return target;
  453. }
  454. size_t TestAllTypes_NestedMessage::ByteSizeLong() const {
  455. // @@protoc_insertion_point(message_byte_size_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  456. size_t total_size = 0;
  457. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  458. total_size +=
  459. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  460. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  461. }
  462. // int32 bb = 1;
  463. if (this->bb() != 0) {
  464. total_size += 1 +
  465. ::google::protobuf::internal::WireFormatLite::Int32Size(
  466. this->bb());
  467. }
  468. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  469. SetCachedSize(cached_size);
  470. return total_size;
  471. }
  472. void TestAllTypes_NestedMessage::MergeFrom(const ::google::protobuf::Message& from) {
  473. // @@protoc_insertion_point(generalized_merge_from_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  474. GOOGLE_DCHECK_NE(&from, this);
  475. const TestAllTypes_NestedMessage* source =
  476. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes_NestedMessage>(
  477. &from);
  478. if (source == NULL) {
  479. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  480. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  481. } else {
  482. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  483. MergeFrom(*source);
  484. }
  485. }
  486. void TestAllTypes_NestedMessage::MergeFrom(const TestAllTypes_NestedMessage& from) {
  487. // @@protoc_insertion_point(class_specific_merge_from_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  488. GOOGLE_DCHECK_NE(&from, this);
  489. _internal_metadata_.MergeFrom(from._internal_metadata_);
  490. ::google::protobuf::uint32 cached_has_bits = 0;
  491. (void) cached_has_bits;
  492. if (from.bb() != 0) {
  493. set_bb(from.bb());
  494. }
  495. }
  496. void TestAllTypes_NestedMessage::CopyFrom(const ::google::protobuf::Message& from) {
  497. // @@protoc_insertion_point(generalized_copy_from_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  498. if (&from == this) return;
  499. Clear();
  500. MergeFrom(from);
  501. }
  502. void TestAllTypes_NestedMessage::CopyFrom(const TestAllTypes_NestedMessage& from) {
  503. // @@protoc_insertion_point(class_specific_copy_from_start:proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage)
  504. if (&from == this) return;
  505. Clear();
  506. MergeFrom(from);
  507. }
  508. bool TestAllTypes_NestedMessage::IsInitialized() const {
  509. return true;
  510. }
  511. void TestAllTypes_NestedMessage::Swap(TestAllTypes_NestedMessage* other) {
  512. if (other == this) return;
  513. InternalSwap(other);
  514. }
  515. void TestAllTypes_NestedMessage::InternalSwap(TestAllTypes_NestedMessage* other) {
  516. using std::swap;
  517. swap(bb_, other->bb_);
  518. _internal_metadata_.Swap(&other->_internal_metadata_);
  519. }
  520. ::google::protobuf::Metadata TestAllTypes_NestedMessage::GetMetadata() const {
  521. protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  522. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages];
  523. }
  524. // ===================================================================
  525. void TestAllTypes::InitAsDefaultInstance() {
  526. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_nested_message_ = const_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage*>(
  527. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::internal_default_instance());
  528. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_foreign_message_ = const_cast< ::proto2_nofieldpresence_unittest::ForeignMessage*>(
  529. ::proto2_nofieldpresence_unittest::ForeignMessage::internal_default_instance());
  530. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_proto2_message_ = const_cast< ::protobuf_unittest::TestAllTypes*>(
  531. ::protobuf_unittest::TestAllTypes::internal_default_instance());
  532. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_lazy_message_ = const_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage*>(
  533. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::internal_default_instance());
  534. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_.oneof_uint32_ = 0u;
  535. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_.oneof_nested_message_ = const_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage*>(
  536. ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::internal_default_instance());
  537. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_.oneof_string_.UnsafeSetDefault(
  538. &::google::protobuf::internal::GetEmptyStringAlreadyInited());
  539. ::proto2_nofieldpresence_unittest::_TestAllTypes_default_instance_.oneof_enum_ = 0;
  540. }
  541. void TestAllTypes::clear_optional_proto2_message() {
  542. if (GetArenaNoVirtual() == NULL && optional_proto2_message_ != NULL) {
  543. delete optional_proto2_message_;
  544. }
  545. optional_proto2_message_ = NULL;
  546. }
  547. void TestAllTypes::clear_repeated_proto2_message() {
  548. repeated_proto2_message_.Clear();
  549. }
  550. void TestAllTypes::set_allocated_oneof_nested_message(::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* oneof_nested_message) {
  551. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  552. clear_oneof_field();
  553. if (oneof_nested_message) {
  554. ::google::protobuf::Arena* submessage_arena = NULL;
  555. if (message_arena != submessage_arena) {
  556. oneof_nested_message = ::google::protobuf::internal::GetOwnedMessage(
  557. message_arena, oneof_nested_message, submessage_arena);
  558. }
  559. set_has_oneof_nested_message();
  560. oneof_field_.oneof_nested_message_ = oneof_nested_message;
  561. }
  562. // @@protoc_insertion_point(field_set_allocated:proto2_nofieldpresence_unittest.TestAllTypes.oneof_nested_message)
  563. }
  564. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  565. const int TestAllTypes::kOptionalInt32FieldNumber;
  566. const int TestAllTypes::kOptionalInt64FieldNumber;
  567. const int TestAllTypes::kOptionalUint32FieldNumber;
  568. const int TestAllTypes::kOptionalUint64FieldNumber;
  569. const int TestAllTypes::kOptionalSint32FieldNumber;
  570. const int TestAllTypes::kOptionalSint64FieldNumber;
  571. const int TestAllTypes::kOptionalFixed32FieldNumber;
  572. const int TestAllTypes::kOptionalFixed64FieldNumber;
  573. const int TestAllTypes::kOptionalSfixed32FieldNumber;
  574. const int TestAllTypes::kOptionalSfixed64FieldNumber;
  575. const int TestAllTypes::kOptionalFloatFieldNumber;
  576. const int TestAllTypes::kOptionalDoubleFieldNumber;
  577. const int TestAllTypes::kOptionalBoolFieldNumber;
  578. const int TestAllTypes::kOptionalStringFieldNumber;
  579. const int TestAllTypes::kOptionalBytesFieldNumber;
  580. const int TestAllTypes::kOptionalNestedMessageFieldNumber;
  581. const int TestAllTypes::kOptionalForeignMessageFieldNumber;
  582. const int TestAllTypes::kOptionalProto2MessageFieldNumber;
  583. const int TestAllTypes::kOptionalNestedEnumFieldNumber;
  584. const int TestAllTypes::kOptionalForeignEnumFieldNumber;
  585. const int TestAllTypes::kOptionalStringPieceFieldNumber;
  586. const int TestAllTypes::kOptionalCordFieldNumber;
  587. const int TestAllTypes::kOptionalLazyMessageFieldNumber;
  588. const int TestAllTypes::kRepeatedInt32FieldNumber;
  589. const int TestAllTypes::kRepeatedInt64FieldNumber;
  590. const int TestAllTypes::kRepeatedUint32FieldNumber;
  591. const int TestAllTypes::kRepeatedUint64FieldNumber;
  592. const int TestAllTypes::kRepeatedSint32FieldNumber;
  593. const int TestAllTypes::kRepeatedSint64FieldNumber;
  594. const int TestAllTypes::kRepeatedFixed32FieldNumber;
  595. const int TestAllTypes::kRepeatedFixed64FieldNumber;
  596. const int TestAllTypes::kRepeatedSfixed32FieldNumber;
  597. const int TestAllTypes::kRepeatedSfixed64FieldNumber;
  598. const int TestAllTypes::kRepeatedFloatFieldNumber;
  599. const int TestAllTypes::kRepeatedDoubleFieldNumber;
  600. const int TestAllTypes::kRepeatedBoolFieldNumber;
  601. const int TestAllTypes::kRepeatedStringFieldNumber;
  602. const int TestAllTypes::kRepeatedBytesFieldNumber;
  603. const int TestAllTypes::kRepeatedNestedMessageFieldNumber;
  604. const int TestAllTypes::kRepeatedForeignMessageFieldNumber;
  605. const int TestAllTypes::kRepeatedProto2MessageFieldNumber;
  606. const int TestAllTypes::kRepeatedNestedEnumFieldNumber;
  607. const int TestAllTypes::kRepeatedForeignEnumFieldNumber;
  608. const int TestAllTypes::kRepeatedStringPieceFieldNumber;
  609. const int TestAllTypes::kRepeatedCordFieldNumber;
  610. const int TestAllTypes::kRepeatedLazyMessageFieldNumber;
  611. const int TestAllTypes::kOneofUint32FieldNumber;
  612. const int TestAllTypes::kOneofNestedMessageFieldNumber;
  613. const int TestAllTypes::kOneofStringFieldNumber;
  614. const int TestAllTypes::kOneofEnumFieldNumber;
  615. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  616. TestAllTypes::TestAllTypes()
  617. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  618. ::google::protobuf::internal::InitSCC(
  619. &protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_TestAllTypes.base);
  620. SharedCtor();
  621. // @@protoc_insertion_point(constructor:proto2_nofieldpresence_unittest.TestAllTypes)
  622. }
  623. TestAllTypes::TestAllTypes(const TestAllTypes& from)
  624. : ::google::protobuf::Message(),
  625. _internal_metadata_(NULL),
  626. repeated_int32_(from.repeated_int32_),
  627. repeated_int64_(from.repeated_int64_),
  628. repeated_uint32_(from.repeated_uint32_),
  629. repeated_uint64_(from.repeated_uint64_),
  630. repeated_sint32_(from.repeated_sint32_),
  631. repeated_sint64_(from.repeated_sint64_),
  632. repeated_fixed32_(from.repeated_fixed32_),
  633. repeated_fixed64_(from.repeated_fixed64_),
  634. repeated_sfixed32_(from.repeated_sfixed32_),
  635. repeated_sfixed64_(from.repeated_sfixed64_),
  636. repeated_float_(from.repeated_float_),
  637. repeated_double_(from.repeated_double_),
  638. repeated_bool_(from.repeated_bool_),
  639. repeated_string_(from.repeated_string_),
  640. repeated_bytes_(from.repeated_bytes_),
  641. repeated_nested_message_(from.repeated_nested_message_),
  642. repeated_foreign_message_(from.repeated_foreign_message_),
  643. repeated_proto2_message_(from.repeated_proto2_message_),
  644. repeated_nested_enum_(from.repeated_nested_enum_),
  645. repeated_foreign_enum_(from.repeated_foreign_enum_),
  646. repeated_string_piece_(from.repeated_string_piece_),
  647. repeated_cord_(from.repeated_cord_),
  648. repeated_lazy_message_(from.repeated_lazy_message_) {
  649. _internal_metadata_.MergeFrom(from._internal_metadata_);
  650. optional_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  651. if (from.optional_string().size() > 0) {
  652. optional_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_);
  653. }
  654. optional_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  655. if (from.optional_bytes().size() > 0) {
  656. optional_bytes_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_bytes_);
  657. }
  658. optional_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  659. if (from.optional_string_piece().size() > 0) {
  660. optional_string_piece_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_piece_);
  661. }
  662. optional_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  663. if (from.optional_cord().size() > 0) {
  664. optional_cord_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_cord_);
  665. }
  666. if (from.has_optional_nested_message()) {
  667. optional_nested_message_ = new ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage(*from.optional_nested_message_);
  668. } else {
  669. optional_nested_message_ = NULL;
  670. }
  671. if (from.has_optional_foreign_message()) {
  672. optional_foreign_message_ = new ::proto2_nofieldpresence_unittest::ForeignMessage(*from.optional_foreign_message_);
  673. } else {
  674. optional_foreign_message_ = NULL;
  675. }
  676. if (from.has_optional_proto2_message()) {
  677. optional_proto2_message_ = new ::protobuf_unittest::TestAllTypes(*from.optional_proto2_message_);
  678. } else {
  679. optional_proto2_message_ = NULL;
  680. }
  681. if (from.has_optional_lazy_message()) {
  682. optional_lazy_message_ = new ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage(*from.optional_lazy_message_);
  683. } else {
  684. optional_lazy_message_ = NULL;
  685. }
  686. ::memcpy(&optional_int64_, &from.optional_int64_,
  687. static_cast<size_t>(reinterpret_cast<char*>(&optional_foreign_enum_) -
  688. reinterpret_cast<char*>(&optional_int64_)) + sizeof(optional_foreign_enum_));
  689. clear_has_oneof_field();
  690. switch (from.oneof_field_case()) {
  691. case kOneofUint32: {
  692. set_oneof_uint32(from.oneof_uint32());
  693. break;
  694. }
  695. case kOneofNestedMessage: {
  696. mutable_oneof_nested_message()->::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::MergeFrom(from.oneof_nested_message());
  697. break;
  698. }
  699. case kOneofString: {
  700. set_oneof_string(from.oneof_string());
  701. break;
  702. }
  703. case kOneofEnum: {
  704. set_oneof_enum(from.oneof_enum());
  705. break;
  706. }
  707. case ONEOF_FIELD_NOT_SET: {
  708. break;
  709. }
  710. }
  711. // @@protoc_insertion_point(copy_constructor:proto2_nofieldpresence_unittest.TestAllTypes)
  712. }
  713. void TestAllTypes::SharedCtor() {
  714. optional_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  715. optional_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  716. optional_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  717. optional_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  718. ::memset(&optional_nested_message_, 0, static_cast<size_t>(
  719. reinterpret_cast<char*>(&optional_foreign_enum_) -
  720. reinterpret_cast<char*>(&optional_nested_message_)) + sizeof(optional_foreign_enum_));
  721. clear_has_oneof_field();
  722. }
  723. TestAllTypes::~TestAllTypes() {
  724. // @@protoc_insertion_point(destructor:proto2_nofieldpresence_unittest.TestAllTypes)
  725. SharedDtor();
  726. }
  727. void TestAllTypes::SharedDtor() {
  728. optional_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  729. optional_bytes_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  730. optional_string_piece_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  731. optional_cord_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  732. if (this != internal_default_instance()) delete optional_nested_message_;
  733. if (this != internal_default_instance()) delete optional_foreign_message_;
  734. if (this != internal_default_instance()) delete optional_proto2_message_;
  735. if (this != internal_default_instance()) delete optional_lazy_message_;
  736. if (has_oneof_field()) {
  737. clear_oneof_field();
  738. }
  739. }
  740. void TestAllTypes::SetCachedSize(int size) const {
  741. _cached_size_.Set(size);
  742. }
  743. const ::google::protobuf::Descriptor* TestAllTypes::descriptor() {
  744. ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  745. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  746. }
  747. const TestAllTypes& TestAllTypes::default_instance() {
  748. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_TestAllTypes.base);
  749. return *internal_default_instance();
  750. }
  751. void TestAllTypes::clear_oneof_field() {
  752. // @@protoc_insertion_point(one_of_clear_start:proto2_nofieldpresence_unittest.TestAllTypes)
  753. switch (oneof_field_case()) {
  754. case kOneofUint32: {
  755. // No need to clear
  756. break;
  757. }
  758. case kOneofNestedMessage: {
  759. delete oneof_field_.oneof_nested_message_;
  760. break;
  761. }
  762. case kOneofString: {
  763. oneof_field_.oneof_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  764. break;
  765. }
  766. case kOneofEnum: {
  767. // No need to clear
  768. break;
  769. }
  770. case ONEOF_FIELD_NOT_SET: {
  771. break;
  772. }
  773. }
  774. _oneof_case_[0] = ONEOF_FIELD_NOT_SET;
  775. }
  776. void TestAllTypes::Clear() {
  777. // @@protoc_insertion_point(message_clear_start:proto2_nofieldpresence_unittest.TestAllTypes)
  778. ::google::protobuf::uint32 cached_has_bits = 0;
  779. // Prevent compiler warnings about cached_has_bits being unused
  780. (void) cached_has_bits;
  781. repeated_int32_.Clear();
  782. repeated_int64_.Clear();
  783. repeated_uint32_.Clear();
  784. repeated_uint64_.Clear();
  785. repeated_sint32_.Clear();
  786. repeated_sint64_.Clear();
  787. repeated_fixed32_.Clear();
  788. repeated_fixed64_.Clear();
  789. repeated_sfixed32_.Clear();
  790. repeated_sfixed64_.Clear();
  791. repeated_float_.Clear();
  792. repeated_double_.Clear();
  793. repeated_bool_.Clear();
  794. repeated_string_.Clear();
  795. repeated_bytes_.Clear();
  796. repeated_nested_message_.Clear();
  797. repeated_foreign_message_.Clear();
  798. repeated_proto2_message_.Clear();
  799. repeated_nested_enum_.Clear();
  800. repeated_foreign_enum_.Clear();
  801. repeated_string_piece_.Clear();
  802. repeated_cord_.Clear();
  803. repeated_lazy_message_.Clear();
  804. optional_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  805. optional_bytes_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  806. optional_string_piece_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  807. optional_cord_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  808. if (GetArenaNoVirtual() == NULL && optional_nested_message_ != NULL) {
  809. delete optional_nested_message_;
  810. }
  811. optional_nested_message_ = NULL;
  812. if (GetArenaNoVirtual() == NULL && optional_foreign_message_ != NULL) {
  813. delete optional_foreign_message_;
  814. }
  815. optional_foreign_message_ = NULL;
  816. if (GetArenaNoVirtual() == NULL && optional_proto2_message_ != NULL) {
  817. delete optional_proto2_message_;
  818. }
  819. optional_proto2_message_ = NULL;
  820. if (GetArenaNoVirtual() == NULL && optional_lazy_message_ != NULL) {
  821. delete optional_lazy_message_;
  822. }
  823. optional_lazy_message_ = NULL;
  824. ::memset(&optional_int64_, 0, static_cast<size_t>(
  825. reinterpret_cast<char*>(&optional_foreign_enum_) -
  826. reinterpret_cast<char*>(&optional_int64_)) + sizeof(optional_foreign_enum_));
  827. clear_oneof_field();
  828. _internal_metadata_.Clear();
  829. }
  830. bool TestAllTypes::MergePartialFromCodedStream(
  831. ::google::protobuf::io::CodedInputStream* input) {
  832. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  833. ::google::protobuf::uint32 tag;
  834. // @@protoc_insertion_point(parse_start:proto2_nofieldpresence_unittest.TestAllTypes)
  835. for (;;) {
  836. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  837. tag = p.first;
  838. if (!p.second) goto handle_unusual;
  839. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  840. // int32 optional_int32 = 1;
  841. case 1: {
  842. if (static_cast< ::google::protobuf::uint8>(tag) ==
  843. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  844. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  845. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  846. input, &optional_int32_)));
  847. } else {
  848. goto handle_unusual;
  849. }
  850. break;
  851. }
  852. // int64 optional_int64 = 2;
  853. case 2: {
  854. if (static_cast< ::google::protobuf::uint8>(tag) ==
  855. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  856. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  857. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  858. input, &optional_int64_)));
  859. } else {
  860. goto handle_unusual;
  861. }
  862. break;
  863. }
  864. // uint32 optional_uint32 = 3;
  865. case 3: {
  866. if (static_cast< ::google::protobuf::uint8>(tag) ==
  867. static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
  868. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  869. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  870. input, &optional_uint32_)));
  871. } else {
  872. goto handle_unusual;
  873. }
  874. break;
  875. }
  876. // uint64 optional_uint64 = 4;
  877. case 4: {
  878. if (static_cast< ::google::protobuf::uint8>(tag) ==
  879. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  880. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  881. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  882. input, &optional_uint64_)));
  883. } else {
  884. goto handle_unusual;
  885. }
  886. break;
  887. }
  888. // sint32 optional_sint32 = 5;
  889. case 5: {
  890. if (static_cast< ::google::protobuf::uint8>(tag) ==
  891. static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  892. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  893. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  894. input, &optional_sint32_)));
  895. } else {
  896. goto handle_unusual;
  897. }
  898. break;
  899. }
  900. // sint64 optional_sint64 = 6;
  901. case 6: {
  902. if (static_cast< ::google::protobuf::uint8>(tag) ==
  903. static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
  904. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  905. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  906. input, &optional_sint64_)));
  907. } else {
  908. goto handle_unusual;
  909. }
  910. break;
  911. }
  912. // fixed32 optional_fixed32 = 7;
  913. case 7: {
  914. if (static_cast< ::google::protobuf::uint8>(tag) ==
  915. static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
  916. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  917. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  918. input, &optional_fixed32_)));
  919. } else {
  920. goto handle_unusual;
  921. }
  922. break;
  923. }
  924. // fixed64 optional_fixed64 = 8;
  925. case 8: {
  926. if (static_cast< ::google::protobuf::uint8>(tag) ==
  927. static_cast< ::google::protobuf::uint8>(65u /* 65 & 0xFF */)) {
  928. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  929. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  930. input, &optional_fixed64_)));
  931. } else {
  932. goto handle_unusual;
  933. }
  934. break;
  935. }
  936. // sfixed32 optional_sfixed32 = 9;
  937. case 9: {
  938. if (static_cast< ::google::protobuf::uint8>(tag) ==
  939. static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
  940. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  941. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  942. input, &optional_sfixed32_)));
  943. } else {
  944. goto handle_unusual;
  945. }
  946. break;
  947. }
  948. // sfixed64 optional_sfixed64 = 10;
  949. case 10: {
  950. if (static_cast< ::google::protobuf::uint8>(tag) ==
  951. static_cast< ::google::protobuf::uint8>(81u /* 81 & 0xFF */)) {
  952. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  953. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  954. input, &optional_sfixed64_)));
  955. } else {
  956. goto handle_unusual;
  957. }
  958. break;
  959. }
  960. // float optional_float = 11;
  961. case 11: {
  962. if (static_cast< ::google::protobuf::uint8>(tag) ==
  963. static_cast< ::google::protobuf::uint8>(93u /* 93 & 0xFF */)) {
  964. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  965. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  966. input, &optional_float_)));
  967. } else {
  968. goto handle_unusual;
  969. }
  970. break;
  971. }
  972. // double optional_double = 12;
  973. case 12: {
  974. if (static_cast< ::google::protobuf::uint8>(tag) ==
  975. static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) {
  976. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  977. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  978. input, &optional_double_)));
  979. } else {
  980. goto handle_unusual;
  981. }
  982. break;
  983. }
  984. // bool optional_bool = 13;
  985. case 13: {
  986. if (static_cast< ::google::protobuf::uint8>(tag) ==
  987. static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
  988. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  989. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  990. input, &optional_bool_)));
  991. } else {
  992. goto handle_unusual;
  993. }
  994. break;
  995. }
  996. // string optional_string = 14;
  997. case 14: {
  998. if (static_cast< ::google::protobuf::uint8>(tag) ==
  999. static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
  1000. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1001. input, this->mutable_optional_string()));
  1002. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1003. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  1004. ::google::protobuf::internal::WireFormatLite::PARSE,
  1005. "proto2_nofieldpresence_unittest.TestAllTypes.optional_string"));
  1006. } else {
  1007. goto handle_unusual;
  1008. }
  1009. break;
  1010. }
  1011. // bytes optional_bytes = 15;
  1012. case 15: {
  1013. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1014. static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) {
  1015. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  1016. input, this->mutable_optional_bytes()));
  1017. } else {
  1018. goto handle_unusual;
  1019. }
  1020. break;
  1021. }
  1022. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  1023. case 18: {
  1024. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1025. static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) {
  1026. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1027. input, mutable_optional_nested_message()));
  1028. } else {
  1029. goto handle_unusual;
  1030. }
  1031. break;
  1032. }
  1033. // .proto2_nofieldpresence_unittest.ForeignMessage optional_foreign_message = 19;
  1034. case 19: {
  1035. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1036. static_cast< ::google::protobuf::uint8>(154u /* 154 & 0xFF */)) {
  1037. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1038. input, mutable_optional_foreign_message()));
  1039. } else {
  1040. goto handle_unusual;
  1041. }
  1042. break;
  1043. }
  1044. // .protobuf_unittest.TestAllTypes optional_proto2_message = 20;
  1045. case 20: {
  1046. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1047. static_cast< ::google::protobuf::uint8>(162u /* 162 & 0xFF */)) {
  1048. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1049. input, mutable_optional_proto2_message()));
  1050. } else {
  1051. goto handle_unusual;
  1052. }
  1053. break;
  1054. }
  1055. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  1056. case 21: {
  1057. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1058. static_cast< ::google::protobuf::uint8>(168u /* 168 & 0xFF */)) {
  1059. int value;
  1060. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1061. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1062. input, &value)));
  1063. set_optional_nested_enum(static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(value));
  1064. } else {
  1065. goto handle_unusual;
  1066. }
  1067. break;
  1068. }
  1069. // .proto2_nofieldpresence_unittest.ForeignEnum optional_foreign_enum = 22;
  1070. case 22: {
  1071. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1072. static_cast< ::google::protobuf::uint8>(176u /* 176 & 0xFF */)) {
  1073. int value;
  1074. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1075. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1076. input, &value)));
  1077. set_optional_foreign_enum(static_cast< ::proto2_nofieldpresence_unittest::ForeignEnum >(value));
  1078. } else {
  1079. goto handle_unusual;
  1080. }
  1081. break;
  1082. }
  1083. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  1084. case 24: {
  1085. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1086. static_cast< ::google::protobuf::uint8>(194u /* 194 & 0xFF */)) {
  1087. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1088. input, this->mutable_optional_string_piece()));
  1089. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1090. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  1091. ::google::protobuf::internal::WireFormatLite::PARSE,
  1092. "proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece"));
  1093. } else {
  1094. goto handle_unusual;
  1095. }
  1096. break;
  1097. }
  1098. // string optional_cord = 25 [ctype = CORD];
  1099. case 25: {
  1100. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1101. static_cast< ::google::protobuf::uint8>(202u /* 202 & 0xFF */)) {
  1102. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1103. input, this->mutable_optional_cord()));
  1104. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1105. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  1106. ::google::protobuf::internal::WireFormatLite::PARSE,
  1107. "proto2_nofieldpresence_unittest.TestAllTypes.optional_cord"));
  1108. } else {
  1109. goto handle_unusual;
  1110. }
  1111. break;
  1112. }
  1113. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_lazy_message = 30 [lazy = true];
  1114. case 30: {
  1115. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1116. static_cast< ::google::protobuf::uint8>(242u /* 242 & 0xFF */)) {
  1117. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1118. input, mutable_optional_lazy_message()));
  1119. } else {
  1120. goto handle_unusual;
  1121. }
  1122. break;
  1123. }
  1124. // repeated int32 repeated_int32 = 31;
  1125. case 31: {
  1126. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1127. static_cast< ::google::protobuf::uint8>(250u /* 250 & 0xFF */)) {
  1128. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1129. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1130. input, this->mutable_repeated_int32())));
  1131. } else if (
  1132. static_cast< ::google::protobuf::uint8>(tag) ==
  1133. static_cast< ::google::protobuf::uint8>(248u /* 248 & 0xFF */)) {
  1134. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1135. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1136. 2, 250u, input, this->mutable_repeated_int32())));
  1137. } else {
  1138. goto handle_unusual;
  1139. }
  1140. break;
  1141. }
  1142. // repeated int64 repeated_int64 = 32;
  1143. case 32: {
  1144. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1145. static_cast< ::google::protobuf::uint8>(2u /* 258 & 0xFF */)) {
  1146. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1147. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  1148. input, this->mutable_repeated_int64())));
  1149. } else if (
  1150. static_cast< ::google::protobuf::uint8>(tag) ==
  1151. static_cast< ::google::protobuf::uint8>(0u /* 256 & 0xFF */)) {
  1152. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1153. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  1154. 2, 258u, input, this->mutable_repeated_int64())));
  1155. } else {
  1156. goto handle_unusual;
  1157. }
  1158. break;
  1159. }
  1160. // repeated uint32 repeated_uint32 = 33;
  1161. case 33: {
  1162. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1163. static_cast< ::google::protobuf::uint8>(10u /* 266 & 0xFF */)) {
  1164. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1165. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1166. input, this->mutable_repeated_uint32())));
  1167. } else if (
  1168. static_cast< ::google::protobuf::uint8>(tag) ==
  1169. static_cast< ::google::protobuf::uint8>(8u /* 264 & 0xFF */)) {
  1170. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1171. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1172. 2, 266u, input, this->mutable_repeated_uint32())));
  1173. } else {
  1174. goto handle_unusual;
  1175. }
  1176. break;
  1177. }
  1178. // repeated uint64 repeated_uint64 = 34;
  1179. case 34: {
  1180. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1181. static_cast< ::google::protobuf::uint8>(18u /* 274 & 0xFF */)) {
  1182. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1183. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  1184. input, this->mutable_repeated_uint64())));
  1185. } else if (
  1186. static_cast< ::google::protobuf::uint8>(tag) ==
  1187. static_cast< ::google::protobuf::uint8>(16u /* 272 & 0xFF */)) {
  1188. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1189. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  1190. 2, 274u, input, this->mutable_repeated_uint64())));
  1191. } else {
  1192. goto handle_unusual;
  1193. }
  1194. break;
  1195. }
  1196. // repeated sint32 repeated_sint32 = 35;
  1197. case 35: {
  1198. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1199. static_cast< ::google::protobuf::uint8>(26u /* 282 & 0xFF */)) {
  1200. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1201. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  1202. input, this->mutable_repeated_sint32())));
  1203. } else if (
  1204. static_cast< ::google::protobuf::uint8>(tag) ==
  1205. static_cast< ::google::protobuf::uint8>(24u /* 280 & 0xFF */)) {
  1206. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1207. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  1208. 2, 282u, input, this->mutable_repeated_sint32())));
  1209. } else {
  1210. goto handle_unusual;
  1211. }
  1212. break;
  1213. }
  1214. // repeated sint64 repeated_sint64 = 36;
  1215. case 36: {
  1216. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1217. static_cast< ::google::protobuf::uint8>(34u /* 290 & 0xFF */)) {
  1218. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1219. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  1220. input, this->mutable_repeated_sint64())));
  1221. } else if (
  1222. static_cast< ::google::protobuf::uint8>(tag) ==
  1223. static_cast< ::google::protobuf::uint8>(32u /* 288 & 0xFF */)) {
  1224. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1225. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  1226. 2, 290u, input, this->mutable_repeated_sint64())));
  1227. } else {
  1228. goto handle_unusual;
  1229. }
  1230. break;
  1231. }
  1232. // repeated fixed32 repeated_fixed32 = 37;
  1233. case 37: {
  1234. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1235. static_cast< ::google::protobuf::uint8>(42u /* 298 & 0xFF */)) {
  1236. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1237. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  1238. input, this->mutable_repeated_fixed32())));
  1239. } else if (
  1240. static_cast< ::google::protobuf::uint8>(tag) ==
  1241. static_cast< ::google::protobuf::uint8>(45u /* 301 & 0xFF */)) {
  1242. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1243. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  1244. 2, 298u, input, this->mutable_repeated_fixed32())));
  1245. } else {
  1246. goto handle_unusual;
  1247. }
  1248. break;
  1249. }
  1250. // repeated fixed64 repeated_fixed64 = 38;
  1251. case 38: {
  1252. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1253. static_cast< ::google::protobuf::uint8>(50u /* 306 & 0xFF */)) {
  1254. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1255. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  1256. input, this->mutable_repeated_fixed64())));
  1257. } else if (
  1258. static_cast< ::google::protobuf::uint8>(tag) ==
  1259. static_cast< ::google::protobuf::uint8>(49u /* 305 & 0xFF */)) {
  1260. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1261. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  1262. 2, 306u, input, this->mutable_repeated_fixed64())));
  1263. } else {
  1264. goto handle_unusual;
  1265. }
  1266. break;
  1267. }
  1268. // repeated sfixed32 repeated_sfixed32 = 39;
  1269. case 39: {
  1270. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1271. static_cast< ::google::protobuf::uint8>(58u /* 314 & 0xFF */)) {
  1272. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1273. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  1274. input, this->mutable_repeated_sfixed32())));
  1275. } else if (
  1276. static_cast< ::google::protobuf::uint8>(tag) ==
  1277. static_cast< ::google::protobuf::uint8>(61u /* 317 & 0xFF */)) {
  1278. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1279. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  1280. 2, 314u, input, this->mutable_repeated_sfixed32())));
  1281. } else {
  1282. goto handle_unusual;
  1283. }
  1284. break;
  1285. }
  1286. // repeated sfixed64 repeated_sfixed64 = 40;
  1287. case 40: {
  1288. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1289. static_cast< ::google::protobuf::uint8>(66u /* 322 & 0xFF */)) {
  1290. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1291. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  1292. input, this->mutable_repeated_sfixed64())));
  1293. } else if (
  1294. static_cast< ::google::protobuf::uint8>(tag) ==
  1295. static_cast< ::google::protobuf::uint8>(65u /* 321 & 0xFF */)) {
  1296. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1297. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  1298. 2, 322u, input, this->mutable_repeated_sfixed64())));
  1299. } else {
  1300. goto handle_unusual;
  1301. }
  1302. break;
  1303. }
  1304. // repeated float repeated_float = 41;
  1305. case 41: {
  1306. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1307. static_cast< ::google::protobuf::uint8>(74u /* 330 & 0xFF */)) {
  1308. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1309. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  1310. input, this->mutable_repeated_float())));
  1311. } else if (
  1312. static_cast< ::google::protobuf::uint8>(tag) ==
  1313. static_cast< ::google::protobuf::uint8>(77u /* 333 & 0xFF */)) {
  1314. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1315. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  1316. 2, 330u, input, this->mutable_repeated_float())));
  1317. } else {
  1318. goto handle_unusual;
  1319. }
  1320. break;
  1321. }
  1322. // repeated double repeated_double = 42;
  1323. case 42: {
  1324. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1325. static_cast< ::google::protobuf::uint8>(82u /* 338 & 0xFF */)) {
  1326. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1327. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  1328. input, this->mutable_repeated_double())));
  1329. } else if (
  1330. static_cast< ::google::protobuf::uint8>(tag) ==
  1331. static_cast< ::google::protobuf::uint8>(81u /* 337 & 0xFF */)) {
  1332. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1333. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  1334. 2, 338u, input, this->mutable_repeated_double())));
  1335. } else {
  1336. goto handle_unusual;
  1337. }
  1338. break;
  1339. }
  1340. // repeated bool repeated_bool = 43;
  1341. case 43: {
  1342. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1343. static_cast< ::google::protobuf::uint8>(90u /* 346 & 0xFF */)) {
  1344. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1345. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  1346. input, this->mutable_repeated_bool())));
  1347. } else if (
  1348. static_cast< ::google::protobuf::uint8>(tag) ==
  1349. static_cast< ::google::protobuf::uint8>(88u /* 344 & 0xFF */)) {
  1350. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1351. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  1352. 2, 346u, input, this->mutable_repeated_bool())));
  1353. } else {
  1354. goto handle_unusual;
  1355. }
  1356. break;
  1357. }
  1358. // repeated string repeated_string = 44;
  1359. case 44: {
  1360. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1361. static_cast< ::google::protobuf::uint8>(98u /* 354 & 0xFF */)) {
  1362. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1363. input, this->add_repeated_string()));
  1364. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1365. this->repeated_string(this->repeated_string_size() - 1).data(),
  1366. static_cast<int>(this->repeated_string(this->repeated_string_size() - 1).length()),
  1367. ::google::protobuf::internal::WireFormatLite::PARSE,
  1368. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_string"));
  1369. } else {
  1370. goto handle_unusual;
  1371. }
  1372. break;
  1373. }
  1374. // repeated bytes repeated_bytes = 45;
  1375. case 45: {
  1376. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1377. static_cast< ::google::protobuf::uint8>(106u /* 362 & 0xFF */)) {
  1378. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  1379. input, this->add_repeated_bytes()));
  1380. } else {
  1381. goto handle_unusual;
  1382. }
  1383. break;
  1384. }
  1385. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  1386. case 48: {
  1387. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1388. static_cast< ::google::protobuf::uint8>(130u /* 386 & 0xFF */)) {
  1389. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1390. input, add_repeated_nested_message()));
  1391. } else {
  1392. goto handle_unusual;
  1393. }
  1394. break;
  1395. }
  1396. // repeated .proto2_nofieldpresence_unittest.ForeignMessage repeated_foreign_message = 49;
  1397. case 49: {
  1398. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1399. static_cast< ::google::protobuf::uint8>(138u /* 394 & 0xFF */)) {
  1400. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1401. input, add_repeated_foreign_message()));
  1402. } else {
  1403. goto handle_unusual;
  1404. }
  1405. break;
  1406. }
  1407. // repeated .protobuf_unittest.TestAllTypes repeated_proto2_message = 50;
  1408. case 50: {
  1409. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1410. static_cast< ::google::protobuf::uint8>(146u /* 402 & 0xFF */)) {
  1411. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1412. input, add_repeated_proto2_message()));
  1413. } else {
  1414. goto handle_unusual;
  1415. }
  1416. break;
  1417. }
  1418. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  1419. case 51: {
  1420. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1421. static_cast< ::google::protobuf::uint8>(154u /* 410 & 0xFF */)) {
  1422. ::google::protobuf::uint32 length;
  1423. DO_(input->ReadVarint32(&length));
  1424. ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
  1425. while (input->BytesUntilLimit() > 0) {
  1426. int value;
  1427. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1428. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1429. input, &value)));
  1430. add_repeated_nested_enum(static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(value));
  1431. }
  1432. input->PopLimit(limit);
  1433. } else if (
  1434. static_cast< ::google::protobuf::uint8>(tag) ==
  1435. static_cast< ::google::protobuf::uint8>(152u /* 408 & 0xFF */)) {
  1436. int value;
  1437. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1438. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1439. input, &value)));
  1440. add_repeated_nested_enum(static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(value));
  1441. } else {
  1442. goto handle_unusual;
  1443. }
  1444. break;
  1445. }
  1446. // repeated .proto2_nofieldpresence_unittest.ForeignEnum repeated_foreign_enum = 52;
  1447. case 52: {
  1448. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1449. static_cast< ::google::protobuf::uint8>(162u /* 418 & 0xFF */)) {
  1450. ::google::protobuf::uint32 length;
  1451. DO_(input->ReadVarint32(&length));
  1452. ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
  1453. while (input->BytesUntilLimit() > 0) {
  1454. int value;
  1455. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1456. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1457. input, &value)));
  1458. add_repeated_foreign_enum(static_cast< ::proto2_nofieldpresence_unittest::ForeignEnum >(value));
  1459. }
  1460. input->PopLimit(limit);
  1461. } else if (
  1462. static_cast< ::google::protobuf::uint8>(tag) ==
  1463. static_cast< ::google::protobuf::uint8>(160u /* 416 & 0xFF */)) {
  1464. int value;
  1465. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1466. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1467. input, &value)));
  1468. add_repeated_foreign_enum(static_cast< ::proto2_nofieldpresence_unittest::ForeignEnum >(value));
  1469. } else {
  1470. goto handle_unusual;
  1471. }
  1472. break;
  1473. }
  1474. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  1475. case 54: {
  1476. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1477. static_cast< ::google::protobuf::uint8>(178u /* 434 & 0xFF */)) {
  1478. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1479. input, this->add_repeated_string_piece()));
  1480. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1481. this->repeated_string_piece(this->repeated_string_piece_size() - 1).data(),
  1482. static_cast<int>(this->repeated_string_piece(this->repeated_string_piece_size() - 1).length()),
  1483. ::google::protobuf::internal::WireFormatLite::PARSE,
  1484. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece"));
  1485. } else {
  1486. goto handle_unusual;
  1487. }
  1488. break;
  1489. }
  1490. // repeated string repeated_cord = 55 [ctype = CORD];
  1491. case 55: {
  1492. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1493. static_cast< ::google::protobuf::uint8>(186u /* 442 & 0xFF */)) {
  1494. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1495. input, this->add_repeated_cord()));
  1496. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1497. this->repeated_cord(this->repeated_cord_size() - 1).data(),
  1498. static_cast<int>(this->repeated_cord(this->repeated_cord_size() - 1).length()),
  1499. ::google::protobuf::internal::WireFormatLite::PARSE,
  1500. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord"));
  1501. } else {
  1502. goto handle_unusual;
  1503. }
  1504. break;
  1505. }
  1506. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  1507. case 57: {
  1508. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1509. static_cast< ::google::protobuf::uint8>(202u /* 458 & 0xFF */)) {
  1510. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1511. input, add_repeated_lazy_message()));
  1512. } else {
  1513. goto handle_unusual;
  1514. }
  1515. break;
  1516. }
  1517. // uint32 oneof_uint32 = 111;
  1518. case 111: {
  1519. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1520. static_cast< ::google::protobuf::uint8>(120u /* 888 & 0xFF */)) {
  1521. clear_oneof_field();
  1522. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1523. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1524. input, &oneof_field_.oneof_uint32_)));
  1525. set_has_oneof_uint32();
  1526. } else {
  1527. goto handle_unusual;
  1528. }
  1529. break;
  1530. }
  1531. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  1532. case 112: {
  1533. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1534. static_cast< ::google::protobuf::uint8>(130u /* 898 & 0xFF */)) {
  1535. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1536. input, mutable_oneof_nested_message()));
  1537. } else {
  1538. goto handle_unusual;
  1539. }
  1540. break;
  1541. }
  1542. // string oneof_string = 113;
  1543. case 113: {
  1544. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1545. static_cast< ::google::protobuf::uint8>(138u /* 906 & 0xFF */)) {
  1546. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1547. input, this->mutable_oneof_string()));
  1548. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1549. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  1550. ::google::protobuf::internal::WireFormatLite::PARSE,
  1551. "proto2_nofieldpresence_unittest.TestAllTypes.oneof_string"));
  1552. } else {
  1553. goto handle_unusual;
  1554. }
  1555. break;
  1556. }
  1557. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum oneof_enum = 114;
  1558. case 114: {
  1559. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1560. static_cast< ::google::protobuf::uint8>(144u /* 912 & 0xFF */)) {
  1561. int value;
  1562. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1563. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1564. input, &value)));
  1565. set_oneof_enum(static_cast< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedEnum >(value));
  1566. } else {
  1567. goto handle_unusual;
  1568. }
  1569. break;
  1570. }
  1571. default: {
  1572. handle_unusual:
  1573. if (tag == 0) {
  1574. goto success;
  1575. }
  1576. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1577. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1578. break;
  1579. }
  1580. }
  1581. }
  1582. success:
  1583. // @@protoc_insertion_point(parse_success:proto2_nofieldpresence_unittest.TestAllTypes)
  1584. return true;
  1585. failure:
  1586. // @@protoc_insertion_point(parse_failure:proto2_nofieldpresence_unittest.TestAllTypes)
  1587. return false;
  1588. #undef DO_
  1589. }
  1590. void TestAllTypes::SerializeWithCachedSizes(
  1591. ::google::protobuf::io::CodedOutputStream* output) const {
  1592. // @@protoc_insertion_point(serialize_start:proto2_nofieldpresence_unittest.TestAllTypes)
  1593. ::google::protobuf::uint32 cached_has_bits = 0;
  1594. (void) cached_has_bits;
  1595. // int32 optional_int32 = 1;
  1596. if (this->optional_int32() != 0) {
  1597. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->optional_int32(), output);
  1598. }
  1599. // int64 optional_int64 = 2;
  1600. if (this->optional_int64() != 0) {
  1601. ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->optional_int64(), output);
  1602. }
  1603. // uint32 optional_uint32 = 3;
  1604. if (this->optional_uint32() != 0) {
  1605. ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->optional_uint32(), output);
  1606. }
  1607. // uint64 optional_uint64 = 4;
  1608. if (this->optional_uint64() != 0) {
  1609. ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->optional_uint64(), output);
  1610. }
  1611. // sint32 optional_sint32 = 5;
  1612. if (this->optional_sint32() != 0) {
  1613. ::google::protobuf::internal::WireFormatLite::WriteSInt32(5, this->optional_sint32(), output);
  1614. }
  1615. // sint64 optional_sint64 = 6;
  1616. if (this->optional_sint64() != 0) {
  1617. ::google::protobuf::internal::WireFormatLite::WriteSInt64(6, this->optional_sint64(), output);
  1618. }
  1619. // fixed32 optional_fixed32 = 7;
  1620. if (this->optional_fixed32() != 0) {
  1621. ::google::protobuf::internal::WireFormatLite::WriteFixed32(7, this->optional_fixed32(), output);
  1622. }
  1623. // fixed64 optional_fixed64 = 8;
  1624. if (this->optional_fixed64() != 0) {
  1625. ::google::protobuf::internal::WireFormatLite::WriteFixed64(8, this->optional_fixed64(), output);
  1626. }
  1627. // sfixed32 optional_sfixed32 = 9;
  1628. if (this->optional_sfixed32() != 0) {
  1629. ::google::protobuf::internal::WireFormatLite::WriteSFixed32(9, this->optional_sfixed32(), output);
  1630. }
  1631. // sfixed64 optional_sfixed64 = 10;
  1632. if (this->optional_sfixed64() != 0) {
  1633. ::google::protobuf::internal::WireFormatLite::WriteSFixed64(10, this->optional_sfixed64(), output);
  1634. }
  1635. // float optional_float = 11;
  1636. if (this->optional_float() != 0) {
  1637. ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->optional_float(), output);
  1638. }
  1639. // double optional_double = 12;
  1640. if (this->optional_double() != 0) {
  1641. ::google::protobuf::internal::WireFormatLite::WriteDouble(12, this->optional_double(), output);
  1642. }
  1643. // bool optional_bool = 13;
  1644. if (this->optional_bool() != 0) {
  1645. ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->optional_bool(), output);
  1646. }
  1647. // string optional_string = 14;
  1648. if (this->optional_string().size() > 0) {
  1649. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1650. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  1651. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1652. "proto2_nofieldpresence_unittest.TestAllTypes.optional_string");
  1653. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1654. 14, this->optional_string(), output);
  1655. }
  1656. // bytes optional_bytes = 15;
  1657. if (this->optional_bytes().size() > 0) {
  1658. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  1659. 15, this->optional_bytes(), output);
  1660. }
  1661. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  1662. if (this->has_optional_nested_message()) {
  1663. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1664. 18, this->_internal_optional_nested_message(), output);
  1665. }
  1666. // .proto2_nofieldpresence_unittest.ForeignMessage optional_foreign_message = 19;
  1667. if (this->has_optional_foreign_message()) {
  1668. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1669. 19, this->_internal_optional_foreign_message(), output);
  1670. }
  1671. // .protobuf_unittest.TestAllTypes optional_proto2_message = 20;
  1672. if (this->has_optional_proto2_message()) {
  1673. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1674. 20, this->_internal_optional_proto2_message(), output);
  1675. }
  1676. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  1677. if (this->optional_nested_enum() != 0) {
  1678. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  1679. 21, this->optional_nested_enum(), output);
  1680. }
  1681. // .proto2_nofieldpresence_unittest.ForeignEnum optional_foreign_enum = 22;
  1682. if (this->optional_foreign_enum() != 0) {
  1683. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  1684. 22, this->optional_foreign_enum(), output);
  1685. }
  1686. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  1687. if (this->optional_string_piece().size() > 0) {
  1688. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1689. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  1690. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1691. "proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece");
  1692. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1693. 24, this->optional_string_piece(), output);
  1694. }
  1695. // string optional_cord = 25 [ctype = CORD];
  1696. if (this->optional_cord().size() > 0) {
  1697. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1698. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  1699. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1700. "proto2_nofieldpresence_unittest.TestAllTypes.optional_cord");
  1701. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1702. 25, this->optional_cord(), output);
  1703. }
  1704. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_lazy_message = 30 [lazy = true];
  1705. if (this->has_optional_lazy_message()) {
  1706. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1707. 30, this->_internal_optional_lazy_message(), output);
  1708. }
  1709. // repeated int32 repeated_int32 = 31;
  1710. if (this->repeated_int32_size() > 0) {
  1711. ::google::protobuf::internal::WireFormatLite::WriteTag(31, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1712. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1713. _repeated_int32_cached_byte_size_));
  1714. }
  1715. for (int i = 0, n = this->repeated_int32_size(); i < n; i++) {
  1716. ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
  1717. this->repeated_int32(i), output);
  1718. }
  1719. // repeated int64 repeated_int64 = 32;
  1720. if (this->repeated_int64_size() > 0) {
  1721. ::google::protobuf::internal::WireFormatLite::WriteTag(32, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1722. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1723. _repeated_int64_cached_byte_size_));
  1724. }
  1725. for (int i = 0, n = this->repeated_int64_size(); i < n; i++) {
  1726. ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
  1727. this->repeated_int64(i), output);
  1728. }
  1729. // repeated uint32 repeated_uint32 = 33;
  1730. if (this->repeated_uint32_size() > 0) {
  1731. ::google::protobuf::internal::WireFormatLite::WriteTag(33, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1732. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1733. _repeated_uint32_cached_byte_size_));
  1734. }
  1735. for (int i = 0, n = this->repeated_uint32_size(); i < n; i++) {
  1736. ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
  1737. this->repeated_uint32(i), output);
  1738. }
  1739. // repeated uint64 repeated_uint64 = 34;
  1740. if (this->repeated_uint64_size() > 0) {
  1741. ::google::protobuf::internal::WireFormatLite::WriteTag(34, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1742. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1743. _repeated_uint64_cached_byte_size_));
  1744. }
  1745. for (int i = 0, n = this->repeated_uint64_size(); i < n; i++) {
  1746. ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag(
  1747. this->repeated_uint64(i), output);
  1748. }
  1749. // repeated sint32 repeated_sint32 = 35;
  1750. if (this->repeated_sint32_size() > 0) {
  1751. ::google::protobuf::internal::WireFormatLite::WriteTag(35, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1752. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1753. _repeated_sint32_cached_byte_size_));
  1754. }
  1755. for (int i = 0, n = this->repeated_sint32_size(); i < n; i++) {
  1756. ::google::protobuf::internal::WireFormatLite::WriteSInt32NoTag(
  1757. this->repeated_sint32(i), output);
  1758. }
  1759. // repeated sint64 repeated_sint64 = 36;
  1760. if (this->repeated_sint64_size() > 0) {
  1761. ::google::protobuf::internal::WireFormatLite::WriteTag(36, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1762. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1763. _repeated_sint64_cached_byte_size_));
  1764. }
  1765. for (int i = 0, n = this->repeated_sint64_size(); i < n; i++) {
  1766. ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
  1767. this->repeated_sint64(i), output);
  1768. }
  1769. // repeated fixed32 repeated_fixed32 = 37;
  1770. if (this->repeated_fixed32_size() > 0) {
  1771. ::google::protobuf::internal::WireFormatLite::WriteTag(37, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1772. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1773. _repeated_fixed32_cached_byte_size_));
  1774. ::google::protobuf::internal::WireFormatLite::WriteFixed32Array(
  1775. this->repeated_fixed32().data(), this->repeated_fixed32_size(), output);
  1776. }
  1777. // repeated fixed64 repeated_fixed64 = 38;
  1778. if (this->repeated_fixed64_size() > 0) {
  1779. ::google::protobuf::internal::WireFormatLite::WriteTag(38, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1780. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1781. _repeated_fixed64_cached_byte_size_));
  1782. ::google::protobuf::internal::WireFormatLite::WriteFixed64Array(
  1783. this->repeated_fixed64().data(), this->repeated_fixed64_size(), output);
  1784. }
  1785. // repeated sfixed32 repeated_sfixed32 = 39;
  1786. if (this->repeated_sfixed32_size() > 0) {
  1787. ::google::protobuf::internal::WireFormatLite::WriteTag(39, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1788. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1789. _repeated_sfixed32_cached_byte_size_));
  1790. ::google::protobuf::internal::WireFormatLite::WriteSFixed32Array(
  1791. this->repeated_sfixed32().data(), this->repeated_sfixed32_size(), output);
  1792. }
  1793. // repeated sfixed64 repeated_sfixed64 = 40;
  1794. if (this->repeated_sfixed64_size() > 0) {
  1795. ::google::protobuf::internal::WireFormatLite::WriteTag(40, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1796. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1797. _repeated_sfixed64_cached_byte_size_));
  1798. ::google::protobuf::internal::WireFormatLite::WriteSFixed64Array(
  1799. this->repeated_sfixed64().data(), this->repeated_sfixed64_size(), output);
  1800. }
  1801. // repeated float repeated_float = 41;
  1802. if (this->repeated_float_size() > 0) {
  1803. ::google::protobuf::internal::WireFormatLite::WriteTag(41, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1804. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1805. _repeated_float_cached_byte_size_));
  1806. ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
  1807. this->repeated_float().data(), this->repeated_float_size(), output);
  1808. }
  1809. // repeated double repeated_double = 42;
  1810. if (this->repeated_double_size() > 0) {
  1811. ::google::protobuf::internal::WireFormatLite::WriteTag(42, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1812. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1813. _repeated_double_cached_byte_size_));
  1814. ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
  1815. this->repeated_double().data(), this->repeated_double_size(), output);
  1816. }
  1817. // repeated bool repeated_bool = 43;
  1818. if (this->repeated_bool_size() > 0) {
  1819. ::google::protobuf::internal::WireFormatLite::WriteTag(43, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  1820. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  1821. _repeated_bool_cached_byte_size_));
  1822. ::google::protobuf::internal::WireFormatLite::WriteBoolArray(
  1823. this->repeated_bool().data(), this->repeated_bool_size(), output);
  1824. }
  1825. // repeated string repeated_string = 44;
  1826. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  1827. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1828. this->repeated_string(i).data(), static_cast<int>(this->repeated_string(i).length()),
  1829. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1830. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_string");
  1831. ::google::protobuf::internal::WireFormatLite::WriteString(
  1832. 44, this->repeated_string(i), output);
  1833. }
  1834. // repeated bytes repeated_bytes = 45;
  1835. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  1836. ::google::protobuf::internal::WireFormatLite::WriteBytes(
  1837. 45, this->repeated_bytes(i), output);
  1838. }
  1839. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  1840. for (unsigned int i = 0,
  1841. n = static_cast<unsigned int>(this->repeated_nested_message_size()); i < n; i++) {
  1842. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1843. 48,
  1844. this->repeated_nested_message(static_cast<int>(i)),
  1845. output);
  1846. }
  1847. // repeated .proto2_nofieldpresence_unittest.ForeignMessage repeated_foreign_message = 49;
  1848. for (unsigned int i = 0,
  1849. n = static_cast<unsigned int>(this->repeated_foreign_message_size()); i < n; i++) {
  1850. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1851. 49,
  1852. this->repeated_foreign_message(static_cast<int>(i)),
  1853. output);
  1854. }
  1855. // repeated .protobuf_unittest.TestAllTypes repeated_proto2_message = 50;
  1856. for (unsigned int i = 0,
  1857. n = static_cast<unsigned int>(this->repeated_proto2_message_size()); i < n; i++) {
  1858. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1859. 50,
  1860. this->repeated_proto2_message(static_cast<int>(i)),
  1861. output);
  1862. }
  1863. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  1864. if (this->repeated_nested_enum_size() > 0) {
  1865. ::google::protobuf::internal::WireFormatLite::WriteTag(
  1866. 51,
  1867. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  1868. output);
  1869. output->WriteVarint32(
  1870. static_cast< ::google::protobuf::uint32>(_repeated_nested_enum_cached_byte_size_));
  1871. }
  1872. for (int i = 0, n = this->repeated_nested_enum_size(); i < n; i++) {
  1873. ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
  1874. this->repeated_nested_enum(i), output);
  1875. }
  1876. // repeated .proto2_nofieldpresence_unittest.ForeignEnum repeated_foreign_enum = 52;
  1877. if (this->repeated_foreign_enum_size() > 0) {
  1878. ::google::protobuf::internal::WireFormatLite::WriteTag(
  1879. 52,
  1880. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  1881. output);
  1882. output->WriteVarint32(
  1883. static_cast< ::google::protobuf::uint32>(_repeated_foreign_enum_cached_byte_size_));
  1884. }
  1885. for (int i = 0, n = this->repeated_foreign_enum_size(); i < n; i++) {
  1886. ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
  1887. this->repeated_foreign_enum(i), output);
  1888. }
  1889. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  1890. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  1891. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1892. this->repeated_string_piece(i).data(), static_cast<int>(this->repeated_string_piece(i).length()),
  1893. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1894. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece");
  1895. ::google::protobuf::internal::WireFormatLite::WriteString(
  1896. 54, this->repeated_string_piece(i), output);
  1897. }
  1898. // repeated string repeated_cord = 55 [ctype = CORD];
  1899. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  1900. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1901. this->repeated_cord(i).data(), static_cast<int>(this->repeated_cord(i).length()),
  1902. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1903. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord");
  1904. ::google::protobuf::internal::WireFormatLite::WriteString(
  1905. 55, this->repeated_cord(i), output);
  1906. }
  1907. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  1908. for (unsigned int i = 0,
  1909. n = static_cast<unsigned int>(this->repeated_lazy_message_size()); i < n; i++) {
  1910. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1911. 57,
  1912. this->repeated_lazy_message(static_cast<int>(i)),
  1913. output);
  1914. }
  1915. // uint32 oneof_uint32 = 111;
  1916. if (has_oneof_uint32()) {
  1917. ::google::protobuf::internal::WireFormatLite::WriteUInt32(111, this->oneof_uint32(), output);
  1918. }
  1919. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  1920. if (has_oneof_nested_message()) {
  1921. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1922. 112, this->_internal_oneof_nested_message(), output);
  1923. }
  1924. // string oneof_string = 113;
  1925. if (has_oneof_string()) {
  1926. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1927. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  1928. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1929. "proto2_nofieldpresence_unittest.TestAllTypes.oneof_string");
  1930. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1931. 113, this->oneof_string(), output);
  1932. }
  1933. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum oneof_enum = 114;
  1934. if (has_oneof_enum()) {
  1935. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  1936. 114, this->oneof_enum(), output);
  1937. }
  1938. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1939. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1940. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1941. }
  1942. // @@protoc_insertion_point(serialize_end:proto2_nofieldpresence_unittest.TestAllTypes)
  1943. }
  1944. ::google::protobuf::uint8* TestAllTypes::InternalSerializeWithCachedSizesToArray(
  1945. bool deterministic, ::google::protobuf::uint8* target) const {
  1946. (void)deterministic; // Unused
  1947. // @@protoc_insertion_point(serialize_to_array_start:proto2_nofieldpresence_unittest.TestAllTypes)
  1948. ::google::protobuf::uint32 cached_has_bits = 0;
  1949. (void) cached_has_bits;
  1950. // int32 optional_int32 = 1;
  1951. if (this->optional_int32() != 0) {
  1952. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->optional_int32(), target);
  1953. }
  1954. // int64 optional_int64 = 2;
  1955. if (this->optional_int64() != 0) {
  1956. target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->optional_int64(), target);
  1957. }
  1958. // uint32 optional_uint32 = 3;
  1959. if (this->optional_uint32() != 0) {
  1960. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->optional_uint32(), target);
  1961. }
  1962. // uint64 optional_uint64 = 4;
  1963. if (this->optional_uint64() != 0) {
  1964. target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->optional_uint64(), target);
  1965. }
  1966. // sint32 optional_sint32 = 5;
  1967. if (this->optional_sint32() != 0) {
  1968. target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(5, this->optional_sint32(), target);
  1969. }
  1970. // sint64 optional_sint64 = 6;
  1971. if (this->optional_sint64() != 0) {
  1972. target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(6, this->optional_sint64(), target);
  1973. }
  1974. // fixed32 optional_fixed32 = 7;
  1975. if (this->optional_fixed32() != 0) {
  1976. target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(7, this->optional_fixed32(), target);
  1977. }
  1978. // fixed64 optional_fixed64 = 8;
  1979. if (this->optional_fixed64() != 0) {
  1980. target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(8, this->optional_fixed64(), target);
  1981. }
  1982. // sfixed32 optional_sfixed32 = 9;
  1983. if (this->optional_sfixed32() != 0) {
  1984. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed32ToArray(9, this->optional_sfixed32(), target);
  1985. }
  1986. // sfixed64 optional_sfixed64 = 10;
  1987. if (this->optional_sfixed64() != 0) {
  1988. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed64ToArray(10, this->optional_sfixed64(), target);
  1989. }
  1990. // float optional_float = 11;
  1991. if (this->optional_float() != 0) {
  1992. target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->optional_float(), target);
  1993. }
  1994. // double optional_double = 12;
  1995. if (this->optional_double() != 0) {
  1996. target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(12, this->optional_double(), target);
  1997. }
  1998. // bool optional_bool = 13;
  1999. if (this->optional_bool() != 0) {
  2000. target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(13, this->optional_bool(), target);
  2001. }
  2002. // string optional_string = 14;
  2003. if (this->optional_string().size() > 0) {
  2004. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2005. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  2006. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2007. "proto2_nofieldpresence_unittest.TestAllTypes.optional_string");
  2008. target =
  2009. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2010. 14, this->optional_string(), target);
  2011. }
  2012. // bytes optional_bytes = 15;
  2013. if (this->optional_bytes().size() > 0) {
  2014. target =
  2015. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  2016. 15, this->optional_bytes(), target);
  2017. }
  2018. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  2019. if (this->has_optional_nested_message()) {
  2020. target = ::google::protobuf::internal::WireFormatLite::
  2021. InternalWriteMessageToArray(
  2022. 18, this->_internal_optional_nested_message(), deterministic, target);
  2023. }
  2024. // .proto2_nofieldpresence_unittest.ForeignMessage optional_foreign_message = 19;
  2025. if (this->has_optional_foreign_message()) {
  2026. target = ::google::protobuf::internal::WireFormatLite::
  2027. InternalWriteMessageToArray(
  2028. 19, this->_internal_optional_foreign_message(), deterministic, target);
  2029. }
  2030. // .protobuf_unittest.TestAllTypes optional_proto2_message = 20;
  2031. if (this->has_optional_proto2_message()) {
  2032. target = ::google::protobuf::internal::WireFormatLite::
  2033. InternalWriteMessageToArray(
  2034. 20, this->_internal_optional_proto2_message(), deterministic, target);
  2035. }
  2036. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  2037. if (this->optional_nested_enum() != 0) {
  2038. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  2039. 21, this->optional_nested_enum(), target);
  2040. }
  2041. // .proto2_nofieldpresence_unittest.ForeignEnum optional_foreign_enum = 22;
  2042. if (this->optional_foreign_enum() != 0) {
  2043. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  2044. 22, this->optional_foreign_enum(), target);
  2045. }
  2046. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  2047. if (this->optional_string_piece().size() > 0) {
  2048. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2049. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  2050. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2051. "proto2_nofieldpresence_unittest.TestAllTypes.optional_string_piece");
  2052. target =
  2053. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2054. 24, this->optional_string_piece(), target);
  2055. }
  2056. // string optional_cord = 25 [ctype = CORD];
  2057. if (this->optional_cord().size() > 0) {
  2058. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2059. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  2060. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2061. "proto2_nofieldpresence_unittest.TestAllTypes.optional_cord");
  2062. target =
  2063. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2064. 25, this->optional_cord(), target);
  2065. }
  2066. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_lazy_message = 30 [lazy = true];
  2067. if (this->has_optional_lazy_message()) {
  2068. target = ::google::protobuf::internal::WireFormatLite::
  2069. InternalWriteMessageToArray(
  2070. 30, this->_internal_optional_lazy_message(), deterministic, target);
  2071. }
  2072. // repeated int32 repeated_int32 = 31;
  2073. if (this->repeated_int32_size() > 0) {
  2074. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2075. 31,
  2076. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2077. target);
  2078. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2079. static_cast< ::google::protobuf::int32>(
  2080. _repeated_int32_cached_byte_size_), target);
  2081. target = ::google::protobuf::internal::WireFormatLite::
  2082. WriteInt32NoTagToArray(this->repeated_int32_, target);
  2083. }
  2084. // repeated int64 repeated_int64 = 32;
  2085. if (this->repeated_int64_size() > 0) {
  2086. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2087. 32,
  2088. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2089. target);
  2090. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2091. static_cast< ::google::protobuf::int32>(
  2092. _repeated_int64_cached_byte_size_), target);
  2093. target = ::google::protobuf::internal::WireFormatLite::
  2094. WriteInt64NoTagToArray(this->repeated_int64_, target);
  2095. }
  2096. // repeated uint32 repeated_uint32 = 33;
  2097. if (this->repeated_uint32_size() > 0) {
  2098. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2099. 33,
  2100. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2101. target);
  2102. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2103. static_cast< ::google::protobuf::int32>(
  2104. _repeated_uint32_cached_byte_size_), target);
  2105. target = ::google::protobuf::internal::WireFormatLite::
  2106. WriteUInt32NoTagToArray(this->repeated_uint32_, target);
  2107. }
  2108. // repeated uint64 repeated_uint64 = 34;
  2109. if (this->repeated_uint64_size() > 0) {
  2110. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2111. 34,
  2112. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2113. target);
  2114. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2115. static_cast< ::google::protobuf::int32>(
  2116. _repeated_uint64_cached_byte_size_), target);
  2117. target = ::google::protobuf::internal::WireFormatLite::
  2118. WriteUInt64NoTagToArray(this->repeated_uint64_, target);
  2119. }
  2120. // repeated sint32 repeated_sint32 = 35;
  2121. if (this->repeated_sint32_size() > 0) {
  2122. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2123. 35,
  2124. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2125. target);
  2126. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2127. static_cast< ::google::protobuf::int32>(
  2128. _repeated_sint32_cached_byte_size_), target);
  2129. target = ::google::protobuf::internal::WireFormatLite::
  2130. WriteSInt32NoTagToArray(this->repeated_sint32_, target);
  2131. }
  2132. // repeated sint64 repeated_sint64 = 36;
  2133. if (this->repeated_sint64_size() > 0) {
  2134. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2135. 36,
  2136. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2137. target);
  2138. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2139. static_cast< ::google::protobuf::int32>(
  2140. _repeated_sint64_cached_byte_size_), target);
  2141. target = ::google::protobuf::internal::WireFormatLite::
  2142. WriteSInt64NoTagToArray(this->repeated_sint64_, target);
  2143. }
  2144. // repeated fixed32 repeated_fixed32 = 37;
  2145. if (this->repeated_fixed32_size() > 0) {
  2146. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2147. 37,
  2148. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2149. target);
  2150. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2151. static_cast< ::google::protobuf::int32>(
  2152. _repeated_fixed32_cached_byte_size_), target);
  2153. target = ::google::protobuf::internal::WireFormatLite::
  2154. WriteFixed32NoTagToArray(this->repeated_fixed32_, target);
  2155. }
  2156. // repeated fixed64 repeated_fixed64 = 38;
  2157. if (this->repeated_fixed64_size() > 0) {
  2158. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2159. 38,
  2160. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2161. target);
  2162. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2163. static_cast< ::google::protobuf::int32>(
  2164. _repeated_fixed64_cached_byte_size_), target);
  2165. target = ::google::protobuf::internal::WireFormatLite::
  2166. WriteFixed64NoTagToArray(this->repeated_fixed64_, target);
  2167. }
  2168. // repeated sfixed32 repeated_sfixed32 = 39;
  2169. if (this->repeated_sfixed32_size() > 0) {
  2170. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2171. 39,
  2172. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2173. target);
  2174. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2175. static_cast< ::google::protobuf::int32>(
  2176. _repeated_sfixed32_cached_byte_size_), target);
  2177. target = ::google::protobuf::internal::WireFormatLite::
  2178. WriteSFixed32NoTagToArray(this->repeated_sfixed32_, target);
  2179. }
  2180. // repeated sfixed64 repeated_sfixed64 = 40;
  2181. if (this->repeated_sfixed64_size() > 0) {
  2182. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2183. 40,
  2184. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2185. target);
  2186. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2187. static_cast< ::google::protobuf::int32>(
  2188. _repeated_sfixed64_cached_byte_size_), target);
  2189. target = ::google::protobuf::internal::WireFormatLite::
  2190. WriteSFixed64NoTagToArray(this->repeated_sfixed64_, target);
  2191. }
  2192. // repeated float repeated_float = 41;
  2193. if (this->repeated_float_size() > 0) {
  2194. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2195. 41,
  2196. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2197. target);
  2198. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2199. static_cast< ::google::protobuf::int32>(
  2200. _repeated_float_cached_byte_size_), target);
  2201. target = ::google::protobuf::internal::WireFormatLite::
  2202. WriteFloatNoTagToArray(this->repeated_float_, target);
  2203. }
  2204. // repeated double repeated_double = 42;
  2205. if (this->repeated_double_size() > 0) {
  2206. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2207. 42,
  2208. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2209. target);
  2210. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2211. static_cast< ::google::protobuf::int32>(
  2212. _repeated_double_cached_byte_size_), target);
  2213. target = ::google::protobuf::internal::WireFormatLite::
  2214. WriteDoubleNoTagToArray(this->repeated_double_, target);
  2215. }
  2216. // repeated bool repeated_bool = 43;
  2217. if (this->repeated_bool_size() > 0) {
  2218. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2219. 43,
  2220. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2221. target);
  2222. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2223. static_cast< ::google::protobuf::int32>(
  2224. _repeated_bool_cached_byte_size_), target);
  2225. target = ::google::protobuf::internal::WireFormatLite::
  2226. WriteBoolNoTagToArray(this->repeated_bool_, target);
  2227. }
  2228. // repeated string repeated_string = 44;
  2229. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  2230. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2231. this->repeated_string(i).data(), static_cast<int>(this->repeated_string(i).length()),
  2232. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2233. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_string");
  2234. target = ::google::protobuf::internal::WireFormatLite::
  2235. WriteStringToArray(44, this->repeated_string(i), target);
  2236. }
  2237. // repeated bytes repeated_bytes = 45;
  2238. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  2239. target = ::google::protobuf::internal::WireFormatLite::
  2240. WriteBytesToArray(45, this->repeated_bytes(i), target);
  2241. }
  2242. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  2243. for (unsigned int i = 0,
  2244. n = static_cast<unsigned int>(this->repeated_nested_message_size()); i < n; i++) {
  2245. target = ::google::protobuf::internal::WireFormatLite::
  2246. InternalWriteMessageToArray(
  2247. 48, this->repeated_nested_message(static_cast<int>(i)), deterministic, target);
  2248. }
  2249. // repeated .proto2_nofieldpresence_unittest.ForeignMessage repeated_foreign_message = 49;
  2250. for (unsigned int i = 0,
  2251. n = static_cast<unsigned int>(this->repeated_foreign_message_size()); i < n; i++) {
  2252. target = ::google::protobuf::internal::WireFormatLite::
  2253. InternalWriteMessageToArray(
  2254. 49, this->repeated_foreign_message(static_cast<int>(i)), deterministic, target);
  2255. }
  2256. // repeated .protobuf_unittest.TestAllTypes repeated_proto2_message = 50;
  2257. for (unsigned int i = 0,
  2258. n = static_cast<unsigned int>(this->repeated_proto2_message_size()); i < n; i++) {
  2259. target = ::google::protobuf::internal::WireFormatLite::
  2260. InternalWriteMessageToArray(
  2261. 50, this->repeated_proto2_message(static_cast<int>(i)), deterministic, target);
  2262. }
  2263. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  2264. if (this->repeated_nested_enum_size() > 0) {
  2265. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2266. 51,
  2267. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2268. target);
  2269. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
  2270. _repeated_nested_enum_cached_byte_size_), target);
  2271. target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
  2272. this->repeated_nested_enum_, target);
  2273. }
  2274. // repeated .proto2_nofieldpresence_unittest.ForeignEnum repeated_foreign_enum = 52;
  2275. if (this->repeated_foreign_enum_size() > 0) {
  2276. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2277. 52,
  2278. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2279. target);
  2280. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
  2281. _repeated_foreign_enum_cached_byte_size_), target);
  2282. target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
  2283. this->repeated_foreign_enum_, target);
  2284. }
  2285. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  2286. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  2287. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2288. this->repeated_string_piece(i).data(), static_cast<int>(this->repeated_string_piece(i).length()),
  2289. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2290. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_string_piece");
  2291. target = ::google::protobuf::internal::WireFormatLite::
  2292. WriteStringToArray(54, this->repeated_string_piece(i), target);
  2293. }
  2294. // repeated string repeated_cord = 55 [ctype = CORD];
  2295. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  2296. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2297. this->repeated_cord(i).data(), static_cast<int>(this->repeated_cord(i).length()),
  2298. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2299. "proto2_nofieldpresence_unittest.TestAllTypes.repeated_cord");
  2300. target = ::google::protobuf::internal::WireFormatLite::
  2301. WriteStringToArray(55, this->repeated_cord(i), target);
  2302. }
  2303. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  2304. for (unsigned int i = 0,
  2305. n = static_cast<unsigned int>(this->repeated_lazy_message_size()); i < n; i++) {
  2306. target = ::google::protobuf::internal::WireFormatLite::
  2307. InternalWriteMessageToArray(
  2308. 57, this->repeated_lazy_message(static_cast<int>(i)), deterministic, target);
  2309. }
  2310. // uint32 oneof_uint32 = 111;
  2311. if (has_oneof_uint32()) {
  2312. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(111, this->oneof_uint32(), target);
  2313. }
  2314. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  2315. if (has_oneof_nested_message()) {
  2316. target = ::google::protobuf::internal::WireFormatLite::
  2317. InternalWriteMessageToArray(
  2318. 112, this->_internal_oneof_nested_message(), deterministic, target);
  2319. }
  2320. // string oneof_string = 113;
  2321. if (has_oneof_string()) {
  2322. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2323. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  2324. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2325. "proto2_nofieldpresence_unittest.TestAllTypes.oneof_string");
  2326. target =
  2327. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2328. 113, this->oneof_string(), target);
  2329. }
  2330. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum oneof_enum = 114;
  2331. if (has_oneof_enum()) {
  2332. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  2333. 114, this->oneof_enum(), target);
  2334. }
  2335. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2336. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  2337. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  2338. }
  2339. // @@protoc_insertion_point(serialize_to_array_end:proto2_nofieldpresence_unittest.TestAllTypes)
  2340. return target;
  2341. }
  2342. size_t TestAllTypes::ByteSizeLong() const {
  2343. // @@protoc_insertion_point(message_byte_size_start:proto2_nofieldpresence_unittest.TestAllTypes)
  2344. size_t total_size = 0;
  2345. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2346. total_size +=
  2347. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  2348. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  2349. }
  2350. // repeated int32 repeated_int32 = 31;
  2351. {
  2352. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2353. Int32Size(this->repeated_int32_);
  2354. if (data_size > 0) {
  2355. total_size += 2 +
  2356. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2357. static_cast< ::google::protobuf::int32>(data_size));
  2358. }
  2359. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2360. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2361. _repeated_int32_cached_byte_size_ = cached_size;
  2362. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2363. total_size += data_size;
  2364. }
  2365. // repeated int64 repeated_int64 = 32;
  2366. {
  2367. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2368. Int64Size(this->repeated_int64_);
  2369. if (data_size > 0) {
  2370. total_size += 2 +
  2371. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2372. static_cast< ::google::protobuf::int32>(data_size));
  2373. }
  2374. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2375. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2376. _repeated_int64_cached_byte_size_ = cached_size;
  2377. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2378. total_size += data_size;
  2379. }
  2380. // repeated uint32 repeated_uint32 = 33;
  2381. {
  2382. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2383. UInt32Size(this->repeated_uint32_);
  2384. if (data_size > 0) {
  2385. total_size += 2 +
  2386. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2387. static_cast< ::google::protobuf::int32>(data_size));
  2388. }
  2389. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2390. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2391. _repeated_uint32_cached_byte_size_ = cached_size;
  2392. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2393. total_size += data_size;
  2394. }
  2395. // repeated uint64 repeated_uint64 = 34;
  2396. {
  2397. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2398. UInt64Size(this->repeated_uint64_);
  2399. if (data_size > 0) {
  2400. total_size += 2 +
  2401. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2402. static_cast< ::google::protobuf::int32>(data_size));
  2403. }
  2404. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2405. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2406. _repeated_uint64_cached_byte_size_ = cached_size;
  2407. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2408. total_size += data_size;
  2409. }
  2410. // repeated sint32 repeated_sint32 = 35;
  2411. {
  2412. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2413. SInt32Size(this->repeated_sint32_);
  2414. if (data_size > 0) {
  2415. total_size += 2 +
  2416. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2417. static_cast< ::google::protobuf::int32>(data_size));
  2418. }
  2419. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2420. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2421. _repeated_sint32_cached_byte_size_ = cached_size;
  2422. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2423. total_size += data_size;
  2424. }
  2425. // repeated sint64 repeated_sint64 = 36;
  2426. {
  2427. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2428. SInt64Size(this->repeated_sint64_);
  2429. if (data_size > 0) {
  2430. total_size += 2 +
  2431. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2432. static_cast< ::google::protobuf::int32>(data_size));
  2433. }
  2434. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2435. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2436. _repeated_sint64_cached_byte_size_ = cached_size;
  2437. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2438. total_size += data_size;
  2439. }
  2440. // repeated fixed32 repeated_fixed32 = 37;
  2441. {
  2442. unsigned int count = static_cast<unsigned int>(this->repeated_fixed32_size());
  2443. size_t data_size = 4UL * count;
  2444. if (data_size > 0) {
  2445. total_size += 2 +
  2446. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2447. static_cast< ::google::protobuf::int32>(data_size));
  2448. }
  2449. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2450. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2451. _repeated_fixed32_cached_byte_size_ = cached_size;
  2452. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2453. total_size += data_size;
  2454. }
  2455. // repeated fixed64 repeated_fixed64 = 38;
  2456. {
  2457. unsigned int count = static_cast<unsigned int>(this->repeated_fixed64_size());
  2458. size_t data_size = 8UL * count;
  2459. if (data_size > 0) {
  2460. total_size += 2 +
  2461. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2462. static_cast< ::google::protobuf::int32>(data_size));
  2463. }
  2464. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2465. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2466. _repeated_fixed64_cached_byte_size_ = cached_size;
  2467. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2468. total_size += data_size;
  2469. }
  2470. // repeated sfixed32 repeated_sfixed32 = 39;
  2471. {
  2472. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed32_size());
  2473. size_t data_size = 4UL * count;
  2474. if (data_size > 0) {
  2475. total_size += 2 +
  2476. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2477. static_cast< ::google::protobuf::int32>(data_size));
  2478. }
  2479. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2480. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2481. _repeated_sfixed32_cached_byte_size_ = cached_size;
  2482. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2483. total_size += data_size;
  2484. }
  2485. // repeated sfixed64 repeated_sfixed64 = 40;
  2486. {
  2487. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed64_size());
  2488. size_t data_size = 8UL * count;
  2489. if (data_size > 0) {
  2490. total_size += 2 +
  2491. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2492. static_cast< ::google::protobuf::int32>(data_size));
  2493. }
  2494. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2495. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2496. _repeated_sfixed64_cached_byte_size_ = cached_size;
  2497. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2498. total_size += data_size;
  2499. }
  2500. // repeated float repeated_float = 41;
  2501. {
  2502. unsigned int count = static_cast<unsigned int>(this->repeated_float_size());
  2503. size_t data_size = 4UL * count;
  2504. if (data_size > 0) {
  2505. total_size += 2 +
  2506. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2507. static_cast< ::google::protobuf::int32>(data_size));
  2508. }
  2509. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2510. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2511. _repeated_float_cached_byte_size_ = cached_size;
  2512. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2513. total_size += data_size;
  2514. }
  2515. // repeated double repeated_double = 42;
  2516. {
  2517. unsigned int count = static_cast<unsigned int>(this->repeated_double_size());
  2518. size_t data_size = 8UL * count;
  2519. if (data_size > 0) {
  2520. total_size += 2 +
  2521. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2522. static_cast< ::google::protobuf::int32>(data_size));
  2523. }
  2524. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2525. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2526. _repeated_double_cached_byte_size_ = cached_size;
  2527. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2528. total_size += data_size;
  2529. }
  2530. // repeated bool repeated_bool = 43;
  2531. {
  2532. unsigned int count = static_cast<unsigned int>(this->repeated_bool_size());
  2533. size_t data_size = 1UL * count;
  2534. if (data_size > 0) {
  2535. total_size += 2 +
  2536. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2537. static_cast< ::google::protobuf::int32>(data_size));
  2538. }
  2539. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2540. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2541. _repeated_bool_cached_byte_size_ = cached_size;
  2542. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2543. total_size += data_size;
  2544. }
  2545. // repeated string repeated_string = 44;
  2546. total_size += 2 *
  2547. ::google::protobuf::internal::FromIntSize(this->repeated_string_size());
  2548. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  2549. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  2550. this->repeated_string(i));
  2551. }
  2552. // repeated bytes repeated_bytes = 45;
  2553. total_size += 2 *
  2554. ::google::protobuf::internal::FromIntSize(this->repeated_bytes_size());
  2555. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  2556. total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
  2557. this->repeated_bytes(i));
  2558. }
  2559. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  2560. {
  2561. unsigned int count = static_cast<unsigned int>(this->repeated_nested_message_size());
  2562. total_size += 2UL * count;
  2563. for (unsigned int i = 0; i < count; i++) {
  2564. total_size +=
  2565. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2566. this->repeated_nested_message(static_cast<int>(i)));
  2567. }
  2568. }
  2569. // repeated .proto2_nofieldpresence_unittest.ForeignMessage repeated_foreign_message = 49;
  2570. {
  2571. unsigned int count = static_cast<unsigned int>(this->repeated_foreign_message_size());
  2572. total_size += 2UL * count;
  2573. for (unsigned int i = 0; i < count; i++) {
  2574. total_size +=
  2575. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2576. this->repeated_foreign_message(static_cast<int>(i)));
  2577. }
  2578. }
  2579. // repeated .protobuf_unittest.TestAllTypes repeated_proto2_message = 50;
  2580. {
  2581. unsigned int count = static_cast<unsigned int>(this->repeated_proto2_message_size());
  2582. total_size += 2UL * count;
  2583. for (unsigned int i = 0; i < count; i++) {
  2584. total_size +=
  2585. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2586. this->repeated_proto2_message(static_cast<int>(i)));
  2587. }
  2588. }
  2589. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  2590. {
  2591. size_t data_size = 0;
  2592. unsigned int count = static_cast<unsigned int>(this->repeated_nested_enum_size());for (unsigned int i = 0; i < count; i++) {
  2593. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  2594. this->repeated_nested_enum(static_cast<int>(i)));
  2595. }
  2596. if (data_size > 0) {
  2597. total_size += 2 +
  2598. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2599. static_cast< ::google::protobuf::int32>(data_size));
  2600. }
  2601. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2602. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2603. _repeated_nested_enum_cached_byte_size_ = cached_size;
  2604. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2605. total_size += data_size;
  2606. }
  2607. // repeated .proto2_nofieldpresence_unittest.ForeignEnum repeated_foreign_enum = 52;
  2608. {
  2609. size_t data_size = 0;
  2610. unsigned int count = static_cast<unsigned int>(this->repeated_foreign_enum_size());for (unsigned int i = 0; i < count; i++) {
  2611. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  2612. this->repeated_foreign_enum(static_cast<int>(i)));
  2613. }
  2614. if (data_size > 0) {
  2615. total_size += 2 +
  2616. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2617. static_cast< ::google::protobuf::int32>(data_size));
  2618. }
  2619. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2620. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2621. _repeated_foreign_enum_cached_byte_size_ = cached_size;
  2622. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2623. total_size += data_size;
  2624. }
  2625. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  2626. total_size += 2 *
  2627. ::google::protobuf::internal::FromIntSize(this->repeated_string_piece_size());
  2628. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  2629. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  2630. this->repeated_string_piece(i));
  2631. }
  2632. // repeated string repeated_cord = 55 [ctype = CORD];
  2633. total_size += 2 *
  2634. ::google::protobuf::internal::FromIntSize(this->repeated_cord_size());
  2635. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  2636. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  2637. this->repeated_cord(i));
  2638. }
  2639. // repeated .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  2640. {
  2641. unsigned int count = static_cast<unsigned int>(this->repeated_lazy_message_size());
  2642. total_size += 2UL * count;
  2643. for (unsigned int i = 0; i < count; i++) {
  2644. total_size +=
  2645. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2646. this->repeated_lazy_message(static_cast<int>(i)));
  2647. }
  2648. }
  2649. // string optional_string = 14;
  2650. if (this->optional_string().size() > 0) {
  2651. total_size += 1 +
  2652. ::google::protobuf::internal::WireFormatLite::StringSize(
  2653. this->optional_string());
  2654. }
  2655. // bytes optional_bytes = 15;
  2656. if (this->optional_bytes().size() > 0) {
  2657. total_size += 1 +
  2658. ::google::protobuf::internal::WireFormatLite::BytesSize(
  2659. this->optional_bytes());
  2660. }
  2661. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  2662. if (this->optional_string_piece().size() > 0) {
  2663. total_size += 2 +
  2664. ::google::protobuf::internal::WireFormatLite::StringSize(
  2665. this->optional_string_piece());
  2666. }
  2667. // string optional_cord = 25 [ctype = CORD];
  2668. if (this->optional_cord().size() > 0) {
  2669. total_size += 2 +
  2670. ::google::protobuf::internal::WireFormatLite::StringSize(
  2671. this->optional_cord());
  2672. }
  2673. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  2674. if (this->has_optional_nested_message()) {
  2675. total_size += 2 +
  2676. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2677. *optional_nested_message_);
  2678. }
  2679. // .proto2_nofieldpresence_unittest.ForeignMessage optional_foreign_message = 19;
  2680. if (this->has_optional_foreign_message()) {
  2681. total_size += 2 +
  2682. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2683. *optional_foreign_message_);
  2684. }
  2685. // .protobuf_unittest.TestAllTypes optional_proto2_message = 20;
  2686. if (this->has_optional_proto2_message()) {
  2687. total_size += 2 +
  2688. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2689. *optional_proto2_message_);
  2690. }
  2691. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage optional_lazy_message = 30 [lazy = true];
  2692. if (this->has_optional_lazy_message()) {
  2693. total_size += 2 +
  2694. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2695. *optional_lazy_message_);
  2696. }
  2697. // int64 optional_int64 = 2;
  2698. if (this->optional_int64() != 0) {
  2699. total_size += 1 +
  2700. ::google::protobuf::internal::WireFormatLite::Int64Size(
  2701. this->optional_int64());
  2702. }
  2703. // int32 optional_int32 = 1;
  2704. if (this->optional_int32() != 0) {
  2705. total_size += 1 +
  2706. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2707. this->optional_int32());
  2708. }
  2709. // uint32 optional_uint32 = 3;
  2710. if (this->optional_uint32() != 0) {
  2711. total_size += 1 +
  2712. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  2713. this->optional_uint32());
  2714. }
  2715. // uint64 optional_uint64 = 4;
  2716. if (this->optional_uint64() != 0) {
  2717. total_size += 1 +
  2718. ::google::protobuf::internal::WireFormatLite::UInt64Size(
  2719. this->optional_uint64());
  2720. }
  2721. // sint64 optional_sint64 = 6;
  2722. if (this->optional_sint64() != 0) {
  2723. total_size += 1 +
  2724. ::google::protobuf::internal::WireFormatLite::SInt64Size(
  2725. this->optional_sint64());
  2726. }
  2727. // sint32 optional_sint32 = 5;
  2728. if (this->optional_sint32() != 0) {
  2729. total_size += 1 +
  2730. ::google::protobuf::internal::WireFormatLite::SInt32Size(
  2731. this->optional_sint32());
  2732. }
  2733. // fixed32 optional_fixed32 = 7;
  2734. if (this->optional_fixed32() != 0) {
  2735. total_size += 1 + 4;
  2736. }
  2737. // fixed64 optional_fixed64 = 8;
  2738. if (this->optional_fixed64() != 0) {
  2739. total_size += 1 + 8;
  2740. }
  2741. // sfixed64 optional_sfixed64 = 10;
  2742. if (this->optional_sfixed64() != 0) {
  2743. total_size += 1 + 8;
  2744. }
  2745. // sfixed32 optional_sfixed32 = 9;
  2746. if (this->optional_sfixed32() != 0) {
  2747. total_size += 1 + 4;
  2748. }
  2749. // float optional_float = 11;
  2750. if (this->optional_float() != 0) {
  2751. total_size += 1 + 4;
  2752. }
  2753. // double optional_double = 12;
  2754. if (this->optional_double() != 0) {
  2755. total_size += 1 + 8;
  2756. }
  2757. // bool optional_bool = 13;
  2758. if (this->optional_bool() != 0) {
  2759. total_size += 1 + 1;
  2760. }
  2761. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  2762. if (this->optional_nested_enum() != 0) {
  2763. total_size += 2 +
  2764. ::google::protobuf::internal::WireFormatLite::EnumSize(this->optional_nested_enum());
  2765. }
  2766. // .proto2_nofieldpresence_unittest.ForeignEnum optional_foreign_enum = 22;
  2767. if (this->optional_foreign_enum() != 0) {
  2768. total_size += 2 +
  2769. ::google::protobuf::internal::WireFormatLite::EnumSize(this->optional_foreign_enum());
  2770. }
  2771. switch (oneof_field_case()) {
  2772. // uint32 oneof_uint32 = 111;
  2773. case kOneofUint32: {
  2774. total_size += 2 +
  2775. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  2776. this->oneof_uint32());
  2777. break;
  2778. }
  2779. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  2780. case kOneofNestedMessage: {
  2781. total_size += 2 +
  2782. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2783. *oneof_field_.oneof_nested_message_);
  2784. break;
  2785. }
  2786. // string oneof_string = 113;
  2787. case kOneofString: {
  2788. total_size += 2 +
  2789. ::google::protobuf::internal::WireFormatLite::StringSize(
  2790. this->oneof_string());
  2791. break;
  2792. }
  2793. // .proto2_nofieldpresence_unittest.TestAllTypes.NestedEnum oneof_enum = 114;
  2794. case kOneofEnum: {
  2795. total_size += 2 +
  2796. ::google::protobuf::internal::WireFormatLite::EnumSize(this->oneof_enum());
  2797. break;
  2798. }
  2799. case ONEOF_FIELD_NOT_SET: {
  2800. break;
  2801. }
  2802. }
  2803. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  2804. SetCachedSize(cached_size);
  2805. return total_size;
  2806. }
  2807. void TestAllTypes::MergeFrom(const ::google::protobuf::Message& from) {
  2808. // @@protoc_insertion_point(generalized_merge_from_start:proto2_nofieldpresence_unittest.TestAllTypes)
  2809. GOOGLE_DCHECK_NE(&from, this);
  2810. const TestAllTypes* source =
  2811. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes>(
  2812. &from);
  2813. if (source == NULL) {
  2814. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto2_nofieldpresence_unittest.TestAllTypes)
  2815. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  2816. } else {
  2817. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto2_nofieldpresence_unittest.TestAllTypes)
  2818. MergeFrom(*source);
  2819. }
  2820. }
  2821. void TestAllTypes::MergeFrom(const TestAllTypes& from) {
  2822. // @@protoc_insertion_point(class_specific_merge_from_start:proto2_nofieldpresence_unittest.TestAllTypes)
  2823. GOOGLE_DCHECK_NE(&from, this);
  2824. _internal_metadata_.MergeFrom(from._internal_metadata_);
  2825. ::google::protobuf::uint32 cached_has_bits = 0;
  2826. (void) cached_has_bits;
  2827. repeated_int32_.MergeFrom(from.repeated_int32_);
  2828. repeated_int64_.MergeFrom(from.repeated_int64_);
  2829. repeated_uint32_.MergeFrom(from.repeated_uint32_);
  2830. repeated_uint64_.MergeFrom(from.repeated_uint64_);
  2831. repeated_sint32_.MergeFrom(from.repeated_sint32_);
  2832. repeated_sint64_.MergeFrom(from.repeated_sint64_);
  2833. repeated_fixed32_.MergeFrom(from.repeated_fixed32_);
  2834. repeated_fixed64_.MergeFrom(from.repeated_fixed64_);
  2835. repeated_sfixed32_.MergeFrom(from.repeated_sfixed32_);
  2836. repeated_sfixed64_.MergeFrom(from.repeated_sfixed64_);
  2837. repeated_float_.MergeFrom(from.repeated_float_);
  2838. repeated_double_.MergeFrom(from.repeated_double_);
  2839. repeated_bool_.MergeFrom(from.repeated_bool_);
  2840. repeated_string_.MergeFrom(from.repeated_string_);
  2841. repeated_bytes_.MergeFrom(from.repeated_bytes_);
  2842. repeated_nested_message_.MergeFrom(from.repeated_nested_message_);
  2843. repeated_foreign_message_.MergeFrom(from.repeated_foreign_message_);
  2844. repeated_proto2_message_.MergeFrom(from.repeated_proto2_message_);
  2845. repeated_nested_enum_.MergeFrom(from.repeated_nested_enum_);
  2846. repeated_foreign_enum_.MergeFrom(from.repeated_foreign_enum_);
  2847. repeated_string_piece_.MergeFrom(from.repeated_string_piece_);
  2848. repeated_cord_.MergeFrom(from.repeated_cord_);
  2849. repeated_lazy_message_.MergeFrom(from.repeated_lazy_message_);
  2850. if (from.optional_string().size() > 0) {
  2851. optional_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_);
  2852. }
  2853. if (from.optional_bytes().size() > 0) {
  2854. optional_bytes_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_bytes_);
  2855. }
  2856. if (from.optional_string_piece().size() > 0) {
  2857. optional_string_piece_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_piece_);
  2858. }
  2859. if (from.optional_cord().size() > 0) {
  2860. optional_cord_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_cord_);
  2861. }
  2862. if (from.has_optional_nested_message()) {
  2863. mutable_optional_nested_message()->::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::MergeFrom(from.optional_nested_message());
  2864. }
  2865. if (from.has_optional_foreign_message()) {
  2866. mutable_optional_foreign_message()->::proto2_nofieldpresence_unittest::ForeignMessage::MergeFrom(from.optional_foreign_message());
  2867. }
  2868. if (from.has_optional_proto2_message()) {
  2869. mutable_optional_proto2_message()->::protobuf_unittest::TestAllTypes::MergeFrom(from.optional_proto2_message());
  2870. }
  2871. if (from.has_optional_lazy_message()) {
  2872. mutable_optional_lazy_message()->::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::MergeFrom(from.optional_lazy_message());
  2873. }
  2874. if (from.optional_int64() != 0) {
  2875. set_optional_int64(from.optional_int64());
  2876. }
  2877. if (from.optional_int32() != 0) {
  2878. set_optional_int32(from.optional_int32());
  2879. }
  2880. if (from.optional_uint32() != 0) {
  2881. set_optional_uint32(from.optional_uint32());
  2882. }
  2883. if (from.optional_uint64() != 0) {
  2884. set_optional_uint64(from.optional_uint64());
  2885. }
  2886. if (from.optional_sint64() != 0) {
  2887. set_optional_sint64(from.optional_sint64());
  2888. }
  2889. if (from.optional_sint32() != 0) {
  2890. set_optional_sint32(from.optional_sint32());
  2891. }
  2892. if (from.optional_fixed32() != 0) {
  2893. set_optional_fixed32(from.optional_fixed32());
  2894. }
  2895. if (from.optional_fixed64() != 0) {
  2896. set_optional_fixed64(from.optional_fixed64());
  2897. }
  2898. if (from.optional_sfixed64() != 0) {
  2899. set_optional_sfixed64(from.optional_sfixed64());
  2900. }
  2901. if (from.optional_sfixed32() != 0) {
  2902. set_optional_sfixed32(from.optional_sfixed32());
  2903. }
  2904. if (from.optional_float() != 0) {
  2905. set_optional_float(from.optional_float());
  2906. }
  2907. if (from.optional_double() != 0) {
  2908. set_optional_double(from.optional_double());
  2909. }
  2910. if (from.optional_bool() != 0) {
  2911. set_optional_bool(from.optional_bool());
  2912. }
  2913. if (from.optional_nested_enum() != 0) {
  2914. set_optional_nested_enum(from.optional_nested_enum());
  2915. }
  2916. if (from.optional_foreign_enum() != 0) {
  2917. set_optional_foreign_enum(from.optional_foreign_enum());
  2918. }
  2919. switch (from.oneof_field_case()) {
  2920. case kOneofUint32: {
  2921. set_oneof_uint32(from.oneof_uint32());
  2922. break;
  2923. }
  2924. case kOneofNestedMessage: {
  2925. mutable_oneof_nested_message()->::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage::MergeFrom(from.oneof_nested_message());
  2926. break;
  2927. }
  2928. case kOneofString: {
  2929. set_oneof_string(from.oneof_string());
  2930. break;
  2931. }
  2932. case kOneofEnum: {
  2933. set_oneof_enum(from.oneof_enum());
  2934. break;
  2935. }
  2936. case ONEOF_FIELD_NOT_SET: {
  2937. break;
  2938. }
  2939. }
  2940. }
  2941. void TestAllTypes::CopyFrom(const ::google::protobuf::Message& from) {
  2942. // @@protoc_insertion_point(generalized_copy_from_start:proto2_nofieldpresence_unittest.TestAllTypes)
  2943. if (&from == this) return;
  2944. Clear();
  2945. MergeFrom(from);
  2946. }
  2947. void TestAllTypes::CopyFrom(const TestAllTypes& from) {
  2948. // @@protoc_insertion_point(class_specific_copy_from_start:proto2_nofieldpresence_unittest.TestAllTypes)
  2949. if (&from == this) return;
  2950. Clear();
  2951. MergeFrom(from);
  2952. }
  2953. bool TestAllTypes::IsInitialized() const {
  2954. return true;
  2955. }
  2956. void TestAllTypes::Swap(TestAllTypes* other) {
  2957. if (other == this) return;
  2958. InternalSwap(other);
  2959. }
  2960. void TestAllTypes::InternalSwap(TestAllTypes* other) {
  2961. using std::swap;
  2962. repeated_int32_.InternalSwap(&other->repeated_int32_);
  2963. repeated_int64_.InternalSwap(&other->repeated_int64_);
  2964. repeated_uint32_.InternalSwap(&other->repeated_uint32_);
  2965. repeated_uint64_.InternalSwap(&other->repeated_uint64_);
  2966. repeated_sint32_.InternalSwap(&other->repeated_sint32_);
  2967. repeated_sint64_.InternalSwap(&other->repeated_sint64_);
  2968. repeated_fixed32_.InternalSwap(&other->repeated_fixed32_);
  2969. repeated_fixed64_.InternalSwap(&other->repeated_fixed64_);
  2970. repeated_sfixed32_.InternalSwap(&other->repeated_sfixed32_);
  2971. repeated_sfixed64_.InternalSwap(&other->repeated_sfixed64_);
  2972. repeated_float_.InternalSwap(&other->repeated_float_);
  2973. repeated_double_.InternalSwap(&other->repeated_double_);
  2974. repeated_bool_.InternalSwap(&other->repeated_bool_);
  2975. repeated_string_.InternalSwap(CastToBase(&other->repeated_string_));
  2976. repeated_bytes_.InternalSwap(CastToBase(&other->repeated_bytes_));
  2977. CastToBase(&repeated_nested_message_)->InternalSwap(CastToBase(&other->repeated_nested_message_));
  2978. CastToBase(&repeated_foreign_message_)->InternalSwap(CastToBase(&other->repeated_foreign_message_));
  2979. CastToBase(&repeated_proto2_message_)->InternalSwap(CastToBase(&other->repeated_proto2_message_));
  2980. repeated_nested_enum_.InternalSwap(&other->repeated_nested_enum_);
  2981. repeated_foreign_enum_.InternalSwap(&other->repeated_foreign_enum_);
  2982. repeated_string_piece_.InternalSwap(CastToBase(&other->repeated_string_piece_));
  2983. repeated_cord_.InternalSwap(CastToBase(&other->repeated_cord_));
  2984. CastToBase(&repeated_lazy_message_)->InternalSwap(CastToBase(&other->repeated_lazy_message_));
  2985. optional_string_.Swap(&other->optional_string_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  2986. GetArenaNoVirtual());
  2987. optional_bytes_.Swap(&other->optional_bytes_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  2988. GetArenaNoVirtual());
  2989. optional_string_piece_.Swap(&other->optional_string_piece_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  2990. GetArenaNoVirtual());
  2991. optional_cord_.Swap(&other->optional_cord_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  2992. GetArenaNoVirtual());
  2993. swap(optional_nested_message_, other->optional_nested_message_);
  2994. swap(optional_foreign_message_, other->optional_foreign_message_);
  2995. swap(optional_proto2_message_, other->optional_proto2_message_);
  2996. swap(optional_lazy_message_, other->optional_lazy_message_);
  2997. swap(optional_int64_, other->optional_int64_);
  2998. swap(optional_int32_, other->optional_int32_);
  2999. swap(optional_uint32_, other->optional_uint32_);
  3000. swap(optional_uint64_, other->optional_uint64_);
  3001. swap(optional_sint64_, other->optional_sint64_);
  3002. swap(optional_sint32_, other->optional_sint32_);
  3003. swap(optional_fixed32_, other->optional_fixed32_);
  3004. swap(optional_fixed64_, other->optional_fixed64_);
  3005. swap(optional_sfixed64_, other->optional_sfixed64_);
  3006. swap(optional_sfixed32_, other->optional_sfixed32_);
  3007. swap(optional_float_, other->optional_float_);
  3008. swap(optional_double_, other->optional_double_);
  3009. swap(optional_bool_, other->optional_bool_);
  3010. swap(optional_nested_enum_, other->optional_nested_enum_);
  3011. swap(optional_foreign_enum_, other->optional_foreign_enum_);
  3012. swap(oneof_field_, other->oneof_field_);
  3013. swap(_oneof_case_[0], other->_oneof_case_[0]);
  3014. _internal_metadata_.Swap(&other->_internal_metadata_);
  3015. }
  3016. ::google::protobuf::Metadata TestAllTypes::GetMetadata() const {
  3017. protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  3018. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages];
  3019. }
  3020. // ===================================================================
  3021. void TestProto2Required::InitAsDefaultInstance() {
  3022. ::proto2_nofieldpresence_unittest::_TestProto2Required_default_instance_._instance.get_mutable()->proto2_ = const_cast< ::protobuf_unittest::TestRequired*>(
  3023. ::protobuf_unittest::TestRequired::internal_default_instance());
  3024. }
  3025. void TestProto2Required::clear_proto2() {
  3026. if (GetArenaNoVirtual() == NULL && proto2_ != NULL) {
  3027. delete proto2_;
  3028. }
  3029. proto2_ = NULL;
  3030. }
  3031. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  3032. const int TestProto2Required::kProto2FieldNumber;
  3033. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  3034. TestProto2Required::TestProto2Required()
  3035. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  3036. ::google::protobuf::internal::InitSCC(
  3037. &protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_TestProto2Required.base);
  3038. SharedCtor();
  3039. // @@protoc_insertion_point(constructor:proto2_nofieldpresence_unittest.TestProto2Required)
  3040. }
  3041. TestProto2Required::TestProto2Required(const TestProto2Required& from)
  3042. : ::google::protobuf::Message(),
  3043. _internal_metadata_(NULL) {
  3044. _internal_metadata_.MergeFrom(from._internal_metadata_);
  3045. if (from.has_proto2()) {
  3046. proto2_ = new ::protobuf_unittest::TestRequired(*from.proto2_);
  3047. } else {
  3048. proto2_ = NULL;
  3049. }
  3050. // @@protoc_insertion_point(copy_constructor:proto2_nofieldpresence_unittest.TestProto2Required)
  3051. }
  3052. void TestProto2Required::SharedCtor() {
  3053. proto2_ = NULL;
  3054. }
  3055. TestProto2Required::~TestProto2Required() {
  3056. // @@protoc_insertion_point(destructor:proto2_nofieldpresence_unittest.TestProto2Required)
  3057. SharedDtor();
  3058. }
  3059. void TestProto2Required::SharedDtor() {
  3060. if (this != internal_default_instance()) delete proto2_;
  3061. }
  3062. void TestProto2Required::SetCachedSize(int size) const {
  3063. _cached_size_.Set(size);
  3064. }
  3065. const ::google::protobuf::Descriptor* TestProto2Required::descriptor() {
  3066. ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  3067. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  3068. }
  3069. const TestProto2Required& TestProto2Required::default_instance() {
  3070. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_TestProto2Required.base);
  3071. return *internal_default_instance();
  3072. }
  3073. void TestProto2Required::Clear() {
  3074. // @@protoc_insertion_point(message_clear_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3075. ::google::protobuf::uint32 cached_has_bits = 0;
  3076. // Prevent compiler warnings about cached_has_bits being unused
  3077. (void) cached_has_bits;
  3078. if (GetArenaNoVirtual() == NULL && proto2_ != NULL) {
  3079. delete proto2_;
  3080. }
  3081. proto2_ = NULL;
  3082. _internal_metadata_.Clear();
  3083. }
  3084. bool TestProto2Required::MergePartialFromCodedStream(
  3085. ::google::protobuf::io::CodedInputStream* input) {
  3086. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  3087. ::google::protobuf::uint32 tag;
  3088. // @@protoc_insertion_point(parse_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3089. for (;;) {
  3090. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  3091. tag = p.first;
  3092. if (!p.second) goto handle_unusual;
  3093. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  3094. // .protobuf_unittest.TestRequired proto2 = 1;
  3095. case 1: {
  3096. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3097. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  3098. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  3099. input, mutable_proto2()));
  3100. } else {
  3101. goto handle_unusual;
  3102. }
  3103. break;
  3104. }
  3105. default: {
  3106. handle_unusual:
  3107. if (tag == 0) {
  3108. goto success;
  3109. }
  3110. DO_(::google::protobuf::internal::WireFormat::SkipField(
  3111. input, tag, _internal_metadata_.mutable_unknown_fields()));
  3112. break;
  3113. }
  3114. }
  3115. }
  3116. success:
  3117. // @@protoc_insertion_point(parse_success:proto2_nofieldpresence_unittest.TestProto2Required)
  3118. return true;
  3119. failure:
  3120. // @@protoc_insertion_point(parse_failure:proto2_nofieldpresence_unittest.TestProto2Required)
  3121. return false;
  3122. #undef DO_
  3123. }
  3124. void TestProto2Required::SerializeWithCachedSizes(
  3125. ::google::protobuf::io::CodedOutputStream* output) const {
  3126. // @@protoc_insertion_point(serialize_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3127. ::google::protobuf::uint32 cached_has_bits = 0;
  3128. (void) cached_has_bits;
  3129. // .protobuf_unittest.TestRequired proto2 = 1;
  3130. if (this->has_proto2()) {
  3131. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  3132. 1, this->_internal_proto2(), output);
  3133. }
  3134. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  3135. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  3136. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  3137. }
  3138. // @@protoc_insertion_point(serialize_end:proto2_nofieldpresence_unittest.TestProto2Required)
  3139. }
  3140. ::google::protobuf::uint8* TestProto2Required::InternalSerializeWithCachedSizesToArray(
  3141. bool deterministic, ::google::protobuf::uint8* target) const {
  3142. (void)deterministic; // Unused
  3143. // @@protoc_insertion_point(serialize_to_array_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3144. ::google::protobuf::uint32 cached_has_bits = 0;
  3145. (void) cached_has_bits;
  3146. // .protobuf_unittest.TestRequired proto2 = 1;
  3147. if (this->has_proto2()) {
  3148. target = ::google::protobuf::internal::WireFormatLite::
  3149. InternalWriteMessageToArray(
  3150. 1, this->_internal_proto2(), deterministic, target);
  3151. }
  3152. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  3153. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  3154. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  3155. }
  3156. // @@protoc_insertion_point(serialize_to_array_end:proto2_nofieldpresence_unittest.TestProto2Required)
  3157. return target;
  3158. }
  3159. size_t TestProto2Required::ByteSizeLong() const {
  3160. // @@protoc_insertion_point(message_byte_size_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3161. size_t total_size = 0;
  3162. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  3163. total_size +=
  3164. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  3165. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  3166. }
  3167. // .protobuf_unittest.TestRequired proto2 = 1;
  3168. if (this->has_proto2()) {
  3169. total_size += 1 +
  3170. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3171. *proto2_);
  3172. }
  3173. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  3174. SetCachedSize(cached_size);
  3175. return total_size;
  3176. }
  3177. void TestProto2Required::MergeFrom(const ::google::protobuf::Message& from) {
  3178. // @@protoc_insertion_point(generalized_merge_from_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3179. GOOGLE_DCHECK_NE(&from, this);
  3180. const TestProto2Required* source =
  3181. ::google::protobuf::internal::DynamicCastToGenerated<const TestProto2Required>(
  3182. &from);
  3183. if (source == NULL) {
  3184. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto2_nofieldpresence_unittest.TestProto2Required)
  3185. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  3186. } else {
  3187. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto2_nofieldpresence_unittest.TestProto2Required)
  3188. MergeFrom(*source);
  3189. }
  3190. }
  3191. void TestProto2Required::MergeFrom(const TestProto2Required& from) {
  3192. // @@protoc_insertion_point(class_specific_merge_from_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3193. GOOGLE_DCHECK_NE(&from, this);
  3194. _internal_metadata_.MergeFrom(from._internal_metadata_);
  3195. ::google::protobuf::uint32 cached_has_bits = 0;
  3196. (void) cached_has_bits;
  3197. if (from.has_proto2()) {
  3198. mutable_proto2()->::protobuf_unittest::TestRequired::MergeFrom(from.proto2());
  3199. }
  3200. }
  3201. void TestProto2Required::CopyFrom(const ::google::protobuf::Message& from) {
  3202. // @@protoc_insertion_point(generalized_copy_from_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3203. if (&from == this) return;
  3204. Clear();
  3205. MergeFrom(from);
  3206. }
  3207. void TestProto2Required::CopyFrom(const TestProto2Required& from) {
  3208. // @@protoc_insertion_point(class_specific_copy_from_start:proto2_nofieldpresence_unittest.TestProto2Required)
  3209. if (&from == this) return;
  3210. Clear();
  3211. MergeFrom(from);
  3212. }
  3213. bool TestProto2Required::IsInitialized() const {
  3214. if (has_proto2()) {
  3215. if (!this->proto2_->IsInitialized()) return false;
  3216. }
  3217. return true;
  3218. }
  3219. void TestProto2Required::Swap(TestProto2Required* other) {
  3220. if (other == this) return;
  3221. InternalSwap(other);
  3222. }
  3223. void TestProto2Required::InternalSwap(TestProto2Required* other) {
  3224. using std::swap;
  3225. swap(proto2_, other->proto2_);
  3226. _internal_metadata_.Swap(&other->_internal_metadata_);
  3227. }
  3228. ::google::protobuf::Metadata TestProto2Required::GetMetadata() const {
  3229. protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  3230. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages];
  3231. }
  3232. // ===================================================================
  3233. void ForeignMessage::InitAsDefaultInstance() {
  3234. }
  3235. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  3236. const int ForeignMessage::kCFieldNumber;
  3237. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  3238. ForeignMessage::ForeignMessage()
  3239. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  3240. ::google::protobuf::internal::InitSCC(
  3241. &protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_ForeignMessage.base);
  3242. SharedCtor();
  3243. // @@protoc_insertion_point(constructor:proto2_nofieldpresence_unittest.ForeignMessage)
  3244. }
  3245. ForeignMessage::ForeignMessage(const ForeignMessage& from)
  3246. : ::google::protobuf::Message(),
  3247. _internal_metadata_(NULL) {
  3248. _internal_metadata_.MergeFrom(from._internal_metadata_);
  3249. c_ = from.c_;
  3250. // @@protoc_insertion_point(copy_constructor:proto2_nofieldpresence_unittest.ForeignMessage)
  3251. }
  3252. void ForeignMessage::SharedCtor() {
  3253. c_ = 0;
  3254. }
  3255. ForeignMessage::~ForeignMessage() {
  3256. // @@protoc_insertion_point(destructor:proto2_nofieldpresence_unittest.ForeignMessage)
  3257. SharedDtor();
  3258. }
  3259. void ForeignMessage::SharedDtor() {
  3260. }
  3261. void ForeignMessage::SetCachedSize(int size) const {
  3262. _cached_size_.Set(size);
  3263. }
  3264. const ::google::protobuf::Descriptor* ForeignMessage::descriptor() {
  3265. ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  3266. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  3267. }
  3268. const ForeignMessage& ForeignMessage::default_instance() {
  3269. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::scc_info_ForeignMessage.base);
  3270. return *internal_default_instance();
  3271. }
  3272. void ForeignMessage::Clear() {
  3273. // @@protoc_insertion_point(message_clear_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3274. ::google::protobuf::uint32 cached_has_bits = 0;
  3275. // Prevent compiler warnings about cached_has_bits being unused
  3276. (void) cached_has_bits;
  3277. c_ = 0;
  3278. _internal_metadata_.Clear();
  3279. }
  3280. bool ForeignMessage::MergePartialFromCodedStream(
  3281. ::google::protobuf::io::CodedInputStream* input) {
  3282. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  3283. ::google::protobuf::uint32 tag;
  3284. // @@protoc_insertion_point(parse_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3285. for (;;) {
  3286. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  3287. tag = p.first;
  3288. if (!p.second) goto handle_unusual;
  3289. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  3290. // int32 c = 1;
  3291. case 1: {
  3292. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3293. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  3294. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  3295. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  3296. input, &c_)));
  3297. } else {
  3298. goto handle_unusual;
  3299. }
  3300. break;
  3301. }
  3302. default: {
  3303. handle_unusual:
  3304. if (tag == 0) {
  3305. goto success;
  3306. }
  3307. DO_(::google::protobuf::internal::WireFormat::SkipField(
  3308. input, tag, _internal_metadata_.mutable_unknown_fields()));
  3309. break;
  3310. }
  3311. }
  3312. }
  3313. success:
  3314. // @@protoc_insertion_point(parse_success:proto2_nofieldpresence_unittest.ForeignMessage)
  3315. return true;
  3316. failure:
  3317. // @@protoc_insertion_point(parse_failure:proto2_nofieldpresence_unittest.ForeignMessage)
  3318. return false;
  3319. #undef DO_
  3320. }
  3321. void ForeignMessage::SerializeWithCachedSizes(
  3322. ::google::protobuf::io::CodedOutputStream* output) const {
  3323. // @@protoc_insertion_point(serialize_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3324. ::google::protobuf::uint32 cached_has_bits = 0;
  3325. (void) cached_has_bits;
  3326. // int32 c = 1;
  3327. if (this->c() != 0) {
  3328. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->c(), output);
  3329. }
  3330. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  3331. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  3332. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  3333. }
  3334. // @@protoc_insertion_point(serialize_end:proto2_nofieldpresence_unittest.ForeignMessage)
  3335. }
  3336. ::google::protobuf::uint8* ForeignMessage::InternalSerializeWithCachedSizesToArray(
  3337. bool deterministic, ::google::protobuf::uint8* target) const {
  3338. (void)deterministic; // Unused
  3339. // @@protoc_insertion_point(serialize_to_array_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3340. ::google::protobuf::uint32 cached_has_bits = 0;
  3341. (void) cached_has_bits;
  3342. // int32 c = 1;
  3343. if (this->c() != 0) {
  3344. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->c(), target);
  3345. }
  3346. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  3347. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  3348. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  3349. }
  3350. // @@protoc_insertion_point(serialize_to_array_end:proto2_nofieldpresence_unittest.ForeignMessage)
  3351. return target;
  3352. }
  3353. size_t ForeignMessage::ByteSizeLong() const {
  3354. // @@protoc_insertion_point(message_byte_size_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3355. size_t total_size = 0;
  3356. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  3357. total_size +=
  3358. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  3359. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  3360. }
  3361. // int32 c = 1;
  3362. if (this->c() != 0) {
  3363. total_size += 1 +
  3364. ::google::protobuf::internal::WireFormatLite::Int32Size(
  3365. this->c());
  3366. }
  3367. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  3368. SetCachedSize(cached_size);
  3369. return total_size;
  3370. }
  3371. void ForeignMessage::MergeFrom(const ::google::protobuf::Message& from) {
  3372. // @@protoc_insertion_point(generalized_merge_from_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3373. GOOGLE_DCHECK_NE(&from, this);
  3374. const ForeignMessage* source =
  3375. ::google::protobuf::internal::DynamicCastToGenerated<const ForeignMessage>(
  3376. &from);
  3377. if (source == NULL) {
  3378. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto2_nofieldpresence_unittest.ForeignMessage)
  3379. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  3380. } else {
  3381. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto2_nofieldpresence_unittest.ForeignMessage)
  3382. MergeFrom(*source);
  3383. }
  3384. }
  3385. void ForeignMessage::MergeFrom(const ForeignMessage& from) {
  3386. // @@protoc_insertion_point(class_specific_merge_from_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3387. GOOGLE_DCHECK_NE(&from, this);
  3388. _internal_metadata_.MergeFrom(from._internal_metadata_);
  3389. ::google::protobuf::uint32 cached_has_bits = 0;
  3390. (void) cached_has_bits;
  3391. if (from.c() != 0) {
  3392. set_c(from.c());
  3393. }
  3394. }
  3395. void ForeignMessage::CopyFrom(const ::google::protobuf::Message& from) {
  3396. // @@protoc_insertion_point(generalized_copy_from_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3397. if (&from == this) return;
  3398. Clear();
  3399. MergeFrom(from);
  3400. }
  3401. void ForeignMessage::CopyFrom(const ForeignMessage& from) {
  3402. // @@protoc_insertion_point(class_specific_copy_from_start:proto2_nofieldpresence_unittest.ForeignMessage)
  3403. if (&from == this) return;
  3404. Clear();
  3405. MergeFrom(from);
  3406. }
  3407. bool ForeignMessage::IsInitialized() const {
  3408. return true;
  3409. }
  3410. void ForeignMessage::Swap(ForeignMessage* other) {
  3411. if (other == this) return;
  3412. InternalSwap(other);
  3413. }
  3414. void ForeignMessage::InternalSwap(ForeignMessage* other) {
  3415. using std::swap;
  3416. swap(c_, other->c_);
  3417. _internal_metadata_.Swap(&other->_internal_metadata_);
  3418. }
  3419. ::google::protobuf::Metadata ForeignMessage::GetMetadata() const {
  3420. protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::protobuf_AssignDescriptorsOnce();
  3421. return ::protobuf_google_2fprotobuf_2funittest_5fno_5ffield_5fpresence_2eproto::file_level_metadata[kIndexInFileMessages];
  3422. }
  3423. // @@protoc_insertion_point(namespace_scope)
  3424. } // namespace proto2_nofieldpresence_unittest
  3425. namespace google {
  3426. namespace protobuf {
  3427. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage* Arena::CreateMaybeMessage< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >(Arena* arena) {
  3428. return Arena::CreateInternal< ::proto2_nofieldpresence_unittest::TestAllTypes_NestedMessage >(arena);
  3429. }
  3430. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto2_nofieldpresence_unittest::TestAllTypes* Arena::CreateMaybeMessage< ::proto2_nofieldpresence_unittest::TestAllTypes >(Arena* arena) {
  3431. return Arena::CreateInternal< ::proto2_nofieldpresence_unittest::TestAllTypes >(arena);
  3432. }
  3433. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto2_nofieldpresence_unittest::TestProto2Required* Arena::CreateMaybeMessage< ::proto2_nofieldpresence_unittest::TestProto2Required >(Arena* arena) {
  3434. return Arena::CreateInternal< ::proto2_nofieldpresence_unittest::TestProto2Required >(arena);
  3435. }
  3436. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto2_nofieldpresence_unittest::ForeignMessage* Arena::CreateMaybeMessage< ::proto2_nofieldpresence_unittest::ForeignMessage >(Arena* arena) {
  3437. return Arena::CreateInternal< ::proto2_nofieldpresence_unittest::ForeignMessage >(arena);
  3438. }
  3439. } // namespace protobuf
  3440. } // namespace google
  3441. // @@protoc_insertion_point(global_scope)