Container for range definitions.
More...
#include <cvb/value_range.hpp>
template<class T>
class Cvb::ValueRange< T >
Container for range definitions.
- Examples
- Foundation/QmlBlobSearch.
◆ ValueRange() [1/2]
Creates a default value range e.g. from 0 to 0.
- Exceptions
-
Does | not throw any exception. |
◆ ValueRange() [2/2]
Initializes a ValueRange object.
- Parameters
-
[in] | min | Minimum value. |
[in] | max | Maximum value. |
- Exceptions
-
◆ Contains()
bool Contains |
( |
T |
value | ) |
const |
|
inlinenoexcept |
Checks if a value is within the range.
- Parameters
-
[in] | value | Value to be checked. |
- Returns
- True if the value is within the range (border included), false otherwise.
- Exceptions
-
Does | not throw any exception. |
◆ IntersectsWith()
bool IntersectsWith |
( |
ValueRange< T > |
other | ) |
const |
|
inlinenoexcept |
Checks if this value range intersects with another value range.
- Parameters
-
[in] | other | Range for intersection test. |
- Returns
- True if this range and the other range have at least one value in common, false otherwise.
- Exceptions
-
Does | not throw any exception. |
◆ Max()
Gets the maximum value.
- Returns
- The minimum value.
- Exceptions
-
Does | not throw any exception. |
◆ Min()
Gets the minimum value.
- Returns
- The minimum value.
- Exceptions
-
Does | not throw any exception. |
◆ operator!=()
bool operator!= |
( |
const ValueRange< T > & |
valueRange | ) |
const |
|
inlinenoexcept |
Compares to an other value range.
- Parameters
-
[in] | valueRange | Other value range. |
- Returns
- True if not equal, otherwise false.
- Exceptions
-
Does | not throw any exception. |
◆ operator==()
bool operator== |
( |
const ValueRange< T > & |
valueRange | ) |
const |
|
inlinenoexcept |
Compares to an other value range.
- Parameters
-
[in] | valueRange | Other value range. |
- Returns
- True if equal, otherwise false.
- Exceptions
-
Does | not throw any exception. |
◆ SetMax()
Sets the maximum value.
- Parameters
-
[in] | max | New maximum value, must be greater or equal than the current minimum value. |
- Exceptions
-
◆ SetMin()
Sets the minimum value.
- Parameters
-
[in] | min | New minimum value, must be less or equal than the current maximum value. |
- Exceptions
-