# Frost::s_uint_t< T > Class Template Reference

Base type : unsigned integer. More...

`#include <frost_utils_uint.h>`

List of all members.

## Public Types

enum | Type { INTEGER, INTEGER_INF, INTEGER_NAN }

## Public Member Functions

| s_uint_t ()
| s_uint_t (const T &uiValue)
| s_uint_t (const Type &mType)
| s_uint_t (const float &fValue)
| s_uint_t (const double &dValue)
template<class N >
| s_uint_t (const s_uint_t< N > &uiValue)
template<class N >
| s_uint_t (const s_int_t< N > &iValue)
template<class N >
| s_uint_t (const s_float_t< N > &fValue)
| s_uint_t (const s_bool &bValue)
template<class N >
| s_uint_t (const s_str_t< N > &sValue)
const T & | Get () const
| Returns a const reference to the uint.
T & | GetR ()
| Returns a reference to the uint.
void | Clamp (const s_uint_t &uiMin, const s_uint_t &uiMax)
| Adjusts this uint's value to be contained into the provided interval.
s_uint_t | GetNearestPowerOfTwo () const
| Returns the power of two just above the value (or equal).
Type | GetType () const
| Returns the type of this uint.
s_bool | IsInfinite () const
| Checks if this uint is infinite.
s_bool | IsInRange (const s_uint_t< T > &uiMin, const s_uint_t< T > &uiMax) const
| Checks if this uint is contained into the provided range.
s_bool | IsNaN () const
| Checks if this uint is a Not a Number (NaN).
s_bool | IsNull () const
| Checks if this uint equals zero.
s_bool | IsValid () const
| Checks if this uint is a valid number.
void | Pow (const s_uint_t &uiPower)
| Elevates this uint to a certain power (this^n).
void | Randomize (const s_uint_t &uiMin=0u, const s_uint_t &uiMax=1u)
| Sets the value of the uint to a random number.
void | SetInfinite ()
| Sets this uint to infinite.
void | SetNaN ()
| Set this uint to Not a Number state.
s_int_t< typename TypeTraits < T >::SignedType > | operator- () const
s_uint_t & | operator++ ()
s_uint_t | operator++ (int)
s_uint_t & | operator-- ()
s_uint_t | operator-- (int)
s_uint_t | operator+ (const s_uint_t &uiValue) const
s_uint_t | operator- (const s_uint_t &uiValue) const
s_uint_t | operator* (const s_uint_t &uiValue) const
s_uint_t | operator/ (const s_uint_t &uiValue) const
s_uint_t | operator% (const s_uint_t &uiValue) const
void | operator+= (const s_uint_t &uiValue)
void | operator-= (const s_uint_t &uiValue)
void | operator*= (const s_uint_t &uiValue)
void | operator/= (const s_uint_t &uiValue)
void | operator%= (const s_uint_t &uiValue)
s_uint_t & | operator<< (const s_uint_t &uiValue)
s_bool | operator== (const s_uint_t &uiValue) const
s_bool | operator!= (const s_uint_t &uiValue) const
s_bool | operator< (const s_uint_t &uiValue) const
s_bool | operator> (const s_uint_t &uiValue) const
s_bool | operator<= (const s_uint_t &uiValue) const
s_bool | operator>= (const s_uint_t &uiValue) const

## Static Public Member Functions

static s_uint_t | Min (const s_uint_t &uiLeft, const s_uint_t &uiRight)
| Returns the lowest value of the two provided ones.
static s_uint_t | Max (const s_uint_t &uiLeft, const s_uint_t &uiRight)
| Returns the highest value of the two provided ones.
static s_uint_t | Clamp (const s_uint_t &uiValue, const s_uint_t &uiMin, const s_uint_t &uiMax)
| Clamps the provided value into the provided interval.
static s_uint_t | Random (const s_uint_t &uiMin=0u, const s_uint_t &uiMax=1u)
| Returns a random uint in the provided range.

## Static Public Attributes

static const s_uint_t | NaN = s_uint_t<T>(INTEGER_NAN)
static const s_uint_t | INF = s_uint_t<T>(INTEGER_INF)

## Private Attributes

T | uiValue_
Type | mType_

## Detailed Description

### template<class T>
class Frost::s_uint_t< T >

Base type : unsigned integer.

Frost's base types are made to allow simpler manipulation of numbers, booleans and strings. They simplify conversions (mostly to string), allow easy access to math/string functions and implements new functions that are not present in the standard libraries.
Note : Most of Frost's base types are slower than C++ base types. The difference is negligible for small operations, but if you need to do a lot of calculations (matrices, ...) it can bloat your performances. Use prebuilt types in this case. Note : This class is about 60 times slower than the wrapped POD (20 times in debug, without any compiler optimizations).

Definition at line 22 of file frost_utils_uint.h.

## Member Enumeration Documentation

template<class T>

enum Frost::s_uint_t::Type

