Basic Exception. More...

#include <rexception.h>

Inheritance diagram for RException:
[legend]
Collaboration diagram for RException:
[legend]

Public Member Functions

 RException (void)
 
 RException (const RString &str)
 
 RException (const RString &func, long where, const RString &str)
 
RString GetMsg (void) const
 
virtual ~RException (void)
 

Protected Member Functions

void SetMsg (const RString &str)
 
void SetMsg (const RString &func, long where, const RString &str)
 

Protected Attributes

RString Msg
 

Private Member Functions

void Null (void)
 

Detailed Description

Basic Exception.

The RException class provides a basic representation for an exception.

Constructor & Destructor Documentation

RException ( void  )

Construct an exception.

RException ( const RString str)

Construct an exception.

Parameters
strMessage of the error.
RException ( const RString func,
long  where,
const RString str 
)

Construct an exception with the message "func [where]: str". A typical use is:

if(!ptr)
throw RException(__PRETTY_FUNCTION__,__LINE__,"ptr cannot be a null pointer");
See also
The mThrowRException macro.
Parameters
funcFunction producing the error.
whereLine position of the error.
strMessage of the error.
virtual ~RException ( void  )
virtual

Destructor.

Member Function Documentation

void Null ( void  )
private
RString GetMsg ( void  ) const

Get the content of the exception.

Returns
Pointer to a C String.
void SetMsg ( const RString str)
protected

Set the error message.

Parameters
strMessage of the error.
void SetMsg ( const RString func,
long  where,
const RString str 
)
protected

Set the error message.

Parameters
funcFunction producing the error.
whereLine position of the error.
strMessage of the error.

Field Documentation

RString Msg
protected

Message holding some information.