CoreLinux++  0.4.32
Limits.hpp
1 #if !defined (__LIMITS_HPP)
2 #define __LIMITS_HPP
3 
4 /*
5  CoreLinux++
6  Copyright (C) 1999 CoreLinux Consortium
7 
8  The CoreLinux++ Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12 
13  The CoreLinux++ Library Library is distributed in the hope that it will
14  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public
19  License along with the GNU C Library; see the file COPYING.LIB. If not,
20  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA 02111-1307, USA.
22 */
23 
24 
25 #if !defined IN_COMMON_HPP
26  #error Limits.hpp is included by Common.hpp only.
27 #endif
28 
29 namespace corelinux
30 {
31  DECLARE_CLASS( Limits );
32 
37  class Limits
38  {
39 
40  public:
41  enum CharLimits
42  {
43  CHARBITS = 8,
44  CHARMIN = -128,
45  CHARMAX = 127
46  };
47 
48  enum ByteLimits
49  {
50  BYTEBITS = 8,
51  BYTEMIN = 0,
52  BYTEMAX = 255
53  };
54 
55  enum ShortLimits
56  {
57  SHORTBITS = 16,
58  SHORTMIN = (-32768),
59  SHORTMAX = 32767
60  };
61 
62  enum WordLimits
63  {
64  WORDBITS = 16,
65  WORDMIN = 0,
66  WORDMAX = 65535
67  };
68 
69  enum LongLimits
70  {
71  LONGBITS = 32,
72  LONGMIN = (-2147483647 - 1),
73  LONGMAX = 2147483647
74  };
75 
76  enum DwordLimits
77  {
78  DWORDBITS = 32,
79  DWORDMIN = 0,
80  DWORDMAX = -1 // 4294967295U USE DWORD(DWORDMAX) IN CAST
81  };
82 
83  enum SizeLimits
84  {
85  SIZEBITS = DWORDBITS,
86  SIZEMIN = DWORDMIN,
87  SIZEMAX = DWORDMAX
88  };
89 
90  enum IndexLimits
91  {
92  INDEXBITS = DWORDBITS,
93  INDEXMIN = DWORDMIN,
94  INDEXMAX = DWORDMAX
95  };
96 
97  enum CounterLimits
98  {
99  COUNTERBITS = LONGBITS,
100  COUNTERMIN = LONGMIN,
101  COUNTERMAX = LONGMAX
102  };
103 
104  enum IdLimits
105  {
106  IDBITS = WORDBITS,
107  IDMIN = WORDMIN,
108  IDMAX = WORDMAX
109  };
110 
111  // *******************************************
112  // Real Limits
113  // *******************************************
114 
115  static Word RealBits;
116  static Word RealPrecision;
117  static Real RealMin;
118  static Real RealMax;
119 
120  // *******************************************
121  // Smallest number such that 1.0 + RealEpsilon != 1.0
122  // *******************************************
123 
124  static Real RealEpsilon;
125  };
126 
127 }
128 
129 #endif // !defined HEADER_HPP
130 
131 /*
132  Common rcs information do not modify
133  $Author: prudhomm $
134  $Revision: 1.1 $
135  $Date: 2000/04/23 20:43:13 $
136  $Locker: $
137 */
138 
Limits is to provide information regarding CoreLinux++ scalar types.
Definition: Limits.hpp:37
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium