Lua wrapper around a Graphite object.
More...
Go to the source code of this file.
|
| namespace | OGF |
| | Global Graphite namespace.
|
| |
Lua wrapper around a Graphite object.
Definition in file lua_graphite_object.h.
◆ init_lua_graphite()
Initializes the LUA state for graphite.
Registers GOM implementation functions, creates the metatables for graphite objects and graphite requests, and create the global table for LUA targets. The global tables are created in the registry.
- Parameters
-
| [in] | interpreter | a pointer to the LuaInterpreter. |
◆ lua_isgraphite()
| bool OGF::GOMLua::lua_isgraphite |
( |
lua_State * |
L, |
|
|
int |
index |
|
) |
| |
Tests whether a LUA object is a graphite object.
- Parameters
-
| [in] | L | a pointer to the LUA state. |
| [in] | index | the stack index of the LUA object to be tested. |
- Return values
-
| true | if the LUA object at index is a graphite object. |
| false | otherwise. |
◆ lua_pushgraphite()
| void OGF::GOMLua::lua_pushgraphite |
( |
lua_State * |
L, |
|
|
Object * |
object, |
|
|
bool |
managed = true |
|
) |
| |
Pushes a graphite object onto the LUA stack.
Graphite objects in LUA are seen as a full user data that contains a pointer to the object. We use full user data (rather than light user data) because full user data can have a metatable, that lets us redirect member access to the GOM system.
- Parameters
-
| [in] | L | a pointer to the LUA state. |
| [in] | object | a pointer to the graphite object |
| [in] | managed | if true, manages reference count, else only store a reference to the object without changing the reference count. This is needed for the Interpreter itself, accessible through the "gom" global variable. If it was reference-counted, then we would have a circular reference, preventing the interpreter from being deallocated on exit. |
◆ lua_tographite()
| Object * OGF::GOMLua::lua_tographite |
( |
lua_State * |
L, |
|
|
int |
index |
|
) |
| |
Gets a pointer to a graphite object from a LUA object.
- Precondition
- lua_isgraphite(L,index)
- Parameters
-
| [in] | L | a pointer to the LUA state. |
| [in] | index | the stack index of the LUA object to be tested. |
- Returns
- a pointer to the graphite object.