IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
RangeT< T > Class Template Reference

#include <peak_common/types/peak_common_range.hpp>

Inheritance diagram for RangeT< T >:
Collaboration diagram for RangeT< T >:

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.
 
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.
 
std::string ToString () const
 Returns a string representation of the interval.
 

Detailed Description

template<typename T>
class peak::common::detail::RangeT< T >

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.

Template Parameters
TThe numeric type used for the range values. Must be an arithmetic type (e.g., int, float).
Since
ids_peak_common 1.0

Definition at line 43 of file peak_common_range.hpp.

Member Typedef Documentation

◆ type

template<typename T >
using type = T

Definition at line 49 of file peak_common_range.hpp.

Constructor & Destructor Documentation

◆ RangeT()

template<typename T >
RangeT ( T minimum,
T maximum,
T increment )
inlineconstexpr

Constructs a range with specified minimum, maximum, and increment values.

Parameters
minimumThe inclusive starting (lower) boundary of the range.
maximumThe inclusive ending (upper) boundary of the range.
incrementThe step size or increment between values within the range.
Exceptions
InvalidParameterExceptionIf minimum is greater than maximum, or if increment exceeds the total range span.
Since
ids_peak_common 1.0

Definition at line 63 of file peak_common_range.hpp.

Member Function Documentation

◆ GetIncrement()

template<typename T >
T GetIncrement ( ) const
inlineconstexpr

Retrieves the increment value associated with this range.

Returns
The increment step.
Since
ids_peak_common 1.0

Definition at line 80 of file peak_common_range.hpp.

◆ GetMaximum()

template<typename T >
T GetMaximum ( ) const
inlineconstexprinherited

Returns the upper boundary of the interval.

Returns
The maximum value of the interval (inclusive).
Since
ids_peak_common 1.0

Definition at line 88 of file peak_common_interval.hpp.

◆ GetMinimum()

template<typename T >
T GetMinimum ( ) const
inlineconstexprinherited

Returns the lower boundary of the interval.

Returns
The minimum value of the interval (inclusive).
Since
ids_peak_common 1.0

Definition at line 77 of file peak_common_interval.hpp.

◆ operator!=() [1/2]

template<typename T >
bool operator!= ( const IntervalT< T > & rhs) const
inlineconstexprinherited

Inequality comparison operator.

Parameters
rhsThe interval to compare with.
Returns
True if the intervals differ in either minimum or maximum value.
Since
ids_peak_common 1.0

Definition at line 149 of file peak_common_interval.hpp.

◆ operator!=() [2/2]

template<typename T >
bool operator!= ( const RangeT< T > & rhs) const
inlineconstexpr

Compares this range with another for inequality.

Parameters
rhsThe other range to compare with.
Returns
True if the ranges are not equal; otherwise, false.
Since
ids_peak_common 1.0

Definition at line 108 of file peak_common_range.hpp.

◆ operator==() [1/2]

template<typename T >
template<typename H >
bool operator== ( const IntervalT< H > & rhs) const
inlineconstexprinherited

Compares two intervals for equality (integral types).

Checks whether the minimum and maximum values of both intervals are exactly the same.

Parameters
rhsThe interval to compare against.
Returns
true if both intervals have the same minimum and maximum values; otherwise, false.
Since
ids_peak_common 1.0

Definition at line 109 of file peak_common_interval.hpp.

◆ operator==() [2/2]

template<typename T >
bool operator== ( const RangeT< T > & rhs) const
inlineconstexpr

Compares this range with another for equality.

Two ranges are equal if their boundaries and increments are the same.

Parameters
rhsThe other range to compare with.
Returns
True if the ranges are equal; otherwise, false.
Since
ids_peak_common 1.0

Definition at line 95 of file peak_common_range.hpp.

◆ ToString()

template<typename T >
std::string ToString ( ) const
inlineinherited

Returns a string representation of the interval.

Returns
A formatted string showing the minimum and maximum values.
Since
ids_peak_common 1.0

Definition at line 173 of file peak_common_interval.hpp.