[luabind] Dynamic class instantiation
Brought to you by:
arvidn,
daniel_wallin
From: Sergey P. <al...@gm...> - 2005-09-28 14:44:47
|
Hi there! I've searched the archive of this mail list, but could not find the answer, so I decide to post it here. Let C++ class is registered via luabind under "SomeCppClass" name. Normally, the Lua code should look like this: local myVar = SomeCppClass() ... But in my case the name of that class is not known at the moment of Lua script writing. I should read its (class) name from text config file and instantiate it. Should look like this: local className = "SomeCppClass" local myVar = MagicLuaMechanism:instantiateClass(className) Do you know how to do such thing with Lua? Thanks in advance, Serge. |