00001 #if !defined (__LIMITS_HPP)
00002 #define __LIMITS_HPP
00003
00004 /*
00005 CoreLinux++
00006 Copyright (C) 1999 CoreLinux Consortium
00007
00008 The CoreLinux++ Library is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU Library General Public License as
00010 published by the Free Software Foundation; either version 2 of the
00011 License, or (at your option) any later version.
00012
00013 The CoreLinux++ Library Library is distributed in the hope that it will
00014 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016 Library General Public License for more details.
00017
00018 You should have received a copy of the GNU Library General Public
00019 License along with the GNU C Library; see the file COPYING.LIB. If not,
00020 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021 Boston, MA 02111-1307, USA.
00022 */
00023
00024
00025 #if !defined IN_COMMON_HPP
00026 #error Limits.hpp is included by Common.hpp only.
00027 #endif
00028
00029 namespace corelinux
00030 {
00031 DECLARE_CLASS( Limits );
00032
00037 class Limits
00038 {
00039
00040 public:
00041 enum CharLimits
00042 {
00043 CHARBITS = 8,
00044 CHARMIN = -128,
00045 CHARMAX = 127
00046 };
00047
00048 enum ByteLimits
00049 {
00050 BYTEBITS = 8,
00051 BYTEMIN = 0,
00052 BYTEMAX = 255
00053 };
00054
00055 enum ShortLimits
00056 {
00057 SHORTBITS = 16,
00058 SHORTMIN = (-32768),
00059 SHORTMAX = 32767
00060 };
00061
00062 enum WordLimits
00063 {
00064 WORDBITS = 16,
00065 WORDMIN = 0,
00066 WORDMAX = 65535
00067 };
00068
00069 enum LongLimits
00070 {
00071 LONGBITS = 32,
00072 LONGMIN = (-2147483647 - 1),
00073 LONGMAX = 2147483647
00074 };
00075
00076 enum DwordLimits
00077 {
00078 DWORDBITS = 32,
00079 DWORDMIN = 0,
00080 DWORDMAX = -1 // 4294967295U USE DWORD(DWORDMAX) IN CAST
00081 };
00082
00083 enum SizeLimits
00084 {
00085 SIZEBITS = DWORDBITS,
00086 SIZEMIN = DWORDMIN,
00087 SIZEMAX = DWORDMAX
00088 };
00089
00090 enum IndexLimits
00091 {
00092 INDEXBITS = DWORDBITS,
00093 INDEXMIN = DWORDMIN,
00094 INDEXMAX = DWORDMAX
00095 };
00096
00097 enum CounterLimits
00098 {
00099 COUNTERBITS = LONGBITS,
00100 COUNTERMIN = LONGMIN,
00101 COUNTERMAX = LONGMAX
00102 };
00103
00104 enum IdLimits
00105 {
00106 IDBITS = WORDBITS,
00107 IDMIN = WORDMIN,
00108 IDMAX = WORDMAX
00109 };
00110
00111 // *******************************************
00112 // Real Limits
00113 // *******************************************
00114
00115 static Word RealBits;
00116 static Word RealPrecision;
00117 static Real RealMin;
00118 static Real RealMax;
00119
00120 // *******************************************
00121 // Smallest number such that 1.0 + RealEpsilon != 1.0
00122 // *******************************************
00123
00124 static Real RealEpsilon;
00125 };
00126
00127 }
00128
00129 #endif // !defined HEADER_HPP
00130
00131 /*
00132 Common rcs information do not modify
00133 $Author: prudhomm $
00134 $Revision: 1.1 $
00135 $Date: 2000/04/23 20:43:13 $
00136 $Locker: $
00137 */
00138