playrho::BoundedValue< T, lo, hi > Class Template Reference

Bounded value. More...

#include <BoundedValue.hpp>

Public Types

using value_type = T
 Value type. More...
 
using remove_pointer_type = typename std::remove_pointer< T >::type
 Remove pointer type. More...
 
using exception_type = InvalidArgument
 Exception type. More...
 
using this_type = BoundedValue< value_type, lo, hi >
 This type. More...
 

Public Member Functions

PLAYRHO_CONSTEXPR BoundedValue (value_type value)
 Initializing constructor. More...
 
template<typename U >
PLAYRHO_CONSTEXPR BoundedValue (U value)
 Initializing constructor for implicitly convertible types. More...
 
PLAYRHO_CONSTEXPR BoundedValue (const this_type &value)=default
 Copy constructor. More...
 
PLAYRHO_CONSTEXPR BoundedValue (this_type &&value) noexcept
 Move constructor. More...
 
 ~BoundedValue () noexcept=default
 
PLAYRHO_CONSTEXPR BoundedValueoperator= (const this_type &other) noexcept
 Assignment operator. More...
 
PLAYRHO_CONSTEXPR BoundedValueoperator= (const T &value)
 Assignment operator. More...
 
template<typename U >
PLAYRHO_CONSTEXPR std::enable_if_t< std::is_convertible< U, T >::value, BoundedValue & > operator= (const U &tmpVal)
 Assignment operator for implicitly convertible types. More...
 
PLAYRHO_CONSTEXPR BoundedValueoperator= (this_type &&value) noexcept
 Move assignment operator. More...
 
PLAYRHO_CONSTEXPR value_type get () const noexcept
 Gets the underlying value. More...
 
PLAYRHO_CONSTEXPR operator value_type () const noexcept
 Gets the underlying value. More...
 
template<typename U = T>
PLAYRHO_CONSTEXPR std::enable_if_t< std::is_pointer< U >::value, U > operator-> () const
 Member of pointer operator. More...
 
template<typename U = T>
PLAYRHO_CONSTEXPR std::enable_if_t< std::is_pointer< U >::value, remove_pointer_type > & operator* () const
 Indirection operator. More...
 

Static Public Member Functions

static PLAYRHO_CONSTEXPR LoValueCheck GetLoCheck ()
 Gets the lo check. More...
 
static PLAYRHO_CONSTEXPR HiValueCheck GetHiCheck ()
 Gets the hi check. More...
 
static PLAYRHO_CONSTEXPR void DoLoCheck (value_type value)
 Performs the lo check. More...
 
static PLAYRHO_CONSTEXPR void DoHiCheck (value_type value)
 Performs the hi check. More...
 

Detailed Description

template<typename T, LoValueCheck lo, HiValueCheck hi>
class playrho::BoundedValue< T, lo, hi >

Bounded value.

Note
While this works well enough for use in the PlayRho library, I'm not keen on its current implementation.
Examples
World.cpp.

Definition at line 125 of file BoundedValue.hpp.

Member Typedef Documentation

◆ value_type

template<typename T , LoValueCheck lo, HiValueCheck hi>
using playrho::BoundedValue< T, lo, hi >::value_type = T

Value type.

Definition at line 129 of file BoundedValue.hpp.

◆ remove_pointer_type

template<typename T , LoValueCheck lo, HiValueCheck hi>
using playrho::BoundedValue< T, lo, hi >::remove_pointer_type = typename std::remove_pointer<T>::type

Remove pointer type.

Definition at line 132 of file BoundedValue.hpp.

◆ exception_type

template<typename T , LoValueCheck lo, HiValueCheck hi>
using playrho::BoundedValue< T, lo, hi >::exception_type = InvalidArgument

Exception type.

Definition at line 135 of file BoundedValue.hpp.

◆ this_type

template<typename T , LoValueCheck lo, HiValueCheck hi>
using playrho::BoundedValue< T, lo, hi >::this_type = BoundedValue<value_type, lo, hi>

This type.

Definition at line 138 of file BoundedValue.hpp.

Constructor & Destructor Documentation

