00001 #ifndef SIMEXCEPTION_H_
00002 #define SIMEXCEPTION_H_
00003
00004 #include <string>
00005 using std::string;
00006
00007 namespace evesim
00008 {
00009
00010 class Exception
00011 {
00012 public:
00013 Exception( string method, string msg ) : _method(method), _MSG( msg ) {};
00014 virtual ~Exception() {};
00015 string message() const;
00016 virtual string name() const { return string("nevesim::Exception"); };
00017 protected:
00018 string _method;
00019 string _MSG;
00020 };
00021
00022 class ConstructionException : public Exception
00023 {
00024 public:
00025 ConstructionException( string method, string msg ) : Exception( method, msg ) {};
00026 virtual string name() const { return string("nevesim::ConstructionException"); };
00027 };
00028
00029 class NotFoundException : public Exception
00030 {
00031 public:
00032 NotFoundException( string method, string msg ) : Exception( method, msg ) {};
00033 virtual string name() const { return string("nevesim::NotFoundException"); };
00034 };
00035
00036 }
00037
00038 inline string evesim::Exception::message() const
00039 {
00040 return name() + " in function " + _method + ": " + _MSG;
00041 }
00042
00043 #endif