correct way to object_cast a non-trivial type?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

correct way to object_cast a non-trivial type?

anders langlands
I've got a simple pod data struct that's im trying to pass to c++ in a table by iterating over the passes table and using object_cast<MyStruct> to get the data, but the cast always fails. Is there something I'm missing?

cheers,

anders
Reply | Threaded
Open this post in threaded view
|

Re: correct way to object_cast a non-trivial type?

Arvid Norberg-2

On Mar 26, 2006, at 04:15, anders langlands wrote:

> I've got a simple pod data struct that's im trying to pass to c++  
> in a table by iterating over the passes table and using  
> object_cast<MyStruct> to get the data, but the cast always fails.  
> Is there something I'm missing?

Have you bound MyStruct with luabind first? what type does the lua  
object have that you are trying to cast?

object_cast<>() is basically only a facility to do the lua to c++  
conversions that are done on parameters and return values when c++  
functions are called from lua or vice versa.

i.e. if MyType is registered, and you are trying to acquire the a  
pointer to it in C++, then object_cast<> is supposed to work.

--
Arvid Norberg




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user