The Battle for Wesnoth  1.19.5+dev
Classes | Macros
lua_jailbreak_exception.hpp File Reference
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 final { return new type(*this); } \
\
virtual void execute() final \
{ \
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 91 of file lua_jailbreak_exception.hpp.