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 BoundedValue & | operator= (const this_type &other) noexcept |
Assignment operator. More... | |
PLAYRHO_CONSTEXPR BoundedValue & | operator= (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 BoundedValue & | operator= (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
using playrho::BoundedValue< T, lo, hi >::value_type = T |
Value type.
Definition at line 129 of file BoundedValue.hpp.
◆ remove_pointer_type
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
using playrho::BoundedValue< T, lo, hi >::exception_type = InvalidArgument |
Exception type.
Definition at line 135 of file BoundedValue.hpp.
◆ this_type
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]
|
inline |
Initializing constructor.
Definition at line 213 of file BoundedValue.hpp.
◆ BoundedValue() [2/4]
|
inline |
Initializing constructor for implicitly convertible types.
Definition at line 221 of file BoundedValue.hpp.
◆ BoundedValue() [3/4]
|
inlinedefault |
Copy constructor.
◆ BoundedValue() [4/4]
|
inlinenoexcept |
Move constructor.
Definition at line 231 of file BoundedValue.hpp.
◆ ~BoundedValue()
|
defaultnoexcept |
Member Function Documentation
◆ GetLoCheck()
|
inlinestatic |
Gets the lo check.
Definition at line 141 of file BoundedValue.hpp.
◆ GetHiCheck()
|
inlinestatic |
Gets the hi check.
Definition at line 144 of file BoundedValue.hpp.
◆ DoLoCheck()
|
inlinestatic |
Performs the lo check.
Definition at line 147 of file BoundedValue.hpp.
◆ DoHiCheck()
|
inlinestatic |
Performs the hi check.
Definition at line 178 of file BoundedValue.hpp.
◆ operator=() [1/4]
|
inlinenoexcept |
Assignment operator.
Definition at line 242 of file BoundedValue.hpp.
◆ operator=() [2/4]
|
inline |
Assignment operator.
Definition at line 249 of file BoundedValue.hpp.
◆ operator=() [3/4]
|
inline |
Assignment operator for implicitly convertible types.
Definition at line 260 of file BoundedValue.hpp.
◆ operator=() [4/4]
|
inlinenoexcept |
Move assignment operator.
Definition at line 270 of file BoundedValue.hpp.
◆ get()
|
inlinenoexcept |
Gets the underlying value.
Definition at line 279 of file BoundedValue.hpp.
◆ operator value_type()
|
inlinenoexcept |
Gets the underlying value.
Definition at line 285 of file BoundedValue.hpp.
◆ operator->()
|
inline |
Member of pointer operator.
Definition at line 292 of file BoundedValue.hpp.
◆ operator*()
|
inline |
Indirection operator.
Definition at line 300 of file BoundedValue.hpp.
The documentation for this class was generated from the following file:
- Common/BoundedValue.hpp