Re: Control of luabind::objects
"Josh Klint" <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <000001cc176a$5645a9c0$02d0fd40$@com> |
I should also mention that in my example below, "health" is not a C++ class member, but just a Lua value I added to the entity. Best Regards, Josh Klint CEO Leadwerks Software www.leadwerks.com From: Josh Klint [mailto:[email protected]] Sent: Friday, May 20, 2011 4:16 PM To: [email protected] Subject: [luabind] Control of luabind::objects Is it possible to ensure luabind always uses the same Luabind::object for any given C++ object? I am having problems because luabind is creating new luabind::objects and returning those, without the information I attached to the "real" object. Example: --"entity" is the luabind::object created for the C++ object entity.health= entity.health -1 for child in entity.kids do -"kids" is an std::list exposed to LuaBind child.health = child.health-1 -Can't access this because luabind creates a new luabind::object and returns it, instead of returning the one I created and pushed the "health" value onto end I would like to have a callback function LuaBind uses to get the actual luabind::object I created and pushed onto the stack when I added values. Right now, any values I add to a luabind::object will get lost if a function returns an object, because a new empty luabind::object will be created. Best Regards, Josh Klint CEO Leadwerks Software www.leadwerks.com ------------------------------------------------------------------------------ What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user