12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277 |
- Strict
- Rem
- bbdoc: BASIC/Reflection
- End Rem
- Module BRL.Reflection
- ModuleInfo "Version: 1.10"
- ModuleInfo "Author: Mark Sibly"
- ModuleInfo "License: zlib/libpng"
- ModuleInfo "Copyright: Blitz Research Ltd"
- ModuleInfo "Modserver: BRL"
- ModuleInfo "History: 1.10"
- ModuleInfo "History: Added LongInt and ULongInt primitives."
- ModuleInfo "History: 1.09"
- ModuleInfo "History: Threading support."
- ModuleInfo "History: 1.08"
- ModuleInfo "History: Improved metadata retrieval."
- ModuleInfo "History: 1.07"
- ModuleInfo "History: Primitive field set/get now avoids passing values through String."
- ModuleInfo "History: 1.06"
- ModuleInfo "History: Cache lower case member names and use map lookup instead of list."
- ModuleInfo "History: 1.05"
- ModuleInfo "History: Added size_t, UInt and ULong primitives."
- ModuleInfo "History: 1.04"
- ModuleInfo "History: Added support for interfaces."
- ModuleInfo "History: 1.03"
- ModuleInfo "History: Added grable enhancements."
- ModuleInfo "History: Added support for globals."
- ModuleInfo "History: 1.02 Release"
- ModuleInfo "History: Added Brucey's size fix to GetArrayElement()/SetArrayElement()."
- ModuleInfo "History: 1.01 Release"
- ModuleInfo "History: Fixed NewArray using temp type name"
- Import BRL.LinkedList
- Import BRL.Map
- Import BRL.Threads
- Import BRL.StringBuilder
- Import "reflection.c"
- Private
- Extern
- Function bbObjectNew:Object( class:Byte Ptr )="BBObject * bbObjectNew(BBClass *)!"
- ?Not ptr64
- Function bbObjectRegisteredTypes:Int Ptr( count Var )="BBClass** bbObjectRegisteredTypes(int *)!"
- Function bbObjectRegisteredInterfaces:Int Ptr( count Var )="BBInterface** bbObjectRegisteredInterfaces(int *)!"
- ?ptr64
- Function bbObjectRegisteredTypes:Long Ptr( count Var )="BBClass** bbObjectRegisteredTypes(int *)!"
- Function bbObjectRegisteredInterfaces:Long Ptr( count Var )="BBInterface** bbObjectRegisteredInterfaces(int *)!"
- ?
- Function bbArrayNew1D:Object( typeTag:Byte Ptr,length )="BBArray* bbArrayNew1D(const char *,int )!"
- Function bbArraySlice:Object( typeTag:Byte Ptr, _array:Object, _start:Int, _end:Int)="BBArray* bbArraySlice(const char *, BBArray*, int, int)!"
- Function bbRefArrayClass:Byte Ptr()
- Function bbRefStringClass:Byte Ptr()
- Function bbRefObjectClass:Byte Ptr()
- Function bbRefArrayLength( _array:Object, dim:Int = 0 )
- Function bbRefArrayTypeTag:String( _array:Object )
- Function bbRefArrayDimensions:Int( _array:Object )
- Function bbRefArrayCreate:Object( typeTag:Byte Ptr,dims:Int[] )
- Function bbRefFieldPtr:Byte Ptr( obj:Object,index )
- Function bbRefMethodPtr:Byte Ptr( obj:Object,index )
- Function bbRefArrayElementPtr:Byte Ptr( sz,_array:Object,index )
- Function bbRefGetObject:Object( p:Byte Ptr )
- Function bbRefPushObject( p:Byte Ptr,obj:Object )
- Function bbRefInitObject( p:Byte Ptr,obj:Object )
- Function bbRefAssignObject( p:Byte Ptr,obj:Object )
- Function bbRefGetObjectClass:Byte Ptr( obj:Object )
- Function bbRefGetSuperClass:Byte Ptr( class:Byte Ptr )
- Function bbStringFromRef:String( ref:Byte Ptr )
- Function bbRefArrayNull:Object()
- Function bbInterfaceName:Byte Ptr(ifc:Byte Ptr)
- Function bbInterfaceClass:Byte Ptr(ifc:Byte Ptr)
- Function bbObjectImplementsInterfaces:Int(class:Byte Ptr)
- Function bbObjectImplementedCount:Int(class:Byte Ptr)
- Function bbObjectImplementedInterface:Byte Ptr(class:Byte Ptr, index:Int)
- Function bbRefClassSuper:Byte Ptr(clas:Byte Ptr)
- Function bbRefClassDebugScope:Byte Ptr(clas:Byte Ptr)
- Function bbRefClassDebugDecl:Byte Ptr(clas:Byte Ptr)
- Function bbRefClassDebugScopeName:Byte Ptr(class:Byte Ptr)
- Function bbDebugDeclKind:Int(decl:Byte Ptr)
- Function bbDebugDeclName:Byte Ptr(decl:Byte Ptr)
- Function bbDebugDeclType:Byte Ptr(decl:Byte Ptr)
- Function bbDebugDeclConstValue:String(decl:Byte Ptr)
- Function bbDebugDeclFieldOffset:Int(decl:Byte Ptr)
- Function bbDebugDeclVarAddress:Byte Ptr(decl:Byte Ptr)
- Function bbDebugDeclNext:Byte Ptr(decl:Byte Ptr)
- End Extern
- Global _guard:TMutex = TMutex.Create()
- Function _Get:Object( p:Byte Ptr,typeId:TTypeId )
- Select typeId
- Case ByteTypeId
- Return String.FromInt( (Byte Ptr p)[0] )
- Case ShortTypeId
- Return String.FromInt( (Short Ptr p)[0] )
- Case IntTypeId
- Return String.FromInt( (Int Ptr p)[0] )
- Case UIntTypeId
- Return String.FromUInt( (UInt Ptr p)[0] )
- Case LongTypeId
- Return String.FromLong( (Long Ptr p)[0] )
- Case ULongTypeId
- Return String.FromULong( (ULong Ptr p)[0] )
- Case SizetTypeId
- Return String.FromSizet( (Size_T Ptr p)[0] )
- Case FloatTypeId
- Return String.FromFloat( (Float Ptr p)[0] )
- Case DoubleTypeId
- Return String.FromDouble( (Double Ptr p)[0] )
- Case LongIntTypeId
- Return String.FromLongInt( (LongInt Ptr p)[0] )
- Case ULongIntTypeId
- Return String.FromULongInt( (ULongInt Ptr p)[0] )
- Default
- If typeid.ExtendsType(PointerTypeId) Or typeid.ExtendsType(FunctionTypeId) Then
- ?Not ptr64
- Return String.FromInt( (Int Ptr p)[0] )
- ?ptr64
- Return String.FromLong( (Long Ptr p)[0] )
- ?
- EndIf
- Return bbRefGetObject( p )
- End Select
- End Function
- Function _Push:Byte Ptr( sp:Byte Ptr,typeId:TTypeId,value:Object )
- Select typeId
- Case ByteTypeId,ShortTypeId,IntTypeId
- (Int Ptr sp)[0]=value.ToString().ToInt()
- Return sp+4
- Case UIntTypeId
- (UInt Ptr sp)[0]=value.ToString().ToUInt()
- Return sp+4
- Case LongTypeId
- (Long Ptr sp)[0]=value.ToString().ToLong()
- Return sp+8
- Case ULongTypeId
- (ULong Ptr sp)[0]=value.ToString().ToULong()
- Return sp+8
- Case SizetTypeId
- (Size_T Ptr sp)[0]=value.ToString().ToSizet()
- ?Not ptr64
- Return sp+4
- ?ptr64
- Return sp+8
- ?
- Case FloatTypeId
- (Float Ptr sp)[0]=value.ToString().ToFloat()
- Return sp+4
- Case DoubleTypeId
- (Double Ptr sp)[0]=value.ToString().ToDouble()
- Return sp+8
- Case LongIntTypeId
- (LongInt Ptr sp)[0]=value.ToString().ToLongInt()
- ?Not ptr64
- Return sp+4
- ?ptr64 and not win32
- Return sp+8
- ?ptr64 and win32
- Return sp+4
- ?
- Case ULongIntTypeId
- (ULongInt Ptr sp)[0]=value.ToString().ToULongInt()
- ?Not ptr64
- Return sp+4
- ?ptr64 and not win32
- Return sp+8
- ?ptr64 and win32
- Return sp+4
- ?
- Case StringTypeId
- If Not value value=""
- bbRefPushObject sp,value
- Return sp+4
- Default
- If value
- If typeid.ExtendsType(PointerTypeId) Or typeid.ExtendsType(FunctionTypeId) Then
- ?Not ptr64
- (Int Ptr sp)[0]=value.ToString().ToInt()
- Return sp+4
- ?ptr64
- (Long Ptr sp)[0]=value.ToString().ToLong()
- Return sp+8
- ?
- EndIf
- Local c:Byte Ptr=typeId._class
- Local t:Byte Ptr=bbRefGetObjectClass( value )
- While t And t<>c
- t=bbRefGetSuperClass( t )
- Wend
- If Not t Throw "ERROR"
- EndIf
- bbRefPushObject sp,value
- Return sp+4
- End Select
- End Function
- Function _Assign( p:Byte Ptr,typeId:TTypeId,value:Object )
- Select typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=value.ToString().ToInt()
- Case ShortTypeId
- (Short Ptr p)[0]=value.ToString().ToInt()
- Case IntTypeId
- (Int Ptr p)[0]=value.ToString().ToInt()
- Case UIntTypeId
- (UInt Ptr p)[0]=value.ToString().ToUInt()
- Case LongTypeId
- (Long Ptr p)[0]=value.ToString().ToLong()
- Case ULongTypeId
- (ULong Ptr p)[0]=value.ToString().ToULong()
- Case SizetTypeId
- (Size_T Ptr p)[0]=value.ToString().ToSizet()
- Case FloatTypeId
- (Float Ptr p)[0]=value.ToString().ToFloat()
- Case DoubleTypeId
- (Double Ptr p)[0]=value.ToString().ToDouble()
- Case LongIntTypeId
- (LongInt Ptr p)[0]=value.ToString().ToLongInt()
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=value.ToString().ToULongInt()
- Case StringTypeId
- If Not value value=""
- bbRefAssignObject p,value
- Default
- If value
- If typeid.ExtendsType(PointerTypeId) Or typeid.ExtendsType(FunctionTypeId) Then
- ?Not ptr64
- (Int Ptr p)[0]=value.ToString().ToInt()
- ?ptr64
- (Long Ptr p)[0]=value.ToString().ToLong()
- ?
- Return
- EndIf
- Local c:Byte Ptr=typeId._class
- Local t:Byte Ptr=bbRefGetObjectClass( value )
- While t And t<>c
- t=bbRefGetSuperClass( t )
- Wend
- If Not t Throw "ERROR"
- Else
- If typeId.Name().Endswith("]") Then
- value = bbRefArrayNull()
- EndIf
- EndIf
- bbRefAssignObject p,value
- End Select
- End Function
- Function _CallFunction:Object( p:Byte Ptr,typeId:TTypeId,args:Object[],argTypes:TTypeId[] )
- Local q:Byte Ptr[10]
- If args Then
- For Local i=0 Until args.length
- _Push( Varptr q[i],argTypes[i],args[i] )
- Next
- End If
- Select typeId
- Case ByteTypeId,ShortTypeId,IntTypeId
- Select argTypes.length
- Case 0
- Local f:Int()=p
- Return String.FromInt( f() )
- Case 1
- Local f:Int(p0:Byte Ptr)=p
- Return String.FromInt( f(q[0]) )
- Case 2
- Local f:Int(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromInt( f(q[0], q[1]) )
- Case 3
- Local f:Int(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromInt( f(q[0], q[1], q[2]) )
- Case 4
- Local f:Int(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromInt( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Int(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromInt( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Int(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromInt( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Int(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Int(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Int(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- ?Not ptr64
- Case UIntTypeId,SizetTypeId
- ?ptr64
- Case UIntTypeId
- ?
- Select argTypes.length
- Case 0
- Local f:UInt()=p
- Return String.FromUInt( f() )
- Case 1
- Local f:UInt(p0:Byte Ptr)=p
- Return String.FromUInt( f(q[0]) )
- Case 2
- Local f:UInt(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromUInt( f(q[0], q[1]) )
- Case 3
- Local f:UInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromUInt( f(q[0], q[1], q[2]) )
- Case 4
- Local f:UInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromUInt( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:UInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromUInt( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:UInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromUInt( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:UInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromUInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:UInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromUInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:UInt(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromUInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case LongTypeId
- Select argTypes.length
- Case 0
- Local f:Long()=p
- Return String.Fromlong( f() )
- Case 1
- Local f:Long(p0:Byte Ptr)=p
- Return String.Fromlong( f(q[0]) )
- Case 2
- Local f:Long(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.Fromlong( f(q[0], q[1]) )
- Case 3
- Local f:Long(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.Fromlong( f(q[0], q[1], q[2]) )
- Case 4
- Local f:Long(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.Fromlong( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Long(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.Fromlong( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Long(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.Fromlong( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Long(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.Fromlong( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Long(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.Fromlong( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Long(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.Fromlong( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- ?Not ptr64
- Case ULongTypeId
- ?ptr64
- Case ULongTypeId,SizetTypeId
- ?
- Select argTypes.length
- Case 0
- Local f:ULong()=p
- Return String.FromULong( f() )
- Case 1
- Local f:ULong(p0:Byte Ptr)=p
- Return String.FromULong( f(q[0]) )
- Case 2
- Local f:ULong(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromULong( f(q[0], q[1]) )
- Case 3
- Local f:ULong(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromULong( f(q[0], q[1], q[2]) )
- Case 4
- Local f:ULong(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromULong( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:ULong(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromULong( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:ULong(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromULong( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:ULong(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromULong( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:ULong(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromULong( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:ULong(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromULong( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case FloatTypeId
- Select argTypes.length
- Case 0
- Local f:Float()=p
- Return String.FromFloat( f() )
- Case 1
- Local f:Float(p0:Byte Ptr)=p
- Return String.FromFloat( f(q[0]) )
- Case 2
- Local f:Float(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromFloat( f(q[0], q[1]) )
- Case 3
- Local f:Float(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromFloat( f(q[0], q[1], q[2]) )
- Case 4
- Local f:Float(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromFloat( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Float(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromFloat( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Float(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromFloat( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Float(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromFloat( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Float(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromFloat( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Float(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromFloat( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case DoubleTypeId
- Select argTypes.length
- Case 0
- Local f:Double()=p
- Return String.FromDouble( f() )
- Case 1
- Local f:Double(p0:Byte Ptr)=p
- Return String.FromDouble( f(q[0]) )
- Case 2
- Local f:Double(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromDouble( f(q[0], q[1]) )
- Case 3
- Local f:Double(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromDouble( f(q[0], q[1], q[2]) )
- Case 4
- Local f:Double(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromDouble( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Double(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromDouble( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Double(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromDouble( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Double(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromDouble( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Double(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromDouble( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Double(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromDouble( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case VoidTypeId
- Select argTypes.length
- Case 0
- Local f()=p
- f()
- Case 1
- Local f(p0:Byte Ptr)=p
- f(q[0])
- Case 2
- Local f(p0:Byte Ptr, p1:Byte Ptr)=p
- f(q[0], q[1])
- Case 3
- Local f(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- f(q[0], q[1], q[2])
- Case 4
- Local f(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- f(q[0], q[1], q[2], q[3])
- Case 5
- Local f(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- f(q[0], q[1], q[2], q[3], q[4])
- Case 6
- Local f(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- f(q[0], q[1], q[2], q[3], q[4], q[5])
- Case 7
- Local f(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- f(q[0], q[1], q[2], q[3], q[4], q[5], q[6])
- Case 8
- Local f(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7])
- Default
- Local f(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] )
- End Select
- Case LongIntTypeId
- Select argTypes.length
- Case 0
- Local f:LongInt()=p
- Return String.FromLongInt( f() )
- Case 1
- Local f:LongInt(p0:Byte Ptr)=p
- Return String.FromLongInt( f(q[0]) )
- Case 2
- Local f:LongInt(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromLongInt( f(q[0], q[1]) )
- Case 3
- Local f:LongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromLongInt( f(q[0], q[1], q[2]) )
- Case 4
- Local f:LongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromLongInt( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:LongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromLongInt( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:LongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromLongInt( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:LongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromLongInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:LongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromLongInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:LongInt(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromLongInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case ULongIntTypeId
- Select argTypes.length
- Case 0
- Local f:ULongInt()=p
- Return String.FromULongInt( f() )
- Case 1
- Local f:ULongInt(p0:Byte Ptr)=p
- Return String.FromULongInt( f(q[0]) )
- Case 2
- Local f:ULongInt(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromULongInt( f(q[0], q[1]) )
- Case 3
- Local f:ULongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromULongInt( f(q[0], q[1], q[2]) )
- Case 4
- Local f:ULongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromULongInt( f(q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:ULongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromULongInt( f(q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:ULongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromULongInt( f(q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:ULongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromULongInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:ULongInt(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromULongInt( f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:ULongInt(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromULongInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Default
- If typeid.ExtendsType(PointerTypeId) Or typeid.ExtendsType(FunctionTypeId) Then
- ?Not ptr64
- Select argTypes.length
- Case 0
- Local f:Byte Ptr()=p
- Return String.FromInt(Int f())
- Case 1
- Local f:Byte Ptr(p0:Byte Ptr)=p
- Return String.FromInt(Int f(q[0]))
- Case 2
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromInt(Int f(q[0], q[1]))
- Case 3
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromInt(Int f(q[0], q[1], q[2]))
- Case 4
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromInt(Int f(q[0], q[1], q[2], q[3]))
- Case 5
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromInt(Int f(q[0], q[1], q[2], q[3], q[4]))
- Case 6
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromInt(Int f(q[0], q[1], q[2], q[3], q[4], q[5]))
- Case 7
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromInt(Int f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]))
- Case 8
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromInt(Int f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]))
- Default
- Local f:Byte Ptr(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromInt(Int f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ))
- End Select
- ?ptr64
- Select argTypes.length
- Case 0
- Local f:Byte Ptr()=p
- Return String.Fromlong(Long f())
- Case 1
- Local f:Byte Ptr(p0:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0]))
- Case 2
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0], q[1]))
- Case 3
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0], q[1], q[2]))
- Case 4
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0], q[1], q[2], q[3]))
- Case 5
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0], q[1], q[2], q[3], q[4]))
- Case 6
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0], q[1], q[2], q[3], q[4], q[5]))
- Case 7
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0], q[1], q[2], q[3], q[4], q[5], q[6]))
- Case 8
- Local f:Byte Ptr(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.Fromlong(Long f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]))
- Default
- Local f:Byte Ptr(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.Fromlong(Long f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ))
- End Select
- ?
- Else
- Select argTypes.length
- Case 0
- Local f:Object()=p
- Return f()
- Case 1
- Local f:Object(p0:Byte Ptr)=p
- Return f(q[0])
- Case 2
- Local f:Object(p0:Byte Ptr, p1:Byte Ptr)=p
- Return f(q[0], q[1])
- Case 3
- Local f:Object(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return f(q[0], q[1], q[2])
- Case 4
- Local f:Object(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return f(q[0], q[1], q[2], q[3])
- Case 5
- Local f:Object(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return f(q[0], q[1], q[2], q[3], q[4])
- Case 6
- Local f:Object(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return f(q[0], q[1], q[2], q[3], q[4], q[5])
- Case 7
- Local f:Object(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return f(q[0], q[1], q[2], q[3], q[4], q[5], q[6])
- Case 8
- Local f:Object(p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return f(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7])
- Default
- Local f:Object(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] )
- End Select
- End If
- End Select
- End Function
- Function _CallMethod:Object( p:Byte Ptr,typeId:TTypeId,obj:Object,args:Object[],argTypes:TTypeId[] )
- Local q:Byte Ptr[10]',sp:Byte Ptr=q
- 'bbRefPushObject sp,obj
- 'sp:+4
- 'If typeId=LongTypeId sp:+8
- If args Then
- For Local i=0 Until args.length
- 'If Int Ptr(sp)>=Int Ptr(q)+8 Throw "ERROR"
- _Push( Varptr q[i],argTypes[i],args[i] )
- Next
- End If
- 'If Int Ptr(sp)>Int Ptr(q)+8 Throw "ERROR"
- Local retType:TTypeId = typeId._retType
- Select retType
- Case ByteTypeId,ShortTypeId,IntTypeId
- Select argTypes.length
- Case 0
- Local f:Int(m:Object)=p
- Return String.FromInt( f(obj) )
- Case 1
- Local f:Int(m:Object, p0:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0]) )
- Case 2
- Local f:Int(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0], q[1]) )
- Case 3
- Local f:Int(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:Int(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Int(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Int(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Int(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Int(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Int(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- ?Not ptr64
- Case UIntTypeId,SizetTypeId
- ?ptr64
- Case UIntTypeId
- ?
- Select argTypes.length
- Case 0
- Local f:UInt(m:Object)=p
- Return String.FromUInt( f(obj) )
- Case 1
- Local f:UInt(m:Object, p0:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0]) )
- Case 2
- Local f:UInt(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0], q[1]) )
- Case 3
- Local f:UInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:UInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:UInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:UInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:UInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:UInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromUInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:UInt(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromUInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case LongTypeId
- Select argTypes.length
- Case 0
- Local f:Long(m:Object)=p
- Return String.Fromlong( f(obj) )
- Case 1
- Local f:Long(m:Object, p0:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0]) )
- Case 2
- Local f:Long(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0], q[1]) )
- Case 3
- Local f:Long(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:Long(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Long(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Long(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Long(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Long(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.Fromlong( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Long(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.Fromlong( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- ?Not ptr64
- Case ULongTypeId
- ?ptr64
- Case ULongTypeId,SizetTypeId
- ?
- Select argTypes.length
- Case 0
- Local f:ULong(m:Object)=p
- Return String.FromULong( f(obj) )
- Case 1
- Local f:ULong(m:Object, p0:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0]) )
- Case 2
- Local f:ULong(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0], q[1]) )
- Case 3
- Local f:ULong(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:ULong(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:ULong(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:ULong(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:ULong(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:ULong(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromULong( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:ULong(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromULong( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case FloatTypeId
- Select argTypes.length
- Case 0
- Local f:Float(m:Object)=p
- Return String.FromFloat( f(obj) )
- Case 1
- Local f:Float(m:Object, p0:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0]) )
- Case 2
- Local f:Float(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0], q[1]) )
- Case 3
- Local f:Float(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:Float(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Float(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Float(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Float(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Float(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromFloat( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Float(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromFloat( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case DoubleTypeId
- Select argTypes.length
- Case 0
- Local f:Double(m:Object)=p
- Return String.FromDouble( f(obj) )
- Case 1
- Local f:Double(m:Object, p0:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0]) )
- Case 2
- Local f:Double(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0], q[1]) )
- Case 3
- Local f:Double(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:Double(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:Double(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:Double(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:Double(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:Double(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromDouble( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:Double(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromDouble( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case LongIntTypeId
- Select argTypes.length
- Case 0
- Local f:LongInt(m:Object)=p
- Return String.FromLongInt( f(obj) )
- Case 1
- Local f:LongInt(m:Object, p0:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0]) )
- Case 2
- Local f:LongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0], q[1]) )
- Case 3
- Local f:LongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:LongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:LongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:LongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:LongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:LongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromLongInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:LongInt(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromLongInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case ULongIntTypeId
- Select argTypes.length
- Case 0
- Local f:ULongInt(m:Object)=p
- Return String.FromULongInt( f(obj) )
- Case 1
- Local f:ULongInt(m:Object, p0:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0]) )
- Case 2
- Local f:ULongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0], q[1]) )
- Case 3
- Local f:ULongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0], q[1], q[2]) )
- Case 4
- Local f:ULongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0], q[1], q[2], q[3]) )
- Case 5
- Local f:ULongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0], q[1], q[2], q[3], q[4]) )
- Case 6
- Local f:ULongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5]) )
- Case 7
- Local f:ULongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]) )
- Case 8
- Local f:ULongInt(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromULongInt( f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]) )
- Default
- Local f:ULongInt(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromULongInt( f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ) )
- End Select
- Case VoidTypeId
- Select argTypes.length
- Case 0
- Local f(m:Object)=p
- f(obj)
- Case 1
- Local f(m:Object, p0:Byte Ptr)=p
- f(obj, q[0])
- Case 2
- Local f(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- f(obj, q[0], q[1])
- Case 3
- Local f(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- f(obj, q[0], q[1], q[2])
- Case 4
- Local f(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- f(obj, q[0], q[1], q[2], q[3])
- Case 5
- Local f(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- f(obj, q[0], q[1], q[2], q[3], q[4])
- Case 6
- Local f(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- f(obj, q[0], q[1], q[2], q[3], q[4], q[5])
- Case 7
- Local f(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6])
- Case 8
- Local f(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7])
- Default
- Local f(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] )
- End Select
- Default
- If retType.ExtendsType(PointerTypeId) Or retType.ExtendsType(FunctionTypeId) Then
- ?Not ptr64
- Select argTypes.length
- Case 0
- Local f:Byte Ptr(m:Object)=p
- Return String.FromInt(Int f(obj))
- Case 1
- Local f:Byte Ptr(m:Object, p0:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0]))
- Case 2
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0], q[1]))
- Case 3
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0], q[1], q[2]))
- Case 4
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0], q[1], q[2], q[3]))
- Case 5
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0], q[1], q[2], q[3], q[4]))
- Case 6
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0], q[1], q[2], q[3], q[4], q[5]))
- Case 7
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]))
- Case 8
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromInt(Int f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]))
- Default
- Local f:Byte Ptr(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromInt(Int f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ))
- End Select
- ?ptr64
- Select argTypes.length
- Case 0
- Local f:Byte Ptr(m:Object)=p
- Return String.FromLong(Long f(obj))
- Case 1
- Local f:Byte Ptr(m:Object, p0:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0]))
- Case 2
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0], q[1]))
- Case 3
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0], q[1], q[2]))
- Case 4
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0], q[1], q[2], q[3]))
- Case 5
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0], q[1], q[2], q[3], q[4]))
- Case 6
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0], q[1], q[2], q[3], q[4], q[5]))
- Case 7
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6]))
- Case 8
- Local f:Byte Ptr(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return String.FromLong(Long f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7]))
- Default
- Local f:Byte Ptr(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return String.FromLong(Long f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] ))
- End Select
- ?
- Else
- Select argTypes.length
- Case 0
- Local f:Object(m:Object)=p
- Return f(obj)
- Case 1
- Local f:Object(m:Object, p0:Byte Ptr)=p
- Return f(obj, q[0])
- Case 2
- Local f:Object(m:Object, p0:Byte Ptr, p1:Byte Ptr)=p
- Return f(obj, q[0], q[1])
- Case 3
- Local f:Object(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr)=p
- Return f(obj, q[0], q[1], q[2])
- Case 4
- Local f:Object(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr)=p
- Return f(obj, q[0], q[1], q[2], q[3])
- Case 5
- Local f:Object(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr)=p
- Return f(obj, q[0], q[1], q[2], q[3], q[4])
- Case 6
- Local f:Object(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr)=p
- Return f(obj, q[0], q[1], q[2], q[3], q[4], q[5])
- Case 7
- Local f:Object(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr)=p
- Return f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6])
- Case 8
- Local f:Object(m:Object, p0:Byte Ptr, p1:Byte Ptr, p2:Byte Ptr, p3:Byte Ptr, p4:Byte Ptr, p5:Byte Ptr, p6:Byte Ptr, p7:Byte Ptr)=p
- Return f(obj, q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7])
- Default
- Local f:Object(p0:Byte Ptr,p1:Byte Ptr,p2:Byte Ptr,p3:Byte Ptr,p4:Byte Ptr,p5:Byte Ptr,p6:Byte Ptr,p7:Byte Ptr)=p
- Return f( q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7] )
- End Select
- End If
- End Select
- End Function
- Function TypeTagForId:String( id:TTypeId )
- If id.ExtendsType( ArrayTypeId )
- Return "[]"+TypeTagForId( id.ElementType() )
- EndIf
- If id.ExtendsType( PointerTypeId )
- Return "*"+TypeTagForId(id._elementType)
- EndIf
- If id.ExtendsType( FunctionTypeId )
- Local s:String
- For Local t:TTypeId = EachIn id._argTypes
- If s Then s :+ ","
- s :+ TypeTagForId(t)
- Next
- s = "(" + s + ")"
- If id._retType Then s :+ TypeTagForId(id._retType)
- Return s
- EndIf
- Select id
- Case ByteTypeId Return "b"
- Case ShortTypeId Return "s"
- Case IntTypeId Return "i"
- Case UIntTypeId Return "u"
- Case LongTypeId Return "l"
- Case ULongTypeId Return "y"
- Case SizetTypeId Return "t"
- Case FloatTypeId Return "f"
- Case DoubleTypeId Return "d"
- Case LongIntTypeId Return "v"
- Case ULongIntTypeId Return "e"
- Case StringTypeId Return "$"
- Case PointerTypeId Return "*"
- Case FunctionTypeId Return "("
- End Select
- If id.ExtendsType( ObjectTypeId )
- Return ":"+id.Name()
- EndIf
- Throw "ERROR"
- End Function
- Public
- Function TypeIdForTag:TTypeId( ty:String )
- If ty.StartsWith( "[" )
- Local dims:Int = ty.split(",").length
- ty=ty[ty.Find("]")+1..]
- Local id:TTypeId = TypeIdForTag( ty )
- If id Then
- id=id.ArrayType(dims)
- End If
- Return id
- EndIf
- If ty.StartsWith( ":" )
- ty=ty[1..]
- Local i=ty.FindLast( "." )
- If i<>-1 ty=ty[i+1..]
- Return TTypeId.ForName( ty )
- EndIf
- If ty.StartsWith( "*" ) Then
- ty = ty[1..]
- Local id:TTypeId = TypeIdForTag( ty )
- If id Then
- id = id.PointerType()
- EndIf
- Return id
- EndIf
- If ty.StartsWith( "(" ) Then
- Local t:String[]
- Local idx:Int = ty.FindLast(")")
- If idx > 0 Then
- t = [ ty[1..idx], ty[idx+1..] ]
- Else
- t = [ ty[1..], "" ]
- EndIf
- Local retType:TTypeId=TypeIdForTag( t[1] ), argTypes:TTypeId[]
- If t[0].length>0 Then
- Local i:Int,b:Int,q:String=t[0], args:TList=New TList
- While i < q.length
- Select q[i]
- Case Asc( "," )
- args.AddLast q[b..i]
- i:+1
- b=i
- Case Asc( "[" )
- i:+1
- While i<q.length And q[i]=Asc(",")
- i:+1
- Wend
- Case Asc( "(" )
- Local level:Int = 1
- i:+1
- While i < q.Length
- If q[i] = Asc(",") Then
- If level = 0 Then
- Exit
- End If
- ElseIf q[i] = Asc(")") Then
- level :- 1
- ElseIf q[i] = Asc("(") Then
- level :+ 1
- EndIf
- i:+1
- Wend
- Default
- i:+1
- End Select
- Wend
- If b < q.Length Then args.AddLast q[b..]
- argTypes=New TTypeId[args.Count()]
- i=0
- For Local s:String = EachIn args
- argTypes[i]=TypeIdForTag( s )
- If Not argTypes[i] Then argTypes[i] = ObjectTypeId
- i:+1
- Next
- EndIf
- If Not retType Then retType = ObjectTypeId
- Return retType.FunctionType(argTypes)
- EndIf
- Select ty
- Case "b" Return ByteTypeId
- Case "s" Return ShortTypeId
- Case "i" Return IntTypeId
- Case "u" Return UIntTypeId
- Case "l" Return LongTypeId
- Case "y" Return ULongTypeId
- Case "t" Return SizetTypeId
- Case "f" Return FloatTypeId
- Case "d" Return DoubleTypeId
- Case "v" Return LongIntTypeId
- Case "e" Return ULongIntTypeId
- Case "$" Return StringTypeId
- Case "*" Return PointerTypeId
- Case "(" Return FunctionTypeId
- Case "" Return VoidTypeId
- End Select
- End Function
- Private
- Function ExtractMetaMap:TStringMap( meta:String )
- If Not meta Then
- Return Null
- End If
- Local map:TStringMap = New TStringMap
- Local key:String
- Local value:String
-
- Local i=0
- While i < meta.length
- Local e:Int = meta.Find( "=",i )
- If e = -1 Throw "Malformed meta data"
-
- Local key:String = meta[i..e]
- Local value:String
- i = e + 1
-
- If i < meta.length And meta[i]=Asc("~q")
- i:+1
- Local e:Int = meta.Find( "~q",i )
- If e = -1 Throw "Malformed meta data"
- value = meta[i..e]
- i = e + 1
- Else
- Local e:Int = meta.Find( " ",i )
- If e = -1 e = meta.length
- value = meta[i..e]
- i = e
- EndIf
- map.Insert(key, value)
-
- If i < meta.length And meta[i] = Asc(" ") i:+1
- Wend
-
- Return map
- End Function
- Public
- Rem
- bbdoc: Primitive byte type
- End Rem
- Global ByteTypeId:TTypeId=New TTypeId.Init( "Byte",1 )
- Rem
- bbdoc: Primitive short type
- End Rem
- Global ShortTypeId:TTypeId=New TTypeId.Init( "Short",2 )
- Rem
- bbdoc: Primitive int type
- End Rem
- Global IntTypeId:TTypeId=New TTypeId.Init( "Int",4 )
- Rem
- bbdoc: Primitive unsigned int type
- End Rem
- Global UIntTypeId:TTypeId=New TTypeId.Init( "UInt",4 )
- Rem
- bbdoc: Primitive long type
- End Rem
- Global LongTypeId:TTypeId=New TTypeId.Init( "Long",8 )
- Rem
- bbdoc: Primitive unsigned long type
- End Rem
- Global ULongTypeId:TTypeId=New TTypeId.Init( "ULong",8 )
- Rem
- bbdoc: Primitive size_t type
- End Rem
- ?Not ptr64
- Global SizetTypeId:TTypeId=New TTypeId.Init( "size_t",4 )
- ?ptr64
- Global SizetTypeId:TTypeId=New TTypeId.Init( "size_t",8 )
- ?
- Rem
- bbdoc: Primitive longint type
- End Rem
- ?Not ptr64
- Global LongIntTypeId:TTypeId=New TTypeId.Init( "LongInt",4 )
- ?ptr64 and not win32
- Global LongIntTypeId:TTypeId=New TTypeId.Init( "LongInt",8 )
- ?ptr64 and win32
- Global LongIntTypeId:TTypeId=New TTypeId.Init( "LongInt",4 )
- ?
- Rem
- bbdoc: Primitive ulongint type
- End Rem
- ?Not ptr64
- Global ULongIntTypeId:TTypeId=New TTypeId.Init( "ULongInt",4 )
- ?ptr64 and not win32
- Global ULongIntTypeId:TTypeId=New TTypeId.Init( "ULongInt",8 )
- ?ptr64 and win32
- Global ULongIntTypeId:TTypeId=New TTypeId.Init( "ULongInt",4 )
- ?
- Rem
- bbdoc: Primitive float type
- End Rem
- Global FloatTypeId:TTypeId=New TTypeId.Init( "Float",4 )
- Rem
- bbdoc: Primitive double type
- End Rem
- Global DoubleTypeId:TTypeId=New TTypeId.Init( "Double",8 )
- Rem
- bbdoc: Primitive object type
- End Rem
- ?Not ptr64
- Global ObjectTypeId:TTypeId=New TTypeId.Init( "Object",4,bbRefObjectClass() )
- ?ptr64
- Global ObjectTypeId:TTypeId=New TTypeId.Init( "Object",8,bbRefObjectClass() )
- ?
- Rem
- bbdoc: Primitive string type
- End Rem
- ?Not ptr64
- Global StringTypeId:TTypeId=New TTypeId.Init( "String",4,bbRefStringClass(),ObjectTypeId )
- ?ptr64
- Global StringTypeId:TTypeId=New TTypeId.Init( "String",8,bbRefStringClass(),ObjectTypeId )
- ?
- Rem
- bbdoc: Primitive array type
- End Rem
- ?Not ptr64
- Global ArrayTypeId:TTypeId=New TTypeId.Init( "Null[]",4,bbRefArrayClass(),ObjectTypeId )
- ?ptr64
- Global ArrayTypeId:TTypeId=New TTypeId.Init( "Null[]",8,bbRefArrayClass(),ObjectTypeId )
- ?
- ' Void Type
- ' Only used For Function/Method Return types
- Global VoidTypeId:TTypeId=New TTypeId.Init( "Void",0 )
- Rem
- bbdoc: Primitive pointer type
- End Rem
- ?Not ptr64
- Global PointerTypeId:TTypeId=New TTypeId.Init( "Ptr",4 )
- ?ptr64
- Global PointerTypeId:TTypeId=New TTypeId.Init( "Ptr",8 )
- ?
- Rem
- bbdoc: Primitive function type
- End Rem
- ?Not ptr64
- Global FunctionTypeId:TTypeId=New TTypeId.Init( "Null()",4 )
- ?ptr64
- Global FunctionTypeId:TTypeId=New TTypeId.Init( "Null()",8 )
- ?
- Rem
- bbdoc: Type member - Field Or Method.
- End Rem
- Type TMember
- Rem
- bbdoc: Get member name
- End Rem
- Method Name:String()
- Return _name
- End Method
- Method NameLower:String()
- If Not _nameLower Then
- _nameLower = _name.ToLower()
- End If
- Return _nameLower
- End Method
- Rem
- bbdoc: Get member type
- End Rem
- Method TypeId:TTypeId()
- Return _typeId
- End Method
- Rem
- bbdoc: Get member meta data
- End Rem
- Method MetaData:String( key:String="" )
- If Not _metaMap Or Not key Return _meta
- Return String(_metaMap.ValueForKey(key))
- End Method
-
- Rem
- bbdoc: Returns #True if @key is in the metadata.
- End Rem
- Method HasMetaData:Int( key:String )
- If Not _metaMap Or Not key Return False
- Return _metaMap.Contains(key)
- End Method
-
- Method InitMeta(meta:String)
- _meta = meta
- _metaMap = ExtractMetaMap(meta)
- End Method
- Field _name:String,_typeId:TTypeId,_meta:String
- Field _nameLower:String
- Field _metaMap:TStringMap
- End Type
- Rem
- bbdoc: Type constant
- EndRem
- Type TConstant Extends TMember
- Method Init:TConstant( name:String, typeId:TTypeId, meta:String, str:String)
- _name = name
- _typeId = typeId
- InitMeta(meta)
- _string = str
- Return Self
- EndMethod
- Rem
- bbdoc: Get constant value
- EndRem
- Method GetString:String()
- Return _string
- EndMethod
- Rem
- bbdoc: Get constant value as @Int
- EndRem
- Method GetInt:Int()
- Return GetString().ToInt()
- EndMethod
- Rem
- bbdoc: Get constant value as @Float
- EndRem
- Method GetFloat:Float()
- Return GetString().ToFloat()
- EndMethod
- Rem
- bbdoc: Get constant value as @Long
- EndRem
- Method GetLong:Long()
- Return GetString().ToLong()
- EndMethod
- Rem
- bbdoc: Get constant value as @size_t
- EndRem
- Method GetSizet:Size_T()
- Return GetString().ToSizet()
- EndMethod
- Rem
- bbdoc: Get constant value as @LongInt
- EndRem
- Method GetLongInt:LongInt()
- Return GetString().ToLongInt()
- EndMethod
- Rem
- bbdoc: Get constant value as @ULongInt
- EndRem
- Method GetULongInt:ULongInt()
- Return GetString().ToULongInt()
- EndMethod
- Rem
- bbdoc: Get constant value as @Double
- EndRem
- Method GetDouble:Double()
- Return GetString().ToDouble()
- EndMethod
- Rem
- bbdoc: Get constant value as @{Byte Ptr}
- EndRem
- Method GetPointer:Byte Ptr()
- ?Not ptr64
- Return Byte Ptr GetString().ToInt()
- ?ptr64
- Return Byte Ptr GetString().ToLong()
- ?
- EndMethod
- Field _string:String
- EndType
- Rem
- bbdoc: Type field
- End Rem
- Type TField Extends TMember
- Method Init:TField( name:String,typeId:TTypeId,meta:String,index )
- _name=name
- _typeId=typeId
- InitMeta(meta)
- _index=index
- Return Self
- End Method
- Rem
- bbdoc: Get field value
- End Rem
- Method Get:Object( obj:Object )
- Return _Get( bbRefFieldPtr( obj,_index ),_typeId )
- End Method
- Rem
- bbdoc: Get #Byte field value
- End Rem
- Method GetByte:Byte( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #Short field value
- End Rem
- Method GetShort:Short( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #Int field value
- End Rem
- Method GetInt:Int( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #UInt field value
- End Rem
- Method GetUInt:UInt( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get long field value
- End Rem
- Method GetLong:Long( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #ULong field value
- End Rem
- Method GetULong:ULong( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #Size_T field value
- End Rem
- Method GetSizet:Size_T( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #Float field value
- End Rem
- Method GetFloat:Float( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #Double field value
- End Rem
- Method GetDouble:Double( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #LongInt field value
- End Rem
- Method GetLongInt:LongInt( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #ULongInt field value
- End Rem
- Method GetULongInt:ULongInt( obj:Object )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Get #String field value
- End Rem
- Method GetString:String( obj:Object )
- Return String( Get( obj ) )
- End Method
- Rem
- bbdoc: Set field value
- End Rem
- Method Set( obj:Object,value:Object )
- _Assign bbRefFieldPtr( obj,_index ),_typeId,value
- End Method
- Rem
- bbdoc: Set #Byte field value
- End Rem
- Method Set( obj:Object,value:Byte )
- SetByte(obj, value)
- End Method
- Rem
- bbdoc: Set #Short field value
- End Rem
- Method Set( obj:Object,value:Short )
- SetShort(obj, value)
- End Method
- Rem
- bbdoc: Set #Int field value
- End Rem
- Method Set( obj:Object,value:Int )
- SetInt(obj, value)
- End Method
- Rem
- bbdoc: Set #UInt field value
- End Rem
- Method Set( obj:Object,value:UInt )
- SetUInt(obj, value)
- End Method
- Rem
- bbdoc: Set #Long field value
- End Rem
- Method Set( obj:Object,value:Long )
- SetLong(obj, value)
- End Method
- Rem
- bbdoc: Set #ULong field value
- End Rem
- Method Set( obj:Object,value:ULong )
- SetULong(obj, value)
- End Method
- Rem
- bbdoc: Set #Size_T field value
- End Rem
- Method Set( obj:Object,value:Size_T )
- SetSizet(obj, value)
- End Method
- Rem
- bbdoc: Set #Float field value
- End Rem
- Method Set( obj:Object,value:Float )
- SetFloat(obj, value)
- End Method
- Rem
- bbdoc: Set #Double field value
- End Rem
- Method Set( obj:Object,value:Double )
- SetDouble(obj, value)
- End Method
- Rem
- bbdoc: Set #LongInt field value
- End Rem
- Method Set( obj:Object,value:LongInt )
- SetLongInt(obj, value)
- End Method
- Rem
- bbdoc: Set #ULongInt field value
- End Rem
- Method Set( obj:Object,value:ULongInt )
- SetULongInt(obj, value)
- End Method
- Rem
- bbdoc: Set #Object field value
- End Rem
- Method SetObject( obj:Object,value:Object )
- _Assign bbRefFieldPtr( obj,_index ),_typeId,value
- End Method
- Rem
- bbdoc: Set #Byte field value
- End Rem
- Method SetByte( obj:Object,value:Byte )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=value
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromInt( value )
- End Select
- End Method
- Rem
- bbdoc: Set #Short field value
- End Rem
- Method SetShort( obj:Object,value:Short )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=value
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromInt( value )
- End Select
- End Method
- Rem
- bbdoc: Set #Int field value
- End Rem
- Method SetInt( obj:Object,value:Int )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=value
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromInt( value )
- End Select
- End Method
- Rem
- bbdoc: Set #UInt field value
- End Rem
- Method SetUInt( obj:Object,value:UInt )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=value
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromUInt( value )
- End Select
- End Method
- Rem
- bbdoc: Set #Long field value
- End Rem
- Method SetLong( obj:Object,value:Long )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=value
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromLong( value )
- End Select
- End Method
- Rem
- bbdoc: Set #ULong field value
- End Rem
- Method SetULong( obj:Object,value:ULong )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=value
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromULong( value )
- End Select
- End Method
- Rem
- bbdoc: Set #Size_T field value
- End Rem
- Method SetSizet( obj:Object,value:Size_T )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=value
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromSizet( value )
- End Select
- End Method
- Rem
- bbdoc: Set #Float field value
- End Rem
- Method SetFloat( obj:Object,value:Float )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=value
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromFloat( value )
- End Select
- End Method
- Rem
- bbdoc: Set #Double field value
- End Rem
- Method SetDouble( obj:Object,value:Double )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=value
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromDouble( value )
- End Select
- End Method
- Rem
- bbdoc: Set #LongInt field value
- End Rem
- Method SetLongInt( obj:Object,value:LongInt )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=value
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromLongInt( value )
- End Select
- End Method
- Rem
- bbdoc: Set #ULongInt field value
- End Rem
- Method SetULongInt( obj:Object,value:ULongInt )
- Local p:Byte Ptr = bbRefFieldPtr( obj,_index )
- Select _typeId
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=value
- Case StringTypeId
- bbRefAssignObject p,String.FromULongInt( value )
- End Select
- End Method
- Rem
- bbdoc: Set #String field value
- End Rem
- Method SetString( obj:Object,value:String )
- Set obj,value
- End Method
- Field _index
- End Type
- Rem
- bbdoc: Type global
- End Rem
- Type TGlobal Extends TMember
- Method Init:TGlobal( name:String,typeId:TTypeId,meta:String,ref:Byte Ptr )
- _name=name
- _typeId=typeId
- InitMeta(meta)
- _ref=ref
- Return Self
- End Method
- Rem
- bbdoc: Get global value
- End Rem
- Method Get:Object()
- Return _Get( _ref,_typeId )
- End Method
- Rem
- bbdoc: Get int global value
- End Rem
- Method GetInt:Int( )
- Return GetString().ToInt()
- End Method
- Rem
- bbdoc: Get long global value
- End Rem
- Method GetLong:Long()
- Return GetString().ToLong()
- End Method
- Rem
- bbdoc: Get size_t global value
- End Rem
- Method GetSizet:Size_T()
- Return GetString().ToSizet()
- End Method
- Rem
- bbdoc: Get ulong global value
- End Rem
- Method GetULong:ULong()
- Return GetString().ToULong()
- End Method
- Rem
- bbdoc: Get longint global value
- End Rem
- Method GetLongInt:LongInt()
- Return GetString().ToLongInt()
- End Method
- Rem
- bbdoc: Get ulongint global value
- End Rem
- Method GetULongInt:ULongInt()
- Return GetString().ToULongInt()
- End Method
- Rem
- bbdoc: Get float global value
- End Rem
- Method GetFloat:Float()
- Return GetString().ToFloat()
- End Method
- Rem
- bbdoc: Get double global value
- End Rem
- Method GetDouble:Double()
- Return GetString().ToDouble()
- End Method
- Rem
- bbdoc: Get string global value
- End Rem
- Method GetString:String()
- Return String( Get() )
- End Method
- Rem
- bbdoc: Set global value
- End Rem
- Method Set(value:Object )
- _Assign _ref,_typeId,value
- End Method
- Rem
- bbdoc: Set int global value
- End Rem
- Method SetInt(value:Int )
- SetString String.FromInt( value )
- End Method
- Rem
- bbdoc: Set uint global value
- End Rem
- Method SetUInt(value:UInt )
- SetString String.FromUInt( value )
- End Method
- Rem
- bbdoc: Set long global value
- End Rem
- Method SetLong(value:Long )
- SetString String.FromLong( value )
- End Method
- Rem
- bbdoc: Set ulong global value
- End Rem
- Method SetULong(value:ULong )
- SetString String.FromULong( value )
- End Method
- Rem
- bbdoc: Set longint global value
- End Rem
- Method SetLongInt(value:LongInt )
- SetString String.FromLongInt( value )
- End Method
- Rem
- bbdoc: Set ulongint global value
- End Rem
- Method SetULongInt(value:ULongInt )
- SetString String.FromULongInt( value )
- End Method
- Rem
- bbdoc: Set size_t global value
- End Rem
- Method SetSizet(value:Size_T )
- SetString String.FromSizet( value )
- End Method
- Rem
- bbdoc: Set float global value
- End Rem
- Method SetFloat(value:Float )
- SetString String.FromFloat( value )
- End Method
- Rem
- bbdoc: Set double global value
- End Rem
- Method SetDouble(value:Double )
- SetString String.FromDouble( value )
- End Method
- Rem
- bbdoc: Set string global value
- End Rem
- Method SetString(value:String )
- Set value
- End Method
- Field _ref:Byte Ptr
- End Type
- Rem
- bbdoc: Type function
- endrem
- Type TFunction Extends TMember
- Method Init:TFunction(name:String, typeId:TTypeId, meta:String, selfTypeId:TTypeId, ref:Byte Ptr, argTypes:TTypeId[])
- _name=name
- _typeId=typeId
- InitMeta(meta)
- _selfTypeId=selfTypeId
- _ref=ref
- _argTypes=argTypes
- Return Self
- End Method
- Rem
- bbdoc: Get function arg types
- End Rem
- Method ArgTypes:TTypeId[]()
- Return _argTypes
- End Method
- Rem
- bbdoc: Get function return type
- End Rem
- Method ReturnType:TTypeId()
- Return _typeId
- End Method
- Rem
- bbdoc: Get function pointer.
- endrem
- Method FunctionPtr:Byte Ptr()
- Return _ref
- End Method
- Rem
- bbdoc: Invoke type function
- endrem
- Method Invoke:Object(args:Object[] = Null)
- Return _CallFunction( _ref, _typeId, args, _argTypes)
- End Method
- Field _selfTypeId:TTypeId
- Field _ref:Byte Ptr
- Field _argTypes:TTypeId[]
- EndType
- Rem
- bbdoc: Type method
- End Rem
- Type TMethod Extends TMember
- Method Init:TMethod( name:String,typeId:TTypeId,meta:String,selfTypeId:TTypeId,ref:Byte Ptr,argTypes:TTypeId[] )
- _name=name
- _typeId=typeId
- InitMeta(meta)
- _selfTypeId=selfTypeId
- _ref=ref
- _argTypes=argTypes
- Return Self
- End Method
- Rem
- bbdoc: Get method arg types
- End Rem
- Method ArgTypes:TTypeId[]()
- Return _argTypes
- End Method
- Method ReturnType:TTypeId()
- Return _typeId._retType
- End Method
- Rem
- bbdoc: Invoke method
- End Rem
- Method Invoke:Object( obj:Object,args:Object[] = Null)
- Return _CallMethod( _ref,_typeId,obj,args,_argTypes )
- End Method
- Field _selfTypeId:TTypeId
- Field _ref:Byte Ptr
- Field _argTypes:TTypeId[]
- End Type
- Rem
- bbdoc: Type id
- End Rem
- Type TTypeId
- Rem
- bbdoc: Get name of type
- End Rem
- Method Name:String()
- Return _name
- End Method
- Rem
- bbdoc: Get type meta data
- End Rem
- Method MetaData:String( key:String="" )
- If Not _metaMap Or Not key Return _meta
- Return String(_metaMap.ValueForKey(key))
- End Method
-
- Rem
- bbdoc: Returns #True if @key is in the metadata.
- End Rem
- Method HasMetaData:Int( key:String )
- If Not _metaMap Or Not key Return False
- Return _metaMap.Contains(key)
- End Method
- Rem
- bbdoc: Get super type
- End Rem
- Method SuperType:TTypeId()
- Return _super
- End Method
- Rem
- bbdoc: Get array type
- End Rem
- Method ArrayType:TTypeId(dims:Int = 1)
- Try
- _guard.Lock()
-
- If dims >= _arrayType.length Then
- _arrayType = _arrayType[..dims + 1]
- End If
-
- Local at:TTypeId = _arrayType[dims]
-
- If Not at
- Local dim:String
- If dims > 1 Then
- For Local i:Int = 1 Until dims
- dim :+ ","
- Next
- End If
- ?Not ptr64
- at = New TTypeId.Init( _name+"[" + dim + "]",4,bbRefArrayClass() )
- ?ptr64
- at = New TTypeId.Init( _name+"[" + dim + "]",8,bbRefArrayClass() )
- ?
- at._elementType=Self
- If _super
- at._super=_super.ArrayType()
- Else
- at._super=ArrayTypeId
- EndIf
-
- _arrayType[dims] = at
- EndIf
- Return at
- Finally
- _guard.Unlock()
- End Try
- End Method
- Rem
- bbdoc: Get element type
- End Rem
- Method ElementType:TTypeId()
- Return _elementType
- End Method
- Rem
- bbdoc: Get pointer type
- End Rem
- Method PointerType:TTypeId()
- Try
- _guard.Lock()
-
- Local pt:TTypeId = _pointerType
- If Not pt Then
- ?Not ptr64
- pt = New TTypeId.Init( _name + " Ptr", 4)
- ?ptr64
- pt = New TTypeId.Init( _name + " Ptr", 8)
- ?
- pt._elementType = Self
- If _super Then
- pt._super = _super.PointerType()
- Else
- pt._super = PointerTypeId
- EndIf
-
- _pointertype = pt
- EndIf
- Return pt
- Finally
- _guard.Unlock()
- End Try
- End Method
- Rem
- bbdoc: Get function pointer type
- End Rem
- Method FunctionType:TTypeId( args:TTypeId[]=Null)
- Local s:String
- If args.length > 2 Then
- Local sb:TStringBuilder = New TStringBuilder()
- For Local t:TTypeId = EachIn args
- If sb.Length() sb.Append(",")
- sb.Append(t.Name())
- Next
- Else
- For Local t:TTypeId = EachIn args
- If s Then s :+ ","
- s :+ t.Name()
- Next
- End If
-
- If Not _functionType Then
- _functionType = New TStringMap
- End If
-
- Local ft:TTypeId = TTypeId(_functionType.ValueForKey(s))
-
- If Not ft Then
- ?Not ptr64
- ft = New TTypeId.Init( _name + "(" + s + ")", 4)
- ?ptr64
- ft = New TTypeId.Init( _name + "(" + s + ")", 8)
- ?
- ft._retType = Self
- ft._argTypes = args
- If _super Then
- ft._super = _super.FunctionType()
- Else
- ft._super = FunctionTypeId
- EndIf
-
- _functionType.Insert(s, ft)
- EndIf
- Return ft
- End Method
- Rem
- bbdoc: Get function return type
- End Rem
- Method ReturnType:TTypeId()
- If Not _retType Then Throw "TypeID is not a function type"
- Return _retType
- End Method
- Rem
- bbdoc: Get function argument types
- End Rem
- Method ArgTypes:TTypeId[]()
- If Not _retType Then Throw "TypeID is not a function type"
- Return _argTypes
- End Method
- Rem
- bbdoc: Determine if type extends a type
- End Rem
- Method ExtendsType( typeId:TTypeId )
- If Self=typeId Return True
- If _super Return _super.ExtendsType( typeId )
- End Method
- Rem
- bbdoc: Get list of derived types
- End Rem
- Method DerivedTypes:TList()
- If Not _derived _derived=New TList
- Return _derived
- End Method
- Rem
- bbdoc: Create a new object
- End Rem
- Method NewObject:Object()
- If Not _class Throw "Unable to create new object"
- If _interface Throw "Unable to create object from interface"
- Return bbObjectNew( _class )
- End Method
- Rem
- bbdoc: Returns True if this TypeId is an interface.
- End Rem
- Method IsInterface:Int()
- Return _interface <> Null
- End Method
- Rem
- bbdoc: Get list of constants
- about: Only returns constants declared in this type, not in super types.
- End Rem
- Method Constants:TStringMap()
- Return _consts
- End Method
- Rem
- bbdoc: Get list of fields
- about: Only returns fields declared in this type, not in super types.
- End Rem
- Method Fields:TStringMap()
- Return _fields
- End Method
- Rem
- bbdoc: Get list of globals
- about: Only returns globals declared in this type, not in super types.
- End Rem
- Method Globals:TStringMap()
- Return _globals
- End Method
- Rem
- bbdoc: Get list of functions
- about: Only returns functions declared in this type, not in super types.
- EndRem
- Method Functions:TStringMap()
- Return _functions
- End Method
- Rem
- bbdoc: Get list of methods
- about: Only returns methods declared in this type, not in super types.
- End Rem
- Method Methods:TStringMap()
- Return _methods
- End Method
- Rem
- bbdoc: Get list of implemented interfaces.
- End Rem
- Method Interfaces:TList()
- Return _interfaces
- End Method
- Rem
- bbdoc: Find a constant by name
- about: Searchs type hierarchy for constant called @name.
- End Rem
- Method FindConstant:TConstant( name:String )
- name=name.ToLower()
- Local t:TConstant = TConstant(_consts.ValueForKey(name))
- If t Return t
- ' For Local t:TConstant=EachIn _consts
- ' If t.NameLower()=name Return t
- ' Next
- If _super Return _super.FindConstant( name )
- End Method
- Rem
- bbdoc: Find a field by name
- about: Searchs type hierarchy for field called @name.
- End Rem
- Method FindField:TField( name:String )
- name=name.ToLower()
- Local t:TField = TField(_fields.ValueForKey(name))
- If t Then Return t
- If _super Return _super.FindField( name )
- End Method
- Rem
- bbdoc: Find a global by name
- about: Searchs type hierarchy for global called @name.
- End Rem
- Method FindGlobal:TGlobal( name:String )
- name=name.ToLower()
- Local t:TGlobal = TGlobal(_globals.ValueForKey(name))
- If t Then Return t
- If _super Return _super.FindGlobal( name )
- End Method
- Rem
- bbdoc: Find a function by name
- about: Searches type heirarchy for function called @name
- endrem
- Method FindFunction:TFunction(name:String)
- name = name.ToLower()
- Local t:TFunction = TFunction(_functions.ValueForKey(name))
- If t Then Return t
- If _super Return _super.FindFunction(name)
- End Method
- Rem
- bbdoc: Find a method by name
- about: Searchs type hierarchy for method called @name.
- End Rem
- Method FindMethod:TMethod( name:String )
- name=name.ToLower()
- Local t:TMethod = TMethod(_methods.ValueForKey(name))
- If t Then Return t
- If _super Return _super.FindMethod( name )
- End Method
- Rem
- bbdoc: Enumerate all constants
- about: Returns a list of all constants in type hierarchy
- End Rem
- Method EnumConstants:TList( list:TList=Null )
- If Not list list=New TList
- If _super _super.EnumConstants list
- For Local t:TConstant=EachIn _constsList '.Values()
- list.AddLast t
- Next
- Return list
- End Method
- Rem
- bbdoc: Enumerate all fields
- about: Returns a list of all fields in type hierarchy
- End Rem
- Method EnumFields:TList( list:TList=Null )
- If Not list list=New TList
- If _super _super.EnumFields list
- For Local t:TField=EachIn _fieldsList '.Values()
- list.AddLast t
- Next
- Return list
- End Method
- Rem
- bbdoc: Enumerate all globals
- about: Returns a list of all globals in type hierarchy
- End Rem
- Method EnumGlobals:TList( list:TList=Null )
- If Not list list=New TList
- If _super _super.EnumGlobals list
- For Local t:TGlobal=EachIn _globalsList '.Values()
- list.AddLast t
- Next
- Return list
- End Method
- Rem
- bbdoc: Enumerate all functions
- about: Returns a list of all functions in type hierarchy
- End Rem
- Method EnumFunctions:TList( list:TList=Null )
- Function compareFunction:Int( a:Object, b:Object)
- If TFunction(a) And TFunction(b) Then
- Return TFunction(a).Name().Compare(TFunction(b).Name())
- End If
- EndFunction
- If Not list list=New TList
- If _super And _super <> Self Then _super.EnumFunctions list
- For Local t:TFunction=EachIn _functionsList '.Values()
- list.AddLast t
- Next
- ' remove overridden functions
- list.Sort( True, compareFunction)
- Local prev:TFunction
- For Local t:TFunction = EachIn list
- If prev Then
- If (t.Name().Compare(prev.Name())) = 0 Then list.Remove(prev)
- EndIf
- prev = t
- Next
- Return list
- End Method
- Rem
- bbdoc: Enumerate all methods
- about: Returns a list of all methods in type hierarchy - TO DO: handle overrides!
- End Rem
- Method EnumMethods:TList( list:TList=Null )
- If Not list list=New TList
- If _super _super.EnumMethods list
- For Local t:TMethod=EachIn _methodsList '.Values()
- list.AddLast t
- Next
- Return list
- End Method
- Rem
- bbdoc: Create a new array
- End Rem
- Method NewArray:Object( length, dims:Int[] = Null )
- If Not _elementType Throw "TypeID is not an array type"
- Local tag:Byte Ptr=_elementType._typeTag
- If Not tag
- tag=TypeTagForId( _elementType ).ToCString()
- _elementType._typeTag=tag
- EndIf
- If Not dims Then
- Return bbArrayNew1D( tag,length )
- Else
- Return bbRefArrayCreate( tag, dims )
- End If
- End Method
- Rem
- bbdoc: Get array length
- End Rem
- Method ArrayLength( _array:Object, dim:Int = 0 )
- If Not _elementType Throw "TypeID is not an array type"
- Return bbRefArrayLength( _array, dim )
- End Method
- Method NullArray:Object()
- Return bbRefArrayNull()
- End Method
-
- Rem
- bbdoc: Get the number of dimensions
- End Rem
- Method ArrayDimensions:Int( _array:Object )
- If Not _elementType Throw "TypeID is not an array type"
- Return bbRefArrayDimensions( _array )
- End Method
-
- Method ArraySlice:Object( _array:Object, _start:Int, _end:Int )
- If Not _elementType Throw "TypeID is not an array type"
- Local tag:Byte Ptr=_elementType._typeTag
- If Not tag
- tag=TypeTagForId( _elementType ).ToCString()
- _elementType._typeTag=tag
- EndIf
- _array = bbArraySlice(tag, _array, _start, _end)
- Return _array
- End Method
-
- Rem
- bbdoc: Gets an array element
- End Rem
- Method GetArrayElement:Object( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Return _Get( p,_elementType )
- End Method
- Rem
- bbdoc: Gets an array element as a #String
- End Rem
- Method GetStringArrayElement:String( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Return String(_Get( p,_elementType ))
- End Method
- Rem
- bbdoc: Gets an array element as a #Byte
- End Rem
- Method GetByteArrayElement:Byte( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #Short
- End Rem
- Method GetShortArrayElement:Short( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as an #Int
- End Rem
- Method GetIntArrayElement:Int( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #UInt
- End Rem
- Method GetUIntArrayElement:UInt( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #Long
- End Rem
- Method GetLongArrayElement:Long( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #ULong
- End Rem
- Method GetULongArrayElement:ULong( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #Size_T
- End Rem
- Method GetSizeTArrayElement:Size_T( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #Float
- End Rem
- Method GetFloatArrayElement:Float( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #Double
- End Rem
- Method GetDoubleArrayElement:Double( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #LongInt
- End Rem
- Method GetLongIntArrayElement:LongInt( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Gets an array element as a #ULongInt
- End Rem
- Method GetULongIntArrayElement:ULongInt( _array:Object,index )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- Return (Byte Ptr p)[0]
- Case ShortTypeId
- Return (Short Ptr p)[0]
- Case IntTypeId
- Return (Int Ptr p)[0]
- Case UIntTypeId
- Return (UInt Ptr p)[0]
- Case LongTypeId
- Return (Long Ptr p)[0]
- Case ULongTypeId
- Return (ULong Ptr p)[0]
- Case SizetTypeId
- Return (Size_T Ptr p)[0]
- Case FloatTypeId
- Return (Float Ptr p)[0]
- Case DoubleTypeId
- Return (Double Ptr p)[0]
- Case LongIntTypeId
- Return (LongInt Ptr p)[0]
- Case ULongIntTypeId
- Return (ULongInt Ptr p)[0]
- End Select
- End Method
- Rem
- bbdoc: Sets an array element
- End Rem
- Method SetArrayElement( _array:Object,index,value:Object )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- _Assign p,_elementType,value
- End Method
- Rem
- bbdoc: Sets an array element as a #Byte
- End Rem
- Method SetArrayElement( _array:Object,index,value:Byte )
- SetByteArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #Short
- End Rem
- Method SetArrayElement( _array:Object,index,value:Short )
- SetShortArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as an #Int
- End Rem
- Method SetArrayElement( _array:Object,index,value:Int )
- SetIntArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #UInt
- End Rem
- Method SetArrayElement( _array:Object,index,value:UInt )
- SetUIntArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #Long
- End Rem
- Method SetArrayElement( _array:Object,index,value:Long )
- SetLongArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #ULong
- End Rem
- Method SetArrayElement( _array:Object,index,value:ULong )
- SetULongArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #Size_T
- End Rem
- Method SetArrayElement( _array:Object,index,value:Size_T )
- SetSizeTArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #Float
- End Rem
- Method SetArrayElement( _array:Object,index,value:Float )
- SetFloatArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #Double
- End Rem
- Method SetArrayElement( _array:Object,index,value:Double )
- SetDoubleArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #LongInt
- End Rem
- Method SetArrayElement( _array:Object,index,value:LongInt )
- SetLongIntArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #ULongInt
- End Rem
- Method SetArrayElement( _array:Object,index,value:ULongInt )
- SetULongIntArrayElement(_array, index, value)
- End Method
- Rem
- bbdoc: Sets an array element as a #Byte
- End Rem
- Method SetByteArrayElement( _array:Object,index,value:Byte )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=value
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromInt(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #Short
- End Rem
- Method SetShortArrayElement( _array:Object,index,value:Short )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=value
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromInt(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #Int
- End Rem
- Method SetIntArrayElement( _array:Object,index,value:Int )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=value
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromInt(value)
- End Select
- End Method
-
- Rem
- bbdoc: Sets an array element as a #UInt
- End Rem
- Method SetUIntArrayElement( _array:Object,index,value:UInt )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=value
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromUInt(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #Long
- End Rem
- Method SetLongArrayElement( _array:Object,index,value:Long )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=value
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromLong(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #ULong
- End Rem
- Method SetULongArrayElement( _array:Object,index,value:ULong )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=value
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromULong(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #Size_T
- End Rem
- Method SetSizeTArrayElement( _array:Object,index,value:Size_T )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=value
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromSizeT(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #Float
- End Rem
- Method SetFloatArrayElement( _array:Object,index,value:Float )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=value
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromFloat(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #Double
- End Rem
- Method SetDoubleArrayElement( _array:Object,index,value:Double )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=value
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromDouble(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #LongInt
- End Rem
- Method SetLongIntArrayElement( _array:Object,index,value:LongInt )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=value
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=ULongInt(value)
- Case StringTypeId
- bbRefAssignObject p,String.FromDouble(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element as a #ULongInt
- End Rem
- Method SetULongIntArrayElement( _array:Object,index,value:ULongInt )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- Select _elementType
- Case ByteTypeId
- (Byte Ptr p)[0]=Byte(value)
- Case ShortTypeId
- (Short Ptr p)[0]=Short(value)
- Case IntTypeId
- (Int Ptr p)[0]=Int(value)
- Case UIntTypeId
- (UInt Ptr p)[0]=UInt(value)
- Case LongTypeId
- (Long Ptr p)[0]=Long(value)
- Case ULongTypeId
- (ULong Ptr p)[0]=ULong(value)
- Case SizetTypeId
- (Size_T Ptr p)[0]=Size_T(value)
- Case FloatTypeId
- (Float Ptr p)[0]=Float(value)
- Case DoubleTypeId
- (Double Ptr p)[0]=Double(value)
- Case LongIntTypeId
- (LongInt Ptr p)[0]=LongInt(value)
- Case ULongIntTypeId
- (ULongInt Ptr p)[0]=value
- Case StringTypeId
- bbRefAssignObject p,String.FromDouble(value)
- End Select
- End Method
- Rem
- bbdoc: Sets an array element
- End Rem
- Method SetStringArrayElement( _array:Object,index,value:String )
- If Not _elementType Throw "TypeID is not an array type"
- Local p:Byte Ptr=bbRefArrayElementPtr( _elementType._size,_array,index )
- _Assign p,_elementType,value
- End Method
- Rem
- bbdoc: Get Type by name
- End Rem
- Function ForName:TTypeId( name:String )
- Try
- _guard.Lock()
-
- _Update
- If name.EndsWith( "]" )
- ' TODO
- name=name[..name.length-2]
- Local nameType:TTypeID = TTypeId( _nameMap.ValueForKey( name.ToLower() ) )
- If Not nameType Then Return Null
- Return nameType.ArrayType()
- ' pointers
- ElseIf name.EndsWith( "Ptr" )
- name=name[..name.length-4].Trim()
- If Not name Then Return Null
- Local baseType:TTypeId = ForName( name )
- If baseType Then
- ' check for valid pointer base types
- Select baseType
- Case ByteTypeId, ShortTypeId, IntTypeId, LongTypeId, FloatTypeId, DoubleTypeId
- Return baseType.PointerType()
- Default
- If baseType.ExtendsType(PointerTypeId) Then Return baseType.PointerType()
- EndSelect
- EndIf
- Return Null
- ' function pointers
- ElseIf name.EndsWith( ")" )
- ' check if its in the table already
- Local t:TTypeId = TTypeId( _nameMap.ValueForKey( name.ToLower() ) )
- If t Then Return t
- Local i:Int = name.Find("(")
- Local ret:TTypeId = ForName( name[..i].Trim())
- Local typs:TTypeId[]
- If ret Then
- Local params:String = name[i+1..name.Length-1].Trim()
- If params Then
- Local args:String[] = params.Split(",")
- If args.Length >= 1 And args[0] Then
- typs = New TTypeId[args.Length]
- For Local i:Int = 0 Until args.Length
- typs[i] = ForName(args[i].Trim())
- If Not typs[i] Then typs[i] = ObjectTypeId
- Next
- EndIf
- EndIf
- 'ret._functionType = Null
- Return ret.FunctionType(typs)
- EndIf
- Else
- Return TTypeId( _nameMap.ValueForKey( name.ToLower() ) )
- EndIf
- Finally
- _guard.Unlock()
- End Try
- End Function
- Rem
- bbdoc: Get Type by object
- End Rem
- Function ForObject:TTypeId( obj:Object )
- Try
- _guard.Lock()
- _Update
- Local class:Byte Ptr=bbRefGetObjectClass( obj )
- If class=ArrayTypeId._class
- If Not bbRefArrayLength( obj ) Return ArrayTypeId
- Return TypeIdForTag( bbRefArrayTypeTag( obj ) ).ArrayType()
- Else
- Return TTypeId( _classMap.ValueForKey( class ) )
- EndIf
- Finally
- _guard.Unlock()
- End Try
- End Function
- Rem
- bbdoc: Get list of all types
- End Rem
- Function EnumTypes:TList()
- Try
- _guard.Lock()
- _Update
- Local list:TList=New TList
- For Local t:TTypeId=EachIn _nameMap.Values()
- list.AddLast t
- Next
- Return list
- Finally
- _guard.Unlock()
- End Try
- End Function
- Rem
- bbdoc: Gets a list of all interfaces
- End Rem
- Function EnumInterfaces:TList()
- _Update
- Local list:TList=New TList
- For Local t:TTypeId=EachIn _interfaceMap.Values()
- list.AddLast t
- Next
- Return list
- End Function
- '***** PRIVATE *****
- Method Init:TTypeId( name:String,size,class:Byte Ptr=Null,supor:TTypeId=Null )
- _name=name
- _size=size
- _class=class
- _super=supor
- _consts=New TStringMap
- _fields=New TStringMap
- _globals=New TStringMap
- _functions=New TStringMap
- _methods=New TStringMap
- _constsList=New TList
- _fieldsList=New TList
- _globalsList=New TList
- _functionsList=New TList
- _methodsList=New TList
- _nameMap.Insert _name.ToLower(),Self
- If class _classMap.Insert class,Self
- Return Self
- End Method
-
- Method InitMeta(meta:String)
- _meta = meta
- _metaMap = ExtractMetaMap(meta)
- End Method
- Method SetClass:TTypeId( class:Byte Ptr )
- Local name:String=String.FromCString( bbRefClassDebugScopeName(class) )
- Local meta:String
- Local i=name.Find( "{" )
- If i<>-1
- meta=name[i+1..name.length-1]
- name=name[..i]
- EndIf
- _name=name
- InitMeta(meta)
- _class=class
- _nameMap.Insert _name.ToLower(),Self
- _classMap.Insert class,Self
- Return Self
- End Method
- Method SetInterface:TTypeId( ifc:Byte Ptr )
- Local name:String = String.FromCString(bbInterfaceName(ifc))
- Local meta:String
- Local i=name.Find( "{" )
- If i<>-1
- meta=name[i+1..name.length-1]
- name=name[..i]
- EndIf
- _name=name
- InitMeta(meta)
- _interface=ifc
- _class=bbInterfaceClass(ifc)
- _nameMap.Insert _name.ToLower(),Self
- _interfaceMap.Insert ifc,Self
- Return Self
- End Method
- Function _Update()
- Local count:Int
- ?Not ptr64
- Local p:Int Ptr Ptr=bbObjectRegisteredTypes( count )
- ?ptr64
- Local p:Long Ptr Ptr=bbObjectRegisteredTypes( count )
- ?
- If count=_count Return
- Local list:TList=New TList
- For Local i=_count Until count
- Local ty:TTypeId=New TTypeId.SetClass( p[i] )
- list.AddLast ty
- Next
- _count=count
- _UpdateInterfaces()
- For Local t:TTypeId=EachIn list
- t._Resolve
- Next
- End Function
- Function _UpdateInterfaces()
- Local count:Int
- ?Not ptr64
- Local p:Int Ptr Ptr=bbObjectRegisteredInterfaces( count )
- ?ptr64
- Local p:Long Ptr Ptr=bbObjectRegisteredInterfaces( count )
- ?
- If count=_icount Return
- Local list:TList=New TList
- For Local i=_icount Until count
- Local ty:TTypeId=New TTypeId.SetInterface( p[i] )
- list.AddLast ty
- Next
- _icount=count
- For Local t:TTypeId=EachIn list
- t._Resolve
- Next
- End Function
- Method _Resolve()
- If _fields Or Not _class Return
- _consts=New TStringMap
- _fields=New TStringMap
- _globals=New TStringMap
- _functions=New TStringMap
- _methods=New TStringMap
- _constsList=New TList
- _fieldsList=New TList
- _globalsList=New TList
- _functionsList=New TList
- _methodsList=New TList
- _interfaces=New TList
- If Not _interface Then
- _super=TTypeId( _classMap.ValueForKey(bbRefClassSuper(_class)))
- End If
- If Not _super _super=ObjectTypeId
- If Not _super._derived _super._derived=New TList
- _super._derived.AddLast Self
- Local p:Byte Ptr = bbRefClassDebugDecl(_class)
- While bbDebugDeclKind(p)
- Local id:String=String.FromCString( bbDebugDeclName(p) )
- Local ty:String=String.FromCString( bbDebugDeclType(p) )
- Local meta:String
- Local i=ty.Find( "{" )
- If i<>-1
- meta=ty[i+1..ty.length-1]
- ty=ty[..i]
- EndIf
- Select bbDebugDeclKind(p)
- Case 1 'const
- Local tt:TTypeId = TypeIdFortag(ty)
- If tt Then
- Local t:TConstant = New TConstant.Init( id, tt, meta, bbDebugDeclConstValue(p))
- _constsList.AddLast(t)
- _consts.Insert(t.NameLower(), t)
- EndIf
- Case 3 'field
- Local typeId:TTypeId=TypeIdForTag( ty )
- If typeId Then
- Local t:TField = New TField.Init( id,typeId,meta,bbDebugDeclFieldOffset(p) )
- _fieldsList.AddLast(t)
- _fields.Insert(t.NameLower(), t)
- End If
- Case 4 'global
- Local typeId:TTypeId=TypeIdForTag( ty )
- If typeId Then
- Local t:TGlobal = New TGlobal.Init( id,typeId,meta, bbDebugDeclVarAddress(p) )
- _globalsList.AddLast(t)
- _globals.Insert(t.NameLower(), t)
- End If
- Case 6, 7 'method/function
- Local t:String[]=ty.Split( ")" )
- Local retType:TTypeId=TypeIdForTag( t[1] )
- If retType
- Local argTypes:TTypeId[]
- If t[0].length>1
- Local i,b,q:String=t[0][1..],args:TList=New TList
- While i<q.length
- Select q[i]
- Case Asc( "," )
- args.AddLast q[b..i]
- i:+1
- b=i
- Case Asc( "[" )
- i:+1
- While i<q.length And q[i]=Asc(",")
- i:+1
- Wend
- Default
- i:+1
- End Select
- Wend
- If b<q.length args.AddLast q[b..q.length]
- argTypes=New TTypeId[args.Count()]
- i=0
- For Local arg:String=EachIn args
- argTypes[i]=TypeIdForTag( arg )
- If Not argTypes[i] retType=Null
- i:+1
- Next
- EndIf
- If retType
- If bbDebugDeclKind(p) = 6 Then ' method
- Local t:TMethod = New TMethod.Init(id, TypeIdForTag(ty), meta, Self, bbDebugDeclVarAddress(p), argTypes)
- _methodsList.AddLast(t)
- _methods.Insert(t.NameLower(), t)
- Else ' function
- Local t:TFunction = New TFunction.Init(id, TypeIdForTag(ty), meta, Self, bbDebugDeclVarAddress(p), argTypes)
- _functionsList.AddLast(t)
- _functions.Insert(t.NameLower(), t)
- End If
- EndIf
- EndIf
- End Select
- p = bbDebugDeclNext(p)
- Wend
- ' implemented interfaces ?
- Local impInt:Int = bbObjectImplementsInterfaces(_class)
- If impInt Then
- Local imps:Int = bbObjectImplementedCount(_class)
- If imps > 0 Then
- For Local i:Int = 0 Until imps
- _interfaces.AddLast(_interfaceMap.ValueForKey(bbObjectImplementedInterface(_class, i)))
- Next
- End If
- End If
- End Method
- Field _name:String
- Field _meta:String
- Field _metaMap:TStringMap
- Field _class:Byte Ptr
- Field _interface:Byte Ptr
- ' default object size
- ?Not ptr64
- Field _size=4
- ?ptr64
- Field _size=8
- ?
- Field _consts:TStringMap
- Field _fields:TStringMap
- Field _globals:TStringMap
- Field _functions:TStringMap
- Field _methods:TStringMap
- Field _constsList:TList
- Field _fieldsList:TList
- Field _globalsList:TList
- Field _functionsList:TList
- Field _methodsList:TList
- Field _interfaces:TList
- Field _super:TTypeId
- Field _derived:TList
- Field _arrayType:TTypeId[]
- Field _elementType:TTypeId
- Field _typeTag:Byte Ptr
- Field _pointerType:TTypeId
- Field _functionType:TStringMap
- Field _argTypes:TTypeId[]
- Field _retType:TTypeId
- Global _count,_nameMap:TMap=New TMap,_classMap:TPtrMap=New TPtrMap
- Global _icount:Int, _interfaceMap:TPtrMap=New TPtrMap
- End Type
|