Go to the documentation of this file.
4 #ifndef OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
5 #define OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
7 #include <openvdb/version.h>
26 const char*
what() const noexcept
override
28 try {
return mMessage.c_str(); }
catch (...) {}
34 explicit Exception(
const char* eType,
const std::string*
const msg =
nullptr) noexcept
37 if (eType) mMessage = eType;
38 if (msg) mMessage +=
": " + (*msg);
47 #define OPENVDB_EXCEPTION(_classname) \
48 class OPENVDB_API _classname: public Exception \
51 _classname() noexcept: Exception( #_classname ) {} \
52 explicit _classname(const std::string& msg) noexcept: Exception( #_classname , &msg) {} \
67 #undef OPENVDB_EXCEPTION
74 #define OPENVDB_THROW(exception, message) \
76 std::string _openvdb_throw_msg; \
78 std::ostringstream _openvdb_throw_os; \
79 _openvdb_throw_os << message; \
80 _openvdb_throw_msg = _openvdb_throw_os.str(); \
82 throw exception(_openvdb_throw_msg); \
85 #endif // OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
Definition: openvdb/Exceptions.h:59
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:178
#define OPENVDB_EXCEPTION(_classname)
Definition: openvdb/Exceptions.h:47
Definition: openvdb/Exceptions.h:60
Definition: openvdb/Exceptions.h:62
Exception() noexcept
Definition: openvdb/Exceptions.h:33
const char * what() const noexcept override
Definition: openvdb/Exceptions.h:26
Definition: openvdb/Exceptions.h:58
Definition: openvdb/Exceptions.h:17
Definition: openvdb/Exceptions.h:61
Definition: openvdb/Exceptions.h:56
Definition: openvdb/Exceptions.h:65
Exception(const char *eType, const std::string *const msg=nullptr) noexcept
Definition: openvdb/Exceptions.h:34
Definition: openvdb/Exceptions.h:63
Definition: openvdb/Exceptions.h:64
Definition: openvdb/Exceptions.h:13
Definition: openvdb/Exceptions.h:57