00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __CALARMSERVEREXCEPTION_H //Required for current class
00018 #define __CALARMSERVEREXCEPTION_H
00019
00020 #ifndef __CEXCEPTION_H
00021 #include "CException.h"
00022 #endif
00023
00024 #ifndef __HISTOTYPES_H
00025 #include <histotypes.h>
00026 #endif
00027
00028 #ifndef __ERRNO_H
00029 #include <errno.h>
00030 #endif
00031
00032 #ifndef __STL_STRING
00033 #include <string>
00034 #define __STL_STRING
00035 #endif
00036
00037 class CAlarmServerException : public CException
00038 {
00039 string m_sRequestString;
00040 Int_t m_nErrno;
00041
00042 public:
00043
00044 CAlarmServerException(const char* pszAction, const char* pError) :
00045 m_sRequestString(pError),
00046 CException(pszAction),
00047 m_nErrno(errno) {}
00048 CAlarmServerException(const char* pszAction, const string& rError) :
00049 m_sRequestString(rError),
00050 CException(pszAction),
00051 m_nErrno(errno) {}
00052 CAlarmServerException(const std::string& rsAction, const char* pError) :
00053 m_sRequestString(pError),
00054 CException(rsAction),
00055 m_nErrno(errno) {}
00056 CAlarmServerException(const std::string& rsAction, const string& rError) :
00057 m_sRequestString(rError),
00058 CException(rsAction),
00059 m_nErrno(errno) {}
00060
00061
00062 ~CAlarmServerException() {}
00063
00064
00065 CAlarmServerException(const CAlarmServerException& aCAlarmServerException) :
00066 CException(aCAlarmServerException)
00067 {
00068 m_sRequestString = aCAlarmServerException.m_sRequestString;
00069 }
00070
00071
00072 CAlarmServerException& operator=
00073 (const CAlarmServerException& aCAlarmServerException)
00074 {
00075 if(this == &aCAlarmServerException) return *this;
00076 CException::operator= (aCAlarmServerException);
00077 m_sRequestString = aCAlarmServerException.m_sRequestString;
00078 return *this;
00079 }
00080
00081
00082 int operator== (const CAlarmServerException& aCAlarmServerException)
00083 {
00084 return ((CException::operator== (aCAlarmServerException)) &&
00085 (m_sRequestString == aCAlarmServerException.m_sRequestString));
00086 }
00087
00088
00089 string getRequestString() const { return m_sRequestString; }
00090 Int_t getErrno() const { return m_nErrno; }
00091
00092
00093 protected:
00094 void setRequestString(string am_sRequestString)
00095 { m_sRequestString = am_sRequestString; }
00096 void setErrno(Int_t err) { m_nErrno = err; }
00097
00098
00099 virtual const char* ReasonText() const;
00100 virtual Int_t ReasonCode() const;
00101 };
00102
00103 #endif