Ignore:
Timestamp:
Apr 12, 2000, 7:49:54 PM (25 years ago)
Author:
ansari
Message:

Documentation de fichiers - Reza 12/4/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/pexceptions.h

    r773 r895  
    1414namespace SOPHYA {
    1515
    16   // Utiliatire pour accoler un nom de fichier et numero de ligne au message
     16//! Utility function for appending a file name and line number to a message
    1717  string BuildLongExceptionMessage(const char * s, const char *file, int line);
    1818
    19   // Ancestor for PError and PException
    20   // It has a message, and an id to give more
    21   // information on the exception.
     19//! Base exception class in Sophya.
     20/*! Ancestor for PError and PException
     21    It has a message, and an id to give more
     22    information on the exception.
     23*/
    2224  class PThrowable {
    2325  public:
     26    //! Constructor with the message and error-id (optional) specification
    2427    explicit PThrowable(const string& m, int ident=0)
    2528      : msg(m), id(ident) {}
    2629    virtual ~PThrowable() { }
     30    //! Returns the associated message string
    2731    virtual string const& Msg() const  {return msg;}
     32    //! Returns the associated error-id
     33    virtual int Id() const {return id; }
    2834  private:
    2935    string msg;
    3036    int    id;
    3137  };
    32  
    33   // A PError is a serious logic error. Usually not caught...
     38
     39//  PThrowable
     40//      PError
     41//      PException
     42 
     43//! A PError is a serious logic error. Usually not caught...
    3444  class PError : public PThrowable {
    3545  public:
     
    3747  };
    3848 
    39   // A PException is not as serious... Can be caught.
     49//! A PException is not as serious... Can be caught.
    4050  class PException : public PThrowable {
    4151  public:
     
    4353  };
    4454 
    45   // Errors
    46   // Memory allocation failure
     55//  ----   Errors ----
     56//  PError
     57//     AllocationError
     58//     NullPtrError
     59//     ForbiddenError
     60//     AssertionFailedError
     61
     62//! Memory allocation failure
    4763  class AllocationError : public PError {
    4864  public:
     
    5066  };
    5167 
    52   // Null pointer error
     68//! Null pointer error
    5369  class NullPtrError : public PError {
    5470  public:
     
    5672  };
    5773 
    58   // Size mismatch between objects
    59   class SzMismatchError : public PError {
    60   public:
    61     explicit SzMismatchError(const string& m, int id=0) : PError(m,id) {}
    62   };
    63  
    64   // Out of bounds for array, matrix, etc.
    65   class RangeCheckError : public PError {
    66   public:
    67     explicit RangeCheckError(const string& m, int id=0) : PError(m,id) {}
    68   };
    69  
    70   // Invalid parameter to method/constructor...
    71   class ParmError : public PError {
    72   public:
    73     explicit ParmError(const string& m, int id=0) : PError(m,id) {}
    74   };
    75  
    76   // Calling a forbidden method, trying a forbidden operation
     74 
     75//! Calling a forbidden method, trying a forbidden operation
    7776  class ForbiddenError : public PError {
    7877  public:
     
    8079  };
    8180
    82   // Calling a non available / not implemented method
    83   class NotAvailableOperation : public PException {
    84   public:
    85     explicit NotAvailableOperation(const string& m, int id=0) : PException(m,id) {}
    86   };
    87  
    88   // ASSERT macro failure. The message is the assertion...
     81 
     82//! ASSERT macro failure. The message is the assertion...
    8983  class AssertionFailedError : public PError {
    9084  public:
     
    9791  //   IOExc
    9892  //     FileFormatExc
     93  //   SzMismatchError
     94  //   RangeCheckError
     95  //   ParmError
    9996  //   TypeMismatchExc
     97  //   MathExc
     98  //     SingMatxExc
    10099  //   DuplicateIdExc
    101100  //   NotFoundExc
    102   //   MathExc
    103   //     SingMatxExc
    104  
    105   // generic IO Exception
     101  //   CaughtSignalExc
     102 
     103  //! Generic IO Exception.
    106104  class IOExc : public PException {
    107105  public:
     
    109107  };
    110108
    111   // Bad type -> keep ?
     109  //! Bad file format.
     110  class FileFormatExc : public IOExc {
     111  public:
     112    explicit FileFormatExc(const string& m, int id=0) : IOExc(m,id) {}
     113  };
     114
     115  //! Size mismatch between objects.
     116  class SzMismatchError : public PException {
     117  public:
     118    explicit SzMismatchError(const string& m, int id=0) : PException(m,id) {}
     119  };
     120 
     121  //! Out of bounds for array, matrix, etc.
     122  class RangeCheckError : public PException {
     123  public:
     124    explicit RangeCheckError(const string& m, int id=0) : PException(m,id) {}
     125  };
     126 
     127  //! Invalid parameter to method/constructor...
     128  class ParmError : public PException {
     129  public:
     130    explicit ParmError(const string& m, int id=0) : PException(m,id) {}
     131  };
     132
     133  //! Calling a non available / not implemented method
     134  class NotAvailableOperation : public PException {
     135  public:
     136    explicit NotAvailableOperation(const string& m, int id=0) : PException(m,id) {}
     137  };
     138
     139  //! Bad data type -> keep ?
    112140  class TypeMismatchExc : public PException {
    113141  public:
    114142    explicit TypeMismatchExc(const string& m, int id=0) : PException(m,id) {}
    115143  };
    116  
     144
     145  //! Math operation exception
    117146  class MathExc : public PException {
    118147  public:
     
    120149  };
    121150 
     151  //! Singular matrix
     152  class SingMatrixExc : public MathExc {
     153  public:
     154    explicit SingMatrixExc(const string& m, int id=0) : MathExc(m,id) {}
     155  };
     156
     157  //! Duplicate identifier during registration
    122158  class DuplicateIdExc : public PException {
    123159  public:
     
    125161  };
    126162 
     163  //! Not found identifier
    127164  class NotFoundExc : public PException {
    128165  public:
     
    130167  };
    131168 
     169  //! Generated exception when processing a signal
    132170  class CaughtSignalExc : public PException {
    133171  public:
    134172    explicit CaughtSignalExc(const string& m, int id=0) : PException(m,id) {}
    135173  };
    136 
    137   // Bad file format
    138   class FileFormatExc : public IOExc {
    139   public:
    140     explicit FileFormatExc(const string& m, int id=0) : IOExc(m,id) {}
    141   };
    142  
    143   class SingMatrixExc : public MathExc {
    144   public:
    145     explicit SingMatrixExc(const string& m, int id=0) : MathExc(m,id) {}
    146   };
    147  
    148  
    149 }
     174   
     175} // namespace SOPHYA
    150176
    151177
Note: See TracChangeset for help on using the changeset viewer.