6 #include <gsl/gsl_errno.h> 34 std::string buf(
"blah");
72 virtual void print(std::ostream& Os)
const 74 Os <<
"Full Physics Exception:\n" 75 <<
"=========================\n" 77 <<
"=========================\n" 79 <<
"=========================\n" 81 <<
"=========================\n";
88 virtual const char*
what()
const throw()
103 return scratch_.c_str();
106 std::ostringstream s_;
107 mutable std::string scratch_;
128 e <<
"Out of range error in file " << File <<
" at line " << Line <<
"\n" 129 <<
"Value: " << Val <<
"\n" 130 <<
"Minimum allowed: " << Min <<
"\n" 131 <<
"Maximum allowed: " << Max;
140 #define range_check(V, Min, Max) \ 141 FullPhysics::range_check_template(V, Min, Max, __FILE__, __LINE__) 156 e <<
"Out of range error in file " << File <<
" at line " << Line <<
"\n" 157 <<
"Value: " << Val <<
"\n" 158 <<
"Minimum allowed: " << Min <<
"\n";
167 #define range_min_check(V, Min) \ 168 FullPhysics::range_min_check_template(V, Min, __FILE__, __LINE__) 183 e <<
"Out of range error in file " << File <<
" at line " << Line <<
"\n" 184 <<
"Value: " << Val <<
"\n" 185 <<
"Maximum allowed: " << Max <<
"\n";
194 #define range_max_check(V, Max) \ 195 FullPhysics::range_max_check_template(V, Max, __FILE__, __LINE__) 203 gsl_set_error_handler_off();
218 e <<
"GSL error in file " << File <<
" at line " << Line <<
"\n" 219 <<
"GSL error: " << gsl_strerror(status) <<
"\n";
228 #define gsl_check(status) \ 229 FullPhysics::gsl_check_func(status, __FILE__, __LINE__) virtual const char * what() const
Description of what the error is.
void no_gsl_abort()
Turn off gsl errors abort.
void gsl_check_func(int status, const char *File, int Line)
Check for gsl errors.
void range_min_check_template(const T &Val, const T &Min, const char *File, int Line)
Range check.
This is the base of the exception hierarchy for Full Physics code.
Exception(const std::string &W="")
Default constructor.
This is a Mixin for classes that can be printed.
Exception & operator<<(const T &V)
Write to exception what() string.
details::trace_manip trace(E const &e)
virtual void print(std::ostream &Os) const
Print out description of object.
void range_max_check_template(const T &Val, const T &Max, const char *File, int Line)
Range check.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
virtual ~Exception()
Destructor.
Exception(const Exception &E)
Copy constructor.
void range_check_template(const T &Val, const T &Min, const T &Max, const char *File, int Line)
Range check.