00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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