RANGE< _CT > Class Template Reference

Template for storing numeric range. More...

#include <mi32/range.h>

List of all members.

Public Member Functions

 RANGE (_CT value)
 RANGE (_CT minval, _CT maxval)
 RANGE ()
bool Contains (_CT valuemin, _CT valuemax) const
bool Contains (const RANGE &rhs) const
bool Contains (_CT value) const
void Expand (_CT value)
void Extend (const RANGE &rhs)
void Extend (_CT minval, _CT maxval)
void Extend (_CT value)
_CT GetCenter () const
_CT GetMaximum () const
_CT GetMinimum () const
_CT GetSize () const
void IniRead (INIHANDLE hdl, const char *GroupName, const char *FieldNameMin, const char *FieldNameMax)
void IniWrite (INIHANDLE hdl, const char *GroupName, const char *FieldNameMin, const char *FieldNameMax) const
void Intersect (const RANGE &rhs)
bool IsNonEmpty () const
bool IsValid () const
_CT Limit (_CT value) const
bool operator!= (const RANGE &rhs) const
RANGEoperator= (_CT value)
bool operator== (const RANGE &rhs) const
bool Overlaps (const RANGE &rhs) const
void Set (_CT minval, _CT maxval)
void SetInvalid ()
void SetMaximum (_CT val)
void SetMinimum (_CT val)
void ShiftFast (_CT value)
void Validate ()

Detailed Description

template<class _CT>
class RANGE< _CT >

Template for storing numeric range.

Designed to work with signed integer and floating-point data types, unsigned types are not supported.


Constructor & Destructor Documentation

template<class _CT>
RANGE< _CT >::RANGE (  )  [inline]

Default constructor, initialize to invalid (empty) range.

template<class _CT>
RANGE< _CT >::RANGE ( _CT  minval,
_CT  maxval 
) [inline]

Construct range with specified minimum and maximum values.

template<class _CT>
RANGE< _CT >::RANGE ( _CT  value  )  [inline, explicit]

Construct range to include only specified value.


Member Function Documentation

template<class _CT>
bool RANGE< _CT >::Contains ( _CT  valuemin,
_CT  valuemax 
) const [inline]

Determine if range containes specified range.

Parameters:
valuemin Minimum range value
valuemax Maximum range value
template<class _CT>
bool RANGE< _CT >::Contains ( const RANGE< _CT > &  rhs  )  const [inline]

Determine if range containes specified range.

template<class _CT>
bool RANGE< _CT >::Contains ( _CT  value  )  const [inline]

Determine if range contains specified value.

template<class _CT>
void RANGE< _CT >::Expand ( _CT  value  )  [inline]

Expand range by specified amount.

template<class _CT>
void RANGE< _CT >::Extend ( const RANGE< _CT > &  rhs  )  [inline]

Extend range to include specified range.

template<class _CT>
void RANGE< _CT >::Extend ( _CT  minval,
_CT  maxval 
) [inline]

Extend range to include specified range.

template<class _CT>
void RANGE< _CT >::Extend ( _CT  value  )  [inline]

Extend range to include specified value.

template<class _CT>
_CT RANGE< _CT >::GetCenter (  )  const [inline]

Get center of range.

template<class _CT>
_CT RANGE< _CT >::GetMaximum (  )  const [inline]

Get maximum value in range.

template<class _CT>
_CT RANGE< _CT >::GetMinimum (  )  const [inline]

Get minimum value in range.

template<class _CT>
_CT RANGE< _CT >::GetSize (  )  const [inline]

Get 'size' of range.

template<class _CT>
void RANGE< _CT >::IniRead ( INIHANDLE  hdl,
const char *  GroupName,
const char *  FieldNameMin,
const char *  FieldNameMax 
) [inline]

Read values from INI file.

template<class _CT>
void RANGE< _CT >::IniWrite ( INIHANDLE  hdl,
const char *  GroupName,
const char *  FieldNameMin,
const char *  FieldNameMax 
) const [inline]

Write values to INI file.

template<class _CT>
void RANGE< _CT >::Intersect ( const RANGE< _CT > &  rhs  )  [inline]

Intersect range with another range.

template<class _CT>
bool RANGE< _CT >::IsNonEmpty (  )  const [inline]

Determine if range is non-empty.

template<class _CT>
bool RANGE< _CT >::IsValid (  )  const [inline]

Determine if range is valid.

template<class _CT>
_CT RANGE< _CT >::Limit ( _CT  value  )  const [inline]

Limit the value based on the current range Can be used to replace the bound() macro.

Returns:
Limit'ed value based on the range
template<class _CT>
bool RANGE< _CT >::operator!= ( const RANGE< _CT > &  rhs  )  const [inline]

Inequality operator.

template<class _CT>
RANGE& RANGE< _CT >::operator= ( _CT  value  )  [inline]

Assignment from single value.

template<class _CT>
bool RANGE< _CT >::operator== ( const RANGE< _CT > &  rhs  )  const [inline]

Equality operator.

template<class _CT>
bool RANGE< _CT >::Overlaps ( const RANGE< _CT > &  rhs  )  const [inline]

Determine if range overlaps another range.

template<class _CT>
void RANGE< _CT >::Set ( _CT  minval,
_CT  maxval 
) [inline]

Set minimum and maximum values.

template<class _CT>
void RANGE< _CT >::SetInvalid (  )  [inline]

Set range to be "invalid" (empty).

template<class _CT>
void RANGE< _CT >::SetMaximum ( _CT  val  )  [inline]

Set maximum value.

template<class _CT>
void RANGE< _CT >::SetMinimum ( _CT  val  )  [inline]

Set minimum value.

template<class _CT>
void RANGE< _CT >::ShiftFast ( _CT  value  )  [inline]

Shift by specified value.

Does not perform any validation

template<class _CT>
void RANGE< _CT >::Validate (  )  [inline]

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:45 2012 for TNTsdk 2012 by  doxygen 1.6.1