Template for storing numeric range. More...
#include <mi32/range.h>
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 |
| RANGE & | operator= (_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 () |
Template for storing numeric range.
Designed to work with signed integer and floating-point data types, unsigned types are not supported.
Default constructor, initialize to invalid (empty) range.
Construct range with specified minimum and maximum values.
Construct range to include only specified value.
| bool RANGE< _CT >::Contains | ( | _CT | valuemin, | |
| _CT | valuemax | |||
| ) | const [inline] |
Determine if range containes specified range.
| valuemin | Minimum range value | |
| valuemax | Maximum range value |
Determine if range containes specified range.
| bool RANGE< _CT >::Contains | ( | _CT | value | ) | const [inline] |
Determine if range contains specified value.
| void RANGE< _CT >::Expand | ( | _CT | value | ) | [inline] |
Expand range by specified amount.
Extend range to include specified range.
| void RANGE< _CT >::Extend | ( | _CT | minval, | |
| _CT | maxval | |||
| ) | [inline] |
Extend range to include specified range.
| void RANGE< _CT >::Extend | ( | _CT | value | ) | [inline] |
Extend range to include specified value.
| _CT RANGE< _CT >::GetCenter | ( | ) | const [inline] |
Get center of range.
| _CT RANGE< _CT >::GetMaximum | ( | ) | const [inline] |
Get maximum value in range.
| _CT RANGE< _CT >::GetMinimum | ( | ) | const [inline] |
Get minimum value in range.
| _CT RANGE< _CT >::GetSize | ( | ) | const [inline] |
Get 'size' of range.
| void RANGE< _CT >::IniRead | ( | INIHANDLE | hdl, | |
| const char * | GroupName, | |||
| const char * | FieldNameMin, | |||
| const char * | FieldNameMax | |||
| ) | [inline] |
Read values from INI file.
| void RANGE< _CT >::IniWrite | ( | INIHANDLE | hdl, | |
| const char * | GroupName, | |||
| const char * | FieldNameMin, | |||
| const char * | FieldNameMax | |||
| ) | const [inline] |
Write values to INI file.
Intersect range with another range.
| bool RANGE< _CT >::IsNonEmpty | ( | ) | const [inline] |
Determine if range is non-empty.
| bool RANGE< _CT >::IsValid | ( | ) | const [inline] |
Determine if range is valid.
| _CT RANGE< _CT >::Limit | ( | _CT | value | ) | const [inline] |
Limit the value based on the current range Can be used to replace the bound() macro.
Inequality operator.
Assignment from single value.
Equality operator.
Determine if range overlaps another range.
| void RANGE< _CT >::Set | ( | _CT | minval, | |
| _CT | maxval | |||
| ) | [inline] |
Set minimum and maximum values.
| void RANGE< _CT >::SetInvalid | ( | ) | [inline] |
Set range to be "invalid" (empty).
| void RANGE< _CT >::SetMaximum | ( | _CT | val | ) | [inline] |
Set maximum value.
| void RANGE< _CT >::SetMinimum | ( | _CT | val | ) | [inline] |
Set minimum value.
| void RANGE< _CT >::ShiftFast | ( | _CT | value | ) | [inline] |
Shift by specified value.
Does not perform any validation
| void RANGE< _CT >::Validate | ( | ) | [inline] |
1.6.1