| 
    PSCF v1.3.3
    
   | 
 
A user-defined exception. More...
#include <Exception.h>
  
Public Member Functions | |
| Exception (const char *function, const char *message, const char *file, int line, int echo=1) | |
| Constructor.   | |
| Exception (const char *message, const char *file, int line, int echo=1) | |
| Constructor without function name parameter.   | |
| virtual | ~Exception () | 
| Destructor.   | |
| void | write (std::ostream &out) | 
| Write error message to output stream.   | |
| std::string & | message () | 
| Return the error message.   | |
Protected Attributes | |
| std::string | message_ | 
| Error message string.   | |
A user-defined exception.
Exceptions are usually thrown using the UTIL_THROW() macro.
Definition at line 24 of file Exception.h.
| Util::Exception::Exception | ( | const char * | function, | 
| const char * | message, | ||
| const char * | file, | ||
| int | line, | ||
| int | echo = 1 ) | 
Constructor.
Constructs error message that includes file and line number. Values of the file and line parameters should be given by the built-in macros FILE and LINE, respectively, in the calling function. A typical call of the constructor is thus of the form:
| function | name of the function from which the Exception was thrown | 
| message | message describing the nature of the error | 
| file | name of the file from which the Exception was thrown | 
| line | line number in file | 
| echo | if echo, then echo to Log::file() when constructed. | 
Definition at line 22 of file Exception.cpp.
References Util::Log::file(), message(), message_, and write().
Referenced by Pscf::NanException::NanException(), and Pscf::NanException::NanException().
| Util::Exception::Exception | ( | const char * | message, | 
| const char * | file, | ||
| int | line, | ||
| int | echo = 1 ) | 
Constructor without function name parameter.
| message | message describing the nature of the error | 
| file | name of the file from which the Exception was thrown | 
| line | line number in file | 
| echo | if echo, then echo to std out when constructed. | 
Definition at line 48 of file Exception.cpp.
References Util::Log::file(), message(), message_, and write().
      
  | 
  virtual | 
Destructor.
Definition at line 71 of file Exception.cpp.
| void Util::Exception::write | ( | std::ostream & | out | ) | 
Write error message to output stream.
| out | output stream | 
Definition at line 77 of file Exception.cpp.
References message_.
Referenced by Exception(), and Exception().
| std::string & Util::Exception::message | ( | ) | 
Return the error message.
Definition at line 83 of file Exception.cpp.
References message_.
Referenced by Exception(), and Exception().
      
  | 
  protected | 
Error message string.
Definition at line 80 of file Exception.h.
Referenced by Exception(), Exception(), message(), and write().