books.pb.cc 267 KB

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