lua-users home
lua-l archive

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


It should be as easy as using lua_getmetatable() on one of the
objects, and putting the resultant table in the permanents table; all
objects of that class most likely use the same metatable. This is
slightly hackish, since technically it should be possible to grab the
metatable from the LuaBind class registry, but I'm familiar enough
with LuaBind to know how to do that.

Ben

On 5/15/05, Stefan Schwarzbach <Schwarzbach@silentdreams.de> wrote:
> I don't know how to identify the metatable to list it in the permanent
> table.
> 
> Here's the call stack from the beginning of the serialization to the
> C-function problem:
> 
> persistfunction(PersistInfo_t * pi=0x0006f8f0)
> persist(PersistInfo_t * pi=0x0006f8f0)
> persisttable(PersistInfo_t * pi=0x0006f8f0)
> persist(PersistInfo_t * pi=0x0006f8f0)
> persistuserdata(PersistInfo_t * pi=0x0006f8f0)
> persist(PersistInfo_t * pi=0x0006f8f0)
> // Main persist table
> persisttable(PersistInfo_t * pi=0x0006f8f0)
> persist(PersistInfo_t * pi=0x0006f8f0)
> // Start call
> pluto_persist(lua_State * L=0x0e674b20, int (lua_State *, const void *,
> unsigned int, void *)* writer=0x0060b615, void * ud=0x1027c8f8)
> 
> What do I have to do to identify the metatable? I don't get a name from
> the that metatable, only from the class table itself and from the
> function name.
> 
> Greetings,
> Stefan
> 
> Ben Sunshine-Hill wrote:
> > Ahh, I think I know what's going on.
> >
> > LuaBind is trying to store a metatable for a table, and the metatable
> > contains an __eq metamethod which is a C-function. Pluto, which has no
> > way of serializing C functions, thus fails.
> >
> > Have you tried adding the metatable to the permanents table? Assuming
> > there's only one metatable per class, this shouldn't be much overhead,
> > and should work fine. Tell me if you need help with this; I'd very
> > much like to be aware of interactions between Pluto and binding
> > libraries like LuaBind.
>