28 #ifndef _util_misc_scexception_h
29 #define _util_misc_scexception_h
32 #include <util/misc/exception.h>
35 #include <util/class/class.h>
36 #include <util/misc/bug.h>
45 const char *exception_type_;
46 mutable char *elaboration_c_str_;
47 std::ostringstream *elaboration_;
73 const char*
what()
const MPQC__NOEXCEPT;
79 const char *
exception_type() const MPQC__NOEXCEPT {
return exception_type_; }
109 const char *
file = 0,
137 const char *
file = 0,
154 const char *keyword_;
174 const char *
file = 0,
177 const char *
value = 0,
183 const char *
keyword() const MPQC__NOEXCEPT {
return keyword_; }
186 const char *
value() const MPQC__NOEXCEPT {
return value_; }
211 const char *
file = 0,
240 const char *
file = 0,
249 size_t nbyte() const MPQC__NOEXCEPT {
return nbyte_; }
256 enum FileOperation { Unknown, OpenR, OpenW, OpenRW,
257 Close, Read, Write, Corrupt, Other };
260 const char *filename_;
261 FileOperation operation_;
281 const char *source_file = 0,
286 const char *
exception_type =
"FileOperationFailed") MPQC__NOEXCEPT;
292 const char *
filename() const MPQC__NOEXCEPT {
return filename_; }
294 FileOperation
operation() const MPQC__NOEXCEPT {
return operation_; }
300 const char *syscall_;
320 const char *source_file = 0,
331 const char *
syscall() const MPQC__NOEXCEPT {
return syscall_; }
333 int err() const MPQC__NOEXCEPT {
return err_; }
359 const char *
file = 0,
390 const char *
file = 0,
399 int max_iter() const MPQC__NOEXCEPT {
return max_iter_; }
425 const char *
file = 0,
434 double tolerance() MPQC__NOEXCEPT {
return tolerance_; }
436 double value() MPQC__NOEXCEPT {
return value_; }
473 const char *
exception_type = strdup((std::string(
"LimitExceeded<") + std::string(
typeid(T).name()) + std::string(
">")).c_str())
476 limit_(lim), value_(val)
481 <<
"limit: " << limit_
489 limit_(ref.limit_), value_(ref.value_)
496 T
value() MPQC__NOEXCEPT {
return value_; }
504 const char* assertion_text_;
520 int line) MPQC__NOEXCEPT;
522 const char* assertion_text()
const MPQC__NOEXCEPT {
return assertion_text_; }
563 #define __scexception_h_finished
This is thrown when when some tolerance is exceeded.
Definition: scexception.h:404
int err() const MPQC__NOEXCEPT
Return the error code that the system call returned.
Definition: scexception.h:333
This is thrown when an assertion fails.
Definition: scexception.h:502
Creates a backtrace of a running program/thread.
Definition: bug.h:123
const ClassDesc * class_desc() const MPQC__NOEXCEPT
Returns the class descriptor of the object which generated the exception.
Definition: scexception.h:77
SystemException(const char *description=0, const char *file=0, int line=0, const ClassDesc *class_desc=0, const char *exception_type="SystemException") MPQC__NOEXCEPT
Create a SystemException exception.
int line() const MPQC__NOEXCEPT
Returns the line number where the exception was created.
Definition: exception.h:81
This is a std::exception specialization that records information about where an exception took place.
Definition: exception.h:48
This is thrown when a memory allocation fails.
Definition: scexception.h:221
FileOperation operation() const MPQC__NOEXCEPT
Return the file operation that failed as a FileOperation enum.
Definition: scexception.h:294
const char * what() const MPQC__NOEXCEPT
overload of Exception::what()
ProgrammingError(const char *description=0, const char *file=0, int line=0, const ClassDesc *class_desc=0, const char *exception_type="ProgrammingError") MPQC__NOEXCEPT
Create a ProgrammingError exception.
const char * exception_type() const MPQC__NOEXCEPT
Returns the classname of the exception. May return null.
Definition: scexception.h:79
T value() MPQC__NOEXCEPT
The value which exceeded the limit.
Definition: scexception.h:496
This exception is thrown whenever a problem with an algorithm is encountered.
Definition: scexception.h:342
const char * file() const MPQC__NOEXCEPT
Returns the name of the file in which the exception was created.
Definition: exception.h:78
This is a sc::Exception specialization that keeps track of the ClassDesc for the MPQC object from whi...
Definition: scexception.h:43
This is thrown when an system call fails with an errno.
Definition: scexception.h:299
AssertionFailed(const char *assertion_text, const char *file, int line) MPQC__NOEXCEPT
Create an AssertionFailed exception.
LimitExceeded(const char *description, const char *file, int line, T lim, T val, const ClassDesc *class_desc=0, const char *exception_type=strdup((std::string("LimitExceeded<")+std::string(typeid(T).name())+std::string(">")).c_str())) MPQC__NOEXCEPT
Create a LimitExceeded exception.
Definition: scexception.h:467
This is thrown when an operation on a file fails.
Definition: scexception.h:254
This is thrown when an attempt is made to use a feature that is not yet implemented.
Definition: scexception.h:120
const char * filename() const MPQC__NOEXCEPT
Returns the file name of the file that caused the error, if known.
Definition: scexception.h:292
This class is used to contain information about classes.
Definition: class.h:147
size_t nbyte() const MPQC__NOEXCEPT
Returns the number of bytes used in the failed allocation attempt.
Definition: scexception.h:249
This is thrown when a limit is exceeded.
Definition: scexception.h:447
const char * syscall() const MPQC__NOEXCEPT
Returns the file name of the file that caused the error, if known.
Definition: scexception.h:331
This is thrown when an iterative algorithm attempts to use more iterations than allowed.
Definition: scexception.h:371
FeatureNotImplemented(const char *description=0, const char *file=0, int line=0, const ClassDesc *class_desc=0, const char *exception_type="FeatureNotImplemented") MPQC__NOEXCEPT
Create a FeatureNotImplemented exception.
This is thrown when a system problem occurs.
Definition: scexception.h:194
const char * description() const MPQC__NOEXCEPT
Reimplementation of std::exception::what().
Definition: exception.h:75
SCException(const char *description=0, const char *file=0, int line=0, const ClassDesc *class_desc=0, const char *exception_type="SCException") MPQC__NOEXCEPT
Create an SCException.
T tolerance() MPQC__NOEXCEPT
The limit which was exceeded.
Definition: scexception.h:494
double tolerance() MPQC__NOEXCEPT
Return the required tolerance.
Definition: scexception.h:434
int max_iter() const MPQC__NOEXCEPT
Return the maximum number of iterations.
Definition: scexception.h:399
This is thrown when a situations arises that should be impossible.
Definition: scexception.h:92
ToleranceExceeded(const char *description=0, const char *file=0, int line=0, double tol=0, double val=0, const ClassDesc *class_desc=0, const char *exception_type="ToleranceExceeded") MPQC__NOEXCEPT
Create a ToleranceExceeded exception.
MaxIterExceeded(const char *description=0, const char *file=0, int line=0, int maxiter=0, const ClassDesc *class_desc=0, const char *exception_type="MaxIterExceeded") MPQC__NOEXCEPT
Create a MaxIterExceeded exception.
FileOperationFailed(const char *description=0, const char *source_file=0, int line=0, const char *filename=0, FileOperation operation=Unknown, const ClassDesc *class_desc=0, const char *exception_type="FileOperationFailed") MPQC__NOEXCEPT
Create a FileOperationFailure exception.
double value() MPQC__NOEXCEPT
Return the value which was obtained.
Definition: scexception.h:436
AlgorithmException(const char *description=0, const char *file=0, int line=0, const ClassDesc *class_desc=0, const char *exception_type="AlgorithmException") MPQC__NOEXCEPT
Create an AlgorithmException.
std::ostream & elaborate()
Returns a stream where additional information about the exception can be written.
SyscallFailed(const char *description=0, const char *source_file=0, int line=0, const char *syscall=0, int err=0, const ClassDesc *class_desc=0, const char *exception_type="SyscallFailed") MPQC__NOEXCEPT
Create a SyscallFailed exception.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
MemAllocFailed(const char *description=0, const char *file=0, int line=0, size_t nbyte=0, const ClassDesc *class_desc=0, const char *exception_type="MemAllocFailed") MPQC__NOEXCEPT
Create a MemAllocFailed exception.
Generated at Sun Jan 26 2020 23:24:02 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.