Go to the documentation of this file.
4 #ifndef OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
5 #define OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
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
75 Exception(
"IllegalValueException", &msg) {}
82 #define OPENVDB_THROW(exception, message) \
84 std::string _openvdb_throw_msg; \
86 std::ostringstream _openvdb_throw_os; \
87 _openvdb_throw_os << message; \
88 _openvdb_throw_msg = _openvdb_throw_os.str(); \
90 throw exception(_openvdb_throw_msg); \
93 #endif // OPENVDB_EXCEPTIONS_HAS_BEEN_INCLUDED
Definition: Exceptions.h:59
#define OPENVDB_EXCEPTION(_classname)
Definition: Exceptions.h:47
Exception & operator=(const Exception &)=default
Exception(Exception &&)=default
Exception() noexcept
Definition: Exceptions.h:33
Definition: Exceptions.h:63
Library and file format version numbers.
~Exception() override=default
Definition: Exceptions.h:71
const char * what() const noexcept override
Definition: Exceptions.h:26
Definition: Exceptions.h:58
Definition: Exceptions.h:18
Definition: Exceptions.h:61
Definition: Exceptions.h:60
Exception(const char *eType, const std::string *const msg=nullptr) noexcept
Definition: Exceptions.h:34
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:146
Definition: Exceptions.h:57
Exception & operator=(Exception &&)=default
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:94
Definition: Exceptions.h:56
Definition: Exceptions.h:65
Definition: Exceptions.h:13
Exception(const Exception &)=default
Definition: Exceptions.h:62
Definition: Exceptions.h:64