00001 00002 // 00003 // Title : OSCARError.h 00004 // Project : OSCAR Version 2.0 00005 // Created : 00006 // Author : Chetan Kapoor 00007 // Platforms : All 00008 // Copyright : Copyright© The University of Texas at Austin, 2002. All rights reserved. 00009 // 00010 // This software and documentation constitute an unpublished work 00011 // and contain valuable trade secrets and proprietary information 00012 // belonging to the University. None of the foregoing material may be 00013 // copied or duplicated or disclosed without the express, written 00014 // permission of University. THE UNIVERSITY EXPRESSLY DISCLAIMS ANY 00015 // AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION, 00016 // INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 00017 // PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY 00018 // THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE. 00019 // NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF 00020 // THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall the 00021 // University be liable for incidental, special, indirect, direct or 00022 // consequential damages or loss of profits, interruption of business, 00023 // or related expenses which may arise from use of software or documentation, 00024 // including but not limited to those resulting from defects in software 00025 // and/or documentation, or loss or inaccuracy of data of any kind. 00026 // 00027 // Purpose : Assists in error reporting. OSCARError objects contain specific 00028 // information about the error state of each object in OSCAR. Each 00029 // OSCARError object consists of an integer value that can uniquely 00030 // define the error, and a string description of the error. 00031 // 00032 //------------------------------------------------------------------------------ 00033 // 00034 // $Revisions$ 00035 // 00036 // 3/23/01 - Modified OSCARError to a class that contains string 00037 // descriptions of the errors 00038 // $Log: OSCARError.h,v $ 00039 // Revision 1.8 2005/03/14 21:50:07 pmarch 00040 // Added to namespace OSCAR and removed "RR" from front of class names. 00041 // 00042 // Revision 1.7 2004/07/30 18:45:18 chetan 00043 // Getting rid of warnings (level 4) in VC++ 6.0 00044 // 00045 // Revision 1.6 2004/07/19 16:32:59 edjung 00046 // -made fix to constructors for ANSI C++ compliance with temporary OSCARError objects 00047 // -added DUMMY_ERROR class 00048 // 00049 // Revision 1.5 2004/06/04 16:04:38 chetan 00050 // Removed #include Commdefs.h 00051 // 00052 // Revision 1.4 2004/06/01 18:15:11 pmarch 00053 // Added std:: in front of input/output objects. 00054 // 00055 // Revision 1.3 2004/05/26 19:37:16 pmarch 00056 // Added /defgroup and /ingroup tags 00057 // 00058 // Revision 1.2 2003/09/05 15:36:16 eswint 00059 // - Changed default arguments OSCARError(0,"No Error"...) to OSCARError(noError) and String(" ") to String("") 00060 // - Commented, format 00061 // 00062 // Revision 1.1 2003/08/14 16:20:20 pmarch 00063 // Added files to module 00064 // 00065 // 00067 #ifndef OSCARError_hpp 00068 #define OSCARError_hpp 00069 00070 #include "CommIncludes.h" 00071 #include "String.h" 00072 00074 namespace OSCAR { 00075 00086 class OSCARError 00087 { 00088 public: 00089 00103 OSCARError(int errorCode, const String& basicDescription, const String& customDescription = String()); 00104 00112 OSCARError(const OSCARError& rhs); 00113 00119 virtual ~OSCARError(); 00120 00128 OSCARError& operator=(const OSCARError& rhs); 00129 00137 void SetErrorCode(int errorCode); 00138 00146 void SetBasicDescription(const String& basicDesc); 00147 00159 void SetCustomDescription(const String& customDesc); 00160 00168 int GetErrorCode() const; 00169 00177 const String& GetBasicDescription() const; 00178 00186 const String& GetCustomDescription() const; 00187 00198 operator int() const; 00199 00209 bool operator==(const OSCARError& err) const; 00210 00220 bool operator!=(const OSCARError& err) const; 00221 00222 protected: 00223 00224 int errorCode; //Uniquely defines the error. 00225 00226 String basicDescription; //Basic error description defined with all static OSCARErrors 00227 00228 String customDescription; //Customized error description supplied by programmer 00229 00230 }; //end of OSCARError definition 00231 00241 extern std::ostream& operator<<(std::ostream& strm, const OSCARError& err); 00242 00253 extern OSCARError operator+(const OSCARError& e1, const OSCARError& e2); 00254 00255 #include "OSCARError.ipp" 00256 } 00257 #endif //end of #ifndef OSCARError_hpp
| RRG Homepage | OSCAR Overview | OSCAR Tutorials | Simulations |