00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __CGDBMEXCEPTION_H //Required for current class
00017 #define __CGDBMEXCEPTION_H
00018
00019 #ifndef __CEXCEPTION_H
00020 #include "CException.h"
00021 #endif
00022
00023 #ifndef __HISTOTYPES_H
00024 #include <histotypes.h>
00025 #endif
00026
00027 #ifndef __GDBM_H
00028 #include <gdbm.h>
00029 #endif
00030
00031 #ifndef __STL_STRING
00032 #include <string>
00033 #define __STL_STRING
00034 #endif
00035
00036 class CGDBMException : public CException
00037 {
00038 gdbm_error m_nError;
00039
00040 public:
00041
00042 CGDBMException(const char* pszAction, gdbm_error am_nError) :
00043 m_nError(am_nError),
00044 CException(pszAction) {}
00045 CGDBMException(const std::string& rsAction, gdbm_error am_nError) :
00046 m_nError(am_nError),
00047 CException(rsAction) {}
00048
00049
00050 ~CGDBMException() {}
00051
00052
00053 CGDBMException(const CGDBMException& aCGDBMException) :
00054 CException(aCGDBMException)
00055 {
00056 m_nError = aCGDBMException.m_nError;
00057 }
00058
00059
00060 CGDBMException& operator= (const CGDBMException& aCGDBMException)
00061 {
00062 if(this == &aCGDBMException) return *this;
00063 CException::operator= (aCGDBMException);
00064 m_nError = aCGDBMException.m_nError;
00065 return *this;
00066 }
00067
00068
00069 int operator== (const CGDBMException& aCGDBMException)
00070 {
00071 return ((CException::operator== (aCGDBMException)) &&
00072 (m_nError == aCGDBMException.m_nError));
00073 }
00074
00075
00076 gdbm_error getError() const { return m_nError; }
00077
00078
00079 protected:
00080 void setError(gdbm_error am_nError) { m_nError = am_nError; }
00081
00082
00083 virtual const char* ReasonText() const;
00084 virtual Int_t ReasonCode() const;
00085 };
00086
00087 #endif