Container for range definitions. More...
#include <cvb/value_range.hpp>
Public Member Functions | |
ValueRange () noexcept=default | |
Creates a default value range e.g. from 0 to 0. More... | |
ValueRange (T min, T max) | |
Initializes a ValueRange object. More... | |
T | Min () const noexcept |
Gets the minimum value. More... | |
void | SetMin (T min) |
Sets the minimum value. More... | |
T | Max () const noexcept |
Gets the maximum value. More... | |
void | SetMax (T max) |
Sets the maximum value. More... | |
bool | Contains (T value) const noexcept |
Checks if a value is within the range. More... | |
bool | IntersectsWith (ValueRange< T > other) const noexcept |
Checks if this value range intersects with another value range. More... | |
bool | operator== (const ValueRange< T > &valueRange) const noexcept |
Compares to an other value range. More... | |
bool | operator!= (const ValueRange< T > &valueRange) const noexcept |
Compares to an other value range. More... | |
template<class C > | |
operator ValueRange< C > () const noexcept | |
Enable casting. | |
Container for range definitions.
|
defaultnoexcept |
Creates a default value range e.g. from 0 to 0.
Does | not throw any exception. |
|
inline |
Initializes a ValueRange object.
[in] | min | Minimum value. |
[in] | max | Maximum value. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Checks if a value is within the range.
[in] | value | Value to be checked. |
Does | not throw any exception. |
|
inlinenoexcept |
Checks if this value range intersects with another value range.
[in] | other | Range for intersection test. |
Does | not throw any exception. |
|
inlinenoexcept |
Gets the maximum value.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the minimum value.
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other value range.
[in] | valueRange | Other value range. |
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other value range.
[in] | valueRange | Other value range. |
Does | not throw any exception. |
|
inline |
Sets the maximum value.
[in] | max | New maximum value, must be greater or equal than the current minimum value. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Sets the minimum value.
[in] | min | New minimum value, must be less or equal than the current maximum value. |
Any | exception derived from std::exception including CvbException. |