| Last change
 on this file since 3892 was             2803, checked in by ansari, 20 years ago | 
        
          | 
petites corrections/adaptation suite test compil intel icc - Reza 9 Juin 2005
 | 
        
          | File size:
            807 bytes | 
      
      
| Line |  | 
|---|
| 1 | #include <iostream> | 
|---|
| 2 | #include <exception> | 
|---|
| 3 | #include <string> | 
|---|
| 4 | using namespace std; | 
|---|
| 5 |  | 
|---|
| 6 | #define ExcLongMessage(a) BuildFLExcMsg(a,__FILE__,__LINE__) | 
|---|
| 7 |  | 
|---|
| 8 | inline string BuildFLExcMsg(const char * s, const char *file, int line) | 
|---|
| 9 | { | 
|---|
| 10 | char buff[32]; | 
|---|
| 11 | sprintf(buff," Line=%d", line); | 
|---|
| 12 | string rs=s; | 
|---|
| 13 | rs += " File="; rs += file; rs += buff; | 
|---|
| 14 | return(rs); | 
|---|
| 15 | } | 
|---|
| 16 |  | 
|---|
| 17 | class myException  { | 
|---|
| 18 | public: | 
|---|
| 19 | myException(const char * s) {_msg= s;} | 
|---|
| 20 | myException(string const & s) {_msg =s; } | 
|---|
| 21 | //  ~myExecption() {} | 
|---|
| 22 | string Msg() { return _msg; } | 
|---|
| 23 | private: | 
|---|
| 24 | string _msg; | 
|---|
| 25 | }; | 
|---|
| 26 |  | 
|---|
| 27 |  | 
|---|
| 28 | class Toto { | 
|---|
| 29 | public: | 
|---|
| 30 | Toto(int n); | 
|---|
| 31 | virtual ~Toto(); | 
|---|
| 32 | inline double Value(int k) | 
|---|
| 33 | { if ((k<0) || (k>=size) ) | 
|---|
| 34 | throw( myException(ExcLongMessage("Toto::Value()-OutOfBound")) ) ; | 
|---|
| 35 | else return(data[k]); | 
|---|
| 36 | } | 
|---|
| 37 | protected: | 
|---|
| 38 | int size; | 
|---|
| 39 | double * data; | 
|---|
| 40 | }; | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.