31 #ifndef OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
32 #define OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
46 virtual const char*
what()
const throw()
48 try {
return mMessage.c_str(); }
catch (...) {};
56 explicit Exception(
const char* eType,
const std::string*
const msg = NULL) throw()
59 if (eType) mMessage = eType;
60 if (msg) mMessage +=
": " + (*msg);
69 #define OPENVDB_EXCEPTION(_classname) \
70 class OPENVDB_API _classname: public Exception \
73 _classname() throw() : Exception( #_classname ) {} \
74 explicit _classname(const std::string &msg) throw() : Exception( #_classname , &msg) {} \
91 #undef OPENVDB_EXCEPTION
97 #define OPENVDB_THROW(exception, message) \
99 std::string _openvdb_throw_msg; \
101 std::ostringstream _openvdb_throw_os; \
102 _openvdb_throw_os << message; \
103 _openvdb_throw_msg = _openvdb_throw_os.str(); \
105 throw exception(_openvdb_throw_msg); \
108 #endif // OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
virtual const char * what() const
Definition: Exceptions.h:46
Exception(const char *eType, const std::string *const msg=NULL)
Definition: Exceptions.h:56
Definition: Exceptions.h:88
Definition: Exceptions.h:83
Definition: Exceptions.h:85
Definition: Exceptions.h:80
Definition: Exceptions.h:43
#define OPENVDB_VERSION_NAME
Definition: version.h:43
virtual ~Exception()
Definition: Exceptions.h:52
Definition: Exceptions.h:86
Definition: Exceptions.h:39
Exception()
Definition: Exceptions.h:55
Definition: Exceptions.h:81
Definition: Exceptions.h:84
Definition: Exceptions.h:78
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
Definition: Exceptions.h:79
Definition: Exceptions.h:87
Definition: Exceptions.h:82
#define OPENVDB_EXCEPTION(_classname)
Definition: Exceptions.h:69