lua-users home
lua-l archive

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


Hello,

I'm planning to use Lua to provide extensibility for a rich C++ class
hierarchy in a performance-sensitive application. What I would like to do is
to provide some way for the user to inherit any of the classes in the
hierarchy and implement its virtual functions in Lua code. The fact that any
virtual function might be implement in Lua should preferably not be visible
to the C++ side.

Any ideas how to do this kind of thing efficiently? My current plan is to
have objects represented with tables on the Lua side, and have them contain
a pointer to the C++ instance as userdata. Some tag methods would probably
need to be specified to provide delegation of indexing from the table to the
C++ instance, etc...

--
Mikko Kallinen