17 #ifndef AGXLUA_LUACALL_H
18 #define AGXLUA_LUACALL_H
20 #include <agx/config/AGX_USE_LUA.h>
21 #include <agx/config.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 );
104 void pushInteger (
int value ) {
106 lua_pushinteger( m_lua, value );
110 void pushValue (
int lo ) {
112 lua_pushvalue ( m_lua, lo );
117 void pushBoolean (
bool value ) {
119 lua_pushboolean ( m_lua, value );
123 void pushNumber (
double value ) {
125 lua_pushnumber ( m_lua, value );
130 void pushString (
const std::string& value ) {
132 agxLua::pushstring ( m_lua, value.c_str() );
137 bool pushUsertype (
void* value,
const char *type ) {
139 return agxLua::pushusertype( m_lua, value, type );
156 bool call(
int num_return_values );
159 const std::string& getLastError()
const;
162 std::string getStackTrace()
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()) \
std::ostream & operator<<(std::ostream &o, const agx::Vec6 &v)