#include <peak_common/types/peak_common_range.hpp>

Public Types | |
| using | type = T |
Public Member Functions | |
| constexpr | RangeT (T minimum, T maximum, T increment) |
| Constructs a range with specified minimum, maximum, and increment values. | |
| constexpr T | GetIncrement () const |
| Retrieves the increment value associated with this range. | |
| constexpr bool | operator== (const RangeT &rhs) const |
| Compares this range with another for equality. | |
| constexpr bool | operator!= (const RangeT &rhs) const |
| Compares this range with another for inequality. | |
| std::string | ToString () const |
| Returns a string representation of the range. | |
| constexpr T | GetMinimum () const |
| Returns the lower boundary of the interval. | |
| constexpr T | GetMaximum () const |
| Returns the upper boundary of the interval. | |
| template<typename H > | |
| constexpr bool | operator== (const IntervalT< H > &rhs) const |
| Compares two intervals for equality (integral types). | |
| constexpr bool | operator!= (const IntervalT &rhs) const |
| Inequality comparison operator. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, RangeT range) |
| Outputs the range as a human-readable string to a stream. | |
Represents a numeric range with defined boundaries and a fixed increment.
A RangeT models a continuous sequence of values starting from a minimum value, ending at a maximum value, and progressing in steps defined by an increment. It supports arithmetic types such as integers and floating-point numbers.
This class ensures that the increment does not exceed the total span between the minimum and maximum bounds. The range is inclusive of its boundary values.
| T | The numeric type used for the range values. Must be an arithmetic type (e.g., int, float). |
| using type = T |
|
inlineconstexpr |
Constructs a range with specified minimum, maximum, and increment values.
| minimum | The inclusive starting (lower) boundary of the range. |
| maximum | The inclusive ending (upper) boundary of the range. |
| increment | The step size or increment between values within the range. |
| InvalidParameterException | If minimum is greater than maximum, or if increment exceeds the total range span. |
|
inlineconstexpr |
Retrieves the increment value associated with this range.
|
inlineconstexprinherited |
Returns the upper boundary of the interval.
|
inlineconstexprinherited |
Returns the lower boundary of the interval.
|
inlineconstexprinherited |
Inequality comparison operator.
| rhs | The interval to compare with. |
|
inlineconstexpr |
Compares this range with another for inequality.
| rhs | The other range to compare with. |
|
inlineconstexprinherited |
Compares two intervals for equality (integral types).
Checks whether the minimum and maximum values of both intervals are exactly the same.
| rhs | The interval to compare against. |
true if both intervals have the same minimum and maximum values; otherwise, false.
|
inlineconstexpr |
Compares this range with another for equality.
Two ranges are equal if their boundaries and increments are the same.
| rhs | The other range to compare with. |
|
inline |
Returns a string representation of the range.
|
friend |
Outputs the range as a human-readable string to a stream.
| os | The output stream. |
| range | The range to print. |