lua-users home
lua-l archive

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


I've been reading up as much as I can on Lua the last month or so,
including the book, and I have a project that I am not sure the best
way to go about integrating Lua into it.

Basically what I need to is this.

I have a Singleton Object factory in C++ that creates objects (of
course). What I need is for once these objects are created in C++ pass
them into lua to be stored into a table.
Then my program is going to call a lua script which iterates on the
table of objects and processes scripts for each one in order.

I've figured out how to create instances of a C++ class IN Lua, but I
haven't really seen a way to pass already created class objects into
the Lua environment to be handled by Lua.

I also don't want them garbage collected, since I will handle that in
my script. I understand that probably isn't a problem since Lua didnt
create them, but I wanted to be sure.

Thanks in advance,
Ryan.