Enumerator:

  INTEGER |
  INTEGER_INF |
  INTEGER_NAN |

Definition at line 26 of file frost_utils_uint.h.

## Constructor & Destructor Documentation

template<class T >

Frost::s_uint_t< T >::s_uint_t | ( |  | ) | `[inline]`

Definition at line 8 of file frost_utils_uint_impl.cpp.

template<class T>

Frost::s_uint_t< T >::s_uint_t | ( | const T & | uiValue | ) | `[inline]`

Definition at line 15 of file frost_utils_uint_impl.cpp.

template<class T>

Frost::s_uint_t< T >::s_uint_t | ( | const Type & | mType | ) | `[inline, explicit]`

Definition at line 22 of file frost_utils_uint_impl.cpp.

template<class T>

Frost::s_uint_t< T >::s_uint_t | ( | const float & | fValue | ) | `[inline, explicit]`

Definition at line 29 of file frost_utils_uint_impl.cpp.

template<class T>

Frost::s_uint_t< T >::s_uint_t | ( | const double & | dValue | ) | `[inline, explicit]`

Definition at line 36 of file frost_utils_uint_impl.cpp.

template<class T>
template<class N >

Frost::s_uint_t< T >::s_uint_t | ( | const s_uint_t< N > & | uiValue | ) | `[inline, explicit]`

Definition at line 44 of file frost_utils_uint.h.

template<class T>
template<class N >

Frost::s_uint_t< T >::s_uint_t | ( | const s_int_t< N > & | iValue | ) | `[inline, explicit]`

Definition at line 51 of file frost_utils_uint.h.

template<class T>
template<class N >

Frost::s_uint_t< T >::s_uint_t | ( | const s_float_t< N > & | fValue | ) | `[inline, explicit]`

Definition at line 71 of file frost_utils_uint.h.

template<class T>

Frost::s_uint_t< T >::s_uint_t | ( | const s_bool & | bValue | ) | `[inline, explicit]`

Definition at line 43 of file frost_utils_uint_impl.cpp.

template<class T>
template<class N >

Frost::s_uint_t< T >::s_uint_t | ( | const s_str_t< N > & | sValue | ) | `[inline, explicit]`

Definition at line 93 of file frost_utils_uint.h.

## Member Function Documentation

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::Clamp | ( | const s_uint_t< T > & | uiValue,
|  | const s_uint_t< T > & | uiMin,
|  | const s_uint_t< T > & | uiMax |
| ) |  |  | `[inline, static]`

Clamps the provided value into the provided interval.

Parameters:

  | uiValue | The value to clamp
  | uiMin | The minimum value
  | uiMax | The maximum value

Returns:
  The clamped value

Definition at line 470 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::Clamp | ( | const s_uint_t< T > & | uiMin,
|  | const s_uint_t< T > & | uiMax |
| ) |  |  | `[inline]`

Adjusts this uint's value to be contained into the provided interval.

Parameters:

  | uiMin | The minimum value
  | uiMax | The maximum value

Definition at line 53 of file frost_utils_uint_impl.cpp.

template<class T>

const T& Frost::s_uint_t< T >::Get | ( |  | ) | const`[inline]`

Returns a const reference to the uint.

Returns:
  A const reference to the uint

Definition at line 112 of file frost_utils_uint.h.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::GetNearestPowerOfTwo | ( |  | ) | const`[inline]`

Returns the power of two just above the value (or equal).

Returns:
  The associated power of two (2^n) (superior of equal)

Definition at line 59 of file frost_utils_uint_impl.cpp.

template<class T>

T& Frost::s_uint_t< T >::GetR | ( |  | ) | `[inline]`

Returns a reference to the uint.

Returns:
  A reference to the uint

Definition at line 117 of file frost_utils_uint.h.

template<class T >

s_uint_t< T >::Type Frost::s_uint_t< T >::GetType | ( |  | ) | const`[inline]`

Returns the type of this uint.

Returns:
  The type of this uint (infinite, NaN, ...)

Definition at line 76 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::IsInfinite | ( |  | ) | const`[inline]`

Checks if this uint is infinite.

Returns:
  'true' if this uint is infinite

Definition at line 82 of file frost_utils_uint_impl.cpp.

template<class T>

s_bool Frost::s_uint_t< T >::IsInRange | ( | const s_uint_t< T > & | uiMin,
|  | const s_uint_t< T > & | uiMax |
| ) |  |  | const`[inline]`

Checks if this uint is contained into the provided range.

Definition at line 88 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::IsNaN | ( |  | ) | const`[inline]`

Checks if this uint is a Not a Number (NaN).

Returns:
  'true' if this uint is NaN

Definition at line 94 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::IsNull | ( |  | ) | const`[inline]`

Checks if this uint equals zero.

Returns:
  'true' if this uint equals zero

Definition at line 100 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::IsValid | ( |  | ) | const`[inline]`

