TBCI Numerical high perf. C++ Library  2.8.0
Public Member Functions | Public Attributes | List of all members
NumErr Class Reference

exception base class for the TBCI NumLib More...

#include <except.h>

Inheritance diagram for NumErr:
Inheritance graph
[legend]
Collaboration diagram for NumErr:
Collaboration graph
[legend]

Public Member Functions

 NumErr ()
 
 NumErr (const char *txt, const long idx=0)
 
 NumErr (const std::string &str, const long idx=0)
 
 NumErr (const NumErr &ne)
 
virtual const char * what () const throw ()
 
virtual ~NumErr () throw ()
 

Public Attributes

const char * errtext
 Short error description in _what. More...
 
long index
 Index for out of bounds error. More...
 

Detailed Description

exception base class for the TBCI NumLib

All exceptions that are generated by the TBCI library are derived from this class.

Currently, the structure uses an exception type depending on the storage object dealt with – so there is TBCI::VecErr, TBCI::MatErr etc.

In a later version, this will be changed to a scheme, where the exception class is based on the type of exception, such as RangeError, BadAlloc, Arithmetic (e.g. div by zero), Convergence, ...

Checking for error conditions such as bound checking ... are only done if ERRCHECK is defined at compile time. Otherwise, the checks are left out for performance reasons. All these checks are implemented using the BCHK macros.

The behaviour in case of error conditions with ERRCHECK defined defaults to reporting the error to stderr / cerr, but continuing the program execution. This allows to find more than one error at a time.

If you define ABORT_ON_ERROR (additionally to ERRCHECK), the error checks will call abort() after printing out the error message. This is useful, when you want to backtrace errors with a debugger.

If you define EXCEPT (additionally to ERRCHECK), an exception is thrown on error conditions, so you might catch and handle such conditions. If you don't, the results will be similar to calling abort() ...

Definition at line 58 of file except.h.

Constructor & Destructor Documentation

NumErr::NumErr ( )
inline

Definition at line 65 of file except.h.

NumErr::NumErr ( const char *  txt,
const long  idx = 0 
)
inline

Definition at line 70 of file except.h.

NumErr::NumErr ( const std::string &  str,
const long  idx = 0 
)
inline

Definition at line 75 of file except.h.

NumErr::NumErr ( const NumErr ne)
inline

Definition at line 80 of file except.h.

virtual NumErr::~NumErr ( )
throw (
)
inlinevirtual

Definition at line 87 of file except.h.

References CSTD__, and errtext.

Member Function Documentation

virtual const char* NumErr::what ( ) const
throw (
)
inlinevirtual

Definition at line 85 of file except.h.

References errtext.

Member Data Documentation

const char* NumErr::errtext

Short error description in _what.

Definition at line 62 of file except.h.

Referenced by what(), and ~NumErr().

long NumErr::index

Index for out of bounds error.

Definition at line 64 of file except.h.


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