Compounds | |
| struct | Bounded::Crop |
| class | Bounded::Float |
| class | Bounded::Integer |
| struct | Bounded::Wrap |
Typedefs | |
| typedef long | LargeInt |
| Encompassing integral type; the Bounded classes can only accept integral values up to those representable in this type. More... | |
| typedef double | LargeFloat |
| Encompassing floating-point type; the Bounded classes can only accept floating-point values up to those representable in this type. More... | |
| typedef double | Magnitude |
| Generic type for a real-valued magnitude on the scale 0 to 1.0. More... | |
An instance of these classes stores a single number, silently enforcing upper and lower bounds for construction, assignment, and copying from other types. Unlike the implicit aliasing of e.g. a char, the boundaries may be smaller than the maximum representable in that type (although for integers the default range is the full range available) and values outside the range can either be truncated (cropped) at the boundaries, or aliased (wrapped) into the valid range.
A design criterion is that the memory footprint of an instance of each class must be no larger than the size of its underlying type. As a result, no virtual functions can be used, since the size of the virtual function table is quite large compared to the size of e.g. a char. (Inheritance from a base type also seems to increase the class size in GCC, at least for chars, so that too should be avoided.)
|
|
Encompassing floating-point type; the Bounded classes can only accept floating-point values up to those representable in this type.
Definition at line 61 of file boundednumber.h. |
|
|
Encompassing integral type; the Bounded classes can only accept integral values up to those representable in this type.
Definition at line 56 of file boundednumber.h. |
|
|
Generic type for a real-valued magnitude on the scale 0 to 1.0. Larger or smaller values are acceptable (boundaries are not enforced) but are not always meaningful. Definition at line 68 of file boundednumber.h. |
1.2.1 written by Dimitri van Heesch,
© 1997-2000