Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor::RangedValue< T > Class Template Reference

A value inside a range. More...

#include <RangedValue.hpp>

Inheritance diagram for castor::RangedValue< T >:
Inheritance graph
[legend]

Public Member Functions

 RangedValue (T const &value, Range< T > const &range) noexcept
 Constructor.
 
RangedValueoperator= (T const &value) noexcept
 Assignment from a value.
 
void updateRange (Range< T > const &range) noexcept
 Redefines the range.
 
float percent () const noexcept
 
T const & value () const noexcept
 
Range< T > const & range () const noexcept
 
Arithmetic operators.
RangedValue< T > & operator+= (RangedValue< T > const &rhs) noexcept
 
RangedValue< T > & operator-= (RangedValue< T > const &rhs) noexcept
 
RangedValue< T > & operator*= (RangedValue< T > const &rhs) noexcept
 
RangedValue< T > & operator/= (RangedValue< T > const &rhs) noexcept
 
RangedValue< T > & operator+= (T const &rhs) noexcept
 
RangedValue< T > & operator-= (T const &rhs) noexcept
 
RangedValue< T > & operator*= (T const &rhs) noexcept
 
RangedValue< T > & operator/= (T const &rhs) noexcept
 

Detailed Description

template<typename T>
class castor::RangedValue< T >

A value inside a range.

Remarks
The value can't get out of its range.

Constructor & Destructor Documentation

◆ RangedValue()

template<typename T >
castor::RangedValue< T >::RangedValue ( T const & value,
Range< T > const & range )
inlinenoexcept

Constructor.

Parameters
[in]valueThe value.
[in]rangeThe range.

References castor::RangedValue< T >::range().

Here is the call graph for this function:

Member Function Documentation

◆ operator*=() [1/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator*= ( RangedValue< T > const & rhs)
inlinenoexcept

◆ operator*=() [2/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator*= ( T const & rhs)
inlinenoexcept

◆ operator+=() [1/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator+= ( RangedValue< T > const & rhs)
inlinenoexcept

◆ operator+=() [2/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator+= ( T const & rhs)
inlinenoexcept

◆ operator-=() [1/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator-= ( RangedValue< T > const & rhs)
inlinenoexcept

◆ operator-=() [2/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator-= ( T const & rhs)
inlinenoexcept

◆ operator/=() [1/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator/= ( RangedValue< T > const & rhs)
inlinenoexcept

◆ operator/=() [2/2]

template<typename T >
RangedValue< T > & castor::RangedValue< T >::operator/= ( T const & rhs)
inlinenoexcept

◆ operator=()

template<typename T >
RangedValue & castor::RangedValue< T >::operator= ( T const & value)
inlinenoexcept

Assignment from a value.

Parameters
[in]valueThe value.

References castor::RangedValue< T >::value().

Here is the call graph for this function:

◆ percent()

template<typename T >
float castor::RangedValue< T >::percent ( ) const
inlinenoexcept
Returns
0.0 if m_value <= m_range.m_min.
1.0 if m_value >= m_range.m_max.
A value from 0.0 to 1.0, depending on how close the value is from m_range.m_min or from m_range.m_max.

◆ range()

template<typename T >
Range< T > const & castor::RangedValue< T >::range ( ) const
inlinenoexcept

◆ updateRange()

template<typename T >
void castor::RangedValue< T >::updateRange ( Range< T > const & range)
inlinenoexcept

Redefines the range.

Parameters
[in]rangeThe range.

References castor::RangedValue< T >::range().

Here is the call graph for this function:

◆ value()

template<typename T >
T const & castor::RangedValue< T >::value ( ) const
inlinenoexcept

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