00001 /* 00002 * Copyright 2003 Michael A. Marsh, Cornell University. All rights reserved. 00003 * This software is released under the modified BSD license. 00004 * See the file LICENSE in the top-level directory for details. 00005 */ 00006 // 00007 // $Id: ExceptionBase.h,v 1.4 2005/01/21 19:44:16 mmarsh Exp $ 00008 // 00009 // $Log: ExceptionBase.h,v $ 00010 // Revision 1.4 2005/01/21 19:44:16 mmarsh 00011 // Updated for compatibility with Doxygen 1.4.1 00012 // 00013 // Revision 1.3 2004/05/19 15:56:50 mmarsh 00014 // *** empty log message *** 00015 // 00016 // Revision 1.2 2003/11/04 22:31:48 mmarsh 00017 // *** empty log message *** 00018 // 00019 // 00020 00021 #ifndef __CODEX_EXCEPTIONS_EXCEPTIONBASE_H__ 00022 #define __CODEX_EXCEPTIONS_EXCEPTIONBASE_H__ 00023 00024 #include <string> 00025 00026 using namespace std; 00027 00034 namespace CODEX_Exceptions 00035 { 00039 class ExceptionBase 00040 { 00041 public : 00047 ExceptionBase( const string& fname, int line ) : 00048 m_fname(fname), 00049 m_line(line) 00050 {} 00051 00053 virtual ~ExceptionBase() {} 00054 00059 virtual void report() const = 0; 00060 00062 const string& fname() const { return m_fname; } 00063 00065 int line() const { return m_line; } 00066 00067 protected : 00069 string m_fname; 00071 int m_line; 00072 }; 00073 00075 class IllegalIndexException : public ExceptionBase 00076 { 00077 public : 00079 IllegalIndexException( const string& fname, int line ) : 00080 ExceptionBase( fname, line ) 00081 {} 00082 00084 ~IllegalIndexException() {} 00085 00086 void report() const; 00087 }; 00088 00089 } 00090 00091 #endif /* __CODEX_EXCEPTIONS_EXCEPTIONBASE_H__ */
1.4.1