Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
orxonox::Exception Class Referenceabstract

Base class for all exceptions (derived from std::exception). More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/Exception.h>

Inheritance diagram for orxonox::Exception:

Public Member Functions

 Exception (const std::string &description, unsigned int lineNumber, const char *filename, const char *functionName)
 Creates the exception but doesn't yet compose the full descrption (because of the virtual functions) More...
 
 Exception (const std::string &description)
 Simplified constructor with just a description. If you need more, use the other one. More...
 
virtual ~Exception () throw ()
 Needed for compatibility with std::exception. More...
 
virtual const std::string & getDescription () const
 Returns the short developer written exception. More...
 
virtual const std::string & getFilename () const
 Returns the filename in which the exception occurred. More...
 
virtual const std::string & getFullDescription () const
 Returns a full description with type, line, file and function. More...
 
virtual const std::string & getFunctionName () const
 Returns the function in which the exception occurred. More...
 
virtual unsigned int getLineNumber () const
 Returns the line number on which the exception occurred. More...
 
virtual std::string getTypeName () const =0
 Returns the string name of the exception type. More...
 
const char * what () const throw ()
 Returns the error description. More...
 

Static Public Member Functions

static std::string handleMessage ()
 Retrieves information from an exception caught with "..." Works for std::exception and CEGUI::Exception. More...
 

Protected Attributes

std::string description_
 User typed text about why the exception occurred. More...
 
std::string filename_
 File where the exception occurred. More...
 
std::string fullDescription_
 Full description with line, file and function. More...
 
std::string functionName_
 Function (including namespace and class) where the exception occurred. More...
 
unsigned int lineNumber_
 Line on which the exception occurred. More...
 

Detailed Description

Base class for all exceptions (derived from std::exception).

This class provides support for information about the file, the line and the function the error occurred.

See also
Exception.h

Constructor & Destructor Documentation

orxonox::Exception::Exception ( const std::string &  description,
unsigned int  lineNumber,
const char *  filename,
const char *  functionName 
)

Creates the exception but doesn't yet compose the full descrption (because of the virtual functions)

Parameters
descriptionException description as string. This message is supposed to help developers!
lineNumberThe number of the code-line in which the exception occurred
filenameThe file in which the exception occurred
functionNameThe function in which the exception occurred
orxonox::Exception::Exception ( const std::string &  description)

Simplified constructor with just a description. If you need more, use the other one.

virtual orxonox::Exception::~Exception ( )
throw (
)
inlinevirtual

Needed for compatibility with std::exception.

Member Function Documentation

virtual const std::string& orxonox::Exception::getDescription ( ) const
inlinevirtual

Returns the short developer written exception.

virtual const std::string& orxonox::Exception::getFilename ( ) const
inlinevirtual

Returns the filename in which the exception occurred.

const std::string & orxonox::Exception::getFullDescription ( ) const
virtual

Returns a full description with type, line, file and function.

Remarks
The composed full description gets stored to fullDescription_. But for compliance with std::exception, this method has to be const. Hence fullDescription_ is declared as mutable.
virtual const std::string& orxonox::Exception::getFunctionName ( ) const
inlinevirtual

Returns the function in which the exception occurred.

virtual unsigned int orxonox::Exception::getLineNumber ( ) const
inlinevirtual

Returns the line number on which the exception occurred.

virtual std::string orxonox::Exception::getTypeName ( ) const
pure virtual

Returns the string name of the exception type.

std::string orxonox::Exception::handleMessage ( )
static

Retrieves information from an exception caught with "..." Works for std::exception and CEGUI::Exception.

Remarks
Never ever call this function without an exception in the stack!
const char * orxonox::Exception::what ( ) const
throw (
)

Returns the error description.

Member Data Documentation

std::string orxonox::Exception::description_
protected

User typed text about why the exception occurred.

std::string orxonox::Exception::filename_
protected

File where the exception occurred.

std::string orxonox::Exception::fullDescription_
mutableprotected

Full description with line, file and function.

std::string orxonox::Exception::functionName_
protected

Function (including namespace and class) where the exception occurred.

unsigned int orxonox::Exception::lineNumber_
protected

Line on which the exception occurred.


The documentation for this class was generated from the following files: