TRange< T > Struct Template Reference

Manage a range of numbers between specified limits. More...

#include <Range.h>

Collaboration diagram for TRange< T >:

Classes

class  Iterator
 

Public Member Functions

constexpr TRange ()
 
constexpr TRange (T min, T max)
 
constexpr TRange (T count)
 
bool contains (T value) const
 Determine if range contains a value. More...
 
template<typename Q >
bool contains (const TRange< Q > &value) const
 Determine if range contains another range (subset) More...
 
clip (T value) const
 Clip values to within the range. More...
 
random () const
 Return a random value within the range. More...
 
Iterator begin () const
 
Iterator end () const
 
String toString () const
 
 operator String () const
 

Public Attributes

min {}
 
max {}
 

Detailed Description

template<typename T>
struct TRange< T >

Manage a range of numbers between specified limits.

Values in the range meet the criteria (min <= value <= max)

Constructor & Destructor Documentation

◆ TRange() [1/3]

template<typename T >
constexpr TRange< T >::TRange ( )
inlineconstexpr

◆ TRange() [2/3]

template<typename T >
constexpr TRange< T >::TRange ( min,
max 
)
inlineconstexpr

◆ TRange() [3/3]

template<typename T >
constexpr TRange< T >::TRange ( count)
inlineconstexpr

Member Function Documentation

◆ begin()

template<typename T >
Iterator TRange< T >::begin ( ) const
inline

◆ clip()

template<typename T >
T TRange< T >::clip ( value) const
inline

Clip values to within the range.

◆ contains() [1/2]

template<typename T >
template<typename Q >
bool TRange< T >::contains ( const TRange< Q > &  value) const
inline

Determine if range contains another range (subset)

◆ contains() [2/2]

template<typename T >
bool TRange< T >::contains ( value) const
inline

Determine if range contains a value.

◆ end()

template<typename T >
Iterator TRange< T >::end ( ) const
inline

◆ operator String()

template<typename T >
TRange< T >::operator String ( ) const
inline

◆ random()

template<typename T >
T TRange< T >::random ( ) const
inline

Return a random value within the range.

◆ toString()

template<typename T >
String TRange< T >::toString ( ) const
inline

Member Data Documentation

◆ max

template<typename T >
T TRange< T >::max {}

◆ min

template<typename T >
T TRange< T >::min {}

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