iSpike
2.1
Spike conversion library for robotics
|
00001 #ifndef ISPIKEEXCEPTION_HPP_ 00002 #define ISPIKEEXCEPTION_HPP_ 00003 00004 #include <string> 00005 #include <sstream> 00006 using namespace std; 00007 00008 namespace ispike { 00009 00010 class ISpikeException : public exception { 00011 private: 00012 string description; 00013 00014 public: 00015 ISpikeException(string description) throw() { 00016 this->description = description; 00017 } 00018 ISpikeException(string description, int arg1) throw() { 00019 ostringstream oss; 00020 oss<<description<<arg1; 00021 this->description = oss.str(); 00022 } 00023 ~ISpikeException() throw() {} 00024 00025 const string& msg() const { 00026 return description; 00027 } 00028 00029 const char* what() const throw() { 00030 return description.c_str(); 00031 } 00032 00033 }; 00034 00035 } 00036 00037 #endif /* ISPIKEEXCEPTION_HPP_ */