32 #ifndef _util_misc_scexception_h
33 #define _util_misc_scexception_h
35 #ifndef _util_class_class_h
36 #include <util/class/class.h>
50 const char *description_;
54 const char *exception_type_;
55 std::ostringstream *elaboration_;
62 const char *exception_type =
"SCException")
throw();
68 const char*
what()
const throw();
70 const char *description()
const throw() {
return description_; }
71 const char *file()
const throw() {
return file_; }
72 int line()
const throw() {
return line_; }
73 const ClassDesc *class_desc()
const throw() {
return class_desc_; }
74 const char *exception_type()
const throw() {
return exception_type_; }
94 const char *exception_type =
"ProgrammingError")
throw();
106 const char *file = 0,
109 const char *exception_type =
"FeatureNotImplemented")
123 const char *keyword_;
128 const char *file = 0,
130 const char *keyword = 0,
131 const char *value = 0,
133 const char *exception_type =
"InputError")
throw();
136 const char *keyword()
const throw() {
return keyword_; }
137 const char *value()
const throw() {
return value_; }
149 const char *file = 0,
152 const char *exception_type =
"SystemException")
throw();
164 const char *file = 0,
168 const char *exception_type =
"MemAllocFailed")
throw();
173 size_t nbyte()
const throw() {
return nbyte_; }
180 enum FileOperation { Unknown, OpenR, OpenW, OpenRW,
181 Close, Read, Write, Corrupt, Other };
184 const char *filename_;
185 FileOperation operation_;
189 const char *source_file = 0,
192 FileOperation operation = Unknown,
194 const char *exception_type =
"FileOperationFailed")
throw();
200 const char *
filename()
const throw() {
return filename_; }
201 FileOperation operation()
const throw() {
return operation_; }
207 const char *syscall_;
212 const char *source_file = 0,
217 const char *exception_type =
"SyscallFailed")
throw();
223 const char *
syscall()
const throw() {
return syscall_; }
224 int err()
const throw() {
return err_; }
237 const char *file = 0,
240 const char *exception_type =
"AlgorithmException")
254 const char *file = 0,
258 const char *exception_type =
"MaxIterExceeded")
throw();
262 int max_iter()
const throw() {
return max_iter_; }
273 const char *file = 0,
278 const char *exception_type =
"ToleranceExceeded")
throw();
281 double tolerance()
throw() {
return tolerance_; }
282 double value()
throw() {
return value_; }
304 const char *exception_type =
"LimitExceeded")
throw():
305 SCException(description, file, line, class_desc, exception_type),
306 limit_(lim), value_(val)
311 <<
"limit: " << limit_
319 limit_(ref.limit_), value_(ref.value_)
323 T tolerance()
throw() {
return limit_; }
324 T value()
throw() {
return value_; }
This is thrown when when some tolerance is exceeded.
Definition: scexception.h:267
This is thrown when a memory allocation fails.
Definition: scexception.h:159
const char * syscall() const
Returns the file name of the file that caused the error, if known.
Definition: scexception.h:223
This exception is thrown whenever a problem with an algorithm is encountered.
Definition: scexception.h:233
This is a std::exception specialization that records information about where an exception took place.
Definition: scexception.h:49
This is thrown when an system call fails with an errno.
Definition: scexception.h:206
This is thrown when an operation on a file fails.
Definition: scexception.h:178
This is thrown when an attempt is made to use a feature that is not yet implemented.
Definition: scexception.h:102
This class is used to contain information about classes.
Definition: class.h:158
const char * what() const
Reimplementation of std::exception::what().
This is thrown when a limit is exceeded.
Definition: scexception.h:293
This is thrown when an iterative algorithm attempts to use more iterations than allowed.
Definition: scexception.h:249
size_t nbyte() const
Returns the number of bytes used in the failed allocation attempt.
Definition: scexception.h:173
This is thrown when a system problem occurs.
Definition: scexception.h:145
const char * filename() const
Returns the file name of the file that caused the error, if known.
Definition: scexception.h:200
This is thrown when a situations arises that should be impossible.
Definition: scexception.h:87
std::ostream & elaborate()
Returns a stream where addition information about the exception can be written.
Generated at Sun Jan 26 2020 23:33:04 for MPQC
2.3.1 using the documentation package Doxygen
1.8.16.