Checks if this uint is a valid number.

Returns:
  'true' if this uint is not infinite and a number

Definition at line 106 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::Max | ( | const s_uint_t< T > & | uiLeft,
|  | const s_uint_t< T > & | uiRight |
| ) |  |  | `[inline, static]`

Returns the highest value of the two provided ones.

Parameters:

  | uiLeft | The first value
  | uiRight | The second value

Returns:
  The highest value of the two provided ones

Definition at line 464 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::Min | ( | const s_uint_t< T > & | uiLeft,
|  | const s_uint_t< T > & | uiRight |
| ) |  |  | `[inline, static]`

Returns the lowest value of the two provided ones.

Parameters:

  | uiLeft | The first value
  | uiRight | The second value

Returns:
  The lowest value of the two provided ones

Definition at line 458 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::operator!= | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 364 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::operator% | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 287 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::operator%= | ( | const s_uint_t< T > & | uiValue | ) | `[inline]`

Definition at line 334 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::operator* | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 238 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::operator*= | ( | const s_uint_t< T > & | uiValue | ) | `[inline]`

Definition at line 322 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::operator+ | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 210 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::operator++ | ( | int |  | ) | `[inline]`

Definition at line 164 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > & Frost::s_uint_t< T >::operator++ | ( |  | ) | `[inline]`

Definition at line 154 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::operator+= | ( | const s_uint_t< T > & | uiValue | ) | `[inline]`

Definition at line 310 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::operator- | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 224 of file frost_utils_uint_impl.cpp.

template<class T >

s_int_t< typename TypeTraits< T >::SignedType > Frost::s_uint_t< T >::operator- | ( |  | ) | const`[inline]`

Definition at line 175 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::operator-- | ( | int |  | ) | `[inline]`

Definition at line 199 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > & Frost::s_uint_t< T >::operator-- | ( |  | ) | `[inline]`

Definition at line 189 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::operator-= | ( | const s_uint_t< T > & | uiValue | ) | `[inline]`

Definition at line 316 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::operator/ | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 264 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::operator/= | ( | const s_uint_t< T > & | uiValue | ) | `[inline]`

Definition at line 328 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::operator< | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 378 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > & Frost::s_uint_t< T >::operator<< | ( | const s_uint_t< T > & | uiValue | ) | `[inline]`

Definition at line 340 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::operator<= | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 418 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::operator== | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 350 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::operator> | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 398 of file frost_utils_uint_impl.cpp.

template<class T >

s_bool Frost::s_uint_t< T >::operator>= | ( | const s_uint_t< T > & | uiValue | ) | const`[inline]`

Definition at line 438 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::Pow | ( | const s_uint_t< T > & | uiPower | ) | `[inline]`

Elevates this uint to a certain power (this^n).

Parameters:

  | uiPower | The power...

Definition at line 112 of file frost_utils_uint_impl.cpp.

template<class T >

s_uint_t< T > Frost::s_uint_t< T >::Random | ( | const s_uint_t< T > & | uiMin = `0u`,
|  | const s_uint_t< T > & | uiMax = `1u` |
| ) |  |  | `[inline, static]`

Returns a random uint in the provided range.

Parameters:

  | uiMin | The lower bound (minimum)
  | uiMax | The upper bound (maximum)

Returns:
  A random uint in the provided range

Definition at line 476 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::Randomize | ( | const s_uint_t< T > & | uiMin = `0u`,
|  | const s_uint_t< T > & | uiMax = `1u` |
| ) |  |  | `[inline]`

Sets the value of the uint to a random number.

Parameters:

  | uiMin | The lower bound (minimum)
  | uiMax | The upper bound (maximum)

Definition at line 124 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::SetInfinite | ( |  | ) | `[inline]`

Sets this uint to infinite.

Definition at line 140 of file frost_utils_uint_impl.cpp.

template<class T >

void Frost::s_uint_t< T >::SetNaN | ( |  | ) | `[inline]`

Set this uint to Not a Number state.

Definition at line 147 of file frost_utils_uint_impl.cpp.

## Member Data Documentation

template<class T>

const s_uint_t< T > Frost::s_uint_t< T >::INF = s_uint_t<T>(INTEGER_INF)`[inline, static]`

Definition at line 204 of file frost_utils_uint.h.

template<class T>

Type Frost::s_uint_t< T >::mType_`[private]`

Definition at line 239 of file frost_utils_uint.h.

template<class T>

const s_uint_t< T > Frost::s_uint_t< T >::NaN = s_uint_t<T>(INTEGER_NAN)`[inline, static]`

Definition at line 203 of file frost_utils_uint.h.

template<class T>

T Frost::s_uint_t< T >::uiValue_`[private]`

Definition at line 237 of file frost_utils_uint.h.

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

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_uint.h
- D:/Programmation/Sources/Tensor2/Utils/src/frost_utils_uint_impl.cpp