Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

steamcalculatorexception.h

00001 /* 00002 00003 freesteam - IAPWS-IF97 steam tables library 00004 Copyright (C) 2004-2005 John Pye 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 as published by the Free Software Foundation; either version 2 00009 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 00020 */ 00021 00022 #ifndef STEAMCALCULATOREXCEPTION_H 00023 #define STEAMCALCULATOREXCEPTION_H 00024 00025 #include "common.h" 00026 00027 #ifndef STEAMCALCULATOR_H 00028 class SteamCalculator; 00029 class Boundaries; 00030 class SteamState; 00031 #endif 00032 00033 #include "exception.h" 00034 00035 typedef enum { 00036 STM_UNKNOWN_ERROR = 00037 0, STM_RANGE_OVERALL, STM_BEYOND_SAT_CURVE, STM_NOT_SAT, 00038 REG1_RANGE_T_HIGH, REG1_RANGE_P_LOW, REG3_RANGE_T_LOW_TB, 00039 REG3_RANGE_P_LOW_PB, REG2_RANGE_T_LOW_TS, REG2_RANGE_P_HIGH_PB, 00040 REG2_RANGE_TB_LOW, REG2_RANGE_TB_HIGH, REG2_RANGE_PB_LOW, 00041 REG2_RANGE_PB_HIGH, STM_UNABLE_DET_REGION, STM_SAT_INEXACT, 00042 STM_ILLEGAL_WRAP_REG3_PRES_ERR, STM_PRESSURE_HIGH, 00043 STM_PRESSURE_LOW, STM_TEMPERATURE_HIGH, STM_TEMPERATURE_LOW 00044 } SteamErrorCode; 00045 00046 class SteamCalculatorException:public Exception { 00047 00048 public: 00049 00050 string what(); 00051 SteamErrorCode getType(); 00052 00053 protected: 00054 friend class SteamCalculator; 00055 friend class Boundaries; 00056 friend class SteamState; 00057 00058 SteamCalculatorException(Pressure p = -1.0 * MPa, Temperature T = 00059 -1.0 * Kelvin, SteamErrorCode c = STM_UNKNOWN_ERROR); 00060 00061 private: 00062 00063 SteamErrorCode type; 00064 Pressure p; 00065 Temperature T; 00066 string message; 00067 }; 00068 00069 class SteamAlmostSaturatedException:public Exception { 00070 00071 public: 00072 string what(); 00073 00074 protected: 00075 friend class Boundaries; 00076 SteamAlmostSaturatedException(Pressure p = -1.0 * MPa, Temperature T = -1.0 *Kelvin); 00077 00078 private: 00079 Pressure p; 00080 Temperature T; 00081 }; 00082 00083 class OverPressureException : public Exception { 00084 OverPressureException(string message); 00085 }; 00086 00087 #endif

Generated on Tue Mar 22 19:07:05 2005 for freesteam by doxygen 1.3.8