#include <src/util/Exception.h>
Public Member Functions | |
Exception (const std::string &description) | |
Simplified constructor with just a description. If you need more, use the other one. | |
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). | |
virtual const std::string & | getDescription () const |
Returns the short developer written exception. | |
virtual const std::string & | getFilename () const |
Returns the filename in which the exception occurred. | |
virtual const std::string & | getFullDescription () const |
Returns a full description with type, line, file and function. | |
virtual const std::string & | getFunctionName () const |
Returns the function in which the exception occurred. | |
virtual const unsigned int | getLineNumber () const |
Returns the line number on which the exception occurred. | |
virtual std::string | getTypeName () const =0 |
Returns the string name of the exception type. | |
const char * | what () const throw () |
Returns the error description. | |
virtual | ~Exception () throw () |
Needed for compatibility with std::exception. | |
Protected Attributes | |
std::string | description_ |
User typed text about why the exception occurred. | |
std::string | filename_ |
File where the exception occurred. | |
std::string | fullDescription_ |
Full description with line, file and function. | |
std::string | functionName_ |
Function (including namespace and class) where the exception occurred. | |
unsigned int | lineNumber_ |
Line on which the exception occurred. |
This class provides support for information about the file, the line and the function the error occured.
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).
description | Exception description as string. This message is supposed to help developers! |
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 () [inline, virtual] |
Needed for compatibility with std::exception.
virtual const std::string& orxonox::Exception::getDescription | ( | void | ) | const [inline, virtual] |
virtual const std::string& orxonox::Exception::getFilename | ( | ) | const [inline, virtual] |
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.
References description_, filename_, fullDescription_, functionName_, getTypeName(), and lineNumber_.
Referenced by orxonox::FailQuest::invoke(), orxonox::CompleteQuest::invoke(), orxonox::AddQuestHint::invoke(), and orxonox::AddQuest::invoke().
virtual const std::string& orxonox::Exception::getFunctionName | ( | ) | const [inline, virtual] |
Returns the function in which the exception occurred.
virtual const unsigned int orxonox::Exception::getLineNumber | ( | ) | const [inline, virtual] |
Returns the line number on which the exception occurred.
virtual std::string orxonox::Exception::getTypeName | ( | ) | const [pure virtual] |
const char * orxonox::Exception::what | ( | ) | const throw () |
std::string orxonox::Exception::description_ [protected] |
std::string orxonox::Exception::filename_ [protected] |
std::string orxonox::Exception::fullDescription_ [mutable, protected] |
std::string orxonox::Exception::functionName_ [protected] |
Function (including namespace and class) where the exception occurred.
Referenced by getFullDescription().
unsigned int orxonox::Exception::lineNumber_ [protected] |