00001 #ifndef gMATH_X_H 00002 #define gMATH_X_H 00003 00004 #include "gstorage.h" 00005 //////////////////////////////////////////////////////////// 00006 // CLASS gIntDegree - abstract 00007 //////////////////////////////////////////////////////////// 00008 class gIntDegree : public gInt { 00009 public: 00010 virtual ~gIntDegree () ; 00011 00012 // Public members 00013 float rValue; 00014 00015 // Get methods 00016 int NearestInt (float aValue) ; 00017 00018 // Set methods 00019 virtual int Convert () = 0; //PURE 00020 00021 // Operators,etc 00022 gIntDegree (gIntDegree& copy) ; 00023 gIntDegree& operator= (gIntDegree& copy) ; 00024 00025 protected: 00026 gIntDegree (int d) ; 00027 }; 00028 //////////////////////////////////////////////////////////// 00029 // CLASS gDegreeCelsius, etc 00030 //////////////////////////////////////////////////////////// 00031 class gDegreeCelsius : public gIntDegree { 00032 public: 00033 gDegreeCelsius (int d=0) ; 00034 virtual ~gDegreeCelsius () ; 00035 00036 virtual int Convert () { 00037 return ConvertToFahrenheit( GetInt() ); 00038 } 00039 00040 virtual int ConvertToFahrenheit (int d) ; 00041 00042 private: 00043 // Operators,empty 00044 gDegreeCelsius (gDegreeCelsius& ) ; //empty 00045 gDegreeCelsius& operator= (gDegreeCelsius& ) ; //empty 00046 }; 00047 00048 class gDegreeFh : public gIntDegree { 00049 public: 00050 gDegreeFh (int d=0) ; 00051 virtual ~gDegreeFh () ; 00052 00053 virtual int Convert () { 00054 return ConvertToCelsius( GetInt() ); 00055 } 00056 00057 virtual int ConvertToCelsius (int d) ; 00058 00059 private: 00060 // Operators,empty 00061 gDegreeFh (gDegreeFh& ) ; //empty 00062 gDegreeFh& operator= (gDegreeFh& ) ; //empty 00063 }; 00064 //////////////////////////////////////////////////////////// 00065 class gRandom : public gInt { 00066 public: 00067 gRandom (unsigned uVal=0) ; 00068 virtual ~gRandom () ; 00069 00070 virtual void Reset () ; 00071 00072 virtual void SetSeed (unsigned uVal) ; 00073 virtual void GarbleSeed (unsigned uVal=0) ; 00074 00075 protected: 00076 unsigned uRange; 00077 00078 unsigned thisGetRandom (unsigned uVal) ; 00079 00080 private: 00081 // Operators,empty 00082 gRandom (gRandom& ) ; //empty 00083 gRandom& operator= (gRandom& ) ; //empty 00084 }; 00085 //////////////////////////////////////////////////////////// 00086 #endif //gMATH_X_H 00087