在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.new tbClass{}, Binding "FunName" to C function "thunk" and set it's closure with upvalue;
2.rigister metatable "Class", and set metatable __index to table"tbClass"
3.new pObj, new userdata to point it, and set this userdata's metatable then push it into stack.
4.call Obj:FunName()
5.because Obj associate tbClass by metatable, so will call tbClass[FunName], then call thunk, remember thunk have upvalue.
6.when we have userdata whitch have pObj,and have upvalue,then CallFun
1.new tbClass{},Encapsulation all Class Memeber as KLuaData. tbClass[FunName] = KLuaData.KLuaData push as userdata.
2.rigister metatable "Class", and set metatable __index to C Function "_LuaIndex"
3.push userdata who's restore pObj, and set metatable
4.Call a.FunName()
5.Call C Function _LuaIndex,in this can get pObj and KLuaData,switch kind of KLuaData,execute diff Op.
6.if KLuaData is FunData, then push pObj,and FunData, and CFun "_LuaDispatcher",then () will Call this Fun
7.CallFun
|
请发表评论