lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Ok.. I am pretty new to Lua...

I have an extensive RTTI information system built into my cpp class
hierarchy.  This includes the variables that make up the class (for
serialization primarily) and also the classes functions.. return
type/parameter types/ and a functor (function pointer) to the associated
function...

Following the example of how toLua generates bindings... I am teaching my
system to automatically bind these classes to Lua... it is working
fabulously...

I have run into a small snag however...

All function tags callback to the same static int luacallback(lua_State* ls)
function I have defined... what I need to get from here is:

A) the "class" of the table
B) the _name_ of the field (function)

so a table of "type" cpClass with a function called setName.. called from
Lua as:

class = cpClass:new()
class:setName("whewp")

would end up in the callback static int luacallback(lua_State* ls)

How do I get the cpClass and the setName here so I can match the arguments
and call the appropriate function?

Thanks!
-J