TracedException.h File Reference

Macros and definitions for Pro-Vocation exception handling system. More...

#include <PVLE/Export.h>
#include <PVLE/Config.h>
#include <exception>
#include <stdexcept>
#include <string>
#include <PVLE/Util/Log.h>
#include <boost/format.hpp>
#include <signal.h>

Include dependency graph for TracedException.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TracedException
 Base exception class of the generic generic Pro-Vocation Exception. More...

Defines

#define INIT_TRACED_EXCEPTIONS
#define THROW_TRACED_EXCEPTION(Reason)   throw TracedException(Reason, __PVLE_METHOD__)
 Macro to throw a generic Pro-Vocation Exception.
#define THROW_TRACED_FMT_EXCEPTION(Reason, Args)   throw TracedException( boost::format(Reason) % Args, __PVLE_METHOD__)
 Macro to throw a generic Pro-Vocation Exception with formated text (usage THROW_TRACED_FMT_EXCEPTION("this is %1% %2%", 1 % "exemple" ) ).
#define THROW_TRACED_EXCEPTION_FROM(Reason, FunctionName)   throw TracedException(Reason, FunctionName)
 Macro to throw a generic Pro-Vocation Exception from a function lacking of try-catch blocks.
#define THROW_TRACED_FMT_EXCEPTION_FROM(Reason, FunctionName, Args)   throw TracedException( boost::format(Reason) % Args, FunctionName)
 Combination of THROW_TRACED_FMT_EXCEPTION and THROW_TRACED_EXCEPTION_FROM.
#define CATCH_TRACED_EXCEPTION_FROM(FunctionName)
 Macro to install generic Pro-Vocation Exception handler, with specified function name.
#define CATCH_TRACED_EXCEPTION   CATCH_TRACED_EXCEPTION_FROM(__PVLE_METHOD__)
 Macro to install generic Pro-Vocation Exception handler.
#define TRY_BLOCK_START   try {
 Macro to use at the begining and end of guarded functions.
#define CATCH_CUSTOM_EXCEPTION(FilterName)   } catch(FilterName) {
#define TRY_BLOCK_END   } CATCH_TRACED_EXCEPTION
#define TRY_BLOCK_END_FROM(FunctionName)   } CATCH_TRACED_EXCEPTION(FunctionName)
#define DBG_TRY_BLOCK_START   ((void)0);
#define DBG_CATCH_CUSTOM_EXCEPTION(FilterName)   ((void)0);
#define DBG_TRY_BLOCK_END   ((void)0);
#define DBG_TRY_BLOCK_END_FROM(FunctionName)   ((void)0);


Detailed Description

Macros and definitions for Pro-Vocation exception handling system.

Definition in file TracedException.h.


Define Documentation

#define CATCH_CUSTOM_EXCEPTION ( FilterName   )     } catch(FilterName) {

Definition at line 273 of file TracedException.h.

#define CATCH_TRACED_EXCEPTION   CATCH_TRACED_EXCEPTION_FROM(__PVLE_METHOD__)

Macro to install generic Pro-Vocation Exception handler.

Definition at line 268 of file TracedException.h.

#define CATCH_TRACED_EXCEPTION_FROM ( FunctionName   ) 

Value:

catch( TracedException &e ) { e.UpdateFunctionStack(FunctionName); throw e; }   \
                                                                catch( std::exception &e )  { throw TracedException(e.what(), FunctionName); }  \
                                                                catch( std::string &e )     { throw TracedException(e       , FunctionName); }  \
                                                                catch( char * e )           { throw TracedException(e       , FunctionName); }  \
                                                                catch(...)                  { throw TracedException("Undefined Exception", FunctionName); }
Macro to install generic Pro-Vocation Exception handler, with specified function name.

Definition at line 261 of file TracedException.h.

#define DBG_CATCH_CUSTOM_EXCEPTION ( FilterName   )     ((void)0);

Definition at line 286 of file TracedException.h.

#define DBG_TRY_BLOCK_END   ((void)0);

#define DBG_TRY_BLOCK_END_FROM ( FunctionName   )     ((void)0);

Definition at line 288 of file TracedException.h.

#define DBG_TRY_BLOCK_START   ((void)0);

#define INIT_TRACED_EXCEPTIONS

Value:

Todo:
use sigaction instead of signal ?

Definition at line 241 of file TracedException.h.

#define THROW_TRACED_EXCEPTION ( Reason   )     throw TracedException(Reason, __PVLE_METHOD__)

#define THROW_TRACED_EXCEPTION_FROM ( Reason,
FunctionName   )     throw TracedException(Reason, FunctionName)

Macro to throw a generic Pro-Vocation Exception from a function lacking of try-catch blocks.

Definition at line 254 of file TracedException.h.

#define THROW_TRACED_FMT_EXCEPTION ( Reason,
Args   )     throw TracedException( boost::format(Reason) % Args, __PVLE_METHOD__)

Macro to throw a generic Pro-Vocation Exception with formated text (usage THROW_TRACED_FMT_EXCEPTION("this is %1% %2%", 1 % "exemple" ) ).

Definition at line 251 of file TracedException.h.

Referenced by ControlMapper::getHandlerList(), Util::DG< T >::operator()(), and readHeightMap().

#define THROW_TRACED_FMT_EXCEPTION_FROM ( Reason,
FunctionName,
Args   )     throw TracedException( boost::format(Reason) % Args, FunctionName)

Combination of THROW_TRACED_FMT_EXCEPTION and THROW_TRACED_EXCEPTION_FROM.

Definition at line 257 of file TracedException.h.

#define TRY_BLOCK_END   } CATCH_TRACED_EXCEPTION

Definition at line 274 of file TracedException.h.

#define TRY_BLOCK_END_FROM ( FunctionName   )     } CATCH_TRACED_EXCEPTION(FunctionName)

Definition at line 275 of file TracedException.h.

#define TRY_BLOCK_START   try {

Macro to use at the begining and end of guarded functions.

Definition at line 272 of file TracedException.h.


Generated on Sun Jan 17 11:39:20 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9