◆ BoundedValue() [1/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR playrho::BoundedValue< T, lo, hi >::BoundedValue ( value_type  value)
inline

Initializing constructor.

Definition at line 213 of file BoundedValue.hpp.

◆ BoundedValue() [2/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
template<typename U >
PLAYRHO_CONSTEXPR playrho::BoundedValue< T, lo, hi >::BoundedValue ( value)
inline

Initializing constructor for implicitly convertible types.

Definition at line 221 of file BoundedValue.hpp.

◆ BoundedValue() [3/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR playrho::BoundedValue< T, lo, hi >::BoundedValue ( const this_type value)
inlinedefault

Copy constructor.

◆ BoundedValue() [4/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR playrho::BoundedValue< T, lo, hi >::BoundedValue ( this_type &&  value)
inlinenoexcept

Move constructor.

Definition at line 231 of file BoundedValue.hpp.

◆ ~BoundedValue()

template<typename T , LoValueCheck lo, HiValueCheck hi>
playrho::BoundedValue< T, lo, hi >::~BoundedValue ( )
defaultnoexcept

Member Function Documentation

◆ GetLoCheck()

template<typename T , LoValueCheck lo, HiValueCheck hi>
static PLAYRHO_CONSTEXPR LoValueCheck playrho::BoundedValue< T, lo, hi >::GetLoCheck ( )
inlinestatic

Gets the lo check.

Definition at line 141 of file BoundedValue.hpp.

◆ GetHiCheck()

template<typename T , LoValueCheck lo, HiValueCheck hi>
static PLAYRHO_CONSTEXPR HiValueCheck playrho::BoundedValue< T, lo, hi >::GetHiCheck ( )
inlinestatic

Gets the hi check.

Definition at line 144 of file BoundedValue.hpp.

◆ DoLoCheck()

template<typename T , LoValueCheck lo, HiValueCheck hi>
static PLAYRHO_CONSTEXPR void playrho::BoundedValue< T, lo, hi >::DoLoCheck ( value_type  value)
inlinestatic

Performs the lo check.

Definition at line 147 of file BoundedValue.hpp.

◆ DoHiCheck()

template<typename T , LoValueCheck lo, HiValueCheck hi>
static PLAYRHO_CONSTEXPR void playrho::BoundedValue< T, lo, hi >::DoHiCheck ( value_type  value)
inlinestatic

Performs the hi check.

Definition at line 178 of file BoundedValue.hpp.

◆ operator=() [1/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR BoundedValue& playrho::BoundedValue< T, lo, hi >::operator= ( const this_type other)
inlinenoexcept

Assignment operator.

Definition at line 242 of file BoundedValue.hpp.

◆ operator=() [2/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR BoundedValue& playrho::BoundedValue< T, lo, hi >::operator= ( const T &  value)
inline

Assignment operator.

Definition at line 249 of file BoundedValue.hpp.

◆ operator=() [3/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
template<typename U >
PLAYRHO_CONSTEXPR std::enable_if_t<std::is_convertible<U, T>::value, BoundedValue&> playrho::BoundedValue< T, lo, hi >::operator= ( const U &  tmpVal)
inline

Assignment operator for implicitly convertible types.

Definition at line 260 of file BoundedValue.hpp.

◆ operator=() [4/4]

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR BoundedValue& playrho::BoundedValue< T, lo, hi >::operator= ( this_type &&  value)
inlinenoexcept

Move assignment operator.

Definition at line 270 of file BoundedValue.hpp.

◆ get()

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR value_type playrho::BoundedValue< T, lo, hi >::get ( ) const
inlinenoexcept

Gets the underlying value.

Definition at line 279 of file BoundedValue.hpp.

◆ operator value_type()

template<typename T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR playrho::BoundedValue< T, lo, hi >::operator value_type ( ) const
inlinenoexcept

Gets the underlying value.

Definition at line 285 of file BoundedValue.hpp.

◆ operator->()

template<typename T , LoValueCheck lo, HiValueCheck hi>
template<typename U = T>
PLAYRHO_CONSTEXPR std::enable_if_t<std::is_pointer<U>::value, U> playrho::BoundedValue< T, lo, hi >::operator-> ( ) const
inline

Member of pointer operator.

Definition at line 292 of file BoundedValue.hpp.

◆ operator*()

template<typename T , LoValueCheck lo, HiValueCheck hi>
template<typename U = T>
PLAYRHO_CONSTEXPR std::enable_if_t<std::is_pointer<U>::value, remove_pointer_type>& playrho::BoundedValue< T, lo, hi >::operator* ( ) const
inline

Indirection operator.

Definition at line 300 of file BoundedValue.hpp.


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