Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Base.h

Go to the documentation of this file.
00001 
00002 //
00003 //      Title     : Base.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: Acts as the base class for all other OSCAR classes.
00028 //
00029 //----------------------------------------------------------------------------
00030 //
00031 //      $Revisions$
00032 //
00033 //      $Log: Base.h,v $
00034 //      Revision 1.15  2005/03/14 21:50:05  pmarch
00035 //      Added to namespace OSCAR and removed "RR" from front of class names.
00036 //
00037 //      Revision 1.14  2005/01/06 22:43:00  chetan
00038 //      Added TLS
00039 //
00040 //      Revision 1.13  2005/01/06 17:22:06  chetan
00041 //      Added documentation for ToDo related to thread safety
00042 //
00043 //      Revision 1.12  2004/11/15 21:49:45  chetan
00044 //      removed const qualified from OSCARError argument in constructor
00045 //
00046 //      Revision 1.11  2004/07/30 18:45:17  chetan
00047 //      Getting rid of warnings (level 4) in VC++ 6.0
00048 //
00049 //      Revision 1.10  2004/07/19 16:32:57  edjung
00050 //      -made fix to constructors for ANSI C++ compliance with temporary OSCARError objects
00051 //      -added DUMMY_ERROR class
00052 //
00053 //      Revision 1.9  2004/06/04 16:04:23  chetan
00054 //      Removed #include Commdefs.h
00055 //
00056 //      Revision 1.8  2004/06/01 18:15:13  pmarch
00057 //      Added std:: in front of input/output objects.
00058 //
00059 //      Revision 1.7  2004/05/26 19:37:17  pmarch
00060 //      Added /defgroup and /ingroup tags
00061 //
00062 //      Revision 1.6  2003/10/07 01:42:39  ndesai
00063 //      no message
00064 //
00065 //      Revision 1.5  2003/10/07 01:41:32  ndesai
00066 //      sadfgsadfgdafsg
00067 //
00068 //      Revision 1.4  2003/09/19 03:44:21  edjung
00069 //      -Changed Base constructor to const RROSCAR& err
00070 //      for .Net
00071 //
00072 //      Revision 1.3  2003/09/05 15:36:20  eswint
00073 //      - Changed default arguments OSCARError(0,"No Error"...) to OSCARError(noError) and String(" ") to String("")
00074 //      - Commented, format
00075 //
00076 //      Revision 1.2  2003/09/05 13:37:17  eswint
00077 //      - Changed default parameters OSCARError(0,"No Error"...) to OSCARError(noError) and String(" ") to String("")
00078 //
00079 //      Revision 1.1  2003/08/14 16:20:25  pmarch
00080 //      Added files to module
00081 //
00082 //
00084 #ifndef Base_hpp
00085 #define Base_hpp
00086 
00087 #include "BaseError.h"
00088 #include "CommIncludes.h"
00089 #include "Console.h"
00090 #include "OSCARError.h"
00091 #include "String.h"
00092 
00094 namespace OSCAR {
00095 
00105   class Base
00106   {
00107   public:
00108   
00118     Base(const String& name = String(), OSCARError &err = DUMMY_ERROR(noError));
00119   
00126     //Base(const String& name = String());
00127   
00135     Base(const Base& rhs);
00136   
00142     virtual ~Base();
00143   
00151     virtual Base& operator=(const Base& rhs);
00152   
00160     virtual const String& GetName() const;
00161   
00169     virtual void SetName(const String& name);
00170   
00184     virtual const OSCARError&   GetError() const;
00185   
00193     virtual void ClearError() const;
00194   
00208     static bool EnableErrorLogging(const String& errLogFileName = String("OSCARErrorLog.txt"));
00209   
00220     static bool DisableErrorLogging();
00221   
00222   protected:
00223   
00224     String name; //name of the Base Object     
00225   
00226     mutable OSCARError error;  //This is declared mutable because a change to error should
00227     //not be considered as a change to the object. This will allow
00228     //const methods that set the error code, to still be declared constant.
00229   
00240     virtual void setError(const OSCARError& err) const;
00241   
00242     static TLS std::ofstream errLogStream;  //output stream for logging errors
00243   
00244     static TLS bool errLogging;  //this variable determines whether errors are to be logged or not
00245   
00246   
00247   };  //End of Base definition
00248 
00249   #include "Base.ipp"
00250 }
00251 #endif //end of #ifndef "Base_hpp"
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations