ircproxy  The Ultimate Cyborg

edragon Namespace Reference


Detailed Description

Namespace with utilities copied from the edragon project.


Functions

template<class E>
void throw_exception (E const &exception, std::string const &debug_msg)
 Throw an exception.
template<class E>
void caught (E const &exception)
 Debugging function.


Function Documentation

template<class E>
void edragon::throw_exception ( E const &  exception,
std::string const &  debug_msg 
) [inline]

Throw an exception.

For internal use only.

Parameters:
exception The exception to be thrown.
debug_msg A simple string for debugging purposes, to clarify the reason why the exception is thrown.
Debug output has the form:

EXCEPTIONS: <debug_msg>, throwing exception "<exception.what()>".

Don't use this function directly, instead use the macro THROW_EXCEPTION.

Definition at line 89 of file exceptions.h.

References debug::channels::dc::exceptions.

00090   {
00091 #if CWDEBUG_LOCATION
00092     libcwd::location_ct loc((char*)__builtin_return_address(0) + libcwd::builtin_return_address_offset);
00093 #else
00094     void* loc = (char*)__builtin_return_address(0) + libcwd::builtin_return_address_offset;
00095 #endif
00096     Dout(dc::exceptions, loc << ": " << debug_msg << ", throwing exception \"" << exception.what() << "\".");
00097     throw exception; 
00098   }

template<class E>
void edragon::caught ( E const &  exception  )  [inline]

Debugging function.

Print location that this function was called from and what exception was caught there.

Definition at line 127 of file exceptions.h.

References debug::channels::dc::exceptions.

Referenced by Identity::new_client_message_received(), Identity::new_server_message_received(), Channel::new_server_message_received(), and ClientSession::process_message().

00128   {
00129 #if CWDEBUG_LOCATION
00130     libcwd::location_ct loc((char*)__builtin_return_address(0) + libcwd::builtin_return_address_offset);
00131 #else
00132     void* loc = (char*)__builtin_return_address(0) + libcwd::builtin_return_address_offset;
00133 #endif
00134     Dout(dc::exceptions, loc << ": caught exception \"" << exception.what() << "\".");
00135   }


Copyright © 2005-2007 Carlo Wood.  All rights reserved.