unittest_no_arena.pb.cc 231 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_no_arena.proto
  3. #include <google/protobuf/unittest_no_arena.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_5farena_2eproto {
  19. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5farena_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_ArenaMessage;
  20. } // namespace protobuf_google_2fprotobuf_2funittest_5farena_2eproto
  21. namespace protobuf_google_2fprotobuf_2funittest_5fimport_2eproto {
  22. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fimport_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ImportMessage;
  23. } // namespace protobuf_google_2fprotobuf_2funittest_5fimport_2eproto
  24. namespace protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto {
  25. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_PublicImportMessage;
  26. } // namespace protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto
  27. namespace protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto {
  28. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ForeignMessage;
  29. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_NestedMessage;
  30. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_OptionalGroup;
  31. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_RepeatedGroup;
  32. } // namespace protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto
  33. namespace protobuf_unittest_no_arena {
  34. class TestAllTypes_NestedMessageDefaultTypeInternal {
  35. public:
  36. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes_NestedMessage>
  37. _instance;
  38. } _TestAllTypes_NestedMessage_default_instance_;
  39. class TestAllTypes_OptionalGroupDefaultTypeInternal {
  40. public:
  41. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes_OptionalGroup>
  42. _instance;
  43. } _TestAllTypes_OptionalGroup_default_instance_;
  44. class TestAllTypes_RepeatedGroupDefaultTypeInternal {
  45. public:
  46. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes_RepeatedGroup>
  47. _instance;
  48. } _TestAllTypes_RepeatedGroup_default_instance_;
  49. class TestAllTypesDefaultTypeInternal {
  50. public:
  51. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes>
  52. _instance;
  53. ::google::protobuf::uint32 oneof_uint32_;
  54. const ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage* oneof_nested_message_;
  55. ::google::protobuf::internal::ArenaStringPtr oneof_string_;
  56. ::google::protobuf::internal::ArenaStringPtr oneof_bytes_;
  57. const ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage* lazy_oneof_nested_message_;
  58. } _TestAllTypes_default_instance_;
  59. class ForeignMessageDefaultTypeInternal {
  60. public:
  61. ::google::protobuf::internal::ExplicitlyConstructed<ForeignMessage>
  62. _instance;
  63. } _ForeignMessage_default_instance_;
  64. class TestNoArenaMessageDefaultTypeInternal {
  65. public:
  66. ::google::protobuf::internal::ExplicitlyConstructed<TestNoArenaMessage>
  67. _instance;
  68. } _TestNoArenaMessage_default_instance_;
  69. } // namespace protobuf_unittest_no_arena
  70. namespace protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto {
  71. static void InitDefaultsTestAllTypes_NestedMessage() {
  72. GOOGLE_PROTOBUF_VERIFY_VERSION;
  73. {
  74. void* ptr = &::protobuf_unittest_no_arena::_TestAllTypes_NestedMessage_default_instance_;
  75. new (ptr) ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage();
  76. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  77. }
  78. ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::InitAsDefaultInstance();
  79. }
  80. ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_NestedMessage =
  81. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestAllTypes_NestedMessage}, {}};
  82. static void InitDefaultsTestAllTypes_OptionalGroup() {
  83. GOOGLE_PROTOBUF_VERIFY_VERSION;
  84. {
  85. void* ptr = &::protobuf_unittest_no_arena::_TestAllTypes_OptionalGroup_default_instance_;
  86. new (ptr) ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup();
  87. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  88. }
  89. ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup::InitAsDefaultInstance();
  90. }
  91. ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_OptionalGroup =
  92. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestAllTypes_OptionalGroup}, {}};
  93. static void InitDefaultsTestAllTypes_RepeatedGroup() {
  94. GOOGLE_PROTOBUF_VERIFY_VERSION;
  95. {
  96. void* ptr = &::protobuf_unittest_no_arena::_TestAllTypes_RepeatedGroup_default_instance_;
  97. new (ptr) ::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup();
  98. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  99. }
  100. ::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup::InitAsDefaultInstance();
  101. }
  102. ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_RepeatedGroup =
  103. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestAllTypes_RepeatedGroup}, {}};
  104. static void InitDefaultsTestAllTypes() {
  105. GOOGLE_PROTOBUF_VERIFY_VERSION;
  106. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.DefaultConstruct();
  107. *::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get_mutable() = ::std::string("hello", 5);
  108. ::google::protobuf::internal::OnShutdownDestroyString(
  109. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get_mutable());
  110. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.DefaultConstruct();
  111. *::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get_mutable() = ::std::string("world", 5);
  112. ::google::protobuf::internal::OnShutdownDestroyString(
  113. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get_mutable());
  114. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.DefaultConstruct();
  115. *::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get_mutable() = ::std::string("abc", 3);
  116. ::google::protobuf::internal::OnShutdownDestroyString(
  117. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get_mutable());
  118. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.DefaultConstruct();
  119. *::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get_mutable() = ::std::string("123", 3);
  120. ::google::protobuf::internal::OnShutdownDestroyString(
  121. ::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get_mutable());
  122. {
  123. void* ptr = &::protobuf_unittest_no_arena::_TestAllTypes_default_instance_;
  124. new (ptr) ::protobuf_unittest_no_arena::TestAllTypes();
  125. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  126. }
  127. ::protobuf_unittest_no_arena::TestAllTypes::InitAsDefaultInstance();
  128. }
  129. ::google::protobuf::internal::SCCInfo<6> scc_info_TestAllTypes =
  130. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 6, InitDefaultsTestAllTypes}, {
  131. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_OptionalGroup.base,
  132. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_NestedMessage.base,
  133. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_ForeignMessage.base,
  134. &protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::scc_info_ImportMessage.base,
  135. &protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::scc_info_PublicImportMessage.base,
  136. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_RepeatedGroup.base,}};
  137. static void InitDefaultsForeignMessage() {
  138. GOOGLE_PROTOBUF_VERIFY_VERSION;
  139. {
  140. void* ptr = &::protobuf_unittest_no_arena::_ForeignMessage_default_instance_;
  141. new (ptr) ::protobuf_unittest_no_arena::ForeignMessage();
  142. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  143. }
  144. ::protobuf_unittest_no_arena::ForeignMessage::InitAsDefaultInstance();
  145. }
  146. ::google::protobuf::internal::SCCInfo<0> scc_info_ForeignMessage =
  147. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsForeignMessage}, {}};
  148. static void InitDefaultsTestNoArenaMessage() {
  149. GOOGLE_PROTOBUF_VERIFY_VERSION;
  150. {
  151. void* ptr = &::protobuf_unittest_no_arena::_TestNoArenaMessage_default_instance_;
  152. new (ptr) ::protobuf_unittest_no_arena::TestNoArenaMessage();
  153. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  154. }
  155. ::protobuf_unittest_no_arena::TestNoArenaMessage::InitAsDefaultInstance();
  156. }
  157. ::google::protobuf::internal::SCCInfo<1> scc_info_TestNoArenaMessage =
  158. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTestNoArenaMessage}, {
  159. &protobuf_google_2fprotobuf_2funittest_5farena_2eproto::scc_info_ArenaMessage.base,}};
  160. void InitDefaults() {
  161. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes_NestedMessage.base);
  162. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes_OptionalGroup.base);
  163. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes_RepeatedGroup.base);
  164. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes.base);
  165. ::google::protobuf::internal::InitSCC(&scc_info_ForeignMessage.base);
  166. ::google::protobuf::internal::InitSCC(&scc_info_TestNoArenaMessage.base);
  167. }
  168. ::google::protobuf::Metadata file_level_metadata[6];
  169. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
  170. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  171. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_NestedMessage, _has_bits_),
  172. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_NestedMessage, _internal_metadata_),
  173. ~0u, // no _extensions_
  174. ~0u, // no _oneof_case_
  175. ~0u, // no _weak_field_map_
  176. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_NestedMessage, bb_),
  177. 0,
  178. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup, _has_bits_),
  179. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup, _internal_metadata_),
  180. ~0u, // no _extensions_
  181. ~0u, // no _oneof_case_
  182. ~0u, // no _weak_field_map_
  183. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup, a_),
  184. 0,
  185. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup, _has_bits_),
  186. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup, _internal_metadata_),
  187. ~0u, // no _extensions_
  188. ~0u, // no _oneof_case_
  189. ~0u, // no _weak_field_map_
  190. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup, a_),
  191. 0,
  192. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, _has_bits_),
  193. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, _internal_metadata_),
  194. ~0u, // no _extensions_
  195. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, _oneof_case_[0]),
  196. ~0u, // no _weak_field_map_
  197. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_int32_),
  198. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_int64_),
  199. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_uint32_),
  200. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_uint64_),
  201. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_sint32_),
  202. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_sint64_),
  203. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_fixed32_),
  204. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_fixed64_),
  205. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_sfixed32_),
  206. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_sfixed64_),
  207. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_float_),
  208. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_double_),
  209. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_bool_),
  210. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_string_),
  211. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_bytes_),
  212. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optionalgroup_),
  213. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_nested_message_),
  214. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_foreign_message_),
  215. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_import_message_),
  216. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_nested_enum_),
  217. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_foreign_enum_),
  218. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_import_enum_),
  219. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_string_piece_),
  220. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_cord_),
  221. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_public_import_message_),
  222. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, optional_message_),
  223. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_int32_),
  224. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_int64_),
  225. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_uint32_),
  226. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_uint64_),
  227. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_sint32_),
  228. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_sint64_),
  229. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_fixed32_),
  230. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_fixed64_),
  231. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_sfixed32_),
  232. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_sfixed64_),
  233. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_float_),
  234. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_double_),
  235. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_bool_),
  236. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_string_),
  237. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_bytes_),
  238. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeatedgroup_),
  239. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_nested_message_),
  240. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_foreign_message_),
  241. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_import_message_),
  242. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_nested_enum_),
  243. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_foreign_enum_),
  244. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_import_enum_),
  245. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_string_piece_),
  246. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_cord_),
  247. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, repeated_lazy_message_),
  248. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_int32_),
  249. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_int64_),
  250. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_uint32_),
  251. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_uint64_),
  252. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_sint32_),
  253. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_sint64_),
  254. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_fixed32_),
  255. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_fixed64_),
  256. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_sfixed32_),
  257. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_sfixed64_),
  258. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_float_),
  259. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_double_),
  260. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_bool_),
  261. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_string_),
  262. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_bytes_),
  263. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_nested_enum_),
  264. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_foreign_enum_),
  265. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_import_enum_),
  266. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_string_piece_),
  267. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, default_cord_),
  268. offsetof(::protobuf_unittest_no_arena::TestAllTypesDefaultTypeInternal, oneof_uint32_),
  269. offsetof(::protobuf_unittest_no_arena::TestAllTypesDefaultTypeInternal, oneof_nested_message_),
  270. offsetof(::protobuf_unittest_no_arena::TestAllTypesDefaultTypeInternal, oneof_string_),
  271. offsetof(::protobuf_unittest_no_arena::TestAllTypesDefaultTypeInternal, oneof_bytes_),
  272. offsetof(::protobuf_unittest_no_arena::TestAllTypesDefaultTypeInternal, lazy_oneof_nested_message_),
  273. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestAllTypes, oneof_field_),
  274. 15,
  275. 14,
  276. 16,
  277. 17,
  278. 19,
  279. 18,
  280. 20,
  281. 21,
  282. 23,
  283. 22,
  284. 24,
  285. 25,
  286. 26,
  287. 0,
  288. 1,
  289. 8,
  290. 9,
  291. 10,
  292. 11,
  293. 28,
  294. 29,
  295. 30,
  296. 2,
  297. 3,
  298. 12,
  299. 13,
  300. ~0u,
  301. ~0u,
  302. ~0u,
  303. ~0u,
  304. ~0u,
  305. ~0u,
  306. ~0u,
  307. ~0u,
  308. ~0u,
  309. ~0u,
  310. ~0u,
  311. ~0u,
  312. ~0u,
  313. ~0u,
  314. ~0u,
  315. ~0u,
  316. ~0u,
  317. ~0u,
  318. ~0u,
  319. ~0u,
  320. ~0u,
  321. ~0u,
  322. ~0u,
  323. ~0u,
  324. ~0u,
  325. 31,
  326. 32,
  327. 34,
  328. 33,
  329. 35,
  330. 36,
  331. 38,
  332. 37,
  333. 39,
  334. 40,
  335. 42,
  336. 41,
  337. 43,
  338. 4,
  339. 5,
  340. 44,
  341. 45,
  342. 27,
  343. 6,
  344. 7,
  345. ~0u,
  346. ~0u,
  347. ~0u,
  348. ~0u,
  349. ~0u,
  350. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::ForeignMessage, _has_bits_),
  351. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::ForeignMessage, _internal_metadata_),
  352. ~0u, // no _extensions_
  353. ~0u, // no _oneof_case_
  354. ~0u, // no _weak_field_map_
  355. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::ForeignMessage, c_),
  356. 0,
  357. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestNoArenaMessage, _has_bits_),
  358. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestNoArenaMessage, _internal_metadata_),
  359. ~0u, // no _extensions_
  360. ~0u, // no _oneof_case_
  361. ~0u, // no _weak_field_map_
  362. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_no_arena::TestNoArenaMessage, arena_message_),
  363. 0,
  364. };
  365. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  366. { 0, 6, sizeof(::protobuf_unittest_no_arena::TestAllTypes_NestedMessage)},
  367. { 7, 13, sizeof(::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup)},
  368. { 14, 20, sizeof(::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup)},
  369. { 21, 103, sizeof(::protobuf_unittest_no_arena::TestAllTypes)},
  370. { 179, 185, sizeof(::protobuf_unittest_no_arena::ForeignMessage)},
  371. { 186, 192, sizeof(::protobuf_unittest_no_arena::TestNoArenaMessage)},
  372. };
  373. static ::google::protobuf::Message const * const file_default_instances[] = {
  374. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_no_arena::_TestAllTypes_NestedMessage_default_instance_),
  375. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_no_arena::_TestAllTypes_OptionalGroup_default_instance_),
  376. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_no_arena::_TestAllTypes_RepeatedGroup_default_instance_),
  377. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_no_arena::_TestAllTypes_default_instance_),
  378. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_no_arena::_ForeignMessage_default_instance_),
  379. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_no_arena::_TestNoArenaMessage_default_instance_),
  380. };
  381. void protobuf_AssignDescriptors() {
  382. AddDescriptors();
  383. AssignDescriptors(
  384. "google/protobuf/unittest_no_arena.proto", schemas, file_default_instances, TableStruct::offsets,
  385. file_level_metadata, file_level_enum_descriptors, NULL);
  386. }
  387. void protobuf_AssignDescriptorsOnce() {
  388. static ::google::protobuf::internal::once_flag once;
  389. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  390. }
  391. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  392. void protobuf_RegisterTypes(const ::std::string&) {
  393. protobuf_AssignDescriptorsOnce();
  394. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 6);
  395. }
  396. void AddDescriptorsImpl() {
  397. InitDefaults();
  398. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  399. "\n\'google/protobuf/unittest_no_arena.prot"
  400. "o\022\032protobuf_unittest_no_arena\032%google/pr"
  401. "otobuf/unittest_import.proto\032$google/pro"
  402. "tobuf/unittest_arena.proto\"\320\032\n\014TestAllTy"
  403. "pes\022\026\n\016optional_int32\030\001 \001(\005\022\026\n\016optional_"
  404. "int64\030\002 \001(\003\022\027\n\017optional_uint32\030\003 \001(\r\022\027\n\017"
  405. "optional_uint64\030\004 \001(\004\022\027\n\017optional_sint32"
  406. "\030\005 \001(\021\022\027\n\017optional_sint64\030\006 \001(\022\022\030\n\020optio"
  407. "nal_fixed32\030\007 \001(\007\022\030\n\020optional_fixed64\030\010 "
  408. "\001(\006\022\031\n\021optional_sfixed32\030\t \001(\017\022\031\n\021option"
  409. "al_sfixed64\030\n \001(\020\022\026\n\016optional_float\030\013 \001("
  410. "\002\022\027\n\017optional_double\030\014 \001(\001\022\025\n\roptional_b"
  411. "ool\030\r \001(\010\022\027\n\017optional_string\030\016 \001(\t\022\026\n\016op"
  412. "tional_bytes\030\017 \001(\014\022M\n\roptionalgroup\030\020 \001("
  413. "\n26.protobuf_unittest_no_arena.TestAllTy"
  414. "pes.OptionalGroup\022W\n\027optional_nested_mes"
  415. "sage\030\022 \001(\01326.protobuf_unittest_no_arena."
  416. "TestAllTypes.NestedMessage\022L\n\030optional_f"
  417. "oreign_message\030\023 \001(\0132*.protobuf_unittest"
  418. "_no_arena.ForeignMessage\022H\n\027optional_imp"
  419. "ort_message\030\024 \001(\0132\'.protobuf_unittest_im"
  420. "port.ImportMessage\022Q\n\024optional_nested_en"
  421. "um\030\025 \001(\01623.protobuf_unittest_no_arena.Te"
  422. "stAllTypes.NestedEnum\022F\n\025optional_foreig"
  423. "n_enum\030\026 \001(\0162\'.protobuf_unittest_no_aren"
  424. "a.ForeignEnum\022B\n\024optional_import_enum\030\027 "
  425. "\001(\0162$.protobuf_unittest_import.ImportEnu"
  426. "m\022!\n\025optional_string_piece\030\030 \001(\tB\002\010\002\022\031\n\r"
  427. "optional_cord\030\031 \001(\tB\002\010\001\022U\n\036optional_publ"
  428. "ic_import_message\030\032 \001(\0132-.protobuf_unitt"
  429. "est_import.PublicImportMessage\022T\n\020option"
  430. "al_message\030\033 \001(\01326.protobuf_unittest_no_"
  431. "arena.TestAllTypes.NestedMessageB\002(\001\022\026\n\016"
  432. "repeated_int32\030\037 \003(\005\022\026\n\016repeated_int64\030 "
  433. " \003(\003\022\027\n\017repeated_uint32\030! \003(\r\022\027\n\017repeate"
  434. "d_uint64\030\" \003(\004\022\027\n\017repeated_sint32\030# \003(\021\022"
  435. "\027\n\017repeated_sint64\030$ \003(\022\022\030\n\020repeated_fix"
  436. "ed32\030% \003(\007\022\030\n\020repeated_fixed64\030& \003(\006\022\031\n\021"
  437. "repeated_sfixed32\030\' \003(\017\022\031\n\021repeated_sfix"
  438. "ed64\030( \003(\020\022\026\n\016repeated_float\030) \003(\002\022\027\n\017re"
  439. "peated_double\030* \003(\001\022\025\n\rrepeated_bool\030+ \003"
  440. "(\010\022\027\n\017repeated_string\030, \003(\t\022\026\n\016repeated_"
  441. "bytes\030- \003(\014\022M\n\rrepeatedgroup\030. \003(\n26.pro"
  442. "tobuf_unittest_no_arena.TestAllTypes.Rep"
  443. "eatedGroup\022W\n\027repeated_nested_message\0300 "
  444. "\003(\01326.protobuf_unittest_no_arena.TestAll"
  445. "Types.NestedMessage\022L\n\030repeated_foreign_"
  446. "message\0301 \003(\0132*.protobuf_unittest_no_are"
  447. "na.ForeignMessage\022H\n\027repeated_import_mes"
  448. "sage\0302 \003(\0132\'.protobuf_unittest_import.Im"
  449. "portMessage\022Q\n\024repeated_nested_enum\0303 \003("
  450. "\01623.protobuf_unittest_no_arena.TestAllTy"
  451. "pes.NestedEnum\022F\n\025repeated_foreign_enum\030"
  452. "4 \003(\0162\'.protobuf_unittest_no_arena.Forei"
  453. "gnEnum\022B\n\024repeated_import_enum\0305 \003(\0162$.p"
  454. "rotobuf_unittest_import.ImportEnum\022!\n\025re"
  455. "peated_string_piece\0306 \003(\tB\002\010\002\022\031\n\rrepeate"
  456. "d_cord\0307 \003(\tB\002\010\001\022Y\n\025repeated_lazy_messag"
  457. "e\0309 \003(\01326.protobuf_unittest_no_arena.Tes"
  458. "tAllTypes.NestedMessageB\002(\001\022\031\n\rdefault_i"
  459. "nt32\030= \001(\005:\00241\022\031\n\rdefault_int64\030> \001(\003:\0024"
  460. "2\022\032\n\016default_uint32\030\? \001(\r:\00243\022\032\n\016default"
  461. "_uint64\030@ \001(\004:\00244\022\033\n\016default_sint32\030A \001("
  462. "\021:\003-45\022\032\n\016default_sint64\030B \001(\022:\00246\022\033\n\017de"
  463. "fault_fixed32\030C \001(\007:\00247\022\033\n\017default_fixed"
  464. "64\030D \001(\006:\00248\022\034\n\020default_sfixed32\030E \001(\017:\002"
  465. "49\022\035\n\020default_sfixed64\030F \001(\020:\003-50\022\033\n\rdef"
  466. "ault_float\030G \001(\002:\00451.5\022\035\n\016default_double"
  467. "\030H \001(\001:\00552000\022\032\n\014default_bool\030I \001(\010:\004tru"
  468. "e\022\035\n\016default_string\030J \001(\t:\005hello\022\034\n\rdefa"
  469. "ult_bytes\030K \001(\014:\005world\022U\n\023default_nested"
  470. "_enum\030Q \001(\01623.protobuf_unittest_no_arena"
  471. ".TestAllTypes.NestedEnum:\003BAR\022R\n\024default"
  472. "_foreign_enum\030R \001(\0162\'.protobuf_unittest_"
  473. "no_arena.ForeignEnum:\013FOREIGN_BAR\022M\n\023def"
  474. "ault_import_enum\030S \001(\0162$.protobuf_unitte"
  475. "st_import.ImportEnum:\nIMPORT_BAR\022%\n\024defa"
  476. "ult_string_piece\030T \001(\t:\003abcB\002\010\002\022\035\n\014defau"
  477. "lt_cord\030U \001(\t:\003123B\002\010\001\022\026\n\014oneof_uint32\030o"
  478. " \001(\rH\000\022V\n\024oneof_nested_message\030p \001(\01326.p"
  479. "rotobuf_unittest_no_arena.TestAllTypes.N"
  480. "estedMessageH\000\022\026\n\014oneof_string\030q \001(\tH\000\022\025"
  481. "\n\013oneof_bytes\030r \001(\014H\000\022_\n\031lazy_oneof_nest"
  482. "ed_message\030s \001(\01326.protobuf_unittest_no_"
  483. "arena.TestAllTypes.NestedMessageB\002(\001H\000\032\033"
  484. "\n\rNestedMessage\022\n\n\002bb\030\001 \001(\005\032\032\n\rOptionalG"
  485. "roup\022\t\n\001a\030\021 \001(\005\032\032\n\rRepeatedGroup\022\t\n\001a\030/ "
  486. "\001(\005\"9\n\nNestedEnum\022\007\n\003FOO\020\001\022\007\n\003BAR\020\002\022\007\n\003B"
  487. "AZ\020\003\022\020\n\003NEG\020\377\377\377\377\377\377\377\377\377\001B\r\n\013oneof_field\"\033\n"
  488. "\016ForeignMessage\022\t\n\001c\030\001 \001(\005\"P\n\022TestNoAren"
  489. "aMessage\022:\n\rarena_message\030\001 \001(\0132#.proto2"
  490. "_arena_unittest.ArenaMessage*@\n\013ForeignE"
  491. "num\022\017\n\013FOREIGN_FOO\020\004\022\017\n\013FOREIGN_BAR\020\005\022\017\n"
  492. "\013FOREIGN_BAZ\020\006B%B\rUnittestProtoH\001\200\001\001\210\001\001\220"
  493. "\001\001\370\001\000\242\002\005NOARN"
  494. };
  495. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  496. descriptor, 3773);
  497. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  498. "google/protobuf/unittest_no_arena.proto", &protobuf_RegisterTypes);
  499. ::protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::AddDescriptors();
  500. ::protobuf_google_2fprotobuf_2funittest_5farena_2eproto::AddDescriptors();
  501. }
  502. void AddDescriptors() {
  503. static ::google::protobuf::internal::once_flag once;
  504. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  505. }
  506. // Force AddDescriptors() to be called at dynamic initialization time.
  507. struct StaticDescriptorInitializer {
  508. StaticDescriptorInitializer() {
  509. AddDescriptors();
  510. }
  511. } static_descriptor_initializer;
  512. } // namespace protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto
  513. namespace protobuf_unittest_no_arena {
  514. const ::google::protobuf::EnumDescriptor* TestAllTypes_NestedEnum_descriptor() {
  515. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  516. return protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_enum_descriptors[0];
  517. }
  518. bool TestAllTypes_NestedEnum_IsValid(int value) {
  519. switch (value) {
  520. case -1:
  521. case 1:
  522. case 2:
  523. case 3:
  524. return true;
  525. default:
  526. return false;
  527. }
  528. }
  529. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  530. const TestAllTypes_NestedEnum TestAllTypes::FOO;
  531. const TestAllTypes_NestedEnum TestAllTypes::BAR;
  532. const TestAllTypes_NestedEnum TestAllTypes::BAZ;
  533. const TestAllTypes_NestedEnum TestAllTypes::NEG;
  534. const TestAllTypes_NestedEnum TestAllTypes::NestedEnum_MIN;
  535. const TestAllTypes_NestedEnum TestAllTypes::NestedEnum_MAX;
  536. const int TestAllTypes::NestedEnum_ARRAYSIZE;
  537. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  538. const ::google::protobuf::EnumDescriptor* ForeignEnum_descriptor() {
  539. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  540. return protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_enum_descriptors[1];
  541. }
  542. bool ForeignEnum_IsValid(int value) {
  543. switch (value) {
  544. case 4:
  545. case 5:
  546. case 6:
  547. return true;
  548. default:
  549. return false;
  550. }
  551. }
  552. // ===================================================================
  553. void TestAllTypes_NestedMessage::InitAsDefaultInstance() {
  554. }
  555. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  556. const int TestAllTypes_NestedMessage::kBbFieldNumber;
  557. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  558. TestAllTypes_NestedMessage::TestAllTypes_NestedMessage()
  559. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  560. ::google::protobuf::internal::InitSCC(
  561. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_NestedMessage.base);
  562. SharedCtor();
  563. // @@protoc_insertion_point(constructor:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  564. }
  565. TestAllTypes_NestedMessage::TestAllTypes_NestedMessage(const TestAllTypes_NestedMessage& from)
  566. : ::google::protobuf::Message(),
  567. _internal_metadata_(NULL),
  568. _has_bits_(from._has_bits_) {
  569. _internal_metadata_.MergeFrom(from._internal_metadata_);
  570. bb_ = from.bb_;
  571. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  572. }
  573. void TestAllTypes_NestedMessage::SharedCtor() {
  574. bb_ = 0;
  575. }
  576. TestAllTypes_NestedMessage::~TestAllTypes_NestedMessage() {
  577. // @@protoc_insertion_point(destructor:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  578. SharedDtor();
  579. }
  580. void TestAllTypes_NestedMessage::SharedDtor() {
  581. }
  582. void TestAllTypes_NestedMessage::SetCachedSize(int size) const {
  583. _cached_size_.Set(size);
  584. }
  585. const ::google::protobuf::Descriptor* TestAllTypes_NestedMessage::descriptor() {
  586. ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  587. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  588. }
  589. const TestAllTypes_NestedMessage& TestAllTypes_NestedMessage::default_instance() {
  590. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_NestedMessage.base);
  591. return *internal_default_instance();
  592. }
  593. void TestAllTypes_NestedMessage::Clear() {
  594. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  595. ::google::protobuf::uint32 cached_has_bits = 0;
  596. // Prevent compiler warnings about cached_has_bits being unused
  597. (void) cached_has_bits;
  598. bb_ = 0;
  599. _has_bits_.Clear();
  600. _internal_metadata_.Clear();
  601. }
  602. bool TestAllTypes_NestedMessage::MergePartialFromCodedStream(
  603. ::google::protobuf::io::CodedInputStream* input) {
  604. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  605. ::google::protobuf::uint32 tag;
  606. // @@protoc_insertion_point(parse_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  607. for (;;) {
  608. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  609. tag = p.first;
  610. if (!p.second) goto handle_unusual;
  611. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  612. // optional int32 bb = 1;
  613. case 1: {
  614. if (static_cast< ::google::protobuf::uint8>(tag) ==
  615. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  616. set_has_bb();
  617. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  618. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  619. input, &bb_)));
  620. } else {
  621. goto handle_unusual;
  622. }
  623. break;
  624. }
  625. default: {
  626. handle_unusual:
  627. if (tag == 0) {
  628. goto success;
  629. }
  630. DO_(::google::protobuf::internal::WireFormat::SkipField(
  631. input, tag, _internal_metadata_.mutable_unknown_fields()));
  632. break;
  633. }
  634. }
  635. }
  636. success:
  637. // @@protoc_insertion_point(parse_success:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  638. return true;
  639. failure:
  640. // @@protoc_insertion_point(parse_failure:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  641. return false;
  642. #undef DO_
  643. }
  644. void TestAllTypes_NestedMessage::SerializeWithCachedSizes(
  645. ::google::protobuf::io::CodedOutputStream* output) const {
  646. // @@protoc_insertion_point(serialize_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  647. ::google::protobuf::uint32 cached_has_bits = 0;
  648. (void) cached_has_bits;
  649. cached_has_bits = _has_bits_[0];
  650. // optional int32 bb = 1;
  651. if (cached_has_bits & 0x00000001u) {
  652. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->bb(), output);
  653. }
  654. if (_internal_metadata_.have_unknown_fields()) {
  655. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  656. _internal_metadata_.unknown_fields(), output);
  657. }
  658. // @@protoc_insertion_point(serialize_end:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  659. }
  660. ::google::protobuf::uint8* TestAllTypes_NestedMessage::InternalSerializeWithCachedSizesToArray(
  661. bool deterministic, ::google::protobuf::uint8* target) const {
  662. (void)deterministic; // Unused
  663. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  664. ::google::protobuf::uint32 cached_has_bits = 0;
  665. (void) cached_has_bits;
  666. cached_has_bits = _has_bits_[0];
  667. // optional int32 bb = 1;
  668. if (cached_has_bits & 0x00000001u) {
  669. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->bb(), target);
  670. }
  671. if (_internal_metadata_.have_unknown_fields()) {
  672. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  673. _internal_metadata_.unknown_fields(), target);
  674. }
  675. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  676. return target;
  677. }
  678. size_t TestAllTypes_NestedMessage::ByteSizeLong() const {
  679. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  680. size_t total_size = 0;
  681. if (_internal_metadata_.have_unknown_fields()) {
  682. total_size +=
  683. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  684. _internal_metadata_.unknown_fields());
  685. }
  686. // optional int32 bb = 1;
  687. if (has_bb()) {
  688. total_size += 1 +
  689. ::google::protobuf::internal::WireFormatLite::Int32Size(
  690. this->bb());
  691. }
  692. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  693. SetCachedSize(cached_size);
  694. return total_size;
  695. }
  696. void TestAllTypes_NestedMessage::MergeFrom(const ::google::protobuf::Message& from) {
  697. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  698. GOOGLE_DCHECK_NE(&from, this);
  699. const TestAllTypes_NestedMessage* source =
  700. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes_NestedMessage>(
  701. &from);
  702. if (source == NULL) {
  703. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  704. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  705. } else {
  706. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  707. MergeFrom(*source);
  708. }
  709. }
  710. void TestAllTypes_NestedMessage::MergeFrom(const TestAllTypes_NestedMessage& from) {
  711. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  712. GOOGLE_DCHECK_NE(&from, this);
  713. _internal_metadata_.MergeFrom(from._internal_metadata_);
  714. ::google::protobuf::uint32 cached_has_bits = 0;
  715. (void) cached_has_bits;
  716. if (from.has_bb()) {
  717. set_bb(from.bb());
  718. }
  719. }
  720. void TestAllTypes_NestedMessage::CopyFrom(const ::google::protobuf::Message& from) {
  721. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  722. if (&from == this) return;
  723. Clear();
  724. MergeFrom(from);
  725. }
  726. void TestAllTypes_NestedMessage::CopyFrom(const TestAllTypes_NestedMessage& from) {
  727. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_no_arena.TestAllTypes.NestedMessage)
  728. if (&from == this) return;
  729. Clear();
  730. MergeFrom(from);
  731. }
  732. bool TestAllTypes_NestedMessage::IsInitialized() const {
  733. return true;
  734. }
  735. void TestAllTypes_NestedMessage::Swap(TestAllTypes_NestedMessage* other) {
  736. if (other == this) return;
  737. InternalSwap(other);
  738. }
  739. void TestAllTypes_NestedMessage::InternalSwap(TestAllTypes_NestedMessage* other) {
  740. using std::swap;
  741. swap(bb_, other->bb_);
  742. swap(_has_bits_[0], other->_has_bits_[0]);
  743. _internal_metadata_.Swap(&other->_internal_metadata_);
  744. }
  745. ::google::protobuf::Metadata TestAllTypes_NestedMessage::GetMetadata() const {
  746. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  747. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  748. }
  749. // ===================================================================
  750. void TestAllTypes_OptionalGroup::InitAsDefaultInstance() {
  751. }
  752. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  753. const int TestAllTypes_OptionalGroup::kAFieldNumber;
  754. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  755. TestAllTypes_OptionalGroup::TestAllTypes_OptionalGroup()
  756. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  757. ::google::protobuf::internal::InitSCC(
  758. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_OptionalGroup.base);
  759. SharedCtor();
  760. // @@protoc_insertion_point(constructor:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  761. }
  762. TestAllTypes_OptionalGroup::TestAllTypes_OptionalGroup(const TestAllTypes_OptionalGroup& from)
  763. : ::google::protobuf::Message(),
  764. _internal_metadata_(NULL),
  765. _has_bits_(from._has_bits_) {
  766. _internal_metadata_.MergeFrom(from._internal_metadata_);
  767. a_ = from.a_;
  768. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  769. }
  770. void TestAllTypes_OptionalGroup::SharedCtor() {
  771. a_ = 0;
  772. }
  773. TestAllTypes_OptionalGroup::~TestAllTypes_OptionalGroup() {
  774. // @@protoc_insertion_point(destructor:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  775. SharedDtor();
  776. }
  777. void TestAllTypes_OptionalGroup::SharedDtor() {
  778. }
  779. void TestAllTypes_OptionalGroup::SetCachedSize(int size) const {
  780. _cached_size_.Set(size);
  781. }
  782. const ::google::protobuf::Descriptor* TestAllTypes_OptionalGroup::descriptor() {
  783. ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  784. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  785. }
  786. const TestAllTypes_OptionalGroup& TestAllTypes_OptionalGroup::default_instance() {
  787. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_OptionalGroup.base);
  788. return *internal_default_instance();
  789. }
  790. void TestAllTypes_OptionalGroup::Clear() {
  791. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  792. ::google::protobuf::uint32 cached_has_bits = 0;
  793. // Prevent compiler warnings about cached_has_bits being unused
  794. (void) cached_has_bits;
  795. a_ = 0;
  796. _has_bits_.Clear();
  797. _internal_metadata_.Clear();
  798. }
  799. bool TestAllTypes_OptionalGroup::MergePartialFromCodedStream(
  800. ::google::protobuf::io::CodedInputStream* input) {
  801. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  802. ::google::protobuf::uint32 tag;
  803. // @@protoc_insertion_point(parse_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  804. for (;;) {
  805. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  806. tag = p.first;
  807. if (!p.second) goto handle_unusual;
  808. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  809. // optional int32 a = 17;
  810. case 17: {
  811. if (static_cast< ::google::protobuf::uint8>(tag) ==
  812. static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) {
  813. set_has_a();
  814. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  815. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  816. input, &a_)));
  817. } else {
  818. goto handle_unusual;
  819. }
  820. break;
  821. }
  822. default: {
  823. handle_unusual:
  824. if (tag == 0 ||
  825. ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  826. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  827. input->SetLastTag(tag);
  828. goto success;
  829. }
  830. DO_(::google::protobuf::internal::WireFormat::SkipField(
  831. input, tag, _internal_metadata_.mutable_unknown_fields()));
  832. break;
  833. }
  834. }
  835. }
  836. success:
  837. // @@protoc_insertion_point(parse_success:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  838. return true;
  839. failure:
  840. // @@protoc_insertion_point(parse_failure:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  841. return false;
  842. #undef DO_
  843. }
  844. void TestAllTypes_OptionalGroup::SerializeWithCachedSizes(
  845. ::google::protobuf::io::CodedOutputStream* output) const {
  846. // @@protoc_insertion_point(serialize_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  847. ::google::protobuf::uint32 cached_has_bits = 0;
  848. (void) cached_has_bits;
  849. cached_has_bits = _has_bits_[0];
  850. // optional int32 a = 17;
  851. if (cached_has_bits & 0x00000001u) {
  852. ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->a(), output);
  853. }
  854. if (_internal_metadata_.have_unknown_fields()) {
  855. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  856. _internal_metadata_.unknown_fields(), output);
  857. }
  858. // @@protoc_insertion_point(serialize_end:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  859. }
  860. ::google::protobuf::uint8* TestAllTypes_OptionalGroup::InternalSerializeWithCachedSizesToArray(
  861. bool deterministic, ::google::protobuf::uint8* target) const {
  862. (void)deterministic; // Unused
  863. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  864. ::google::protobuf::uint32 cached_has_bits = 0;
  865. (void) cached_has_bits;
  866. cached_has_bits = _has_bits_[0];
  867. // optional int32 a = 17;
  868. if (cached_has_bits & 0x00000001u) {
  869. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(17, this->a(), target);
  870. }
  871. if (_internal_metadata_.have_unknown_fields()) {
  872. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  873. _internal_metadata_.unknown_fields(), target);
  874. }
  875. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  876. return target;
  877. }
  878. size_t TestAllTypes_OptionalGroup::ByteSizeLong() const {
  879. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  880. size_t total_size = 0;
  881. if (_internal_metadata_.have_unknown_fields()) {
  882. total_size +=
  883. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  884. _internal_metadata_.unknown_fields());
  885. }
  886. // optional int32 a = 17;
  887. if (has_a()) {
  888. total_size += 2 +
  889. ::google::protobuf::internal::WireFormatLite::Int32Size(
  890. this->a());
  891. }
  892. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  893. SetCachedSize(cached_size);
  894. return total_size;
  895. }
  896. void TestAllTypes_OptionalGroup::MergeFrom(const ::google::protobuf::Message& from) {
  897. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  898. GOOGLE_DCHECK_NE(&from, this);
  899. const TestAllTypes_OptionalGroup* source =
  900. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes_OptionalGroup>(
  901. &from);
  902. if (source == NULL) {
  903. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  904. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  905. } else {
  906. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  907. MergeFrom(*source);
  908. }
  909. }
  910. void TestAllTypes_OptionalGroup::MergeFrom(const TestAllTypes_OptionalGroup& from) {
  911. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  912. GOOGLE_DCHECK_NE(&from, this);
  913. _internal_metadata_.MergeFrom(from._internal_metadata_);
  914. ::google::protobuf::uint32 cached_has_bits = 0;
  915. (void) cached_has_bits;
  916. if (from.has_a()) {
  917. set_a(from.a());
  918. }
  919. }
  920. void TestAllTypes_OptionalGroup::CopyFrom(const ::google::protobuf::Message& from) {
  921. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  922. if (&from == this) return;
  923. Clear();
  924. MergeFrom(from);
  925. }
  926. void TestAllTypes_OptionalGroup::CopyFrom(const TestAllTypes_OptionalGroup& from) {
  927. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_no_arena.TestAllTypes.OptionalGroup)
  928. if (&from == this) return;
  929. Clear();
  930. MergeFrom(from);
  931. }
  932. bool TestAllTypes_OptionalGroup::IsInitialized() const {
  933. return true;
  934. }
  935. void TestAllTypes_OptionalGroup::Swap(TestAllTypes_OptionalGroup* other) {
  936. if (other == this) return;
  937. InternalSwap(other);
  938. }
  939. void TestAllTypes_OptionalGroup::InternalSwap(TestAllTypes_OptionalGroup* other) {
  940. using std::swap;
  941. swap(a_, other->a_);
  942. swap(_has_bits_[0], other->_has_bits_[0]);
  943. _internal_metadata_.Swap(&other->_internal_metadata_);
  944. }
  945. ::google::protobuf::Metadata TestAllTypes_OptionalGroup::GetMetadata() const {
  946. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  947. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  948. }
  949. // ===================================================================
  950. void TestAllTypes_RepeatedGroup::InitAsDefaultInstance() {
  951. }
  952. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  953. const int TestAllTypes_RepeatedGroup::kAFieldNumber;
  954. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  955. TestAllTypes_RepeatedGroup::TestAllTypes_RepeatedGroup()
  956. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  957. ::google::protobuf::internal::InitSCC(
  958. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_RepeatedGroup.base);
  959. SharedCtor();
  960. // @@protoc_insertion_point(constructor:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  961. }
  962. TestAllTypes_RepeatedGroup::TestAllTypes_RepeatedGroup(const TestAllTypes_RepeatedGroup& from)
  963. : ::google::protobuf::Message(),
  964. _internal_metadata_(NULL),
  965. _has_bits_(from._has_bits_) {
  966. _internal_metadata_.MergeFrom(from._internal_metadata_);
  967. a_ = from.a_;
  968. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  969. }
  970. void TestAllTypes_RepeatedGroup::SharedCtor() {
  971. a_ = 0;
  972. }
  973. TestAllTypes_RepeatedGroup::~TestAllTypes_RepeatedGroup() {
  974. // @@protoc_insertion_point(destructor:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  975. SharedDtor();
  976. }
  977. void TestAllTypes_RepeatedGroup::SharedDtor() {
  978. }
  979. void TestAllTypes_RepeatedGroup::SetCachedSize(int size) const {
  980. _cached_size_.Set(size);
  981. }
  982. const ::google::protobuf::Descriptor* TestAllTypes_RepeatedGroup::descriptor() {
  983. ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  984. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  985. }
  986. const TestAllTypes_RepeatedGroup& TestAllTypes_RepeatedGroup::default_instance() {
  987. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes_RepeatedGroup.base);
  988. return *internal_default_instance();
  989. }
  990. void TestAllTypes_RepeatedGroup::Clear() {
  991. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  992. ::google::protobuf::uint32 cached_has_bits = 0;
  993. // Prevent compiler warnings about cached_has_bits being unused
  994. (void) cached_has_bits;
  995. a_ = 0;
  996. _has_bits_.Clear();
  997. _internal_metadata_.Clear();
  998. }
  999. bool TestAllTypes_RepeatedGroup::MergePartialFromCodedStream(
  1000. ::google::protobuf::io::CodedInputStream* input) {
  1001. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1002. ::google::protobuf::uint32 tag;
  1003. // @@protoc_insertion_point(parse_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1004. for (;;) {
  1005. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  1006. tag = p.first;
  1007. if (!p.second) goto handle_unusual;
  1008. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1009. // optional int32 a = 47;
  1010. case 47: {
  1011. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1012. static_cast< ::google::protobuf::uint8>(120u /* 376 & 0xFF */)) {
  1013. set_has_a();
  1014. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1015. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1016. input, &a_)));
  1017. } else {
  1018. goto handle_unusual;
  1019. }
  1020. break;
  1021. }
  1022. default: {
  1023. handle_unusual:
  1024. if (tag == 0 ||
  1025. ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  1026. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  1027. input->SetLastTag(tag);
  1028. goto success;
  1029. }
  1030. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1031. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1032. break;
  1033. }
  1034. }
  1035. }
  1036. success:
  1037. // @@protoc_insertion_point(parse_success:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1038. return true;
  1039. failure:
  1040. // @@protoc_insertion_point(parse_failure:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1041. return false;
  1042. #undef DO_
  1043. }
  1044. void TestAllTypes_RepeatedGroup::SerializeWithCachedSizes(
  1045. ::google::protobuf::io::CodedOutputStream* output) const {
  1046. // @@protoc_insertion_point(serialize_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1047. ::google::protobuf::uint32 cached_has_bits = 0;
  1048. (void) cached_has_bits;
  1049. cached_has_bits = _has_bits_[0];
  1050. // optional int32 a = 47;
  1051. if (cached_has_bits & 0x00000001u) {
  1052. ::google::protobuf::internal::WireFormatLite::WriteInt32(47, this->a(), output);
  1053. }
  1054. if (_internal_metadata_.have_unknown_fields()) {
  1055. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1056. _internal_metadata_.unknown_fields(), output);
  1057. }
  1058. // @@protoc_insertion_point(serialize_end:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1059. }
  1060. ::google::protobuf::uint8* TestAllTypes_RepeatedGroup::InternalSerializeWithCachedSizesToArray(
  1061. bool deterministic, ::google::protobuf::uint8* target) const {
  1062. (void)deterministic; // Unused
  1063. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1064. ::google::protobuf::uint32 cached_has_bits = 0;
  1065. (void) cached_has_bits;
  1066. cached_has_bits = _has_bits_[0];
  1067. // optional int32 a = 47;
  1068. if (cached_has_bits & 0x00000001u) {
  1069. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(47, this->a(), target);
  1070. }
  1071. if (_internal_metadata_.have_unknown_fields()) {
  1072. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1073. _internal_metadata_.unknown_fields(), target);
  1074. }
  1075. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1076. return target;
  1077. }
  1078. size_t TestAllTypes_RepeatedGroup::ByteSizeLong() const {
  1079. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1080. size_t total_size = 0;
  1081. if (_internal_metadata_.have_unknown_fields()) {
  1082. total_size +=
  1083. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1084. _internal_metadata_.unknown_fields());
  1085. }
  1086. // optional int32 a = 47;
  1087. if (has_a()) {
  1088. total_size += 2 +
  1089. ::google::protobuf::internal::WireFormatLite::Int32Size(
  1090. this->a());
  1091. }
  1092. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1093. SetCachedSize(cached_size);
  1094. return total_size;
  1095. }
  1096. void TestAllTypes_RepeatedGroup::MergeFrom(const ::google::protobuf::Message& from) {
  1097. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1098. GOOGLE_DCHECK_NE(&from, this);
  1099. const TestAllTypes_RepeatedGroup* source =
  1100. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes_RepeatedGroup>(
  1101. &from);
  1102. if (source == NULL) {
  1103. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1104. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1105. } else {
  1106. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1107. MergeFrom(*source);
  1108. }
  1109. }
  1110. void TestAllTypes_RepeatedGroup::MergeFrom(const TestAllTypes_RepeatedGroup& from) {
  1111. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1112. GOOGLE_DCHECK_NE(&from, this);
  1113. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1114. ::google::protobuf::uint32 cached_has_bits = 0;
  1115. (void) cached_has_bits;
  1116. if (from.has_a()) {
  1117. set_a(from.a());
  1118. }
  1119. }
  1120. void TestAllTypes_RepeatedGroup::CopyFrom(const ::google::protobuf::Message& from) {
  1121. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1122. if (&from == this) return;
  1123. Clear();
  1124. MergeFrom(from);
  1125. }
  1126. void TestAllTypes_RepeatedGroup::CopyFrom(const TestAllTypes_RepeatedGroup& from) {
  1127. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_no_arena.TestAllTypes.RepeatedGroup)
  1128. if (&from == this) return;
  1129. Clear();
  1130. MergeFrom(from);
  1131. }
  1132. bool TestAllTypes_RepeatedGroup::IsInitialized() const {
  1133. return true;
  1134. }
  1135. void TestAllTypes_RepeatedGroup::Swap(TestAllTypes_RepeatedGroup* other) {
  1136. if (other == this) return;
  1137. InternalSwap(other);
  1138. }
  1139. void TestAllTypes_RepeatedGroup::InternalSwap(TestAllTypes_RepeatedGroup* other) {
  1140. using std::swap;
  1141. swap(a_, other->a_);
  1142. swap(_has_bits_[0], other->_has_bits_[0]);
  1143. _internal_metadata_.Swap(&other->_internal_metadata_);
  1144. }
  1145. ::google::protobuf::Metadata TestAllTypes_RepeatedGroup::GetMetadata() const {
  1146. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  1147. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  1148. }
  1149. // ===================================================================
  1150. void TestAllTypes::InitAsDefaultInstance() {
  1151. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_._instance.get_mutable()->optionalgroup_ = const_cast< ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup*>(
  1152. ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup::internal_default_instance());
  1153. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_._instance.get_mutable()->optional_nested_message_ = const_cast< ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage*>(
  1154. ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::internal_default_instance());
  1155. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_._instance.get_mutable()->optional_foreign_message_ = const_cast< ::protobuf_unittest_no_arena::ForeignMessage*>(
  1156. ::protobuf_unittest_no_arena::ForeignMessage::internal_default_instance());
  1157. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_._instance.get_mutable()->optional_import_message_ = const_cast< ::protobuf_unittest_import::ImportMessage*>(
  1158. ::protobuf_unittest_import::ImportMessage::internal_default_instance());
  1159. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_._instance.get_mutable()->optional_public_import_message_ = const_cast< ::protobuf_unittest_import::PublicImportMessage*>(
  1160. ::protobuf_unittest_import::PublicImportMessage::internal_default_instance());
  1161. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_._instance.get_mutable()->optional_message_ = const_cast< ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage*>(
  1162. ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::internal_default_instance());
  1163. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_.oneof_uint32_ = 0u;
  1164. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_.oneof_nested_message_ = const_cast< ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage*>(
  1165. ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::internal_default_instance());
  1166. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_.oneof_string_.UnsafeSetDefault(
  1167. &::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1168. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_.oneof_bytes_.UnsafeSetDefault(
  1169. &::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1170. ::protobuf_unittest_no_arena::_TestAllTypes_default_instance_.lazy_oneof_nested_message_ = const_cast< ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage*>(
  1171. ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::internal_default_instance());
  1172. }
  1173. void TestAllTypes::clear_optional_import_message() {
  1174. if (optional_import_message_ != NULL) optional_import_message_->Clear();
  1175. clear_has_optional_import_message();
  1176. }
  1177. void TestAllTypes::clear_optional_public_import_message() {
  1178. if (optional_public_import_message_ != NULL) optional_public_import_message_->Clear();
  1179. clear_has_optional_public_import_message();
  1180. }
  1181. void TestAllTypes::clear_repeated_import_message() {
  1182. repeated_import_message_.Clear();
  1183. }
  1184. ::google::protobuf::internal::ExplicitlyConstructed<::std::string> TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_;
  1185. ::google::protobuf::internal::ExplicitlyConstructed<::std::string> TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_;
  1186. ::google::protobuf::internal::ExplicitlyConstructed<::std::string> TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_;
  1187. ::google::protobuf::internal::ExplicitlyConstructed<::std::string> TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_;
  1188. void TestAllTypes::set_allocated_oneof_nested_message(::protobuf_unittest_no_arena::TestAllTypes_NestedMessage* oneof_nested_message) {
  1189. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  1190. clear_oneof_field();
  1191. if (oneof_nested_message) {
  1192. ::google::protobuf::Arena* submessage_arena = NULL;
  1193. if (message_arena != submessage_arena) {
  1194. oneof_nested_message = ::google::protobuf::internal::GetOwnedMessage(
  1195. message_arena, oneof_nested_message, submessage_arena);
  1196. }
  1197. set_has_oneof_nested_message();
  1198. oneof_field_.oneof_nested_message_ = oneof_nested_message;
  1199. }
  1200. // @@protoc_insertion_point(field_set_allocated:protobuf_unittest_no_arena.TestAllTypes.oneof_nested_message)
  1201. }
  1202. void TestAllTypes::set_allocated_lazy_oneof_nested_message(::protobuf_unittest_no_arena::TestAllTypes_NestedMessage* lazy_oneof_nested_message) {
  1203. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  1204. clear_oneof_field();
  1205. if (lazy_oneof_nested_message) {
  1206. ::google::protobuf::Arena* submessage_arena = NULL;
  1207. if (message_arena != submessage_arena) {
  1208. lazy_oneof_nested_message = ::google::protobuf::internal::GetOwnedMessage(
  1209. message_arena, lazy_oneof_nested_message, submessage_arena);
  1210. }
  1211. set_has_lazy_oneof_nested_message();
  1212. oneof_field_.lazy_oneof_nested_message_ = lazy_oneof_nested_message;
  1213. }
  1214. // @@protoc_insertion_point(field_set_allocated:protobuf_unittest_no_arena.TestAllTypes.lazy_oneof_nested_message)
  1215. }
  1216. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1217. const int TestAllTypes::kOptionalInt32FieldNumber;
  1218. const int TestAllTypes::kOptionalInt64FieldNumber;
  1219. const int TestAllTypes::kOptionalUint32FieldNumber;
  1220. const int TestAllTypes::kOptionalUint64FieldNumber;
  1221. const int TestAllTypes::kOptionalSint32FieldNumber;
  1222. const int TestAllTypes::kOptionalSint64FieldNumber;
  1223. const int TestAllTypes::kOptionalFixed32FieldNumber;
  1224. const int TestAllTypes::kOptionalFixed64FieldNumber;
  1225. const int TestAllTypes::kOptionalSfixed32FieldNumber;
  1226. const int TestAllTypes::kOptionalSfixed64FieldNumber;
  1227. const int TestAllTypes::kOptionalFloatFieldNumber;
  1228. const int TestAllTypes::kOptionalDoubleFieldNumber;
  1229. const int TestAllTypes::kOptionalBoolFieldNumber;
  1230. const int TestAllTypes::kOptionalStringFieldNumber;
  1231. const int TestAllTypes::kOptionalBytesFieldNumber;
  1232. const int TestAllTypes::kOptionalgroupFieldNumber;
  1233. const int TestAllTypes::kOptionalNestedMessageFieldNumber;
  1234. const int TestAllTypes::kOptionalForeignMessageFieldNumber;
  1235. const int TestAllTypes::kOptionalImportMessageFieldNumber;
  1236. const int TestAllTypes::kOptionalNestedEnumFieldNumber;
  1237. const int TestAllTypes::kOptionalForeignEnumFieldNumber;
  1238. const int TestAllTypes::kOptionalImportEnumFieldNumber;
  1239. const int TestAllTypes::kOptionalStringPieceFieldNumber;
  1240. const int TestAllTypes::kOptionalCordFieldNumber;
  1241. const int TestAllTypes::kOptionalPublicImportMessageFieldNumber;
  1242. const int TestAllTypes::kOptionalMessageFieldNumber;
  1243. const int TestAllTypes::kRepeatedInt32FieldNumber;
  1244. const int TestAllTypes::kRepeatedInt64FieldNumber;
  1245. const int TestAllTypes::kRepeatedUint32FieldNumber;
  1246. const int TestAllTypes::kRepeatedUint64FieldNumber;
  1247. const int TestAllTypes::kRepeatedSint32FieldNumber;
  1248. const int TestAllTypes::kRepeatedSint64FieldNumber;
  1249. const int TestAllTypes::kRepeatedFixed32FieldNumber;
  1250. const int TestAllTypes::kRepeatedFixed64FieldNumber;
  1251. const int TestAllTypes::kRepeatedSfixed32FieldNumber;
  1252. const int TestAllTypes::kRepeatedSfixed64FieldNumber;
  1253. const int TestAllTypes::kRepeatedFloatFieldNumber;
  1254. const int TestAllTypes::kRepeatedDoubleFieldNumber;
  1255. const int TestAllTypes::kRepeatedBoolFieldNumber;
  1256. const int TestAllTypes::kRepeatedStringFieldNumber;
  1257. const int TestAllTypes::kRepeatedBytesFieldNumber;
  1258. const int TestAllTypes::kRepeatedgroupFieldNumber;
  1259. const int TestAllTypes::kRepeatedNestedMessageFieldNumber;
  1260. const int TestAllTypes::kRepeatedForeignMessageFieldNumber;
  1261. const int TestAllTypes::kRepeatedImportMessageFieldNumber;
  1262. const int TestAllTypes::kRepeatedNestedEnumFieldNumber;
  1263. const int TestAllTypes::kRepeatedForeignEnumFieldNumber;
  1264. const int TestAllTypes::kRepeatedImportEnumFieldNumber;
  1265. const int TestAllTypes::kRepeatedStringPieceFieldNumber;
  1266. const int TestAllTypes::kRepeatedCordFieldNumber;
  1267. const int TestAllTypes::kRepeatedLazyMessageFieldNumber;
  1268. const int TestAllTypes::kDefaultInt32FieldNumber;
  1269. const int TestAllTypes::kDefaultInt64FieldNumber;
  1270. const int TestAllTypes::kDefaultUint32FieldNumber;
  1271. const int TestAllTypes::kDefaultUint64FieldNumber;
  1272. const int TestAllTypes::kDefaultSint32FieldNumber;
  1273. const int TestAllTypes::kDefaultSint64FieldNumber;
  1274. const int TestAllTypes::kDefaultFixed32FieldNumber;
  1275. const int TestAllTypes::kDefaultFixed64FieldNumber;
  1276. const int TestAllTypes::kDefaultSfixed32FieldNumber;
  1277. const int TestAllTypes::kDefaultSfixed64FieldNumber;
  1278. const int TestAllTypes::kDefaultFloatFieldNumber;
  1279. const int TestAllTypes::kDefaultDoubleFieldNumber;
  1280. const int TestAllTypes::kDefaultBoolFieldNumber;
  1281. const int TestAllTypes::kDefaultStringFieldNumber;
  1282. const int TestAllTypes::kDefaultBytesFieldNumber;
  1283. const int TestAllTypes::kDefaultNestedEnumFieldNumber;
  1284. const int TestAllTypes::kDefaultForeignEnumFieldNumber;
  1285. const int TestAllTypes::kDefaultImportEnumFieldNumber;
  1286. const int TestAllTypes::kDefaultStringPieceFieldNumber;
  1287. const int TestAllTypes::kDefaultCordFieldNumber;
  1288. const int TestAllTypes::kOneofUint32FieldNumber;
  1289. const int TestAllTypes::kOneofNestedMessageFieldNumber;
  1290. const int TestAllTypes::kOneofStringFieldNumber;
  1291. const int TestAllTypes::kOneofBytesFieldNumber;
  1292. const int TestAllTypes::kLazyOneofNestedMessageFieldNumber;
  1293. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  1294. TestAllTypes::TestAllTypes()
  1295. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  1296. ::google::protobuf::internal::InitSCC(
  1297. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes.base);
  1298. SharedCtor();
  1299. // @@protoc_insertion_point(constructor:protobuf_unittest_no_arena.TestAllTypes)
  1300. }
  1301. TestAllTypes::TestAllTypes(const TestAllTypes& from)
  1302. : ::google::protobuf::Message(),
  1303. _internal_metadata_(NULL),
  1304. _has_bits_(from._has_bits_),
  1305. repeated_int32_(from.repeated_int32_),
  1306. repeated_int64_(from.repeated_int64_),
  1307. repeated_uint32_(from.repeated_uint32_),
  1308. repeated_uint64_(from.repeated_uint64_),
  1309. repeated_sint32_(from.repeated_sint32_),
  1310. repeated_sint64_(from.repeated_sint64_),
  1311. repeated_fixed32_(from.repeated_fixed32_),
  1312. repeated_fixed64_(from.repeated_fixed64_),
  1313. repeated_sfixed32_(from.repeated_sfixed32_),
  1314. repeated_sfixed64_(from.repeated_sfixed64_),
  1315. repeated_float_(from.repeated_float_),
  1316. repeated_double_(from.repeated_double_),
  1317. repeated_bool_(from.repeated_bool_),
  1318. repeated_string_(from.repeated_string_),
  1319. repeated_bytes_(from.repeated_bytes_),
  1320. repeatedgroup_(from.repeatedgroup_),
  1321. repeated_nested_message_(from.repeated_nested_message_),
  1322. repeated_foreign_message_(from.repeated_foreign_message_),
  1323. repeated_import_message_(from.repeated_import_message_),
  1324. repeated_nested_enum_(from.repeated_nested_enum_),
  1325. repeated_foreign_enum_(from.repeated_foreign_enum_),
  1326. repeated_import_enum_(from.repeated_import_enum_),
  1327. repeated_string_piece_(from.repeated_string_piece_),
  1328. repeated_cord_(from.repeated_cord_),
  1329. repeated_lazy_message_(from.repeated_lazy_message_) {
  1330. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1331. optional_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1332. if (from.has_optional_string()) {
  1333. optional_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_);
  1334. }
  1335. optional_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1336. if (from.has_optional_bytes()) {
  1337. optional_bytes_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_bytes_);
  1338. }
  1339. optional_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1340. if (from.has_optional_string_piece()) {
  1341. optional_string_piece_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_piece_);
  1342. }
  1343. optional_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1344. if (from.has_optional_cord()) {
  1345. optional_cord_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_cord_);
  1346. }
  1347. default_string_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get());
  1348. if (from.has_default_string()) {
  1349. default_string_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get(), from.default_string_);
  1350. }
  1351. default_bytes_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get());
  1352. if (from.has_default_bytes()) {
  1353. default_bytes_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get(), from.default_bytes_);
  1354. }
  1355. default_string_piece_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get());
  1356. if (from.has_default_string_piece()) {
  1357. default_string_piece_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get(), from.default_string_piece_);
  1358. }
  1359. default_cord_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get());
  1360. if (from.has_default_cord()) {
  1361. default_cord_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get(), from.default_cord_);
  1362. }
  1363. if (from.has_optionalgroup()) {
  1364. optionalgroup_ = new ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup(*from.optionalgroup_);
  1365. } else {
  1366. optionalgroup_ = NULL;
  1367. }
  1368. if (from.has_optional_nested_message()) {
  1369. optional_nested_message_ = new ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage(*from.optional_nested_message_);
  1370. } else {
  1371. optional_nested_message_ = NULL;
  1372. }
  1373. if (from.has_optional_foreign_message()) {
  1374. optional_foreign_message_ = new ::protobuf_unittest_no_arena::ForeignMessage(*from.optional_foreign_message_);
  1375. } else {
  1376. optional_foreign_message_ = NULL;
  1377. }
  1378. if (from.has_optional_import_message()) {
  1379. optional_import_message_ = new ::protobuf_unittest_import::ImportMessage(*from.optional_import_message_);
  1380. } else {
  1381. optional_import_message_ = NULL;
  1382. }
  1383. if (from.has_optional_public_import_message()) {
  1384. optional_public_import_message_ = new ::protobuf_unittest_import::PublicImportMessage(*from.optional_public_import_message_);
  1385. } else {
  1386. optional_public_import_message_ = NULL;
  1387. }
  1388. if (from.has_optional_message()) {
  1389. optional_message_ = new ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage(*from.optional_message_);
  1390. } else {
  1391. optional_message_ = NULL;
  1392. }
  1393. ::memcpy(&optional_int64_, &from.optional_int64_,
  1394. static_cast<size_t>(reinterpret_cast<char*>(&default_foreign_enum_) -
  1395. reinterpret_cast<char*>(&optional_int64_)) + sizeof(default_foreign_enum_));
  1396. clear_has_oneof_field();
  1397. switch (from.oneof_field_case()) {
  1398. case kOneofUint32: {
  1399. set_oneof_uint32(from.oneof_uint32());
  1400. break;
  1401. }
  1402. case kOneofNestedMessage: {
  1403. mutable_oneof_nested_message()->::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::MergeFrom(from.oneof_nested_message());
  1404. break;
  1405. }
  1406. case kOneofString: {
  1407. set_oneof_string(from.oneof_string());
  1408. break;
  1409. }
  1410. case kOneofBytes: {
  1411. set_oneof_bytes(from.oneof_bytes());
  1412. break;
  1413. }
  1414. case kLazyOneofNestedMessage: {
  1415. mutable_lazy_oneof_nested_message()->::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::MergeFrom(from.lazy_oneof_nested_message());
  1416. break;
  1417. }
  1418. case ONEOF_FIELD_NOT_SET: {
  1419. break;
  1420. }
  1421. }
  1422. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_no_arena.TestAllTypes)
  1423. }
  1424. void TestAllTypes::SharedCtor() {
  1425. optional_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1426. optional_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1427. optional_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1428. optional_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1429. default_string_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get());
  1430. default_bytes_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get());
  1431. default_string_piece_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get());
  1432. default_cord_.UnsafeSetDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get());
  1433. ::memset(&optionalgroup_, 0, static_cast<size_t>(
  1434. reinterpret_cast<char*>(&optional_bool_) -
  1435. reinterpret_cast<char*>(&optionalgroup_)) + sizeof(optional_bool_));
  1436. default_import_enum_ = 8;
  1437. optional_nested_enum_ = 1;
  1438. optional_foreign_enum_ = 4;
  1439. optional_import_enum_ = 7;
  1440. default_int32_ = 41;
  1441. default_int64_ = GOOGLE_LONGLONG(42);
  1442. default_uint64_ = GOOGLE_ULONGLONG(44);
  1443. default_uint32_ = 43u;
  1444. default_sint32_ = -45;
  1445. default_sint64_ = GOOGLE_LONGLONG(46);
  1446. default_fixed64_ = GOOGLE_ULONGLONG(48);
  1447. default_fixed32_ = 47u;
  1448. default_sfixed32_ = 49;
  1449. default_sfixed64_ = GOOGLE_LONGLONG(-50);
  1450. default_double_ = 52000;
  1451. default_float_ = 51.5f;
  1452. default_bool_ = true;
  1453. default_nested_enum_ = 2;
  1454. default_foreign_enum_ = 5;
  1455. clear_has_oneof_field();
  1456. }
  1457. TestAllTypes::~TestAllTypes() {
  1458. // @@protoc_insertion_point(destructor:protobuf_unittest_no_arena.TestAllTypes)
  1459. SharedDtor();
  1460. }
  1461. void TestAllTypes::SharedDtor() {
  1462. optional_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1463. optional_bytes_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1464. optional_string_piece_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1465. optional_cord_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1466. default_string_.DestroyNoArena(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get());
  1467. default_bytes_.DestroyNoArena(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get());
  1468. default_string_piece_.DestroyNoArena(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get());
  1469. default_cord_.DestroyNoArena(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get());
  1470. if (this != internal_default_instance()) delete optionalgroup_;
  1471. if (this != internal_default_instance()) delete optional_nested_message_;
  1472. if (this != internal_default_instance()) delete optional_foreign_message_;
  1473. if (this != internal_default_instance()) delete optional_import_message_;
  1474. if (this != internal_default_instance()) delete optional_public_import_message_;
  1475. if (this != internal_default_instance()) delete optional_message_;
  1476. if (has_oneof_field()) {
  1477. clear_oneof_field();
  1478. }
  1479. }
  1480. void TestAllTypes::SetCachedSize(int size) const {
  1481. _cached_size_.Set(size);
  1482. }
  1483. const ::google::protobuf::Descriptor* TestAllTypes::descriptor() {
  1484. ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  1485. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1486. }
  1487. const TestAllTypes& TestAllTypes::default_instance() {
  1488. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestAllTypes.base);
  1489. return *internal_default_instance();
  1490. }
  1491. void TestAllTypes::clear_oneof_field() {
  1492. // @@protoc_insertion_point(one_of_clear_start:protobuf_unittest_no_arena.TestAllTypes)
  1493. switch (oneof_field_case()) {
  1494. case kOneofUint32: {
  1495. // No need to clear
  1496. break;
  1497. }
  1498. case kOneofNestedMessage: {
  1499. delete oneof_field_.oneof_nested_message_;
  1500. break;
  1501. }
  1502. case kOneofString: {
  1503. oneof_field_.oneof_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1504. break;
  1505. }
  1506. case kOneofBytes: {
  1507. oneof_field_.oneof_bytes_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1508. break;
  1509. }
  1510. case kLazyOneofNestedMessage: {
  1511. delete oneof_field_.lazy_oneof_nested_message_;
  1512. break;
  1513. }
  1514. case ONEOF_FIELD_NOT_SET: {
  1515. break;
  1516. }
  1517. }
  1518. _oneof_case_[0] = ONEOF_FIELD_NOT_SET;
  1519. }
  1520. void TestAllTypes::Clear() {
  1521. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_no_arena.TestAllTypes)
  1522. ::google::protobuf::uint32 cached_has_bits = 0;
  1523. // Prevent compiler warnings about cached_has_bits being unused
  1524. (void) cached_has_bits;
  1525. repeated_int32_.Clear();
  1526. repeated_int64_.Clear();
  1527. repeated_uint32_.Clear();
  1528. repeated_uint64_.Clear();
  1529. repeated_sint32_.Clear();
  1530. repeated_sint64_.Clear();
  1531. repeated_fixed32_.Clear();
  1532. repeated_fixed64_.Clear();
  1533. repeated_sfixed32_.Clear();
  1534. repeated_sfixed64_.Clear();
  1535. repeated_float_.Clear();
  1536. repeated_double_.Clear();
  1537. repeated_bool_.Clear();
  1538. repeated_string_.Clear();
  1539. repeated_bytes_.Clear();
  1540. repeatedgroup_.Clear();
  1541. repeated_nested_message_.Clear();
  1542. repeated_foreign_message_.Clear();
  1543. repeated_import_message_.Clear();
  1544. repeated_nested_enum_.Clear();
  1545. repeated_foreign_enum_.Clear();
  1546. repeated_import_enum_.Clear();
  1547. repeated_string_piece_.Clear();
  1548. repeated_cord_.Clear();
  1549. repeated_lazy_message_.Clear();
  1550. cached_has_bits = _has_bits_[0];
  1551. if (cached_has_bits & 255u) {
  1552. if (cached_has_bits & 0x00000001u) {
  1553. optional_string_.ClearNonDefaultToEmptyNoArena();
  1554. }
  1555. if (cached_has_bits & 0x00000002u) {
  1556. optional_bytes_.ClearNonDefaultToEmptyNoArena();
  1557. }
  1558. if (cached_has_bits & 0x00000004u) {
  1559. optional_string_piece_.ClearNonDefaultToEmptyNoArena();
  1560. }
  1561. if (cached_has_bits & 0x00000008u) {
  1562. optional_cord_.ClearNonDefaultToEmptyNoArena();
  1563. }
  1564. if (cached_has_bits & 0x00000010u) {
  1565. default_string_.UnsafeMutablePointer()->assign(*&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get());
  1566. }
  1567. if (cached_has_bits & 0x00000020u) {
  1568. default_bytes_.UnsafeMutablePointer()->assign(*&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get());
  1569. }
  1570. if (cached_has_bits & 0x00000040u) {
  1571. default_string_piece_.UnsafeMutablePointer()->assign(*&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get());
  1572. }
  1573. if (cached_has_bits & 0x00000080u) {
  1574. default_cord_.UnsafeMutablePointer()->assign(*&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get());
  1575. }
  1576. }
  1577. if (cached_has_bits & 16128u) {
  1578. if (cached_has_bits & 0x00000100u) {
  1579. GOOGLE_DCHECK(optionalgroup_ != NULL);
  1580. optionalgroup_->Clear();
  1581. }
  1582. if (cached_has_bits & 0x00000200u) {
  1583. GOOGLE_DCHECK(optional_nested_message_ != NULL);
  1584. optional_nested_message_->Clear();
  1585. }
  1586. if (cached_has_bits & 0x00000400u) {
  1587. GOOGLE_DCHECK(optional_foreign_message_ != NULL);
  1588. optional_foreign_message_->Clear();
  1589. }
  1590. if (cached_has_bits & 0x00000800u) {
  1591. GOOGLE_DCHECK(optional_import_message_ != NULL);
  1592. optional_import_message_->Clear();
  1593. }
  1594. if (cached_has_bits & 0x00001000u) {
  1595. GOOGLE_DCHECK(optional_public_import_message_ != NULL);
  1596. optional_public_import_message_->Clear();
  1597. }
  1598. if (cached_has_bits & 0x00002000u) {
  1599. GOOGLE_DCHECK(optional_message_ != NULL);
  1600. optional_message_->Clear();
  1601. }
  1602. }
  1603. if (cached_has_bits & 49152u) {
  1604. ::memset(&optional_int64_, 0, static_cast<size_t>(
  1605. reinterpret_cast<char*>(&optional_int32_) -
  1606. reinterpret_cast<char*>(&optional_int64_)) + sizeof(optional_int32_));
  1607. }
  1608. if (cached_has_bits & 16711680u) {
  1609. ::memset(&optional_uint32_, 0, static_cast<size_t>(
  1610. reinterpret_cast<char*>(&optional_sfixed32_) -
  1611. reinterpret_cast<char*>(&optional_uint32_)) + sizeof(optional_sfixed32_));
  1612. }
  1613. if (cached_has_bits & 4278190080u) {
  1614. ::memset(&optional_float_, 0, static_cast<size_t>(
  1615. reinterpret_cast<char*>(&optional_bool_) -
  1616. reinterpret_cast<char*>(&optional_float_)) + sizeof(optional_bool_));
  1617. default_import_enum_ = 8;
  1618. optional_nested_enum_ = 1;
  1619. optional_foreign_enum_ = 4;
  1620. optional_import_enum_ = 7;
  1621. default_int32_ = 41;
  1622. }
  1623. cached_has_bits = _has_bits_[1];
  1624. if (cached_has_bits & 255u) {
  1625. default_int64_ = GOOGLE_LONGLONG(42);
  1626. default_uint64_ = GOOGLE_ULONGLONG(44);
  1627. default_uint32_ = 43u;
  1628. default_sint32_ = -45;
  1629. default_sint64_ = GOOGLE_LONGLONG(46);
  1630. default_fixed64_ = GOOGLE_ULONGLONG(48);
  1631. default_fixed32_ = 47u;
  1632. default_sfixed32_ = 49;
  1633. }
  1634. if (cached_has_bits & 16128u) {
  1635. default_sfixed64_ = GOOGLE_LONGLONG(-50);
  1636. default_double_ = 52000;
  1637. default_float_ = 51.5f;
  1638. default_bool_ = true;
  1639. default_nested_enum_ = 2;
  1640. default_foreign_enum_ = 5;
  1641. }
  1642. clear_oneof_field();
  1643. _has_bits_.Clear();
  1644. _internal_metadata_.Clear();
  1645. }
  1646. bool TestAllTypes::MergePartialFromCodedStream(
  1647. ::google::protobuf::io::CodedInputStream* input) {
  1648. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1649. ::google::protobuf::uint32 tag;
  1650. // @@protoc_insertion_point(parse_start:protobuf_unittest_no_arena.TestAllTypes)
  1651. for (;;) {
  1652. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  1653. tag = p.first;
  1654. if (!p.second) goto handle_unusual;
  1655. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1656. // optional int32 optional_int32 = 1;
  1657. case 1: {
  1658. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1659. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  1660. set_has_optional_int32();
  1661. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1662. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1663. input, &optional_int32_)));
  1664. } else {
  1665. goto handle_unusual;
  1666. }
  1667. break;
  1668. }
  1669. // optional int64 optional_int64 = 2;
  1670. case 2: {
  1671. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1672. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  1673. set_has_optional_int64();
  1674. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1675. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  1676. input, &optional_int64_)));
  1677. } else {
  1678. goto handle_unusual;
  1679. }
  1680. break;
  1681. }
  1682. // optional uint32 optional_uint32 = 3;
  1683. case 3: {
  1684. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1685. static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
  1686. set_has_optional_uint32();
  1687. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1688. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1689. input, &optional_uint32_)));
  1690. } else {
  1691. goto handle_unusual;
  1692. }
  1693. break;
  1694. }
  1695. // optional uint64 optional_uint64 = 4;
  1696. case 4: {
  1697. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1698. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  1699. set_has_optional_uint64();
  1700. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1701. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  1702. input, &optional_uint64_)));
  1703. } else {
  1704. goto handle_unusual;
  1705. }
  1706. break;
  1707. }
  1708. // optional sint32 optional_sint32 = 5;
  1709. case 5: {
  1710. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1711. static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  1712. set_has_optional_sint32();
  1713. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1714. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  1715. input, &optional_sint32_)));
  1716. } else {
  1717. goto handle_unusual;
  1718. }
  1719. break;
  1720. }
  1721. // optional sint64 optional_sint64 = 6;
  1722. case 6: {
  1723. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1724. static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
  1725. set_has_optional_sint64();
  1726. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1727. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  1728. input, &optional_sint64_)));
  1729. } else {
  1730. goto handle_unusual;
  1731. }
  1732. break;
  1733. }
  1734. // optional fixed32 optional_fixed32 = 7;
  1735. case 7: {
  1736. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1737. static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
  1738. set_has_optional_fixed32();
  1739. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1740. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  1741. input, &optional_fixed32_)));
  1742. } else {
  1743. goto handle_unusual;
  1744. }
  1745. break;
  1746. }
  1747. // optional fixed64 optional_fixed64 = 8;
  1748. case 8: {
  1749. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1750. static_cast< ::google::protobuf::uint8>(65u /* 65 & 0xFF */)) {
  1751. set_has_optional_fixed64();
  1752. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1753. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  1754. input, &optional_fixed64_)));
  1755. } else {
  1756. goto handle_unusual;
  1757. }
  1758. break;
  1759. }
  1760. // optional sfixed32 optional_sfixed32 = 9;
  1761. case 9: {
  1762. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1763. static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
  1764. set_has_optional_sfixed32();
  1765. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1766. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  1767. input, &optional_sfixed32_)));
  1768. } else {
  1769. goto handle_unusual;
  1770. }
  1771. break;
  1772. }
  1773. // optional sfixed64 optional_sfixed64 = 10;
  1774. case 10: {
  1775. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1776. static_cast< ::google::protobuf::uint8>(81u /* 81 & 0xFF */)) {
  1777. set_has_optional_sfixed64();
  1778. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1779. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  1780. input, &optional_sfixed64_)));
  1781. } else {
  1782. goto handle_unusual;
  1783. }
  1784. break;
  1785. }
  1786. // optional float optional_float = 11;
  1787. case 11: {
  1788. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1789. static_cast< ::google::protobuf::uint8>(93u /* 93 & 0xFF */)) {
  1790. set_has_optional_float();
  1791. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1792. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  1793. input, &optional_float_)));
  1794. } else {
  1795. goto handle_unusual;
  1796. }
  1797. break;
  1798. }
  1799. // optional double optional_double = 12;
  1800. case 12: {
  1801. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1802. static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) {
  1803. set_has_optional_double();
  1804. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1805. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  1806. input, &optional_double_)));
  1807. } else {
  1808. goto handle_unusual;
  1809. }
  1810. break;
  1811. }
  1812. // optional bool optional_bool = 13;
  1813. case 13: {
  1814. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1815. static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
  1816. set_has_optional_bool();
  1817. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1818. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  1819. input, &optional_bool_)));
  1820. } else {
  1821. goto handle_unusual;
  1822. }
  1823. break;
  1824. }
  1825. // optional string optional_string = 14;
  1826. case 14: {
  1827. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1828. static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
  1829. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1830. input, this->mutable_optional_string()));
  1831. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  1832. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  1833. ::google::protobuf::internal::WireFormat::PARSE,
  1834. "protobuf_unittest_no_arena.TestAllTypes.optional_string");
  1835. } else {
  1836. goto handle_unusual;
  1837. }
  1838. break;
  1839. }
  1840. // optional bytes optional_bytes = 15;
  1841. case 15: {
  1842. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1843. static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) {
  1844. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  1845. input, this->mutable_optional_bytes()));
  1846. } else {
  1847. goto handle_unusual;
  1848. }
  1849. break;
  1850. }
  1851. // optional group OptionalGroup = 16 { ... };
  1852. case 16: {
  1853. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1854. static_cast< ::google::protobuf::uint8>(131u /* 131 & 0xFF */)) {
  1855. DO_(::google::protobuf::internal::WireFormatLite::ReadGroup(
  1856. 16, input, mutable_optionalgroup()));
  1857. } else {
  1858. goto handle_unusual;
  1859. }
  1860. break;
  1861. }
  1862. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_nested_message = 18;
  1863. case 18: {
  1864. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1865. static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) {
  1866. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1867. input, mutable_optional_nested_message()));
  1868. } else {
  1869. goto handle_unusual;
  1870. }
  1871. break;
  1872. }
  1873. // optional .protobuf_unittest_no_arena.ForeignMessage optional_foreign_message = 19;
  1874. case 19: {
  1875. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1876. static_cast< ::google::protobuf::uint8>(154u /* 154 & 0xFF */)) {
  1877. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1878. input, mutable_optional_foreign_message()));
  1879. } else {
  1880. goto handle_unusual;
  1881. }
  1882. break;
  1883. }
  1884. // optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  1885. case 20: {
  1886. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1887. static_cast< ::google::protobuf::uint8>(162u /* 162 & 0xFF */)) {
  1888. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1889. input, mutable_optional_import_message()));
  1890. } else {
  1891. goto handle_unusual;
  1892. }
  1893. break;
  1894. }
  1895. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum optional_nested_enum = 21;
  1896. case 21: {
  1897. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1898. static_cast< ::google::protobuf::uint8>(168u /* 168 & 0xFF */)) {
  1899. int value;
  1900. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1901. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1902. input, &value)));
  1903. if (::protobuf_unittest_no_arena::TestAllTypes_NestedEnum_IsValid(value)) {
  1904. set_optional_nested_enum(static_cast< ::protobuf_unittest_no_arena::TestAllTypes_NestedEnum >(value));
  1905. } else {
  1906. mutable_unknown_fields()->AddVarint(
  1907. 21, static_cast< ::google::protobuf::uint64>(value));
  1908. }
  1909. } else {
  1910. goto handle_unusual;
  1911. }
  1912. break;
  1913. }
  1914. // optional .protobuf_unittest_no_arena.ForeignEnum optional_foreign_enum = 22;
  1915. case 22: {
  1916. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1917. static_cast< ::google::protobuf::uint8>(176u /* 176 & 0xFF */)) {
  1918. int value;
  1919. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1920. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1921. input, &value)));
  1922. if (::protobuf_unittest_no_arena::ForeignEnum_IsValid(value)) {
  1923. set_optional_foreign_enum(static_cast< ::protobuf_unittest_no_arena::ForeignEnum >(value));
  1924. } else {
  1925. mutable_unknown_fields()->AddVarint(
  1926. 22, static_cast< ::google::protobuf::uint64>(value));
  1927. }
  1928. } else {
  1929. goto handle_unusual;
  1930. }
  1931. break;
  1932. }
  1933. // optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
  1934. case 23: {
  1935. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1936. static_cast< ::google::protobuf::uint8>(184u /* 184 & 0xFF */)) {
  1937. int value;
  1938. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1939. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1940. input, &value)));
  1941. if (::protobuf_unittest_import::ImportEnum_IsValid(value)) {
  1942. set_optional_import_enum(static_cast< ::protobuf_unittest_import::ImportEnum >(value));
  1943. } else {
  1944. mutable_unknown_fields()->AddVarint(
  1945. 23, static_cast< ::google::protobuf::uint64>(value));
  1946. }
  1947. } else {
  1948. goto handle_unusual;
  1949. }
  1950. break;
  1951. }
  1952. // optional string optional_string_piece = 24 [ctype = STRING_PIECE];
  1953. case 24: {
  1954. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1955. static_cast< ::google::protobuf::uint8>(194u /* 194 & 0xFF */)) {
  1956. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1957. input, this->mutable_optional_string_piece()));
  1958. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  1959. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  1960. ::google::protobuf::internal::WireFormat::PARSE,
  1961. "protobuf_unittest_no_arena.TestAllTypes.optional_string_piece");
  1962. } else {
  1963. goto handle_unusual;
  1964. }
  1965. break;
  1966. }
  1967. // optional string optional_cord = 25 [ctype = CORD];
  1968. case 25: {
  1969. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1970. static_cast< ::google::protobuf::uint8>(202u /* 202 & 0xFF */)) {
  1971. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1972. input, this->mutable_optional_cord()));
  1973. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  1974. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  1975. ::google::protobuf::internal::WireFormat::PARSE,
  1976. "protobuf_unittest_no_arena.TestAllTypes.optional_cord");
  1977. } else {
  1978. goto handle_unusual;
  1979. }
  1980. break;
  1981. }
  1982. // optional .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  1983. case 26: {
  1984. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1985. static_cast< ::google::protobuf::uint8>(210u /* 210 & 0xFF */)) {
  1986. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1987. input, mutable_optional_public_import_message()));
  1988. } else {
  1989. goto handle_unusual;
  1990. }
  1991. break;
  1992. }
  1993. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_message = 27 [lazy = true];
  1994. case 27: {
  1995. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1996. static_cast< ::google::protobuf::uint8>(218u /* 218 & 0xFF */)) {
  1997. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1998. input, mutable_optional_message()));
  1999. } else {
  2000. goto handle_unusual;
  2001. }
  2002. break;
  2003. }
  2004. // repeated int32 repeated_int32 = 31;
  2005. case 31: {
  2006. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2007. static_cast< ::google::protobuf::uint8>(248u /* 248 & 0xFF */)) {
  2008. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2009. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  2010. 2, 248u, input, this->mutable_repeated_int32())));
  2011. } else if (
  2012. static_cast< ::google::protobuf::uint8>(tag) ==
  2013. static_cast< ::google::protobuf::uint8>(250u /* 250 & 0xFF */)) {
  2014. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2015. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  2016. input, this->mutable_repeated_int32())));
  2017. } else {
  2018. goto handle_unusual;
  2019. }
  2020. break;
  2021. }
  2022. // repeated int64 repeated_int64 = 32;
  2023. case 32: {
  2024. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2025. static_cast< ::google::protobuf::uint8>(0u /* 256 & 0xFF */)) {
  2026. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2027. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  2028. 2, 256u, input, this->mutable_repeated_int64())));
  2029. } else if (
  2030. static_cast< ::google::protobuf::uint8>(tag) ==
  2031. static_cast< ::google::protobuf::uint8>(2u /* 258 & 0xFF */)) {
  2032. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2033. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  2034. input, this->mutable_repeated_int64())));
  2035. } else {
  2036. goto handle_unusual;
  2037. }
  2038. break;
  2039. }
  2040. // repeated uint32 repeated_uint32 = 33;
  2041. case 33: {
  2042. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2043. static_cast< ::google::protobuf::uint8>(8u /* 264 & 0xFF */)) {
  2044. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2045. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  2046. 2, 264u, input, this->mutable_repeated_uint32())));
  2047. } else if (
  2048. static_cast< ::google::protobuf::uint8>(tag) ==
  2049. static_cast< ::google::protobuf::uint8>(10u /* 266 & 0xFF */)) {
  2050. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2051. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  2052. input, this->mutable_repeated_uint32())));
  2053. } else {
  2054. goto handle_unusual;
  2055. }
  2056. break;
  2057. }
  2058. // repeated uint64 repeated_uint64 = 34;
  2059. case 34: {
  2060. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2061. static_cast< ::google::protobuf::uint8>(16u /* 272 & 0xFF */)) {
  2062. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2063. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  2064. 2, 272u, input, this->mutable_repeated_uint64())));
  2065. } else if (
  2066. static_cast< ::google::protobuf::uint8>(tag) ==
  2067. static_cast< ::google::protobuf::uint8>(18u /* 274 & 0xFF */)) {
  2068. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2069. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  2070. input, this->mutable_repeated_uint64())));
  2071. } else {
  2072. goto handle_unusual;
  2073. }
  2074. break;
  2075. }
  2076. // repeated sint32 repeated_sint32 = 35;
  2077. case 35: {
  2078. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2079. static_cast< ::google::protobuf::uint8>(24u /* 280 & 0xFF */)) {
  2080. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2081. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  2082. 2, 280u, input, this->mutable_repeated_sint32())));
  2083. } else if (
  2084. static_cast< ::google::protobuf::uint8>(tag) ==
  2085. static_cast< ::google::protobuf::uint8>(26u /* 282 & 0xFF */)) {
  2086. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2087. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  2088. input, this->mutable_repeated_sint32())));
  2089. } else {
  2090. goto handle_unusual;
  2091. }
  2092. break;
  2093. }
  2094. // repeated sint64 repeated_sint64 = 36;
  2095. case 36: {
  2096. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2097. static_cast< ::google::protobuf::uint8>(32u /* 288 & 0xFF */)) {
  2098. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2099. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  2100. 2, 288u, input, this->mutable_repeated_sint64())));
  2101. } else if (
  2102. static_cast< ::google::protobuf::uint8>(tag) ==
  2103. static_cast< ::google::protobuf::uint8>(34u /* 290 & 0xFF */)) {
  2104. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2105. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  2106. input, this->mutable_repeated_sint64())));
  2107. } else {
  2108. goto handle_unusual;
  2109. }
  2110. break;
  2111. }
  2112. // repeated fixed32 repeated_fixed32 = 37;
  2113. case 37: {
  2114. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2115. static_cast< ::google::protobuf::uint8>(45u /* 301 & 0xFF */)) {
  2116. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2117. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  2118. 2, 301u, input, this->mutable_repeated_fixed32())));
  2119. } else if (
  2120. static_cast< ::google::protobuf::uint8>(tag) ==
  2121. static_cast< ::google::protobuf::uint8>(42u /* 298 & 0xFF */)) {
  2122. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2123. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  2124. input, this->mutable_repeated_fixed32())));
  2125. } else {
  2126. goto handle_unusual;
  2127. }
  2128. break;
  2129. }
  2130. // repeated fixed64 repeated_fixed64 = 38;
  2131. case 38: {
  2132. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2133. static_cast< ::google::protobuf::uint8>(49u /* 305 & 0xFF */)) {
  2134. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2135. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  2136. 2, 305u, input, this->mutable_repeated_fixed64())));
  2137. } else if (
  2138. static_cast< ::google::protobuf::uint8>(tag) ==
  2139. static_cast< ::google::protobuf::uint8>(50u /* 306 & 0xFF */)) {
  2140. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2141. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  2142. input, this->mutable_repeated_fixed64())));
  2143. } else {
  2144. goto handle_unusual;
  2145. }
  2146. break;
  2147. }
  2148. // repeated sfixed32 repeated_sfixed32 = 39;
  2149. case 39: {
  2150. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2151. static_cast< ::google::protobuf::uint8>(61u /* 317 & 0xFF */)) {
  2152. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2153. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  2154. 2, 317u, input, this->mutable_repeated_sfixed32())));
  2155. } else if (
  2156. static_cast< ::google::protobuf::uint8>(tag) ==
  2157. static_cast< ::google::protobuf::uint8>(58u /* 314 & 0xFF */)) {
  2158. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2159. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  2160. input, this->mutable_repeated_sfixed32())));
  2161. } else {
  2162. goto handle_unusual;
  2163. }
  2164. break;
  2165. }
  2166. // repeated sfixed64 repeated_sfixed64 = 40;
  2167. case 40: {
  2168. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2169. static_cast< ::google::protobuf::uint8>(65u /* 321 & 0xFF */)) {
  2170. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2171. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  2172. 2, 321u, input, this->mutable_repeated_sfixed64())));
  2173. } else if (
  2174. static_cast< ::google::protobuf::uint8>(tag) ==
  2175. static_cast< ::google::protobuf::uint8>(66u /* 322 & 0xFF */)) {
  2176. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2177. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  2178. input, this->mutable_repeated_sfixed64())));
  2179. } else {
  2180. goto handle_unusual;
  2181. }
  2182. break;
  2183. }
  2184. // repeated float repeated_float = 41;
  2185. case 41: {
  2186. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2187. static_cast< ::google::protobuf::uint8>(77u /* 333 & 0xFF */)) {
  2188. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2189. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  2190. 2, 333u, input, this->mutable_repeated_float())));
  2191. } else if (
  2192. static_cast< ::google::protobuf::uint8>(tag) ==
  2193. static_cast< ::google::protobuf::uint8>(74u /* 330 & 0xFF */)) {
  2194. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2195. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  2196. input, this->mutable_repeated_float())));
  2197. } else {
  2198. goto handle_unusual;
  2199. }
  2200. break;
  2201. }
  2202. // repeated double repeated_double = 42;
  2203. case 42: {
  2204. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2205. static_cast< ::google::protobuf::uint8>(81u /* 337 & 0xFF */)) {
  2206. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2207. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  2208. 2, 337u, input, this->mutable_repeated_double())));
  2209. } else if (
  2210. static_cast< ::google::protobuf::uint8>(tag) ==
  2211. static_cast< ::google::protobuf::uint8>(82u /* 338 & 0xFF */)) {
  2212. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2213. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  2214. input, this->mutable_repeated_double())));
  2215. } else {
  2216. goto handle_unusual;
  2217. }
  2218. break;
  2219. }
  2220. // repeated bool repeated_bool = 43;
  2221. case 43: {
  2222. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2223. static_cast< ::google::protobuf::uint8>(88u /* 344 & 0xFF */)) {
  2224. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  2225. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  2226. 2, 344u, input, this->mutable_repeated_bool())));
  2227. } else if (
  2228. static_cast< ::google::protobuf::uint8>(tag) ==
  2229. static_cast< ::google::protobuf::uint8>(90u /* 346 & 0xFF */)) {
  2230. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  2231. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  2232. input, this->mutable_repeated_bool())));
  2233. } else {
  2234. goto handle_unusual;
  2235. }
  2236. break;
  2237. }
  2238. // repeated string repeated_string = 44;
  2239. case 44: {
  2240. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2241. static_cast< ::google::protobuf::uint8>(98u /* 354 & 0xFF */)) {
  2242. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  2243. input, this->add_repeated_string()));
  2244. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2245. this->repeated_string(this->repeated_string_size() - 1).data(),
  2246. static_cast<int>(this->repeated_string(this->repeated_string_size() - 1).length()),
  2247. ::google::protobuf::internal::WireFormat::PARSE,
  2248. "protobuf_unittest_no_arena.TestAllTypes.repeated_string");
  2249. } else {
  2250. goto handle_unusual;
  2251. }
  2252. break;
  2253. }
  2254. // repeated bytes repeated_bytes = 45;
  2255. case 45: {
  2256. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2257. static_cast< ::google::protobuf::uint8>(106u /* 362 & 0xFF */)) {
  2258. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  2259. input, this->add_repeated_bytes()));
  2260. } else {
  2261. goto handle_unusual;
  2262. }
  2263. break;
  2264. }
  2265. // repeated group RepeatedGroup = 46 { ... };
  2266. case 46: {
  2267. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2268. static_cast< ::google::protobuf::uint8>(115u /* 371 & 0xFF */)) {
  2269. DO_(::google::protobuf::internal::WireFormatLite::ReadGroup(46, input, add_repeatedgroup()));
  2270. } else {
  2271. goto handle_unusual;
  2272. }
  2273. break;
  2274. }
  2275. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_nested_message = 48;
  2276. case 48: {
  2277. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2278. static_cast< ::google::protobuf::uint8>(130u /* 386 & 0xFF */)) {
  2279. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  2280. input, add_repeated_nested_message()));
  2281. } else {
  2282. goto handle_unusual;
  2283. }
  2284. break;
  2285. }
  2286. // repeated .protobuf_unittest_no_arena.ForeignMessage repeated_foreign_message = 49;
  2287. case 49: {
  2288. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2289. static_cast< ::google::protobuf::uint8>(138u /* 394 & 0xFF */)) {
  2290. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  2291. input, add_repeated_foreign_message()));
  2292. } else {
  2293. goto handle_unusual;
  2294. }
  2295. break;
  2296. }
  2297. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  2298. case 50: {
  2299. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2300. static_cast< ::google::protobuf::uint8>(146u /* 402 & 0xFF */)) {
  2301. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  2302. input, add_repeated_import_message()));
  2303. } else {
  2304. goto handle_unusual;
  2305. }
  2306. break;
  2307. }
  2308. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  2309. case 51: {
  2310. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2311. static_cast< ::google::protobuf::uint8>(152u /* 408 & 0xFF */)) {
  2312. int value;
  2313. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2314. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  2315. input, &value)));
  2316. if (::protobuf_unittest_no_arena::TestAllTypes_NestedEnum_IsValid(value)) {
  2317. add_repeated_nested_enum(static_cast< ::protobuf_unittest_no_arena::TestAllTypes_NestedEnum >(value));
  2318. } else {
  2319. mutable_unknown_fields()->AddVarint(
  2320. 51, static_cast< ::google::protobuf::uint64>(value));
  2321. }
  2322. } else if (
  2323. static_cast< ::google::protobuf::uint8>(tag) ==
  2324. static_cast< ::google::protobuf::uint8>(154u /* 410 & 0xFF */)) {
  2325. DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns(
  2326. input,
  2327. 51,
  2328. ::protobuf_unittest_no_arena::TestAllTypes_NestedEnum_IsValid,
  2329. mutable_unknown_fields(),
  2330. this->mutable_repeated_nested_enum())));
  2331. } else {
  2332. goto handle_unusual;
  2333. }
  2334. break;
  2335. }
  2336. // repeated .protobuf_unittest_no_arena.ForeignEnum repeated_foreign_enum = 52;
  2337. case 52: {
  2338. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2339. static_cast< ::google::protobuf::uint8>(160u /* 416 & 0xFF */)) {
  2340. int value;
  2341. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2342. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  2343. input, &value)));
  2344. if (::protobuf_unittest_no_arena::ForeignEnum_IsValid(value)) {
  2345. add_repeated_foreign_enum(static_cast< ::protobuf_unittest_no_arena::ForeignEnum >(value));
  2346. } else {
  2347. mutable_unknown_fields()->AddVarint(
  2348. 52, static_cast< ::google::protobuf::uint64>(value));
  2349. }
  2350. } else if (
  2351. static_cast< ::google::protobuf::uint8>(tag) ==
  2352. static_cast< ::google::protobuf::uint8>(162u /* 418 & 0xFF */)) {
  2353. DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns(
  2354. input,
  2355. 52,
  2356. ::protobuf_unittest_no_arena::ForeignEnum_IsValid,
  2357. mutable_unknown_fields(),
  2358. this->mutable_repeated_foreign_enum())));
  2359. } else {
  2360. goto handle_unusual;
  2361. }
  2362. break;
  2363. }
  2364. // repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
  2365. case 53: {
  2366. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2367. static_cast< ::google::protobuf::uint8>(168u /* 424 & 0xFF */)) {
  2368. int value;
  2369. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2370. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  2371. input, &value)));
  2372. if (::protobuf_unittest_import::ImportEnum_IsValid(value)) {
  2373. add_repeated_import_enum(static_cast< ::protobuf_unittest_import::ImportEnum >(value));
  2374. } else {
  2375. mutable_unknown_fields()->AddVarint(
  2376. 53, static_cast< ::google::protobuf::uint64>(value));
  2377. }
  2378. } else if (
  2379. static_cast< ::google::protobuf::uint8>(tag) ==
  2380. static_cast< ::google::protobuf::uint8>(170u /* 426 & 0xFF */)) {
  2381. DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns(
  2382. input,
  2383. 53,
  2384. ::protobuf_unittest_import::ImportEnum_IsValid,
  2385. mutable_unknown_fields(),
  2386. this->mutable_repeated_import_enum())));
  2387. } else {
  2388. goto handle_unusual;
  2389. }
  2390. break;
  2391. }
  2392. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  2393. case 54: {
  2394. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2395. static_cast< ::google::protobuf::uint8>(178u /* 434 & 0xFF */)) {
  2396. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  2397. input, this->add_repeated_string_piece()));
  2398. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2399. this->repeated_string_piece(this->repeated_string_piece_size() - 1).data(),
  2400. static_cast<int>(this->repeated_string_piece(this->repeated_string_piece_size() - 1).length()),
  2401. ::google::protobuf::internal::WireFormat::PARSE,
  2402. "protobuf_unittest_no_arena.TestAllTypes.repeated_string_piece");
  2403. } else {
  2404. goto handle_unusual;
  2405. }
  2406. break;
  2407. }
  2408. // repeated string repeated_cord = 55 [ctype = CORD];
  2409. case 55: {
  2410. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2411. static_cast< ::google::protobuf::uint8>(186u /* 442 & 0xFF */)) {
  2412. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  2413. input, this->add_repeated_cord()));
  2414. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2415. this->repeated_cord(this->repeated_cord_size() - 1).data(),
  2416. static_cast<int>(this->repeated_cord(this->repeated_cord_size() - 1).length()),
  2417. ::google::protobuf::internal::WireFormat::PARSE,
  2418. "protobuf_unittest_no_arena.TestAllTypes.repeated_cord");
  2419. } else {
  2420. goto handle_unusual;
  2421. }
  2422. break;
  2423. }
  2424. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  2425. case 57: {
  2426. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2427. static_cast< ::google::protobuf::uint8>(202u /* 458 & 0xFF */)) {
  2428. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  2429. input, add_repeated_lazy_message()));
  2430. } else {
  2431. goto handle_unusual;
  2432. }
  2433. break;
  2434. }
  2435. // optional int32 default_int32 = 61 [default = 41];
  2436. case 61: {
  2437. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2438. static_cast< ::google::protobuf::uint8>(232u /* 488 & 0xFF */)) {
  2439. set_has_default_int32();
  2440. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2441. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  2442. input, &default_int32_)));
  2443. } else {
  2444. goto handle_unusual;
  2445. }
  2446. break;
  2447. }
  2448. // optional int64 default_int64 = 62 [default = 42];
  2449. case 62: {
  2450. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2451. static_cast< ::google::protobuf::uint8>(240u /* 496 & 0xFF */)) {
  2452. set_has_default_int64();
  2453. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2454. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  2455. input, &default_int64_)));
  2456. } else {
  2457. goto handle_unusual;
  2458. }
  2459. break;
  2460. }
  2461. // optional uint32 default_uint32 = 63 [default = 43];
  2462. case 63: {
  2463. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2464. static_cast< ::google::protobuf::uint8>(248u /* 504 & 0xFF */)) {
  2465. set_has_default_uint32();
  2466. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2467. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  2468. input, &default_uint32_)));
  2469. } else {
  2470. goto handle_unusual;
  2471. }
  2472. break;
  2473. }
  2474. // optional uint64 default_uint64 = 64 [default = 44];
  2475. case 64: {
  2476. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2477. static_cast< ::google::protobuf::uint8>(0u /* 512 & 0xFF */)) {
  2478. set_has_default_uint64();
  2479. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2480. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  2481. input, &default_uint64_)));
  2482. } else {
  2483. goto handle_unusual;
  2484. }
  2485. break;
  2486. }
  2487. // optional sint32 default_sint32 = 65 [default = -45];
  2488. case 65: {
  2489. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2490. static_cast< ::google::protobuf::uint8>(8u /* 520 & 0xFF */)) {
  2491. set_has_default_sint32();
  2492. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2493. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  2494. input, &default_sint32_)));
  2495. } else {
  2496. goto handle_unusual;
  2497. }
  2498. break;
  2499. }
  2500. // optional sint64 default_sint64 = 66 [default = 46];
  2501. case 66: {
  2502. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2503. static_cast< ::google::protobuf::uint8>(16u /* 528 & 0xFF */)) {
  2504. set_has_default_sint64();
  2505. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2506. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  2507. input, &default_sint64_)));
  2508. } else {
  2509. goto handle_unusual;
  2510. }
  2511. break;
  2512. }
  2513. // optional fixed32 default_fixed32 = 67 [default = 47];
  2514. case 67: {
  2515. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2516. static_cast< ::google::protobuf::uint8>(29u /* 541 & 0xFF */)) {
  2517. set_has_default_fixed32();
  2518. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2519. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  2520. input, &default_fixed32_)));
  2521. } else {
  2522. goto handle_unusual;
  2523. }
  2524. break;
  2525. }
  2526. // optional fixed64 default_fixed64 = 68 [default = 48];
  2527. case 68: {
  2528. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2529. static_cast< ::google::protobuf::uint8>(33u /* 545 & 0xFF */)) {
  2530. set_has_default_fixed64();
  2531. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2532. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  2533. input, &default_fixed64_)));
  2534. } else {
  2535. goto handle_unusual;
  2536. }
  2537. break;
  2538. }
  2539. // optional sfixed32 default_sfixed32 = 69 [default = 49];
  2540. case 69: {
  2541. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2542. static_cast< ::google::protobuf::uint8>(45u /* 557 & 0xFF */)) {
  2543. set_has_default_sfixed32();
  2544. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2545. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  2546. input, &default_sfixed32_)));
  2547. } else {
  2548. goto handle_unusual;
  2549. }
  2550. break;
  2551. }
  2552. // optional sfixed64 default_sfixed64 = 70 [default = -50];
  2553. case 70: {
  2554. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2555. static_cast< ::google::protobuf::uint8>(49u /* 561 & 0xFF */)) {
  2556. set_has_default_sfixed64();
  2557. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2558. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  2559. input, &default_sfixed64_)));
  2560. } else {
  2561. goto handle_unusual;
  2562. }
  2563. break;
  2564. }
  2565. // optional float default_float = 71 [default = 51.5];
  2566. case 71: {
  2567. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2568. static_cast< ::google::protobuf::uint8>(61u /* 573 & 0xFF */)) {
  2569. set_has_default_float();
  2570. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2571. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  2572. input, &default_float_)));
  2573. } else {
  2574. goto handle_unusual;
  2575. }
  2576. break;
  2577. }
  2578. // optional double default_double = 72 [default = 52000];
  2579. case 72: {
  2580. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2581. static_cast< ::google::protobuf::uint8>(65u /* 577 & 0xFF */)) {
  2582. set_has_default_double();
  2583. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2584. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  2585. input, &default_double_)));
  2586. } else {
  2587. goto handle_unusual;
  2588. }
  2589. break;
  2590. }
  2591. // optional bool default_bool = 73 [default = true];
  2592. case 73: {
  2593. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2594. static_cast< ::google::protobuf::uint8>(72u /* 584 & 0xFF */)) {
  2595. set_has_default_bool();
  2596. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2597. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  2598. input, &default_bool_)));
  2599. } else {
  2600. goto handle_unusual;
  2601. }
  2602. break;
  2603. }
  2604. // optional string default_string = 74 [default = "hello"];
  2605. case 74: {
  2606. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2607. static_cast< ::google::protobuf::uint8>(82u /* 594 & 0xFF */)) {
  2608. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  2609. input, this->mutable_default_string()));
  2610. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2611. this->default_string().data(), static_cast<int>(this->default_string().length()),
  2612. ::google::protobuf::internal::WireFormat::PARSE,
  2613. "protobuf_unittest_no_arena.TestAllTypes.default_string");
  2614. } else {
  2615. goto handle_unusual;
  2616. }
  2617. break;
  2618. }
  2619. // optional bytes default_bytes = 75 [default = "world"];
  2620. case 75: {
  2621. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2622. static_cast< ::google::protobuf::uint8>(90u /* 602 & 0xFF */)) {
  2623. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  2624. input, this->mutable_default_bytes()));
  2625. } else {
  2626. goto handle_unusual;
  2627. }
  2628. break;
  2629. }
  2630. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
  2631. case 81: {
  2632. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2633. static_cast< ::google::protobuf::uint8>(136u /* 648 & 0xFF */)) {
  2634. int value;
  2635. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2636. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  2637. input, &value)));
  2638. if (::protobuf_unittest_no_arena::TestAllTypes_NestedEnum_IsValid(value)) {
  2639. set_default_nested_enum(static_cast< ::protobuf_unittest_no_arena::TestAllTypes_NestedEnum >(value));
  2640. } else {
  2641. mutable_unknown_fields()->AddVarint(
  2642. 81, static_cast< ::google::protobuf::uint64>(value));
  2643. }
  2644. } else {
  2645. goto handle_unusual;
  2646. }
  2647. break;
  2648. }
  2649. // optional .protobuf_unittest_no_arena.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
  2650. case 82: {
  2651. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2652. static_cast< ::google::protobuf::uint8>(144u /* 656 & 0xFF */)) {
  2653. int value;
  2654. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2655. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  2656. input, &value)));
  2657. if (::protobuf_unittest_no_arena::ForeignEnum_IsValid(value)) {
  2658. set_default_foreign_enum(static_cast< ::protobuf_unittest_no_arena::ForeignEnum >(value));
  2659. } else {
  2660. mutable_unknown_fields()->AddVarint(
  2661. 82, static_cast< ::google::protobuf::uint64>(value));
  2662. }
  2663. } else {
  2664. goto handle_unusual;
  2665. }
  2666. break;
  2667. }
  2668. // optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
  2669. case 83: {
  2670. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2671. static_cast< ::google::protobuf::uint8>(152u /* 664 & 0xFF */)) {
  2672. int value;
  2673. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2674. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  2675. input, &value)));
  2676. if (::protobuf_unittest_import::ImportEnum_IsValid(value)) {
  2677. set_default_import_enum(static_cast< ::protobuf_unittest_import::ImportEnum >(value));
  2678. } else {
  2679. mutable_unknown_fields()->AddVarint(
  2680. 83, static_cast< ::google::protobuf::uint64>(value));
  2681. }
  2682. } else {
  2683. goto handle_unusual;
  2684. }
  2685. break;
  2686. }
  2687. // optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
  2688. case 84: {
  2689. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2690. static_cast< ::google::protobuf::uint8>(162u /* 674 & 0xFF */)) {
  2691. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  2692. input, this->mutable_default_string_piece()));
  2693. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2694. this->default_string_piece().data(), static_cast<int>(this->default_string_piece().length()),
  2695. ::google::protobuf::internal::WireFormat::PARSE,
  2696. "protobuf_unittest_no_arena.TestAllTypes.default_string_piece");
  2697. } else {
  2698. goto handle_unusual;
  2699. }
  2700. break;
  2701. }
  2702. // optional string default_cord = 85 [default = "123", ctype = CORD];
  2703. case 85: {
  2704. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2705. static_cast< ::google::protobuf::uint8>(170u /* 682 & 0xFF */)) {
  2706. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  2707. input, this->mutable_default_cord()));
  2708. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2709. this->default_cord().data(), static_cast<int>(this->default_cord().length()),
  2710. ::google::protobuf::internal::WireFormat::PARSE,
  2711. "protobuf_unittest_no_arena.TestAllTypes.default_cord");
  2712. } else {
  2713. goto handle_unusual;
  2714. }
  2715. break;
  2716. }
  2717. // optional uint32 oneof_uint32 = 111;
  2718. case 111: {
  2719. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2720. static_cast< ::google::protobuf::uint8>(120u /* 888 & 0xFF */)) {
  2721. clear_oneof_field();
  2722. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2723. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  2724. input, &oneof_field_.oneof_uint32_)));
  2725. set_has_oneof_uint32();
  2726. } else {
  2727. goto handle_unusual;
  2728. }
  2729. break;
  2730. }
  2731. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage oneof_nested_message = 112;
  2732. case 112: {
  2733. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2734. static_cast< ::google::protobuf::uint8>(130u /* 898 & 0xFF */)) {
  2735. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  2736. input, mutable_oneof_nested_message()));
  2737. } else {
  2738. goto handle_unusual;
  2739. }
  2740. break;
  2741. }
  2742. // optional string oneof_string = 113;
  2743. case 113: {
  2744. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2745. static_cast< ::google::protobuf::uint8>(138u /* 906 & 0xFF */)) {
  2746. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  2747. input, this->mutable_oneof_string()));
  2748. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2749. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  2750. ::google::protobuf::internal::WireFormat::PARSE,
  2751. "protobuf_unittest_no_arena.TestAllTypes.oneof_string");
  2752. } else {
  2753. goto handle_unusual;
  2754. }
  2755. break;
  2756. }
  2757. // optional bytes oneof_bytes = 114;
  2758. case 114: {
  2759. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2760. static_cast< ::google::protobuf::uint8>(146u /* 914 & 0xFF */)) {
  2761. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  2762. input, this->mutable_oneof_bytes()));
  2763. } else {
  2764. goto handle_unusual;
  2765. }
  2766. break;
  2767. }
  2768. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage lazy_oneof_nested_message = 115 [lazy = true];
  2769. case 115: {
  2770. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2771. static_cast< ::google::protobuf::uint8>(154u /* 922 & 0xFF */)) {
  2772. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  2773. input, mutable_lazy_oneof_nested_message()));
  2774. } else {
  2775. goto handle_unusual;
  2776. }
  2777. break;
  2778. }
  2779. default: {
  2780. handle_unusual:
  2781. if (tag == 0) {
  2782. goto success;
  2783. }
  2784. DO_(::google::protobuf::internal::WireFormat::SkipField(
  2785. input, tag, _internal_metadata_.mutable_unknown_fields()));
  2786. break;
  2787. }
  2788. }
  2789. }
  2790. success:
  2791. // @@protoc_insertion_point(parse_success:protobuf_unittest_no_arena.TestAllTypes)
  2792. return true;
  2793. failure:
  2794. // @@protoc_insertion_point(parse_failure:protobuf_unittest_no_arena.TestAllTypes)
  2795. return false;
  2796. #undef DO_
  2797. }
  2798. void TestAllTypes::SerializeWithCachedSizes(
  2799. ::google::protobuf::io::CodedOutputStream* output) const {
  2800. // @@protoc_insertion_point(serialize_start:protobuf_unittest_no_arena.TestAllTypes)
  2801. ::google::protobuf::uint32 cached_has_bits = 0;
  2802. (void) cached_has_bits;
  2803. cached_has_bits = _has_bits_[0];
  2804. // optional int32 optional_int32 = 1;
  2805. if (cached_has_bits & 0x00008000u) {
  2806. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->optional_int32(), output);
  2807. }
  2808. // optional int64 optional_int64 = 2;
  2809. if (cached_has_bits & 0x00004000u) {
  2810. ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->optional_int64(), output);
  2811. }
  2812. // optional uint32 optional_uint32 = 3;
  2813. if (cached_has_bits & 0x00010000u) {
  2814. ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->optional_uint32(), output);
  2815. }
  2816. // optional uint64 optional_uint64 = 4;
  2817. if (cached_has_bits & 0x00020000u) {
  2818. ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->optional_uint64(), output);
  2819. }
  2820. // optional sint32 optional_sint32 = 5;
  2821. if (cached_has_bits & 0x00080000u) {
  2822. ::google::protobuf::internal::WireFormatLite::WriteSInt32(5, this->optional_sint32(), output);
  2823. }
  2824. // optional sint64 optional_sint64 = 6;
  2825. if (cached_has_bits & 0x00040000u) {
  2826. ::google::protobuf::internal::WireFormatLite::WriteSInt64(6, this->optional_sint64(), output);
  2827. }
  2828. // optional fixed32 optional_fixed32 = 7;
  2829. if (cached_has_bits & 0x00100000u) {
  2830. ::google::protobuf::internal::WireFormatLite::WriteFixed32(7, this->optional_fixed32(), output);
  2831. }
  2832. // optional fixed64 optional_fixed64 = 8;
  2833. if (cached_has_bits & 0x00200000u) {
  2834. ::google::protobuf::internal::WireFormatLite::WriteFixed64(8, this->optional_fixed64(), output);
  2835. }
  2836. // optional sfixed32 optional_sfixed32 = 9;
  2837. if (cached_has_bits & 0x00800000u) {
  2838. ::google::protobuf::internal::WireFormatLite::WriteSFixed32(9, this->optional_sfixed32(), output);
  2839. }
  2840. // optional sfixed64 optional_sfixed64 = 10;
  2841. if (cached_has_bits & 0x00400000u) {
  2842. ::google::protobuf::internal::WireFormatLite::WriteSFixed64(10, this->optional_sfixed64(), output);
  2843. }
  2844. // optional float optional_float = 11;
  2845. if (cached_has_bits & 0x01000000u) {
  2846. ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->optional_float(), output);
  2847. }
  2848. // optional double optional_double = 12;
  2849. if (cached_has_bits & 0x02000000u) {
  2850. ::google::protobuf::internal::WireFormatLite::WriteDouble(12, this->optional_double(), output);
  2851. }
  2852. // optional bool optional_bool = 13;
  2853. if (cached_has_bits & 0x04000000u) {
  2854. ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->optional_bool(), output);
  2855. }
  2856. // optional string optional_string = 14;
  2857. if (cached_has_bits & 0x00000001u) {
  2858. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2859. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  2860. ::google::protobuf::internal::WireFormat::SERIALIZE,
  2861. "protobuf_unittest_no_arena.TestAllTypes.optional_string");
  2862. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  2863. 14, this->optional_string(), output);
  2864. }
  2865. // optional bytes optional_bytes = 15;
  2866. if (cached_has_bits & 0x00000002u) {
  2867. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  2868. 15, this->optional_bytes(), output);
  2869. }
  2870. // optional group OptionalGroup = 16 { ... };
  2871. if (cached_has_bits & 0x00000100u) {
  2872. ::google::protobuf::internal::WireFormatLite::WriteGroupMaybeToArray(
  2873. 16, this->_internal_optionalgroup(), output);
  2874. }
  2875. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_nested_message = 18;
  2876. if (cached_has_bits & 0x00000200u) {
  2877. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2878. 18, this->_internal_optional_nested_message(), output);
  2879. }
  2880. // optional .protobuf_unittest_no_arena.ForeignMessage optional_foreign_message = 19;
  2881. if (cached_has_bits & 0x00000400u) {
  2882. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2883. 19, this->_internal_optional_foreign_message(), output);
  2884. }
  2885. // optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  2886. if (cached_has_bits & 0x00000800u) {
  2887. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2888. 20, this->_internal_optional_import_message(), output);
  2889. }
  2890. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum optional_nested_enum = 21;
  2891. if (cached_has_bits & 0x10000000u) {
  2892. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  2893. 21, this->optional_nested_enum(), output);
  2894. }
  2895. // optional .protobuf_unittest_no_arena.ForeignEnum optional_foreign_enum = 22;
  2896. if (cached_has_bits & 0x20000000u) {
  2897. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  2898. 22, this->optional_foreign_enum(), output);
  2899. }
  2900. // optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
  2901. if (cached_has_bits & 0x40000000u) {
  2902. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  2903. 23, this->optional_import_enum(), output);
  2904. }
  2905. // optional string optional_string_piece = 24 [ctype = STRING_PIECE];
  2906. if (cached_has_bits & 0x00000004u) {
  2907. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2908. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  2909. ::google::protobuf::internal::WireFormat::SERIALIZE,
  2910. "protobuf_unittest_no_arena.TestAllTypes.optional_string_piece");
  2911. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  2912. 24, this->optional_string_piece(), output);
  2913. }
  2914. // optional string optional_cord = 25 [ctype = CORD];
  2915. if (cached_has_bits & 0x00000008u) {
  2916. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  2917. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  2918. ::google::protobuf::internal::WireFormat::SERIALIZE,
  2919. "protobuf_unittest_no_arena.TestAllTypes.optional_cord");
  2920. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  2921. 25, this->optional_cord(), output);
  2922. }
  2923. // optional .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  2924. if (cached_has_bits & 0x00001000u) {
  2925. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2926. 26, this->_internal_optional_public_import_message(), output);
  2927. }
  2928. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_message = 27 [lazy = true];
  2929. if (cached_has_bits & 0x00002000u) {
  2930. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2931. 27, this->_internal_optional_message(), output);
  2932. }
  2933. // repeated int32 repeated_int32 = 31;
  2934. for (int i = 0, n = this->repeated_int32_size(); i < n; i++) {
  2935. ::google::protobuf::internal::WireFormatLite::WriteInt32(
  2936. 31, this->repeated_int32(i), output);
  2937. }
  2938. // repeated int64 repeated_int64 = 32;
  2939. for (int i = 0, n = this->repeated_int64_size(); i < n; i++) {
  2940. ::google::protobuf::internal::WireFormatLite::WriteInt64(
  2941. 32, this->repeated_int64(i), output);
  2942. }
  2943. // repeated uint32 repeated_uint32 = 33;
  2944. for (int i = 0, n = this->repeated_uint32_size(); i < n; i++) {
  2945. ::google::protobuf::internal::WireFormatLite::WriteUInt32(
  2946. 33, this->repeated_uint32(i), output);
  2947. }
  2948. // repeated uint64 repeated_uint64 = 34;
  2949. for (int i = 0, n = this->repeated_uint64_size(); i < n; i++) {
  2950. ::google::protobuf::internal::WireFormatLite::WriteUInt64(
  2951. 34, this->repeated_uint64(i), output);
  2952. }
  2953. // repeated sint32 repeated_sint32 = 35;
  2954. for (int i = 0, n = this->repeated_sint32_size(); i < n; i++) {
  2955. ::google::protobuf::internal::WireFormatLite::WriteSInt32(
  2956. 35, this->repeated_sint32(i), output);
  2957. }
  2958. // repeated sint64 repeated_sint64 = 36;
  2959. for (int i = 0, n = this->repeated_sint64_size(); i < n; i++) {
  2960. ::google::protobuf::internal::WireFormatLite::WriteSInt64(
  2961. 36, this->repeated_sint64(i), output);
  2962. }
  2963. // repeated fixed32 repeated_fixed32 = 37;
  2964. for (int i = 0, n = this->repeated_fixed32_size(); i < n; i++) {
  2965. ::google::protobuf::internal::WireFormatLite::WriteFixed32(
  2966. 37, this->repeated_fixed32(i), output);
  2967. }
  2968. // repeated fixed64 repeated_fixed64 = 38;
  2969. for (int i = 0, n = this->repeated_fixed64_size(); i < n; i++) {
  2970. ::google::protobuf::internal::WireFormatLite::WriteFixed64(
  2971. 38, this->repeated_fixed64(i), output);
  2972. }
  2973. // repeated sfixed32 repeated_sfixed32 = 39;
  2974. for (int i = 0, n = this->repeated_sfixed32_size(); i < n; i++) {
  2975. ::google::protobuf::internal::WireFormatLite::WriteSFixed32(
  2976. 39, this->repeated_sfixed32(i), output);
  2977. }
  2978. // repeated sfixed64 repeated_sfixed64 = 40;
  2979. for (int i = 0, n = this->repeated_sfixed64_size(); i < n; i++) {
  2980. ::google::protobuf::internal::WireFormatLite::WriteSFixed64(
  2981. 40, this->repeated_sfixed64(i), output);
  2982. }
  2983. // repeated float repeated_float = 41;
  2984. for (int i = 0, n = this->repeated_float_size(); i < n; i++) {
  2985. ::google::protobuf::internal::WireFormatLite::WriteFloat(
  2986. 41, this->repeated_float(i), output);
  2987. }
  2988. // repeated double repeated_double = 42;
  2989. for (int i = 0, n = this->repeated_double_size(); i < n; i++) {
  2990. ::google::protobuf::internal::WireFormatLite::WriteDouble(
  2991. 42, this->repeated_double(i), output);
  2992. }
  2993. // repeated bool repeated_bool = 43;
  2994. for (int i = 0, n = this->repeated_bool_size(); i < n; i++) {
  2995. ::google::protobuf::internal::WireFormatLite::WriteBool(
  2996. 43, this->repeated_bool(i), output);
  2997. }
  2998. // repeated string repeated_string = 44;
  2999. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  3000. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3001. this->repeated_string(i).data(), static_cast<int>(this->repeated_string(i).length()),
  3002. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3003. "protobuf_unittest_no_arena.TestAllTypes.repeated_string");
  3004. ::google::protobuf::internal::WireFormatLite::WriteString(
  3005. 44, this->repeated_string(i), output);
  3006. }
  3007. // repeated bytes repeated_bytes = 45;
  3008. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  3009. ::google::protobuf::internal::WireFormatLite::WriteBytes(
  3010. 45, this->repeated_bytes(i), output);
  3011. }
  3012. // repeated group RepeatedGroup = 46 { ... };
  3013. for (unsigned int i = 0,
  3014. n = static_cast<unsigned int>(this->repeatedgroup_size()); i < n; i++) {
  3015. ::google::protobuf::internal::WireFormatLite::WriteGroupMaybeToArray(
  3016. 46,
  3017. this->repeatedgroup(static_cast<int>(i)),
  3018. output);
  3019. }
  3020. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_nested_message = 48;
  3021. for (unsigned int i = 0,
  3022. n = static_cast<unsigned int>(this->repeated_nested_message_size()); i < n; i++) {
  3023. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  3024. 48,
  3025. this->repeated_nested_message(static_cast<int>(i)),
  3026. output);
  3027. }
  3028. // repeated .protobuf_unittest_no_arena.ForeignMessage repeated_foreign_message = 49;
  3029. for (unsigned int i = 0,
  3030. n = static_cast<unsigned int>(this->repeated_foreign_message_size()); i < n; i++) {
  3031. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  3032. 49,
  3033. this->repeated_foreign_message(static_cast<int>(i)),
  3034. output);
  3035. }
  3036. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  3037. for (unsigned int i = 0,
  3038. n = static_cast<unsigned int>(this->repeated_import_message_size()); i < n; i++) {
  3039. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  3040. 50,
  3041. this->repeated_import_message(static_cast<int>(i)),
  3042. output);
  3043. }
  3044. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  3045. for (int i = 0, n = this->repeated_nested_enum_size(); i < n; i++) {
  3046. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  3047. 51, this->repeated_nested_enum(i), output);
  3048. }
  3049. // repeated .protobuf_unittest_no_arena.ForeignEnum repeated_foreign_enum = 52;
  3050. for (int i = 0, n = this->repeated_foreign_enum_size(); i < n; i++) {
  3051. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  3052. 52, this->repeated_foreign_enum(i), output);
  3053. }
  3054. // repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
  3055. for (int i = 0, n = this->repeated_import_enum_size(); i < n; i++) {
  3056. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  3057. 53, this->repeated_import_enum(i), output);
  3058. }
  3059. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  3060. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  3061. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3062. this->repeated_string_piece(i).data(), static_cast<int>(this->repeated_string_piece(i).length()),
  3063. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3064. "protobuf_unittest_no_arena.TestAllTypes.repeated_string_piece");
  3065. ::google::protobuf::internal::WireFormatLite::WriteString(
  3066. 54, this->repeated_string_piece(i), output);
  3067. }
  3068. // repeated string repeated_cord = 55 [ctype = CORD];
  3069. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  3070. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3071. this->repeated_cord(i).data(), static_cast<int>(this->repeated_cord(i).length()),
  3072. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3073. "protobuf_unittest_no_arena.TestAllTypes.repeated_cord");
  3074. ::google::protobuf::internal::WireFormatLite::WriteString(
  3075. 55, this->repeated_cord(i), output);
  3076. }
  3077. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  3078. for (unsigned int i = 0,
  3079. n = static_cast<unsigned int>(this->repeated_lazy_message_size()); i < n; i++) {
  3080. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  3081. 57,
  3082. this->repeated_lazy_message(static_cast<int>(i)),
  3083. output);
  3084. }
  3085. // optional int32 default_int32 = 61 [default = 41];
  3086. if (cached_has_bits & 0x80000000u) {
  3087. ::google::protobuf::internal::WireFormatLite::WriteInt32(61, this->default_int32(), output);
  3088. }
  3089. cached_has_bits = _has_bits_[1];
  3090. // optional int64 default_int64 = 62 [default = 42];
  3091. if (cached_has_bits & 0x00000001u) {
  3092. ::google::protobuf::internal::WireFormatLite::WriteInt64(62, this->default_int64(), output);
  3093. }
  3094. // optional uint32 default_uint32 = 63 [default = 43];
  3095. if (cached_has_bits & 0x00000004u) {
  3096. ::google::protobuf::internal::WireFormatLite::WriteUInt32(63, this->default_uint32(), output);
  3097. }
  3098. // optional uint64 default_uint64 = 64 [default = 44];
  3099. if (cached_has_bits & 0x00000002u) {
  3100. ::google::protobuf::internal::WireFormatLite::WriteUInt64(64, this->default_uint64(), output);
  3101. }
  3102. // optional sint32 default_sint32 = 65 [default = -45];
  3103. if (cached_has_bits & 0x00000008u) {
  3104. ::google::protobuf::internal::WireFormatLite::WriteSInt32(65, this->default_sint32(), output);
  3105. }
  3106. // optional sint64 default_sint64 = 66 [default = 46];
  3107. if (cached_has_bits & 0x00000010u) {
  3108. ::google::protobuf::internal::WireFormatLite::WriteSInt64(66, this->default_sint64(), output);
  3109. }
  3110. // optional fixed32 default_fixed32 = 67 [default = 47];
  3111. if (cached_has_bits & 0x00000040u) {
  3112. ::google::protobuf::internal::WireFormatLite::WriteFixed32(67, this->default_fixed32(), output);
  3113. }
  3114. // optional fixed64 default_fixed64 = 68 [default = 48];
  3115. if (cached_has_bits & 0x00000020u) {
  3116. ::google::protobuf::internal::WireFormatLite::WriteFixed64(68, this->default_fixed64(), output);
  3117. }
  3118. // optional sfixed32 default_sfixed32 = 69 [default = 49];
  3119. if (cached_has_bits & 0x00000080u) {
  3120. ::google::protobuf::internal::WireFormatLite::WriteSFixed32(69, this->default_sfixed32(), output);
  3121. }
  3122. // optional sfixed64 default_sfixed64 = 70 [default = -50];
  3123. if (cached_has_bits & 0x00000100u) {
  3124. ::google::protobuf::internal::WireFormatLite::WriteSFixed64(70, this->default_sfixed64(), output);
  3125. }
  3126. // optional float default_float = 71 [default = 51.5];
  3127. if (cached_has_bits & 0x00000400u) {
  3128. ::google::protobuf::internal::WireFormatLite::WriteFloat(71, this->default_float(), output);
  3129. }
  3130. // optional double default_double = 72 [default = 52000];
  3131. if (cached_has_bits & 0x00000200u) {
  3132. ::google::protobuf::internal::WireFormatLite::WriteDouble(72, this->default_double(), output);
  3133. }
  3134. // optional bool default_bool = 73 [default = true];
  3135. if (cached_has_bits & 0x00000800u) {
  3136. ::google::protobuf::internal::WireFormatLite::WriteBool(73, this->default_bool(), output);
  3137. }
  3138. cached_has_bits = _has_bits_[0];
  3139. // optional string default_string = 74 [default = "hello"];
  3140. if (cached_has_bits & 0x00000010u) {
  3141. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3142. this->default_string().data(), static_cast<int>(this->default_string().length()),
  3143. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3144. "protobuf_unittest_no_arena.TestAllTypes.default_string");
  3145. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  3146. 74, this->default_string(), output);
  3147. }
  3148. // optional bytes default_bytes = 75 [default = "world"];
  3149. if (cached_has_bits & 0x00000020u) {
  3150. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  3151. 75, this->default_bytes(), output);
  3152. }
  3153. cached_has_bits = _has_bits_[1];
  3154. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
  3155. if (cached_has_bits & 0x00001000u) {
  3156. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  3157. 81, this->default_nested_enum(), output);
  3158. }
  3159. // optional .protobuf_unittest_no_arena.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
  3160. if (cached_has_bits & 0x00002000u) {
  3161. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  3162. 82, this->default_foreign_enum(), output);
  3163. }
  3164. cached_has_bits = _has_bits_[0];
  3165. // optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
  3166. if (cached_has_bits & 0x08000000u) {
  3167. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  3168. 83, this->default_import_enum(), output);
  3169. }
  3170. // optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
  3171. if (cached_has_bits & 0x00000040u) {
  3172. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3173. this->default_string_piece().data(), static_cast<int>(this->default_string_piece().length()),
  3174. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3175. "protobuf_unittest_no_arena.TestAllTypes.default_string_piece");
  3176. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  3177. 84, this->default_string_piece(), output);
  3178. }
  3179. // optional string default_cord = 85 [default = "123", ctype = CORD];
  3180. if (cached_has_bits & 0x00000080u) {
  3181. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3182. this->default_cord().data(), static_cast<int>(this->default_cord().length()),
  3183. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3184. "protobuf_unittest_no_arena.TestAllTypes.default_cord");
  3185. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  3186. 85, this->default_cord(), output);
  3187. }
  3188. switch (oneof_field_case()) {
  3189. case kOneofUint32:
  3190. ::google::protobuf::internal::WireFormatLite::WriteUInt32(111, this->oneof_uint32(), output);
  3191. break;
  3192. case kOneofNestedMessage:
  3193. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  3194. 112, this->_internal_oneof_nested_message(), output);
  3195. break;
  3196. case kOneofString:
  3197. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3198. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  3199. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3200. "protobuf_unittest_no_arena.TestAllTypes.oneof_string");
  3201. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  3202. 113, this->oneof_string(), output);
  3203. break;
  3204. case kOneofBytes:
  3205. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  3206. 114, this->oneof_bytes(), output);
  3207. break;
  3208. case kLazyOneofNestedMessage:
  3209. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  3210. 115, this->_internal_lazy_oneof_nested_message(), output);
  3211. break;
  3212. default: ;
  3213. }
  3214. if (_internal_metadata_.have_unknown_fields()) {
  3215. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  3216. _internal_metadata_.unknown_fields(), output);
  3217. }
  3218. // @@protoc_insertion_point(serialize_end:protobuf_unittest_no_arena.TestAllTypes)
  3219. }
  3220. ::google::protobuf::uint8* TestAllTypes::InternalSerializeWithCachedSizesToArray(
  3221. bool deterministic, ::google::protobuf::uint8* target) const {
  3222. (void)deterministic; // Unused
  3223. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_no_arena.TestAllTypes)
  3224. ::google::protobuf::uint32 cached_has_bits = 0;
  3225. (void) cached_has_bits;
  3226. cached_has_bits = _has_bits_[0];
  3227. // optional int32 optional_int32 = 1;
  3228. if (cached_has_bits & 0x00008000u) {
  3229. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->optional_int32(), target);
  3230. }
  3231. // optional int64 optional_int64 = 2;
  3232. if (cached_has_bits & 0x00004000u) {
  3233. target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->optional_int64(), target);
  3234. }
  3235. // optional uint32 optional_uint32 = 3;
  3236. if (cached_has_bits & 0x00010000u) {
  3237. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->optional_uint32(), target);
  3238. }
  3239. // optional uint64 optional_uint64 = 4;
  3240. if (cached_has_bits & 0x00020000u) {
  3241. target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->optional_uint64(), target);
  3242. }
  3243. // optional sint32 optional_sint32 = 5;
  3244. if (cached_has_bits & 0x00080000u) {
  3245. target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(5, this->optional_sint32(), target);
  3246. }
  3247. // optional sint64 optional_sint64 = 6;
  3248. if (cached_has_bits & 0x00040000u) {
  3249. target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(6, this->optional_sint64(), target);
  3250. }
  3251. // optional fixed32 optional_fixed32 = 7;
  3252. if (cached_has_bits & 0x00100000u) {
  3253. target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(7, this->optional_fixed32(), target);
  3254. }
  3255. // optional fixed64 optional_fixed64 = 8;
  3256. if (cached_has_bits & 0x00200000u) {
  3257. target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(8, this->optional_fixed64(), target);
  3258. }
  3259. // optional sfixed32 optional_sfixed32 = 9;
  3260. if (cached_has_bits & 0x00800000u) {
  3261. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed32ToArray(9, this->optional_sfixed32(), target);
  3262. }
  3263. // optional sfixed64 optional_sfixed64 = 10;
  3264. if (cached_has_bits & 0x00400000u) {
  3265. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed64ToArray(10, this->optional_sfixed64(), target);
  3266. }
  3267. // optional float optional_float = 11;
  3268. if (cached_has_bits & 0x01000000u) {
  3269. target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->optional_float(), target);
  3270. }
  3271. // optional double optional_double = 12;
  3272. if (cached_has_bits & 0x02000000u) {
  3273. target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(12, this->optional_double(), target);
  3274. }
  3275. // optional bool optional_bool = 13;
  3276. if (cached_has_bits & 0x04000000u) {
  3277. target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(13, this->optional_bool(), target);
  3278. }
  3279. // optional string optional_string = 14;
  3280. if (cached_has_bits & 0x00000001u) {
  3281. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3282. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  3283. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3284. "protobuf_unittest_no_arena.TestAllTypes.optional_string");
  3285. target =
  3286. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  3287. 14, this->optional_string(), target);
  3288. }
  3289. // optional bytes optional_bytes = 15;
  3290. if (cached_has_bits & 0x00000002u) {
  3291. target =
  3292. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  3293. 15, this->optional_bytes(), target);
  3294. }
  3295. // optional group OptionalGroup = 16 { ... };
  3296. if (cached_has_bits & 0x00000100u) {
  3297. target = ::google::protobuf::internal::WireFormatLite::
  3298. InternalWriteGroupToArray(
  3299. 16, this->_internal_optionalgroup(), deterministic, target);
  3300. }
  3301. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_nested_message = 18;
  3302. if (cached_has_bits & 0x00000200u) {
  3303. target = ::google::protobuf::internal::WireFormatLite::
  3304. InternalWriteMessageToArray(
  3305. 18, this->_internal_optional_nested_message(), deterministic, target);
  3306. }
  3307. // optional .protobuf_unittest_no_arena.ForeignMessage optional_foreign_message = 19;
  3308. if (cached_has_bits & 0x00000400u) {
  3309. target = ::google::protobuf::internal::WireFormatLite::
  3310. InternalWriteMessageToArray(
  3311. 19, this->_internal_optional_foreign_message(), deterministic, target);
  3312. }
  3313. // optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  3314. if (cached_has_bits & 0x00000800u) {
  3315. target = ::google::protobuf::internal::WireFormatLite::
  3316. InternalWriteMessageToArray(
  3317. 20, this->_internal_optional_import_message(), deterministic, target);
  3318. }
  3319. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum optional_nested_enum = 21;
  3320. if (cached_has_bits & 0x10000000u) {
  3321. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3322. 21, this->optional_nested_enum(), target);
  3323. }
  3324. // optional .protobuf_unittest_no_arena.ForeignEnum optional_foreign_enum = 22;
  3325. if (cached_has_bits & 0x20000000u) {
  3326. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3327. 22, this->optional_foreign_enum(), target);
  3328. }
  3329. // optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
  3330. if (cached_has_bits & 0x40000000u) {
  3331. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3332. 23, this->optional_import_enum(), target);
  3333. }
  3334. // optional string optional_string_piece = 24 [ctype = STRING_PIECE];
  3335. if (cached_has_bits & 0x00000004u) {
  3336. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3337. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  3338. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3339. "protobuf_unittest_no_arena.TestAllTypes.optional_string_piece");
  3340. target =
  3341. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  3342. 24, this->optional_string_piece(), target);
  3343. }
  3344. // optional string optional_cord = 25 [ctype = CORD];
  3345. if (cached_has_bits & 0x00000008u) {
  3346. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3347. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  3348. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3349. "protobuf_unittest_no_arena.TestAllTypes.optional_cord");
  3350. target =
  3351. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  3352. 25, this->optional_cord(), target);
  3353. }
  3354. // optional .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  3355. if (cached_has_bits & 0x00001000u) {
  3356. target = ::google::protobuf::internal::WireFormatLite::
  3357. InternalWriteMessageToArray(
  3358. 26, this->_internal_optional_public_import_message(), deterministic, target);
  3359. }
  3360. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_message = 27 [lazy = true];
  3361. if (cached_has_bits & 0x00002000u) {
  3362. target = ::google::protobuf::internal::WireFormatLite::
  3363. InternalWriteMessageToArray(
  3364. 27, this->_internal_optional_message(), deterministic, target);
  3365. }
  3366. // repeated int32 repeated_int32 = 31;
  3367. target = ::google::protobuf::internal::WireFormatLite::
  3368. WriteInt32ToArray(31, this->repeated_int32_, target);
  3369. // repeated int64 repeated_int64 = 32;
  3370. target = ::google::protobuf::internal::WireFormatLite::
  3371. WriteInt64ToArray(32, this->repeated_int64_, target);
  3372. // repeated uint32 repeated_uint32 = 33;
  3373. target = ::google::protobuf::internal::WireFormatLite::
  3374. WriteUInt32ToArray(33, this->repeated_uint32_, target);
  3375. // repeated uint64 repeated_uint64 = 34;
  3376. target = ::google::protobuf::internal::WireFormatLite::
  3377. WriteUInt64ToArray(34, this->repeated_uint64_, target);
  3378. // repeated sint32 repeated_sint32 = 35;
  3379. target = ::google::protobuf::internal::WireFormatLite::
  3380. WriteSInt32ToArray(35, this->repeated_sint32_, target);
  3381. // repeated sint64 repeated_sint64 = 36;
  3382. target = ::google::protobuf::internal::WireFormatLite::
  3383. WriteSInt64ToArray(36, this->repeated_sint64_, target);
  3384. // repeated fixed32 repeated_fixed32 = 37;
  3385. target = ::google::protobuf::internal::WireFormatLite::
  3386. WriteFixed32ToArray(37, this->repeated_fixed32_, target);
  3387. // repeated fixed64 repeated_fixed64 = 38;
  3388. target = ::google::protobuf::internal::WireFormatLite::
  3389. WriteFixed64ToArray(38, this->repeated_fixed64_, target);
  3390. // repeated sfixed32 repeated_sfixed32 = 39;
  3391. target = ::google::protobuf::internal::WireFormatLite::
  3392. WriteSFixed32ToArray(39, this->repeated_sfixed32_, target);
  3393. // repeated sfixed64 repeated_sfixed64 = 40;
  3394. target = ::google::protobuf::internal::WireFormatLite::
  3395. WriteSFixed64ToArray(40, this->repeated_sfixed64_, target);
  3396. // repeated float repeated_float = 41;
  3397. target = ::google::protobuf::internal::WireFormatLite::
  3398. WriteFloatToArray(41, this->repeated_float_, target);
  3399. // repeated double repeated_double = 42;
  3400. target = ::google::protobuf::internal::WireFormatLite::
  3401. WriteDoubleToArray(42, this->repeated_double_, target);
  3402. // repeated bool repeated_bool = 43;
  3403. target = ::google::protobuf::internal::WireFormatLite::
  3404. WriteBoolToArray(43, this->repeated_bool_, target);
  3405. // repeated string repeated_string = 44;
  3406. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  3407. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3408. this->repeated_string(i).data(), static_cast<int>(this->repeated_string(i).length()),
  3409. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3410. "protobuf_unittest_no_arena.TestAllTypes.repeated_string");
  3411. target = ::google::protobuf::internal::WireFormatLite::
  3412. WriteStringToArray(44, this->repeated_string(i), target);
  3413. }
  3414. // repeated bytes repeated_bytes = 45;
  3415. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  3416. target = ::google::protobuf::internal::WireFormatLite::
  3417. WriteBytesToArray(45, this->repeated_bytes(i), target);
  3418. }
  3419. // repeated group RepeatedGroup = 46 { ... };
  3420. for (unsigned int i = 0,
  3421. n = static_cast<unsigned int>(this->repeatedgroup_size()); i < n; i++) {
  3422. target = ::google::protobuf::internal::WireFormatLite::
  3423. InternalWriteGroupToArray(
  3424. 46, this->repeatedgroup(static_cast<int>(i)), deterministic, target);
  3425. }
  3426. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_nested_message = 48;
  3427. for (unsigned int i = 0,
  3428. n = static_cast<unsigned int>(this->repeated_nested_message_size()); i < n; i++) {
  3429. target = ::google::protobuf::internal::WireFormatLite::
  3430. InternalWriteMessageToArray(
  3431. 48, this->repeated_nested_message(static_cast<int>(i)), deterministic, target);
  3432. }
  3433. // repeated .protobuf_unittest_no_arena.ForeignMessage repeated_foreign_message = 49;
  3434. for (unsigned int i = 0,
  3435. n = static_cast<unsigned int>(this->repeated_foreign_message_size()); i < n; i++) {
  3436. target = ::google::protobuf::internal::WireFormatLite::
  3437. InternalWriteMessageToArray(
  3438. 49, this->repeated_foreign_message(static_cast<int>(i)), deterministic, target);
  3439. }
  3440. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  3441. for (unsigned int i = 0,
  3442. n = static_cast<unsigned int>(this->repeated_import_message_size()); i < n; i++) {
  3443. target = ::google::protobuf::internal::WireFormatLite::
  3444. InternalWriteMessageToArray(
  3445. 50, this->repeated_import_message(static_cast<int>(i)), deterministic, target);
  3446. }
  3447. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  3448. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3449. 51, this->repeated_nested_enum_, target);
  3450. // repeated .protobuf_unittest_no_arena.ForeignEnum repeated_foreign_enum = 52;
  3451. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3452. 52, this->repeated_foreign_enum_, target);
  3453. // repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
  3454. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3455. 53, this->repeated_import_enum_, target);
  3456. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  3457. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  3458. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3459. this->repeated_string_piece(i).data(), static_cast<int>(this->repeated_string_piece(i).length()),
  3460. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3461. "protobuf_unittest_no_arena.TestAllTypes.repeated_string_piece");
  3462. target = ::google::protobuf::internal::WireFormatLite::
  3463. WriteStringToArray(54, this->repeated_string_piece(i), target);
  3464. }
  3465. // repeated string repeated_cord = 55 [ctype = CORD];
  3466. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  3467. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3468. this->repeated_cord(i).data(), static_cast<int>(this->repeated_cord(i).length()),
  3469. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3470. "protobuf_unittest_no_arena.TestAllTypes.repeated_cord");
  3471. target = ::google::protobuf::internal::WireFormatLite::
  3472. WriteStringToArray(55, this->repeated_cord(i), target);
  3473. }
  3474. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  3475. for (unsigned int i = 0,
  3476. n = static_cast<unsigned int>(this->repeated_lazy_message_size()); i < n; i++) {
  3477. target = ::google::protobuf::internal::WireFormatLite::
  3478. InternalWriteMessageToArray(
  3479. 57, this->repeated_lazy_message(static_cast<int>(i)), deterministic, target);
  3480. }
  3481. // optional int32 default_int32 = 61 [default = 41];
  3482. if (cached_has_bits & 0x80000000u) {
  3483. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(61, this->default_int32(), target);
  3484. }
  3485. cached_has_bits = _has_bits_[1];
  3486. // optional int64 default_int64 = 62 [default = 42];
  3487. if (cached_has_bits & 0x00000001u) {
  3488. target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(62, this->default_int64(), target);
  3489. }
  3490. // optional uint32 default_uint32 = 63 [default = 43];
  3491. if (cached_has_bits & 0x00000004u) {
  3492. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(63, this->default_uint32(), target);
  3493. }
  3494. // optional uint64 default_uint64 = 64 [default = 44];
  3495. if (cached_has_bits & 0x00000002u) {
  3496. target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(64, this->default_uint64(), target);
  3497. }
  3498. // optional sint32 default_sint32 = 65 [default = -45];
  3499. if (cached_has_bits & 0x00000008u) {
  3500. target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(65, this->default_sint32(), target);
  3501. }
  3502. // optional sint64 default_sint64 = 66 [default = 46];
  3503. if (cached_has_bits & 0x00000010u) {
  3504. target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(66, this->default_sint64(), target);
  3505. }
  3506. // optional fixed32 default_fixed32 = 67 [default = 47];
  3507. if (cached_has_bits & 0x00000040u) {
  3508. target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(67, this->default_fixed32(), target);
  3509. }
  3510. // optional fixed64 default_fixed64 = 68 [default = 48];
  3511. if (cached_has_bits & 0x00000020u) {
  3512. target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(68, this->default_fixed64(), target);
  3513. }
  3514. // optional sfixed32 default_sfixed32 = 69 [default = 49];
  3515. if (cached_has_bits & 0x00000080u) {
  3516. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed32ToArray(69, this->default_sfixed32(), target);
  3517. }
  3518. // optional sfixed64 default_sfixed64 = 70 [default = -50];
  3519. if (cached_has_bits & 0x00000100u) {
  3520. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed64ToArray(70, this->default_sfixed64(), target);
  3521. }
  3522. // optional float default_float = 71 [default = 51.5];
  3523. if (cached_has_bits & 0x00000400u) {
  3524. target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(71, this->default_float(), target);
  3525. }
  3526. // optional double default_double = 72 [default = 52000];
  3527. if (cached_has_bits & 0x00000200u) {
  3528. target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(72, this->default_double(), target);
  3529. }
  3530. // optional bool default_bool = 73 [default = true];
  3531. if (cached_has_bits & 0x00000800u) {
  3532. target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(73, this->default_bool(), target);
  3533. }
  3534. cached_has_bits = _has_bits_[0];
  3535. // optional string default_string = 74 [default = "hello"];
  3536. if (cached_has_bits & 0x00000010u) {
  3537. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3538. this->default_string().data(), static_cast<int>(this->default_string().length()),
  3539. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3540. "protobuf_unittest_no_arena.TestAllTypes.default_string");
  3541. target =
  3542. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  3543. 74, this->default_string(), target);
  3544. }
  3545. // optional bytes default_bytes = 75 [default = "world"];
  3546. if (cached_has_bits & 0x00000020u) {
  3547. target =
  3548. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  3549. 75, this->default_bytes(), target);
  3550. }
  3551. cached_has_bits = _has_bits_[1];
  3552. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
  3553. if (cached_has_bits & 0x00001000u) {
  3554. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3555. 81, this->default_nested_enum(), target);
  3556. }
  3557. // optional .protobuf_unittest_no_arena.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
  3558. if (cached_has_bits & 0x00002000u) {
  3559. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3560. 82, this->default_foreign_enum(), target);
  3561. }
  3562. cached_has_bits = _has_bits_[0];
  3563. // optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
  3564. if (cached_has_bits & 0x08000000u) {
  3565. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  3566. 83, this->default_import_enum(), target);
  3567. }
  3568. // optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
  3569. if (cached_has_bits & 0x00000040u) {
  3570. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3571. this->default_string_piece().data(), static_cast<int>(this->default_string_piece().length()),
  3572. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3573. "protobuf_unittest_no_arena.TestAllTypes.default_string_piece");
  3574. target =
  3575. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  3576. 84, this->default_string_piece(), target);
  3577. }
  3578. // optional string default_cord = 85 [default = "123", ctype = CORD];
  3579. if (cached_has_bits & 0x00000080u) {
  3580. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3581. this->default_cord().data(), static_cast<int>(this->default_cord().length()),
  3582. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3583. "protobuf_unittest_no_arena.TestAllTypes.default_cord");
  3584. target =
  3585. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  3586. 85, this->default_cord(), target);
  3587. }
  3588. switch (oneof_field_case()) {
  3589. case kOneofUint32:
  3590. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(111, this->oneof_uint32(), target);
  3591. break;
  3592. case kOneofNestedMessage:
  3593. target = ::google::protobuf::internal::WireFormatLite::
  3594. InternalWriteMessageToArray(
  3595. 112, this->_internal_oneof_nested_message(), deterministic, target);
  3596. break;
  3597. case kOneofString:
  3598. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  3599. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  3600. ::google::protobuf::internal::WireFormat::SERIALIZE,
  3601. "protobuf_unittest_no_arena.TestAllTypes.oneof_string");
  3602. target =
  3603. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  3604. 113, this->oneof_string(), target);
  3605. break;
  3606. case kOneofBytes:
  3607. target =
  3608. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  3609. 114, this->oneof_bytes(), target);
  3610. break;
  3611. case kLazyOneofNestedMessage:
  3612. target = ::google::protobuf::internal::WireFormatLite::
  3613. InternalWriteMessageToArray(
  3614. 115, this->_internal_lazy_oneof_nested_message(), deterministic, target);
  3615. break;
  3616. default: ;
  3617. }
  3618. if (_internal_metadata_.have_unknown_fields()) {
  3619. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  3620. _internal_metadata_.unknown_fields(), target);
  3621. }
  3622. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_no_arena.TestAllTypes)
  3623. return target;
  3624. }
  3625. size_t TestAllTypes::ByteSizeLong() const {
  3626. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_no_arena.TestAllTypes)
  3627. size_t total_size = 0;
  3628. if (_internal_metadata_.have_unknown_fields()) {
  3629. total_size +=
  3630. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  3631. _internal_metadata_.unknown_fields());
  3632. }
  3633. // repeated int32 repeated_int32 = 31;
  3634. {
  3635. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  3636. Int32Size(this->repeated_int32_);
  3637. total_size += 2 *
  3638. ::google::protobuf::internal::FromIntSize(this->repeated_int32_size());
  3639. total_size += data_size;
  3640. }
  3641. // repeated int64 repeated_int64 = 32;
  3642. {
  3643. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  3644. Int64Size(this->repeated_int64_);
  3645. total_size += 2 *
  3646. ::google::protobuf::internal::FromIntSize(this->repeated_int64_size());
  3647. total_size += data_size;
  3648. }
  3649. // repeated uint32 repeated_uint32 = 33;
  3650. {
  3651. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  3652. UInt32Size(this->repeated_uint32_);
  3653. total_size += 2 *
  3654. ::google::protobuf::internal::FromIntSize(this->repeated_uint32_size());
  3655. total_size += data_size;
  3656. }
  3657. // repeated uint64 repeated_uint64 = 34;
  3658. {
  3659. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  3660. UInt64Size(this->repeated_uint64_);
  3661. total_size += 2 *
  3662. ::google::protobuf::internal::FromIntSize(this->repeated_uint64_size());
  3663. total_size += data_size;
  3664. }
  3665. // repeated sint32 repeated_sint32 = 35;
  3666. {
  3667. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  3668. SInt32Size(this->repeated_sint32_);
  3669. total_size += 2 *
  3670. ::google::protobuf::internal::FromIntSize(this->repeated_sint32_size());
  3671. total_size += data_size;
  3672. }
  3673. // repeated sint64 repeated_sint64 = 36;
  3674. {
  3675. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  3676. SInt64Size(this->repeated_sint64_);
  3677. total_size += 2 *
  3678. ::google::protobuf::internal::FromIntSize(this->repeated_sint64_size());
  3679. total_size += data_size;
  3680. }
  3681. // repeated fixed32 repeated_fixed32 = 37;
  3682. {
  3683. unsigned int count = static_cast<unsigned int>(this->repeated_fixed32_size());
  3684. size_t data_size = 4UL * count;
  3685. total_size += 2 *
  3686. ::google::protobuf::internal::FromIntSize(this->repeated_fixed32_size());
  3687. total_size += data_size;
  3688. }
  3689. // repeated fixed64 repeated_fixed64 = 38;
  3690. {
  3691. unsigned int count = static_cast<unsigned int>(this->repeated_fixed64_size());
  3692. size_t data_size = 8UL * count;
  3693. total_size += 2 *
  3694. ::google::protobuf::internal::FromIntSize(this->repeated_fixed64_size());
  3695. total_size += data_size;
  3696. }
  3697. // repeated sfixed32 repeated_sfixed32 = 39;
  3698. {
  3699. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed32_size());
  3700. size_t data_size = 4UL * count;
  3701. total_size += 2 *
  3702. ::google::protobuf::internal::FromIntSize(this->repeated_sfixed32_size());
  3703. total_size += data_size;
  3704. }
  3705. // repeated sfixed64 repeated_sfixed64 = 40;
  3706. {
  3707. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed64_size());
  3708. size_t data_size = 8UL * count;
  3709. total_size += 2 *
  3710. ::google::protobuf::internal::FromIntSize(this->repeated_sfixed64_size());
  3711. total_size += data_size;
  3712. }
  3713. // repeated float repeated_float = 41;
  3714. {
  3715. unsigned int count = static_cast<unsigned int>(this->repeated_float_size());
  3716. size_t data_size = 4UL * count;
  3717. total_size += 2 *
  3718. ::google::protobuf::internal::FromIntSize(this->repeated_float_size());
  3719. total_size += data_size;
  3720. }
  3721. // repeated double repeated_double = 42;
  3722. {
  3723. unsigned int count = static_cast<unsigned int>(this->repeated_double_size());
  3724. size_t data_size = 8UL * count;
  3725. total_size += 2 *
  3726. ::google::protobuf::internal::FromIntSize(this->repeated_double_size());
  3727. total_size += data_size;
  3728. }
  3729. // repeated bool repeated_bool = 43;
  3730. {
  3731. unsigned int count = static_cast<unsigned int>(this->repeated_bool_size());
  3732. size_t data_size = 1UL * count;
  3733. total_size += 2 *
  3734. ::google::protobuf::internal::FromIntSize(this->repeated_bool_size());
  3735. total_size += data_size;
  3736. }
  3737. // repeated string repeated_string = 44;
  3738. total_size += 2 *
  3739. ::google::protobuf::internal::FromIntSize(this->repeated_string_size());
  3740. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  3741. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  3742. this->repeated_string(i));
  3743. }
  3744. // repeated bytes repeated_bytes = 45;
  3745. total_size += 2 *
  3746. ::google::protobuf::internal::FromIntSize(this->repeated_bytes_size());
  3747. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  3748. total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
  3749. this->repeated_bytes(i));
  3750. }
  3751. // repeated group RepeatedGroup = 46 { ... };
  3752. {
  3753. unsigned int count = static_cast<unsigned int>(this->repeatedgroup_size());
  3754. total_size += 4UL * count;
  3755. for (unsigned int i = 0; i < count; i++) {
  3756. total_size +=
  3757. ::google::protobuf::internal::WireFormatLite::GroupSize(
  3758. this->repeatedgroup(static_cast<int>(i)));
  3759. }
  3760. }
  3761. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_nested_message = 48;
  3762. {
  3763. unsigned int count = static_cast<unsigned int>(this->repeated_nested_message_size());
  3764. total_size += 2UL * count;
  3765. for (unsigned int i = 0; i < count; i++) {
  3766. total_size +=
  3767. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3768. this->repeated_nested_message(static_cast<int>(i)));
  3769. }
  3770. }
  3771. // repeated .protobuf_unittest_no_arena.ForeignMessage repeated_foreign_message = 49;
  3772. {
  3773. unsigned int count = static_cast<unsigned int>(this->repeated_foreign_message_size());
  3774. total_size += 2UL * count;
  3775. for (unsigned int i = 0; i < count; i++) {
  3776. total_size +=
  3777. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3778. this->repeated_foreign_message(static_cast<int>(i)));
  3779. }
  3780. }
  3781. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  3782. {
  3783. unsigned int count = static_cast<unsigned int>(this->repeated_import_message_size());
  3784. total_size += 2UL * count;
  3785. for (unsigned int i = 0; i < count; i++) {
  3786. total_size +=
  3787. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3788. this->repeated_import_message(static_cast<int>(i)));
  3789. }
  3790. }
  3791. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  3792. {
  3793. size_t data_size = 0;
  3794. unsigned int count = static_cast<unsigned int>(this->repeated_nested_enum_size());for (unsigned int i = 0; i < count; i++) {
  3795. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  3796. this->repeated_nested_enum(static_cast<int>(i)));
  3797. }
  3798. total_size += (2UL * count) + data_size;
  3799. }
  3800. // repeated .protobuf_unittest_no_arena.ForeignEnum repeated_foreign_enum = 52;
  3801. {
  3802. size_t data_size = 0;
  3803. unsigned int count = static_cast<unsigned int>(this->repeated_foreign_enum_size());for (unsigned int i = 0; i < count; i++) {
  3804. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  3805. this->repeated_foreign_enum(static_cast<int>(i)));
  3806. }
  3807. total_size += (2UL * count) + data_size;
  3808. }
  3809. // repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
  3810. {
  3811. size_t data_size = 0;
  3812. unsigned int count = static_cast<unsigned int>(this->repeated_import_enum_size());for (unsigned int i = 0; i < count; i++) {
  3813. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  3814. this->repeated_import_enum(static_cast<int>(i)));
  3815. }
  3816. total_size += (2UL * count) + data_size;
  3817. }
  3818. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  3819. total_size += 2 *
  3820. ::google::protobuf::internal::FromIntSize(this->repeated_string_piece_size());
  3821. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  3822. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  3823. this->repeated_string_piece(i));
  3824. }
  3825. // repeated string repeated_cord = 55 [ctype = CORD];
  3826. total_size += 2 *
  3827. ::google::protobuf::internal::FromIntSize(this->repeated_cord_size());
  3828. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  3829. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  3830. this->repeated_cord(i));
  3831. }
  3832. // repeated .protobuf_unittest_no_arena.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  3833. {
  3834. unsigned int count = static_cast<unsigned int>(this->repeated_lazy_message_size());
  3835. total_size += 2UL * count;
  3836. for (unsigned int i = 0; i < count; i++) {
  3837. total_size +=
  3838. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3839. this->repeated_lazy_message(static_cast<int>(i)));
  3840. }
  3841. }
  3842. if (_has_bits_[0 / 32] & 255u) {
  3843. // optional string optional_string = 14;
  3844. if (has_optional_string()) {
  3845. total_size += 1 +
  3846. ::google::protobuf::internal::WireFormatLite::StringSize(
  3847. this->optional_string());
  3848. }
  3849. // optional bytes optional_bytes = 15;
  3850. if (has_optional_bytes()) {
  3851. total_size += 1 +
  3852. ::google::protobuf::internal::WireFormatLite::BytesSize(
  3853. this->optional_bytes());
  3854. }
  3855. // optional string optional_string_piece = 24 [ctype = STRING_PIECE];
  3856. if (has_optional_string_piece()) {
  3857. total_size += 2 +
  3858. ::google::protobuf::internal::WireFormatLite::StringSize(
  3859. this->optional_string_piece());
  3860. }
  3861. // optional string optional_cord = 25 [ctype = CORD];
  3862. if (has_optional_cord()) {
  3863. total_size += 2 +
  3864. ::google::protobuf::internal::WireFormatLite::StringSize(
  3865. this->optional_cord());
  3866. }
  3867. // optional string default_string = 74 [default = "hello"];
  3868. if (has_default_string()) {
  3869. total_size += 2 +
  3870. ::google::protobuf::internal::WireFormatLite::StringSize(
  3871. this->default_string());
  3872. }
  3873. // optional bytes default_bytes = 75 [default = "world"];
  3874. if (has_default_bytes()) {
  3875. total_size += 2 +
  3876. ::google::protobuf::internal::WireFormatLite::BytesSize(
  3877. this->default_bytes());
  3878. }
  3879. // optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
  3880. if (has_default_string_piece()) {
  3881. total_size += 2 +
  3882. ::google::protobuf::internal::WireFormatLite::StringSize(
  3883. this->default_string_piece());
  3884. }
  3885. // optional string default_cord = 85 [default = "123", ctype = CORD];
  3886. if (has_default_cord()) {
  3887. total_size += 2 +
  3888. ::google::protobuf::internal::WireFormatLite::StringSize(
  3889. this->default_cord());
  3890. }
  3891. }
  3892. if (_has_bits_[8 / 32] & 65280u) {
  3893. // optional group OptionalGroup = 16 { ... };
  3894. if (has_optionalgroup()) {
  3895. total_size += 4 +
  3896. ::google::protobuf::internal::WireFormatLite::GroupSize(
  3897. *optionalgroup_);
  3898. }
  3899. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_nested_message = 18;
  3900. if (has_optional_nested_message()) {
  3901. total_size += 2 +
  3902. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3903. *optional_nested_message_);
  3904. }
  3905. // optional .protobuf_unittest_no_arena.ForeignMessage optional_foreign_message = 19;
  3906. if (has_optional_foreign_message()) {
  3907. total_size += 2 +
  3908. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3909. *optional_foreign_message_);
  3910. }
  3911. // optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  3912. if (has_optional_import_message()) {
  3913. total_size += 2 +
  3914. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3915. *optional_import_message_);
  3916. }
  3917. // optional .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  3918. if (has_optional_public_import_message()) {
  3919. total_size += 2 +
  3920. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3921. *optional_public_import_message_);
  3922. }
  3923. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage optional_message = 27 [lazy = true];
  3924. if (has_optional_message()) {
  3925. total_size += 2 +
  3926. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3927. *optional_message_);
  3928. }
  3929. // optional int64 optional_int64 = 2;
  3930. if (has_optional_int64()) {
  3931. total_size += 1 +
  3932. ::google::protobuf::internal::WireFormatLite::Int64Size(
  3933. this->optional_int64());
  3934. }
  3935. // optional int32 optional_int32 = 1;
  3936. if (has_optional_int32()) {
  3937. total_size += 1 +
  3938. ::google::protobuf::internal::WireFormatLite::Int32Size(
  3939. this->optional_int32());
  3940. }
  3941. }
  3942. if (_has_bits_[16 / 32] & 16711680u) {
  3943. // optional uint32 optional_uint32 = 3;
  3944. if (has_optional_uint32()) {
  3945. total_size += 1 +
  3946. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  3947. this->optional_uint32());
  3948. }
  3949. // optional uint64 optional_uint64 = 4;
  3950. if (has_optional_uint64()) {
  3951. total_size += 1 +
  3952. ::google::protobuf::internal::WireFormatLite::UInt64Size(
  3953. this->optional_uint64());
  3954. }
  3955. // optional sint64 optional_sint64 = 6;
  3956. if (has_optional_sint64()) {
  3957. total_size += 1 +
  3958. ::google::protobuf::internal::WireFormatLite::SInt64Size(
  3959. this->optional_sint64());
  3960. }
  3961. // optional sint32 optional_sint32 = 5;
  3962. if (has_optional_sint32()) {
  3963. total_size += 1 +
  3964. ::google::protobuf::internal::WireFormatLite::SInt32Size(
  3965. this->optional_sint32());
  3966. }
  3967. // optional fixed32 optional_fixed32 = 7;
  3968. if (has_optional_fixed32()) {
  3969. total_size += 1 + 4;
  3970. }
  3971. // optional fixed64 optional_fixed64 = 8;
  3972. if (has_optional_fixed64()) {
  3973. total_size += 1 + 8;
  3974. }
  3975. // optional sfixed64 optional_sfixed64 = 10;
  3976. if (has_optional_sfixed64()) {
  3977. total_size += 1 + 8;
  3978. }
  3979. // optional sfixed32 optional_sfixed32 = 9;
  3980. if (has_optional_sfixed32()) {
  3981. total_size += 1 + 4;
  3982. }
  3983. }
  3984. if (_has_bits_[24 / 32] & 4278190080u) {
  3985. // optional float optional_float = 11;
  3986. if (has_optional_float()) {
  3987. total_size += 1 + 4;
  3988. }
  3989. // optional double optional_double = 12;
  3990. if (has_optional_double()) {
  3991. total_size += 1 + 8;
  3992. }
  3993. // optional bool optional_bool = 13;
  3994. if (has_optional_bool()) {
  3995. total_size += 1 + 1;
  3996. }
  3997. // optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
  3998. if (has_default_import_enum()) {
  3999. total_size += 2 +
  4000. ::google::protobuf::internal::WireFormatLite::EnumSize(this->default_import_enum());
  4001. }
  4002. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum optional_nested_enum = 21;
  4003. if (has_optional_nested_enum()) {
  4004. total_size += 2 +
  4005. ::google::protobuf::internal::WireFormatLite::EnumSize(this->optional_nested_enum());
  4006. }
  4007. // optional .protobuf_unittest_no_arena.ForeignEnum optional_foreign_enum = 22;
  4008. if (has_optional_foreign_enum()) {
  4009. total_size += 2 +
  4010. ::google::protobuf::internal::WireFormatLite::EnumSize(this->optional_foreign_enum());
  4011. }
  4012. // optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
  4013. if (has_optional_import_enum()) {
  4014. total_size += 2 +
  4015. ::google::protobuf::internal::WireFormatLite::EnumSize(this->optional_import_enum());
  4016. }
  4017. // optional int32 default_int32 = 61 [default = 41];
  4018. if (has_default_int32()) {
  4019. total_size += 2 +
  4020. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4021. this->default_int32());
  4022. }
  4023. }
  4024. if (_has_bits_[32 / 32] & 255u) {
  4025. // optional int64 default_int64 = 62 [default = 42];
  4026. if (has_default_int64()) {
  4027. total_size += 2 +
  4028. ::google::protobuf::internal::WireFormatLite::Int64Size(
  4029. this->default_int64());
  4030. }
  4031. // optional uint64 default_uint64 = 64 [default = 44];
  4032. if (has_default_uint64()) {
  4033. total_size += 2 +
  4034. ::google::protobuf::internal::WireFormatLite::UInt64Size(
  4035. this->default_uint64());
  4036. }
  4037. // optional uint32 default_uint32 = 63 [default = 43];
  4038. if (has_default_uint32()) {
  4039. total_size += 2 +
  4040. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  4041. this->default_uint32());
  4042. }
  4043. // optional sint32 default_sint32 = 65 [default = -45];
  4044. if (has_default_sint32()) {
  4045. total_size += 2 +
  4046. ::google::protobuf::internal::WireFormatLite::SInt32Size(
  4047. this->default_sint32());
  4048. }
  4049. // optional sint64 default_sint64 = 66 [default = 46];
  4050. if (has_default_sint64()) {
  4051. total_size += 2 +
  4052. ::google::protobuf::internal::WireFormatLite::SInt64Size(
  4053. this->default_sint64());
  4054. }
  4055. // optional fixed64 default_fixed64 = 68 [default = 48];
  4056. if (has_default_fixed64()) {
  4057. total_size += 2 + 8;
  4058. }
  4059. // optional fixed32 default_fixed32 = 67 [default = 47];
  4060. if (has_default_fixed32()) {
  4061. total_size += 2 + 4;
  4062. }
  4063. // optional sfixed32 default_sfixed32 = 69 [default = 49];
  4064. if (has_default_sfixed32()) {
  4065. total_size += 2 + 4;
  4066. }
  4067. }
  4068. if (_has_bits_[40 / 32] & 16128u) {
  4069. // optional sfixed64 default_sfixed64 = 70 [default = -50];
  4070. if (has_default_sfixed64()) {
  4071. total_size += 2 + 8;
  4072. }
  4073. // optional double default_double = 72 [default = 52000];
  4074. if (has_default_double()) {
  4075. total_size += 2 + 8;
  4076. }
  4077. // optional float default_float = 71 [default = 51.5];
  4078. if (has_default_float()) {
  4079. total_size += 2 + 4;
  4080. }
  4081. // optional bool default_bool = 73 [default = true];
  4082. if (has_default_bool()) {
  4083. total_size += 2 + 1;
  4084. }
  4085. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
  4086. if (has_default_nested_enum()) {
  4087. total_size += 2 +
  4088. ::google::protobuf::internal::WireFormatLite::EnumSize(this->default_nested_enum());
  4089. }
  4090. // optional .protobuf_unittest_no_arena.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
  4091. if (has_default_foreign_enum()) {
  4092. total_size += 2 +
  4093. ::google::protobuf::internal::WireFormatLite::EnumSize(this->default_foreign_enum());
  4094. }
  4095. }
  4096. switch (oneof_field_case()) {
  4097. // optional uint32 oneof_uint32 = 111;
  4098. case kOneofUint32: {
  4099. total_size += 2 +
  4100. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  4101. this->oneof_uint32());
  4102. break;
  4103. }
  4104. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage oneof_nested_message = 112;
  4105. case kOneofNestedMessage: {
  4106. total_size += 2 +
  4107. ::google::protobuf::internal::WireFormatLite::MessageSize(
  4108. *oneof_field_.oneof_nested_message_);
  4109. break;
  4110. }
  4111. // optional string oneof_string = 113;
  4112. case kOneofString: {
  4113. total_size += 2 +
  4114. ::google::protobuf::internal::WireFormatLite::StringSize(
  4115. this->oneof_string());
  4116. break;
  4117. }
  4118. // optional bytes oneof_bytes = 114;
  4119. case kOneofBytes: {
  4120. total_size += 2 +
  4121. ::google::protobuf::internal::WireFormatLite::BytesSize(
  4122. this->oneof_bytes());
  4123. break;
  4124. }
  4125. // optional .protobuf_unittest_no_arena.TestAllTypes.NestedMessage lazy_oneof_nested_message = 115 [lazy = true];
  4126. case kLazyOneofNestedMessage: {
  4127. total_size += 2 +
  4128. ::google::protobuf::internal::WireFormatLite::MessageSize(
  4129. *oneof_field_.lazy_oneof_nested_message_);
  4130. break;
  4131. }
  4132. case ONEOF_FIELD_NOT_SET: {
  4133. break;
  4134. }
  4135. }
  4136. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  4137. SetCachedSize(cached_size);
  4138. return total_size;
  4139. }
  4140. void TestAllTypes::MergeFrom(const ::google::protobuf::Message& from) {
  4141. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_no_arena.TestAllTypes)
  4142. GOOGLE_DCHECK_NE(&from, this);
  4143. const TestAllTypes* source =
  4144. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes>(
  4145. &from);
  4146. if (source == NULL) {
  4147. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_no_arena.TestAllTypes)
  4148. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  4149. } else {
  4150. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_no_arena.TestAllTypes)
  4151. MergeFrom(*source);
  4152. }
  4153. }
  4154. void TestAllTypes::MergeFrom(const TestAllTypes& from) {
  4155. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_no_arena.TestAllTypes)
  4156. GOOGLE_DCHECK_NE(&from, this);
  4157. _internal_metadata_.MergeFrom(from._internal_metadata_);
  4158. ::google::protobuf::uint32 cached_has_bits = 0;
  4159. (void) cached_has_bits;
  4160. repeated_int32_.MergeFrom(from.repeated_int32_);
  4161. repeated_int64_.MergeFrom(from.repeated_int64_);
  4162. repeated_uint32_.MergeFrom(from.repeated_uint32_);
  4163. repeated_uint64_.MergeFrom(from.repeated_uint64_);
  4164. repeated_sint32_.MergeFrom(from.repeated_sint32_);
  4165. repeated_sint64_.MergeFrom(from.repeated_sint64_);
  4166. repeated_fixed32_.MergeFrom(from.repeated_fixed32_);
  4167. repeated_fixed64_.MergeFrom(from.repeated_fixed64_);
  4168. repeated_sfixed32_.MergeFrom(from.repeated_sfixed32_);
  4169. repeated_sfixed64_.MergeFrom(from.repeated_sfixed64_);
  4170. repeated_float_.MergeFrom(from.repeated_float_);
  4171. repeated_double_.MergeFrom(from.repeated_double_);
  4172. repeated_bool_.MergeFrom(from.repeated_bool_);
  4173. repeated_string_.MergeFrom(from.repeated_string_);
  4174. repeated_bytes_.MergeFrom(from.repeated_bytes_);
  4175. repeatedgroup_.MergeFrom(from.repeatedgroup_);
  4176. repeated_nested_message_.MergeFrom(from.repeated_nested_message_);
  4177. repeated_foreign_message_.MergeFrom(from.repeated_foreign_message_);
  4178. repeated_import_message_.MergeFrom(from.repeated_import_message_);
  4179. repeated_nested_enum_.MergeFrom(from.repeated_nested_enum_);
  4180. repeated_foreign_enum_.MergeFrom(from.repeated_foreign_enum_);
  4181. repeated_import_enum_.MergeFrom(from.repeated_import_enum_);
  4182. repeated_string_piece_.MergeFrom(from.repeated_string_piece_);
  4183. repeated_cord_.MergeFrom(from.repeated_cord_);
  4184. repeated_lazy_message_.MergeFrom(from.repeated_lazy_message_);
  4185. cached_has_bits = from._has_bits_[0];
  4186. if (cached_has_bits & 255u) {
  4187. if (cached_has_bits & 0x00000001u) {
  4188. set_has_optional_string();
  4189. optional_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_);
  4190. }
  4191. if (cached_has_bits & 0x00000002u) {
  4192. set_has_optional_bytes();
  4193. optional_bytes_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_bytes_);
  4194. }
  4195. if (cached_has_bits & 0x00000004u) {
  4196. set_has_optional_string_piece();
  4197. optional_string_piece_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_piece_);
  4198. }
  4199. if (cached_has_bits & 0x00000008u) {
  4200. set_has_optional_cord();
  4201. optional_cord_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_cord_);
  4202. }
  4203. if (cached_has_bits & 0x00000010u) {
  4204. set_has_default_string();
  4205. default_string_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get(), from.default_string_);
  4206. }
  4207. if (cached_has_bits & 0x00000020u) {
  4208. set_has_default_bytes();
  4209. default_bytes_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get(), from.default_bytes_);
  4210. }
  4211. if (cached_has_bits & 0x00000040u) {
  4212. set_has_default_string_piece();
  4213. default_string_piece_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get(), from.default_string_piece_);
  4214. }
  4215. if (cached_has_bits & 0x00000080u) {
  4216. set_has_default_cord();
  4217. default_cord_.AssignWithDefault(&::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get(), from.default_cord_);
  4218. }
  4219. }
  4220. if (cached_has_bits & 65280u) {
  4221. if (cached_has_bits & 0x00000100u) {
  4222. mutable_optionalgroup()->::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup::MergeFrom(from.optionalgroup());
  4223. }
  4224. if (cached_has_bits & 0x00000200u) {
  4225. mutable_optional_nested_message()->::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::MergeFrom(from.optional_nested_message());
  4226. }
  4227. if (cached_has_bits & 0x00000400u) {
  4228. mutable_optional_foreign_message()->::protobuf_unittest_no_arena::ForeignMessage::MergeFrom(from.optional_foreign_message());
  4229. }
  4230. if (cached_has_bits & 0x00000800u) {
  4231. mutable_optional_import_message()->::protobuf_unittest_import::ImportMessage::MergeFrom(from.optional_import_message());
  4232. }
  4233. if (cached_has_bits & 0x00001000u) {
  4234. mutable_optional_public_import_message()->::protobuf_unittest_import::PublicImportMessage::MergeFrom(from.optional_public_import_message());
  4235. }
  4236. if (cached_has_bits & 0x00002000u) {
  4237. mutable_optional_message()->::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::MergeFrom(from.optional_message());
  4238. }
  4239. if (cached_has_bits & 0x00004000u) {
  4240. optional_int64_ = from.optional_int64_;
  4241. }
  4242. if (cached_has_bits & 0x00008000u) {
  4243. optional_int32_ = from.optional_int32_;
  4244. }
  4245. _has_bits_[0] |= cached_has_bits;
  4246. }
  4247. if (cached_has_bits & 16711680u) {
  4248. if (cached_has_bits & 0x00010000u) {
  4249. optional_uint32_ = from.optional_uint32_;
  4250. }
  4251. if (cached_has_bits & 0x00020000u) {
  4252. optional_uint64_ = from.optional_uint64_;
  4253. }
  4254. if (cached_has_bits & 0x00040000u) {
  4255. optional_sint64_ = from.optional_sint64_;
  4256. }
  4257. if (cached_has_bits & 0x00080000u) {
  4258. optional_sint32_ = from.optional_sint32_;
  4259. }
  4260. if (cached_has_bits & 0x00100000u) {
  4261. optional_fixed32_ = from.optional_fixed32_;
  4262. }
  4263. if (cached_has_bits & 0x00200000u) {
  4264. optional_fixed64_ = from.optional_fixed64_;
  4265. }
  4266. if (cached_has_bits & 0x00400000u) {
  4267. optional_sfixed64_ = from.optional_sfixed64_;
  4268. }
  4269. if (cached_has_bits & 0x00800000u) {
  4270. optional_sfixed32_ = from.optional_sfixed32_;
  4271. }
  4272. _has_bits_[0] |= cached_has_bits;
  4273. }
  4274. if (cached_has_bits & 4278190080u) {
  4275. if (cached_has_bits & 0x01000000u) {
  4276. optional_float_ = from.optional_float_;
  4277. }
  4278. if (cached_has_bits & 0x02000000u) {
  4279. optional_double_ = from.optional_double_;
  4280. }
  4281. if (cached_has_bits & 0x04000000u) {
  4282. optional_bool_ = from.optional_bool_;
  4283. }
  4284. if (cached_has_bits & 0x08000000u) {
  4285. default_import_enum_ = from.default_import_enum_;
  4286. }
  4287. if (cached_has_bits & 0x10000000u) {
  4288. optional_nested_enum_ = from.optional_nested_enum_;
  4289. }
  4290. if (cached_has_bits & 0x20000000u) {
  4291. optional_foreign_enum_ = from.optional_foreign_enum_;
  4292. }
  4293. if (cached_has_bits & 0x40000000u) {
  4294. optional_import_enum_ = from.optional_import_enum_;
  4295. }
  4296. if (cached_has_bits & 0x80000000u) {
  4297. default_int32_ = from.default_int32_;
  4298. }
  4299. _has_bits_[0] |= cached_has_bits;
  4300. }
  4301. cached_has_bits = from._has_bits_[1];
  4302. if (cached_has_bits & 255u) {
  4303. if (cached_has_bits & 0x00000001u) {
  4304. default_int64_ = from.default_int64_;
  4305. }
  4306. if (cached_has_bits & 0x00000002u) {
  4307. default_uint64_ = from.default_uint64_;
  4308. }
  4309. if (cached_has_bits & 0x00000004u) {
  4310. default_uint32_ = from.default_uint32_;
  4311. }
  4312. if (cached_has_bits & 0x00000008u) {
  4313. default_sint32_ = from.default_sint32_;
  4314. }
  4315. if (cached_has_bits & 0x00000010u) {
  4316. default_sint64_ = from.default_sint64_;
  4317. }
  4318. if (cached_has_bits & 0x00000020u) {
  4319. default_fixed64_ = from.default_fixed64_;
  4320. }
  4321. if (cached_has_bits & 0x00000040u) {
  4322. default_fixed32_ = from.default_fixed32_;
  4323. }
  4324. if (cached_has_bits & 0x00000080u) {
  4325. default_sfixed32_ = from.default_sfixed32_;
  4326. }
  4327. _has_bits_[1] |= cached_has_bits;
  4328. }
  4329. if (cached_has_bits & 16128u) {
  4330. if (cached_has_bits & 0x00000100u) {
  4331. default_sfixed64_ = from.default_sfixed64_;
  4332. }
  4333. if (cached_has_bits & 0x00000200u) {
  4334. default_double_ = from.default_double_;
  4335. }
  4336. if (cached_has_bits & 0x00000400u) {
  4337. default_float_ = from.default_float_;
  4338. }
  4339. if (cached_has_bits & 0x00000800u) {
  4340. default_bool_ = from.default_bool_;
  4341. }
  4342. if (cached_has_bits & 0x00001000u) {
  4343. default_nested_enum_ = from.default_nested_enum_;
  4344. }
  4345. if (cached_has_bits & 0x00002000u) {
  4346. default_foreign_enum_ = from.default_foreign_enum_;
  4347. }
  4348. _has_bits_[1] |= cached_has_bits;
  4349. }
  4350. switch (from.oneof_field_case()) {
  4351. case kOneofUint32: {
  4352. set_oneof_uint32(from.oneof_uint32());
  4353. break;
  4354. }
  4355. case kOneofNestedMessage: {
  4356. mutable_oneof_nested_message()->::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::MergeFrom(from.oneof_nested_message());
  4357. break;
  4358. }
  4359. case kOneofString: {
  4360. set_oneof_string(from.oneof_string());
  4361. break;
  4362. }
  4363. case kOneofBytes: {
  4364. set_oneof_bytes(from.oneof_bytes());
  4365. break;
  4366. }
  4367. case kLazyOneofNestedMessage: {
  4368. mutable_lazy_oneof_nested_message()->::protobuf_unittest_no_arena::TestAllTypes_NestedMessage::MergeFrom(from.lazy_oneof_nested_message());
  4369. break;
  4370. }
  4371. case ONEOF_FIELD_NOT_SET: {
  4372. break;
  4373. }
  4374. }
  4375. }
  4376. void TestAllTypes::CopyFrom(const ::google::protobuf::Message& from) {
  4377. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_no_arena.TestAllTypes)
  4378. if (&from == this) return;
  4379. Clear();
  4380. MergeFrom(from);
  4381. }
  4382. void TestAllTypes::CopyFrom(const TestAllTypes& from) {
  4383. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_no_arena.TestAllTypes)
  4384. if (&from == this) return;
  4385. Clear();
  4386. MergeFrom(from);
  4387. }
  4388. bool TestAllTypes::IsInitialized() const {
  4389. return true;
  4390. }
  4391. void TestAllTypes::Swap(TestAllTypes* other) {
  4392. if (other == this) return;
  4393. InternalSwap(other);
  4394. }
  4395. void TestAllTypes::InternalSwap(TestAllTypes* other) {
  4396. using std::swap;
  4397. repeated_int32_.InternalSwap(&other->repeated_int32_);
  4398. repeated_int64_.InternalSwap(&other->repeated_int64_);
  4399. repeated_uint32_.InternalSwap(&other->repeated_uint32_);
  4400. repeated_uint64_.InternalSwap(&other->repeated_uint64_);
  4401. repeated_sint32_.InternalSwap(&other->repeated_sint32_);
  4402. repeated_sint64_.InternalSwap(&other->repeated_sint64_);
  4403. repeated_fixed32_.InternalSwap(&other->repeated_fixed32_);
  4404. repeated_fixed64_.InternalSwap(&other->repeated_fixed64_);
  4405. repeated_sfixed32_.InternalSwap(&other->repeated_sfixed32_);
  4406. repeated_sfixed64_.InternalSwap(&other->repeated_sfixed64_);
  4407. repeated_float_.InternalSwap(&other->repeated_float_);
  4408. repeated_double_.InternalSwap(&other->repeated_double_);
  4409. repeated_bool_.InternalSwap(&other->repeated_bool_);
  4410. repeated_string_.InternalSwap(CastToBase(&other->repeated_string_));
  4411. repeated_bytes_.InternalSwap(CastToBase(&other->repeated_bytes_));
  4412. CastToBase(&repeatedgroup_)->InternalSwap(CastToBase(&other->repeatedgroup_));
  4413. CastToBase(&repeated_nested_message_)->InternalSwap(CastToBase(&other->repeated_nested_message_));
  4414. CastToBase(&repeated_foreign_message_)->InternalSwap(CastToBase(&other->repeated_foreign_message_));
  4415. CastToBase(&repeated_import_message_)->InternalSwap(CastToBase(&other->repeated_import_message_));
  4416. repeated_nested_enum_.InternalSwap(&other->repeated_nested_enum_);
  4417. repeated_foreign_enum_.InternalSwap(&other->repeated_foreign_enum_);
  4418. repeated_import_enum_.InternalSwap(&other->repeated_import_enum_);
  4419. repeated_string_piece_.InternalSwap(CastToBase(&other->repeated_string_piece_));
  4420. repeated_cord_.InternalSwap(CastToBase(&other->repeated_cord_));
  4421. CastToBase(&repeated_lazy_message_)->InternalSwap(CastToBase(&other->repeated_lazy_message_));
  4422. optional_string_.Swap(&other->optional_string_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  4423. GetArenaNoVirtual());
  4424. optional_bytes_.Swap(&other->optional_bytes_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  4425. GetArenaNoVirtual());
  4426. optional_string_piece_.Swap(&other->optional_string_piece_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  4427. GetArenaNoVirtual());
  4428. optional_cord_.Swap(&other->optional_cord_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  4429. GetArenaNoVirtual());
  4430. default_string_.Swap(&other->default_string_, &::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_.get(),
  4431. GetArenaNoVirtual());
  4432. default_bytes_.Swap(&other->default_bytes_, &::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_bytes_.get(),
  4433. GetArenaNoVirtual());
  4434. default_string_piece_.Swap(&other->default_string_piece_, &::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_string_piece_.get(),
  4435. GetArenaNoVirtual());
  4436. default_cord_.Swap(&other->default_cord_, &::protobuf_unittest_no_arena::TestAllTypes::_i_give_permission_to_break_this_code_default_default_cord_.get(),
  4437. GetArenaNoVirtual());
  4438. swap(optionalgroup_, other->optionalgroup_);
  4439. swap(optional_nested_message_, other->optional_nested_message_);
  4440. swap(optional_foreign_message_, other->optional_foreign_message_);
  4441. swap(optional_import_message_, other->optional_import_message_);
  4442. swap(optional_public_import_message_, other->optional_public_import_message_);
  4443. swap(optional_message_, other->optional_message_);
  4444. swap(optional_int64_, other->optional_int64_);
  4445. swap(optional_int32_, other->optional_int32_);
  4446. swap(optional_uint32_, other->optional_uint32_);
  4447. swap(optional_uint64_, other->optional_uint64_);
  4448. swap(optional_sint64_, other->optional_sint64_);
  4449. swap(optional_sint32_, other->optional_sint32_);
  4450. swap(optional_fixed32_, other->optional_fixed32_);
  4451. swap(optional_fixed64_, other->optional_fixed64_);
  4452. swap(optional_sfixed64_, other->optional_sfixed64_);
  4453. swap(optional_sfixed32_, other->optional_sfixed32_);
  4454. swap(optional_float_, other->optional_float_);
  4455. swap(optional_double_, other->optional_double_);
  4456. swap(optional_bool_, other->optional_bool_);
  4457. swap(default_import_enum_, other->default_import_enum_);
  4458. swap(optional_nested_enum_, other->optional_nested_enum_);
  4459. swap(optional_foreign_enum_, other->optional_foreign_enum_);
  4460. swap(optional_import_enum_, other->optional_import_enum_);
  4461. swap(default_int32_, other->default_int32_);
  4462. swap(default_int64_, other->default_int64_);
  4463. swap(default_uint64_, other->default_uint64_);
  4464. swap(default_uint32_, other->default_uint32_);
  4465. swap(default_sint32_, other->default_sint32_);
  4466. swap(default_sint64_, other->default_sint64_);
  4467. swap(default_fixed64_, other->default_fixed64_);
  4468. swap(default_fixed32_, other->default_fixed32_);
  4469. swap(default_sfixed32_, other->default_sfixed32_);
  4470. swap(default_sfixed64_, other->default_sfixed64_);
  4471. swap(default_double_, other->default_double_);
  4472. swap(default_float_, other->default_float_);
  4473. swap(default_bool_, other->default_bool_);
  4474. swap(default_nested_enum_, other->default_nested_enum_);
  4475. swap(default_foreign_enum_, other->default_foreign_enum_);
  4476. swap(oneof_field_, other->oneof_field_);
  4477. swap(_oneof_case_[0], other->_oneof_case_[0]);
  4478. swap(_has_bits_[0], other->_has_bits_[0]);
  4479. swap(_has_bits_[1], other->_has_bits_[1]);
  4480. _internal_metadata_.Swap(&other->_internal_metadata_);
  4481. }
  4482. ::google::protobuf::Metadata TestAllTypes::GetMetadata() const {
  4483. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  4484. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  4485. }
  4486. // ===================================================================
  4487. void ForeignMessage::InitAsDefaultInstance() {
  4488. }
  4489. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  4490. const int ForeignMessage::kCFieldNumber;
  4491. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  4492. ForeignMessage::ForeignMessage()
  4493. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  4494. ::google::protobuf::internal::InitSCC(
  4495. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_ForeignMessage.base);
  4496. SharedCtor();
  4497. // @@protoc_insertion_point(constructor:protobuf_unittest_no_arena.ForeignMessage)
  4498. }
  4499. ForeignMessage::ForeignMessage(const ForeignMessage& from)
  4500. : ::google::protobuf::Message(),
  4501. _internal_metadata_(NULL),
  4502. _has_bits_(from._has_bits_) {
  4503. _internal_metadata_.MergeFrom(from._internal_metadata_);
  4504. c_ = from.c_;
  4505. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_no_arena.ForeignMessage)
  4506. }
  4507. void ForeignMessage::SharedCtor() {
  4508. c_ = 0;
  4509. }
  4510. ForeignMessage::~ForeignMessage() {
  4511. // @@protoc_insertion_point(destructor:protobuf_unittest_no_arena.ForeignMessage)
  4512. SharedDtor();
  4513. }
  4514. void ForeignMessage::SharedDtor() {
  4515. }
  4516. void ForeignMessage::SetCachedSize(int size) const {
  4517. _cached_size_.Set(size);
  4518. }
  4519. const ::google::protobuf::Descriptor* ForeignMessage::descriptor() {
  4520. ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  4521. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  4522. }
  4523. const ForeignMessage& ForeignMessage::default_instance() {
  4524. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_ForeignMessage.base);
  4525. return *internal_default_instance();
  4526. }
  4527. void ForeignMessage::Clear() {
  4528. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_no_arena.ForeignMessage)
  4529. ::google::protobuf::uint32 cached_has_bits = 0;
  4530. // Prevent compiler warnings about cached_has_bits being unused
  4531. (void) cached_has_bits;
  4532. c_ = 0;
  4533. _has_bits_.Clear();
  4534. _internal_metadata_.Clear();
  4535. }
  4536. bool ForeignMessage::MergePartialFromCodedStream(
  4537. ::google::protobuf::io::CodedInputStream* input) {
  4538. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  4539. ::google::protobuf::uint32 tag;
  4540. // @@protoc_insertion_point(parse_start:protobuf_unittest_no_arena.ForeignMessage)
  4541. for (;;) {
  4542. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  4543. tag = p.first;
  4544. if (!p.second) goto handle_unusual;
  4545. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  4546. // optional int32 c = 1;
  4547. case 1: {
  4548. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4549. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  4550. set_has_c();
  4551. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  4552. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  4553. input, &c_)));
  4554. } else {
  4555. goto handle_unusual;
  4556. }
  4557. break;
  4558. }
  4559. default: {
  4560. handle_unusual:
  4561. if (tag == 0) {
  4562. goto success;
  4563. }
  4564. DO_(::google::protobuf::internal::WireFormat::SkipField(
  4565. input, tag, _internal_metadata_.mutable_unknown_fields()));
  4566. break;
  4567. }
  4568. }
  4569. }
  4570. success:
  4571. // @@protoc_insertion_point(parse_success:protobuf_unittest_no_arena.ForeignMessage)
  4572. return true;
  4573. failure:
  4574. // @@protoc_insertion_point(parse_failure:protobuf_unittest_no_arena.ForeignMessage)
  4575. return false;
  4576. #undef DO_
  4577. }
  4578. void ForeignMessage::SerializeWithCachedSizes(
  4579. ::google::protobuf::io::CodedOutputStream* output) const {
  4580. // @@protoc_insertion_point(serialize_start:protobuf_unittest_no_arena.ForeignMessage)
  4581. ::google::protobuf::uint32 cached_has_bits = 0;
  4582. (void) cached_has_bits;
  4583. cached_has_bits = _has_bits_[0];
  4584. // optional int32 c = 1;
  4585. if (cached_has_bits & 0x00000001u) {
  4586. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->c(), output);
  4587. }
  4588. if (_internal_metadata_.have_unknown_fields()) {
  4589. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  4590. _internal_metadata_.unknown_fields(), output);
  4591. }
  4592. // @@protoc_insertion_point(serialize_end:protobuf_unittest_no_arena.ForeignMessage)
  4593. }
  4594. ::google::protobuf::uint8* ForeignMessage::InternalSerializeWithCachedSizesToArray(
  4595. bool deterministic, ::google::protobuf::uint8* target) const {
  4596. (void)deterministic; // Unused
  4597. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_no_arena.ForeignMessage)
  4598. ::google::protobuf::uint32 cached_has_bits = 0;
  4599. (void) cached_has_bits;
  4600. cached_has_bits = _has_bits_[0];
  4601. // optional int32 c = 1;
  4602. if (cached_has_bits & 0x00000001u) {
  4603. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->c(), target);
  4604. }
  4605. if (_internal_metadata_.have_unknown_fields()) {
  4606. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  4607. _internal_metadata_.unknown_fields(), target);
  4608. }
  4609. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_no_arena.ForeignMessage)
  4610. return target;
  4611. }
  4612. size_t ForeignMessage::ByteSizeLong() const {
  4613. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_no_arena.ForeignMessage)
  4614. size_t total_size = 0;
  4615. if (_internal_metadata_.have_unknown_fields()) {
  4616. total_size +=
  4617. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  4618. _internal_metadata_.unknown_fields());
  4619. }
  4620. // optional int32 c = 1;
  4621. if (has_c()) {
  4622. total_size += 1 +
  4623. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4624. this->c());
  4625. }
  4626. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  4627. SetCachedSize(cached_size);
  4628. return total_size;
  4629. }
  4630. void ForeignMessage::MergeFrom(const ::google::protobuf::Message& from) {
  4631. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_no_arena.ForeignMessage)
  4632. GOOGLE_DCHECK_NE(&from, this);
  4633. const ForeignMessage* source =
  4634. ::google::protobuf::internal::DynamicCastToGenerated<const ForeignMessage>(
  4635. &from);
  4636. if (source == NULL) {
  4637. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_no_arena.ForeignMessage)
  4638. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  4639. } else {
  4640. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_no_arena.ForeignMessage)
  4641. MergeFrom(*source);
  4642. }
  4643. }
  4644. void ForeignMessage::MergeFrom(const ForeignMessage& from) {
  4645. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_no_arena.ForeignMessage)
  4646. GOOGLE_DCHECK_NE(&from, this);
  4647. _internal_metadata_.MergeFrom(from._internal_metadata_);
  4648. ::google::protobuf::uint32 cached_has_bits = 0;
  4649. (void) cached_has_bits;
  4650. if (from.has_c()) {
  4651. set_c(from.c());
  4652. }
  4653. }
  4654. void ForeignMessage::CopyFrom(const ::google::protobuf::Message& from) {
  4655. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_no_arena.ForeignMessage)
  4656. if (&from == this) return;
  4657. Clear();
  4658. MergeFrom(from);
  4659. }
  4660. void ForeignMessage::CopyFrom(const ForeignMessage& from) {
  4661. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_no_arena.ForeignMessage)
  4662. if (&from == this) return;
  4663. Clear();
  4664. MergeFrom(from);
  4665. }
  4666. bool ForeignMessage::IsInitialized() const {
  4667. return true;
  4668. }
  4669. void ForeignMessage::Swap(ForeignMessage* other) {
  4670. if (other == this) return;
  4671. InternalSwap(other);
  4672. }
  4673. void ForeignMessage::InternalSwap(ForeignMessage* other) {
  4674. using std::swap;
  4675. swap(c_, other->c_);
  4676. swap(_has_bits_[0], other->_has_bits_[0]);
  4677. _internal_metadata_.Swap(&other->_internal_metadata_);
  4678. }
  4679. ::google::protobuf::Metadata ForeignMessage::GetMetadata() const {
  4680. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  4681. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  4682. }
  4683. // ===================================================================
  4684. void TestNoArenaMessage::InitAsDefaultInstance() {
  4685. ::protobuf_unittest_no_arena::_TestNoArenaMessage_default_instance_._instance.get_mutable()->arena_message_ = const_cast< ::proto2_arena_unittest::ArenaMessage*>(
  4686. ::proto2_arena_unittest::ArenaMessage::internal_default_instance());
  4687. }
  4688. void TestNoArenaMessage::clear_arena_message() {
  4689. if (arena_message_ != NULL) arena_message_->Clear();
  4690. clear_has_arena_message();
  4691. }
  4692. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  4693. const int TestNoArenaMessage::kArenaMessageFieldNumber;
  4694. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  4695. TestNoArenaMessage::TestNoArenaMessage()
  4696. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  4697. ::google::protobuf::internal::InitSCC(
  4698. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestNoArenaMessage.base);
  4699. SharedCtor();
  4700. // @@protoc_insertion_point(constructor:protobuf_unittest_no_arena.TestNoArenaMessage)
  4701. }
  4702. TestNoArenaMessage::TestNoArenaMessage(const TestNoArenaMessage& from)
  4703. : ::google::protobuf::Message(),
  4704. _internal_metadata_(NULL),
  4705. _has_bits_(from._has_bits_) {
  4706. _internal_metadata_.MergeFrom(from._internal_metadata_);
  4707. if (from.has_arena_message()) {
  4708. arena_message_ = new ::proto2_arena_unittest::ArenaMessage(*from.arena_message_);
  4709. } else {
  4710. arena_message_ = NULL;
  4711. }
  4712. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_no_arena.TestNoArenaMessage)
  4713. }
  4714. void TestNoArenaMessage::SharedCtor() {
  4715. arena_message_ = NULL;
  4716. }
  4717. TestNoArenaMessage::~TestNoArenaMessage() {
  4718. // @@protoc_insertion_point(destructor:protobuf_unittest_no_arena.TestNoArenaMessage)
  4719. SharedDtor();
  4720. }
  4721. void TestNoArenaMessage::SharedDtor() {
  4722. if (this != internal_default_instance()) delete arena_message_;
  4723. }
  4724. void TestNoArenaMessage::SetCachedSize(int size) const {
  4725. _cached_size_.Set(size);
  4726. }
  4727. const ::google::protobuf::Descriptor* TestNoArenaMessage::descriptor() {
  4728. ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  4729. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  4730. }
  4731. const TestNoArenaMessage& TestNoArenaMessage::default_instance() {
  4732. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::scc_info_TestNoArenaMessage.base);
  4733. return *internal_default_instance();
  4734. }
  4735. void TestNoArenaMessage::Clear() {
  4736. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4737. ::google::protobuf::uint32 cached_has_bits = 0;
  4738. // Prevent compiler warnings about cached_has_bits being unused
  4739. (void) cached_has_bits;
  4740. cached_has_bits = _has_bits_[0];
  4741. if (cached_has_bits & 0x00000001u) {
  4742. GOOGLE_DCHECK(arena_message_ != NULL);
  4743. arena_message_->Clear();
  4744. }
  4745. _has_bits_.Clear();
  4746. _internal_metadata_.Clear();
  4747. }
  4748. bool TestNoArenaMessage::MergePartialFromCodedStream(
  4749. ::google::protobuf::io::CodedInputStream* input) {
  4750. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  4751. ::google::protobuf::uint32 tag;
  4752. // @@protoc_insertion_point(parse_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4753. for (;;) {
  4754. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  4755. tag = p.first;
  4756. if (!p.second) goto handle_unusual;
  4757. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  4758. // optional .proto2_arena_unittest.ArenaMessage arena_message = 1;
  4759. case 1: {
  4760. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4761. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  4762. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  4763. input, mutable_arena_message()));
  4764. } else {
  4765. goto handle_unusual;
  4766. }
  4767. break;
  4768. }
  4769. default: {
  4770. handle_unusual:
  4771. if (tag == 0) {
  4772. goto success;
  4773. }
  4774. DO_(::google::protobuf::internal::WireFormat::SkipField(
  4775. input, tag, _internal_metadata_.mutable_unknown_fields()));
  4776. break;
  4777. }
  4778. }
  4779. }
  4780. success:
  4781. // @@protoc_insertion_point(parse_success:protobuf_unittest_no_arena.TestNoArenaMessage)
  4782. return true;
  4783. failure:
  4784. // @@protoc_insertion_point(parse_failure:protobuf_unittest_no_arena.TestNoArenaMessage)
  4785. return false;
  4786. #undef DO_
  4787. }
  4788. void TestNoArenaMessage::SerializeWithCachedSizes(
  4789. ::google::protobuf::io::CodedOutputStream* output) const {
  4790. // @@protoc_insertion_point(serialize_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4791. ::google::protobuf::uint32 cached_has_bits = 0;
  4792. (void) cached_has_bits;
  4793. cached_has_bits = _has_bits_[0];
  4794. // optional .proto2_arena_unittest.ArenaMessage arena_message = 1;
  4795. if (cached_has_bits & 0x00000001u) {
  4796. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  4797. 1, this->_internal_arena_message(), output);
  4798. }
  4799. if (_internal_metadata_.have_unknown_fields()) {
  4800. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  4801. _internal_metadata_.unknown_fields(), output);
  4802. }
  4803. // @@protoc_insertion_point(serialize_end:protobuf_unittest_no_arena.TestNoArenaMessage)
  4804. }
  4805. ::google::protobuf::uint8* TestNoArenaMessage::InternalSerializeWithCachedSizesToArray(
  4806. bool deterministic, ::google::protobuf::uint8* target) const {
  4807. (void)deterministic; // Unused
  4808. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4809. ::google::protobuf::uint32 cached_has_bits = 0;
  4810. (void) cached_has_bits;
  4811. cached_has_bits = _has_bits_[0];
  4812. // optional .proto2_arena_unittest.ArenaMessage arena_message = 1;
  4813. if (cached_has_bits & 0x00000001u) {
  4814. target = ::google::protobuf::internal::WireFormatLite::
  4815. InternalWriteMessageToArray(
  4816. 1, this->_internal_arena_message(), deterministic, target);
  4817. }
  4818. if (_internal_metadata_.have_unknown_fields()) {
  4819. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  4820. _internal_metadata_.unknown_fields(), target);
  4821. }
  4822. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_no_arena.TestNoArenaMessage)
  4823. return target;
  4824. }
  4825. size_t TestNoArenaMessage::ByteSizeLong() const {
  4826. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4827. size_t total_size = 0;
  4828. if (_internal_metadata_.have_unknown_fields()) {
  4829. total_size +=
  4830. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  4831. _internal_metadata_.unknown_fields());
  4832. }
  4833. // optional .proto2_arena_unittest.ArenaMessage arena_message = 1;
  4834. if (has_arena_message()) {
  4835. total_size += 1 +
  4836. ::google::protobuf::internal::WireFormatLite::MessageSize(
  4837. *arena_message_);
  4838. }
  4839. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  4840. SetCachedSize(cached_size);
  4841. return total_size;
  4842. }
  4843. void TestNoArenaMessage::MergeFrom(const ::google::protobuf::Message& from) {
  4844. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4845. GOOGLE_DCHECK_NE(&from, this);
  4846. const TestNoArenaMessage* source =
  4847. ::google::protobuf::internal::DynamicCastToGenerated<const TestNoArenaMessage>(
  4848. &from);
  4849. if (source == NULL) {
  4850. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_no_arena.TestNoArenaMessage)
  4851. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  4852. } else {
  4853. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_no_arena.TestNoArenaMessage)
  4854. MergeFrom(*source);
  4855. }
  4856. }
  4857. void TestNoArenaMessage::MergeFrom(const TestNoArenaMessage& from) {
  4858. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4859. GOOGLE_DCHECK_NE(&from, this);
  4860. _internal_metadata_.MergeFrom(from._internal_metadata_);
  4861. ::google::protobuf::uint32 cached_has_bits = 0;
  4862. (void) cached_has_bits;
  4863. if (from.has_arena_message()) {
  4864. mutable_arena_message()->::proto2_arena_unittest::ArenaMessage::MergeFrom(from.arena_message());
  4865. }
  4866. }
  4867. void TestNoArenaMessage::CopyFrom(const ::google::protobuf::Message& from) {
  4868. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4869. if (&from == this) return;
  4870. Clear();
  4871. MergeFrom(from);
  4872. }
  4873. void TestNoArenaMessage::CopyFrom(const TestNoArenaMessage& from) {
  4874. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_no_arena.TestNoArenaMessage)
  4875. if (&from == this) return;
  4876. Clear();
  4877. MergeFrom(from);
  4878. }
  4879. bool TestNoArenaMessage::IsInitialized() const {
  4880. return true;
  4881. }
  4882. void TestNoArenaMessage::Swap(TestNoArenaMessage* other) {
  4883. if (other == this) return;
  4884. InternalSwap(other);
  4885. }
  4886. void TestNoArenaMessage::InternalSwap(TestNoArenaMessage* other) {
  4887. using std::swap;
  4888. swap(arena_message_, other->arena_message_);
  4889. swap(_has_bits_[0], other->_has_bits_[0]);
  4890. _internal_metadata_.Swap(&other->_internal_metadata_);
  4891. }
  4892. ::google::protobuf::Metadata TestNoArenaMessage::GetMetadata() const {
  4893. protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  4894. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  4895. }
  4896. // @@protoc_insertion_point(namespace_scope)
  4897. } // namespace protobuf_unittest_no_arena
  4898. namespace google {
  4899. namespace protobuf {
  4900. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage* Arena::CreateMaybeMessage< ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage >(Arena* arena) {
  4901. return Arena::CreateInternal< ::protobuf_unittest_no_arena::TestAllTypes_NestedMessage >(arena);
  4902. }
  4903. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup* Arena::CreateMaybeMessage< ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup >(Arena* arena) {
  4904. return Arena::CreateInternal< ::protobuf_unittest_no_arena::TestAllTypes_OptionalGroup >(arena);
  4905. }
  4906. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup* Arena::CreateMaybeMessage< ::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup >(Arena* arena) {
  4907. return Arena::CreateInternal< ::protobuf_unittest_no_arena::TestAllTypes_RepeatedGroup >(arena);
  4908. }
  4909. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_no_arena::TestAllTypes* Arena::CreateMaybeMessage< ::protobuf_unittest_no_arena::TestAllTypes >(Arena* arena) {
  4910. return Arena::CreateInternal< ::protobuf_unittest_no_arena::TestAllTypes >(arena);
  4911. }
  4912. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_no_arena::ForeignMessage* Arena::CreateMaybeMessage< ::protobuf_unittest_no_arena::ForeignMessage >(Arena* arena) {
  4913. return Arena::CreateInternal< ::protobuf_unittest_no_arena::ForeignMessage >(arena);
  4914. }
  4915. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_no_arena::TestNoArenaMessage* Arena::CreateMaybeMessage< ::protobuf_unittest_no_arena::TestNoArenaMessage >(Arena* arena) {
  4916. return Arena::CreateInternal< ::protobuf_unittest_no_arena::TestNoArenaMessage >(arena);
  4917. }
  4918. } // namespace protobuf
  4919. } // namespace google
  4920. // @@protoc_insertion_point(global_scope)