PLCnext API Documentation 25.0.2.69
|
This class represents a range of values of any comparable type. More...
#include <Range.hxx>
Public Types | |
using | Value = T |
Public Member Functions | |
Range (const Value &min, const Value &max) | |
Constructs an Range instance. More... | |
const Value & | GetMin (void) const |
Gets the lower bound of this range. More... | |
const Value & | GetMax (void) const |
Gets the upper bound of this range. More... | |
bool | IsEmpty (void) const |
Determines if this range is empty. More... | |
bool | Contains (const Value &value) const |
Determines of the supplied value is inside this range. More... | |
bool | IsDisjointTo (const Range &other, bool strictDisjoint=false) const |
Determines if the supplied other range is disjoint to this range. More... | |
Static Public Member Functions | |
template<std::input_iterator InputIt> | |
static bool | AreDisjoint (InputIt begin, InputIt end, bool strictDisjoint=false) |
Checks if all ranges in the sequence determined by begin and end a disjointed More... | |
Friends | |
auto | operator<=> (const Range &lhs, const Range &rhs)=default |
This class represents a range of values of any comparable type.
T | The type of the range values. This type shall be comparable. |
|
inline |
Constructs an Range instance.
T | The data type of the range values. |
min | The lower bound of the range. |
max | The upper bound of the range. |
|
static |
Checks if all ranges in the sequence determined by begin and end a disjointed
begin | Iterator to the beginning of the sequence |
end | Iterator past the end of the sequence |
strictDisjoint | Determines ranges may share borders |
|
inline |
Determines of the supplied value is inside this range.
T | The data type of the range values. |
value | The value to check, if it is contained in this range. |
true
if the supplied value is inside this range, otherwise false
.
|
inline |
Gets the upper bound of this range.
T | The data type of the range values. |
|
inline |
Gets the lower bound of this range.
T | The data type of the range values. |
|
inline |
Determines if the supplied other range is disjoint to this range.
T | The data type of the range values. |
other | The range to check, if it is disjoint to this range. |
strictDisjoint | Determines ranges may share borders |
true
if the supplied other range is disjoint to this range, otherwise false
.The result of this operation depends on the parameter strictDisjoint
, if it is true
this operation returns this->GetMax() < other.GetMin() || this->GetMin() > other.GetMax()
. if strictDisjoint
is false
this->GetMax() <= other.GetMin() || this->GetMin() >= other.GetMax()
is returned.
|
inline |