OptppExceptions.h

00001 #ifndef OPTPPEXCEPTIONS_H
00002 #define OPTPPEXCEPTIONS_H
00003 
00004 namespace OPTPP {
00005 
00016 // CPJW
00017 // Changed the class name from Exception to Exceptions to prevent clash with 
00018 // class Exception previously defined in newmat08/myexcepts.h 
00019 // Changed the class name from Exceptions to OptppExceptions to prevent clash 
00020 // with class CSRMException previously defined in the DDace/CPPUtilities.h 
00021 // 
00022 
00023 class OptppExceptions
00024 {
00025  public:
00026         OptppExceptions() {;}
00027         OptppExceptions(const char* mesg);
00028 
00029         virtual void print() const ;
00030 
00031         virtual const char* message() const {return mesg_;}
00032 
00033  protected:
00034         char mesg_[1000];
00035 };
00036 
00037 
00038 class OptppMemoryError : public OptppExceptions
00039 {
00040  public:
00041         OptppMemoryError(const char* mesg);
00042 
00043         virtual void print() const ;
00044         
00045  private:
00046 };
00047 
00048 class OptppRangeError : public OptppExceptions
00049 {
00050  public:
00051         OptppRangeError(const char* mesg, int i, int low, int high);
00052 
00053         virtual void print() const ;
00054         
00055  private:
00056         int i_;
00057         int low_;
00058         int high_;
00059 };
00060 
00061 
00062 class OptppMathError : public OptppExceptions
00063 {
00064  public:
00065         OptppMathError(const char* mesg);
00066 
00067         virtual void print() const ;
00068         
00069  private:
00070 };
00071 
00072 class OptppDomainError : public OptppMathError
00073 {
00074  public:
00075         OptppDomainError(const char* mesg, const double& badValue);
00076 
00077         virtual void print() const ;
00078         
00079  private:
00080         double badValue_;
00081 };
00082 
00083 class OptppZeroDivide : public OptppMathError 
00084 {
00085  public:
00086         OptppZeroDivide(const char* mesg);
00087 
00088         virtual void print() const ;
00089         
00090  private:
00091 };
00092 
00093 class RecoverableOptppExceptions : public OptppExceptions
00094 {
00095  public:
00096         RecoverableOptppExceptions(const OptppExceptions& e);
00097 
00098         virtual void print() const ;
00099  private:
00100         OptppExceptions e_;
00101 };
00102 
00103 void bailout(const OptppExceptions& e);
00104 
00105 } // namespace OPTPP
00106 
00107 #endif
Generated on Mon Jan 24 12:04:37 2011 for FASTlib by  doxygen 1.6.3