Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CODEX_KeyService/Exceptions.h

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: Exceptions.h,v 1.3 2004/05/19 15:56:52 mmarsh Exp $
00008 //
00009 // $Log: Exceptions.h,v $
00010 // Revision 1.3  2004/05/19 15:56:52  mmarsh
00011 // *** empty log message ***
00012 //
00013 // Revision 1.2  2003/11/04 22:31:49  mmarsh
00014 // *** empty log message ***
00015 //
00016 //
00017 
00018 #ifndef __CODEX_KEYSERVICE_EXCEPTIONS_H__
00019 #define __CODEX_KEYSERVICE_EXCEPTIONS_H__
00020 
00021 #include <string>
00022 
00023 #include "CODEX_Exceptions/ExceptionBase.h"
00024 
00025 namespace CODEX_KeyService
00026 {
00028    class ExceptionBase : public CODEX_Exceptions::ExceptionBase
00029    {
00030       public :
00036          ExceptionBase( const string& fname, int line ) :
00037             CODEX_Exceptions::ExceptionBase( fname, line )
00038          {}
00039 
00041          virtual ~ExceptionBase() {}
00042 
00046          void report() const;
00047 
00048       protected :
00053          virtual void derivedMsg() const = 0;
00054 
00055    };
00056 
00058    class KeyExistsException : public ExceptionBase
00059    {
00060       public :
00062          KeyExistsException( const string& fname, int line ) :
00063             ExceptionBase( fname, line )
00064          {}
00065 
00067          virtual ~KeyExistsException() {}
00068 
00069       protected :
00070          void derivedMsg() const;
00071    };
00072 
00074    class NameMismatchException : public ExceptionBase
00075    {
00076       public :
00078          NameMismatchException( const string& fname, int line ) :
00079             ExceptionBase( fname, line )
00080          {}
00081 
00083          ~NameMismatchException() {}
00084 
00085       protected :
00086          void derivedMsg() const;
00087    };
00088 
00090    class KeyNotFoundException : public ExceptionBase
00091    {
00092       public :
00094          KeyNotFoundException( const string& fname, int line ) :
00095             ExceptionBase( fname, line )
00096          {}
00097 
00099          ~KeyNotFoundException() {}
00100 
00101       protected :
00102          void derivedMsg() const;
00103    };
00104 
00106    class ClientNotFoundException : public ExceptionBase
00107    {
00108       public :
00110          ClientNotFoundException( const string& fname, int line ) :
00111             ExceptionBase( fname, line )
00112          {}
00113 
00115          ~ClientNotFoundException() {}
00116 
00117       protected :
00118          void derivedMsg() const;
00119    };
00120 
00121 }
00122 
00123 #endif /* __CODEX_KEYSERVICE_EXCEPTIONS_H__ */

Generated on Fri May 6 17:39:12 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1