Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Member Functions | Static Private Member Functions

tlua_jailbreak_exception Class Reference

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

#include <lua_jailbreak_exception.hpp>

Inheritance diagram for tlua_jailbreak_exception:
Inheritance graph
[legend]
Collaboration diagram for tlua_jailbreak_exception:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~tlua_jailbreak_exception () throw ()
void store () const throw ()
 Stores a copy the current exception to be rethrown.

Static Public Member Functions

static void rethrow ()
 Rethrows the stored exception.

Static Protected Attributes

static tlua_jailbreak_exceptionjailbreak_exception = NULL
 The exception to be rethrown.

Private Member Functions

virtual tlua_jailbreak_exceptionclone () const =0
 Creates a copy of the current exception.
virtual void execute ()=0
 Executes the exception.

Static Private Member Functions

static void clear () throw ()
 Clears the current exception.

Detailed Description

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

Classes inheriting from this class need to use the IMPLEMENT_LUA_JAILBREAK_EXCEPTION macro in the class definition.

Definition at line 27 of file lua_jailbreak_exception.hpp.


Constructor & Destructor Documentation

virtual tlua_jailbreak_exception::~tlua_jailbreak_exception (  )  throw () [inline, virtual]

Definition at line 30 of file lua_jailbreak_exception.hpp.


Member Function Documentation

void tlua_jailbreak_exception::clear (  )  throw () [static, private]

Clears the current exception.

Definition at line 59 of file lua_jailbreak_exception.cpp.

References jailbreak_exception.

Referenced by rethrow().

Here is the caller graph for this function:

virtual tlua_jailbreak_exception* tlua_jailbreak_exception::clone (  )  const [private, pure virtual]

Creates a copy of the current exception.

The copy is allocated with new and is implemented by the IMPLEMENT_LUA_JAILBREAK_EXCEPTION macro.

Note:
it's implemented by the subclass to avoid slicing.
Returns:
A pointer to a copy of the class on the heap.

Referenced by store().

Here is the caller graph for this function:

virtual void tlua_jailbreak_exception::execute (  )  [private, pure 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.

Note:
it's implemented by the subclass to avoid slicing.
Precondition:
jailbreak_exception != NULL

Referenced by rethrow().

Here is the caller graph for this function:

void tlua_jailbreak_exception::rethrow (  )  [static]

Rethrows the stored exception.

It is safe to call this function is no exception is stored.

Definition at line 35 of file lua_jailbreak_exception.cpp.

References clear(), execute(), and jailbreak_exception.

Referenced by luaW_pcall().

Here is the call graph for this function:

Here is the caller graph for this function:

void tlua_jailbreak_exception::store (  )  const throw ()

Stores a copy the current exception to be rethrown.

Definition at line 23 of file lua_jailbreak_exception.cpp.

References clone(), and jailbreak_exception.

Here is the call graph for this function:


Member Data Documentation

The exception to be rethrown.

Definition at line 45 of file lua_jailbreak_exception.hpp.

Referenced by clear(), rethrow(), and store().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:16:48 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs