dune-common  2.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
Dune::Exception Class Reference

Base class for Dune-Exceptions. More...

#include <dune/common/exceptions.hh>

Inheritance diagram for Dune::Exception:
Dune::HelpRequest Dune::InvalidStateException Dune::IOError Dune::MathError Dune::NotImplemented Dune::ParallelError Dune::RangeError Dune::SystemError

Public Member Functions

 Exception ()
 
void message (const std::string &msg)
 store string in internal message buffer More...
 
virtual const char * what () const noexcept
 output internal message buffer More...
 

Static Public Member Functions

static void registerHook (ExceptionHook *hook)
 add a functor which is called before a Dune::Exception is emitted (see Dune::ExceptionHook) More...
 
static void clearHook ()
 remove all hooks More...
 

Detailed Description

Base class for Dune-Exceptions.

all Dune exceptions are derived from this class via trivial subclassing:

class MyException : public Dune::Exception {};

You should not throw a Dune::Exception directly but use the macro DUNE_THROW() instead which fills the message-buffer of the exception in a standard way and features a way to pass the result in the operator<<-style

See Also
DUNE_THROW, IOError, MathError

The documentation for this class was generated from the following files: