00001 00016 #ifndef _QAPOLLOERROR_HH_ 00017 #define _QAPOLLOERROR_HH_ 00018 00019 // C/C++ Includes 00020 #include <string> 00021 #include <sstream> 00022 00023 // Apollo Includes 00024 #include "QCuore.hh" 00025 #include "QApolloMessenger.hh" 00026 #include "QError.hh" 00027 00028 00029 class QApolloError { 00030 public: 00034 virtual ~QApolloError(); 00035 00039 static QApolloError *Get(); 00040 00044 void Reset(); 00045 00058 void Set(const std::string& Where, MsgLevel Sev, 00059 const std::string& Error, QError_ code=QERR_SUCCESS); 00060 00068 void Set(const char* Where, MsgLevel Sev, 00069 const char* Error, QError_ code=QERR_SUCCESS) 00070 {std::string s1 = Where; std::string s2=Error; Set(s1,Sev,s2,code);} 00071 00075 bool IsError() const {return (fSeverity != NoMsg);} 00076 00080 MsgLevel GetSeverity() const {return fSeverity;} 00081 00085 const std::string& GetError() const {return fErrorString;} 00086 00090 const std::string& GetWhere() const {return fWhere;} 00091 00095 const QError& GetQError(); 00096 00097 private: 00098 00099 static QApolloError *fMe; 00100 00104 QApolloError(); 00105 00109 std::string fWhere; 00113 MsgLevel fSeverity; 00114 00118 std::string fErrorString; 00119 00123 QError_ fCode; 00124 00129 QError fError; 00130 00131 }; 00132 00133 #endif // _QAPOLLOERROR_HH_