17 #ifndef AGXLUA_LUAUTILS_H
18 #define AGXLUA_LUAUTILS_H
46 explicit LuaError( lua_State *L ) : std::runtime_error(
""), m_msg(
"")
48 if (lua_isstring(L, -1)) {
49 m_msg = lua_tostring(L, -1);
53 const char *
what()
const throw() {
return m_msg; }
55 explicit LuaError(
const char *msg ) : std::runtime_error(msg), m_msg(msg)
111 return static_cast<T *
>(
_tousertype(L, index, type));
127 lua_getglobal(L, variableName);
131 return tousertype<T>(L, -1,
type);
AGXLUA_EXPORT int tableToRealVector(lua_State *L)
Function that will take a table of numbers and convert it to a agx::RealVector The table has to follo...
AGXLUA_EXPORT void * _tousertype(lua_State *L, int index, const char *type)
This method will return a variable of a specified stack index.
AGXLUA_EXPORT void pushstring(lua_State *L, const char *value)
AGXLUA_EXPORT int requestPlugin(lua_State *L)
AGXLUA_EXPORT int doFile(lua_State *L)
T * tousertype(lua_State *L, int index, const char *type)
AGXLUA_EXPORT int doString(lua_State *L)
const char * what() const
AGXLUA_EXPORT void getpointertable(lua_State *L)
AGXLUA_EXPORT int pcall(lua_State *L, int nargs, int nresults, int errfunc)
AGXLUA_EXPORT void ensurepointer(lua_State *L, const void *p)
AGXLUA_EXPORT int tableToRealPairVector(lua_State *L)
Function that will take a table of tables and convert it to a agx::RealPairVector The table has to fo...
AGXLUA_EXPORT bool pushusertype(lua_State *L, void *p, const char *name)
AGXLUA_EXPORT void error(lua_State *L)
AGXLUA_EXPORT const char * tostring(lua_State *L, int narg, const char *def="")
LuaError(const char *msg)
AGXLUA_EXPORT std::string getStackTrace(lua_State *L)
AGXLUA_EXPORT bool testuserdata(lua_State *L, int index, const char *name)