unittest_proto3_lite.pb.cc 200 KB

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