36 #ifndef MADNESS_WORLD_WORLDEXC_H__INCLUDED
37 #define MADNESS_WORLD_WORLDEXC_H__INCLUDED
46 #ifndef MADNESS_DISPLAY_EXCEPTION_BREAK_MESSAGE
47 #define MADNESS_DISPLAY_EXCEPTION_BREAK_MESSAGE 1
64 int l,
const char *fn,
const char *
f)
72 virtual const char*
what()
const throw() {
81 std::ostream&
operator <<(std::ostream& out,
const MadnessException& e);
88 #define MADNESS_EXCEPTION(msg,value) { \
89 madness::exception_break(MADNESS_DISPLAY_EXCEPTION_BREAK_MESSAGE); \
90 throw madness::MadnessException(msg,0,value,__LINE__,__FUNCTION__,__FILE__); \
101 #ifdef MADNESS_ASSERTIONS_ABORT
102 # define MADNESS_ASSERT(condition) \
103 do {if (!(condition)) ((void (*)())0)();} while(0)
106 #ifdef MADNESS_ASSERTIONS_DISABLE
107 # define MADNESS_ASSERT(condition)
110 #ifdef MADNESS_ASSERTIONS_ASSERT
112 # define MADNESS_ASSERT(condition) assert(condition)
115 #ifdef MADNESS_ASSERTIONS_THROW
116 # define MADNESS_STRINGIZE(X) #X
117 # define MADNESS_EXCEPTION_AT(F, L) MADNESS_STRINGIZE(F) "(" MADNESS_STRINGIZE(L) ")"
118 # define MADNESS_ASSERT(condition) \
120 if (!(condition)) { \
121 madness::exception_break(MADNESS_DISPLAY_EXCEPTION_BREAK_MESSAGE); \
122 throw madness::MadnessException("MADNESS ASSERTION FAILED: " MADNESS_EXCEPTION_AT( __FILE__, __LINE__ ), \
123 #condition,0,__LINE__,__FUNCTION__,__FILE__); \
130 #endif // MADNESS_WORLD_WORLDEXC_H__INCLUDED
const char * assertion
Definition: worldexc.h:56
void exception_break(bool message)
This function is executed just before a madness exception is thrown.
Definition: world.cc:243
const int value
Definition: worldexc.h:57
MadnessException(const char *m, const char *a, int v, int l, const char *fn, const char *f)
Definition: worldexc.h:63
NDIM & f
Definition: mra.h:2179
const char * filename
Definition: worldexc.h:60
FLOAT a(int j, FLOAT z)
Definition: y1.cc:86
const double m
Definition: gfit.cc:199
std::ostream & operator<<(std::ostream &s, const ContractedGaussianShell &c)
Definition: chem/molecularbasis.cc:38
virtual const char * what() const
Definition: worldexc.h:72
const char * msg
Definition: worldexc.h:55
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
const int line
Definition: worldexc.h:58
Most exceptions thrown in MADNESS should be derived from these.
Definition: worldexc.h:53
Function< complexd, 3 > function
Definition: envelopedpulse.h:45