unittest_proto3_arena_lite.pb.cc 214 KB

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