libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
crn::Exception Class Reference

Base class for exceptions. More...

#include <CRNException.h>

+ Inheritance diagram for crn::Exception:
+ Collaboration diagram for crn::Exception:

Public Member Functions

 Exception () noexcept
 Default constructor. More...
 
 Exception (const StringUTF8 &msg) noexcept
 Constructor with a message. More...
 
 Exception (const char *msg) noexcept
 Constructor with a message. More...
 
 Exception (const Exception &ex) noexcept
 Copy constructor. More...
 
virtual ~Exception () noexceptoverride
 Destructor. More...
 
const std::string & GetContext () const noexcept
 String containing the call stack at the moment of throw. More...
 
const std::string & GetMessage () const noexcept
 String containing a description of the exception. More...
 
virtual const char * what () const noexceptoverride
 String containing a description of the exception. More...
 

Static Public Member Functions

static void SetDefaultHandler ()
 Sets the default exception handler to print message and context to the standard error. More...
 
static bool & TraceStack ()
 Shall the stack be traced at each exception thrown? (very slow) More...
 

Detailed Description

Base class for exceptions.

Definition at line 39 of file CRNException.h.

Constructor & Destructor Documentation

Exception::Exception ( )
explicitnoexcept

Default constructor.

Default constructor

Definition at line 114 of file CRNException.cpp.

Exception::Exception ( const StringUTF8 msg)
explicitnoexcept

Constructor with a message.

Constructor with a message

Parameters
[in]msgthe message describing the exception

Definition at line 122 of file CRNException.cpp.

Exception::Exception ( const char *  msg)
explicitnoexcept

Constructor with a message.

Constructor with a message

Parameters
[in]msgthe message describing the exception

Definition at line 131 of file CRNException.cpp.

Exception::Exception ( const Exception ex)
explicitnoexcept

Copy constructor.

Constructor with a message

Parameters
[in]exthe message describing the exception

Definition at line 140 of file CRNException.cpp.

Exception::~Exception ( )
overridevirtualnoexcept

Destructor.

Destructor

Definition at line 148 of file CRNException.cpp.

Member Function Documentation

const std::string & Exception::GetContext ( ) const
noexcept

String containing the call stack at the moment of throw.

String containing the call stack at the moment of throw

Definition at line 153 of file CRNException.cpp.

const std::string & Exception::GetMessage ( ) const
noexcept

String containing a description of the exception.

String containing a description of the exception

Definition at line 159 of file CRNException.cpp.

void Exception::SetDefaultHandler ( )
static

Sets the default exception handler to print message and context to the standard error.

Sets the default exception handler to print message and context to the standard error

Definition at line 219 of file CRNException.cpp.

bool & Exception::TraceStack ( )
static

Shall the stack be traced at each exception thrown? (very slow)

Shall the stack be traced at each exception thrown (default: false).

Warning
SLOW!
Returns
a reference (ie editable variable) to the flag

Definition at line 107 of file CRNException.cpp.

const char * Exception::what ( ) const
overridevirtualnoexcept

String containing a description of the exception.

String containing a description of the exception

Definition at line 165 of file CRNException.cpp.


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