00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _EXCEPTIONS_UESQLC__
00027 #define _EXCEPTIONS_UESQLC__
00028
00029 #include <ostream>
00030 #include <mpcl/error_exception.hh>
00031 #include <mpcl/exception.hh>
00032 #include <mpcl/fatal_exception.hh>
00033 #include <mpcl/warning_exception.hh>
00034
00035
00043 class TException: public virtual mpcl::TException
00044 {
00045
00046 protected:
00047
00048
00049
00050
00051
00052 void write (std::basic_ostream<char>& rtTARGET_OSTREAM) const
00053 {
00054 if ( !fileName().empty() )
00055 {
00056 mpcl::TException::write (rtTARGET_OSTREAM);
00057 }
00058 else
00059 {
00060 rtTARGET_OSTREAM << generalDescription();
00061 if ( !specificDescription().empty() )
00062 {
00063 rtTARGET_OSTREAM << specificDescription();
00064 }
00065 rtTARGET_OSTREAM << std::endl;
00066 }
00067 }
00068
00069 };
00070
00071
00073 class TWarningException :
00074 private virtual mpcl::TException ,
00075 public mpcl::TWarningException ,
00076 public TException
00077 {
00078
00079 private:
00080
00082 static const char* _pkcSynopsis;
00083
00084
00085 public:
00086
00087
00088
00089
00090
00098 TWarningException ( const std::string& rkyRATIONALE ,
00099 const std::string& rkyFILE_NAME ,
00100 const int kiLINE_NUMBER ) :
00101 mpcl::TException (_pkcSynopsis, rkyRATIONALE, rkyFILE_NAME, kiLINE_NUMBER) ,
00102 mpcl::TWarningException () ,
00103 TException () {}
00104
00105 };
00106
00107
00109 class TErrorException :
00110 private virtual mpcl::TException ,
00111 public mpcl::TErrorException ,
00112 public TException
00113 {
00114
00115 private:
00116
00118 static const char* _pkcSynopsis;
00119
00120
00121 public:
00122
00123
00124
00125
00126
00134 TErrorException ( const std::string& rkyRATIONALE ,
00135 const std::string& rkyFILE_NAME ,
00136 const int kiLINE_NUMBER ) :
00137 mpcl::TException (_pkcSynopsis, rkyRATIONALE, rkyFILE_NAME, kiLINE_NUMBER) ,
00138 mpcl::TErrorException () ,
00139 TException () {}
00140
00141 };
00142
00143
00151 class TFatalException :
00152 private virtual mpcl::TException ,
00153 public mpcl::TFatalException ,
00154 public TException
00155 {
00156
00157 private:
00158
00160 static const char* _pkcSynopsis;
00161
00162
00163 protected:
00164
00165
00166
00167
00168
00169 void write (std::basic_ostream<char>& rtTARGET_OSTREAM) const
00170 {
00171
00172
00173
00174 rtTARGET_OSTREAM << generalDescription();
00175 if ( !specificDescription().empty() )
00176 {
00177 rtTARGET_OSTREAM << specificDescription();
00178 }
00179 rtTARGET_OSTREAM << std::endl;
00180 }
00181
00182
00183 public:
00184
00185
00186
00187
00188
00196 TFatalException ( const std::string& rkyRATIONALE ,
00197 const std::string& rkyFILE_NAME = std::string() ,
00198 const int kiLINE_NUMBER = 0 ) :
00199 mpcl::TException (_pkcSynopsis, rkyRATIONALE, rkyFILE_NAME, kiLINE_NUMBER) ,
00200 mpcl::TFatalException () ,
00201 TException () {}
00202
00203 };
00204
00205
00206 #endif // not _EXCEPTIONS_UESQLC__