The Battle for Wesnoth  1.15.2+dev
Classes | Macros
lua_jailbreak_exception.hpp File Reference
#include "global.hpp"
Include dependency graph for lua_jailbreak_exception.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  lua_jailbreak_exception
 Base class for exceptions that want to be thrown 'through' lua. More...
 

Macros

#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
 Helper macro for classes deriving from lua_jailbreak_exception. More...
 

Macro Definition Documentation

◆ IMPLEMENT_LUA_JAILBREAK_EXCEPTION

#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION (   type)
Value:
\
virtual type* clone() const { return new type(*this); } \
\
virtual void execute() \
{ \
type exception(dynamic_cast<type&>(*jailbreak_exception)); \
throw exception; \
}

Helper macro for classes deriving from lua_jailbreak_exception.

lua_jailbreak_exception has several pure virtual functions, this macro implements them properly. This macro needs to be placed in the definition of the most derived class, which uses lua_jailbreak_exception as baseclass.

Parameters
typeThe type of the class whc

Definition at line 87 of file lua_jailbreak_exception.hpp.

Referenced by ingame_wesnothd_error::ingame_wesnothd_error(), gui2::iteration::logic_error::logic_error(), CVideo::quit::quit(), gui2::iteration::range_error::range_error(), and quit_game_exception::what().