#include <gdcmException.h>
Inheritance diagram for gdcm::Exception:

Public Member Functions | |
| Exception (const std::string &from, const std::string &error="") throw () | |
| constructor | |
| virtual | ~Exception () throw () |
| virtual destructor makes this class dynamic | |
| const std::string & | getError () const throw () |
| returns error message | |
| virtual std::string | getName () const throw () |
| getName | |
| virtual const char * | what () const throw () |
| returns exception name string (overloads std::exception::what) | |
| operator const char * () const throw () | |
| Exception. | |
Static Public Member Functions | |
| void | fatal (const char *from) throw () |
| fatal | |
Protected Attributes | |
| std::string | From |
| error message part 1 | |
| std::string | Error |
| error message part 2 | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Exception &e) |
| Exception::operator <<. | |
Definition at line 35 of file gdcmException.h.
|
||||||||||||
|
constructor
Definition at line 31 of file gdcmException.cxx.
|
|
|
virtual destructor makes this class dynamic
Definition at line 51 of file gdcmException.h.
00051 {};
|
|
|
fatal
Definition at line 49 of file gdcmException.cxx.
00050 {
00051 try
00052 {
00053 std::cerr << "Fatal: exception received in " << from
00054 << " while handling exception." << std::endl;
00055 exit(-1);
00056 }
00057 catch(...)
00058 {
00059 try
00060 {
00061 std::cerr << "Fatal: exception received in Exception::fatal while handling exception."
00062 << std::endl;
00063 exit(-1);
00064 }
00065 catch(...)
00066 {
00067 exit(-1);
00068 }
00069 }
00070 }
|
|
|
returns error message
Definition at line 57 of file gdcmException.h. Referenced by gdcm::operator<<().
00057 {
00058 return Error;
00059 }
|
|
|
getName
Definition at line 76 of file gdcmException.cxx. Referenced by gdcm::operator<<().
00077 {
00078 try
00079 {
00080 #if defined(__GNUC__) && 0 // GNU C++ compiler class name demangling
00081 unsigned int nested = 1, i, nb;
00082 int offset;
00083 std::string one;
00084
00085 std::string name;
00086 std::string iname = typeid(*this).name();
00087 if(iname[0] == 'Q')
00088 {
00089 nested = iname[1] - '0';
00090 iname = std::string(iname, 2, std::string::npos);
00091 }
00092 for(i = 0; i < nested; i++)
00093 {
00094 ::sscanf(iname.c_str(), "%u%n", &nb, &offset);
00095 iname = std::string(iname, offset, std::string::npos);
00096 name += std::string(iname, 0, nb);
00097 if(i + 1 < nested) name += "::";
00098 iname = std::string(iname, nb, std::string::npos);
00099 }
00100 return name;
00101 #else // no class name demangling
00102 std::string name = typeid(*this).name();
00103 return name;
00104 #endif
00105 }
00106 catch(...)
00107 {
00108 fatal("Exception::getName(std::string &)");
00109 return "";
00110 }
00111 }
|
|
|
Definition at line 116 of file gdcmException.cxx.
00117 {
00118 return getName().c_str();
00119 }
|
|
|
returns exception name string (overloads std::exception::what)
Definition at line 65 of file gdcmException.h.
00065 {
00066 return (const char *) *this;
00067 }
|
|
||||||||||||
|
Exception::operator <<.
Definition at line 127 of file gdcmException.cxx.
00128 {
00129 try
00130 {
00131 os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl;
00132 }
00133 catch(...)
00134 {
00135 Exception::fatal("operator<<(std::ostream &, const Exception&)");
00136 }
00137 return os;
00138 }
|
|
|
error message part 2
Definition at line 78 of file gdcmException.h. |
|
|
error message part 1
Definition at line 76 of file gdcmException.h. |
1.3.6