|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <DiscreteRange.h>

Classes | |
| struct | lexicographic_order |
Public Types | |
| using | metric_type = T |
| Export metric type. | |
| using | Relation = DiscreteRangeRelation |
| Import type for convenience. | |
| using | EdgeRelation = DiscreteRangeEdgeRelation |
| Import type for convenience. | |
Public Member Functions | |
| constexpr | DiscreteRange () |
| constexpr | DiscreteRange (T const &value) |
| constexpr | DiscreteRange (T const &min, T const &max) |
| bool | empty () const |
| self_type & | assign (metric_type const &min, metric_type const &max) |
| self_type & | assign (metric_type const &value) |
| self_type & | assign_min (metric_type const &min) |
| self_type & | assign_max (metric_type const &max) |
| self_type & | clip_max () |
| metric_type const & | min () const |
| metric_type const & | max () const |
| bool | operator== (self_type const &that) const |
| Equality. | |
| bool | operator!= (self_type const &that) const |
| Inequality. | |
| bool | contains (metric_type const &value) const |
| bool | has_intersection_with (self_type const &that) const |
| self_type | intersection (self_type const &that) const |
| bool | is_adjacent_to (self_type const &that) const |
| bool | is_left_adjacent_to (self_type const &that) const |
| bool | has_union (self_type const &that) const |
| bool | is_superset_of (self_type const &that) const |
| bool | is_subset_of (self_type const &that) const |
| bool | is_strict_superset_of (self_type const &that) const |
| bool | is_strict_subset_of (self_type const &that) const |
| Relation | relationship (self_type const &that) const |
| EdgeRelation | left_edge_relationship (self_type const &that) const |
| self_type | hull (self_type const &that) const |
| bool | is_singleton () const |
| Check if the interval is exactly one element. | |
| bool | operator! () const |
| operator bool () const | |
| bool | is_maximal () const |
| self_type & | operator&= (self_type const &that) |
| self_type & | operator|= (self_type const &that) |
| self_type & | clear () |
| Make the range empty. | |
Protected Attributes | |
| T | _min |
| The minimum value in the interval. | |
| T | _max |
| the maximum value in the interval | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename T> | |
| bool | operator!= (DiscreteRange< T > const &lhs, DiscreteRange< T > const &rhs) |
| template<typename T> | |
| bool | operator^ (DiscreteRange< T > const &lhs, DiscreteRange< T > const &rhs) |
| template<typename T> | |
| bool | operator< (DiscreteRange< T > const &lhs, DiscreteRange< T > const &rhs) |
| template<typename T> | |
| bool | operator<= (DiscreteRange< T > const &lhs, DiscreteRange< T > const &rhs) |
| template<typename T> | |
| bool | operator> (DiscreteRange< T > const &lhs, DiscreteRange< T > const &rhs) |
| template<typename T> | |
| bool | operator>= (DiscreteRange< T > const &lhs, DiscreteRange< T > const &rhs) |
A range over a discrete finite value metric.
| T | The type for the range values. |
The template argument T is presumed to
MIN and MAX that define static instancesstd::numeric_limits<T> support.The interval is always an inclusive (closed) contiguous interval, defined by the minimum and maximum values contained in the interval. An interval can be empty and contain no values. This is the state of a default constructed interval.
Definition at line 139 of file DiscreteRange.h.
| using swoc::DiscreteRange< T >::EdgeRelation = DiscreteRangeEdgeRelation |
Import type for convenience.
Definition at line 149 of file DiscreteRange.h.
| using swoc::DiscreteRange< T >::metric_type = T |
Export metric type.
Definition at line 147 of file DiscreteRange.h.
| using swoc::DiscreteRange< T >::Relation = DiscreteRangeRelation |
Import type for convenience.
Definition at line 148 of file DiscreteRange.h.
|
inlineconstexpr |
Default constructor. An invalid (empty) range is constructed.
Definition at line 154 of file DiscreteRange.h.
|
inlineconstexpr |
Construct a singleton range.
| value | Single value to be contained by the interval. |
explicit and so serves as a conversion from scalar values to an interval. Definition at line 161 of file DiscreteRange.h.
|
inlineconstexpr |
Constructor.
| min | Minimum value in the interval. |
| max | Maximum value in the interval. |
Definition at line 168 of file DiscreteRange.h.
| DiscreteRange< T > & swoc::DiscreteRange< T >::assign | ( | metric_type const & | min, |
| metric_type const & | max ) |
Update the range.
| min | New minimum value. |
| max | New maximum value. |
Definition at line 443 of file DiscreteRange.h.
| DiscreteRange< T > & swoc::DiscreteRange< T >::assign | ( | metric_type const & | value | ) |
Update the range.
| value | The new minimum and maximum value. |
The range will contain the single value value.
Definition at line 486 of file DiscreteRange.h.
| DiscreteRange< T > & swoc::DiscreteRange< T >::assign_max | ( | metric_type const & | max | ) |
Update the maximum value.
| max | The new maximum value. |
Definition at line 541 of file DiscreteRange.h.
| DiscreteRange< T > & swoc::DiscreteRange< T >::assign_min | ( | metric_type const & | min | ) |
Update the minimum value.
| min | The new minimum value. |
Definition at line 494 of file DiscreteRange.h.
| auto swoc::DiscreteRange< T >::clear | ( | ) |
Make the range empty.
Definition at line 429 of file DiscreteRange.h.
| auto swoc::DiscreteRange< T >::clip_max | ( | ) |
Decrement the maximum value.
Definition at line 406 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::contains | ( | metric_type const & | value | ) | const |
Check if a value is in this range.
| value | Metric value to check. |
true if value is in the range, false if not. Definition at line 423 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::empty | ( | ) | const |
Check if there are no values in the range.
true if the range is empty (contains no values), false if it contains at least one value. Definition at line 507 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::has_intersection_with | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Logical intersection.
true if there is at least one common value in the two intervals, false otherwise. Definition at line 585 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::has_union | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Valid union.
| that | Range to compare. |
Definition at line 572 of file DiscreteRange.h.
| DiscreteRange< T > swoc::DiscreteRange< T >::hull | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Convex hull.
this and that. Definition at line 451 of file DiscreteRange.h.
| DiscreteRange< T > swoc::DiscreteRange< T >::intersection | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Compute the intersection of two intervals
Definition at line 616 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_adjacent_to | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Test for adjacency.
true if the intervals are adjacent. Definition at line 597 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_left_adjacent_to | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Lower adjacency.
| that | Range to check for adjacency. |
true if this and @ta that are adjacent and this is less than that. Definition at line 603 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_maximal | ( | ) | const |
Maximality.
true if this range contains every value. Definition at line 513 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_singleton | ( | ) | const |
Check if the interval is exactly one element.
Definition at line 501 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_strict_subset_of | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Strict subset test.
true if that contains every value in this and that has at least one value not in this. Definition at line 548 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_strict_superset_of | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Strict superset test.
true if this contains every value in this and this has at least one value not in that. Definition at line 519 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_subset_of | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Subset test.
true if every value in this is also in that. Definition at line 554 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::is_superset_of | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Superset test.
true if every value in that is also in this. Definition at line 591 of file DiscreteRange.h.
| auto swoc::DiscreteRange< T >::left_edge_relationship | ( | self_type const & | that | ) | const |
Determine the relationship of the left edge of that with this.
| that | The other interval. |
This checks the right edge of this against the left edge of that.
Definition at line 458 of file DiscreteRange.h.
| T const & swoc::DiscreteRange< T >::max | ( | ) | const |
Maximum value.
Definition at line 566 of file DiscreteRange.h.
| T const & swoc::DiscreteRange< T >::min | ( | ) | const |
Minimum value.
Definition at line 560 of file DiscreteRange.h.
|
explicit |
Test for non-empty.
true if there values in the range, false if no values in the range. Definition at line 417 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::operator! | ( | ) | const |
Test for empty, operator form.
true if the interval is empty, false otherwise. Definition at line 413 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::operator!= | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Inequality.
Definition at line 400 of file DiscreteRange.h.
| DiscreteRange< T > & swoc::DiscreteRange< T >::operator&= | ( | DiscreteRange< T >::self_type const & | that | ) |
Clip interval. Remove all element in this interval not in that interval.
Definition at line 578 of file DiscreteRange.h.
| bool swoc::DiscreteRange< T >::operator== | ( | DiscreteRange< T >::self_type const & | that | ) | const |
Equality.
Definition at line 394 of file DiscreteRange.h.
| DiscreteRange< T > & swoc::DiscreteRange< T >::operator|= | ( | DiscreteRange< T >::self_type const & | that | ) |
Convex hull. Minimally extend this to cover all elements in this and that.
Definition at line 525 of file DiscreteRange.h.
| auto swoc::DiscreteRange< T >::relationship | ( | self_type const & | that | ) | const |
Generic relationship.
Definition at line 467 of file DiscreteRange.h.
|
Inequality. Two intervals are equal if their min and max values are equal.
Definition at line 632 of file DiscreteRange.h.
|
Containment ordering.
true if this is a strict subset of rhs. is_strict_subset. Definition at line 658 of file DiscreteRange.h.
|
Containment ordering.
true if this is a subset of rhs. is_subset. Definition at line 669 of file DiscreteRange.h.
|
Containment ordering.
true if this is a strict superset of rhs. is_strict_superset. Definition at line 681 of file DiscreteRange.h.
|
Containment ordering.
true if this is a superset of rhs. is_superset. Definition at line 692 of file DiscreteRange.h.
|
Operator form of logical intersection test for two intervals.
true if there is at least one common value in the two intervals, false otherwise. Definition at line 648 of file DiscreteRange.h.
|
protected |
the maximum value in the interval
Definition at line 144 of file DiscreteRange.h.
|
protected |
The minimum value in the interval.
Definition at line 143 of file DiscreteRange.h.