25 #ifndef ENGINES_AURORA_LUA_SCRIPTMAN_H 26 #define ENGINES_AURORA_LUA_SCRIPTMAN_H 94 lua_CFunction deleter = 0);
141 static int atPanic(lua_State *state);
157 #define LuaScriptMan ::Aurora::Lua::ScriptManager::instance() 159 #endif // ENGINES_AURORA_LUA_SCRIPTMAN_H TableRef getGlobalTable(const Common::UString &name) const
Class and macro for implementing singletons.
static int luaSetGCInterval(lua_State *state)
void beginRegisterClass(const Common::UString &name, const Common::UString &baseName="", lua_CFunction deleter=0)
Begin registration of a class.
static int luaPlayFile(lua_State *state)
A class holding an UTF-8 string.
const TableRef & getLuaInstanceForObject(void *object) const
void unsetLuaInstanceForObject(void *object)
void closeLuaState()
Close the current Lua state.
void endRegisterNamespace()
End registration of the current namespace.
void removeIgnoredFile(const Common::UString &path)
Remove a file from the ignore list.
static int atPanic(lua_State *state)
Handler of the Lua panic situations.
static int luaRegisterSubst(lua_State *state)
void declareClass(const Common::UString &name)
Declare a class with the given name.
void executeDefaultCode()
void registerConstant(const Common::UString &name, float value)
Register a constant.
static int luaRegisterHandler(lua_State *state)
void addIgnoredFile(const Common::UString &path)
Add a file to the ignore list.
static int luaGetLua(lua_State *state)
Lua bindings.
Generic template base class for implementing the singleton design pattern.
void executeString(const Common::UString &code)
Execute a script string.
void endRegister()
End registration of the entities.
void registerVariable(const Common::UString &name, lua_CFunction getter, lua_CFunction setter=0)
Register a variable.
void endRegisterClass()
End registration of the current class.
static int luaUnregisterSubst(lua_State *state)
std::map< void *, TableRef > ObjectLuaInstanceMap
void beginRegisterNamespace(const Common::UString &name)
Begin registration of a namespace.
std::vector< Variable > Variables
ObjectLuaInstanceMap _objectLuaInstances
A reference to a Lua function.
void init()
Initialize the script subsystem.
bool isIgnoredFile(const Common::UString &path) const
Is this file in the ignore list?
Variable getGlobalVariable(const Common::UString &name) const
void executeFile(const Common::UString &path)
Execute a script file.
int _regNestingLevel
The current nesting level of the registration process.
void deinit()
Deinitialize the script subsystem.
void requireDeclaredClass(const Common::UString &name) const
Check whether a class with the given name was declared.
void injectNewIndexMetaEventIntoTable(const TableRef &table)
void beginRegister()
Begin registration of the entities.
void registerDefaultBindings()
lua_State * _luaState
The Lua state.
std::set< Common::UString > _ignoredFiles
A list of files that the script subsystem ignores.
bool ready() const
Was the script subsystem successfully initialized?
A reference to a Lua table.
FunctionRef getGlobalFunction(const Common::UString &name) const
int getUsedMemoryAmount() const
Return the amount of memory in use by Lua (in Kbytes).
Variables callFunction(const Common::UString &name, const Variables ¶ms)
Call a Lua function.
void registerFunction(const Common::UString &name, lua_CFunction func)
Register a function.
void setLuaInstanceForObject(void *object, const TableRef &luaInstance)
void openLuaState()
Open and setup a new Lua state.