Exception.h File Reference

Declaration of facilities to handle exceptions. More...

#include "UtilPrereqs.h"
#include <exception>
#include <sstream>
#include <string>
#include "Debug.h"

Namespaces

namespace  orxonox

Classes

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

Defines

#define CREATE_ORXONOX_EXCEPTION(ExceptionName)
 Creates a new type of exception that inherits from tracker::Exception.
#define ThrowException(type, description)   throw orxonox::exceptionThrowerHelper(type##Exception(static_cast<std::ostringstream&>(std::ostringstream().flush() << description).str(), __LINE__, __FILE__, __FUNCTIONNAME__))
 Throws an exception and logs a message beforehand.

Functions

template<class T>
const T & orxonox::exceptionThrowerHelper (const T &exception)
 Helper function that forwards an exception and displays the message.


Detailed Description

Declaration of facilities to handle exceptions.


Define Documentation

#define CREATE_ORXONOX_EXCEPTION ( ExceptionName   ) 

Value:

class ExceptionName##Exception : public Exception                               \
    {                                                                               \
    public:                                                                         \
        ExceptionName##Exception(const std::string& description,                    \
                unsigned int lineNumber, const char* filename,                      \
                const char* functionName)                                           \
            : Exception(description, lineNumber, filename, functionName)            \
        { }                                                                         \
                                                                                    \
        ExceptionName##Exception(const std::string& description)                    \
            : Exception(description)                                                \
        { }                                                                         \
                                                                                    \
        ~ExceptionName##Exception() throw() { }                                     \
                                                                                    \
        std::string getTypeName() const { return #ExceptionName; }                  \
    }
Creates a new type of exception that inherits from tracker::Exception.

#define ThrowException ( type,
description   )     throw orxonox::exceptionThrowerHelper(type##Exception(static_cast<std::ostringstream&>(std::ostringstream().flush() << description).str(), __LINE__, __FILE__, __FUNCTIONNAME__))


Generated on Tue Jul 28 16:21:11 2009 for Orxonox by  doxygen 1.5.6