00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _EXCEPTION_HPP
00014 #define _EXCEPTION_HPP
00015 #include <iostream>
00016 using namespace std;
00017
00019
00057 class Exception {
00058 public:
00059 Exception(char *throwerString=" unknown thrower", char *whatString="unknown exception"):
00060 thrower(throwerString), what(whatString) {}
00061 ~Exception() {}
00062 void writeMessage(ostream &os = cerr);
00063 private:
00064 char *thrower;
00065 char *what;
00066 };
00067
00068
00069 inline void Exception::writeMessage(ostream &os)
00070 {
00071 os << "Exception [by "<< thrower << "]:"<< what << endl;
00072 }
00073 #endif