Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Bounded::Integer< T, MaxVal, MinVal, Boundary > Class Template Reference

#include <boundednumber.h>

List of all members.


Detailed Description

template<class T, LargeInt MaxVal = LargeInt(MAX_UNSIGNED(T)), LargeInt MinVal = 0, class Boundary = Crop<LargeInt>>
class Bounded::Integer< T, MaxVal, MinVal, Boundary >

Bounded number with integral type.

The template can be instantiated for any integral type smaller than or equal to type LargeInt.

An instance of this class or the Float class 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.

Definition at line 65 of file boundednumber.h.

Public Methods

 Integer ()
 Default constructor.

 Integer (value_type val)
 Constructs using specified value.

 Integer (const self &other)
 Copy constructor.

template<class OT, LargeInt OMaxVal, LargeInt OMinVal, class OBoundary>  Integer (const Float< OT, OMaxVal, OMinVal, OBoundary > &other)
 Construct from a Bounded::Float.

void operator= (const LargeInt &val)
 Set to a numeric value; assumes LargeInt is an encompassing type.

self & operator *= (const LargeFloat m)
 Multiplicative scaling.

self operator+ (const self &B) const
 Integer addition.

Magnitude mag () const
 Returns the current numeric value as a fraction of the maximum.

value_type raw () const
 Returns the current numeric value in the native units.


Static Public Attributes

const value_type Min = MinVal
 Minimum legal value.

const value_type Max = MaxVal
 Maximum legal value.


The documentation for this class was generated from the following file:
Generated on Mon Jan 20 02:37:34 2003 for RF-LISSOM by doxygen1.3-rc2