exceptions.hpp File Reference

Declarations of exception classes used by the BTK. More...

#include <string>
#include <sstream>
#include <stdexcept>

Go to the source code of this file.

Namespaces

namespace  BTK
namespace  BTK::EXCEPTIONS

Classes

struct  BTKException

Defines

#define BASE_BTK_EXCEPTION_TYPE(exception_name, base)
#define NEW_BTK_EXCEPTION_TYPE(exception_name, base_btk_exception)
#define BTK_THROW(btk_exception)   throw BTK::EXCEPTIONS::btk_exception(#btk_exception,__FILE__,__LINE__)
#define BTK_THROW_MSG(btk_exception, msg)   throw BTK::EXCEPTIONS::btk_exception(msg,__FILE__,__LINE__)

Functions

 BASE_BTK_EXCEPTION_TYPE (BTKLogicError, std::logic_error)
 BASE_BTK_EXCEPTION_TYPE (BTKDomainError, std::domain_error)
 BASE_BTK_EXCEPTION_TYPE (BTKInvalidArgument, std::invalid_argument)
 BASE_BTK_EXCEPTION_TYPE (BTKLengthError, std::length_error)
 BASE_BTK_EXCEPTION_TYPE (BTKOutOfRange, std::out_of_range)
 BASE_BTK_EXCEPTION_TYPE (BTKRuntimeError, std::runtime_error)
 BASE_BTK_EXCEPTION_TYPE (BTKRangeError, std::range_error)
 BASE_BTK_EXCEPTION_TYPE (BTKUnderflowError, std::underflow_error)
 BASE_BTK_EXCEPTION_TYPE (BTKOverflowError, std::overflow_error)


Detailed Description

Declarations of exception classes used by the BTK.


Define Documentation

#define BASE_BTK_EXCEPTION_TYPE ( exception_name,
base   ) 

Value:

struct exception_name : public base, public BTKException                \
  {                                                                     \
    exception_name(std::string const & msg = #exception_name,           \
                   std::string const & file = "",                       \
                   unsigned line = 0,                                   \
                   std::string const & func = "") :                     \
      base(msg), BTKException(msg,file,line,func) {}                    \
                                                                        \
    virtual char const * what() const throw()                           \
    { return BTKException::what(); }                                    \
                                                                        \
    virtual ~exception_name() throw() {}                                \
  };

#define BTK_THROW ( btk_exception   )     throw BTK::EXCEPTIONS::btk_exception(#btk_exception,__FILE__,__LINE__)

#define BTK_THROW_MSG ( btk_exception,
msg   )     throw BTK::EXCEPTIONS::btk_exception(msg,__FILE__,__LINE__)

#define NEW_BTK_EXCEPTION_TYPE ( exception_name,
base_btk_exception   ) 

Value:

struct exception_name : public base_btk_exception                     \
  {                                                                     \
    explicit exception_name(char const *msg = #exception_name,          \
                            char const *file = "",                      \
                            unsigned line = 0,                          \
                            char const *func = "") :                    \
      base_btk_exception(msg,file,line,func) {}                         \
                                                                        \
    virtual ~exception_name() throw() {}                                \
  }


Generated on Sun Jul 15 20:46:28 2007 for BTK Core by  doxygen 1.5.1