unittest_proto3_arena.pb.cc 283 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_proto3_arena.proto
  3. #include <google/protobuf/unittest_proto3_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_5fimport_2eproto {
  19. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fimport_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ImportMessage;
  20. } // namespace protobuf_google_2fprotobuf_2funittest_5fimport_2eproto
  21. namespace protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto {
  22. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_PublicImportMessage;
  23. } // namespace protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto
  24. namespace protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto {
  25. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ForeignMessage;
  26. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_NestedMessage;
  27. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_NestedTestAllTypes;
  28. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_TestAllTypes;
  29. } // namespace protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto
  30. namespace proto3_arena_unittest {
  31. class TestAllTypes_NestedMessageDefaultTypeInternal {
  32. public:
  33. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes_NestedMessage>
  34. _instance;
  35. } _TestAllTypes_NestedMessage_default_instance_;
  36. class TestAllTypesDefaultTypeInternal {
  37. public:
  38. ::google::protobuf::internal::ExplicitlyConstructed<TestAllTypes>
  39. _instance;
  40. ::google::protobuf::uint32 oneof_uint32_;
  41. const ::proto3_arena_unittest::TestAllTypes_NestedMessage* oneof_nested_message_;
  42. ::google::protobuf::internal::ArenaStringPtr oneof_string_;
  43. ::google::protobuf::internal::ArenaStringPtr oneof_bytes_;
  44. } _TestAllTypes_default_instance_;
  45. class TestPackedTypesDefaultTypeInternal {
  46. public:
  47. ::google::protobuf::internal::ExplicitlyConstructed<TestPackedTypes>
  48. _instance;
  49. } _TestPackedTypes_default_instance_;
  50. class TestUnpackedTypesDefaultTypeInternal {
  51. public:
  52. ::google::protobuf::internal::ExplicitlyConstructed<TestUnpackedTypes>
  53. _instance;
  54. } _TestUnpackedTypes_default_instance_;
  55. class NestedTestAllTypesDefaultTypeInternal {
  56. public:
  57. ::google::protobuf::internal::ExplicitlyConstructed<NestedTestAllTypes>
  58. _instance;
  59. } _NestedTestAllTypes_default_instance_;
  60. class ForeignMessageDefaultTypeInternal {
  61. public:
  62. ::google::protobuf::internal::ExplicitlyConstructed<ForeignMessage>
  63. _instance;
  64. } _ForeignMessage_default_instance_;
  65. class TestEmptyMessageDefaultTypeInternal {
  66. public:
  67. ::google::protobuf::internal::ExplicitlyConstructed<TestEmptyMessage>
  68. _instance;
  69. } _TestEmptyMessage_default_instance_;
  70. } // namespace proto3_arena_unittest
  71. namespace protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto {
  72. static void InitDefaultsTestAllTypes_NestedMessage() {
  73. GOOGLE_PROTOBUF_VERIFY_VERSION;
  74. {
  75. void* ptr = &::proto3_arena_unittest::_TestAllTypes_NestedMessage_default_instance_;
  76. new (ptr) ::proto3_arena_unittest::TestAllTypes_NestedMessage();
  77. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  78. }
  79. ::proto3_arena_unittest::TestAllTypes_NestedMessage::InitAsDefaultInstance();
  80. }
  81. ::google::protobuf::internal::SCCInfo<0> scc_info_TestAllTypes_NestedMessage =
  82. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestAllTypes_NestedMessage}, {}};
  83. static void InitDefaultsTestAllTypes() {
  84. GOOGLE_PROTOBUF_VERIFY_VERSION;
  85. {
  86. void* ptr = &::proto3_arena_unittest::_TestAllTypes_default_instance_;
  87. new (ptr) ::proto3_arena_unittest::TestAllTypes();
  88. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  89. }
  90. ::proto3_arena_unittest::TestAllTypes::InitAsDefaultInstance();
  91. }
  92. ::google::protobuf::internal::SCCInfo<4> scc_info_TestAllTypes =
  93. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsTestAllTypes}, {
  94. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes_NestedMessage.base,
  95. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_ForeignMessage.base,
  96. &protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::scc_info_ImportMessage.base,
  97. &protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::scc_info_PublicImportMessage.base,}};
  98. static void InitDefaultsTestPackedTypes() {
  99. GOOGLE_PROTOBUF_VERIFY_VERSION;
  100. {
  101. void* ptr = &::proto3_arena_unittest::_TestPackedTypes_default_instance_;
  102. new (ptr) ::proto3_arena_unittest::TestPackedTypes();
  103. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  104. }
  105. ::proto3_arena_unittest::TestPackedTypes::InitAsDefaultInstance();
  106. }
  107. ::google::protobuf::internal::SCCInfo<0> scc_info_TestPackedTypes =
  108. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestPackedTypes}, {}};
  109. static void InitDefaultsTestUnpackedTypes() {
  110. GOOGLE_PROTOBUF_VERIFY_VERSION;
  111. {
  112. void* ptr = &::proto3_arena_unittest::_TestUnpackedTypes_default_instance_;
  113. new (ptr) ::proto3_arena_unittest::TestUnpackedTypes();
  114. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  115. }
  116. ::proto3_arena_unittest::TestUnpackedTypes::InitAsDefaultInstance();
  117. }
  118. ::google::protobuf::internal::SCCInfo<0> scc_info_TestUnpackedTypes =
  119. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestUnpackedTypes}, {}};
  120. static void InitDefaultsNestedTestAllTypes() {
  121. GOOGLE_PROTOBUF_VERIFY_VERSION;
  122. {
  123. void* ptr = &::proto3_arena_unittest::_NestedTestAllTypes_default_instance_;
  124. new (ptr) ::proto3_arena_unittest::NestedTestAllTypes();
  125. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  126. }
  127. ::proto3_arena_unittest::NestedTestAllTypes::InitAsDefaultInstance();
  128. }
  129. ::google::protobuf::internal::SCCInfo<1> scc_info_NestedTestAllTypes =
  130. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNestedTestAllTypes}, {
  131. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes.base,}};
  132. static void InitDefaultsForeignMessage() {
  133. GOOGLE_PROTOBUF_VERIFY_VERSION;
  134. {
  135. void* ptr = &::proto3_arena_unittest::_ForeignMessage_default_instance_;
  136. new (ptr) ::proto3_arena_unittest::ForeignMessage();
  137. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  138. }
  139. ::proto3_arena_unittest::ForeignMessage::InitAsDefaultInstance();
  140. }
  141. ::google::protobuf::internal::SCCInfo<0> scc_info_ForeignMessage =
  142. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsForeignMessage}, {}};
  143. static void InitDefaultsTestEmptyMessage() {
  144. GOOGLE_PROTOBUF_VERIFY_VERSION;
  145. {
  146. void* ptr = &::proto3_arena_unittest::_TestEmptyMessage_default_instance_;
  147. new (ptr) ::proto3_arena_unittest::TestEmptyMessage();
  148. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  149. }
  150. ::proto3_arena_unittest::TestEmptyMessage::InitAsDefaultInstance();
  151. }
  152. ::google::protobuf::internal::SCCInfo<0> scc_info_TestEmptyMessage =
  153. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestEmptyMessage}, {}};
  154. void InitDefaults() {
  155. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes_NestedMessage.base);
  156. ::google::protobuf::internal::InitSCC(&scc_info_TestAllTypes.base);
  157. ::google::protobuf::internal::InitSCC(&scc_info_TestPackedTypes.base);
  158. ::google::protobuf::internal::InitSCC(&scc_info_TestUnpackedTypes.base);
  159. ::google::protobuf::internal::InitSCC(&scc_info_NestedTestAllTypes.base);
  160. ::google::protobuf::internal::InitSCC(&scc_info_ForeignMessage.base);
  161. ::google::protobuf::internal::InitSCC(&scc_info_TestEmptyMessage.base);
  162. }
  163. ::google::protobuf::Metadata file_level_metadata[7];
  164. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
  165. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  166. ~0u, // no _has_bits_
  167. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes_NestedMessage, _internal_metadata_),
  168. ~0u, // no _extensions_
  169. ~0u, // no _oneof_case_
  170. ~0u, // no _weak_field_map_
  171. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes_NestedMessage, bb_),
  172. ~0u, // no _has_bits_
  173. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, _internal_metadata_),
  174. ~0u, // no _extensions_
  175. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, _oneof_case_[0]),
  176. ~0u, // no _weak_field_map_
  177. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_int32_),
  178. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_int64_),
  179. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_uint32_),
  180. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_uint64_),
  181. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_sint32_),
  182. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_sint64_),
  183. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_fixed32_),
  184. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_fixed64_),
  185. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_sfixed32_),
  186. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_sfixed64_),
  187. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_float_),
  188. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_double_),
  189. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_bool_),
  190. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_string_),
  191. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_bytes_),
  192. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_nested_message_),
  193. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_foreign_message_),
  194. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_import_message_),
  195. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_nested_enum_),
  196. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_foreign_enum_),
  197. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_string_piece_),
  198. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_cord_),
  199. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_public_import_message_),
  200. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_lazy_message_),
  201. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, optional_lazy_import_message_),
  202. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_int32_),
  203. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_int64_),
  204. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_uint32_),
  205. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_uint64_),
  206. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_sint32_),
  207. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_sint64_),
  208. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_fixed32_),
  209. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_fixed64_),
  210. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_sfixed32_),
  211. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_sfixed64_),
  212. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_float_),
  213. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_double_),
  214. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_bool_),
  215. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_string_),
  216. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_bytes_),
  217. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_nested_message_),
  218. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_foreign_message_),
  219. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_import_message_),
  220. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_nested_enum_),
  221. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_foreign_enum_),
  222. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_string_piece_),
  223. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_cord_),
  224. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, repeated_lazy_message_),
  225. offsetof(::proto3_arena_unittest::TestAllTypesDefaultTypeInternal, oneof_uint32_),
  226. offsetof(::proto3_arena_unittest::TestAllTypesDefaultTypeInternal, oneof_nested_message_),
  227. offsetof(::proto3_arena_unittest::TestAllTypesDefaultTypeInternal, oneof_string_),
  228. offsetof(::proto3_arena_unittest::TestAllTypesDefaultTypeInternal, oneof_bytes_),
  229. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestAllTypes, oneof_field_),
  230. ~0u, // no _has_bits_
  231. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, _internal_metadata_),
  232. ~0u, // no _extensions_
  233. ~0u, // no _oneof_case_
  234. ~0u, // no _weak_field_map_
  235. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_int32_),
  236. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_int64_),
  237. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_uint32_),
  238. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_uint64_),
  239. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_sint32_),
  240. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_sint64_),
  241. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_fixed32_),
  242. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_fixed64_),
  243. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_sfixed32_),
  244. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_sfixed64_),
  245. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_float_),
  246. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_double_),
  247. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_bool_),
  248. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestPackedTypes, packed_enum_),
  249. ~0u, // no _has_bits_
  250. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, _internal_metadata_),
  251. ~0u, // no _extensions_
  252. ~0u, // no _oneof_case_
  253. ~0u, // no _weak_field_map_
  254. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_int32_),
  255. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_int64_),
  256. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_uint32_),
  257. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_uint64_),
  258. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_sint32_),
  259. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_sint64_),
  260. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_fixed32_),
  261. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_fixed64_),
  262. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_sfixed32_),
  263. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_sfixed64_),
  264. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_float_),
  265. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_double_),
  266. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_bool_),
  267. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestUnpackedTypes, repeated_nested_enum_),
  268. ~0u, // no _has_bits_
  269. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::NestedTestAllTypes, _internal_metadata_),
  270. ~0u, // no _extensions_
  271. ~0u, // no _oneof_case_
  272. ~0u, // no _weak_field_map_
  273. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::NestedTestAllTypes, child_),
  274. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::NestedTestAllTypes, payload_),
  275. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::NestedTestAllTypes, repeated_child_),
  276. ~0u, // no _has_bits_
  277. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::ForeignMessage, _internal_metadata_),
  278. ~0u, // no _extensions_
  279. ~0u, // no _oneof_case_
  280. ~0u, // no _weak_field_map_
  281. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::ForeignMessage, c_),
  282. ~0u, // no _has_bits_
  283. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_arena_unittest::TestEmptyMessage, _internal_metadata_),
  284. ~0u, // no _extensions_
  285. ~0u, // no _oneof_case_
  286. ~0u, // no _weak_field_map_
  287. };
  288. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  289. { 0, -1, sizeof(::proto3_arena_unittest::TestAllTypes_NestedMessage)},
  290. { 6, -1, sizeof(::proto3_arena_unittest::TestAllTypes)},
  291. { 64, -1, sizeof(::proto3_arena_unittest::TestPackedTypes)},
  292. { 83, -1, sizeof(::proto3_arena_unittest::TestUnpackedTypes)},
  293. { 102, -1, sizeof(::proto3_arena_unittest::NestedTestAllTypes)},
  294. { 110, -1, sizeof(::proto3_arena_unittest::ForeignMessage)},
  295. { 116, -1, sizeof(::proto3_arena_unittest::TestEmptyMessage)},
  296. };
  297. static ::google::protobuf::Message const * const file_default_instances[] = {
  298. reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_arena_unittest::_TestAllTypes_NestedMessage_default_instance_),
  299. reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_arena_unittest::_TestAllTypes_default_instance_),
  300. reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_arena_unittest::_TestPackedTypes_default_instance_),
  301. reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_arena_unittest::_TestUnpackedTypes_default_instance_),
  302. reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_arena_unittest::_NestedTestAllTypes_default_instance_),
  303. reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_arena_unittest::_ForeignMessage_default_instance_),
  304. reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_arena_unittest::_TestEmptyMessage_default_instance_),
  305. };
  306. void protobuf_AssignDescriptors() {
  307. AddDescriptors();
  308. AssignDescriptors(
  309. "google/protobuf/unittest_proto3_arena.proto", schemas, file_default_instances, TableStruct::offsets,
  310. file_level_metadata, file_level_enum_descriptors, NULL);
  311. }
  312. void protobuf_AssignDescriptorsOnce() {
  313. static ::google::protobuf::internal::once_flag once;
  314. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  315. }
  316. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  317. void protobuf_RegisterTypes(const ::std::string&) {
  318. protobuf_AssignDescriptorsOnce();
  319. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7);
  320. }
  321. void AddDescriptorsImpl() {
  322. InitDefaults();
  323. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  324. "\n+google/protobuf/unittest_proto3_arena."
  325. "proto\022\025proto3_arena_unittest\032%google/pro"
  326. "tobuf/unittest_import.proto\"\311\021\n\014TestAllT"
  327. "ypes\022\026\n\016optional_int32\030\001 \001(\005\022\026\n\016optional"
  328. "_int64\030\002 \001(\003\022\027\n\017optional_uint32\030\003 \001(\r\022\027\n"
  329. "\017optional_uint64\030\004 \001(\004\022\027\n\017optional_sint3"
  330. "2\030\005 \001(\021\022\027\n\017optional_sint64\030\006 \001(\022\022\030\n\020opti"
  331. "onal_fixed32\030\007 \001(\007\022\030\n\020optional_fixed64\030\010"
  332. " \001(\006\022\031\n\021optional_sfixed32\030\t \001(\017\022\031\n\021optio"
  333. "nal_sfixed64\030\n \001(\020\022\026\n\016optional_float\030\013 \001"
  334. "(\002\022\027\n\017optional_double\030\014 \001(\001\022\025\n\roptional_"
  335. "bool\030\r \001(\010\022\027\n\017optional_string\030\016 \001(\t\022\026\n\016o"
  336. "ptional_bytes\030\017 \001(\014\022R\n\027optional_nested_m"
  337. "essage\030\022 \001(\01321.proto3_arena_unittest.Tes"
  338. "tAllTypes.NestedMessage\022G\n\030optional_fore"
  339. "ign_message\030\023 \001(\0132%.proto3_arena_unittes"
  340. "t.ForeignMessage\022H\n\027optional_import_mess"
  341. "age\030\024 \001(\0132\'.protobuf_unittest_import.Imp"
  342. "ortMessage\022L\n\024optional_nested_enum\030\025 \001(\016"
  343. "2..proto3_arena_unittest.TestAllTypes.Ne"
  344. "stedEnum\022A\n\025optional_foreign_enum\030\026 \001(\0162"
  345. "\".proto3_arena_unittest.ForeignEnum\022!\n\025o"
  346. "ptional_string_piece\030\030 \001(\tB\002\010\002\022\031\n\roption"
  347. "al_cord\030\031 \001(\tB\002\010\001\022U\n\036optional_public_imp"
  348. "ort_message\030\032 \001(\0132-.protobuf_unittest_im"
  349. "port.PublicImportMessage\022T\n\025optional_laz"
  350. "y_message\030\033 \001(\01321.proto3_arena_unittest."
  351. "TestAllTypes.NestedMessageB\002(\001\022Q\n\034option"
  352. "al_lazy_import_message\030s \001(\0132\'.protobuf_"
  353. "unittest_import.ImportMessageB\002(\001\022\026\n\016rep"
  354. "eated_int32\030\037 \003(\005\022\026\n\016repeated_int64\030 \003("
  355. "\003\022\027\n\017repeated_uint32\030! \003(\r\022\027\n\017repeated_u"
  356. "int64\030\" \003(\004\022\027\n\017repeated_sint32\030# \003(\021\022\027\n\017"
  357. "repeated_sint64\030$ \003(\022\022\030\n\020repeated_fixed3"
  358. "2\030% \003(\007\022\030\n\020repeated_fixed64\030& \003(\006\022\031\n\021rep"
  359. "eated_sfixed32\030\' \003(\017\022\031\n\021repeated_sfixed6"
  360. "4\030( \003(\020\022\026\n\016repeated_float\030) \003(\002\022\027\n\017repea"
  361. "ted_double\030* \003(\001\022\025\n\rrepeated_bool\030+ \003(\010\022"
  362. "\027\n\017repeated_string\030, \003(\t\022\026\n\016repeated_byt"
  363. "es\030- \003(\014\022R\n\027repeated_nested_message\0300 \003("
  364. "\01321.proto3_arena_unittest.TestAllTypes.N"
  365. "estedMessage\022G\n\030repeated_foreign_message"
  366. "\0301 \003(\0132%.proto3_arena_unittest.ForeignMe"
  367. "ssage\022H\n\027repeated_import_message\0302 \003(\0132\'"
  368. ".protobuf_unittest_import.ImportMessage\022"
  369. "L\n\024repeated_nested_enum\0303 \003(\0162..proto3_a"
  370. "rena_unittest.TestAllTypes.NestedEnum\022A\n"
  371. "\025repeated_foreign_enum\0304 \003(\0162\".proto3_ar"
  372. "ena_unittest.ForeignEnum\022!\n\025repeated_str"
  373. "ing_piece\0306 \003(\tB\002\010\002\022\031\n\rrepeated_cord\0307 \003"
  374. "(\tB\002\010\001\022T\n\025repeated_lazy_message\0309 \003(\01321."
  375. "proto3_arena_unittest.TestAllTypes.Neste"
  376. "dMessageB\002(\001\022\026\n\014oneof_uint32\030o \001(\rH\000\022Q\n\024"
  377. "oneof_nested_message\030p \001(\01321.proto3_aren"
  378. "a_unittest.TestAllTypes.NestedMessageH\000\022"
  379. "\026\n\014oneof_string\030q \001(\tH\000\022\025\n\013oneof_bytes\030r"
  380. " \001(\014H\000\032\033\n\rNestedMessage\022\n\n\002bb\030\001 \001(\005\"C\n\nN"
  381. "estedEnum\022\010\n\004ZERO\020\000\022\007\n\003FOO\020\001\022\007\n\003BAR\020\002\022\007\n"
  382. "\003BAZ\020\003\022\020\n\003NEG\020\377\377\377\377\377\377\377\377\377\001B\r\n\013oneof_field\""
  383. "\256\003\n\017TestPackedTypes\022\030\n\014packed_int32\030Z \003("
  384. "\005B\002\020\001\022\030\n\014packed_int64\030[ \003(\003B\002\020\001\022\031\n\rpacke"
  385. "d_uint32\030\\ \003(\rB\002\020\001\022\031\n\rpacked_uint64\030] \003("
  386. "\004B\002\020\001\022\031\n\rpacked_sint32\030^ \003(\021B\002\020\001\022\031\n\rpack"
  387. "ed_sint64\030_ \003(\022B\002\020\001\022\032\n\016packed_fixed32\030` "
  388. "\003(\007B\002\020\001\022\032\n\016packed_fixed64\030a \003(\006B\002\020\001\022\033\n\017p"
  389. "acked_sfixed32\030b \003(\017B\002\020\001\022\033\n\017packed_sfixe"
  390. "d64\030c \003(\020B\002\020\001\022\030\n\014packed_float\030d \003(\002B\002\020\001\022"
  391. "\031\n\rpacked_double\030e \003(\001B\002\020\001\022\027\n\013packed_boo"
  392. "l\030f \003(\010B\002\020\001\022;\n\013packed_enum\030g \003(\0162\".proto"
  393. "3_arena_unittest.ForeignEnumB\002\020\001\"\337\003\n\021Tes"
  394. "tUnpackedTypes\022\032\n\016repeated_int32\030\001 \003(\005B\002"
  395. "\020\000\022\032\n\016repeated_int64\030\002 \003(\003B\002\020\000\022\033\n\017repeat"
  396. "ed_uint32\030\003 \003(\rB\002\020\000\022\033\n\017repeated_uint64\030\004"
  397. " \003(\004B\002\020\000\022\033\n\017repeated_sint32\030\005 \003(\021B\002\020\000\022\033\n"
  398. "\017repeated_sint64\030\006 \003(\022B\002\020\000\022\034\n\020repeated_f"
  399. "ixed32\030\007 \003(\007B\002\020\000\022\034\n\020repeated_fixed64\030\010 \003"
  400. "(\006B\002\020\000\022\035\n\021repeated_sfixed32\030\t \003(\017B\002\020\000\022\035\n"
  401. "\021repeated_sfixed64\030\n \003(\020B\002\020\000\022\032\n\016repeated"
  402. "_float\030\013 \003(\002B\002\020\000\022\033\n\017repeated_double\030\014 \003("
  403. "\001B\002\020\000\022\031\n\rrepeated_bool\030\r \003(\010B\002\020\000\022P\n\024repe"
  404. "ated_nested_enum\030\016 \003(\0162..proto3_arena_un"
  405. "ittest.TestAllTypes.NestedEnumB\002\020\000\"\307\001\n\022N"
  406. "estedTestAllTypes\0228\n\005child\030\001 \001(\0132).proto"
  407. "3_arena_unittest.NestedTestAllTypes\0224\n\007p"
  408. "ayload\030\002 \001(\0132#.proto3_arena_unittest.Tes"
  409. "tAllTypes\022A\n\016repeated_child\030\003 \003(\0132).prot"
  410. "o3_arena_unittest.NestedTestAllTypes\"\033\n\016"
  411. "ForeignMessage\022\t\n\001c\030\001 \001(\005\"\022\n\020TestEmptyMe"
  412. "ssage*R\n\013ForeignEnum\022\020\n\014FOREIGN_ZERO\020\000\022\017"
  413. "\n\013FOREIGN_FOO\020\004\022\017\n\013FOREIGN_BAR\020\005\022\017\n\013FORE"
  414. "IGN_BAZ\020\006B\003\370\001\001b\006proto3"
  415. };
  416. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  417. descriptor, 3622);
  418. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  419. "google/protobuf/unittest_proto3_arena.proto", &protobuf_RegisterTypes);
  420. ::protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::AddDescriptors();
  421. }
  422. void AddDescriptors() {
  423. static ::google::protobuf::internal::once_flag once;
  424. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  425. }
  426. // Force AddDescriptors() to be called at dynamic initialization time.
  427. struct StaticDescriptorInitializer {
  428. StaticDescriptorInitializer() {
  429. AddDescriptors();
  430. }
  431. } static_descriptor_initializer;
  432. } // namespace protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto
  433. namespace proto3_arena_unittest {
  434. const ::google::protobuf::EnumDescriptor* TestAllTypes_NestedEnum_descriptor() {
  435. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  436. return protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_enum_descriptors[0];
  437. }
  438. bool TestAllTypes_NestedEnum_IsValid(int value) {
  439. switch (value) {
  440. case -1:
  441. case 0:
  442. case 1:
  443. case 2:
  444. case 3:
  445. return true;
  446. default:
  447. return false;
  448. }
  449. }
  450. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  451. const TestAllTypes_NestedEnum TestAllTypes::ZERO;
  452. const TestAllTypes_NestedEnum TestAllTypes::FOO;
  453. const TestAllTypes_NestedEnum TestAllTypes::BAR;
  454. const TestAllTypes_NestedEnum TestAllTypes::BAZ;
  455. const TestAllTypes_NestedEnum TestAllTypes::NEG;
  456. const TestAllTypes_NestedEnum TestAllTypes::NestedEnum_MIN;
  457. const TestAllTypes_NestedEnum TestAllTypes::NestedEnum_MAX;
  458. const int TestAllTypes::NestedEnum_ARRAYSIZE;
  459. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  460. const ::google::protobuf::EnumDescriptor* ForeignEnum_descriptor() {
  461. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  462. return protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_enum_descriptors[1];
  463. }
  464. bool ForeignEnum_IsValid(int value) {
  465. switch (value) {
  466. case 0:
  467. case 4:
  468. case 5:
  469. case 6:
  470. return true;
  471. default:
  472. return false;
  473. }
  474. }
  475. // ===================================================================
  476. void TestAllTypes_NestedMessage::InitAsDefaultInstance() {
  477. }
  478. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  479. const int TestAllTypes_NestedMessage::kBbFieldNumber;
  480. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  481. TestAllTypes_NestedMessage::TestAllTypes_NestedMessage()
  482. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  483. ::google::protobuf::internal::InitSCC(
  484. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes_NestedMessage.base);
  485. SharedCtor();
  486. // @@protoc_insertion_point(constructor:proto3_arena_unittest.TestAllTypes.NestedMessage)
  487. }
  488. TestAllTypes_NestedMessage::TestAllTypes_NestedMessage(::google::protobuf::Arena* arena)
  489. : ::google::protobuf::Message(),
  490. _internal_metadata_(arena) {
  491. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes_NestedMessage.base);
  492. SharedCtor();
  493. RegisterArenaDtor(arena);
  494. // @@protoc_insertion_point(arena_constructor:proto3_arena_unittest.TestAllTypes.NestedMessage)
  495. }
  496. TestAllTypes_NestedMessage::TestAllTypes_NestedMessage(const TestAllTypes_NestedMessage& from)
  497. : ::google::protobuf::Message(),
  498. _internal_metadata_(NULL) {
  499. _internal_metadata_.MergeFrom(from._internal_metadata_);
  500. bb_ = from.bb_;
  501. // @@protoc_insertion_point(copy_constructor:proto3_arena_unittest.TestAllTypes.NestedMessage)
  502. }
  503. void TestAllTypes_NestedMessage::SharedCtor() {
  504. bb_ = 0;
  505. }
  506. TestAllTypes_NestedMessage::~TestAllTypes_NestedMessage() {
  507. // @@protoc_insertion_point(destructor:proto3_arena_unittest.TestAllTypes.NestedMessage)
  508. SharedDtor();
  509. }
  510. void TestAllTypes_NestedMessage::SharedDtor() {
  511. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  512. }
  513. void TestAllTypes_NestedMessage::ArenaDtor(void* object) {
  514. TestAllTypes_NestedMessage* _this = reinterpret_cast< TestAllTypes_NestedMessage* >(object);
  515. (void)_this;
  516. }
  517. void TestAllTypes_NestedMessage::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  518. }
  519. void TestAllTypes_NestedMessage::SetCachedSize(int size) const {
  520. _cached_size_.Set(size);
  521. }
  522. const ::google::protobuf::Descriptor* TestAllTypes_NestedMessage::descriptor() {
  523. ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  524. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  525. }
  526. const TestAllTypes_NestedMessage& TestAllTypes_NestedMessage::default_instance() {
  527. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes_NestedMessage.base);
  528. return *internal_default_instance();
  529. }
  530. void TestAllTypes_NestedMessage::Clear() {
  531. // @@protoc_insertion_point(message_clear_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  532. ::google::protobuf::uint32 cached_has_bits = 0;
  533. // Prevent compiler warnings about cached_has_bits being unused
  534. (void) cached_has_bits;
  535. bb_ = 0;
  536. _internal_metadata_.Clear();
  537. }
  538. bool TestAllTypes_NestedMessage::MergePartialFromCodedStream(
  539. ::google::protobuf::io::CodedInputStream* input) {
  540. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  541. ::google::protobuf::uint32 tag;
  542. // @@protoc_insertion_point(parse_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  543. for (;;) {
  544. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  545. tag = p.first;
  546. if (!p.second) goto handle_unusual;
  547. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  548. // int32 bb = 1;
  549. case 1: {
  550. if (static_cast< ::google::protobuf::uint8>(tag) ==
  551. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  552. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  553. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  554. input, &bb_)));
  555. } else {
  556. goto handle_unusual;
  557. }
  558. break;
  559. }
  560. default: {
  561. handle_unusual:
  562. if (tag == 0) {
  563. goto success;
  564. }
  565. DO_(::google::protobuf::internal::WireFormat::SkipField(
  566. input, tag, _internal_metadata_.mutable_unknown_fields()));
  567. break;
  568. }
  569. }
  570. }
  571. success:
  572. // @@protoc_insertion_point(parse_success:proto3_arena_unittest.TestAllTypes.NestedMessage)
  573. return true;
  574. failure:
  575. // @@protoc_insertion_point(parse_failure:proto3_arena_unittest.TestAllTypes.NestedMessage)
  576. return false;
  577. #undef DO_
  578. }
  579. void TestAllTypes_NestedMessage::SerializeWithCachedSizes(
  580. ::google::protobuf::io::CodedOutputStream* output) const {
  581. // @@protoc_insertion_point(serialize_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  582. ::google::protobuf::uint32 cached_has_bits = 0;
  583. (void) cached_has_bits;
  584. // int32 bb = 1;
  585. if (this->bb() != 0) {
  586. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->bb(), output);
  587. }
  588. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  589. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  590. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  591. }
  592. // @@protoc_insertion_point(serialize_end:proto3_arena_unittest.TestAllTypes.NestedMessage)
  593. }
  594. ::google::protobuf::uint8* TestAllTypes_NestedMessage::InternalSerializeWithCachedSizesToArray(
  595. bool deterministic, ::google::protobuf::uint8* target) const {
  596. (void)deterministic; // Unused
  597. // @@protoc_insertion_point(serialize_to_array_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  598. ::google::protobuf::uint32 cached_has_bits = 0;
  599. (void) cached_has_bits;
  600. // int32 bb = 1;
  601. if (this->bb() != 0) {
  602. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->bb(), target);
  603. }
  604. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  605. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  606. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  607. }
  608. // @@protoc_insertion_point(serialize_to_array_end:proto3_arena_unittest.TestAllTypes.NestedMessage)
  609. return target;
  610. }
  611. size_t TestAllTypes_NestedMessage::ByteSizeLong() const {
  612. // @@protoc_insertion_point(message_byte_size_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  613. size_t total_size = 0;
  614. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  615. total_size +=
  616. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  617. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  618. }
  619. // int32 bb = 1;
  620. if (this->bb() != 0) {
  621. total_size += 1 +
  622. ::google::protobuf::internal::WireFormatLite::Int32Size(
  623. this->bb());
  624. }
  625. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  626. SetCachedSize(cached_size);
  627. return total_size;
  628. }
  629. void TestAllTypes_NestedMessage::MergeFrom(const ::google::protobuf::Message& from) {
  630. // @@protoc_insertion_point(generalized_merge_from_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  631. GOOGLE_DCHECK_NE(&from, this);
  632. const TestAllTypes_NestedMessage* source =
  633. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes_NestedMessage>(
  634. &from);
  635. if (source == NULL) {
  636. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_arena_unittest.TestAllTypes.NestedMessage)
  637. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  638. } else {
  639. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_arena_unittest.TestAllTypes.NestedMessage)
  640. MergeFrom(*source);
  641. }
  642. }
  643. void TestAllTypes_NestedMessage::MergeFrom(const TestAllTypes_NestedMessage& from) {
  644. // @@protoc_insertion_point(class_specific_merge_from_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  645. GOOGLE_DCHECK_NE(&from, this);
  646. _internal_metadata_.MergeFrom(from._internal_metadata_);
  647. ::google::protobuf::uint32 cached_has_bits = 0;
  648. (void) cached_has_bits;
  649. if (from.bb() != 0) {
  650. set_bb(from.bb());
  651. }
  652. }
  653. void TestAllTypes_NestedMessage::CopyFrom(const ::google::protobuf::Message& from) {
  654. // @@protoc_insertion_point(generalized_copy_from_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  655. if (&from == this) return;
  656. Clear();
  657. MergeFrom(from);
  658. }
  659. void TestAllTypes_NestedMessage::CopyFrom(const TestAllTypes_NestedMessage& from) {
  660. // @@protoc_insertion_point(class_specific_copy_from_start:proto3_arena_unittest.TestAllTypes.NestedMessage)
  661. if (&from == this) return;
  662. Clear();
  663. MergeFrom(from);
  664. }
  665. bool TestAllTypes_NestedMessage::IsInitialized() const {
  666. return true;
  667. }
  668. void TestAllTypes_NestedMessage::Swap(TestAllTypes_NestedMessage* other) {
  669. if (other == this) return;
  670. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  671. InternalSwap(other);
  672. } else {
  673. TestAllTypes_NestedMessage* temp = New(GetArenaNoVirtual());
  674. temp->MergeFrom(*other);
  675. other->CopyFrom(*this);
  676. InternalSwap(temp);
  677. if (GetArenaNoVirtual() == NULL) {
  678. delete temp;
  679. }
  680. }
  681. }
  682. void TestAllTypes_NestedMessage::UnsafeArenaSwap(TestAllTypes_NestedMessage* other) {
  683. if (other == this) return;
  684. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  685. InternalSwap(other);
  686. }
  687. void TestAllTypes_NestedMessage::InternalSwap(TestAllTypes_NestedMessage* other) {
  688. using std::swap;
  689. swap(bb_, other->bb_);
  690. _internal_metadata_.Swap(&other->_internal_metadata_);
  691. }
  692. ::google::protobuf::Metadata TestAllTypes_NestedMessage::GetMetadata() const {
  693. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  694. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  695. }
  696. // ===================================================================
  697. void TestAllTypes::InitAsDefaultInstance() {
  698. ::proto3_arena_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_nested_message_ = const_cast< ::proto3_arena_unittest::TestAllTypes_NestedMessage*>(
  699. ::proto3_arena_unittest::TestAllTypes_NestedMessage::internal_default_instance());
  700. ::proto3_arena_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_foreign_message_ = const_cast< ::proto3_arena_unittest::ForeignMessage*>(
  701. ::proto3_arena_unittest::ForeignMessage::internal_default_instance());
  702. ::proto3_arena_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_import_message_ = const_cast< ::protobuf_unittest_import::ImportMessage*>(
  703. ::protobuf_unittest_import::ImportMessage::internal_default_instance());
  704. ::proto3_arena_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_public_import_message_ = const_cast< ::protobuf_unittest_import::PublicImportMessage*>(
  705. ::protobuf_unittest_import::PublicImportMessage::internal_default_instance());
  706. ::proto3_arena_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_lazy_message_ = const_cast< ::proto3_arena_unittest::TestAllTypes_NestedMessage*>(
  707. ::proto3_arena_unittest::TestAllTypes_NestedMessage::internal_default_instance());
  708. ::proto3_arena_unittest::_TestAllTypes_default_instance_._instance.get_mutable()->optional_lazy_import_message_ = const_cast< ::protobuf_unittest_import::ImportMessage*>(
  709. ::protobuf_unittest_import::ImportMessage::internal_default_instance());
  710. ::proto3_arena_unittest::_TestAllTypes_default_instance_.oneof_uint32_ = 0u;
  711. ::proto3_arena_unittest::_TestAllTypes_default_instance_.oneof_nested_message_ = const_cast< ::proto3_arena_unittest::TestAllTypes_NestedMessage*>(
  712. ::proto3_arena_unittest::TestAllTypes_NestedMessage::internal_default_instance());
  713. ::proto3_arena_unittest::_TestAllTypes_default_instance_.oneof_string_.UnsafeSetDefault(
  714. &::google::protobuf::internal::GetEmptyStringAlreadyInited());
  715. ::proto3_arena_unittest::_TestAllTypes_default_instance_.oneof_bytes_.UnsafeSetDefault(
  716. &::google::protobuf::internal::GetEmptyStringAlreadyInited());
  717. }
  718. void TestAllTypes::unsafe_arena_set_allocated_optional_nested_message(
  719. ::proto3_arena_unittest::TestAllTypes_NestedMessage* optional_nested_message) {
  720. if (GetArenaNoVirtual() == NULL) {
  721. delete optional_nested_message_;
  722. }
  723. optional_nested_message_ = optional_nested_message;
  724. if (optional_nested_message) {
  725. } else {
  726. }
  727. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.TestAllTypes.optional_nested_message)
  728. }
  729. void TestAllTypes::unsafe_arena_set_allocated_optional_foreign_message(
  730. ::proto3_arena_unittest::ForeignMessage* optional_foreign_message) {
  731. if (GetArenaNoVirtual() == NULL) {
  732. delete optional_foreign_message_;
  733. }
  734. optional_foreign_message_ = optional_foreign_message;
  735. if (optional_foreign_message) {
  736. } else {
  737. }
  738. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.TestAllTypes.optional_foreign_message)
  739. }
  740. void TestAllTypes::unsafe_arena_set_allocated_optional_import_message(
  741. ::protobuf_unittest_import::ImportMessage* optional_import_message) {
  742. if (GetArenaNoVirtual() == NULL) {
  743. delete optional_import_message_;
  744. }
  745. optional_import_message_ = optional_import_message;
  746. if (optional_import_message) {
  747. } else {
  748. }
  749. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.TestAllTypes.optional_import_message)
  750. }
  751. void TestAllTypes::clear_optional_import_message() {
  752. if (GetArenaNoVirtual() == NULL && optional_import_message_ != NULL) {
  753. delete optional_import_message_;
  754. }
  755. optional_import_message_ = NULL;
  756. }
  757. void TestAllTypes::unsafe_arena_set_allocated_optional_public_import_message(
  758. ::protobuf_unittest_import::PublicImportMessage* optional_public_import_message) {
  759. if (GetArenaNoVirtual() == NULL) {
  760. delete optional_public_import_message_;
  761. }
  762. optional_public_import_message_ = optional_public_import_message;
  763. if (optional_public_import_message) {
  764. } else {
  765. }
  766. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.TestAllTypes.optional_public_import_message)
  767. }
  768. void TestAllTypes::clear_optional_public_import_message() {
  769. if (GetArenaNoVirtual() == NULL && optional_public_import_message_ != NULL) {
  770. delete optional_public_import_message_;
  771. }
  772. optional_public_import_message_ = NULL;
  773. }
  774. void TestAllTypes::unsafe_arena_set_allocated_optional_lazy_message(
  775. ::proto3_arena_unittest::TestAllTypes_NestedMessage* optional_lazy_message) {
  776. if (GetArenaNoVirtual() == NULL) {
  777. delete optional_lazy_message_;
  778. }
  779. optional_lazy_message_ = optional_lazy_message;
  780. if (optional_lazy_message) {
  781. } else {
  782. }
  783. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.TestAllTypes.optional_lazy_message)
  784. }
  785. void TestAllTypes::unsafe_arena_set_allocated_optional_lazy_import_message(
  786. ::protobuf_unittest_import::ImportMessage* optional_lazy_import_message) {
  787. if (GetArenaNoVirtual() == NULL) {
  788. delete optional_lazy_import_message_;
  789. }
  790. optional_lazy_import_message_ = optional_lazy_import_message;
  791. if (optional_lazy_import_message) {
  792. } else {
  793. }
  794. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.TestAllTypes.optional_lazy_import_message)
  795. }
  796. void TestAllTypes::clear_optional_lazy_import_message() {
  797. if (GetArenaNoVirtual() == NULL && optional_lazy_import_message_ != NULL) {
  798. delete optional_lazy_import_message_;
  799. }
  800. optional_lazy_import_message_ = NULL;
  801. }
  802. void TestAllTypes::clear_repeated_import_message() {
  803. repeated_import_message_.Clear();
  804. }
  805. void TestAllTypes::set_allocated_oneof_nested_message(::proto3_arena_unittest::TestAllTypes_NestedMessage* oneof_nested_message) {
  806. ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  807. clear_oneof_field();
  808. if (oneof_nested_message) {
  809. ::google::protobuf::Arena* submessage_arena =
  810. ::google::protobuf::Arena::GetArena(oneof_nested_message);
  811. if (message_arena != submessage_arena) {
  812. oneof_nested_message = ::google::protobuf::internal::GetOwnedMessage(
  813. message_arena, oneof_nested_message, submessage_arena);
  814. }
  815. set_has_oneof_nested_message();
  816. oneof_field_.oneof_nested_message_ = oneof_nested_message;
  817. }
  818. // @@protoc_insertion_point(field_set_allocated:proto3_arena_unittest.TestAllTypes.oneof_nested_message)
  819. }
  820. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  821. const int TestAllTypes::kOptionalInt32FieldNumber;
  822. const int TestAllTypes::kOptionalInt64FieldNumber;
  823. const int TestAllTypes::kOptionalUint32FieldNumber;
  824. const int TestAllTypes::kOptionalUint64FieldNumber;
  825. const int TestAllTypes::kOptionalSint32FieldNumber;
  826. const int TestAllTypes::kOptionalSint64FieldNumber;
  827. const int TestAllTypes::kOptionalFixed32FieldNumber;
  828. const int TestAllTypes::kOptionalFixed64FieldNumber;
  829. const int TestAllTypes::kOptionalSfixed32FieldNumber;
  830. const int TestAllTypes::kOptionalSfixed64FieldNumber;
  831. const int TestAllTypes::kOptionalFloatFieldNumber;
  832. const int TestAllTypes::kOptionalDoubleFieldNumber;
  833. const int TestAllTypes::kOptionalBoolFieldNumber;
  834. const int TestAllTypes::kOptionalStringFieldNumber;
  835. const int TestAllTypes::kOptionalBytesFieldNumber;
  836. const int TestAllTypes::kOptionalNestedMessageFieldNumber;
  837. const int TestAllTypes::kOptionalForeignMessageFieldNumber;
  838. const int TestAllTypes::kOptionalImportMessageFieldNumber;
  839. const int TestAllTypes::kOptionalNestedEnumFieldNumber;
  840. const int TestAllTypes::kOptionalForeignEnumFieldNumber;
  841. const int TestAllTypes::kOptionalStringPieceFieldNumber;
  842. const int TestAllTypes::kOptionalCordFieldNumber;
  843. const int TestAllTypes::kOptionalPublicImportMessageFieldNumber;
  844. const int TestAllTypes::kOptionalLazyMessageFieldNumber;
  845. const int TestAllTypes::kOptionalLazyImportMessageFieldNumber;
  846. const int TestAllTypes::kRepeatedInt32FieldNumber;
  847. const int TestAllTypes::kRepeatedInt64FieldNumber;
  848. const int TestAllTypes::kRepeatedUint32FieldNumber;
  849. const int TestAllTypes::kRepeatedUint64FieldNumber;
  850. const int TestAllTypes::kRepeatedSint32FieldNumber;
  851. const int TestAllTypes::kRepeatedSint64FieldNumber;
  852. const int TestAllTypes::kRepeatedFixed32FieldNumber;
  853. const int TestAllTypes::kRepeatedFixed64FieldNumber;
  854. const int TestAllTypes::kRepeatedSfixed32FieldNumber;
  855. const int TestAllTypes::kRepeatedSfixed64FieldNumber;
  856. const int TestAllTypes::kRepeatedFloatFieldNumber;
  857. const int TestAllTypes::kRepeatedDoubleFieldNumber;
  858. const int TestAllTypes::kRepeatedBoolFieldNumber;
  859. const int TestAllTypes::kRepeatedStringFieldNumber;
  860. const int TestAllTypes::kRepeatedBytesFieldNumber;
  861. const int TestAllTypes::kRepeatedNestedMessageFieldNumber;
  862. const int TestAllTypes::kRepeatedForeignMessageFieldNumber;
  863. const int TestAllTypes::kRepeatedImportMessageFieldNumber;
  864. const int TestAllTypes::kRepeatedNestedEnumFieldNumber;
  865. const int TestAllTypes::kRepeatedForeignEnumFieldNumber;
  866. const int TestAllTypes::kRepeatedStringPieceFieldNumber;
  867. const int TestAllTypes::kRepeatedCordFieldNumber;
  868. const int TestAllTypes::kRepeatedLazyMessageFieldNumber;
  869. const int TestAllTypes::kOneofUint32FieldNumber;
  870. const int TestAllTypes::kOneofNestedMessageFieldNumber;
  871. const int TestAllTypes::kOneofStringFieldNumber;
  872. const int TestAllTypes::kOneofBytesFieldNumber;
  873. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  874. TestAllTypes::TestAllTypes()
  875. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  876. ::google::protobuf::internal::InitSCC(
  877. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes.base);
  878. SharedCtor();
  879. // @@protoc_insertion_point(constructor:proto3_arena_unittest.TestAllTypes)
  880. }
  881. TestAllTypes::TestAllTypes(::google::protobuf::Arena* arena)
  882. : ::google::protobuf::Message(),
  883. _internal_metadata_(arena),
  884. repeated_int32_(arena),
  885. repeated_int64_(arena),
  886. repeated_uint32_(arena),
  887. repeated_uint64_(arena),
  888. repeated_sint32_(arena),
  889. repeated_sint64_(arena),
  890. repeated_fixed32_(arena),
  891. repeated_fixed64_(arena),
  892. repeated_sfixed32_(arena),
  893. repeated_sfixed64_(arena),
  894. repeated_float_(arena),
  895. repeated_double_(arena),
  896. repeated_bool_(arena),
  897. repeated_string_(arena),
  898. repeated_bytes_(arena),
  899. repeated_nested_message_(arena),
  900. repeated_foreign_message_(arena),
  901. repeated_import_message_(arena),
  902. repeated_nested_enum_(arena),
  903. repeated_foreign_enum_(arena),
  904. repeated_string_piece_(arena),
  905. repeated_cord_(arena),
  906. repeated_lazy_message_(arena) {
  907. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes.base);
  908. SharedCtor();
  909. RegisterArenaDtor(arena);
  910. // @@protoc_insertion_point(arena_constructor:proto3_arena_unittest.TestAllTypes)
  911. }
  912. TestAllTypes::TestAllTypes(const TestAllTypes& from)
  913. : ::google::protobuf::Message(),
  914. _internal_metadata_(NULL),
  915. repeated_int32_(from.repeated_int32_),
  916. repeated_int64_(from.repeated_int64_),
  917. repeated_uint32_(from.repeated_uint32_),
  918. repeated_uint64_(from.repeated_uint64_),
  919. repeated_sint32_(from.repeated_sint32_),
  920. repeated_sint64_(from.repeated_sint64_),
  921. repeated_fixed32_(from.repeated_fixed32_),
  922. repeated_fixed64_(from.repeated_fixed64_),
  923. repeated_sfixed32_(from.repeated_sfixed32_),
  924. repeated_sfixed64_(from.repeated_sfixed64_),
  925. repeated_float_(from.repeated_float_),
  926. repeated_double_(from.repeated_double_),
  927. repeated_bool_(from.repeated_bool_),
  928. repeated_string_(from.repeated_string_),
  929. repeated_bytes_(from.repeated_bytes_),
  930. repeated_nested_message_(from.repeated_nested_message_),
  931. repeated_foreign_message_(from.repeated_foreign_message_),
  932. repeated_import_message_(from.repeated_import_message_),
  933. repeated_nested_enum_(from.repeated_nested_enum_),
  934. repeated_foreign_enum_(from.repeated_foreign_enum_),
  935. repeated_string_piece_(from.repeated_string_piece_),
  936. repeated_cord_(from.repeated_cord_),
  937. repeated_lazy_message_(from.repeated_lazy_message_) {
  938. _internal_metadata_.MergeFrom(from._internal_metadata_);
  939. optional_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  940. if (from.optional_string().size() > 0) {
  941. optional_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string(),
  942. GetArenaNoVirtual());
  943. }
  944. optional_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  945. if (from.optional_bytes().size() > 0) {
  946. optional_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_bytes(),
  947. GetArenaNoVirtual());
  948. }
  949. optional_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  950. if (from.optional_string_piece().size() > 0) {
  951. optional_string_piece_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_string_piece(),
  952. GetArenaNoVirtual());
  953. }
  954. optional_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  955. if (from.optional_cord().size() > 0) {
  956. optional_cord_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.optional_cord(),
  957. GetArenaNoVirtual());
  958. }
  959. if (from.has_optional_nested_message()) {
  960. optional_nested_message_ = new ::proto3_arena_unittest::TestAllTypes_NestedMessage(*from.optional_nested_message_);
  961. } else {
  962. optional_nested_message_ = NULL;
  963. }
  964. if (from.has_optional_foreign_message()) {
  965. optional_foreign_message_ = new ::proto3_arena_unittest::ForeignMessage(*from.optional_foreign_message_);
  966. } else {
  967. optional_foreign_message_ = NULL;
  968. }
  969. if (from.has_optional_import_message()) {
  970. optional_import_message_ = new ::protobuf_unittest_import::ImportMessage(*from.optional_import_message_);
  971. } else {
  972. optional_import_message_ = NULL;
  973. }
  974. if (from.has_optional_public_import_message()) {
  975. optional_public_import_message_ = new ::protobuf_unittest_import::PublicImportMessage(*from.optional_public_import_message_);
  976. } else {
  977. optional_public_import_message_ = NULL;
  978. }
  979. if (from.has_optional_lazy_message()) {
  980. optional_lazy_message_ = new ::proto3_arena_unittest::TestAllTypes_NestedMessage(*from.optional_lazy_message_);
  981. } else {
  982. optional_lazy_message_ = NULL;
  983. }
  984. if (from.has_optional_lazy_import_message()) {
  985. optional_lazy_import_message_ = new ::protobuf_unittest_import::ImportMessage(*from.optional_lazy_import_message_);
  986. } else {
  987. optional_lazy_import_message_ = NULL;
  988. }
  989. ::memcpy(&optional_int64_, &from.optional_int64_,
  990. static_cast<size_t>(reinterpret_cast<char*>(&optional_foreign_enum_) -
  991. reinterpret_cast<char*>(&optional_int64_)) + sizeof(optional_foreign_enum_));
  992. clear_has_oneof_field();
  993. switch (from.oneof_field_case()) {
  994. case kOneofUint32: {
  995. set_oneof_uint32(from.oneof_uint32());
  996. break;
  997. }
  998. case kOneofNestedMessage: {
  999. mutable_oneof_nested_message()->::proto3_arena_unittest::TestAllTypes_NestedMessage::MergeFrom(from.oneof_nested_message());
  1000. break;
  1001. }
  1002. case kOneofString: {
  1003. set_oneof_string(from.oneof_string());
  1004. break;
  1005. }
  1006. case kOneofBytes: {
  1007. set_oneof_bytes(from.oneof_bytes());
  1008. break;
  1009. }
  1010. case ONEOF_FIELD_NOT_SET: {
  1011. break;
  1012. }
  1013. }
  1014. // @@protoc_insertion_point(copy_constructor:proto3_arena_unittest.TestAllTypes)
  1015. }
  1016. void TestAllTypes::SharedCtor() {
  1017. optional_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1018. optional_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1019. optional_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1020. optional_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1021. ::memset(&optional_nested_message_, 0, static_cast<size_t>(
  1022. reinterpret_cast<char*>(&optional_foreign_enum_) -
  1023. reinterpret_cast<char*>(&optional_nested_message_)) + sizeof(optional_foreign_enum_));
  1024. clear_has_oneof_field();
  1025. }
  1026. TestAllTypes::~TestAllTypes() {
  1027. // @@protoc_insertion_point(destructor:proto3_arena_unittest.TestAllTypes)
  1028. SharedDtor();
  1029. }
  1030. void TestAllTypes::SharedDtor() {
  1031. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  1032. optional_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1033. optional_bytes_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1034. optional_string_piece_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1035. optional_cord_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1036. if (this != internal_default_instance()) delete optional_nested_message_;
  1037. if (this != internal_default_instance()) delete optional_foreign_message_;
  1038. if (this != internal_default_instance()) delete optional_import_message_;
  1039. if (this != internal_default_instance()) delete optional_public_import_message_;
  1040. if (this != internal_default_instance()) delete optional_lazy_message_;
  1041. if (this != internal_default_instance()) delete optional_lazy_import_message_;
  1042. if (has_oneof_field()) {
  1043. clear_oneof_field();
  1044. }
  1045. }
  1046. void TestAllTypes::ArenaDtor(void* object) {
  1047. TestAllTypes* _this = reinterpret_cast< TestAllTypes* >(object);
  1048. (void)_this;
  1049. }
  1050. void TestAllTypes::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  1051. }
  1052. void TestAllTypes::SetCachedSize(int size) const {
  1053. _cached_size_.Set(size);
  1054. }
  1055. const ::google::protobuf::Descriptor* TestAllTypes::descriptor() {
  1056. ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  1057. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1058. }
  1059. const TestAllTypes& TestAllTypes::default_instance() {
  1060. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestAllTypes.base);
  1061. return *internal_default_instance();
  1062. }
  1063. void TestAllTypes::clear_oneof_field() {
  1064. // @@protoc_insertion_point(one_of_clear_start:proto3_arena_unittest.TestAllTypes)
  1065. switch (oneof_field_case()) {
  1066. case kOneofUint32: {
  1067. // No need to clear
  1068. break;
  1069. }
  1070. case kOneofNestedMessage: {
  1071. if (GetArenaNoVirtual() == NULL) {
  1072. delete oneof_field_.oneof_nested_message_;
  1073. }
  1074. break;
  1075. }
  1076. case kOneofString: {
  1077. oneof_field_.oneof_string_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1078. GetArenaNoVirtual());
  1079. break;
  1080. }
  1081. case kOneofBytes: {
  1082. oneof_field_.oneof_bytes_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1083. GetArenaNoVirtual());
  1084. break;
  1085. }
  1086. case ONEOF_FIELD_NOT_SET: {
  1087. break;
  1088. }
  1089. }
  1090. _oneof_case_[0] = ONEOF_FIELD_NOT_SET;
  1091. }
  1092. void TestAllTypes::Clear() {
  1093. // @@protoc_insertion_point(message_clear_start:proto3_arena_unittest.TestAllTypes)
  1094. ::google::protobuf::uint32 cached_has_bits = 0;
  1095. // Prevent compiler warnings about cached_has_bits being unused
  1096. (void) cached_has_bits;
  1097. repeated_int32_.Clear();
  1098. repeated_int64_.Clear();
  1099. repeated_uint32_.Clear();
  1100. repeated_uint64_.Clear();
  1101. repeated_sint32_.Clear();
  1102. repeated_sint64_.Clear();
  1103. repeated_fixed32_.Clear();
  1104. repeated_fixed64_.Clear();
  1105. repeated_sfixed32_.Clear();
  1106. repeated_sfixed64_.Clear();
  1107. repeated_float_.Clear();
  1108. repeated_double_.Clear();
  1109. repeated_bool_.Clear();
  1110. repeated_string_.Clear();
  1111. repeated_bytes_.Clear();
  1112. repeated_nested_message_.Clear();
  1113. repeated_foreign_message_.Clear();
  1114. repeated_import_message_.Clear();
  1115. repeated_nested_enum_.Clear();
  1116. repeated_foreign_enum_.Clear();
  1117. repeated_string_piece_.Clear();
  1118. repeated_cord_.Clear();
  1119. repeated_lazy_message_.Clear();
  1120. optional_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  1121. optional_bytes_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  1122. optional_string_piece_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  1123. optional_cord_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  1124. if (GetArenaNoVirtual() == NULL && optional_nested_message_ != NULL) {
  1125. delete optional_nested_message_;
  1126. }
  1127. optional_nested_message_ = NULL;
  1128. if (GetArenaNoVirtual() == NULL && optional_foreign_message_ != NULL) {
  1129. delete optional_foreign_message_;
  1130. }
  1131. optional_foreign_message_ = NULL;
  1132. if (GetArenaNoVirtual() == NULL && optional_import_message_ != NULL) {
  1133. delete optional_import_message_;
  1134. }
  1135. optional_import_message_ = NULL;
  1136. if (GetArenaNoVirtual() == NULL && optional_public_import_message_ != NULL) {
  1137. delete optional_public_import_message_;
  1138. }
  1139. optional_public_import_message_ = NULL;
  1140. if (GetArenaNoVirtual() == NULL && optional_lazy_message_ != NULL) {
  1141. delete optional_lazy_message_;
  1142. }
  1143. optional_lazy_message_ = NULL;
  1144. if (GetArenaNoVirtual() == NULL && optional_lazy_import_message_ != NULL) {
  1145. delete optional_lazy_import_message_;
  1146. }
  1147. optional_lazy_import_message_ = NULL;
  1148. ::memset(&optional_int64_, 0, static_cast<size_t>(
  1149. reinterpret_cast<char*>(&optional_foreign_enum_) -
  1150. reinterpret_cast<char*>(&optional_int64_)) + sizeof(optional_foreign_enum_));
  1151. clear_oneof_field();
  1152. _internal_metadata_.Clear();
  1153. }
  1154. bool TestAllTypes::MergePartialFromCodedStream(
  1155. ::google::protobuf::io::CodedInputStream* input) {
  1156. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1157. ::google::protobuf::uint32 tag;
  1158. // @@protoc_insertion_point(parse_start:proto3_arena_unittest.TestAllTypes)
  1159. for (;;) {
  1160. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  1161. tag = p.first;
  1162. if (!p.second) goto handle_unusual;
  1163. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1164. // int32 optional_int32 = 1;
  1165. case 1: {
  1166. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1167. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  1168. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1169. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1170. input, &optional_int32_)));
  1171. } else {
  1172. goto handle_unusual;
  1173. }
  1174. break;
  1175. }
  1176. // int64 optional_int64 = 2;
  1177. case 2: {
  1178. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1179. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  1180. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1181. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  1182. input, &optional_int64_)));
  1183. } else {
  1184. goto handle_unusual;
  1185. }
  1186. break;
  1187. }
  1188. // uint32 optional_uint32 = 3;
  1189. case 3: {
  1190. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1191. static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
  1192. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1193. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1194. input, &optional_uint32_)));
  1195. } else {
  1196. goto handle_unusual;
  1197. }
  1198. break;
  1199. }
  1200. // uint64 optional_uint64 = 4;
  1201. case 4: {
  1202. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1203. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  1204. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1205. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  1206. input, &optional_uint64_)));
  1207. } else {
  1208. goto handle_unusual;
  1209. }
  1210. break;
  1211. }
  1212. // sint32 optional_sint32 = 5;
  1213. case 5: {
  1214. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1215. static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  1216. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1217. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  1218. input, &optional_sint32_)));
  1219. } else {
  1220. goto handle_unusual;
  1221. }
  1222. break;
  1223. }
  1224. // sint64 optional_sint64 = 6;
  1225. case 6: {
  1226. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1227. static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
  1228. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1229. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  1230. input, &optional_sint64_)));
  1231. } else {
  1232. goto handle_unusual;
  1233. }
  1234. break;
  1235. }
  1236. // fixed32 optional_fixed32 = 7;
  1237. case 7: {
  1238. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1239. static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
  1240. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1241. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  1242. input, &optional_fixed32_)));
  1243. } else {
  1244. goto handle_unusual;
  1245. }
  1246. break;
  1247. }
  1248. // fixed64 optional_fixed64 = 8;
  1249. case 8: {
  1250. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1251. static_cast< ::google::protobuf::uint8>(65u /* 65 & 0xFF */)) {
  1252. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1253. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  1254. input, &optional_fixed64_)));
  1255. } else {
  1256. goto handle_unusual;
  1257. }
  1258. break;
  1259. }
  1260. // sfixed32 optional_sfixed32 = 9;
  1261. case 9: {
  1262. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1263. static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
  1264. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1265. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  1266. input, &optional_sfixed32_)));
  1267. } else {
  1268. goto handle_unusual;
  1269. }
  1270. break;
  1271. }
  1272. // sfixed64 optional_sfixed64 = 10;
  1273. case 10: {
  1274. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1275. static_cast< ::google::protobuf::uint8>(81u /* 81 & 0xFF */)) {
  1276. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1277. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  1278. input, &optional_sfixed64_)));
  1279. } else {
  1280. goto handle_unusual;
  1281. }
  1282. break;
  1283. }
  1284. // float optional_float = 11;
  1285. case 11: {
  1286. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1287. static_cast< ::google::protobuf::uint8>(93u /* 93 & 0xFF */)) {
  1288. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1289. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  1290. input, &optional_float_)));
  1291. } else {
  1292. goto handle_unusual;
  1293. }
  1294. break;
  1295. }
  1296. // double optional_double = 12;
  1297. case 12: {
  1298. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1299. static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) {
  1300. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1301. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  1302. input, &optional_double_)));
  1303. } else {
  1304. goto handle_unusual;
  1305. }
  1306. break;
  1307. }
  1308. // bool optional_bool = 13;
  1309. case 13: {
  1310. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1311. static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
  1312. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1313. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  1314. input, &optional_bool_)));
  1315. } else {
  1316. goto handle_unusual;
  1317. }
  1318. break;
  1319. }
  1320. // string optional_string = 14;
  1321. case 14: {
  1322. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1323. static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
  1324. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1325. input, this->mutable_optional_string()));
  1326. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1327. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  1328. ::google::protobuf::internal::WireFormatLite::PARSE,
  1329. "proto3_arena_unittest.TestAllTypes.optional_string"));
  1330. } else {
  1331. goto handle_unusual;
  1332. }
  1333. break;
  1334. }
  1335. // bytes optional_bytes = 15;
  1336. case 15: {
  1337. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1338. static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) {
  1339. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  1340. input, this->mutable_optional_bytes()));
  1341. } else {
  1342. goto handle_unusual;
  1343. }
  1344. break;
  1345. }
  1346. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  1347. case 18: {
  1348. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1349. static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) {
  1350. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1351. input, mutable_optional_nested_message()));
  1352. } else {
  1353. goto handle_unusual;
  1354. }
  1355. break;
  1356. }
  1357. // .proto3_arena_unittest.ForeignMessage optional_foreign_message = 19;
  1358. case 19: {
  1359. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1360. static_cast< ::google::protobuf::uint8>(154u /* 154 & 0xFF */)) {
  1361. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1362. input, mutable_optional_foreign_message()));
  1363. } else {
  1364. goto handle_unusual;
  1365. }
  1366. break;
  1367. }
  1368. // .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  1369. case 20: {
  1370. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1371. static_cast< ::google::protobuf::uint8>(162u /* 162 & 0xFF */)) {
  1372. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1373. input, mutable_optional_import_message()));
  1374. } else {
  1375. goto handle_unusual;
  1376. }
  1377. break;
  1378. }
  1379. // .proto3_arena_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  1380. case 21: {
  1381. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1382. static_cast< ::google::protobuf::uint8>(168u /* 168 & 0xFF */)) {
  1383. int value;
  1384. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1385. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1386. input, &value)));
  1387. set_optional_nested_enum(static_cast< ::proto3_arena_unittest::TestAllTypes_NestedEnum >(value));
  1388. } else {
  1389. goto handle_unusual;
  1390. }
  1391. break;
  1392. }
  1393. // .proto3_arena_unittest.ForeignEnum optional_foreign_enum = 22;
  1394. case 22: {
  1395. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1396. static_cast< ::google::protobuf::uint8>(176u /* 176 & 0xFF */)) {
  1397. int value;
  1398. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1399. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1400. input, &value)));
  1401. set_optional_foreign_enum(static_cast< ::proto3_arena_unittest::ForeignEnum >(value));
  1402. } else {
  1403. goto handle_unusual;
  1404. }
  1405. break;
  1406. }
  1407. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  1408. case 24: {
  1409. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1410. static_cast< ::google::protobuf::uint8>(194u /* 194 & 0xFF */)) {
  1411. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1412. input, this->mutable_optional_string_piece()));
  1413. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1414. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  1415. ::google::protobuf::internal::WireFormatLite::PARSE,
  1416. "proto3_arena_unittest.TestAllTypes.optional_string_piece"));
  1417. } else {
  1418. goto handle_unusual;
  1419. }
  1420. break;
  1421. }
  1422. // string optional_cord = 25 [ctype = CORD];
  1423. case 25: {
  1424. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1425. static_cast< ::google::protobuf::uint8>(202u /* 202 & 0xFF */)) {
  1426. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1427. input, this->mutable_optional_cord()));
  1428. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1429. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  1430. ::google::protobuf::internal::WireFormatLite::PARSE,
  1431. "proto3_arena_unittest.TestAllTypes.optional_cord"));
  1432. } else {
  1433. goto handle_unusual;
  1434. }
  1435. break;
  1436. }
  1437. // .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  1438. case 26: {
  1439. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1440. static_cast< ::google::protobuf::uint8>(210u /* 210 & 0xFF */)) {
  1441. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1442. input, mutable_optional_public_import_message()));
  1443. } else {
  1444. goto handle_unusual;
  1445. }
  1446. break;
  1447. }
  1448. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_lazy_message = 27 [lazy = true];
  1449. case 27: {
  1450. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1451. static_cast< ::google::protobuf::uint8>(218u /* 218 & 0xFF */)) {
  1452. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1453. input, mutable_optional_lazy_message()));
  1454. } else {
  1455. goto handle_unusual;
  1456. }
  1457. break;
  1458. }
  1459. // repeated int32 repeated_int32 = 31;
  1460. case 31: {
  1461. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1462. static_cast< ::google::protobuf::uint8>(250u /* 250 & 0xFF */)) {
  1463. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1464. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1465. input, this->mutable_repeated_int32())));
  1466. } else if (
  1467. static_cast< ::google::protobuf::uint8>(tag) ==
  1468. static_cast< ::google::protobuf::uint8>(248u /* 248 & 0xFF */)) {
  1469. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1470. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1471. 2, 250u, input, this->mutable_repeated_int32())));
  1472. } else {
  1473. goto handle_unusual;
  1474. }
  1475. break;
  1476. }
  1477. // repeated int64 repeated_int64 = 32;
  1478. case 32: {
  1479. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1480. static_cast< ::google::protobuf::uint8>(2u /* 258 & 0xFF */)) {
  1481. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1482. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  1483. input, this->mutable_repeated_int64())));
  1484. } else if (
  1485. static_cast< ::google::protobuf::uint8>(tag) ==
  1486. static_cast< ::google::protobuf::uint8>(0u /* 256 & 0xFF */)) {
  1487. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1488. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  1489. 2, 258u, input, this->mutable_repeated_int64())));
  1490. } else {
  1491. goto handle_unusual;
  1492. }
  1493. break;
  1494. }
  1495. // repeated uint32 repeated_uint32 = 33;
  1496. case 33: {
  1497. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1498. static_cast< ::google::protobuf::uint8>(10u /* 266 & 0xFF */)) {
  1499. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1500. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1501. input, this->mutable_repeated_uint32())));
  1502. } else if (
  1503. static_cast< ::google::protobuf::uint8>(tag) ==
  1504. static_cast< ::google::protobuf::uint8>(8u /* 264 & 0xFF */)) {
  1505. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1506. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1507. 2, 266u, input, this->mutable_repeated_uint32())));
  1508. } else {
  1509. goto handle_unusual;
  1510. }
  1511. break;
  1512. }
  1513. // repeated uint64 repeated_uint64 = 34;
  1514. case 34: {
  1515. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1516. static_cast< ::google::protobuf::uint8>(18u /* 274 & 0xFF */)) {
  1517. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1518. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  1519. input, this->mutable_repeated_uint64())));
  1520. } else if (
  1521. static_cast< ::google::protobuf::uint8>(tag) ==
  1522. static_cast< ::google::protobuf::uint8>(16u /* 272 & 0xFF */)) {
  1523. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1524. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  1525. 2, 274u, input, this->mutable_repeated_uint64())));
  1526. } else {
  1527. goto handle_unusual;
  1528. }
  1529. break;
  1530. }
  1531. // repeated sint32 repeated_sint32 = 35;
  1532. case 35: {
  1533. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1534. static_cast< ::google::protobuf::uint8>(26u /* 282 & 0xFF */)) {
  1535. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1536. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  1537. input, this->mutable_repeated_sint32())));
  1538. } else if (
  1539. static_cast< ::google::protobuf::uint8>(tag) ==
  1540. static_cast< ::google::protobuf::uint8>(24u /* 280 & 0xFF */)) {
  1541. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1542. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  1543. 2, 282u, input, this->mutable_repeated_sint32())));
  1544. } else {
  1545. goto handle_unusual;
  1546. }
  1547. break;
  1548. }
  1549. // repeated sint64 repeated_sint64 = 36;
  1550. case 36: {
  1551. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1552. static_cast< ::google::protobuf::uint8>(34u /* 290 & 0xFF */)) {
  1553. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1554. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  1555. input, this->mutable_repeated_sint64())));
  1556. } else if (
  1557. static_cast< ::google::protobuf::uint8>(tag) ==
  1558. static_cast< ::google::protobuf::uint8>(32u /* 288 & 0xFF */)) {
  1559. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1560. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  1561. 2, 290u, input, this->mutable_repeated_sint64())));
  1562. } else {
  1563. goto handle_unusual;
  1564. }
  1565. break;
  1566. }
  1567. // repeated fixed32 repeated_fixed32 = 37;
  1568. case 37: {
  1569. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1570. static_cast< ::google::protobuf::uint8>(42u /* 298 & 0xFF */)) {
  1571. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1572. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  1573. input, this->mutable_repeated_fixed32())));
  1574. } else if (
  1575. static_cast< ::google::protobuf::uint8>(tag) ==
  1576. static_cast< ::google::protobuf::uint8>(45u /* 301 & 0xFF */)) {
  1577. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1578. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  1579. 2, 298u, input, this->mutable_repeated_fixed32())));
  1580. } else {
  1581. goto handle_unusual;
  1582. }
  1583. break;
  1584. }
  1585. // repeated fixed64 repeated_fixed64 = 38;
  1586. case 38: {
  1587. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1588. static_cast< ::google::protobuf::uint8>(50u /* 306 & 0xFF */)) {
  1589. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1590. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  1591. input, this->mutable_repeated_fixed64())));
  1592. } else if (
  1593. static_cast< ::google::protobuf::uint8>(tag) ==
  1594. static_cast< ::google::protobuf::uint8>(49u /* 305 & 0xFF */)) {
  1595. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1596. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  1597. 2, 306u, input, this->mutable_repeated_fixed64())));
  1598. } else {
  1599. goto handle_unusual;
  1600. }
  1601. break;
  1602. }
  1603. // repeated sfixed32 repeated_sfixed32 = 39;
  1604. case 39: {
  1605. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1606. static_cast< ::google::protobuf::uint8>(58u /* 314 & 0xFF */)) {
  1607. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1608. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  1609. input, this->mutable_repeated_sfixed32())));
  1610. } else if (
  1611. static_cast< ::google::protobuf::uint8>(tag) ==
  1612. static_cast< ::google::protobuf::uint8>(61u /* 317 & 0xFF */)) {
  1613. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1614. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  1615. 2, 314u, input, this->mutable_repeated_sfixed32())));
  1616. } else {
  1617. goto handle_unusual;
  1618. }
  1619. break;
  1620. }
  1621. // repeated sfixed64 repeated_sfixed64 = 40;
  1622. case 40: {
  1623. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1624. static_cast< ::google::protobuf::uint8>(66u /* 322 & 0xFF */)) {
  1625. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1626. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  1627. input, this->mutable_repeated_sfixed64())));
  1628. } else if (
  1629. static_cast< ::google::protobuf::uint8>(tag) ==
  1630. static_cast< ::google::protobuf::uint8>(65u /* 321 & 0xFF */)) {
  1631. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1632. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  1633. 2, 322u, input, this->mutable_repeated_sfixed64())));
  1634. } else {
  1635. goto handle_unusual;
  1636. }
  1637. break;
  1638. }
  1639. // repeated float repeated_float = 41;
  1640. case 41: {
  1641. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1642. static_cast< ::google::protobuf::uint8>(74u /* 330 & 0xFF */)) {
  1643. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1644. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  1645. input, this->mutable_repeated_float())));
  1646. } else if (
  1647. static_cast< ::google::protobuf::uint8>(tag) ==
  1648. static_cast< ::google::protobuf::uint8>(77u /* 333 & 0xFF */)) {
  1649. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1650. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  1651. 2, 330u, input, this->mutable_repeated_float())));
  1652. } else {
  1653. goto handle_unusual;
  1654. }
  1655. break;
  1656. }
  1657. // repeated double repeated_double = 42;
  1658. case 42: {
  1659. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1660. static_cast< ::google::protobuf::uint8>(82u /* 338 & 0xFF */)) {
  1661. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1662. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  1663. input, this->mutable_repeated_double())));
  1664. } else if (
  1665. static_cast< ::google::protobuf::uint8>(tag) ==
  1666. static_cast< ::google::protobuf::uint8>(81u /* 337 & 0xFF */)) {
  1667. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1668. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  1669. 2, 338u, input, this->mutable_repeated_double())));
  1670. } else {
  1671. goto handle_unusual;
  1672. }
  1673. break;
  1674. }
  1675. // repeated bool repeated_bool = 43;
  1676. case 43: {
  1677. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1678. static_cast< ::google::protobuf::uint8>(90u /* 346 & 0xFF */)) {
  1679. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  1680. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  1681. input, this->mutable_repeated_bool())));
  1682. } else if (
  1683. static_cast< ::google::protobuf::uint8>(tag) ==
  1684. static_cast< ::google::protobuf::uint8>(88u /* 344 & 0xFF */)) {
  1685. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  1686. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  1687. 2, 346u, input, this->mutable_repeated_bool())));
  1688. } else {
  1689. goto handle_unusual;
  1690. }
  1691. break;
  1692. }
  1693. // repeated string repeated_string = 44;
  1694. case 44: {
  1695. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1696. static_cast< ::google::protobuf::uint8>(98u /* 354 & 0xFF */)) {
  1697. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1698. input, this->add_repeated_string()));
  1699. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1700. this->repeated_string(this->repeated_string_size() - 1).data(),
  1701. static_cast<int>(this->repeated_string(this->repeated_string_size() - 1).length()),
  1702. ::google::protobuf::internal::WireFormatLite::PARSE,
  1703. "proto3_arena_unittest.TestAllTypes.repeated_string"));
  1704. } else {
  1705. goto handle_unusual;
  1706. }
  1707. break;
  1708. }
  1709. // repeated bytes repeated_bytes = 45;
  1710. case 45: {
  1711. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1712. static_cast< ::google::protobuf::uint8>(106u /* 362 & 0xFF */)) {
  1713. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  1714. input, this->add_repeated_bytes()));
  1715. } else {
  1716. goto handle_unusual;
  1717. }
  1718. break;
  1719. }
  1720. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  1721. case 48: {
  1722. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1723. static_cast< ::google::protobuf::uint8>(130u /* 386 & 0xFF */)) {
  1724. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1725. input, add_repeated_nested_message()));
  1726. } else {
  1727. goto handle_unusual;
  1728. }
  1729. break;
  1730. }
  1731. // repeated .proto3_arena_unittest.ForeignMessage repeated_foreign_message = 49;
  1732. case 49: {
  1733. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1734. static_cast< ::google::protobuf::uint8>(138u /* 394 & 0xFF */)) {
  1735. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1736. input, add_repeated_foreign_message()));
  1737. } else {
  1738. goto handle_unusual;
  1739. }
  1740. break;
  1741. }
  1742. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  1743. case 50: {
  1744. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1745. static_cast< ::google::protobuf::uint8>(146u /* 402 & 0xFF */)) {
  1746. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1747. input, add_repeated_import_message()));
  1748. } else {
  1749. goto handle_unusual;
  1750. }
  1751. break;
  1752. }
  1753. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  1754. case 51: {
  1755. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1756. static_cast< ::google::protobuf::uint8>(154u /* 410 & 0xFF */)) {
  1757. ::google::protobuf::uint32 length;
  1758. DO_(input->ReadVarint32(&length));
  1759. ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
  1760. while (input->BytesUntilLimit() > 0) {
  1761. int value;
  1762. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1763. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1764. input, &value)));
  1765. add_repeated_nested_enum(static_cast< ::proto3_arena_unittest::TestAllTypes_NestedEnum >(value));
  1766. }
  1767. input->PopLimit(limit);
  1768. } else if (
  1769. static_cast< ::google::protobuf::uint8>(tag) ==
  1770. static_cast< ::google::protobuf::uint8>(152u /* 408 & 0xFF */)) {
  1771. int value;
  1772. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1773. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1774. input, &value)));
  1775. add_repeated_nested_enum(static_cast< ::proto3_arena_unittest::TestAllTypes_NestedEnum >(value));
  1776. } else {
  1777. goto handle_unusual;
  1778. }
  1779. break;
  1780. }
  1781. // repeated .proto3_arena_unittest.ForeignEnum repeated_foreign_enum = 52;
  1782. case 52: {
  1783. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1784. static_cast< ::google::protobuf::uint8>(162u /* 418 & 0xFF */)) {
  1785. ::google::protobuf::uint32 length;
  1786. DO_(input->ReadVarint32(&length));
  1787. ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
  1788. while (input->BytesUntilLimit() > 0) {
  1789. int value;
  1790. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1791. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1792. input, &value)));
  1793. add_repeated_foreign_enum(static_cast< ::proto3_arena_unittest::ForeignEnum >(value));
  1794. }
  1795. input->PopLimit(limit);
  1796. } else if (
  1797. static_cast< ::google::protobuf::uint8>(tag) ==
  1798. static_cast< ::google::protobuf::uint8>(160u /* 416 & 0xFF */)) {
  1799. int value;
  1800. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1801. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  1802. input, &value)));
  1803. add_repeated_foreign_enum(static_cast< ::proto3_arena_unittest::ForeignEnum >(value));
  1804. } else {
  1805. goto handle_unusual;
  1806. }
  1807. break;
  1808. }
  1809. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  1810. case 54: {
  1811. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1812. static_cast< ::google::protobuf::uint8>(178u /* 434 & 0xFF */)) {
  1813. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1814. input, this->add_repeated_string_piece()));
  1815. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1816. this->repeated_string_piece(this->repeated_string_piece_size() - 1).data(),
  1817. static_cast<int>(this->repeated_string_piece(this->repeated_string_piece_size() - 1).length()),
  1818. ::google::protobuf::internal::WireFormatLite::PARSE,
  1819. "proto3_arena_unittest.TestAllTypes.repeated_string_piece"));
  1820. } else {
  1821. goto handle_unusual;
  1822. }
  1823. break;
  1824. }
  1825. // repeated string repeated_cord = 55 [ctype = CORD];
  1826. case 55: {
  1827. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1828. static_cast< ::google::protobuf::uint8>(186u /* 442 & 0xFF */)) {
  1829. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1830. input, this->add_repeated_cord()));
  1831. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1832. this->repeated_cord(this->repeated_cord_size() - 1).data(),
  1833. static_cast<int>(this->repeated_cord(this->repeated_cord_size() - 1).length()),
  1834. ::google::protobuf::internal::WireFormatLite::PARSE,
  1835. "proto3_arena_unittest.TestAllTypes.repeated_cord"));
  1836. } else {
  1837. goto handle_unusual;
  1838. }
  1839. break;
  1840. }
  1841. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  1842. case 57: {
  1843. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1844. static_cast< ::google::protobuf::uint8>(202u /* 458 & 0xFF */)) {
  1845. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1846. input, add_repeated_lazy_message()));
  1847. } else {
  1848. goto handle_unusual;
  1849. }
  1850. break;
  1851. }
  1852. // uint32 oneof_uint32 = 111;
  1853. case 111: {
  1854. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1855. static_cast< ::google::protobuf::uint8>(120u /* 888 & 0xFF */)) {
  1856. clear_oneof_field();
  1857. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1858. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  1859. input, &oneof_field_.oneof_uint32_)));
  1860. set_has_oneof_uint32();
  1861. } else {
  1862. goto handle_unusual;
  1863. }
  1864. break;
  1865. }
  1866. // .proto3_arena_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  1867. case 112: {
  1868. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1869. static_cast< ::google::protobuf::uint8>(130u /* 898 & 0xFF */)) {
  1870. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1871. input, mutable_oneof_nested_message()));
  1872. } else {
  1873. goto handle_unusual;
  1874. }
  1875. break;
  1876. }
  1877. // string oneof_string = 113;
  1878. case 113: {
  1879. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1880. static_cast< ::google::protobuf::uint8>(138u /* 906 & 0xFF */)) {
  1881. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1882. input, this->mutable_oneof_string()));
  1883. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1884. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  1885. ::google::protobuf::internal::WireFormatLite::PARSE,
  1886. "proto3_arena_unittest.TestAllTypes.oneof_string"));
  1887. } else {
  1888. goto handle_unusual;
  1889. }
  1890. break;
  1891. }
  1892. // bytes oneof_bytes = 114;
  1893. case 114: {
  1894. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1895. static_cast< ::google::protobuf::uint8>(146u /* 914 & 0xFF */)) {
  1896. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  1897. input, this->mutable_oneof_bytes()));
  1898. } else {
  1899. goto handle_unusual;
  1900. }
  1901. break;
  1902. }
  1903. // .protobuf_unittest_import.ImportMessage optional_lazy_import_message = 115 [lazy = true];
  1904. case 115: {
  1905. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1906. static_cast< ::google::protobuf::uint8>(154u /* 922 & 0xFF */)) {
  1907. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1908. input, mutable_optional_lazy_import_message()));
  1909. } else {
  1910. goto handle_unusual;
  1911. }
  1912. break;
  1913. }
  1914. default: {
  1915. handle_unusual:
  1916. if (tag == 0) {
  1917. goto success;
  1918. }
  1919. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1920. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1921. break;
  1922. }
  1923. }
  1924. }
  1925. success:
  1926. // @@protoc_insertion_point(parse_success:proto3_arena_unittest.TestAllTypes)
  1927. return true;
  1928. failure:
  1929. // @@protoc_insertion_point(parse_failure:proto3_arena_unittest.TestAllTypes)
  1930. return false;
  1931. #undef DO_
  1932. }
  1933. void TestAllTypes::SerializeWithCachedSizes(
  1934. ::google::protobuf::io::CodedOutputStream* output) const {
  1935. // @@protoc_insertion_point(serialize_start:proto3_arena_unittest.TestAllTypes)
  1936. ::google::protobuf::uint32 cached_has_bits = 0;
  1937. (void) cached_has_bits;
  1938. // int32 optional_int32 = 1;
  1939. if (this->optional_int32() != 0) {
  1940. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->optional_int32(), output);
  1941. }
  1942. // int64 optional_int64 = 2;
  1943. if (this->optional_int64() != 0) {
  1944. ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->optional_int64(), output);
  1945. }
  1946. // uint32 optional_uint32 = 3;
  1947. if (this->optional_uint32() != 0) {
  1948. ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->optional_uint32(), output);
  1949. }
  1950. // uint64 optional_uint64 = 4;
  1951. if (this->optional_uint64() != 0) {
  1952. ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->optional_uint64(), output);
  1953. }
  1954. // sint32 optional_sint32 = 5;
  1955. if (this->optional_sint32() != 0) {
  1956. ::google::protobuf::internal::WireFormatLite::WriteSInt32(5, this->optional_sint32(), output);
  1957. }
  1958. // sint64 optional_sint64 = 6;
  1959. if (this->optional_sint64() != 0) {
  1960. ::google::protobuf::internal::WireFormatLite::WriteSInt64(6, this->optional_sint64(), output);
  1961. }
  1962. // fixed32 optional_fixed32 = 7;
  1963. if (this->optional_fixed32() != 0) {
  1964. ::google::protobuf::internal::WireFormatLite::WriteFixed32(7, this->optional_fixed32(), output);
  1965. }
  1966. // fixed64 optional_fixed64 = 8;
  1967. if (this->optional_fixed64() != 0) {
  1968. ::google::protobuf::internal::WireFormatLite::WriteFixed64(8, this->optional_fixed64(), output);
  1969. }
  1970. // sfixed32 optional_sfixed32 = 9;
  1971. if (this->optional_sfixed32() != 0) {
  1972. ::google::protobuf::internal::WireFormatLite::WriteSFixed32(9, this->optional_sfixed32(), output);
  1973. }
  1974. // sfixed64 optional_sfixed64 = 10;
  1975. if (this->optional_sfixed64() != 0) {
  1976. ::google::protobuf::internal::WireFormatLite::WriteSFixed64(10, this->optional_sfixed64(), output);
  1977. }
  1978. // float optional_float = 11;
  1979. if (this->optional_float() != 0) {
  1980. ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->optional_float(), output);
  1981. }
  1982. // double optional_double = 12;
  1983. if (this->optional_double() != 0) {
  1984. ::google::protobuf::internal::WireFormatLite::WriteDouble(12, this->optional_double(), output);
  1985. }
  1986. // bool optional_bool = 13;
  1987. if (this->optional_bool() != 0) {
  1988. ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->optional_bool(), output);
  1989. }
  1990. // string optional_string = 14;
  1991. if (this->optional_string().size() > 0) {
  1992. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1993. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  1994. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1995. "proto3_arena_unittest.TestAllTypes.optional_string");
  1996. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1997. 14, this->optional_string(), output);
  1998. }
  1999. // bytes optional_bytes = 15;
  2000. if (this->optional_bytes().size() > 0) {
  2001. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  2002. 15, this->optional_bytes(), output);
  2003. }
  2004. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  2005. if (this->has_optional_nested_message()) {
  2006. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2007. 18, this->_internal_optional_nested_message(), output);
  2008. }
  2009. // .proto3_arena_unittest.ForeignMessage optional_foreign_message = 19;
  2010. if (this->has_optional_foreign_message()) {
  2011. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2012. 19, this->_internal_optional_foreign_message(), output);
  2013. }
  2014. // .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  2015. if (this->has_optional_import_message()) {
  2016. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2017. 20, this->_internal_optional_import_message(), output);
  2018. }
  2019. // .proto3_arena_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  2020. if (this->optional_nested_enum() != 0) {
  2021. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  2022. 21, this->optional_nested_enum(), output);
  2023. }
  2024. // .proto3_arena_unittest.ForeignEnum optional_foreign_enum = 22;
  2025. if (this->optional_foreign_enum() != 0) {
  2026. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  2027. 22, this->optional_foreign_enum(), output);
  2028. }
  2029. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  2030. if (this->optional_string_piece().size() > 0) {
  2031. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2032. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  2033. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2034. "proto3_arena_unittest.TestAllTypes.optional_string_piece");
  2035. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  2036. 24, this->optional_string_piece(), output);
  2037. }
  2038. // string optional_cord = 25 [ctype = CORD];
  2039. if (this->optional_cord().size() > 0) {
  2040. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2041. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  2042. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2043. "proto3_arena_unittest.TestAllTypes.optional_cord");
  2044. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  2045. 25, this->optional_cord(), output);
  2046. }
  2047. // .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  2048. if (this->has_optional_public_import_message()) {
  2049. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2050. 26, this->_internal_optional_public_import_message(), output);
  2051. }
  2052. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_lazy_message = 27 [lazy = true];
  2053. if (this->has_optional_lazy_message()) {
  2054. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2055. 27, this->_internal_optional_lazy_message(), output);
  2056. }
  2057. // repeated int32 repeated_int32 = 31;
  2058. if (this->repeated_int32_size() > 0) {
  2059. ::google::protobuf::internal::WireFormatLite::WriteTag(31, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2060. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2061. _repeated_int32_cached_byte_size_));
  2062. }
  2063. for (int i = 0, n = this->repeated_int32_size(); i < n; i++) {
  2064. ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
  2065. this->repeated_int32(i), output);
  2066. }
  2067. // repeated int64 repeated_int64 = 32;
  2068. if (this->repeated_int64_size() > 0) {
  2069. ::google::protobuf::internal::WireFormatLite::WriteTag(32, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2070. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2071. _repeated_int64_cached_byte_size_));
  2072. }
  2073. for (int i = 0, n = this->repeated_int64_size(); i < n; i++) {
  2074. ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
  2075. this->repeated_int64(i), output);
  2076. }
  2077. // repeated uint32 repeated_uint32 = 33;
  2078. if (this->repeated_uint32_size() > 0) {
  2079. ::google::protobuf::internal::WireFormatLite::WriteTag(33, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2080. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2081. _repeated_uint32_cached_byte_size_));
  2082. }
  2083. for (int i = 0, n = this->repeated_uint32_size(); i < n; i++) {
  2084. ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
  2085. this->repeated_uint32(i), output);
  2086. }
  2087. // repeated uint64 repeated_uint64 = 34;
  2088. if (this->repeated_uint64_size() > 0) {
  2089. ::google::protobuf::internal::WireFormatLite::WriteTag(34, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2090. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2091. _repeated_uint64_cached_byte_size_));
  2092. }
  2093. for (int i = 0, n = this->repeated_uint64_size(); i < n; i++) {
  2094. ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag(
  2095. this->repeated_uint64(i), output);
  2096. }
  2097. // repeated sint32 repeated_sint32 = 35;
  2098. if (this->repeated_sint32_size() > 0) {
  2099. ::google::protobuf::internal::WireFormatLite::WriteTag(35, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2100. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2101. _repeated_sint32_cached_byte_size_));
  2102. }
  2103. for (int i = 0, n = this->repeated_sint32_size(); i < n; i++) {
  2104. ::google::protobuf::internal::WireFormatLite::WriteSInt32NoTag(
  2105. this->repeated_sint32(i), output);
  2106. }
  2107. // repeated sint64 repeated_sint64 = 36;
  2108. if (this->repeated_sint64_size() > 0) {
  2109. ::google::protobuf::internal::WireFormatLite::WriteTag(36, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2110. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2111. _repeated_sint64_cached_byte_size_));
  2112. }
  2113. for (int i = 0, n = this->repeated_sint64_size(); i < n; i++) {
  2114. ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
  2115. this->repeated_sint64(i), output);
  2116. }
  2117. // repeated fixed32 repeated_fixed32 = 37;
  2118. if (this->repeated_fixed32_size() > 0) {
  2119. ::google::protobuf::internal::WireFormatLite::WriteTag(37, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2120. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2121. _repeated_fixed32_cached_byte_size_));
  2122. ::google::protobuf::internal::WireFormatLite::WriteFixed32Array(
  2123. this->repeated_fixed32().data(), this->repeated_fixed32_size(), output);
  2124. }
  2125. // repeated fixed64 repeated_fixed64 = 38;
  2126. if (this->repeated_fixed64_size() > 0) {
  2127. ::google::protobuf::internal::WireFormatLite::WriteTag(38, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2128. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2129. _repeated_fixed64_cached_byte_size_));
  2130. ::google::protobuf::internal::WireFormatLite::WriteFixed64Array(
  2131. this->repeated_fixed64().data(), this->repeated_fixed64_size(), output);
  2132. }
  2133. // repeated sfixed32 repeated_sfixed32 = 39;
  2134. if (this->repeated_sfixed32_size() > 0) {
  2135. ::google::protobuf::internal::WireFormatLite::WriteTag(39, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2136. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2137. _repeated_sfixed32_cached_byte_size_));
  2138. ::google::protobuf::internal::WireFormatLite::WriteSFixed32Array(
  2139. this->repeated_sfixed32().data(), this->repeated_sfixed32_size(), output);
  2140. }
  2141. // repeated sfixed64 repeated_sfixed64 = 40;
  2142. if (this->repeated_sfixed64_size() > 0) {
  2143. ::google::protobuf::internal::WireFormatLite::WriteTag(40, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2144. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2145. _repeated_sfixed64_cached_byte_size_));
  2146. ::google::protobuf::internal::WireFormatLite::WriteSFixed64Array(
  2147. this->repeated_sfixed64().data(), this->repeated_sfixed64_size(), output);
  2148. }
  2149. // repeated float repeated_float = 41;
  2150. if (this->repeated_float_size() > 0) {
  2151. ::google::protobuf::internal::WireFormatLite::WriteTag(41, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2152. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2153. _repeated_float_cached_byte_size_));
  2154. ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
  2155. this->repeated_float().data(), this->repeated_float_size(), output);
  2156. }
  2157. // repeated double repeated_double = 42;
  2158. if (this->repeated_double_size() > 0) {
  2159. ::google::protobuf::internal::WireFormatLite::WriteTag(42, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2160. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2161. _repeated_double_cached_byte_size_));
  2162. ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
  2163. this->repeated_double().data(), this->repeated_double_size(), output);
  2164. }
  2165. // repeated bool repeated_bool = 43;
  2166. if (this->repeated_bool_size() > 0) {
  2167. ::google::protobuf::internal::WireFormatLite::WriteTag(43, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  2168. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  2169. _repeated_bool_cached_byte_size_));
  2170. ::google::protobuf::internal::WireFormatLite::WriteBoolArray(
  2171. this->repeated_bool().data(), this->repeated_bool_size(), output);
  2172. }
  2173. // repeated string repeated_string = 44;
  2174. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  2175. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2176. this->repeated_string(i).data(), static_cast<int>(this->repeated_string(i).length()),
  2177. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2178. "proto3_arena_unittest.TestAllTypes.repeated_string");
  2179. ::google::protobuf::internal::WireFormatLite::WriteString(
  2180. 44, this->repeated_string(i), output);
  2181. }
  2182. // repeated bytes repeated_bytes = 45;
  2183. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  2184. ::google::protobuf::internal::WireFormatLite::WriteBytes(
  2185. 45, this->repeated_bytes(i), output);
  2186. }
  2187. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  2188. for (unsigned int i = 0,
  2189. n = static_cast<unsigned int>(this->repeated_nested_message_size()); i < n; i++) {
  2190. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2191. 48,
  2192. this->repeated_nested_message(static_cast<int>(i)),
  2193. output);
  2194. }
  2195. // repeated .proto3_arena_unittest.ForeignMessage repeated_foreign_message = 49;
  2196. for (unsigned int i = 0,
  2197. n = static_cast<unsigned int>(this->repeated_foreign_message_size()); i < n; i++) {
  2198. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2199. 49,
  2200. this->repeated_foreign_message(static_cast<int>(i)),
  2201. output);
  2202. }
  2203. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  2204. for (unsigned int i = 0,
  2205. n = static_cast<unsigned int>(this->repeated_import_message_size()); i < n; i++) {
  2206. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2207. 50,
  2208. this->repeated_import_message(static_cast<int>(i)),
  2209. output);
  2210. }
  2211. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  2212. if (this->repeated_nested_enum_size() > 0) {
  2213. ::google::protobuf::internal::WireFormatLite::WriteTag(
  2214. 51,
  2215. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2216. output);
  2217. output->WriteVarint32(
  2218. static_cast< ::google::protobuf::uint32>(_repeated_nested_enum_cached_byte_size_));
  2219. }
  2220. for (int i = 0, n = this->repeated_nested_enum_size(); i < n; i++) {
  2221. ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
  2222. this->repeated_nested_enum(i), output);
  2223. }
  2224. // repeated .proto3_arena_unittest.ForeignEnum repeated_foreign_enum = 52;
  2225. if (this->repeated_foreign_enum_size() > 0) {
  2226. ::google::protobuf::internal::WireFormatLite::WriteTag(
  2227. 52,
  2228. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2229. output);
  2230. output->WriteVarint32(
  2231. static_cast< ::google::protobuf::uint32>(_repeated_foreign_enum_cached_byte_size_));
  2232. }
  2233. for (int i = 0, n = this->repeated_foreign_enum_size(); i < n; i++) {
  2234. ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
  2235. this->repeated_foreign_enum(i), output);
  2236. }
  2237. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  2238. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  2239. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2240. this->repeated_string_piece(i).data(), static_cast<int>(this->repeated_string_piece(i).length()),
  2241. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2242. "proto3_arena_unittest.TestAllTypes.repeated_string_piece");
  2243. ::google::protobuf::internal::WireFormatLite::WriteString(
  2244. 54, this->repeated_string_piece(i), output);
  2245. }
  2246. // repeated string repeated_cord = 55 [ctype = CORD];
  2247. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  2248. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2249. this->repeated_cord(i).data(), static_cast<int>(this->repeated_cord(i).length()),
  2250. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2251. "proto3_arena_unittest.TestAllTypes.repeated_cord");
  2252. ::google::protobuf::internal::WireFormatLite::WriteString(
  2253. 55, this->repeated_cord(i), output);
  2254. }
  2255. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  2256. for (unsigned int i = 0,
  2257. n = static_cast<unsigned int>(this->repeated_lazy_message_size()); i < n; i++) {
  2258. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2259. 57,
  2260. this->repeated_lazy_message(static_cast<int>(i)),
  2261. output);
  2262. }
  2263. // uint32 oneof_uint32 = 111;
  2264. if (has_oneof_uint32()) {
  2265. ::google::protobuf::internal::WireFormatLite::WriteUInt32(111, this->oneof_uint32(), output);
  2266. }
  2267. // .proto3_arena_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  2268. if (has_oneof_nested_message()) {
  2269. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2270. 112, this->_internal_oneof_nested_message(), output);
  2271. }
  2272. // string oneof_string = 113;
  2273. if (has_oneof_string()) {
  2274. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2275. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  2276. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2277. "proto3_arena_unittest.TestAllTypes.oneof_string");
  2278. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  2279. 113, this->oneof_string(), output);
  2280. }
  2281. // bytes oneof_bytes = 114;
  2282. if (has_oneof_bytes()) {
  2283. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  2284. 114, this->oneof_bytes(), output);
  2285. }
  2286. // .protobuf_unittest_import.ImportMessage optional_lazy_import_message = 115 [lazy = true];
  2287. if (this->has_optional_lazy_import_message()) {
  2288. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  2289. 115, this->_internal_optional_lazy_import_message(), output);
  2290. }
  2291. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2292. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  2293. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  2294. }
  2295. // @@protoc_insertion_point(serialize_end:proto3_arena_unittest.TestAllTypes)
  2296. }
  2297. ::google::protobuf::uint8* TestAllTypes::InternalSerializeWithCachedSizesToArray(
  2298. bool deterministic, ::google::protobuf::uint8* target) const {
  2299. (void)deterministic; // Unused
  2300. // @@protoc_insertion_point(serialize_to_array_start:proto3_arena_unittest.TestAllTypes)
  2301. ::google::protobuf::uint32 cached_has_bits = 0;
  2302. (void) cached_has_bits;
  2303. // int32 optional_int32 = 1;
  2304. if (this->optional_int32() != 0) {
  2305. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->optional_int32(), target);
  2306. }
  2307. // int64 optional_int64 = 2;
  2308. if (this->optional_int64() != 0) {
  2309. target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->optional_int64(), target);
  2310. }
  2311. // uint32 optional_uint32 = 3;
  2312. if (this->optional_uint32() != 0) {
  2313. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->optional_uint32(), target);
  2314. }
  2315. // uint64 optional_uint64 = 4;
  2316. if (this->optional_uint64() != 0) {
  2317. target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->optional_uint64(), target);
  2318. }
  2319. // sint32 optional_sint32 = 5;
  2320. if (this->optional_sint32() != 0) {
  2321. target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(5, this->optional_sint32(), target);
  2322. }
  2323. // sint64 optional_sint64 = 6;
  2324. if (this->optional_sint64() != 0) {
  2325. target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(6, this->optional_sint64(), target);
  2326. }
  2327. // fixed32 optional_fixed32 = 7;
  2328. if (this->optional_fixed32() != 0) {
  2329. target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(7, this->optional_fixed32(), target);
  2330. }
  2331. // fixed64 optional_fixed64 = 8;
  2332. if (this->optional_fixed64() != 0) {
  2333. target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(8, this->optional_fixed64(), target);
  2334. }
  2335. // sfixed32 optional_sfixed32 = 9;
  2336. if (this->optional_sfixed32() != 0) {
  2337. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed32ToArray(9, this->optional_sfixed32(), target);
  2338. }
  2339. // sfixed64 optional_sfixed64 = 10;
  2340. if (this->optional_sfixed64() != 0) {
  2341. target = ::google::protobuf::internal::WireFormatLite::WriteSFixed64ToArray(10, this->optional_sfixed64(), target);
  2342. }
  2343. // float optional_float = 11;
  2344. if (this->optional_float() != 0) {
  2345. target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->optional_float(), target);
  2346. }
  2347. // double optional_double = 12;
  2348. if (this->optional_double() != 0) {
  2349. target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(12, this->optional_double(), target);
  2350. }
  2351. // bool optional_bool = 13;
  2352. if (this->optional_bool() != 0) {
  2353. target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(13, this->optional_bool(), target);
  2354. }
  2355. // string optional_string = 14;
  2356. if (this->optional_string().size() > 0) {
  2357. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2358. this->optional_string().data(), static_cast<int>(this->optional_string().length()),
  2359. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2360. "proto3_arena_unittest.TestAllTypes.optional_string");
  2361. target =
  2362. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2363. 14, this->optional_string(), target);
  2364. }
  2365. // bytes optional_bytes = 15;
  2366. if (this->optional_bytes().size() > 0) {
  2367. target =
  2368. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  2369. 15, this->optional_bytes(), target);
  2370. }
  2371. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  2372. if (this->has_optional_nested_message()) {
  2373. target = ::google::protobuf::internal::WireFormatLite::
  2374. InternalWriteMessageToArray(
  2375. 18, this->_internal_optional_nested_message(), deterministic, target);
  2376. }
  2377. // .proto3_arena_unittest.ForeignMessage optional_foreign_message = 19;
  2378. if (this->has_optional_foreign_message()) {
  2379. target = ::google::protobuf::internal::WireFormatLite::
  2380. InternalWriteMessageToArray(
  2381. 19, this->_internal_optional_foreign_message(), deterministic, target);
  2382. }
  2383. // .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  2384. if (this->has_optional_import_message()) {
  2385. target = ::google::protobuf::internal::WireFormatLite::
  2386. InternalWriteMessageToArray(
  2387. 20, this->_internal_optional_import_message(), deterministic, target);
  2388. }
  2389. // .proto3_arena_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  2390. if (this->optional_nested_enum() != 0) {
  2391. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  2392. 21, this->optional_nested_enum(), target);
  2393. }
  2394. // .proto3_arena_unittest.ForeignEnum optional_foreign_enum = 22;
  2395. if (this->optional_foreign_enum() != 0) {
  2396. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  2397. 22, this->optional_foreign_enum(), target);
  2398. }
  2399. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  2400. if (this->optional_string_piece().size() > 0) {
  2401. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2402. this->optional_string_piece().data(), static_cast<int>(this->optional_string_piece().length()),
  2403. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2404. "proto3_arena_unittest.TestAllTypes.optional_string_piece");
  2405. target =
  2406. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2407. 24, this->optional_string_piece(), target);
  2408. }
  2409. // string optional_cord = 25 [ctype = CORD];
  2410. if (this->optional_cord().size() > 0) {
  2411. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2412. this->optional_cord().data(), static_cast<int>(this->optional_cord().length()),
  2413. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2414. "proto3_arena_unittest.TestAllTypes.optional_cord");
  2415. target =
  2416. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2417. 25, this->optional_cord(), target);
  2418. }
  2419. // .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  2420. if (this->has_optional_public_import_message()) {
  2421. target = ::google::protobuf::internal::WireFormatLite::
  2422. InternalWriteMessageToArray(
  2423. 26, this->_internal_optional_public_import_message(), deterministic, target);
  2424. }
  2425. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_lazy_message = 27 [lazy = true];
  2426. if (this->has_optional_lazy_message()) {
  2427. target = ::google::protobuf::internal::WireFormatLite::
  2428. InternalWriteMessageToArray(
  2429. 27, this->_internal_optional_lazy_message(), deterministic, target);
  2430. }
  2431. // repeated int32 repeated_int32 = 31;
  2432. if (this->repeated_int32_size() > 0) {
  2433. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2434. 31,
  2435. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2436. target);
  2437. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2438. static_cast< ::google::protobuf::int32>(
  2439. _repeated_int32_cached_byte_size_), target);
  2440. target = ::google::protobuf::internal::WireFormatLite::
  2441. WriteInt32NoTagToArray(this->repeated_int32_, target);
  2442. }
  2443. // repeated int64 repeated_int64 = 32;
  2444. if (this->repeated_int64_size() > 0) {
  2445. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2446. 32,
  2447. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2448. target);
  2449. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2450. static_cast< ::google::protobuf::int32>(
  2451. _repeated_int64_cached_byte_size_), target);
  2452. target = ::google::protobuf::internal::WireFormatLite::
  2453. WriteInt64NoTagToArray(this->repeated_int64_, target);
  2454. }
  2455. // repeated uint32 repeated_uint32 = 33;
  2456. if (this->repeated_uint32_size() > 0) {
  2457. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2458. 33,
  2459. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2460. target);
  2461. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2462. static_cast< ::google::protobuf::int32>(
  2463. _repeated_uint32_cached_byte_size_), target);
  2464. target = ::google::protobuf::internal::WireFormatLite::
  2465. WriteUInt32NoTagToArray(this->repeated_uint32_, target);
  2466. }
  2467. // repeated uint64 repeated_uint64 = 34;
  2468. if (this->repeated_uint64_size() > 0) {
  2469. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2470. 34,
  2471. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2472. target);
  2473. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2474. static_cast< ::google::protobuf::int32>(
  2475. _repeated_uint64_cached_byte_size_), target);
  2476. target = ::google::protobuf::internal::WireFormatLite::
  2477. WriteUInt64NoTagToArray(this->repeated_uint64_, target);
  2478. }
  2479. // repeated sint32 repeated_sint32 = 35;
  2480. if (this->repeated_sint32_size() > 0) {
  2481. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2482. 35,
  2483. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2484. target);
  2485. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2486. static_cast< ::google::protobuf::int32>(
  2487. _repeated_sint32_cached_byte_size_), target);
  2488. target = ::google::protobuf::internal::WireFormatLite::
  2489. WriteSInt32NoTagToArray(this->repeated_sint32_, target);
  2490. }
  2491. // repeated sint64 repeated_sint64 = 36;
  2492. if (this->repeated_sint64_size() > 0) {
  2493. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2494. 36,
  2495. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2496. target);
  2497. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2498. static_cast< ::google::protobuf::int32>(
  2499. _repeated_sint64_cached_byte_size_), target);
  2500. target = ::google::protobuf::internal::WireFormatLite::
  2501. WriteSInt64NoTagToArray(this->repeated_sint64_, target);
  2502. }
  2503. // repeated fixed32 repeated_fixed32 = 37;
  2504. if (this->repeated_fixed32_size() > 0) {
  2505. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2506. 37,
  2507. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2508. target);
  2509. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2510. static_cast< ::google::protobuf::int32>(
  2511. _repeated_fixed32_cached_byte_size_), target);
  2512. target = ::google::protobuf::internal::WireFormatLite::
  2513. WriteFixed32NoTagToArray(this->repeated_fixed32_, target);
  2514. }
  2515. // repeated fixed64 repeated_fixed64 = 38;
  2516. if (this->repeated_fixed64_size() > 0) {
  2517. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2518. 38,
  2519. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2520. target);
  2521. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2522. static_cast< ::google::protobuf::int32>(
  2523. _repeated_fixed64_cached_byte_size_), target);
  2524. target = ::google::protobuf::internal::WireFormatLite::
  2525. WriteFixed64NoTagToArray(this->repeated_fixed64_, target);
  2526. }
  2527. // repeated sfixed32 repeated_sfixed32 = 39;
  2528. if (this->repeated_sfixed32_size() > 0) {
  2529. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2530. 39,
  2531. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2532. target);
  2533. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2534. static_cast< ::google::protobuf::int32>(
  2535. _repeated_sfixed32_cached_byte_size_), target);
  2536. target = ::google::protobuf::internal::WireFormatLite::
  2537. WriteSFixed32NoTagToArray(this->repeated_sfixed32_, target);
  2538. }
  2539. // repeated sfixed64 repeated_sfixed64 = 40;
  2540. if (this->repeated_sfixed64_size() > 0) {
  2541. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2542. 40,
  2543. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2544. target);
  2545. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2546. static_cast< ::google::protobuf::int32>(
  2547. _repeated_sfixed64_cached_byte_size_), target);
  2548. target = ::google::protobuf::internal::WireFormatLite::
  2549. WriteSFixed64NoTagToArray(this->repeated_sfixed64_, target);
  2550. }
  2551. // repeated float repeated_float = 41;
  2552. if (this->repeated_float_size() > 0) {
  2553. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2554. 41,
  2555. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2556. target);
  2557. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2558. static_cast< ::google::protobuf::int32>(
  2559. _repeated_float_cached_byte_size_), target);
  2560. target = ::google::protobuf::internal::WireFormatLite::
  2561. WriteFloatNoTagToArray(this->repeated_float_, target);
  2562. }
  2563. // repeated double repeated_double = 42;
  2564. if (this->repeated_double_size() > 0) {
  2565. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2566. 42,
  2567. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2568. target);
  2569. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2570. static_cast< ::google::protobuf::int32>(
  2571. _repeated_double_cached_byte_size_), target);
  2572. target = ::google::protobuf::internal::WireFormatLite::
  2573. WriteDoubleNoTagToArray(this->repeated_double_, target);
  2574. }
  2575. // repeated bool repeated_bool = 43;
  2576. if (this->repeated_bool_size() > 0) {
  2577. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2578. 43,
  2579. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2580. target);
  2581. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  2582. static_cast< ::google::protobuf::int32>(
  2583. _repeated_bool_cached_byte_size_), target);
  2584. target = ::google::protobuf::internal::WireFormatLite::
  2585. WriteBoolNoTagToArray(this->repeated_bool_, target);
  2586. }
  2587. // repeated string repeated_string = 44;
  2588. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  2589. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2590. this->repeated_string(i).data(), static_cast<int>(this->repeated_string(i).length()),
  2591. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2592. "proto3_arena_unittest.TestAllTypes.repeated_string");
  2593. target = ::google::protobuf::internal::WireFormatLite::
  2594. WriteStringToArray(44, this->repeated_string(i), target);
  2595. }
  2596. // repeated bytes repeated_bytes = 45;
  2597. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  2598. target = ::google::protobuf::internal::WireFormatLite::
  2599. WriteBytesToArray(45, this->repeated_bytes(i), target);
  2600. }
  2601. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  2602. for (unsigned int i = 0,
  2603. n = static_cast<unsigned int>(this->repeated_nested_message_size()); i < n; i++) {
  2604. target = ::google::protobuf::internal::WireFormatLite::
  2605. InternalWriteMessageToArray(
  2606. 48, this->repeated_nested_message(static_cast<int>(i)), deterministic, target);
  2607. }
  2608. // repeated .proto3_arena_unittest.ForeignMessage repeated_foreign_message = 49;
  2609. for (unsigned int i = 0,
  2610. n = static_cast<unsigned int>(this->repeated_foreign_message_size()); i < n; i++) {
  2611. target = ::google::protobuf::internal::WireFormatLite::
  2612. InternalWriteMessageToArray(
  2613. 49, this->repeated_foreign_message(static_cast<int>(i)), deterministic, target);
  2614. }
  2615. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  2616. for (unsigned int i = 0,
  2617. n = static_cast<unsigned int>(this->repeated_import_message_size()); i < n; i++) {
  2618. target = ::google::protobuf::internal::WireFormatLite::
  2619. InternalWriteMessageToArray(
  2620. 50, this->repeated_import_message(static_cast<int>(i)), deterministic, target);
  2621. }
  2622. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  2623. if (this->repeated_nested_enum_size() > 0) {
  2624. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2625. 51,
  2626. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2627. target);
  2628. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
  2629. _repeated_nested_enum_cached_byte_size_), target);
  2630. target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
  2631. this->repeated_nested_enum_, target);
  2632. }
  2633. // repeated .proto3_arena_unittest.ForeignEnum repeated_foreign_enum = 52;
  2634. if (this->repeated_foreign_enum_size() > 0) {
  2635. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  2636. 52,
  2637. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  2638. target);
  2639. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
  2640. _repeated_foreign_enum_cached_byte_size_), target);
  2641. target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
  2642. this->repeated_foreign_enum_, target);
  2643. }
  2644. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  2645. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  2646. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2647. this->repeated_string_piece(i).data(), static_cast<int>(this->repeated_string_piece(i).length()),
  2648. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2649. "proto3_arena_unittest.TestAllTypes.repeated_string_piece");
  2650. target = ::google::protobuf::internal::WireFormatLite::
  2651. WriteStringToArray(54, this->repeated_string_piece(i), target);
  2652. }
  2653. // repeated string repeated_cord = 55 [ctype = CORD];
  2654. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  2655. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2656. this->repeated_cord(i).data(), static_cast<int>(this->repeated_cord(i).length()),
  2657. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2658. "proto3_arena_unittest.TestAllTypes.repeated_cord");
  2659. target = ::google::protobuf::internal::WireFormatLite::
  2660. WriteStringToArray(55, this->repeated_cord(i), target);
  2661. }
  2662. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  2663. for (unsigned int i = 0,
  2664. n = static_cast<unsigned int>(this->repeated_lazy_message_size()); i < n; i++) {
  2665. target = ::google::protobuf::internal::WireFormatLite::
  2666. InternalWriteMessageToArray(
  2667. 57, this->repeated_lazy_message(static_cast<int>(i)), deterministic, target);
  2668. }
  2669. // uint32 oneof_uint32 = 111;
  2670. if (has_oneof_uint32()) {
  2671. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(111, this->oneof_uint32(), target);
  2672. }
  2673. // .proto3_arena_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  2674. if (has_oneof_nested_message()) {
  2675. target = ::google::protobuf::internal::WireFormatLite::
  2676. InternalWriteMessageToArray(
  2677. 112, this->_internal_oneof_nested_message(), deterministic, target);
  2678. }
  2679. // string oneof_string = 113;
  2680. if (has_oneof_string()) {
  2681. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  2682. this->oneof_string().data(), static_cast<int>(this->oneof_string().length()),
  2683. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  2684. "proto3_arena_unittest.TestAllTypes.oneof_string");
  2685. target =
  2686. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  2687. 113, this->oneof_string(), target);
  2688. }
  2689. // bytes oneof_bytes = 114;
  2690. if (has_oneof_bytes()) {
  2691. target =
  2692. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  2693. 114, this->oneof_bytes(), target);
  2694. }
  2695. // .protobuf_unittest_import.ImportMessage optional_lazy_import_message = 115 [lazy = true];
  2696. if (this->has_optional_lazy_import_message()) {
  2697. target = ::google::protobuf::internal::WireFormatLite::
  2698. InternalWriteMessageToArray(
  2699. 115, this->_internal_optional_lazy_import_message(), deterministic, target);
  2700. }
  2701. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2702. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  2703. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  2704. }
  2705. // @@protoc_insertion_point(serialize_to_array_end:proto3_arena_unittest.TestAllTypes)
  2706. return target;
  2707. }
  2708. size_t TestAllTypes::ByteSizeLong() const {
  2709. // @@protoc_insertion_point(message_byte_size_start:proto3_arena_unittest.TestAllTypes)
  2710. size_t total_size = 0;
  2711. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2712. total_size +=
  2713. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  2714. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  2715. }
  2716. // repeated int32 repeated_int32 = 31;
  2717. {
  2718. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2719. Int32Size(this->repeated_int32_);
  2720. if (data_size > 0) {
  2721. total_size += 2 +
  2722. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2723. static_cast< ::google::protobuf::int32>(data_size));
  2724. }
  2725. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2726. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2727. _repeated_int32_cached_byte_size_ = cached_size;
  2728. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2729. total_size += data_size;
  2730. }
  2731. // repeated int64 repeated_int64 = 32;
  2732. {
  2733. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2734. Int64Size(this->repeated_int64_);
  2735. if (data_size > 0) {
  2736. total_size += 2 +
  2737. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2738. static_cast< ::google::protobuf::int32>(data_size));
  2739. }
  2740. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2741. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2742. _repeated_int64_cached_byte_size_ = cached_size;
  2743. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2744. total_size += data_size;
  2745. }
  2746. // repeated uint32 repeated_uint32 = 33;
  2747. {
  2748. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2749. UInt32Size(this->repeated_uint32_);
  2750. if (data_size > 0) {
  2751. total_size += 2 +
  2752. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2753. static_cast< ::google::protobuf::int32>(data_size));
  2754. }
  2755. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2756. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2757. _repeated_uint32_cached_byte_size_ = cached_size;
  2758. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2759. total_size += data_size;
  2760. }
  2761. // repeated uint64 repeated_uint64 = 34;
  2762. {
  2763. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2764. UInt64Size(this->repeated_uint64_);
  2765. if (data_size > 0) {
  2766. total_size += 2 +
  2767. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2768. static_cast< ::google::protobuf::int32>(data_size));
  2769. }
  2770. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2771. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2772. _repeated_uint64_cached_byte_size_ = cached_size;
  2773. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2774. total_size += data_size;
  2775. }
  2776. // repeated sint32 repeated_sint32 = 35;
  2777. {
  2778. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2779. SInt32Size(this->repeated_sint32_);
  2780. if (data_size > 0) {
  2781. total_size += 2 +
  2782. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2783. static_cast< ::google::protobuf::int32>(data_size));
  2784. }
  2785. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2786. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2787. _repeated_sint32_cached_byte_size_ = cached_size;
  2788. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2789. total_size += data_size;
  2790. }
  2791. // repeated sint64 repeated_sint64 = 36;
  2792. {
  2793. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  2794. SInt64Size(this->repeated_sint64_);
  2795. if (data_size > 0) {
  2796. total_size += 2 +
  2797. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2798. static_cast< ::google::protobuf::int32>(data_size));
  2799. }
  2800. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2801. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2802. _repeated_sint64_cached_byte_size_ = cached_size;
  2803. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2804. total_size += data_size;
  2805. }
  2806. // repeated fixed32 repeated_fixed32 = 37;
  2807. {
  2808. unsigned int count = static_cast<unsigned int>(this->repeated_fixed32_size());
  2809. size_t data_size = 4UL * count;
  2810. if (data_size > 0) {
  2811. total_size += 2 +
  2812. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2813. static_cast< ::google::protobuf::int32>(data_size));
  2814. }
  2815. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2816. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2817. _repeated_fixed32_cached_byte_size_ = cached_size;
  2818. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2819. total_size += data_size;
  2820. }
  2821. // repeated fixed64 repeated_fixed64 = 38;
  2822. {
  2823. unsigned int count = static_cast<unsigned int>(this->repeated_fixed64_size());
  2824. size_t data_size = 8UL * count;
  2825. if (data_size > 0) {
  2826. total_size += 2 +
  2827. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2828. static_cast< ::google::protobuf::int32>(data_size));
  2829. }
  2830. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2831. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2832. _repeated_fixed64_cached_byte_size_ = cached_size;
  2833. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2834. total_size += data_size;
  2835. }
  2836. // repeated sfixed32 repeated_sfixed32 = 39;
  2837. {
  2838. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed32_size());
  2839. size_t data_size = 4UL * count;
  2840. if (data_size > 0) {
  2841. total_size += 2 +
  2842. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2843. static_cast< ::google::protobuf::int32>(data_size));
  2844. }
  2845. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2846. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2847. _repeated_sfixed32_cached_byte_size_ = cached_size;
  2848. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2849. total_size += data_size;
  2850. }
  2851. // repeated sfixed64 repeated_sfixed64 = 40;
  2852. {
  2853. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed64_size());
  2854. size_t data_size = 8UL * count;
  2855. if (data_size > 0) {
  2856. total_size += 2 +
  2857. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2858. static_cast< ::google::protobuf::int32>(data_size));
  2859. }
  2860. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2861. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2862. _repeated_sfixed64_cached_byte_size_ = cached_size;
  2863. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2864. total_size += data_size;
  2865. }
  2866. // repeated float repeated_float = 41;
  2867. {
  2868. unsigned int count = static_cast<unsigned int>(this->repeated_float_size());
  2869. size_t data_size = 4UL * count;
  2870. if (data_size > 0) {
  2871. total_size += 2 +
  2872. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2873. static_cast< ::google::protobuf::int32>(data_size));
  2874. }
  2875. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2876. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2877. _repeated_float_cached_byte_size_ = cached_size;
  2878. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2879. total_size += data_size;
  2880. }
  2881. // repeated double repeated_double = 42;
  2882. {
  2883. unsigned int count = static_cast<unsigned int>(this->repeated_double_size());
  2884. size_t data_size = 8UL * count;
  2885. if (data_size > 0) {
  2886. total_size += 2 +
  2887. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2888. static_cast< ::google::protobuf::int32>(data_size));
  2889. }
  2890. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2891. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2892. _repeated_double_cached_byte_size_ = cached_size;
  2893. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2894. total_size += data_size;
  2895. }
  2896. // repeated bool repeated_bool = 43;
  2897. {
  2898. unsigned int count = static_cast<unsigned int>(this->repeated_bool_size());
  2899. size_t data_size = 1UL * count;
  2900. if (data_size > 0) {
  2901. total_size += 2 +
  2902. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2903. static_cast< ::google::protobuf::int32>(data_size));
  2904. }
  2905. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2906. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2907. _repeated_bool_cached_byte_size_ = cached_size;
  2908. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2909. total_size += data_size;
  2910. }
  2911. // repeated string repeated_string = 44;
  2912. total_size += 2 *
  2913. ::google::protobuf::internal::FromIntSize(this->repeated_string_size());
  2914. for (int i = 0, n = this->repeated_string_size(); i < n; i++) {
  2915. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  2916. this->repeated_string(i));
  2917. }
  2918. // repeated bytes repeated_bytes = 45;
  2919. total_size += 2 *
  2920. ::google::protobuf::internal::FromIntSize(this->repeated_bytes_size());
  2921. for (int i = 0, n = this->repeated_bytes_size(); i < n; i++) {
  2922. total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
  2923. this->repeated_bytes(i));
  2924. }
  2925. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
  2926. {
  2927. unsigned int count = static_cast<unsigned int>(this->repeated_nested_message_size());
  2928. total_size += 2UL * count;
  2929. for (unsigned int i = 0; i < count; i++) {
  2930. total_size +=
  2931. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2932. this->repeated_nested_message(static_cast<int>(i)));
  2933. }
  2934. }
  2935. // repeated .proto3_arena_unittest.ForeignMessage repeated_foreign_message = 49;
  2936. {
  2937. unsigned int count = static_cast<unsigned int>(this->repeated_foreign_message_size());
  2938. total_size += 2UL * count;
  2939. for (unsigned int i = 0; i < count; i++) {
  2940. total_size +=
  2941. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2942. this->repeated_foreign_message(static_cast<int>(i)));
  2943. }
  2944. }
  2945. // repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  2946. {
  2947. unsigned int count = static_cast<unsigned int>(this->repeated_import_message_size());
  2948. total_size += 2UL * count;
  2949. for (unsigned int i = 0; i < count; i++) {
  2950. total_size +=
  2951. ::google::protobuf::internal::WireFormatLite::MessageSize(
  2952. this->repeated_import_message(static_cast<int>(i)));
  2953. }
  2954. }
  2955. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
  2956. {
  2957. size_t data_size = 0;
  2958. unsigned int count = static_cast<unsigned int>(this->repeated_nested_enum_size());for (unsigned int i = 0; i < count; i++) {
  2959. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  2960. this->repeated_nested_enum(static_cast<int>(i)));
  2961. }
  2962. if (data_size > 0) {
  2963. total_size += 2 +
  2964. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2965. static_cast< ::google::protobuf::int32>(data_size));
  2966. }
  2967. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2968. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2969. _repeated_nested_enum_cached_byte_size_ = cached_size;
  2970. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2971. total_size += data_size;
  2972. }
  2973. // repeated .proto3_arena_unittest.ForeignEnum repeated_foreign_enum = 52;
  2974. {
  2975. size_t data_size = 0;
  2976. unsigned int count = static_cast<unsigned int>(this->repeated_foreign_enum_size());for (unsigned int i = 0; i < count; i++) {
  2977. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  2978. this->repeated_foreign_enum(static_cast<int>(i)));
  2979. }
  2980. if (data_size > 0) {
  2981. total_size += 2 +
  2982. ::google::protobuf::internal::WireFormatLite::Int32Size(
  2983. static_cast< ::google::protobuf::int32>(data_size));
  2984. }
  2985. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  2986. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  2987. _repeated_foreign_enum_cached_byte_size_ = cached_size;
  2988. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  2989. total_size += data_size;
  2990. }
  2991. // repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  2992. total_size += 2 *
  2993. ::google::protobuf::internal::FromIntSize(this->repeated_string_piece_size());
  2994. for (int i = 0, n = this->repeated_string_piece_size(); i < n; i++) {
  2995. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  2996. this->repeated_string_piece(i));
  2997. }
  2998. // repeated string repeated_cord = 55 [ctype = CORD];
  2999. total_size += 2 *
  3000. ::google::protobuf::internal::FromIntSize(this->repeated_cord_size());
  3001. for (int i = 0, n = this->repeated_cord_size(); i < n; i++) {
  3002. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  3003. this->repeated_cord(i));
  3004. }
  3005. // repeated .proto3_arena_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
  3006. {
  3007. unsigned int count = static_cast<unsigned int>(this->repeated_lazy_message_size());
  3008. total_size += 2UL * count;
  3009. for (unsigned int i = 0; i < count; i++) {
  3010. total_size +=
  3011. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3012. this->repeated_lazy_message(static_cast<int>(i)));
  3013. }
  3014. }
  3015. // string optional_string = 14;
  3016. if (this->optional_string().size() > 0) {
  3017. total_size += 1 +
  3018. ::google::protobuf::internal::WireFormatLite::StringSize(
  3019. this->optional_string());
  3020. }
  3021. // bytes optional_bytes = 15;
  3022. if (this->optional_bytes().size() > 0) {
  3023. total_size += 1 +
  3024. ::google::protobuf::internal::WireFormatLite::BytesSize(
  3025. this->optional_bytes());
  3026. }
  3027. // string optional_string_piece = 24 [ctype = STRING_PIECE];
  3028. if (this->optional_string_piece().size() > 0) {
  3029. total_size += 2 +
  3030. ::google::protobuf::internal::WireFormatLite::StringSize(
  3031. this->optional_string_piece());
  3032. }
  3033. // string optional_cord = 25 [ctype = CORD];
  3034. if (this->optional_cord().size() > 0) {
  3035. total_size += 2 +
  3036. ::google::protobuf::internal::WireFormatLite::StringSize(
  3037. this->optional_cord());
  3038. }
  3039. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
  3040. if (this->has_optional_nested_message()) {
  3041. total_size += 2 +
  3042. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3043. *optional_nested_message_);
  3044. }
  3045. // .proto3_arena_unittest.ForeignMessage optional_foreign_message = 19;
  3046. if (this->has_optional_foreign_message()) {
  3047. total_size += 2 +
  3048. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3049. *optional_foreign_message_);
  3050. }
  3051. // .protobuf_unittest_import.ImportMessage optional_import_message = 20;
  3052. if (this->has_optional_import_message()) {
  3053. total_size += 2 +
  3054. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3055. *optional_import_message_);
  3056. }
  3057. // .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
  3058. if (this->has_optional_public_import_message()) {
  3059. total_size += 2 +
  3060. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3061. *optional_public_import_message_);
  3062. }
  3063. // .proto3_arena_unittest.TestAllTypes.NestedMessage optional_lazy_message = 27 [lazy = true];
  3064. if (this->has_optional_lazy_message()) {
  3065. total_size += 2 +
  3066. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3067. *optional_lazy_message_);
  3068. }
  3069. // .protobuf_unittest_import.ImportMessage optional_lazy_import_message = 115 [lazy = true];
  3070. if (this->has_optional_lazy_import_message()) {
  3071. total_size += 2 +
  3072. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3073. *optional_lazy_import_message_);
  3074. }
  3075. // int64 optional_int64 = 2;
  3076. if (this->optional_int64() != 0) {
  3077. total_size += 1 +
  3078. ::google::protobuf::internal::WireFormatLite::Int64Size(
  3079. this->optional_int64());
  3080. }
  3081. // int32 optional_int32 = 1;
  3082. if (this->optional_int32() != 0) {
  3083. total_size += 1 +
  3084. ::google::protobuf::internal::WireFormatLite::Int32Size(
  3085. this->optional_int32());
  3086. }
  3087. // uint32 optional_uint32 = 3;
  3088. if (this->optional_uint32() != 0) {
  3089. total_size += 1 +
  3090. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  3091. this->optional_uint32());
  3092. }
  3093. // uint64 optional_uint64 = 4;
  3094. if (this->optional_uint64() != 0) {
  3095. total_size += 1 +
  3096. ::google::protobuf::internal::WireFormatLite::UInt64Size(
  3097. this->optional_uint64());
  3098. }
  3099. // sint64 optional_sint64 = 6;
  3100. if (this->optional_sint64() != 0) {
  3101. total_size += 1 +
  3102. ::google::protobuf::internal::WireFormatLite::SInt64Size(
  3103. this->optional_sint64());
  3104. }
  3105. // sint32 optional_sint32 = 5;
  3106. if (this->optional_sint32() != 0) {
  3107. total_size += 1 +
  3108. ::google::protobuf::internal::WireFormatLite::SInt32Size(
  3109. this->optional_sint32());
  3110. }
  3111. // fixed32 optional_fixed32 = 7;
  3112. if (this->optional_fixed32() != 0) {
  3113. total_size += 1 + 4;
  3114. }
  3115. // fixed64 optional_fixed64 = 8;
  3116. if (this->optional_fixed64() != 0) {
  3117. total_size += 1 + 8;
  3118. }
  3119. // sfixed64 optional_sfixed64 = 10;
  3120. if (this->optional_sfixed64() != 0) {
  3121. total_size += 1 + 8;
  3122. }
  3123. // sfixed32 optional_sfixed32 = 9;
  3124. if (this->optional_sfixed32() != 0) {
  3125. total_size += 1 + 4;
  3126. }
  3127. // float optional_float = 11;
  3128. if (this->optional_float() != 0) {
  3129. total_size += 1 + 4;
  3130. }
  3131. // double optional_double = 12;
  3132. if (this->optional_double() != 0) {
  3133. total_size += 1 + 8;
  3134. }
  3135. // bool optional_bool = 13;
  3136. if (this->optional_bool() != 0) {
  3137. total_size += 1 + 1;
  3138. }
  3139. // .proto3_arena_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
  3140. if (this->optional_nested_enum() != 0) {
  3141. total_size += 2 +
  3142. ::google::protobuf::internal::WireFormatLite::EnumSize(this->optional_nested_enum());
  3143. }
  3144. // .proto3_arena_unittest.ForeignEnum optional_foreign_enum = 22;
  3145. if (this->optional_foreign_enum() != 0) {
  3146. total_size += 2 +
  3147. ::google::protobuf::internal::WireFormatLite::EnumSize(this->optional_foreign_enum());
  3148. }
  3149. switch (oneof_field_case()) {
  3150. // uint32 oneof_uint32 = 111;
  3151. case kOneofUint32: {
  3152. total_size += 2 +
  3153. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  3154. this->oneof_uint32());
  3155. break;
  3156. }
  3157. // .proto3_arena_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
  3158. case kOneofNestedMessage: {
  3159. total_size += 2 +
  3160. ::google::protobuf::internal::WireFormatLite::MessageSize(
  3161. *oneof_field_.oneof_nested_message_);
  3162. break;
  3163. }
  3164. // string oneof_string = 113;
  3165. case kOneofString: {
  3166. total_size += 2 +
  3167. ::google::protobuf::internal::WireFormatLite::StringSize(
  3168. this->oneof_string());
  3169. break;
  3170. }
  3171. // bytes oneof_bytes = 114;
  3172. case kOneofBytes: {
  3173. total_size += 2 +
  3174. ::google::protobuf::internal::WireFormatLite::BytesSize(
  3175. this->oneof_bytes());
  3176. break;
  3177. }
  3178. case ONEOF_FIELD_NOT_SET: {
  3179. break;
  3180. }
  3181. }
  3182. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  3183. SetCachedSize(cached_size);
  3184. return total_size;
  3185. }
  3186. void TestAllTypes::MergeFrom(const ::google::protobuf::Message& from) {
  3187. // @@protoc_insertion_point(generalized_merge_from_start:proto3_arena_unittest.TestAllTypes)
  3188. GOOGLE_DCHECK_NE(&from, this);
  3189. const TestAllTypes* source =
  3190. ::google::protobuf::internal::DynamicCastToGenerated<const TestAllTypes>(
  3191. &from);
  3192. if (source == NULL) {
  3193. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_arena_unittest.TestAllTypes)
  3194. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  3195. } else {
  3196. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_arena_unittest.TestAllTypes)
  3197. MergeFrom(*source);
  3198. }
  3199. }
  3200. void TestAllTypes::MergeFrom(const TestAllTypes& from) {
  3201. // @@protoc_insertion_point(class_specific_merge_from_start:proto3_arena_unittest.TestAllTypes)
  3202. GOOGLE_DCHECK_NE(&from, this);
  3203. _internal_metadata_.MergeFrom(from._internal_metadata_);
  3204. ::google::protobuf::uint32 cached_has_bits = 0;
  3205. (void) cached_has_bits;
  3206. repeated_int32_.MergeFrom(from.repeated_int32_);
  3207. repeated_int64_.MergeFrom(from.repeated_int64_);
  3208. repeated_uint32_.MergeFrom(from.repeated_uint32_);
  3209. repeated_uint64_.MergeFrom(from.repeated_uint64_);
  3210. repeated_sint32_.MergeFrom(from.repeated_sint32_);
  3211. repeated_sint64_.MergeFrom(from.repeated_sint64_);
  3212. repeated_fixed32_.MergeFrom(from.repeated_fixed32_);
  3213. repeated_fixed64_.MergeFrom(from.repeated_fixed64_);
  3214. repeated_sfixed32_.MergeFrom(from.repeated_sfixed32_);
  3215. repeated_sfixed64_.MergeFrom(from.repeated_sfixed64_);
  3216. repeated_float_.MergeFrom(from.repeated_float_);
  3217. repeated_double_.MergeFrom(from.repeated_double_);
  3218. repeated_bool_.MergeFrom(from.repeated_bool_);
  3219. repeated_string_.MergeFrom(from.repeated_string_);
  3220. repeated_bytes_.MergeFrom(from.repeated_bytes_);
  3221. repeated_nested_message_.MergeFrom(from.repeated_nested_message_);
  3222. repeated_foreign_message_.MergeFrom(from.repeated_foreign_message_);
  3223. repeated_import_message_.MergeFrom(from.repeated_import_message_);
  3224. repeated_nested_enum_.MergeFrom(from.repeated_nested_enum_);
  3225. repeated_foreign_enum_.MergeFrom(from.repeated_foreign_enum_);
  3226. repeated_string_piece_.MergeFrom(from.repeated_string_piece_);
  3227. repeated_cord_.MergeFrom(from.repeated_cord_);
  3228. repeated_lazy_message_.MergeFrom(from.repeated_lazy_message_);
  3229. if (from.optional_string().size() > 0) {
  3230. set_optional_string(from.optional_string());
  3231. }
  3232. if (from.optional_bytes().size() > 0) {
  3233. set_optional_bytes(from.optional_bytes());
  3234. }
  3235. if (from.optional_string_piece().size() > 0) {
  3236. set_optional_string_piece(from.optional_string_piece());
  3237. }
  3238. if (from.optional_cord().size() > 0) {
  3239. set_optional_cord(from.optional_cord());
  3240. }
  3241. if (from.has_optional_nested_message()) {
  3242. mutable_optional_nested_message()->::proto3_arena_unittest::TestAllTypes_NestedMessage::MergeFrom(from.optional_nested_message());
  3243. }
  3244. if (from.has_optional_foreign_message()) {
  3245. mutable_optional_foreign_message()->::proto3_arena_unittest::ForeignMessage::MergeFrom(from.optional_foreign_message());
  3246. }
  3247. if (from.has_optional_import_message()) {
  3248. mutable_optional_import_message()->::protobuf_unittest_import::ImportMessage::MergeFrom(from.optional_import_message());
  3249. }
  3250. if (from.has_optional_public_import_message()) {
  3251. mutable_optional_public_import_message()->::protobuf_unittest_import::PublicImportMessage::MergeFrom(from.optional_public_import_message());
  3252. }
  3253. if (from.has_optional_lazy_message()) {
  3254. mutable_optional_lazy_message()->::proto3_arena_unittest::TestAllTypes_NestedMessage::MergeFrom(from.optional_lazy_message());
  3255. }
  3256. if (from.has_optional_lazy_import_message()) {
  3257. mutable_optional_lazy_import_message()->::protobuf_unittest_import::ImportMessage::MergeFrom(from.optional_lazy_import_message());
  3258. }
  3259. if (from.optional_int64() != 0) {
  3260. set_optional_int64(from.optional_int64());
  3261. }
  3262. if (from.optional_int32() != 0) {
  3263. set_optional_int32(from.optional_int32());
  3264. }
  3265. if (from.optional_uint32() != 0) {
  3266. set_optional_uint32(from.optional_uint32());
  3267. }
  3268. if (from.optional_uint64() != 0) {
  3269. set_optional_uint64(from.optional_uint64());
  3270. }
  3271. if (from.optional_sint64() != 0) {
  3272. set_optional_sint64(from.optional_sint64());
  3273. }
  3274. if (from.optional_sint32() != 0) {
  3275. set_optional_sint32(from.optional_sint32());
  3276. }
  3277. if (from.optional_fixed32() != 0) {
  3278. set_optional_fixed32(from.optional_fixed32());
  3279. }
  3280. if (from.optional_fixed64() != 0) {
  3281. set_optional_fixed64(from.optional_fixed64());
  3282. }
  3283. if (from.optional_sfixed64() != 0) {
  3284. set_optional_sfixed64(from.optional_sfixed64());
  3285. }
  3286. if (from.optional_sfixed32() != 0) {
  3287. set_optional_sfixed32(from.optional_sfixed32());
  3288. }
  3289. if (from.optional_float() != 0) {
  3290. set_optional_float(from.optional_float());
  3291. }
  3292. if (from.optional_double() != 0) {
  3293. set_optional_double(from.optional_double());
  3294. }
  3295. if (from.optional_bool() != 0) {
  3296. set_optional_bool(from.optional_bool());
  3297. }
  3298. if (from.optional_nested_enum() != 0) {
  3299. set_optional_nested_enum(from.optional_nested_enum());
  3300. }
  3301. if (from.optional_foreign_enum() != 0) {
  3302. set_optional_foreign_enum(from.optional_foreign_enum());
  3303. }
  3304. switch (from.oneof_field_case()) {
  3305. case kOneofUint32: {
  3306. set_oneof_uint32(from.oneof_uint32());
  3307. break;
  3308. }
  3309. case kOneofNestedMessage: {
  3310. mutable_oneof_nested_message()->::proto3_arena_unittest::TestAllTypes_NestedMessage::MergeFrom(from.oneof_nested_message());
  3311. break;
  3312. }
  3313. case kOneofString: {
  3314. set_oneof_string(from.oneof_string());
  3315. break;
  3316. }
  3317. case kOneofBytes: {
  3318. set_oneof_bytes(from.oneof_bytes());
  3319. break;
  3320. }
  3321. case ONEOF_FIELD_NOT_SET: {
  3322. break;
  3323. }
  3324. }
  3325. }
  3326. void TestAllTypes::CopyFrom(const ::google::protobuf::Message& from) {
  3327. // @@protoc_insertion_point(generalized_copy_from_start:proto3_arena_unittest.TestAllTypes)
  3328. if (&from == this) return;
  3329. Clear();
  3330. MergeFrom(from);
  3331. }
  3332. void TestAllTypes::CopyFrom(const TestAllTypes& from) {
  3333. // @@protoc_insertion_point(class_specific_copy_from_start:proto3_arena_unittest.TestAllTypes)
  3334. if (&from == this) return;
  3335. Clear();
  3336. MergeFrom(from);
  3337. }
  3338. bool TestAllTypes::IsInitialized() const {
  3339. return true;
  3340. }
  3341. void TestAllTypes::Swap(TestAllTypes* other) {
  3342. if (other == this) return;
  3343. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  3344. InternalSwap(other);
  3345. } else {
  3346. TestAllTypes* temp = New(GetArenaNoVirtual());
  3347. temp->MergeFrom(*other);
  3348. other->CopyFrom(*this);
  3349. InternalSwap(temp);
  3350. if (GetArenaNoVirtual() == NULL) {
  3351. delete temp;
  3352. }
  3353. }
  3354. }
  3355. void TestAllTypes::UnsafeArenaSwap(TestAllTypes* other) {
  3356. if (other == this) return;
  3357. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  3358. InternalSwap(other);
  3359. }
  3360. void TestAllTypes::InternalSwap(TestAllTypes* other) {
  3361. using std::swap;
  3362. repeated_int32_.InternalSwap(&other->repeated_int32_);
  3363. repeated_int64_.InternalSwap(&other->repeated_int64_);
  3364. repeated_uint32_.InternalSwap(&other->repeated_uint32_);
  3365. repeated_uint64_.InternalSwap(&other->repeated_uint64_);
  3366. repeated_sint32_.InternalSwap(&other->repeated_sint32_);
  3367. repeated_sint64_.InternalSwap(&other->repeated_sint64_);
  3368. repeated_fixed32_.InternalSwap(&other->repeated_fixed32_);
  3369. repeated_fixed64_.InternalSwap(&other->repeated_fixed64_);
  3370. repeated_sfixed32_.InternalSwap(&other->repeated_sfixed32_);
  3371. repeated_sfixed64_.InternalSwap(&other->repeated_sfixed64_);
  3372. repeated_float_.InternalSwap(&other->repeated_float_);
  3373. repeated_double_.InternalSwap(&other->repeated_double_);
  3374. repeated_bool_.InternalSwap(&other->repeated_bool_);
  3375. repeated_string_.InternalSwap(CastToBase(&other->repeated_string_));
  3376. repeated_bytes_.InternalSwap(CastToBase(&other->repeated_bytes_));
  3377. CastToBase(&repeated_nested_message_)->InternalSwap(CastToBase(&other->repeated_nested_message_));
  3378. CastToBase(&repeated_foreign_message_)->InternalSwap(CastToBase(&other->repeated_foreign_message_));
  3379. CastToBase(&repeated_import_message_)->InternalSwap(CastToBase(&other->repeated_import_message_));
  3380. repeated_nested_enum_.InternalSwap(&other->repeated_nested_enum_);
  3381. repeated_foreign_enum_.InternalSwap(&other->repeated_foreign_enum_);
  3382. repeated_string_piece_.InternalSwap(CastToBase(&other->repeated_string_piece_));
  3383. repeated_cord_.InternalSwap(CastToBase(&other->repeated_cord_));
  3384. CastToBase(&repeated_lazy_message_)->InternalSwap(CastToBase(&other->repeated_lazy_message_));
  3385. optional_string_.Swap(&other->optional_string_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  3386. GetArenaNoVirtual());
  3387. optional_bytes_.Swap(&other->optional_bytes_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  3388. GetArenaNoVirtual());
  3389. optional_string_piece_.Swap(&other->optional_string_piece_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  3390. GetArenaNoVirtual());
  3391. optional_cord_.Swap(&other->optional_cord_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  3392. GetArenaNoVirtual());
  3393. swap(optional_nested_message_, other->optional_nested_message_);
  3394. swap(optional_foreign_message_, other->optional_foreign_message_);
  3395. swap(optional_import_message_, other->optional_import_message_);
  3396. swap(optional_public_import_message_, other->optional_public_import_message_);
  3397. swap(optional_lazy_message_, other->optional_lazy_message_);
  3398. swap(optional_lazy_import_message_, other->optional_lazy_import_message_);
  3399. swap(optional_int64_, other->optional_int64_);
  3400. swap(optional_int32_, other->optional_int32_);
  3401. swap(optional_uint32_, other->optional_uint32_);
  3402. swap(optional_uint64_, other->optional_uint64_);
  3403. swap(optional_sint64_, other->optional_sint64_);
  3404. swap(optional_sint32_, other->optional_sint32_);
  3405. swap(optional_fixed32_, other->optional_fixed32_);
  3406. swap(optional_fixed64_, other->optional_fixed64_);
  3407. swap(optional_sfixed64_, other->optional_sfixed64_);
  3408. swap(optional_sfixed32_, other->optional_sfixed32_);
  3409. swap(optional_float_, other->optional_float_);
  3410. swap(optional_double_, other->optional_double_);
  3411. swap(optional_bool_, other->optional_bool_);
  3412. swap(optional_nested_enum_, other->optional_nested_enum_);
  3413. swap(optional_foreign_enum_, other->optional_foreign_enum_);
  3414. swap(oneof_field_, other->oneof_field_);
  3415. swap(_oneof_case_[0], other->_oneof_case_[0]);
  3416. _internal_metadata_.Swap(&other->_internal_metadata_);
  3417. }
  3418. ::google::protobuf::Metadata TestAllTypes::GetMetadata() const {
  3419. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  3420. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  3421. }
  3422. // ===================================================================
  3423. void TestPackedTypes::InitAsDefaultInstance() {
  3424. }
  3425. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  3426. const int TestPackedTypes::kPackedInt32FieldNumber;
  3427. const int TestPackedTypes::kPackedInt64FieldNumber;
  3428. const int TestPackedTypes::kPackedUint32FieldNumber;
  3429. const int TestPackedTypes::kPackedUint64FieldNumber;
  3430. const int TestPackedTypes::kPackedSint32FieldNumber;
  3431. const int TestPackedTypes::kPackedSint64FieldNumber;
  3432. const int TestPackedTypes::kPackedFixed32FieldNumber;
  3433. const int TestPackedTypes::kPackedFixed64FieldNumber;
  3434. const int TestPackedTypes::kPackedSfixed32FieldNumber;
  3435. const int TestPackedTypes::kPackedSfixed64FieldNumber;
  3436. const int TestPackedTypes::kPackedFloatFieldNumber;
  3437. const int TestPackedTypes::kPackedDoubleFieldNumber;
  3438. const int TestPackedTypes::kPackedBoolFieldNumber;
  3439. const int TestPackedTypes::kPackedEnumFieldNumber;
  3440. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  3441. TestPackedTypes::TestPackedTypes()
  3442. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  3443. ::google::protobuf::internal::InitSCC(
  3444. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestPackedTypes.base);
  3445. SharedCtor();
  3446. // @@protoc_insertion_point(constructor:proto3_arena_unittest.TestPackedTypes)
  3447. }
  3448. TestPackedTypes::TestPackedTypes(::google::protobuf::Arena* arena)
  3449. : ::google::protobuf::Message(),
  3450. _internal_metadata_(arena),
  3451. packed_int32_(arena),
  3452. packed_int64_(arena),
  3453. packed_uint32_(arena),
  3454. packed_uint64_(arena),
  3455. packed_sint32_(arena),
  3456. packed_sint64_(arena),
  3457. packed_fixed32_(arena),
  3458. packed_fixed64_(arena),
  3459. packed_sfixed32_(arena),
  3460. packed_sfixed64_(arena),
  3461. packed_float_(arena),
  3462. packed_double_(arena),
  3463. packed_bool_(arena),
  3464. packed_enum_(arena) {
  3465. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestPackedTypes.base);
  3466. SharedCtor();
  3467. RegisterArenaDtor(arena);
  3468. // @@protoc_insertion_point(arena_constructor:proto3_arena_unittest.TestPackedTypes)
  3469. }
  3470. TestPackedTypes::TestPackedTypes(const TestPackedTypes& from)
  3471. : ::google::protobuf::Message(),
  3472. _internal_metadata_(NULL),
  3473. packed_int32_(from.packed_int32_),
  3474. packed_int64_(from.packed_int64_),
  3475. packed_uint32_(from.packed_uint32_),
  3476. packed_uint64_(from.packed_uint64_),
  3477. packed_sint32_(from.packed_sint32_),
  3478. packed_sint64_(from.packed_sint64_),
  3479. packed_fixed32_(from.packed_fixed32_),
  3480. packed_fixed64_(from.packed_fixed64_),
  3481. packed_sfixed32_(from.packed_sfixed32_),
  3482. packed_sfixed64_(from.packed_sfixed64_),
  3483. packed_float_(from.packed_float_),
  3484. packed_double_(from.packed_double_),
  3485. packed_bool_(from.packed_bool_),
  3486. packed_enum_(from.packed_enum_) {
  3487. _internal_metadata_.MergeFrom(from._internal_metadata_);
  3488. // @@protoc_insertion_point(copy_constructor:proto3_arena_unittest.TestPackedTypes)
  3489. }
  3490. void TestPackedTypes::SharedCtor() {
  3491. }
  3492. TestPackedTypes::~TestPackedTypes() {
  3493. // @@protoc_insertion_point(destructor:proto3_arena_unittest.TestPackedTypes)
  3494. SharedDtor();
  3495. }
  3496. void TestPackedTypes::SharedDtor() {
  3497. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  3498. }
  3499. void TestPackedTypes::ArenaDtor(void* object) {
  3500. TestPackedTypes* _this = reinterpret_cast< TestPackedTypes* >(object);
  3501. (void)_this;
  3502. }
  3503. void TestPackedTypes::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  3504. }
  3505. void TestPackedTypes::SetCachedSize(int size) const {
  3506. _cached_size_.Set(size);
  3507. }
  3508. const ::google::protobuf::Descriptor* TestPackedTypes::descriptor() {
  3509. ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  3510. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  3511. }
  3512. const TestPackedTypes& TestPackedTypes::default_instance() {
  3513. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestPackedTypes.base);
  3514. return *internal_default_instance();
  3515. }
  3516. void TestPackedTypes::Clear() {
  3517. // @@protoc_insertion_point(message_clear_start:proto3_arena_unittest.TestPackedTypes)
  3518. ::google::protobuf::uint32 cached_has_bits = 0;
  3519. // Prevent compiler warnings about cached_has_bits being unused
  3520. (void) cached_has_bits;
  3521. packed_int32_.Clear();
  3522. packed_int64_.Clear();
  3523. packed_uint32_.Clear();
  3524. packed_uint64_.Clear();
  3525. packed_sint32_.Clear();
  3526. packed_sint64_.Clear();
  3527. packed_fixed32_.Clear();
  3528. packed_fixed64_.Clear();
  3529. packed_sfixed32_.Clear();
  3530. packed_sfixed64_.Clear();
  3531. packed_float_.Clear();
  3532. packed_double_.Clear();
  3533. packed_bool_.Clear();
  3534. packed_enum_.Clear();
  3535. _internal_metadata_.Clear();
  3536. }
  3537. bool TestPackedTypes::MergePartialFromCodedStream(
  3538. ::google::protobuf::io::CodedInputStream* input) {
  3539. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  3540. ::google::protobuf::uint32 tag;
  3541. // @@protoc_insertion_point(parse_start:proto3_arena_unittest.TestPackedTypes)
  3542. for (;;) {
  3543. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  3544. tag = p.first;
  3545. if (!p.second) goto handle_unusual;
  3546. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  3547. // repeated int32 packed_int32 = 90 [packed = true];
  3548. case 90: {
  3549. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3550. static_cast< ::google::protobuf::uint8>(210u /* 722 & 0xFF */)) {
  3551. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3552. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  3553. input, this->mutable_packed_int32())));
  3554. } else if (
  3555. static_cast< ::google::protobuf::uint8>(tag) ==
  3556. static_cast< ::google::protobuf::uint8>(208u /* 720 & 0xFF */)) {
  3557. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3558. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  3559. 2, 722u, input, this->mutable_packed_int32())));
  3560. } else {
  3561. goto handle_unusual;
  3562. }
  3563. break;
  3564. }
  3565. // repeated int64 packed_int64 = 91 [packed = true];
  3566. case 91: {
  3567. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3568. static_cast< ::google::protobuf::uint8>(218u /* 730 & 0xFF */)) {
  3569. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3570. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  3571. input, this->mutable_packed_int64())));
  3572. } else if (
  3573. static_cast< ::google::protobuf::uint8>(tag) ==
  3574. static_cast< ::google::protobuf::uint8>(216u /* 728 & 0xFF */)) {
  3575. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3576. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  3577. 2, 730u, input, this->mutable_packed_int64())));
  3578. } else {
  3579. goto handle_unusual;
  3580. }
  3581. break;
  3582. }
  3583. // repeated uint32 packed_uint32 = 92 [packed = true];
  3584. case 92: {
  3585. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3586. static_cast< ::google::protobuf::uint8>(226u /* 738 & 0xFF */)) {
  3587. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3588. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  3589. input, this->mutable_packed_uint32())));
  3590. } else if (
  3591. static_cast< ::google::protobuf::uint8>(tag) ==
  3592. static_cast< ::google::protobuf::uint8>(224u /* 736 & 0xFF */)) {
  3593. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3594. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  3595. 2, 738u, input, this->mutable_packed_uint32())));
  3596. } else {
  3597. goto handle_unusual;
  3598. }
  3599. break;
  3600. }
  3601. // repeated uint64 packed_uint64 = 93 [packed = true];
  3602. case 93: {
  3603. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3604. static_cast< ::google::protobuf::uint8>(234u /* 746 & 0xFF */)) {
  3605. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3606. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  3607. input, this->mutable_packed_uint64())));
  3608. } else if (
  3609. static_cast< ::google::protobuf::uint8>(tag) ==
  3610. static_cast< ::google::protobuf::uint8>(232u /* 744 & 0xFF */)) {
  3611. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3612. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  3613. 2, 746u, input, this->mutable_packed_uint64())));
  3614. } else {
  3615. goto handle_unusual;
  3616. }
  3617. break;
  3618. }
  3619. // repeated sint32 packed_sint32 = 94 [packed = true];
  3620. case 94: {
  3621. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3622. static_cast< ::google::protobuf::uint8>(242u /* 754 & 0xFF */)) {
  3623. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3624. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  3625. input, this->mutable_packed_sint32())));
  3626. } else if (
  3627. static_cast< ::google::protobuf::uint8>(tag) ==
  3628. static_cast< ::google::protobuf::uint8>(240u /* 752 & 0xFF */)) {
  3629. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3630. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  3631. 2, 754u, input, this->mutable_packed_sint32())));
  3632. } else {
  3633. goto handle_unusual;
  3634. }
  3635. break;
  3636. }
  3637. // repeated sint64 packed_sint64 = 95 [packed = true];
  3638. case 95: {
  3639. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3640. static_cast< ::google::protobuf::uint8>(250u /* 762 & 0xFF */)) {
  3641. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3642. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  3643. input, this->mutable_packed_sint64())));
  3644. } else if (
  3645. static_cast< ::google::protobuf::uint8>(tag) ==
  3646. static_cast< ::google::protobuf::uint8>(248u /* 760 & 0xFF */)) {
  3647. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3648. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  3649. 2, 762u, input, this->mutable_packed_sint64())));
  3650. } else {
  3651. goto handle_unusual;
  3652. }
  3653. break;
  3654. }
  3655. // repeated fixed32 packed_fixed32 = 96 [packed = true];
  3656. case 96: {
  3657. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3658. static_cast< ::google::protobuf::uint8>(2u /* 770 & 0xFF */)) {
  3659. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3660. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  3661. input, this->mutable_packed_fixed32())));
  3662. } else if (
  3663. static_cast< ::google::protobuf::uint8>(tag) ==
  3664. static_cast< ::google::protobuf::uint8>(5u /* 773 & 0xFF */)) {
  3665. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3666. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  3667. 2, 770u, input, this->mutable_packed_fixed32())));
  3668. } else {
  3669. goto handle_unusual;
  3670. }
  3671. break;
  3672. }
  3673. // repeated fixed64 packed_fixed64 = 97 [packed = true];
  3674. case 97: {
  3675. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3676. static_cast< ::google::protobuf::uint8>(10u /* 778 & 0xFF */)) {
  3677. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3678. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  3679. input, this->mutable_packed_fixed64())));
  3680. } else if (
  3681. static_cast< ::google::protobuf::uint8>(tag) ==
  3682. static_cast< ::google::protobuf::uint8>(9u /* 777 & 0xFF */)) {
  3683. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3684. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  3685. 2, 778u, input, this->mutable_packed_fixed64())));
  3686. } else {
  3687. goto handle_unusual;
  3688. }
  3689. break;
  3690. }
  3691. // repeated sfixed32 packed_sfixed32 = 98 [packed = true];
  3692. case 98: {
  3693. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3694. static_cast< ::google::protobuf::uint8>(18u /* 786 & 0xFF */)) {
  3695. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3696. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  3697. input, this->mutable_packed_sfixed32())));
  3698. } else if (
  3699. static_cast< ::google::protobuf::uint8>(tag) ==
  3700. static_cast< ::google::protobuf::uint8>(21u /* 789 & 0xFF */)) {
  3701. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3702. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  3703. 2, 786u, input, this->mutable_packed_sfixed32())));
  3704. } else {
  3705. goto handle_unusual;
  3706. }
  3707. break;
  3708. }
  3709. // repeated sfixed64 packed_sfixed64 = 99 [packed = true];
  3710. case 99: {
  3711. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3712. static_cast< ::google::protobuf::uint8>(26u /* 794 & 0xFF */)) {
  3713. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3714. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  3715. input, this->mutable_packed_sfixed64())));
  3716. } else if (
  3717. static_cast< ::google::protobuf::uint8>(tag) ==
  3718. static_cast< ::google::protobuf::uint8>(25u /* 793 & 0xFF */)) {
  3719. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3720. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  3721. 2, 794u, input, this->mutable_packed_sfixed64())));
  3722. } else {
  3723. goto handle_unusual;
  3724. }
  3725. break;
  3726. }
  3727. // repeated float packed_float = 100 [packed = true];
  3728. case 100: {
  3729. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3730. static_cast< ::google::protobuf::uint8>(34u /* 802 & 0xFF */)) {
  3731. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3732. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  3733. input, this->mutable_packed_float())));
  3734. } else if (
  3735. static_cast< ::google::protobuf::uint8>(tag) ==
  3736. static_cast< ::google::protobuf::uint8>(37u /* 805 & 0xFF */)) {
  3737. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3738. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  3739. 2, 802u, input, this->mutable_packed_float())));
  3740. } else {
  3741. goto handle_unusual;
  3742. }
  3743. break;
  3744. }
  3745. // repeated double packed_double = 101 [packed = true];
  3746. case 101: {
  3747. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3748. static_cast< ::google::protobuf::uint8>(42u /* 810 & 0xFF */)) {
  3749. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3750. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  3751. input, this->mutable_packed_double())));
  3752. } else if (
  3753. static_cast< ::google::protobuf::uint8>(tag) ==
  3754. static_cast< ::google::protobuf::uint8>(41u /* 809 & 0xFF */)) {
  3755. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3756. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  3757. 2, 810u, input, this->mutable_packed_double())));
  3758. } else {
  3759. goto handle_unusual;
  3760. }
  3761. break;
  3762. }
  3763. // repeated bool packed_bool = 102 [packed = true];
  3764. case 102: {
  3765. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3766. static_cast< ::google::protobuf::uint8>(50u /* 818 & 0xFF */)) {
  3767. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
  3768. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  3769. input, this->mutable_packed_bool())));
  3770. } else if (
  3771. static_cast< ::google::protobuf::uint8>(tag) ==
  3772. static_cast< ::google::protobuf::uint8>(48u /* 816 & 0xFF */)) {
  3773. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
  3774. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  3775. 2, 818u, input, this->mutable_packed_bool())));
  3776. } else {
  3777. goto handle_unusual;
  3778. }
  3779. break;
  3780. }
  3781. // repeated .proto3_arena_unittest.ForeignEnum packed_enum = 103 [packed = true];
  3782. case 103: {
  3783. if (static_cast< ::google::protobuf::uint8>(tag) ==
  3784. static_cast< ::google::protobuf::uint8>(58u /* 826 & 0xFF */)) {
  3785. ::google::protobuf::uint32 length;
  3786. DO_(input->ReadVarint32(&length));
  3787. ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
  3788. while (input->BytesUntilLimit() > 0) {
  3789. int value;
  3790. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  3791. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  3792. input, &value)));
  3793. add_packed_enum(static_cast< ::proto3_arena_unittest::ForeignEnum >(value));
  3794. }
  3795. input->PopLimit(limit);
  3796. } else if (
  3797. static_cast< ::google::protobuf::uint8>(tag) ==
  3798. static_cast< ::google::protobuf::uint8>(56u /* 824 & 0xFF */)) {
  3799. int value;
  3800. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  3801. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  3802. input, &value)));
  3803. add_packed_enum(static_cast< ::proto3_arena_unittest::ForeignEnum >(value));
  3804. } else {
  3805. goto handle_unusual;
  3806. }
  3807. break;
  3808. }
  3809. default: {
  3810. handle_unusual:
  3811. if (tag == 0) {
  3812. goto success;
  3813. }
  3814. DO_(::google::protobuf::internal::WireFormat::SkipField(
  3815. input, tag, _internal_metadata_.mutable_unknown_fields()));
  3816. break;
  3817. }
  3818. }
  3819. }
  3820. success:
  3821. // @@protoc_insertion_point(parse_success:proto3_arena_unittest.TestPackedTypes)
  3822. return true;
  3823. failure:
  3824. // @@protoc_insertion_point(parse_failure:proto3_arena_unittest.TestPackedTypes)
  3825. return false;
  3826. #undef DO_
  3827. }
  3828. void TestPackedTypes::SerializeWithCachedSizes(
  3829. ::google::protobuf::io::CodedOutputStream* output) const {
  3830. // @@protoc_insertion_point(serialize_start:proto3_arena_unittest.TestPackedTypes)
  3831. ::google::protobuf::uint32 cached_has_bits = 0;
  3832. (void) cached_has_bits;
  3833. // repeated int32 packed_int32 = 90 [packed = true];
  3834. if (this->packed_int32_size() > 0) {
  3835. ::google::protobuf::internal::WireFormatLite::WriteTag(90, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3836. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3837. _packed_int32_cached_byte_size_));
  3838. }
  3839. for (int i = 0, n = this->packed_int32_size(); i < n; i++) {
  3840. ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
  3841. this->packed_int32(i), output);
  3842. }
  3843. // repeated int64 packed_int64 = 91 [packed = true];
  3844. if (this->packed_int64_size() > 0) {
  3845. ::google::protobuf::internal::WireFormatLite::WriteTag(91, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3846. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3847. _packed_int64_cached_byte_size_));
  3848. }
  3849. for (int i = 0, n = this->packed_int64_size(); i < n; i++) {
  3850. ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
  3851. this->packed_int64(i), output);
  3852. }
  3853. // repeated uint32 packed_uint32 = 92 [packed = true];
  3854. if (this->packed_uint32_size() > 0) {
  3855. ::google::protobuf::internal::WireFormatLite::WriteTag(92, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3856. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3857. _packed_uint32_cached_byte_size_));
  3858. }
  3859. for (int i = 0, n = this->packed_uint32_size(); i < n; i++) {
  3860. ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
  3861. this->packed_uint32(i), output);
  3862. }
  3863. // repeated uint64 packed_uint64 = 93 [packed = true];
  3864. if (this->packed_uint64_size() > 0) {
  3865. ::google::protobuf::internal::WireFormatLite::WriteTag(93, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3866. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3867. _packed_uint64_cached_byte_size_));
  3868. }
  3869. for (int i = 0, n = this->packed_uint64_size(); i < n; i++) {
  3870. ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag(
  3871. this->packed_uint64(i), output);
  3872. }
  3873. // repeated sint32 packed_sint32 = 94 [packed = true];
  3874. if (this->packed_sint32_size() > 0) {
  3875. ::google::protobuf::internal::WireFormatLite::WriteTag(94, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3876. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3877. _packed_sint32_cached_byte_size_));
  3878. }
  3879. for (int i = 0, n = this->packed_sint32_size(); i < n; i++) {
  3880. ::google::protobuf::internal::WireFormatLite::WriteSInt32NoTag(
  3881. this->packed_sint32(i), output);
  3882. }
  3883. // repeated sint64 packed_sint64 = 95 [packed = true];
  3884. if (this->packed_sint64_size() > 0) {
  3885. ::google::protobuf::internal::WireFormatLite::WriteTag(95, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3886. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3887. _packed_sint64_cached_byte_size_));
  3888. }
  3889. for (int i = 0, n = this->packed_sint64_size(); i < n; i++) {
  3890. ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
  3891. this->packed_sint64(i), output);
  3892. }
  3893. // repeated fixed32 packed_fixed32 = 96 [packed = true];
  3894. if (this->packed_fixed32_size() > 0) {
  3895. ::google::protobuf::internal::WireFormatLite::WriteTag(96, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3896. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3897. _packed_fixed32_cached_byte_size_));
  3898. ::google::protobuf::internal::WireFormatLite::WriteFixed32Array(
  3899. this->packed_fixed32().data(), this->packed_fixed32_size(), output);
  3900. }
  3901. // repeated fixed64 packed_fixed64 = 97 [packed = true];
  3902. if (this->packed_fixed64_size() > 0) {
  3903. ::google::protobuf::internal::WireFormatLite::WriteTag(97, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3904. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3905. _packed_fixed64_cached_byte_size_));
  3906. ::google::protobuf::internal::WireFormatLite::WriteFixed64Array(
  3907. this->packed_fixed64().data(), this->packed_fixed64_size(), output);
  3908. }
  3909. // repeated sfixed32 packed_sfixed32 = 98 [packed = true];
  3910. if (this->packed_sfixed32_size() > 0) {
  3911. ::google::protobuf::internal::WireFormatLite::WriteTag(98, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3912. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3913. _packed_sfixed32_cached_byte_size_));
  3914. ::google::protobuf::internal::WireFormatLite::WriteSFixed32Array(
  3915. this->packed_sfixed32().data(), this->packed_sfixed32_size(), output);
  3916. }
  3917. // repeated sfixed64 packed_sfixed64 = 99 [packed = true];
  3918. if (this->packed_sfixed64_size() > 0) {
  3919. ::google::protobuf::internal::WireFormatLite::WriteTag(99, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3920. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3921. _packed_sfixed64_cached_byte_size_));
  3922. ::google::protobuf::internal::WireFormatLite::WriteSFixed64Array(
  3923. this->packed_sfixed64().data(), this->packed_sfixed64_size(), output);
  3924. }
  3925. // repeated float packed_float = 100 [packed = true];
  3926. if (this->packed_float_size() > 0) {
  3927. ::google::protobuf::internal::WireFormatLite::WriteTag(100, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3928. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3929. _packed_float_cached_byte_size_));
  3930. ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
  3931. this->packed_float().data(), this->packed_float_size(), output);
  3932. }
  3933. // repeated double packed_double = 101 [packed = true];
  3934. if (this->packed_double_size() > 0) {
  3935. ::google::protobuf::internal::WireFormatLite::WriteTag(101, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3936. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3937. _packed_double_cached_byte_size_));
  3938. ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
  3939. this->packed_double().data(), this->packed_double_size(), output);
  3940. }
  3941. // repeated bool packed_bool = 102 [packed = true];
  3942. if (this->packed_bool_size() > 0) {
  3943. ::google::protobuf::internal::WireFormatLite::WriteTag(102, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
  3944. output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
  3945. _packed_bool_cached_byte_size_));
  3946. ::google::protobuf::internal::WireFormatLite::WriteBoolArray(
  3947. this->packed_bool().data(), this->packed_bool_size(), output);
  3948. }
  3949. // repeated .proto3_arena_unittest.ForeignEnum packed_enum = 103 [packed = true];
  3950. if (this->packed_enum_size() > 0) {
  3951. ::google::protobuf::internal::WireFormatLite::WriteTag(
  3952. 103,
  3953. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  3954. output);
  3955. output->WriteVarint32(
  3956. static_cast< ::google::protobuf::uint32>(_packed_enum_cached_byte_size_));
  3957. }
  3958. for (int i = 0, n = this->packed_enum_size(); i < n; i++) {
  3959. ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
  3960. this->packed_enum(i), output);
  3961. }
  3962. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  3963. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  3964. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  3965. }
  3966. // @@protoc_insertion_point(serialize_end:proto3_arena_unittest.TestPackedTypes)
  3967. }
  3968. ::google::protobuf::uint8* TestPackedTypes::InternalSerializeWithCachedSizesToArray(
  3969. bool deterministic, ::google::protobuf::uint8* target) const {
  3970. (void)deterministic; // Unused
  3971. // @@protoc_insertion_point(serialize_to_array_start:proto3_arena_unittest.TestPackedTypes)
  3972. ::google::protobuf::uint32 cached_has_bits = 0;
  3973. (void) cached_has_bits;
  3974. // repeated int32 packed_int32 = 90 [packed = true];
  3975. if (this->packed_int32_size() > 0) {
  3976. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  3977. 90,
  3978. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  3979. target);
  3980. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  3981. static_cast< ::google::protobuf::int32>(
  3982. _packed_int32_cached_byte_size_), target);
  3983. target = ::google::protobuf::internal::WireFormatLite::
  3984. WriteInt32NoTagToArray(this->packed_int32_, target);
  3985. }
  3986. // repeated int64 packed_int64 = 91 [packed = true];
  3987. if (this->packed_int64_size() > 0) {
  3988. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  3989. 91,
  3990. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  3991. target);
  3992. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  3993. static_cast< ::google::protobuf::int32>(
  3994. _packed_int64_cached_byte_size_), target);
  3995. target = ::google::protobuf::internal::WireFormatLite::
  3996. WriteInt64NoTagToArray(this->packed_int64_, target);
  3997. }
  3998. // repeated uint32 packed_uint32 = 92 [packed = true];
  3999. if (this->packed_uint32_size() > 0) {
  4000. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4001. 92,
  4002. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4003. target);
  4004. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4005. static_cast< ::google::protobuf::int32>(
  4006. _packed_uint32_cached_byte_size_), target);
  4007. target = ::google::protobuf::internal::WireFormatLite::
  4008. WriteUInt32NoTagToArray(this->packed_uint32_, target);
  4009. }
  4010. // repeated uint64 packed_uint64 = 93 [packed = true];
  4011. if (this->packed_uint64_size() > 0) {
  4012. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4013. 93,
  4014. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4015. target);
  4016. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4017. static_cast< ::google::protobuf::int32>(
  4018. _packed_uint64_cached_byte_size_), target);
  4019. target = ::google::protobuf::internal::WireFormatLite::
  4020. WriteUInt64NoTagToArray(this->packed_uint64_, target);
  4021. }
  4022. // repeated sint32 packed_sint32 = 94 [packed = true];
  4023. if (this->packed_sint32_size() > 0) {
  4024. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4025. 94,
  4026. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4027. target);
  4028. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4029. static_cast< ::google::protobuf::int32>(
  4030. _packed_sint32_cached_byte_size_), target);
  4031. target = ::google::protobuf::internal::WireFormatLite::
  4032. WriteSInt32NoTagToArray(this->packed_sint32_, target);
  4033. }
  4034. // repeated sint64 packed_sint64 = 95 [packed = true];
  4035. if (this->packed_sint64_size() > 0) {
  4036. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4037. 95,
  4038. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4039. target);
  4040. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4041. static_cast< ::google::protobuf::int32>(
  4042. _packed_sint64_cached_byte_size_), target);
  4043. target = ::google::protobuf::internal::WireFormatLite::
  4044. WriteSInt64NoTagToArray(this->packed_sint64_, target);
  4045. }
  4046. // repeated fixed32 packed_fixed32 = 96 [packed = true];
  4047. if (this->packed_fixed32_size() > 0) {
  4048. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4049. 96,
  4050. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4051. target);
  4052. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4053. static_cast< ::google::protobuf::int32>(
  4054. _packed_fixed32_cached_byte_size_), target);
  4055. target = ::google::protobuf::internal::WireFormatLite::
  4056. WriteFixed32NoTagToArray(this->packed_fixed32_, target);
  4057. }
  4058. // repeated fixed64 packed_fixed64 = 97 [packed = true];
  4059. if (this->packed_fixed64_size() > 0) {
  4060. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4061. 97,
  4062. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4063. target);
  4064. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4065. static_cast< ::google::protobuf::int32>(
  4066. _packed_fixed64_cached_byte_size_), target);
  4067. target = ::google::protobuf::internal::WireFormatLite::
  4068. WriteFixed64NoTagToArray(this->packed_fixed64_, target);
  4069. }
  4070. // repeated sfixed32 packed_sfixed32 = 98 [packed = true];
  4071. if (this->packed_sfixed32_size() > 0) {
  4072. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4073. 98,
  4074. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4075. target);
  4076. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4077. static_cast< ::google::protobuf::int32>(
  4078. _packed_sfixed32_cached_byte_size_), target);
  4079. target = ::google::protobuf::internal::WireFormatLite::
  4080. WriteSFixed32NoTagToArray(this->packed_sfixed32_, target);
  4081. }
  4082. // repeated sfixed64 packed_sfixed64 = 99 [packed = true];
  4083. if (this->packed_sfixed64_size() > 0) {
  4084. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4085. 99,
  4086. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4087. target);
  4088. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4089. static_cast< ::google::protobuf::int32>(
  4090. _packed_sfixed64_cached_byte_size_), target);
  4091. target = ::google::protobuf::internal::WireFormatLite::
  4092. WriteSFixed64NoTagToArray(this->packed_sfixed64_, target);
  4093. }
  4094. // repeated float packed_float = 100 [packed = true];
  4095. if (this->packed_float_size() > 0) {
  4096. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4097. 100,
  4098. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4099. target);
  4100. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4101. static_cast< ::google::protobuf::int32>(
  4102. _packed_float_cached_byte_size_), target);
  4103. target = ::google::protobuf::internal::WireFormatLite::
  4104. WriteFloatNoTagToArray(this->packed_float_, target);
  4105. }
  4106. // repeated double packed_double = 101 [packed = true];
  4107. if (this->packed_double_size() > 0) {
  4108. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4109. 101,
  4110. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4111. target);
  4112. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4113. static_cast< ::google::protobuf::int32>(
  4114. _packed_double_cached_byte_size_), target);
  4115. target = ::google::protobuf::internal::WireFormatLite::
  4116. WriteDoubleNoTagToArray(this->packed_double_, target);
  4117. }
  4118. // repeated bool packed_bool = 102 [packed = true];
  4119. if (this->packed_bool_size() > 0) {
  4120. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4121. 102,
  4122. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4123. target);
  4124. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
  4125. static_cast< ::google::protobuf::int32>(
  4126. _packed_bool_cached_byte_size_), target);
  4127. target = ::google::protobuf::internal::WireFormatLite::
  4128. WriteBoolNoTagToArray(this->packed_bool_, target);
  4129. }
  4130. // repeated .proto3_arena_unittest.ForeignEnum packed_enum = 103 [packed = true];
  4131. if (this->packed_enum_size() > 0) {
  4132. target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
  4133. 103,
  4134. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
  4135. target);
  4136. target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
  4137. _packed_enum_cached_byte_size_), target);
  4138. target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
  4139. this->packed_enum_, target);
  4140. }
  4141. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  4142. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  4143. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  4144. }
  4145. // @@protoc_insertion_point(serialize_to_array_end:proto3_arena_unittest.TestPackedTypes)
  4146. return target;
  4147. }
  4148. size_t TestPackedTypes::ByteSizeLong() const {
  4149. // @@protoc_insertion_point(message_byte_size_start:proto3_arena_unittest.TestPackedTypes)
  4150. size_t total_size = 0;
  4151. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  4152. total_size +=
  4153. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  4154. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  4155. }
  4156. // repeated int32 packed_int32 = 90 [packed = true];
  4157. {
  4158. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  4159. Int32Size(this->packed_int32_);
  4160. if (data_size > 0) {
  4161. total_size += 2 +
  4162. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4163. static_cast< ::google::protobuf::int32>(data_size));
  4164. }
  4165. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4166. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4167. _packed_int32_cached_byte_size_ = cached_size;
  4168. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4169. total_size += data_size;
  4170. }
  4171. // repeated int64 packed_int64 = 91 [packed = true];
  4172. {
  4173. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  4174. Int64Size(this->packed_int64_);
  4175. if (data_size > 0) {
  4176. total_size += 2 +
  4177. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4178. static_cast< ::google::protobuf::int32>(data_size));
  4179. }
  4180. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4181. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4182. _packed_int64_cached_byte_size_ = cached_size;
  4183. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4184. total_size += data_size;
  4185. }
  4186. // repeated uint32 packed_uint32 = 92 [packed = true];
  4187. {
  4188. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  4189. UInt32Size(this->packed_uint32_);
  4190. if (data_size > 0) {
  4191. total_size += 2 +
  4192. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4193. static_cast< ::google::protobuf::int32>(data_size));
  4194. }
  4195. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4196. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4197. _packed_uint32_cached_byte_size_ = cached_size;
  4198. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4199. total_size += data_size;
  4200. }
  4201. // repeated uint64 packed_uint64 = 93 [packed = true];
  4202. {
  4203. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  4204. UInt64Size(this->packed_uint64_);
  4205. if (data_size > 0) {
  4206. total_size += 2 +
  4207. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4208. static_cast< ::google::protobuf::int32>(data_size));
  4209. }
  4210. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4211. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4212. _packed_uint64_cached_byte_size_ = cached_size;
  4213. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4214. total_size += data_size;
  4215. }
  4216. // repeated sint32 packed_sint32 = 94 [packed = true];
  4217. {
  4218. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  4219. SInt32Size(this->packed_sint32_);
  4220. if (data_size > 0) {
  4221. total_size += 2 +
  4222. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4223. static_cast< ::google::protobuf::int32>(data_size));
  4224. }
  4225. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4226. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4227. _packed_sint32_cached_byte_size_ = cached_size;
  4228. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4229. total_size += data_size;
  4230. }
  4231. // repeated sint64 packed_sint64 = 95 [packed = true];
  4232. {
  4233. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  4234. SInt64Size(this->packed_sint64_);
  4235. if (data_size > 0) {
  4236. total_size += 2 +
  4237. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4238. static_cast< ::google::protobuf::int32>(data_size));
  4239. }
  4240. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4241. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4242. _packed_sint64_cached_byte_size_ = cached_size;
  4243. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4244. total_size += data_size;
  4245. }
  4246. // repeated fixed32 packed_fixed32 = 96 [packed = true];
  4247. {
  4248. unsigned int count = static_cast<unsigned int>(this->packed_fixed32_size());
  4249. size_t data_size = 4UL * count;
  4250. if (data_size > 0) {
  4251. total_size += 2 +
  4252. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4253. static_cast< ::google::protobuf::int32>(data_size));
  4254. }
  4255. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4256. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4257. _packed_fixed32_cached_byte_size_ = cached_size;
  4258. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4259. total_size += data_size;
  4260. }
  4261. // repeated fixed64 packed_fixed64 = 97 [packed = true];
  4262. {
  4263. unsigned int count = static_cast<unsigned int>(this->packed_fixed64_size());
  4264. size_t data_size = 8UL * count;
  4265. if (data_size > 0) {
  4266. total_size += 2 +
  4267. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4268. static_cast< ::google::protobuf::int32>(data_size));
  4269. }
  4270. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4271. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4272. _packed_fixed64_cached_byte_size_ = cached_size;
  4273. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4274. total_size += data_size;
  4275. }
  4276. // repeated sfixed32 packed_sfixed32 = 98 [packed = true];
  4277. {
  4278. unsigned int count = static_cast<unsigned int>(this->packed_sfixed32_size());
  4279. size_t data_size = 4UL * count;
  4280. if (data_size > 0) {
  4281. total_size += 2 +
  4282. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4283. static_cast< ::google::protobuf::int32>(data_size));
  4284. }
  4285. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4286. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4287. _packed_sfixed32_cached_byte_size_ = cached_size;
  4288. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4289. total_size += data_size;
  4290. }
  4291. // repeated sfixed64 packed_sfixed64 = 99 [packed = true];
  4292. {
  4293. unsigned int count = static_cast<unsigned int>(this->packed_sfixed64_size());
  4294. size_t data_size = 8UL * count;
  4295. if (data_size > 0) {
  4296. total_size += 2 +
  4297. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4298. static_cast< ::google::protobuf::int32>(data_size));
  4299. }
  4300. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4301. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4302. _packed_sfixed64_cached_byte_size_ = cached_size;
  4303. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4304. total_size += data_size;
  4305. }
  4306. // repeated float packed_float = 100 [packed = true];
  4307. {
  4308. unsigned int count = static_cast<unsigned int>(this->packed_float_size());
  4309. size_t data_size = 4UL * count;
  4310. if (data_size > 0) {
  4311. total_size += 2 +
  4312. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4313. static_cast< ::google::protobuf::int32>(data_size));
  4314. }
  4315. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4316. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4317. _packed_float_cached_byte_size_ = cached_size;
  4318. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4319. total_size += data_size;
  4320. }
  4321. // repeated double packed_double = 101 [packed = true];
  4322. {
  4323. unsigned int count = static_cast<unsigned int>(this->packed_double_size());
  4324. size_t data_size = 8UL * count;
  4325. if (data_size > 0) {
  4326. total_size += 2 +
  4327. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4328. static_cast< ::google::protobuf::int32>(data_size));
  4329. }
  4330. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4331. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4332. _packed_double_cached_byte_size_ = cached_size;
  4333. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4334. total_size += data_size;
  4335. }
  4336. // repeated bool packed_bool = 102 [packed = true];
  4337. {
  4338. unsigned int count = static_cast<unsigned int>(this->packed_bool_size());
  4339. size_t data_size = 1UL * count;
  4340. if (data_size > 0) {
  4341. total_size += 2 +
  4342. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4343. static_cast< ::google::protobuf::int32>(data_size));
  4344. }
  4345. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4346. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4347. _packed_bool_cached_byte_size_ = cached_size;
  4348. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4349. total_size += data_size;
  4350. }
  4351. // repeated .proto3_arena_unittest.ForeignEnum packed_enum = 103 [packed = true];
  4352. {
  4353. size_t data_size = 0;
  4354. unsigned int count = static_cast<unsigned int>(this->packed_enum_size());for (unsigned int i = 0; i < count; i++) {
  4355. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  4356. this->packed_enum(static_cast<int>(i)));
  4357. }
  4358. if (data_size > 0) {
  4359. total_size += 2 +
  4360. ::google::protobuf::internal::WireFormatLite::Int32Size(
  4361. static_cast< ::google::protobuf::int32>(data_size));
  4362. }
  4363. int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
  4364. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  4365. _packed_enum_cached_byte_size_ = cached_size;
  4366. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  4367. total_size += data_size;
  4368. }
  4369. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  4370. SetCachedSize(cached_size);
  4371. return total_size;
  4372. }
  4373. void TestPackedTypes::MergeFrom(const ::google::protobuf::Message& from) {
  4374. // @@protoc_insertion_point(generalized_merge_from_start:proto3_arena_unittest.TestPackedTypes)
  4375. GOOGLE_DCHECK_NE(&from, this);
  4376. const TestPackedTypes* source =
  4377. ::google::protobuf::internal::DynamicCastToGenerated<const TestPackedTypes>(
  4378. &from);
  4379. if (source == NULL) {
  4380. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_arena_unittest.TestPackedTypes)
  4381. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  4382. } else {
  4383. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_arena_unittest.TestPackedTypes)
  4384. MergeFrom(*source);
  4385. }
  4386. }
  4387. void TestPackedTypes::MergeFrom(const TestPackedTypes& from) {
  4388. // @@protoc_insertion_point(class_specific_merge_from_start:proto3_arena_unittest.TestPackedTypes)
  4389. GOOGLE_DCHECK_NE(&from, this);
  4390. _internal_metadata_.MergeFrom(from._internal_metadata_);
  4391. ::google::protobuf::uint32 cached_has_bits = 0;
  4392. (void) cached_has_bits;
  4393. packed_int32_.MergeFrom(from.packed_int32_);
  4394. packed_int64_.MergeFrom(from.packed_int64_);
  4395. packed_uint32_.MergeFrom(from.packed_uint32_);
  4396. packed_uint64_.MergeFrom(from.packed_uint64_);
  4397. packed_sint32_.MergeFrom(from.packed_sint32_);
  4398. packed_sint64_.MergeFrom(from.packed_sint64_);
  4399. packed_fixed32_.MergeFrom(from.packed_fixed32_);
  4400. packed_fixed64_.MergeFrom(from.packed_fixed64_);
  4401. packed_sfixed32_.MergeFrom(from.packed_sfixed32_);
  4402. packed_sfixed64_.MergeFrom(from.packed_sfixed64_);
  4403. packed_float_.MergeFrom(from.packed_float_);
  4404. packed_double_.MergeFrom(from.packed_double_);
  4405. packed_bool_.MergeFrom(from.packed_bool_);
  4406. packed_enum_.MergeFrom(from.packed_enum_);
  4407. }
  4408. void TestPackedTypes::CopyFrom(const ::google::protobuf::Message& from) {
  4409. // @@protoc_insertion_point(generalized_copy_from_start:proto3_arena_unittest.TestPackedTypes)
  4410. if (&from == this) return;
  4411. Clear();
  4412. MergeFrom(from);
  4413. }
  4414. void TestPackedTypes::CopyFrom(const TestPackedTypes& from) {
  4415. // @@protoc_insertion_point(class_specific_copy_from_start:proto3_arena_unittest.TestPackedTypes)
  4416. if (&from == this) return;
  4417. Clear();
  4418. MergeFrom(from);
  4419. }
  4420. bool TestPackedTypes::IsInitialized() const {
  4421. return true;
  4422. }
  4423. void TestPackedTypes::Swap(TestPackedTypes* other) {
  4424. if (other == this) return;
  4425. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  4426. InternalSwap(other);
  4427. } else {
  4428. TestPackedTypes* temp = New(GetArenaNoVirtual());
  4429. temp->MergeFrom(*other);
  4430. other->CopyFrom(*this);
  4431. InternalSwap(temp);
  4432. if (GetArenaNoVirtual() == NULL) {
  4433. delete temp;
  4434. }
  4435. }
  4436. }
  4437. void TestPackedTypes::UnsafeArenaSwap(TestPackedTypes* other) {
  4438. if (other == this) return;
  4439. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  4440. InternalSwap(other);
  4441. }
  4442. void TestPackedTypes::InternalSwap(TestPackedTypes* other) {
  4443. using std::swap;
  4444. packed_int32_.InternalSwap(&other->packed_int32_);
  4445. packed_int64_.InternalSwap(&other->packed_int64_);
  4446. packed_uint32_.InternalSwap(&other->packed_uint32_);
  4447. packed_uint64_.InternalSwap(&other->packed_uint64_);
  4448. packed_sint32_.InternalSwap(&other->packed_sint32_);
  4449. packed_sint64_.InternalSwap(&other->packed_sint64_);
  4450. packed_fixed32_.InternalSwap(&other->packed_fixed32_);
  4451. packed_fixed64_.InternalSwap(&other->packed_fixed64_);
  4452. packed_sfixed32_.InternalSwap(&other->packed_sfixed32_);
  4453. packed_sfixed64_.InternalSwap(&other->packed_sfixed64_);
  4454. packed_float_.InternalSwap(&other->packed_float_);
  4455. packed_double_.InternalSwap(&other->packed_double_);
  4456. packed_bool_.InternalSwap(&other->packed_bool_);
  4457. packed_enum_.InternalSwap(&other->packed_enum_);
  4458. _internal_metadata_.Swap(&other->_internal_metadata_);
  4459. }
  4460. ::google::protobuf::Metadata TestPackedTypes::GetMetadata() const {
  4461. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  4462. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  4463. }
  4464. // ===================================================================
  4465. void TestUnpackedTypes::InitAsDefaultInstance() {
  4466. }
  4467. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  4468. const int TestUnpackedTypes::kRepeatedInt32FieldNumber;
  4469. const int TestUnpackedTypes::kRepeatedInt64FieldNumber;
  4470. const int TestUnpackedTypes::kRepeatedUint32FieldNumber;
  4471. const int TestUnpackedTypes::kRepeatedUint64FieldNumber;
  4472. const int TestUnpackedTypes::kRepeatedSint32FieldNumber;
  4473. const int TestUnpackedTypes::kRepeatedSint64FieldNumber;
  4474. const int TestUnpackedTypes::kRepeatedFixed32FieldNumber;
  4475. const int TestUnpackedTypes::kRepeatedFixed64FieldNumber;
  4476. const int TestUnpackedTypes::kRepeatedSfixed32FieldNumber;
  4477. const int TestUnpackedTypes::kRepeatedSfixed64FieldNumber;
  4478. const int TestUnpackedTypes::kRepeatedFloatFieldNumber;
  4479. const int TestUnpackedTypes::kRepeatedDoubleFieldNumber;
  4480. const int TestUnpackedTypes::kRepeatedBoolFieldNumber;
  4481. const int TestUnpackedTypes::kRepeatedNestedEnumFieldNumber;
  4482. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  4483. TestUnpackedTypes::TestUnpackedTypes()
  4484. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  4485. ::google::protobuf::internal::InitSCC(
  4486. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestUnpackedTypes.base);
  4487. SharedCtor();
  4488. // @@protoc_insertion_point(constructor:proto3_arena_unittest.TestUnpackedTypes)
  4489. }
  4490. TestUnpackedTypes::TestUnpackedTypes(::google::protobuf::Arena* arena)
  4491. : ::google::protobuf::Message(),
  4492. _internal_metadata_(arena),
  4493. repeated_int32_(arena),
  4494. repeated_int64_(arena),
  4495. repeated_uint32_(arena),
  4496. repeated_uint64_(arena),
  4497. repeated_sint32_(arena),
  4498. repeated_sint64_(arena),
  4499. repeated_fixed32_(arena),
  4500. repeated_fixed64_(arena),
  4501. repeated_sfixed32_(arena),
  4502. repeated_sfixed64_(arena),
  4503. repeated_float_(arena),
  4504. repeated_double_(arena),
  4505. repeated_bool_(arena),
  4506. repeated_nested_enum_(arena) {
  4507. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestUnpackedTypes.base);
  4508. SharedCtor();
  4509. RegisterArenaDtor(arena);
  4510. // @@protoc_insertion_point(arena_constructor:proto3_arena_unittest.TestUnpackedTypes)
  4511. }
  4512. TestUnpackedTypes::TestUnpackedTypes(const TestUnpackedTypes& from)
  4513. : ::google::protobuf::Message(),
  4514. _internal_metadata_(NULL),
  4515. repeated_int32_(from.repeated_int32_),
  4516. repeated_int64_(from.repeated_int64_),
  4517. repeated_uint32_(from.repeated_uint32_),
  4518. repeated_uint64_(from.repeated_uint64_),
  4519. repeated_sint32_(from.repeated_sint32_),
  4520. repeated_sint64_(from.repeated_sint64_),
  4521. repeated_fixed32_(from.repeated_fixed32_),
  4522. repeated_fixed64_(from.repeated_fixed64_),
  4523. repeated_sfixed32_(from.repeated_sfixed32_),
  4524. repeated_sfixed64_(from.repeated_sfixed64_),
  4525. repeated_float_(from.repeated_float_),
  4526. repeated_double_(from.repeated_double_),
  4527. repeated_bool_(from.repeated_bool_),
  4528. repeated_nested_enum_(from.repeated_nested_enum_) {
  4529. _internal_metadata_.MergeFrom(from._internal_metadata_);
  4530. // @@protoc_insertion_point(copy_constructor:proto3_arena_unittest.TestUnpackedTypes)
  4531. }
  4532. void TestUnpackedTypes::SharedCtor() {
  4533. }
  4534. TestUnpackedTypes::~TestUnpackedTypes() {
  4535. // @@protoc_insertion_point(destructor:proto3_arena_unittest.TestUnpackedTypes)
  4536. SharedDtor();
  4537. }
  4538. void TestUnpackedTypes::SharedDtor() {
  4539. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  4540. }
  4541. void TestUnpackedTypes::ArenaDtor(void* object) {
  4542. TestUnpackedTypes* _this = reinterpret_cast< TestUnpackedTypes* >(object);
  4543. (void)_this;
  4544. }
  4545. void TestUnpackedTypes::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  4546. }
  4547. void TestUnpackedTypes::SetCachedSize(int size) const {
  4548. _cached_size_.Set(size);
  4549. }
  4550. const ::google::protobuf::Descriptor* TestUnpackedTypes::descriptor() {
  4551. ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  4552. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  4553. }
  4554. const TestUnpackedTypes& TestUnpackedTypes::default_instance() {
  4555. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestUnpackedTypes.base);
  4556. return *internal_default_instance();
  4557. }
  4558. void TestUnpackedTypes::Clear() {
  4559. // @@protoc_insertion_point(message_clear_start:proto3_arena_unittest.TestUnpackedTypes)
  4560. ::google::protobuf::uint32 cached_has_bits = 0;
  4561. // Prevent compiler warnings about cached_has_bits being unused
  4562. (void) cached_has_bits;
  4563. repeated_int32_.Clear();
  4564. repeated_int64_.Clear();
  4565. repeated_uint32_.Clear();
  4566. repeated_uint64_.Clear();
  4567. repeated_sint32_.Clear();
  4568. repeated_sint64_.Clear();
  4569. repeated_fixed32_.Clear();
  4570. repeated_fixed64_.Clear();
  4571. repeated_sfixed32_.Clear();
  4572. repeated_sfixed64_.Clear();
  4573. repeated_float_.Clear();
  4574. repeated_double_.Clear();
  4575. repeated_bool_.Clear();
  4576. repeated_nested_enum_.Clear();
  4577. _internal_metadata_.Clear();
  4578. }
  4579. bool TestUnpackedTypes::MergePartialFromCodedStream(
  4580. ::google::protobuf::io::CodedInputStream* input) {
  4581. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  4582. ::google::protobuf::uint32 tag;
  4583. // @@protoc_insertion_point(parse_start:proto3_arena_unittest.TestUnpackedTypes)
  4584. for (;;) {
  4585. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  4586. tag = p.first;
  4587. if (!p.second) goto handle_unusual;
  4588. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  4589. // repeated int32 repeated_int32 = 1 [packed = false];
  4590. case 1: {
  4591. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4592. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  4593. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4594. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  4595. 1, 8u, input, this->mutable_repeated_int32())));
  4596. } else if (
  4597. static_cast< ::google::protobuf::uint8>(tag) ==
  4598. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  4599. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4600. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  4601. input, this->mutable_repeated_int32())));
  4602. } else {
  4603. goto handle_unusual;
  4604. }
  4605. break;
  4606. }
  4607. // repeated int64 repeated_int64 = 2 [packed = false];
  4608. case 2: {
  4609. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4610. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  4611. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4612. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  4613. 1, 16u, input, this->mutable_repeated_int64())));
  4614. } else if (
  4615. static_cast< ::google::protobuf::uint8>(tag) ==
  4616. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  4617. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4618. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  4619. input, this->mutable_repeated_int64())));
  4620. } else {
  4621. goto handle_unusual;
  4622. }
  4623. break;
  4624. }
  4625. // repeated uint32 repeated_uint32 = 3 [packed = false];
  4626. case 3: {
  4627. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4628. static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
  4629. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4630. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  4631. 1, 24u, input, this->mutable_repeated_uint32())));
  4632. } else if (
  4633. static_cast< ::google::protobuf::uint8>(tag) ==
  4634. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  4635. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4636. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  4637. input, this->mutable_repeated_uint32())));
  4638. } else {
  4639. goto handle_unusual;
  4640. }
  4641. break;
  4642. }
  4643. // repeated uint64 repeated_uint64 = 4 [packed = false];
  4644. case 4: {
  4645. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4646. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  4647. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4648. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  4649. 1, 32u, input, this->mutable_repeated_uint64())));
  4650. } else if (
  4651. static_cast< ::google::protobuf::uint8>(tag) ==
  4652. static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
  4653. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4654. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  4655. input, this->mutable_repeated_uint64())));
  4656. } else {
  4657. goto handle_unusual;
  4658. }
  4659. break;
  4660. }
  4661. // repeated sint32 repeated_sint32 = 5 [packed = false];
  4662. case 5: {
  4663. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4664. static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  4665. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4666. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  4667. 1, 40u, input, this->mutable_repeated_sint32())));
  4668. } else if (
  4669. static_cast< ::google::protobuf::uint8>(tag) ==
  4670. static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
  4671. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4672. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  4673. input, this->mutable_repeated_sint32())));
  4674. } else {
  4675. goto handle_unusual;
  4676. }
  4677. break;
  4678. }
  4679. // repeated sint64 repeated_sint64 = 6 [packed = false];
  4680. case 6: {
  4681. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4682. static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
  4683. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4684. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  4685. 1, 48u, input, this->mutable_repeated_sint64())));
  4686. } else if (
  4687. static_cast< ::google::protobuf::uint8>(tag) ==
  4688. static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
  4689. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4690. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
  4691. input, this->mutable_repeated_sint64())));
  4692. } else {
  4693. goto handle_unusual;
  4694. }
  4695. break;
  4696. }
  4697. // repeated fixed32 repeated_fixed32 = 7 [packed = false];
  4698. case 7: {
  4699. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4700. static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
  4701. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4702. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  4703. 1, 61u, input, this->mutable_repeated_fixed32())));
  4704. } else if (
  4705. static_cast< ::google::protobuf::uint8>(tag) ==
  4706. static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
  4707. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4708. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>(
  4709. input, this->mutable_repeated_fixed32())));
  4710. } else {
  4711. goto handle_unusual;
  4712. }
  4713. break;
  4714. }
  4715. // repeated fixed64 repeated_fixed64 = 8 [packed = false];
  4716. case 8: {
  4717. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4718. static_cast< ::google::protobuf::uint8>(65u /* 65 & 0xFF */)) {
  4719. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4720. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  4721. 1, 65u, input, this->mutable_repeated_fixed64())));
  4722. } else if (
  4723. static_cast< ::google::protobuf::uint8>(tag) ==
  4724. static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
  4725. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4726. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
  4727. input, this->mutable_repeated_fixed64())));
  4728. } else {
  4729. goto handle_unusual;
  4730. }
  4731. break;
  4732. }
  4733. // repeated sfixed32 repeated_sfixed32 = 9 [packed = false];
  4734. case 9: {
  4735. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4736. static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
  4737. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4738. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  4739. 1, 77u, input, this->mutable_repeated_sfixed32())));
  4740. } else if (
  4741. static_cast< ::google::protobuf::uint8>(tag) ==
  4742. static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
  4743. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4744. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED32>(
  4745. input, this->mutable_repeated_sfixed32())));
  4746. } else {
  4747. goto handle_unusual;
  4748. }
  4749. break;
  4750. }
  4751. // repeated sfixed64 repeated_sfixed64 = 10 [packed = false];
  4752. case 10: {
  4753. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4754. static_cast< ::google::protobuf::uint8>(81u /* 81 & 0xFF */)) {
  4755. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4756. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  4757. 1, 81u, input, this->mutable_repeated_sfixed64())));
  4758. } else if (
  4759. static_cast< ::google::protobuf::uint8>(tag) ==
  4760. static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
  4761. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4762. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SFIXED64>(
  4763. input, this->mutable_repeated_sfixed64())));
  4764. } else {
  4765. goto handle_unusual;
  4766. }
  4767. break;
  4768. }
  4769. // repeated float repeated_float = 11 [packed = false];
  4770. case 11: {
  4771. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4772. static_cast< ::google::protobuf::uint8>(93u /* 93 & 0xFF */)) {
  4773. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4774. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  4775. 1, 93u, input, this->mutable_repeated_float())));
  4776. } else if (
  4777. static_cast< ::google::protobuf::uint8>(tag) ==
  4778. static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
  4779. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4780. float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
  4781. input, this->mutable_repeated_float())));
  4782. } else {
  4783. goto handle_unusual;
  4784. }
  4785. break;
  4786. }
  4787. // repeated double repeated_double = 12 [packed = false];
  4788. case 12: {
  4789. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4790. static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) {
  4791. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4792. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  4793. 1, 97u, input, this->mutable_repeated_double())));
  4794. } else if (
  4795. static_cast< ::google::protobuf::uint8>(tag) ==
  4796. static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
  4797. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4798. double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
  4799. input, this->mutable_repeated_double())));
  4800. } else {
  4801. goto handle_unusual;
  4802. }
  4803. break;
  4804. }
  4805. // repeated bool repeated_bool = 13 [packed = false];
  4806. case 13: {
  4807. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4808. static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
  4809. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  4810. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  4811. 1, 104u, input, this->mutable_repeated_bool())));
  4812. } else if (
  4813. static_cast< ::google::protobuf::uint8>(tag) ==
  4814. static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
  4815. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  4816. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  4817. input, this->mutable_repeated_bool())));
  4818. } else {
  4819. goto handle_unusual;
  4820. }
  4821. break;
  4822. }
  4823. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 14 [packed = false];
  4824. case 14: {
  4825. if (static_cast< ::google::protobuf::uint8>(tag) ==
  4826. static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) {
  4827. int value;
  4828. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  4829. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  4830. input, &value)));
  4831. add_repeated_nested_enum(static_cast< ::proto3_arena_unittest::TestAllTypes_NestedEnum >(value));
  4832. } else if (
  4833. static_cast< ::google::protobuf::uint8>(tag) ==
  4834. static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
  4835. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumPreserveUnknowns(
  4836. input,
  4837. 14,
  4838. NULL,
  4839. NULL,
  4840. this->mutable_repeated_nested_enum())));
  4841. } else {
  4842. goto handle_unusual;
  4843. }
  4844. break;
  4845. }
  4846. default: {
  4847. handle_unusual:
  4848. if (tag == 0) {
  4849. goto success;
  4850. }
  4851. DO_(::google::protobuf::internal::WireFormat::SkipField(
  4852. input, tag, _internal_metadata_.mutable_unknown_fields()));
  4853. break;
  4854. }
  4855. }
  4856. }
  4857. success:
  4858. // @@protoc_insertion_point(parse_success:proto3_arena_unittest.TestUnpackedTypes)
  4859. return true;
  4860. failure:
  4861. // @@protoc_insertion_point(parse_failure:proto3_arena_unittest.TestUnpackedTypes)
  4862. return false;
  4863. #undef DO_
  4864. }
  4865. void TestUnpackedTypes::SerializeWithCachedSizes(
  4866. ::google::protobuf::io::CodedOutputStream* output) const {
  4867. // @@protoc_insertion_point(serialize_start:proto3_arena_unittest.TestUnpackedTypes)
  4868. ::google::protobuf::uint32 cached_has_bits = 0;
  4869. (void) cached_has_bits;
  4870. // repeated int32 repeated_int32 = 1 [packed = false];
  4871. for (int i = 0, n = this->repeated_int32_size(); i < n; i++) {
  4872. ::google::protobuf::internal::WireFormatLite::WriteInt32(
  4873. 1, this->repeated_int32(i), output);
  4874. }
  4875. // repeated int64 repeated_int64 = 2 [packed = false];
  4876. for (int i = 0, n = this->repeated_int64_size(); i < n; i++) {
  4877. ::google::protobuf::internal::WireFormatLite::WriteInt64(
  4878. 2, this->repeated_int64(i), output);
  4879. }
  4880. // repeated uint32 repeated_uint32 = 3 [packed = false];
  4881. for (int i = 0, n = this->repeated_uint32_size(); i < n; i++) {
  4882. ::google::protobuf::internal::WireFormatLite::WriteUInt32(
  4883. 3, this->repeated_uint32(i), output);
  4884. }
  4885. // repeated uint64 repeated_uint64 = 4 [packed = false];
  4886. for (int i = 0, n = this->repeated_uint64_size(); i < n; i++) {
  4887. ::google::protobuf::internal::WireFormatLite::WriteUInt64(
  4888. 4, this->repeated_uint64(i), output);
  4889. }
  4890. // repeated sint32 repeated_sint32 = 5 [packed = false];
  4891. for (int i = 0, n = this->repeated_sint32_size(); i < n; i++) {
  4892. ::google::protobuf::internal::WireFormatLite::WriteSInt32(
  4893. 5, this->repeated_sint32(i), output);
  4894. }
  4895. // repeated sint64 repeated_sint64 = 6 [packed = false];
  4896. for (int i = 0, n = this->repeated_sint64_size(); i < n; i++) {
  4897. ::google::protobuf::internal::WireFormatLite::WriteSInt64(
  4898. 6, this->repeated_sint64(i), output);
  4899. }
  4900. // repeated fixed32 repeated_fixed32 = 7 [packed = false];
  4901. for (int i = 0, n = this->repeated_fixed32_size(); i < n; i++) {
  4902. ::google::protobuf::internal::WireFormatLite::WriteFixed32(
  4903. 7, this->repeated_fixed32(i), output);
  4904. }
  4905. // repeated fixed64 repeated_fixed64 = 8 [packed = false];
  4906. for (int i = 0, n = this->repeated_fixed64_size(); i < n; i++) {
  4907. ::google::protobuf::internal::WireFormatLite::WriteFixed64(
  4908. 8, this->repeated_fixed64(i), output);
  4909. }
  4910. // repeated sfixed32 repeated_sfixed32 = 9 [packed = false];
  4911. for (int i = 0, n = this->repeated_sfixed32_size(); i < n; i++) {
  4912. ::google::protobuf::internal::WireFormatLite::WriteSFixed32(
  4913. 9, this->repeated_sfixed32(i), output);
  4914. }
  4915. // repeated sfixed64 repeated_sfixed64 = 10 [packed = false];
  4916. for (int i = 0, n = this->repeated_sfixed64_size(); i < n; i++) {
  4917. ::google::protobuf::internal::WireFormatLite::WriteSFixed64(
  4918. 10, this->repeated_sfixed64(i), output);
  4919. }
  4920. // repeated float repeated_float = 11 [packed = false];
  4921. for (int i = 0, n = this->repeated_float_size(); i < n; i++) {
  4922. ::google::protobuf::internal::WireFormatLite::WriteFloat(
  4923. 11, this->repeated_float(i), output);
  4924. }
  4925. // repeated double repeated_double = 12 [packed = false];
  4926. for (int i = 0, n = this->repeated_double_size(); i < n; i++) {
  4927. ::google::protobuf::internal::WireFormatLite::WriteDouble(
  4928. 12, this->repeated_double(i), output);
  4929. }
  4930. // repeated bool repeated_bool = 13 [packed = false];
  4931. for (int i = 0, n = this->repeated_bool_size(); i < n; i++) {
  4932. ::google::protobuf::internal::WireFormatLite::WriteBool(
  4933. 13, this->repeated_bool(i), output);
  4934. }
  4935. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 14 [packed = false];
  4936. for (int i = 0, n = this->repeated_nested_enum_size(); i < n; i++) {
  4937. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  4938. 14, this->repeated_nested_enum(i), output);
  4939. }
  4940. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  4941. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  4942. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  4943. }
  4944. // @@protoc_insertion_point(serialize_end:proto3_arena_unittest.TestUnpackedTypes)
  4945. }
  4946. ::google::protobuf::uint8* TestUnpackedTypes::InternalSerializeWithCachedSizesToArray(
  4947. bool deterministic, ::google::protobuf::uint8* target) const {
  4948. (void)deterministic; // Unused
  4949. // @@protoc_insertion_point(serialize_to_array_start:proto3_arena_unittest.TestUnpackedTypes)
  4950. ::google::protobuf::uint32 cached_has_bits = 0;
  4951. (void) cached_has_bits;
  4952. // repeated int32 repeated_int32 = 1 [packed = false];
  4953. target = ::google::protobuf::internal::WireFormatLite::
  4954. WriteInt32ToArray(1, this->repeated_int32_, target);
  4955. // repeated int64 repeated_int64 = 2 [packed = false];
  4956. target = ::google::protobuf::internal::WireFormatLite::
  4957. WriteInt64ToArray(2, this->repeated_int64_, target);
  4958. // repeated uint32 repeated_uint32 = 3 [packed = false];
  4959. target = ::google::protobuf::internal::WireFormatLite::
  4960. WriteUInt32ToArray(3, this->repeated_uint32_, target);
  4961. // repeated uint64 repeated_uint64 = 4 [packed = false];
  4962. target = ::google::protobuf::internal::WireFormatLite::
  4963. WriteUInt64ToArray(4, this->repeated_uint64_, target);
  4964. // repeated sint32 repeated_sint32 = 5 [packed = false];
  4965. target = ::google::protobuf::internal::WireFormatLite::
  4966. WriteSInt32ToArray(5, this->repeated_sint32_, target);
  4967. // repeated sint64 repeated_sint64 = 6 [packed = false];
  4968. target = ::google::protobuf::internal::WireFormatLite::
  4969. WriteSInt64ToArray(6, this->repeated_sint64_, target);
  4970. // repeated fixed32 repeated_fixed32 = 7 [packed = false];
  4971. target = ::google::protobuf::internal::WireFormatLite::
  4972. WriteFixed32ToArray(7, this->repeated_fixed32_, target);
  4973. // repeated fixed64 repeated_fixed64 = 8 [packed = false];
  4974. target = ::google::protobuf::internal::WireFormatLite::
  4975. WriteFixed64ToArray(8, this->repeated_fixed64_, target);
  4976. // repeated sfixed32 repeated_sfixed32 = 9 [packed = false];
  4977. target = ::google::protobuf::internal::WireFormatLite::
  4978. WriteSFixed32ToArray(9, this->repeated_sfixed32_, target);
  4979. // repeated sfixed64 repeated_sfixed64 = 10 [packed = false];
  4980. target = ::google::protobuf::internal::WireFormatLite::
  4981. WriteSFixed64ToArray(10, this->repeated_sfixed64_, target);
  4982. // repeated float repeated_float = 11 [packed = false];
  4983. target = ::google::protobuf::internal::WireFormatLite::
  4984. WriteFloatToArray(11, this->repeated_float_, target);
  4985. // repeated double repeated_double = 12 [packed = false];
  4986. target = ::google::protobuf::internal::WireFormatLite::
  4987. WriteDoubleToArray(12, this->repeated_double_, target);
  4988. // repeated bool repeated_bool = 13 [packed = false];
  4989. target = ::google::protobuf::internal::WireFormatLite::
  4990. WriteBoolToArray(13, this->repeated_bool_, target);
  4991. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 14 [packed = false];
  4992. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  4993. 14, this->repeated_nested_enum_, target);
  4994. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  4995. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  4996. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  4997. }
  4998. // @@protoc_insertion_point(serialize_to_array_end:proto3_arena_unittest.TestUnpackedTypes)
  4999. return target;
  5000. }
  5001. size_t TestUnpackedTypes::ByteSizeLong() const {
  5002. // @@protoc_insertion_point(message_byte_size_start:proto3_arena_unittest.TestUnpackedTypes)
  5003. size_t total_size = 0;
  5004. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5005. total_size +=
  5006. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  5007. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  5008. }
  5009. // repeated int32 repeated_int32 = 1 [packed = false];
  5010. {
  5011. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  5012. Int32Size(this->repeated_int32_);
  5013. total_size += 1 *
  5014. ::google::protobuf::internal::FromIntSize(this->repeated_int32_size());
  5015. total_size += data_size;
  5016. }
  5017. // repeated int64 repeated_int64 = 2 [packed = false];
  5018. {
  5019. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  5020. Int64Size(this->repeated_int64_);
  5021. total_size += 1 *
  5022. ::google::protobuf::internal::FromIntSize(this->repeated_int64_size());
  5023. total_size += data_size;
  5024. }
  5025. // repeated uint32 repeated_uint32 = 3 [packed = false];
  5026. {
  5027. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  5028. UInt32Size(this->repeated_uint32_);
  5029. total_size += 1 *
  5030. ::google::protobuf::internal::FromIntSize(this->repeated_uint32_size());
  5031. total_size += data_size;
  5032. }
  5033. // repeated uint64 repeated_uint64 = 4 [packed = false];
  5034. {
  5035. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  5036. UInt64Size(this->repeated_uint64_);
  5037. total_size += 1 *
  5038. ::google::protobuf::internal::FromIntSize(this->repeated_uint64_size());
  5039. total_size += data_size;
  5040. }
  5041. // repeated sint32 repeated_sint32 = 5 [packed = false];
  5042. {
  5043. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  5044. SInt32Size(this->repeated_sint32_);
  5045. total_size += 1 *
  5046. ::google::protobuf::internal::FromIntSize(this->repeated_sint32_size());
  5047. total_size += data_size;
  5048. }
  5049. // repeated sint64 repeated_sint64 = 6 [packed = false];
  5050. {
  5051. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  5052. SInt64Size(this->repeated_sint64_);
  5053. total_size += 1 *
  5054. ::google::protobuf::internal::FromIntSize(this->repeated_sint64_size());
  5055. total_size += data_size;
  5056. }
  5057. // repeated fixed32 repeated_fixed32 = 7 [packed = false];
  5058. {
  5059. unsigned int count = static_cast<unsigned int>(this->repeated_fixed32_size());
  5060. size_t data_size = 4UL * count;
  5061. total_size += 1 *
  5062. ::google::protobuf::internal::FromIntSize(this->repeated_fixed32_size());
  5063. total_size += data_size;
  5064. }
  5065. // repeated fixed64 repeated_fixed64 = 8 [packed = false];
  5066. {
  5067. unsigned int count = static_cast<unsigned int>(this->repeated_fixed64_size());
  5068. size_t data_size = 8UL * count;
  5069. total_size += 1 *
  5070. ::google::protobuf::internal::FromIntSize(this->repeated_fixed64_size());
  5071. total_size += data_size;
  5072. }
  5073. // repeated sfixed32 repeated_sfixed32 = 9 [packed = false];
  5074. {
  5075. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed32_size());
  5076. size_t data_size = 4UL * count;
  5077. total_size += 1 *
  5078. ::google::protobuf::internal::FromIntSize(this->repeated_sfixed32_size());
  5079. total_size += data_size;
  5080. }
  5081. // repeated sfixed64 repeated_sfixed64 = 10 [packed = false];
  5082. {
  5083. unsigned int count = static_cast<unsigned int>(this->repeated_sfixed64_size());
  5084. size_t data_size = 8UL * count;
  5085. total_size += 1 *
  5086. ::google::protobuf::internal::FromIntSize(this->repeated_sfixed64_size());
  5087. total_size += data_size;
  5088. }
  5089. // repeated float repeated_float = 11 [packed = false];
  5090. {
  5091. unsigned int count = static_cast<unsigned int>(this->repeated_float_size());
  5092. size_t data_size = 4UL * count;
  5093. total_size += 1 *
  5094. ::google::protobuf::internal::FromIntSize(this->repeated_float_size());
  5095. total_size += data_size;
  5096. }
  5097. // repeated double repeated_double = 12 [packed = false];
  5098. {
  5099. unsigned int count = static_cast<unsigned int>(this->repeated_double_size());
  5100. size_t data_size = 8UL * count;
  5101. total_size += 1 *
  5102. ::google::protobuf::internal::FromIntSize(this->repeated_double_size());
  5103. total_size += data_size;
  5104. }
  5105. // repeated bool repeated_bool = 13 [packed = false];
  5106. {
  5107. unsigned int count = static_cast<unsigned int>(this->repeated_bool_size());
  5108. size_t data_size = 1UL * count;
  5109. total_size += 1 *
  5110. ::google::protobuf::internal::FromIntSize(this->repeated_bool_size());
  5111. total_size += data_size;
  5112. }
  5113. // repeated .proto3_arena_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 14 [packed = false];
  5114. {
  5115. size_t data_size = 0;
  5116. unsigned int count = static_cast<unsigned int>(this->repeated_nested_enum_size());for (unsigned int i = 0; i < count; i++) {
  5117. data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
  5118. this->repeated_nested_enum(static_cast<int>(i)));
  5119. }
  5120. total_size += (1UL * count) + data_size;
  5121. }
  5122. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  5123. SetCachedSize(cached_size);
  5124. return total_size;
  5125. }
  5126. void TestUnpackedTypes::MergeFrom(const ::google::protobuf::Message& from) {
  5127. // @@protoc_insertion_point(generalized_merge_from_start:proto3_arena_unittest.TestUnpackedTypes)
  5128. GOOGLE_DCHECK_NE(&from, this);
  5129. const TestUnpackedTypes* source =
  5130. ::google::protobuf::internal::DynamicCastToGenerated<const TestUnpackedTypes>(
  5131. &from);
  5132. if (source == NULL) {
  5133. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_arena_unittest.TestUnpackedTypes)
  5134. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  5135. } else {
  5136. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_arena_unittest.TestUnpackedTypes)
  5137. MergeFrom(*source);
  5138. }
  5139. }
  5140. void TestUnpackedTypes::MergeFrom(const TestUnpackedTypes& from) {
  5141. // @@protoc_insertion_point(class_specific_merge_from_start:proto3_arena_unittest.TestUnpackedTypes)
  5142. GOOGLE_DCHECK_NE(&from, this);
  5143. _internal_metadata_.MergeFrom(from._internal_metadata_);
  5144. ::google::protobuf::uint32 cached_has_bits = 0;
  5145. (void) cached_has_bits;
  5146. repeated_int32_.MergeFrom(from.repeated_int32_);
  5147. repeated_int64_.MergeFrom(from.repeated_int64_);
  5148. repeated_uint32_.MergeFrom(from.repeated_uint32_);
  5149. repeated_uint64_.MergeFrom(from.repeated_uint64_);
  5150. repeated_sint32_.MergeFrom(from.repeated_sint32_);
  5151. repeated_sint64_.MergeFrom(from.repeated_sint64_);
  5152. repeated_fixed32_.MergeFrom(from.repeated_fixed32_);
  5153. repeated_fixed64_.MergeFrom(from.repeated_fixed64_);
  5154. repeated_sfixed32_.MergeFrom(from.repeated_sfixed32_);
  5155. repeated_sfixed64_.MergeFrom(from.repeated_sfixed64_);
  5156. repeated_float_.MergeFrom(from.repeated_float_);
  5157. repeated_double_.MergeFrom(from.repeated_double_);
  5158. repeated_bool_.MergeFrom(from.repeated_bool_);
  5159. repeated_nested_enum_.MergeFrom(from.repeated_nested_enum_);
  5160. }
  5161. void TestUnpackedTypes::CopyFrom(const ::google::protobuf::Message& from) {
  5162. // @@protoc_insertion_point(generalized_copy_from_start:proto3_arena_unittest.TestUnpackedTypes)
  5163. if (&from == this) return;
  5164. Clear();
  5165. MergeFrom(from);
  5166. }
  5167. void TestUnpackedTypes::CopyFrom(const TestUnpackedTypes& from) {
  5168. // @@protoc_insertion_point(class_specific_copy_from_start:proto3_arena_unittest.TestUnpackedTypes)
  5169. if (&from == this) return;
  5170. Clear();
  5171. MergeFrom(from);
  5172. }
  5173. bool TestUnpackedTypes::IsInitialized() const {
  5174. return true;
  5175. }
  5176. void TestUnpackedTypes::Swap(TestUnpackedTypes* other) {
  5177. if (other == this) return;
  5178. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  5179. InternalSwap(other);
  5180. } else {
  5181. TestUnpackedTypes* temp = New(GetArenaNoVirtual());
  5182. temp->MergeFrom(*other);
  5183. other->CopyFrom(*this);
  5184. InternalSwap(temp);
  5185. if (GetArenaNoVirtual() == NULL) {
  5186. delete temp;
  5187. }
  5188. }
  5189. }
  5190. void TestUnpackedTypes::UnsafeArenaSwap(TestUnpackedTypes* other) {
  5191. if (other == this) return;
  5192. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  5193. InternalSwap(other);
  5194. }
  5195. void TestUnpackedTypes::InternalSwap(TestUnpackedTypes* other) {
  5196. using std::swap;
  5197. repeated_int32_.InternalSwap(&other->repeated_int32_);
  5198. repeated_int64_.InternalSwap(&other->repeated_int64_);
  5199. repeated_uint32_.InternalSwap(&other->repeated_uint32_);
  5200. repeated_uint64_.InternalSwap(&other->repeated_uint64_);
  5201. repeated_sint32_.InternalSwap(&other->repeated_sint32_);
  5202. repeated_sint64_.InternalSwap(&other->repeated_sint64_);
  5203. repeated_fixed32_.InternalSwap(&other->repeated_fixed32_);
  5204. repeated_fixed64_.InternalSwap(&other->repeated_fixed64_);
  5205. repeated_sfixed32_.InternalSwap(&other->repeated_sfixed32_);
  5206. repeated_sfixed64_.InternalSwap(&other->repeated_sfixed64_);
  5207. repeated_float_.InternalSwap(&other->repeated_float_);
  5208. repeated_double_.InternalSwap(&other->repeated_double_);
  5209. repeated_bool_.InternalSwap(&other->repeated_bool_);
  5210. repeated_nested_enum_.InternalSwap(&other->repeated_nested_enum_);
  5211. _internal_metadata_.Swap(&other->_internal_metadata_);
  5212. }
  5213. ::google::protobuf::Metadata TestUnpackedTypes::GetMetadata() const {
  5214. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  5215. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  5216. }
  5217. // ===================================================================
  5218. void NestedTestAllTypes::InitAsDefaultInstance() {
  5219. ::proto3_arena_unittest::_NestedTestAllTypes_default_instance_._instance.get_mutable()->child_ = const_cast< ::proto3_arena_unittest::NestedTestAllTypes*>(
  5220. ::proto3_arena_unittest::NestedTestAllTypes::internal_default_instance());
  5221. ::proto3_arena_unittest::_NestedTestAllTypes_default_instance_._instance.get_mutable()->payload_ = const_cast< ::proto3_arena_unittest::TestAllTypes*>(
  5222. ::proto3_arena_unittest::TestAllTypes::internal_default_instance());
  5223. }
  5224. void NestedTestAllTypes::unsafe_arena_set_allocated_child(
  5225. ::proto3_arena_unittest::NestedTestAllTypes* child) {
  5226. if (GetArenaNoVirtual() == NULL) {
  5227. delete child_;
  5228. }
  5229. child_ = child;
  5230. if (child) {
  5231. } else {
  5232. }
  5233. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.NestedTestAllTypes.child)
  5234. }
  5235. void NestedTestAllTypes::unsafe_arena_set_allocated_payload(
  5236. ::proto3_arena_unittest::TestAllTypes* payload) {
  5237. if (GetArenaNoVirtual() == NULL) {
  5238. delete payload_;
  5239. }
  5240. payload_ = payload;
  5241. if (payload) {
  5242. } else {
  5243. }
  5244. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:proto3_arena_unittest.NestedTestAllTypes.payload)
  5245. }
  5246. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  5247. const int NestedTestAllTypes::kChildFieldNumber;
  5248. const int NestedTestAllTypes::kPayloadFieldNumber;
  5249. const int NestedTestAllTypes::kRepeatedChildFieldNumber;
  5250. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  5251. NestedTestAllTypes::NestedTestAllTypes()
  5252. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  5253. ::google::protobuf::internal::InitSCC(
  5254. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_NestedTestAllTypes.base);
  5255. SharedCtor();
  5256. // @@protoc_insertion_point(constructor:proto3_arena_unittest.NestedTestAllTypes)
  5257. }
  5258. NestedTestAllTypes::NestedTestAllTypes(::google::protobuf::Arena* arena)
  5259. : ::google::protobuf::Message(),
  5260. _internal_metadata_(arena),
  5261. repeated_child_(arena) {
  5262. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_NestedTestAllTypes.base);
  5263. SharedCtor();
  5264. RegisterArenaDtor(arena);
  5265. // @@protoc_insertion_point(arena_constructor:proto3_arena_unittest.NestedTestAllTypes)
  5266. }
  5267. NestedTestAllTypes::NestedTestAllTypes(const NestedTestAllTypes& from)
  5268. : ::google::protobuf::Message(),
  5269. _internal_metadata_(NULL),
  5270. repeated_child_(from.repeated_child_) {
  5271. _internal_metadata_.MergeFrom(from._internal_metadata_);
  5272. if (from.has_child()) {
  5273. child_ = new ::proto3_arena_unittest::NestedTestAllTypes(*from.child_);
  5274. } else {
  5275. child_ = NULL;
  5276. }
  5277. if (from.has_payload()) {
  5278. payload_ = new ::proto3_arena_unittest::TestAllTypes(*from.payload_);
  5279. } else {
  5280. payload_ = NULL;
  5281. }
  5282. // @@protoc_insertion_point(copy_constructor:proto3_arena_unittest.NestedTestAllTypes)
  5283. }
  5284. void NestedTestAllTypes::SharedCtor() {
  5285. ::memset(&child_, 0, static_cast<size_t>(
  5286. reinterpret_cast<char*>(&payload_) -
  5287. reinterpret_cast<char*>(&child_)) + sizeof(payload_));
  5288. }
  5289. NestedTestAllTypes::~NestedTestAllTypes() {
  5290. // @@protoc_insertion_point(destructor:proto3_arena_unittest.NestedTestAllTypes)
  5291. SharedDtor();
  5292. }
  5293. void NestedTestAllTypes::SharedDtor() {
  5294. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  5295. if (this != internal_default_instance()) delete child_;
  5296. if (this != internal_default_instance()) delete payload_;
  5297. }
  5298. void NestedTestAllTypes::ArenaDtor(void* object) {
  5299. NestedTestAllTypes* _this = reinterpret_cast< NestedTestAllTypes* >(object);
  5300. (void)_this;
  5301. }
  5302. void NestedTestAllTypes::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  5303. }
  5304. void NestedTestAllTypes::SetCachedSize(int size) const {
  5305. _cached_size_.Set(size);
  5306. }
  5307. const ::google::protobuf::Descriptor* NestedTestAllTypes::descriptor() {
  5308. ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  5309. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  5310. }
  5311. const NestedTestAllTypes& NestedTestAllTypes::default_instance() {
  5312. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_NestedTestAllTypes.base);
  5313. return *internal_default_instance();
  5314. }
  5315. void NestedTestAllTypes::Clear() {
  5316. // @@protoc_insertion_point(message_clear_start:proto3_arena_unittest.NestedTestAllTypes)
  5317. ::google::protobuf::uint32 cached_has_bits = 0;
  5318. // Prevent compiler warnings about cached_has_bits being unused
  5319. (void) cached_has_bits;
  5320. repeated_child_.Clear();
  5321. if (GetArenaNoVirtual() == NULL && child_ != NULL) {
  5322. delete child_;
  5323. }
  5324. child_ = NULL;
  5325. if (GetArenaNoVirtual() == NULL && payload_ != NULL) {
  5326. delete payload_;
  5327. }
  5328. payload_ = NULL;
  5329. _internal_metadata_.Clear();
  5330. }
  5331. bool NestedTestAllTypes::MergePartialFromCodedStream(
  5332. ::google::protobuf::io::CodedInputStream* input) {
  5333. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  5334. ::google::protobuf::uint32 tag;
  5335. // @@protoc_insertion_point(parse_start:proto3_arena_unittest.NestedTestAllTypes)
  5336. for (;;) {
  5337. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  5338. tag = p.first;
  5339. if (!p.second) goto handle_unusual;
  5340. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  5341. // .proto3_arena_unittest.NestedTestAllTypes child = 1;
  5342. case 1: {
  5343. if (static_cast< ::google::protobuf::uint8>(tag) ==
  5344. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  5345. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  5346. input, mutable_child()));
  5347. } else {
  5348. goto handle_unusual;
  5349. }
  5350. break;
  5351. }
  5352. // .proto3_arena_unittest.TestAllTypes payload = 2;
  5353. case 2: {
  5354. if (static_cast< ::google::protobuf::uint8>(tag) ==
  5355. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  5356. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  5357. input, mutable_payload()));
  5358. } else {
  5359. goto handle_unusual;
  5360. }
  5361. break;
  5362. }
  5363. // repeated .proto3_arena_unittest.NestedTestAllTypes repeated_child = 3;
  5364. case 3: {
  5365. if (static_cast< ::google::protobuf::uint8>(tag) ==
  5366. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  5367. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  5368. input, add_repeated_child()));
  5369. } else {
  5370. goto handle_unusual;
  5371. }
  5372. break;
  5373. }
  5374. default: {
  5375. handle_unusual:
  5376. if (tag == 0) {
  5377. goto success;
  5378. }
  5379. DO_(::google::protobuf::internal::WireFormat::SkipField(
  5380. input, tag, _internal_metadata_.mutable_unknown_fields()));
  5381. break;
  5382. }
  5383. }
  5384. }
  5385. success:
  5386. // @@protoc_insertion_point(parse_success:proto3_arena_unittest.NestedTestAllTypes)
  5387. return true;
  5388. failure:
  5389. // @@protoc_insertion_point(parse_failure:proto3_arena_unittest.NestedTestAllTypes)
  5390. return false;
  5391. #undef DO_
  5392. }
  5393. void NestedTestAllTypes::SerializeWithCachedSizes(
  5394. ::google::protobuf::io::CodedOutputStream* output) const {
  5395. // @@protoc_insertion_point(serialize_start:proto3_arena_unittest.NestedTestAllTypes)
  5396. ::google::protobuf::uint32 cached_has_bits = 0;
  5397. (void) cached_has_bits;
  5398. // .proto3_arena_unittest.NestedTestAllTypes child = 1;
  5399. if (this->has_child()) {
  5400. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  5401. 1, this->_internal_child(), output);
  5402. }
  5403. // .proto3_arena_unittest.TestAllTypes payload = 2;
  5404. if (this->has_payload()) {
  5405. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  5406. 2, this->_internal_payload(), output);
  5407. }
  5408. // repeated .proto3_arena_unittest.NestedTestAllTypes repeated_child = 3;
  5409. for (unsigned int i = 0,
  5410. n = static_cast<unsigned int>(this->repeated_child_size()); i < n; i++) {
  5411. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  5412. 3,
  5413. this->repeated_child(static_cast<int>(i)),
  5414. output);
  5415. }
  5416. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5417. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  5418. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  5419. }
  5420. // @@protoc_insertion_point(serialize_end:proto3_arena_unittest.NestedTestAllTypes)
  5421. }
  5422. ::google::protobuf::uint8* NestedTestAllTypes::InternalSerializeWithCachedSizesToArray(
  5423. bool deterministic, ::google::protobuf::uint8* target) const {
  5424. (void)deterministic; // Unused
  5425. // @@protoc_insertion_point(serialize_to_array_start:proto3_arena_unittest.NestedTestAllTypes)
  5426. ::google::protobuf::uint32 cached_has_bits = 0;
  5427. (void) cached_has_bits;
  5428. // .proto3_arena_unittest.NestedTestAllTypes child = 1;
  5429. if (this->has_child()) {
  5430. target = ::google::protobuf::internal::WireFormatLite::
  5431. InternalWriteMessageToArray(
  5432. 1, this->_internal_child(), deterministic, target);
  5433. }
  5434. // .proto3_arena_unittest.TestAllTypes payload = 2;
  5435. if (this->has_payload()) {
  5436. target = ::google::protobuf::internal::WireFormatLite::
  5437. InternalWriteMessageToArray(
  5438. 2, this->_internal_payload(), deterministic, target);
  5439. }
  5440. // repeated .proto3_arena_unittest.NestedTestAllTypes repeated_child = 3;
  5441. for (unsigned int i = 0,
  5442. n = static_cast<unsigned int>(this->repeated_child_size()); i < n; i++) {
  5443. target = ::google::protobuf::internal::WireFormatLite::
  5444. InternalWriteMessageToArray(
  5445. 3, this->repeated_child(static_cast<int>(i)), deterministic, target);
  5446. }
  5447. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5448. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  5449. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  5450. }
  5451. // @@protoc_insertion_point(serialize_to_array_end:proto3_arena_unittest.NestedTestAllTypes)
  5452. return target;
  5453. }
  5454. size_t NestedTestAllTypes::ByteSizeLong() const {
  5455. // @@protoc_insertion_point(message_byte_size_start:proto3_arena_unittest.NestedTestAllTypes)
  5456. size_t total_size = 0;
  5457. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5458. total_size +=
  5459. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  5460. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  5461. }
  5462. // repeated .proto3_arena_unittest.NestedTestAllTypes repeated_child = 3;
  5463. {
  5464. unsigned int count = static_cast<unsigned int>(this->repeated_child_size());
  5465. total_size += 1UL * count;
  5466. for (unsigned int i = 0; i < count; i++) {
  5467. total_size +=
  5468. ::google::protobuf::internal::WireFormatLite::MessageSize(
  5469. this->repeated_child(static_cast<int>(i)));
  5470. }
  5471. }
  5472. // .proto3_arena_unittest.NestedTestAllTypes child = 1;
  5473. if (this->has_child()) {
  5474. total_size += 1 +
  5475. ::google::protobuf::internal::WireFormatLite::MessageSize(
  5476. *child_);
  5477. }
  5478. // .proto3_arena_unittest.TestAllTypes payload = 2;
  5479. if (this->has_payload()) {
  5480. total_size += 1 +
  5481. ::google::protobuf::internal::WireFormatLite::MessageSize(
  5482. *payload_);
  5483. }
  5484. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  5485. SetCachedSize(cached_size);
  5486. return total_size;
  5487. }
  5488. void NestedTestAllTypes::MergeFrom(const ::google::protobuf::Message& from) {
  5489. // @@protoc_insertion_point(generalized_merge_from_start:proto3_arena_unittest.NestedTestAllTypes)
  5490. GOOGLE_DCHECK_NE(&from, this);
  5491. const NestedTestAllTypes* source =
  5492. ::google::protobuf::internal::DynamicCastToGenerated<const NestedTestAllTypes>(
  5493. &from);
  5494. if (source == NULL) {
  5495. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_arena_unittest.NestedTestAllTypes)
  5496. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  5497. } else {
  5498. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_arena_unittest.NestedTestAllTypes)
  5499. MergeFrom(*source);
  5500. }
  5501. }
  5502. void NestedTestAllTypes::MergeFrom(const NestedTestAllTypes& from) {
  5503. // @@protoc_insertion_point(class_specific_merge_from_start:proto3_arena_unittest.NestedTestAllTypes)
  5504. GOOGLE_DCHECK_NE(&from, this);
  5505. _internal_metadata_.MergeFrom(from._internal_metadata_);
  5506. ::google::protobuf::uint32 cached_has_bits = 0;
  5507. (void) cached_has_bits;
  5508. repeated_child_.MergeFrom(from.repeated_child_);
  5509. if (from.has_child()) {
  5510. mutable_child()->::proto3_arena_unittest::NestedTestAllTypes::MergeFrom(from.child());
  5511. }
  5512. if (from.has_payload()) {
  5513. mutable_payload()->::proto3_arena_unittest::TestAllTypes::MergeFrom(from.payload());
  5514. }
  5515. }
  5516. void NestedTestAllTypes::CopyFrom(const ::google::protobuf::Message& from) {
  5517. // @@protoc_insertion_point(generalized_copy_from_start:proto3_arena_unittest.NestedTestAllTypes)
  5518. if (&from == this) return;
  5519. Clear();
  5520. MergeFrom(from);
  5521. }
  5522. void NestedTestAllTypes::CopyFrom(const NestedTestAllTypes& from) {
  5523. // @@protoc_insertion_point(class_specific_copy_from_start:proto3_arena_unittest.NestedTestAllTypes)
  5524. if (&from == this) return;
  5525. Clear();
  5526. MergeFrom(from);
  5527. }
  5528. bool NestedTestAllTypes::IsInitialized() const {
  5529. return true;
  5530. }
  5531. void NestedTestAllTypes::Swap(NestedTestAllTypes* other) {
  5532. if (other == this) return;
  5533. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  5534. InternalSwap(other);
  5535. } else {
  5536. NestedTestAllTypes* temp = New(GetArenaNoVirtual());
  5537. temp->MergeFrom(*other);
  5538. other->CopyFrom(*this);
  5539. InternalSwap(temp);
  5540. if (GetArenaNoVirtual() == NULL) {
  5541. delete temp;
  5542. }
  5543. }
  5544. }
  5545. void NestedTestAllTypes::UnsafeArenaSwap(NestedTestAllTypes* other) {
  5546. if (other == this) return;
  5547. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  5548. InternalSwap(other);
  5549. }
  5550. void NestedTestAllTypes::InternalSwap(NestedTestAllTypes* other) {
  5551. using std::swap;
  5552. CastToBase(&repeated_child_)->InternalSwap(CastToBase(&other->repeated_child_));
  5553. swap(child_, other->child_);
  5554. swap(payload_, other->payload_);
  5555. _internal_metadata_.Swap(&other->_internal_metadata_);
  5556. }
  5557. ::google::protobuf::Metadata NestedTestAllTypes::GetMetadata() const {
  5558. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  5559. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  5560. }
  5561. // ===================================================================
  5562. void ForeignMessage::InitAsDefaultInstance() {
  5563. }
  5564. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  5565. const int ForeignMessage::kCFieldNumber;
  5566. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  5567. ForeignMessage::ForeignMessage()
  5568. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  5569. ::google::protobuf::internal::InitSCC(
  5570. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_ForeignMessage.base);
  5571. SharedCtor();
  5572. // @@protoc_insertion_point(constructor:proto3_arena_unittest.ForeignMessage)
  5573. }
  5574. ForeignMessage::ForeignMessage(::google::protobuf::Arena* arena)
  5575. : ::google::protobuf::Message(),
  5576. _internal_metadata_(arena) {
  5577. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_ForeignMessage.base);
  5578. SharedCtor();
  5579. RegisterArenaDtor(arena);
  5580. // @@protoc_insertion_point(arena_constructor:proto3_arena_unittest.ForeignMessage)
  5581. }
  5582. ForeignMessage::ForeignMessage(const ForeignMessage& from)
  5583. : ::google::protobuf::Message(),
  5584. _internal_metadata_(NULL) {
  5585. _internal_metadata_.MergeFrom(from._internal_metadata_);
  5586. c_ = from.c_;
  5587. // @@protoc_insertion_point(copy_constructor:proto3_arena_unittest.ForeignMessage)
  5588. }
  5589. void ForeignMessage::SharedCtor() {
  5590. c_ = 0;
  5591. }
  5592. ForeignMessage::~ForeignMessage() {
  5593. // @@protoc_insertion_point(destructor:proto3_arena_unittest.ForeignMessage)
  5594. SharedDtor();
  5595. }
  5596. void ForeignMessage::SharedDtor() {
  5597. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  5598. }
  5599. void ForeignMessage::ArenaDtor(void* object) {
  5600. ForeignMessage* _this = reinterpret_cast< ForeignMessage* >(object);
  5601. (void)_this;
  5602. }
  5603. void ForeignMessage::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  5604. }
  5605. void ForeignMessage::SetCachedSize(int size) const {
  5606. _cached_size_.Set(size);
  5607. }
  5608. const ::google::protobuf::Descriptor* ForeignMessage::descriptor() {
  5609. ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  5610. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  5611. }
  5612. const ForeignMessage& ForeignMessage::default_instance() {
  5613. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_ForeignMessage.base);
  5614. return *internal_default_instance();
  5615. }
  5616. void ForeignMessage::Clear() {
  5617. // @@protoc_insertion_point(message_clear_start:proto3_arena_unittest.ForeignMessage)
  5618. ::google::protobuf::uint32 cached_has_bits = 0;
  5619. // Prevent compiler warnings about cached_has_bits being unused
  5620. (void) cached_has_bits;
  5621. c_ = 0;
  5622. _internal_metadata_.Clear();
  5623. }
  5624. bool ForeignMessage::MergePartialFromCodedStream(
  5625. ::google::protobuf::io::CodedInputStream* input) {
  5626. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  5627. ::google::protobuf::uint32 tag;
  5628. // @@protoc_insertion_point(parse_start:proto3_arena_unittest.ForeignMessage)
  5629. for (;;) {
  5630. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  5631. tag = p.first;
  5632. if (!p.second) goto handle_unusual;
  5633. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  5634. // int32 c = 1;
  5635. case 1: {
  5636. if (static_cast< ::google::protobuf::uint8>(tag) ==
  5637. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  5638. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  5639. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  5640. input, &c_)));
  5641. } else {
  5642. goto handle_unusual;
  5643. }
  5644. break;
  5645. }
  5646. default: {
  5647. handle_unusual:
  5648. if (tag == 0) {
  5649. goto success;
  5650. }
  5651. DO_(::google::protobuf::internal::WireFormat::SkipField(
  5652. input, tag, _internal_metadata_.mutable_unknown_fields()));
  5653. break;
  5654. }
  5655. }
  5656. }
  5657. success:
  5658. // @@protoc_insertion_point(parse_success:proto3_arena_unittest.ForeignMessage)
  5659. return true;
  5660. failure:
  5661. // @@protoc_insertion_point(parse_failure:proto3_arena_unittest.ForeignMessage)
  5662. return false;
  5663. #undef DO_
  5664. }
  5665. void ForeignMessage::SerializeWithCachedSizes(
  5666. ::google::protobuf::io::CodedOutputStream* output) const {
  5667. // @@protoc_insertion_point(serialize_start:proto3_arena_unittest.ForeignMessage)
  5668. ::google::protobuf::uint32 cached_has_bits = 0;
  5669. (void) cached_has_bits;
  5670. // int32 c = 1;
  5671. if (this->c() != 0) {
  5672. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->c(), output);
  5673. }
  5674. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5675. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  5676. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  5677. }
  5678. // @@protoc_insertion_point(serialize_end:proto3_arena_unittest.ForeignMessage)
  5679. }
  5680. ::google::protobuf::uint8* ForeignMessage::InternalSerializeWithCachedSizesToArray(
  5681. bool deterministic, ::google::protobuf::uint8* target) const {
  5682. (void)deterministic; // Unused
  5683. // @@protoc_insertion_point(serialize_to_array_start:proto3_arena_unittest.ForeignMessage)
  5684. ::google::protobuf::uint32 cached_has_bits = 0;
  5685. (void) cached_has_bits;
  5686. // int32 c = 1;
  5687. if (this->c() != 0) {
  5688. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->c(), target);
  5689. }
  5690. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5691. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  5692. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  5693. }
  5694. // @@protoc_insertion_point(serialize_to_array_end:proto3_arena_unittest.ForeignMessage)
  5695. return target;
  5696. }
  5697. size_t ForeignMessage::ByteSizeLong() const {
  5698. // @@protoc_insertion_point(message_byte_size_start:proto3_arena_unittest.ForeignMessage)
  5699. size_t total_size = 0;
  5700. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5701. total_size +=
  5702. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  5703. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  5704. }
  5705. // int32 c = 1;
  5706. if (this->c() != 0) {
  5707. total_size += 1 +
  5708. ::google::protobuf::internal::WireFormatLite::Int32Size(
  5709. this->c());
  5710. }
  5711. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  5712. SetCachedSize(cached_size);
  5713. return total_size;
  5714. }
  5715. void ForeignMessage::MergeFrom(const ::google::protobuf::Message& from) {
  5716. // @@protoc_insertion_point(generalized_merge_from_start:proto3_arena_unittest.ForeignMessage)
  5717. GOOGLE_DCHECK_NE(&from, this);
  5718. const ForeignMessage* source =
  5719. ::google::protobuf::internal::DynamicCastToGenerated<const ForeignMessage>(
  5720. &from);
  5721. if (source == NULL) {
  5722. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_arena_unittest.ForeignMessage)
  5723. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  5724. } else {
  5725. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_arena_unittest.ForeignMessage)
  5726. MergeFrom(*source);
  5727. }
  5728. }
  5729. void ForeignMessage::MergeFrom(const ForeignMessage& from) {
  5730. // @@protoc_insertion_point(class_specific_merge_from_start:proto3_arena_unittest.ForeignMessage)
  5731. GOOGLE_DCHECK_NE(&from, this);
  5732. _internal_metadata_.MergeFrom(from._internal_metadata_);
  5733. ::google::protobuf::uint32 cached_has_bits = 0;
  5734. (void) cached_has_bits;
  5735. if (from.c() != 0) {
  5736. set_c(from.c());
  5737. }
  5738. }
  5739. void ForeignMessage::CopyFrom(const ::google::protobuf::Message& from) {
  5740. // @@protoc_insertion_point(generalized_copy_from_start:proto3_arena_unittest.ForeignMessage)
  5741. if (&from == this) return;
  5742. Clear();
  5743. MergeFrom(from);
  5744. }
  5745. void ForeignMessage::CopyFrom(const ForeignMessage& from) {
  5746. // @@protoc_insertion_point(class_specific_copy_from_start:proto3_arena_unittest.ForeignMessage)
  5747. if (&from == this) return;
  5748. Clear();
  5749. MergeFrom(from);
  5750. }
  5751. bool ForeignMessage::IsInitialized() const {
  5752. return true;
  5753. }
  5754. void ForeignMessage::Swap(ForeignMessage* other) {
  5755. if (other == this) return;
  5756. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  5757. InternalSwap(other);
  5758. } else {
  5759. ForeignMessage* temp = New(GetArenaNoVirtual());
  5760. temp->MergeFrom(*other);
  5761. other->CopyFrom(*this);
  5762. InternalSwap(temp);
  5763. if (GetArenaNoVirtual() == NULL) {
  5764. delete temp;
  5765. }
  5766. }
  5767. }
  5768. void ForeignMessage::UnsafeArenaSwap(ForeignMessage* other) {
  5769. if (other == this) return;
  5770. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  5771. InternalSwap(other);
  5772. }
  5773. void ForeignMessage::InternalSwap(ForeignMessage* other) {
  5774. using std::swap;
  5775. swap(c_, other->c_);
  5776. _internal_metadata_.Swap(&other->_internal_metadata_);
  5777. }
  5778. ::google::protobuf::Metadata ForeignMessage::GetMetadata() const {
  5779. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  5780. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  5781. }
  5782. // ===================================================================
  5783. void TestEmptyMessage::InitAsDefaultInstance() {
  5784. }
  5785. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  5786. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  5787. TestEmptyMessage::TestEmptyMessage()
  5788. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  5789. ::google::protobuf::internal::InitSCC(
  5790. &protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestEmptyMessage.base);
  5791. SharedCtor();
  5792. // @@protoc_insertion_point(constructor:proto3_arena_unittest.TestEmptyMessage)
  5793. }
  5794. TestEmptyMessage::TestEmptyMessage(::google::protobuf::Arena* arena)
  5795. : ::google::protobuf::Message(),
  5796. _internal_metadata_(arena) {
  5797. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestEmptyMessage.base);
  5798. SharedCtor();
  5799. RegisterArenaDtor(arena);
  5800. // @@protoc_insertion_point(arena_constructor:proto3_arena_unittest.TestEmptyMessage)
  5801. }
  5802. TestEmptyMessage::TestEmptyMessage(const TestEmptyMessage& from)
  5803. : ::google::protobuf::Message(),
  5804. _internal_metadata_(NULL) {
  5805. _internal_metadata_.MergeFrom(from._internal_metadata_);
  5806. // @@protoc_insertion_point(copy_constructor:proto3_arena_unittest.TestEmptyMessage)
  5807. }
  5808. void TestEmptyMessage::SharedCtor() {
  5809. }
  5810. TestEmptyMessage::~TestEmptyMessage() {
  5811. // @@protoc_insertion_point(destructor:proto3_arena_unittest.TestEmptyMessage)
  5812. SharedDtor();
  5813. }
  5814. void TestEmptyMessage::SharedDtor() {
  5815. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  5816. }
  5817. void TestEmptyMessage::ArenaDtor(void* object) {
  5818. TestEmptyMessage* _this = reinterpret_cast< TestEmptyMessage* >(object);
  5819. (void)_this;
  5820. }
  5821. void TestEmptyMessage::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  5822. }
  5823. void TestEmptyMessage::SetCachedSize(int size) const {
  5824. _cached_size_.Set(size);
  5825. }
  5826. const ::google::protobuf::Descriptor* TestEmptyMessage::descriptor() {
  5827. ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  5828. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  5829. }
  5830. const TestEmptyMessage& TestEmptyMessage::default_instance() {
  5831. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::scc_info_TestEmptyMessage.base);
  5832. return *internal_default_instance();
  5833. }
  5834. void TestEmptyMessage::Clear() {
  5835. // @@protoc_insertion_point(message_clear_start:proto3_arena_unittest.TestEmptyMessage)
  5836. ::google::protobuf::uint32 cached_has_bits = 0;
  5837. // Prevent compiler warnings about cached_has_bits being unused
  5838. (void) cached_has_bits;
  5839. _internal_metadata_.Clear();
  5840. }
  5841. bool TestEmptyMessage::MergePartialFromCodedStream(
  5842. ::google::protobuf::io::CodedInputStream* input) {
  5843. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  5844. ::google::protobuf::uint32 tag;
  5845. // @@protoc_insertion_point(parse_start:proto3_arena_unittest.TestEmptyMessage)
  5846. for (;;) {
  5847. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  5848. tag = p.first;
  5849. if (!p.second) goto handle_unusual;
  5850. handle_unusual:
  5851. if (tag == 0) {
  5852. goto success;
  5853. }
  5854. DO_(::google::protobuf::internal::WireFormat::SkipField(
  5855. input, tag, _internal_metadata_.mutable_unknown_fields()));
  5856. }
  5857. success:
  5858. // @@protoc_insertion_point(parse_success:proto3_arena_unittest.TestEmptyMessage)
  5859. return true;
  5860. failure:
  5861. // @@protoc_insertion_point(parse_failure:proto3_arena_unittest.TestEmptyMessage)
  5862. return false;
  5863. #undef DO_
  5864. }
  5865. void TestEmptyMessage::SerializeWithCachedSizes(
  5866. ::google::protobuf::io::CodedOutputStream* output) const {
  5867. // @@protoc_insertion_point(serialize_start:proto3_arena_unittest.TestEmptyMessage)
  5868. ::google::protobuf::uint32 cached_has_bits = 0;
  5869. (void) cached_has_bits;
  5870. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5871. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  5872. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  5873. }
  5874. // @@protoc_insertion_point(serialize_end:proto3_arena_unittest.TestEmptyMessage)
  5875. }
  5876. ::google::protobuf::uint8* TestEmptyMessage::InternalSerializeWithCachedSizesToArray(
  5877. bool deterministic, ::google::protobuf::uint8* target) const {
  5878. (void)deterministic; // Unused
  5879. // @@protoc_insertion_point(serialize_to_array_start:proto3_arena_unittest.TestEmptyMessage)
  5880. ::google::protobuf::uint32 cached_has_bits = 0;
  5881. (void) cached_has_bits;
  5882. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5883. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  5884. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  5885. }
  5886. // @@protoc_insertion_point(serialize_to_array_end:proto3_arena_unittest.TestEmptyMessage)
  5887. return target;
  5888. }
  5889. size_t TestEmptyMessage::ByteSizeLong() const {
  5890. // @@protoc_insertion_point(message_byte_size_start:proto3_arena_unittest.TestEmptyMessage)
  5891. size_t total_size = 0;
  5892. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  5893. total_size +=
  5894. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  5895. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  5896. }
  5897. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  5898. SetCachedSize(cached_size);
  5899. return total_size;
  5900. }
  5901. void TestEmptyMessage::MergeFrom(const ::google::protobuf::Message& from) {
  5902. // @@protoc_insertion_point(generalized_merge_from_start:proto3_arena_unittest.TestEmptyMessage)
  5903. GOOGLE_DCHECK_NE(&from, this);
  5904. const TestEmptyMessage* source =
  5905. ::google::protobuf::internal::DynamicCastToGenerated<const TestEmptyMessage>(
  5906. &from);
  5907. if (source == NULL) {
  5908. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_arena_unittest.TestEmptyMessage)
  5909. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  5910. } else {
  5911. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_arena_unittest.TestEmptyMessage)
  5912. MergeFrom(*source);
  5913. }
  5914. }
  5915. void TestEmptyMessage::MergeFrom(const TestEmptyMessage& from) {
  5916. // @@protoc_insertion_point(class_specific_merge_from_start:proto3_arena_unittest.TestEmptyMessage)
  5917. GOOGLE_DCHECK_NE(&from, this);
  5918. _internal_metadata_.MergeFrom(from._internal_metadata_);
  5919. ::google::protobuf::uint32 cached_has_bits = 0;
  5920. (void) cached_has_bits;
  5921. }
  5922. void TestEmptyMessage::CopyFrom(const ::google::protobuf::Message& from) {
  5923. // @@protoc_insertion_point(generalized_copy_from_start:proto3_arena_unittest.TestEmptyMessage)
  5924. if (&from == this) return;
  5925. Clear();
  5926. MergeFrom(from);
  5927. }
  5928. void TestEmptyMessage::CopyFrom(const TestEmptyMessage& from) {
  5929. // @@protoc_insertion_point(class_specific_copy_from_start:proto3_arena_unittest.TestEmptyMessage)
  5930. if (&from == this) return;
  5931. Clear();
  5932. MergeFrom(from);
  5933. }
  5934. bool TestEmptyMessage::IsInitialized() const {
  5935. return true;
  5936. }
  5937. void TestEmptyMessage::Swap(TestEmptyMessage* other) {
  5938. if (other == this) return;
  5939. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  5940. InternalSwap(other);
  5941. } else {
  5942. TestEmptyMessage* temp = New(GetArenaNoVirtual());
  5943. temp->MergeFrom(*other);
  5944. other->CopyFrom(*this);
  5945. InternalSwap(temp);
  5946. if (GetArenaNoVirtual() == NULL) {
  5947. delete temp;
  5948. }
  5949. }
  5950. }
  5951. void TestEmptyMessage::UnsafeArenaSwap(TestEmptyMessage* other) {
  5952. if (other == this) return;
  5953. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  5954. InternalSwap(other);
  5955. }
  5956. void TestEmptyMessage::InternalSwap(TestEmptyMessage* other) {
  5957. using std::swap;
  5958. _internal_metadata_.Swap(&other->_internal_metadata_);
  5959. }
  5960. ::google::protobuf::Metadata TestEmptyMessage::GetMetadata() const {
  5961. protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::protobuf_AssignDescriptorsOnce();
  5962. return ::protobuf_google_2fprotobuf_2funittest_5fproto3_5farena_2eproto::file_level_metadata[kIndexInFileMessages];
  5963. }
  5964. // @@protoc_insertion_point(namespace_scope)
  5965. } // namespace proto3_arena_unittest
  5966. namespace google {
  5967. namespace protobuf {
  5968. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_arena_unittest::TestAllTypes_NestedMessage* Arena::CreateMaybeMessage< ::proto3_arena_unittest::TestAllTypes_NestedMessage >(Arena* arena) {
  5969. return Arena::CreateMessageInternal< ::proto3_arena_unittest::TestAllTypes_NestedMessage >(arena);
  5970. }
  5971. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_arena_unittest::TestAllTypes* Arena::CreateMaybeMessage< ::proto3_arena_unittest::TestAllTypes >(Arena* arena) {
  5972. return Arena::CreateMessageInternal< ::proto3_arena_unittest::TestAllTypes >(arena);
  5973. }
  5974. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_arena_unittest::TestPackedTypes* Arena::CreateMaybeMessage< ::proto3_arena_unittest::TestPackedTypes >(Arena* arena) {
  5975. return Arena::CreateMessageInternal< ::proto3_arena_unittest::TestPackedTypes >(arena);
  5976. }
  5977. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_arena_unittest::TestUnpackedTypes* Arena::CreateMaybeMessage< ::proto3_arena_unittest::TestUnpackedTypes >(Arena* arena) {
  5978. return Arena::CreateMessageInternal< ::proto3_arena_unittest::TestUnpackedTypes >(arena);
  5979. }
  5980. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_arena_unittest::NestedTestAllTypes* Arena::CreateMaybeMessage< ::proto3_arena_unittest::NestedTestAllTypes >(Arena* arena) {
  5981. return Arena::CreateMessageInternal< ::proto3_arena_unittest::NestedTestAllTypes >(arena);
  5982. }
  5983. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_arena_unittest::ForeignMessage* Arena::CreateMaybeMessage< ::proto3_arena_unittest::ForeignMessage >(Arena* arena) {
  5984. return Arena::CreateMessageInternal< ::proto3_arena_unittest::ForeignMessage >(arena);
  5985. }
  5986. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_arena_unittest::TestEmptyMessage* Arena::CreateMaybeMessage< ::proto3_arena_unittest::TestEmptyMessage >(Arena* arena) {
  5987. return Arena::CreateMessageInternal< ::proto3_arena_unittest::TestEmptyMessage >(arena);
  5988. }
  5989. } // namespace protobuf
  5990. } // namespace google
  5991. // @@protoc_insertion_point(global_scope)