17 #ifndef AGXLUA_LUACALL_H
18 #define AGXLUA_LUACALL_H
89 LuaCall( lua_State *lua,
const std::string&
type,
void *this_ptr,
const std::string& method);
91 LuaCall( lua_State *lua,
const std::string& functionName );
106 lua_pushinteger( m_lua, value );
112 lua_pushvalue ( m_lua, lo );
119 lua_pushboolean ( m_lua, value );
125 lua_pushnumber ( m_lua, value );
156 bool call(
int num_return_values );
159 const std::string& getLastError()
const;
168 unsigned int m_num_args;
171 std::string m_errorMessage;
178 #define AGXLUA_LUACALL_CLASS_DECLARE( LC ) agxLua::LuaCall LC( m_lua, agxStream::ClassInformation( AGX_FUNCTION ), this );
181 #define AGXLUA_REPORT_ERROR(errorMessage) \
182 if (g_luaScriptManager->getTreatInvalidAsErrors() || agxUnit::isUnittestingEnabled()) \
184 LOGGER_ERROR() << (errorMessage) << std::endl << LOGGER_END(); \
188 LOGGER_WARNING() << (errorMessage) << std::endl << LOGGER_END(); \
189 g_luaScriptManager->setLastErrorMessage(errorMessage); \
193 #define AGXLUA_LUACALL_CLASS_CALL( N ) \
196 AGXLUA_REPORT_ERROR(lc.getLastError()) \
void pushString(const std::string &value)
Push a string as an argument.
AGXLUA_EXPORT void pushstring(lua_State *L, const char *value)
std::ostream & operator<<(std::ostream &stream, const AtomicValueT< T > &value)
bool pushUsertype(void *value, const char *type)
Push a pointer of userdata as an argument.
void pushInteger(int value)
Push an integer as an argument.
AGXLUA_EXPORT bool pushusertype(lua_State *L, void *p, const char *name)
bool isValid()
Returns true if a call to the method can safely be done ( the method exists in lua) ...
void pushValue(int lo)
Push a value as an argument.
void pushNumber(double value)
Push a number as an argument.
void pushBoolean(bool value)
Push a boolean as an argument.
AGXLUA_EXPORT std::string getStackTrace(lua_State *L)