Exception Class Reference

A class that provides an exception abstraction. More...

#include <rimPhysicsException.h>

List of all members.

Public Member Functions

 Exception ()
 Create a default exception with no message to the catcher.
 Exception (const char *newMessage)
 Create an exception with a character array message.
 Exception (const String &newMessage)
 Create a new exception with a message from a string.
 Exception (const Exception &exception)
 Create a copy of an exception (copy constructor).
Exceptionoperator= (const Exception &exception)
 ~Exception ()
 Destroy an exception, deallocating it's message.
const StringgetMessage () const
 get the message for the exception.
virtual const StringgetType () const
 Get a string representing the type of this exception.

Static Public Member Functions

static const StringgetTypeStatic ()
 Get a string representing the type of this exception (static version).

Private Attributes

Stringmessage
 The message for the exception.

Static Private Attributes

static const Stringtype = new String("Exception")
 A string representing the type of this exception.


Detailed Description

A class that provides an exception abstraction.

It is meant to be thrown from the location of an error and then to be caught by error correcting code somewhere in the calling stack. Each exception provides a means to encapsulate a message in the exception, so as to give the exception catcher a better idea of why the error occurred.


Constructor & Destructor Documentation

Exception::Exception (  ) 

Create a default exception with no message to the catcher.

The message lets the thrower of the exception tell the catcher the reason for the throw of the exception.

Exception::Exception ( const char *  newMessage  ) 

Create an exception with a character array message.

The message lets the thrower of the exception tell the catcher the reason for the throw of the exception.

Exception::Exception ( const String newMessage  ) 

Create a new exception with a message from a string.

The message lets the thrower of the exception tell the catcher the reason for the throw of the exception.

Exception::Exception ( const Exception exception  ) 

Create a copy of an exception (copy constructor).

This copy contructor duplicates the message of the parameter exception by doing a deep copy.

Exception::~Exception (  ) 

Destroy an exception, deallocating it's message.


Member Function Documentation

Exception & Exception::operator= ( const Exception exception  ) 

const String& Exception::getMessage (  )  const [inline]

get the message for the exception.

The message is determined when the exception is constructed, and lets the thrower of the exception tell the catcher the reason for the throw of the exception.

Returns:
the message from the exception's thrower

virtual const String& Exception::getType (  )  const [inline, virtual]

Get a string representing the type of this exception.

static const String& Exception::getTypeStatic (  )  [inline, static]

Get a string representing the type of this exception (static version).


Member Data Documentation

String* Exception::message [private]

The message for the exception.

RIM_PHYSICS_NAMESPACE_START const String * Exception::type = new String("Exception") [static, private]

A string representing the type of this exception.


The documentation for this class was generated from the following files:
Generated on Tue Aug 26 00:03:20 2008 for Rim Physics by  doxygen 1.5.4