Base class for exceptions that want to be thrown 'through' lua. More...
#include <lua_jailbreak_exception.hpp>
Public Member Functions | |
virtual | ~lua_jailbreak_exception () noexcept |
void | store () const noexcept |
Stores a copy the current exception to be rethrown. More... | |
Static Public Member Functions | |
static void | rethrow () |
Rethrows the stored exception. More... | |
Static Public Attributes | |
static int | jail_depth = 0 |
Depth of recursive luaW_pcall_internal() function calls. More... | |
Static Protected Attributes | |
static lua_jailbreak_exception * | jailbreak_exception = nullptr |
The exception to be rethrown. More... | |
Private Member Functions | |
virtual lua_jailbreak_exception * | clone () const =0 |
Creates a copy of the current exception. More... | |
virtual void | execute ()=0 |
Executes the exception. More... | |
Static Private Member Functions | |
static void | clear () noexcept |
Clears the current exception. More... | |
Base class for exceptions that want to be thrown 'through' lua.
Classes derived from this class must call this->store()
in all of their constructors and use the IMPLEMENT_LUA_JAILBREAK_EXCEPTION macro in the class definition. No other classes may derive from classes derived from this class.
Definition at line 26 of file lua_jailbreak_exception.hpp.
|
inlinevirtualnoexcept |
Definition at line 29 of file lua_jailbreak_exception.hpp.
|
staticprivatenoexcept |
Clears the current exception.
Definition at line 64 of file lua_jailbreak_exception.cpp.
References jailbreak_exception.
Referenced by rethrow().
|
privatepure virtual |
Creates a copy of the current exception.
The copy is allocated with new
and is implemented by the IMPLEMENT_LUA_JAILBREAK_EXCEPTION macro.
Referenced by store().
|
privatepure virtual |
Executes the exception.
Throws a copy of the stored jailbreak_exception. The caller is responsible for clearing jailbreak_exception after the throw. The function is implemented by the IMPLEMENT_LUA_JAILBREAK_EXCEPTION macro.
Referenced by rethrow().
|
static |
Rethrows the stored exception.
It is safe to call this function is no exception is stored.
Definition at line 38 of file lua_jailbreak_exception.cpp.
References clear(), execute(), jail_depth, and jailbreak_exception.
Referenced by intf_pcall(), and luaW_pcall_internal().
|
noexcept |
Stores a copy the current exception to be rethrown.
Definition at line 23 of file lua_jailbreak_exception.cpp.
References clone(), jail_depth, and jailbreak_exception.
Referenced by fallback_ai_to_human_exception::fallback_ai_to_human_exception(), image::modification::imod_exception::imod_exception(), ingame_wesnothd_error::ingame_wesnothd_error(), leavegame_wesnothd_error::leavegame_wesnothd_error(), savegame::load_game_exception::load_game_exception(), gui2::iteration::logic_error::logic_error(), video::quit::quit(), quit_game_exception::quit_game_exception(), gui2::iteration::range_error::range_error(), reset_gamestate_exception::reset_gamestate_exception(), return_to_play_side_exception::return_to_play_side_exception(), wesnothd_connection_error::wesnothd_connection_error(), and wml_exception::wml_exception().
|
static |
Depth of recursive luaW_pcall_internal() function calls.
Definition at line 32 of file lua_jailbreak_exception.hpp.
Referenced by luaW_pcall_internal(), rethrow(), and store().
|
staticprotected |
The exception to be rethrown.
Definition at line 47 of file lua_jailbreak_exception.hpp.