|
dune-common
2.11
|
|
Files | |
| file | exceptions.hh |
| A few common exception classes. | |
Classes | |
| class | Dune::Exception |
| Base class for Dune-Exceptions. More... | |
| struct | Dune::ExceptionHook |
| Base class to add a hook to the Dune::Exception. More... | |
| class | Dune::ExceptionStream< E > |
| Class for extending a Dune::Exception with a stream interface. More... | |
| class | Dune::IOError |
| Default exception class for I/O errors. More... | |
| class | Dune::MathError |
| Default exception class for mathematical errors. More... | |
| class | Dune::RangeError |
| Default exception class for range errors. More... | |
| class | Dune::NotImplemented |
| Default exception for dummy implementations. More... | |
| class | Dune::SystemError |
| Default exception class for OS errors. More... | |
| class | Dune::OutOfMemoryError |
| Default exception if memory allocation fails. More... | |
| class | Dune::InvalidStateException |
| Default exception if a function was called while the object is not in a valid state for that function. More... | |
| class | Dune::ParallelError |
| Default exception if an error in the parallel communication of the program occurred. More... | |
Macros | |
| #define | DUNE_THROW(E, ...) throw Dune::ExceptionStream(E()) << THROWSPEC(E) __VA_OPT__(<<) __VA_ARGS__ |
Functions | |
| Dune::Exception::Exception () | |
| void | Dune::Exception::message (const std::string &msg) |
| store string in internal message buffer More... | |
| const char * | Dune::Exception::what () const noexcept override |
| output internal message buffer More... | |
| static void | Dune::Exception::registerHook (ExceptionHook *hook) |
| add a functor which is called before a Dune::Exception is emitted (see Dune::ExceptionHook) More... | |
| static void | Dune::Exception::clearHook () |
| remove all hooks More... | |
| virtual | Dune::ExceptionHook::~ExceptionHook () |
| virtual void | Dune::ExceptionHook::operator() ()=0 |
| std::ostream & | Dune::operator<< (std::ostream &stream, const Exception &e) |
| Dune::ExceptionStream< E >::ExceptionStream (const E &other) | |
| Dune::ExceptionStream< E >::ExceptionStream (E &&other) | |
| template<class T > | |
| Dune::ExceptionStream< E >::requires (requires(std::ostringstream &oss, T t) { oss<< t;} and not std::is_integral_v< T >) friend ExceptionStream &operator<<(ExceptionStream &es | |
| Stream operator for l-value ExceptionStream and lvalue-reference. More... | |
| es | Dune::ExceptionStream< E >::message (es.sstream_.str()) |
| template<class T > | |
| Dune::ExceptionStream< E >::requires (requires(std::ostringstream &oss, T t) { oss<< t;} and not std::is_integral_v< T >) friend ExceptionStream operator<<(ExceptionStream &&es | |
| Stream operator for r-value ExceptionStream and lvalue-reference. More... | |
| return | Dune::ExceptionStream< E >::std::move (es) |
Variables | |
| const T & | Dune::ExceptionStream< E >::t |
| return | Dune::ExceptionStream< E >::es |
Friends | |
| template<class T > | |
| requires std::is_integral_v< T > friend ExceptionStream & | Dune::ExceptionStream< E >::operator<< (ExceptionStream &es, T t) |
| Stream operator for l-value ExceptionStream and integral values. More... | |
| template<class T > | |
| requires std::is_integral_v< T > friend ExceptionStream | Dune::ExceptionStream< E >::operator<< (ExceptionStream &&es, T t) |
| Stream operator for r-value ExceptionStream and integral values. More... | |
| ExceptionStream & | Dune::ExceptionStream< E >::operator<< (ExceptionStream &es, std::ostream &(*t)(std::ostream &)) |
| Stream operator for l-value ExceptionStream and io manipulator. More... | |
| ExceptionStream | Dune::ExceptionStream< E >::operator<< (ExceptionStream &&es, std::ostream &(*t)(std::ostream &)) |
| Stream operator for r-value ExceptionStream and io manipulator. More... | |
The Dune-exceptions are designed to allow a simple derivation of subclasses and to accept a text written in the '<<' syntax.
Example of usage:
| #define DUNE_THROW | ( | E, | |
| ... | |||
| ) | throw Dune::ExceptionStream(E()) << THROWSPEC(E) __VA_OPT__(<<) __VA_ARGS__ |
Macro to throw an exception
| E | exception class derived from Dune::Exception |
| m | reason for this exception in ostream-notation |
Example:
DUNE_THROW automatically adds information about the exception thrown to the text.
|
static |
remove all hooks
| Dune::Exception::Exception | ( | ) |
|
inline |
|
inline |
| void Dune::Exception::message | ( | const std::string & | msg | ) |
store string in internal message buffer
| es Dune::ExceptionStream< E >::message | ( | es.sstream_. | str() | ) |
|
pure virtual |
|
inline |
|
static |
add a functor which is called before a Dune::Exception is emitted (see Dune::ExceptionHook)
| Dune::ExceptionStream< E >::requires | ( | requires(std::ostringstream &oss, T t) { oss<< t;} and not std::is_integral_v< T > | ) | & |
Stream operator for l-value ExceptionStream and lvalue-reference.
| Dune::ExceptionStream< E >::requires | ( | requires(std::ostringstream &oss, T t) { oss<< t;} and not std::is_integral_v< T > | ) | && |
Stream operator for r-value ExceptionStream and lvalue-reference.
| return Dune::ExceptionStream< E >::std::move | ( | es | ) |
|
overridenoexcept |
output internal message buffer
|
inlinevirtual |
| return Dune::ExceptionStream< E >::es |
| const T & Dune::ExceptionStream< E >::t |
|
friend |
Stream operator for l-value ExceptionStream and integral values.
This is needed to support passing a static const members. The other overload leads to ODR use which requires that there is a namespace scope definition of the variable (which does often not exist).
|
friend |
Stream operator for r-value ExceptionStream and integral values.
|
friend |
Stream operator for l-value ExceptionStream and io manipulator.
|
friend |
Stream operator for r-value ExceptionStream and io manipulator.
1.8.14