PandaRoot
genfit::Exception Class Reference

Exception class for error handling in GENFIT (provides storage for diagnostic information) More...

#include <Exception.h>

Inheritance diagram for genfit::Exception:

Public Member Functions

 Exception (std::string excString, int line, std::string file)
 Initializing constructor. More...
 
virtual ~Exception () throw ()
 
void setFatal (bool b=true)
 Set fatal flag. More...
 
bool isFatal ()
 Get fatal flag. More...
 
void setNumbers (std::string, const std::vector< double > &)
 Set list of numbers with description. More...
 
void setMatrices (std::string, const std::vector< TMatrixD > &)
 Set list of matrices with description. More...
 
void info ()
 Print information in the exception object. More...
 
virtual const char * what () const throw ()
 Standard error message handling for exceptions. use like "std::cerr << e.what();". More...
 
std::string getExcString ()
 

Static Public Member Functions

static void quiet (bool b=true)
 "std::cerr << e.what();" will not write anything. More...
 

Detailed Description

Exception class for error handling in GENFIT (provides storage for diagnostic information)

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)

This is the class that is used for all error handling in GENFIT. It is a utility class that allows to store numbers and matrices together with an error string. The exception class can then be thrown when an error is detected and the C++ exception handling facilities can be used to catch and process the exception.

Definition at line 47 of file Exception.h.

Constructor & Destructor Documentation

◆ Exception()

genfit::Exception::Exception ( std::string  excString,
int  line,
std::string  file 
)

Initializing constructor.

Parameters
excStringerror message.
lineline at which the exception is created. Can be set through LINE macro.
filesourcefile in which the exception is created. Can be set through FILE macro.

◆ ~Exception()

virtual genfit::Exception::~Exception ( )
throw (
)
virtual

Member Function Documentation

◆ getExcString()

std::string genfit::Exception::getExcString ( )
inline

Definition at line 74 of file Exception.h.

74 { return excString_; }

◆ info()

void genfit::Exception::info ( )

Print information in the exception object.

Referenced by isFatal().

◆ isFatal()

bool genfit::Exception::isFatal ( )
inline

Get fatal flag.

Definition at line 62 of file Exception.h.

References info(), setMatrices(), setNumbers(), and what().

62 { return fatal_; }

◆ quiet()

static void genfit::Exception::quiet ( bool  b = true)
inlinestatic

"std::cerr << e.what();" will not write anything.

Definition at line 77 of file Exception.h.

77 { quiet_ = b; }

◆ setFatal()

◆ setMatrices()

void genfit::Exception::setMatrices ( std::string  ,
const std::vector< TMatrixD > &   
)

Set list of matrices with description.

Referenced by isFatal().

◆ setNumbers()

void genfit::Exception::setNumbers ( std::string  ,
const std::vector< double > &   
)

◆ what()

virtual const char* genfit::Exception::what ( ) const
throw (
)
virtual

Standard error message handling for exceptions. use like "std::cerr << e.what();".

Referenced by isFatal().


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