base/zz_exception.h

Go to the documentation of this file.
00001 /* libzz
00002  *
00003  * This program is distributed under the GNU General Public License, version 2.
00004  * A copy of this license is included with this source.
00005  *
00006  * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
00007 */
00008 
00009 #ifndef zz_exception_h
00010 #define zz_exception_h
00011 
00012 #include <zz_string.h>
00013 #include <zz_error.h>
00014 #include <zz_export.h>
00015 
00016 #ifndef _LAF
00017 // Description: Macro för radnummer + filnamn
00018 #define _LAF __LINE__, __FILE__      
00019 #endif
00020 
00021 /*
00022         Description:
00023         Basklass för alla fel
00024 
00025         Author: 
00026         Toni Thomsson, toni@tonjac.org
00027 
00028         Library:
00029         libzz.a (HPUX) libzz.lib (win32)
00030 
00031         Platform:
00032         HPUX, win32
00033 */
00034 class ZZ_API CzzException
00035 {
00036 
00037 public:
00038 
00039         /*
00040                 Description:
00041                 Skapar ett felobjekt
00042 
00043                 Remarks:
00044                 Kopierings konstruktor
00045         */
00046     CzzException( const CzzException& exceptionSrc // IN, objekt som skall kopieras
00047                                         );
00048         /*
00049                 Remarks:
00050                 Skapar ett fel enligt argument
00051         */
00052     CzzException( int lineNumber,               // IN, radnummer
00053                                         CzzString fileName, // IN, filnamn
00054                                         CzzString callId,       // IN, anrops id
00055                                         int code,                       // IN, felkod
00056                                         CzzString reason        // IN, feltext
00057                                         );
00058         
00059         /*
00060                 Remarks:
00061                 Skapar ett fel enligt argument
00062         */
00063     CzzException( int lineNumber,               // IN, radnummer
00064                                         CzzString fileName, // IN, filnamn
00065                                         int code,                       // IN, felkod
00066                                         CzzString reason        // IN, feltext
00067                                         );
00068 
00069         // Description: Destruktor
00070     virtual ~CzzException();
00071     
00072         // Description: Tidpunkt för felet
00073     time_t GetOccuranceTime( void ) const;
00074 
00075         // Description: Felhistorik
00076     static CzzErrorHistory* GetErrorHistory( void );
00077 
00078         // Description: Feltext
00079     CzzString GetReason( void ) const;
00080 
00081         // Description: Anrops id
00082     CzzString GetCallId( void ) const;
00083 
00084         // Description: Filnamn
00085     CzzString GetFileName( void ) const;
00086 
00087         // Description: Radnummer
00088     int GetLineNumber( void ) const;
00089 
00090         // Description: Felkod
00091     int GetCode( void ) const;
00092     
00093 protected:
00094 
00095         // Description: Lagrar felet i felstacken
00096     void StoreInHistory( void );
00097 
00098     static CzzErrorHistory* m_ErrorHistory;
00099     const time_t m_OccuranceTime;
00100     CzzString m_CallId;
00101     CzzString m_Reason;
00102     CzzString m_FileName;
00103     int m_LineNumber;
00104     int m_Code;
00105 
00106 private:
00107     void CheckRemoveHistory( void );
00108 
00109 };
00110 
00111 #endif

Generated on Thu Sep 21 21:45:41 2006 for tonjac.org MINI/C++ library by  doxygen 1.4.6-NO