Skip to content

Latest commit

 

History

History
29 lines (28 loc) · 1.1 KB

LUAGLUE.md

File metadata and controls

29 lines (28 loc) · 1.1 KB

LUA Glue

class LuaInterface<T> inheriting from it hooks regular c++ class T into Lua
    static ::Lua_Methods a map generated by LUA_METHOD macro to hook methods into Lua, will pull object and args from lua stack
    static ::Lua_Name a string to identify the class (as lua metamap)
    static ::Lua_Register(lua_state) registers the class with a lua_state
    ::Lua_Index("key") called when lua reads from "unknown" key in object
    ::Lua_NewIndex("key",variant) called when lua writes to "unknown" key in object
interface LuaType
    ::Lua_Push(L) pushes the object onto lua stack
class LuaVariant helper to pull any literal from / push any literal to lua stack
    ::Lua_Get(L) pulls value from stack
struct LuaRef helper to distinguish between integers and references
    int ::ref the actual reference
    bool ::valid() true if ref is set
class Lua provides a wrapper around lua state, for now we mix it with regular lua_* calls
    ::Lua(L) create wrapper for existing lua state L
    ::Push(...) push value onto lua stack, based on type
    ::PushNil() push nil onto lua stack