|
EpetraExt Development
|
00001 #ifndef EPETRAEXT_EXCEPTION 00002 #define EPETRAEXT_EXCEPTION 00003 00004 #include "EpetraExt_ConfigDefs.h" 00005 #include <string> 00006 00007 namespace EpetraExt 00008 { 00009 00010 class Exception 00011 { 00012 public: 00013 Exception(const string FileName, const int LineNumber, 00014 const string Line1, const string Line2 = "", 00015 const string Line3 = "", const string Line4 = "", 00016 const string Line5 = "", const string Line6 = "") : 00017 FileName_(FileName), 00018 LineNumber_(LineNumber), 00019 Line1_(Line1), 00020 Line2_(Line2), 00021 Line3_(Line3), 00022 Line4_(Line4), 00023 Line5_(Line5), 00024 Line6_(Line6) 00025 {} 00026 00027 void Print() 00028 { 00029 cerr << "EpetraExt: Exception: " << Line1_ << endl; 00030 if (Line2_ != "") 00031 cerr << "EpetraExt: Exception: " << Line2_ << endl; 00032 if (Line3_ != "") 00033 cerr << "EpetraExt: Exception: " << Line3_ << endl; 00034 if (Line4_ != "") 00035 cerr << "EpetraExt: Exception: " << Line4_ << endl; 00036 if (Line5_ != "") 00037 cerr << "EpetraExt: Exception: " << Line5_ << endl; 00038 if (Line6_ != "") 00039 cerr << "EpetraExt: Exception: " << Line6_ << endl; 00040 00041 cerr << "EpetraExt: File: " << FileName_ << ", line: " << LineNumber_ << endl; 00042 } 00043 00044 private: 00045 string FileName_; 00046 int LineNumber_; 00047 string Line1_; 00048 string Line2_; 00049 string Line3_; 00050 string Line4_; 00051 string Line5_; 00052 string Line6_; 00053 00054 }; // class Exception 00055 00056 } // namespace EpetraExt 00057 00058 #endif
1.7.4