lua-users home
lua-l archive

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


Hi!

I'm trying to use lunar with my C++ code...
I'd like to expose a factory to Lua.

In short, my problem is something like (see the comment):

class MyClassFactoryWrapperForLua {
  MyClassFactory * factory;
  int Create(lua_State * L) {
    char * param = luaL_checkstring(L, 1);
    ////
    // How can I push on the stack
    // an object using MyClassWrapperForLua
    // generated through factory->NewObject(param);
    ////
  }
}

class MyClassWrapperForLua {
  MyClass * object;
  [...]
}

Any idea?

-- 
Geoffroy Carrier