- Timestamp:
- Jan 19, 2008, 12:09:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h
r43 r71 5 5 * $Id$ 6 6 * 7 * [ 7 * [ Description ] 8 8 * 9 9 */ 10 10 11 #include "ToString.h" 11 12 #include <iostream> 12 13 #include <exception> 13 14 14 using namespace std;15 16 15 namespace morpheo { 17 16 18 class ErrorMorpheo : public exception 17 #define ERRORMORPHEO(funcname,msg) ErrorMorpheo(funcname,msg,__LINE__,__FILE__) 18 19 class ErrorMorpheo : public std::exception 19 20 { 20 21 // -----[ fields ]---------------------------------------------------- 21 private : st ring _msg;22 private : std::string _msg; 22 23 23 24 // -----[ methods ]--------------------------------------------------- 24 public : ErrorMorpheo () throw() { _msg = "Exception detected ...";} 25 public : ErrorMorpheo (string msg) throw() { _msg = msg;} 25 public : ErrorMorpheo () throw() {_msg="Exception detected ...";} 26 public : ErrorMorpheo (std::string msg) throw() {_msg=msg;} 27 public : ErrorMorpheo (std::string funcname, 28 std::string msg , 29 int line , 30 std::string file ) throw() 31 { 32 _msg = "<"+funcname+"> at line " + toString(line) + ", in file " + file + " : "+msg; 33 } 26 34 public : ~ErrorMorpheo (void) throw() {} 27 35 public : const char* what () const throw() { return ( _msg.c_str() );} … … 29 37 }; 30 38 31 class TestMorpheo : public exception39 class TestMorpheo : public std::exception 32 40 { 33 41 // -----[ fields ]---------------------------------------------------- 34 private : st ring _msg;42 private : std::string _msg; 35 43 36 44 // -----[ methods ]--------------------------------------------------- 37 public : TestMorpheo () throw() { _msg ="Test error ...";}38 public : TestMorpheo (st ring msg) throw() { _msg =msg;}39 public : ~TestMorpheo (void) throw() {}40 public : const char* what () const throw() { return ( _msg.c_str() );}45 public : TestMorpheo () throw() {_msg="Test error ...";} 46 public : TestMorpheo (std::string msg) throw() {_msg=msg;} 47 public : ~TestMorpheo (void) throw() {} 48 public : const char* what () const throw() { return ( _msg.c_str() );} 41 49 }; 42 50
Note: See TracChangeset
for help on using the changeset viewer.