Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::Range< T > Struct Template Reference

#include <range.hpp>

Public Member Functions

constexpr Range ()=default
constexpr Range (T s, T e)
constexpr T length () const
 Length of the range.
constexpr bool empty () const
 Whether the range is empty (start >= end).
constexpr bool contains (T value) const
 Whether this range contains a value.
constexpr bool contains (const Range &other) const
 Whether this range fully contains another range.
constexpr bool intersects (const Range &other) const
 Whether this range intersects another range.
constexpr Range intersection (const Range &other) const
 Intersection of two ranges (empty if no overlap).
constexpr Range enclosing_union (const Range &other) const
 Union of two ranges (bounding box — may include a gap).
constexpr T constrain (T value) const
 Constrain a value to this range [start, end).
constexpr Range expanded (T value) const
 Expand range to include a value.
constexpr bool operator== (const Range &other) const
constexpr bool operator!= (const Range &other) const

Static Public Member Functions

static constexpr Range from_start_length (T s, T len)
 Create a range from start + length.

Public Attributes

T start {}
T end {}

Constructor & Destructor Documentation

◆ Range() [1/2]

template<typename T>
pulp::runtime::Range< T >::Range ( )
constexprdefault

◆ Range() [2/2]

template<typename T>
pulp::runtime::Range< T >::Range ( T s,
T e )
inlineconstexpr

Member Function Documentation

◆ constrain()

template<typename T>
T pulp::runtime::Range< T >::constrain ( T value) const
inlineconstexpr

Constrain a value to this range [start, end).

◆ contains() [1/2]

template<typename T>
bool pulp::runtime::Range< T >::contains ( const Range< T > & other) const
inlineconstexpr

Whether this range fully contains another range.

◆ contains() [2/2]

template<typename T>
bool pulp::runtime::Range< T >::contains ( T value) const
inlineconstexpr

Whether this range contains a value.

◆ empty()

template<typename T>
bool pulp::runtime::Range< T >::empty ( ) const
inlineconstexpr

Whether the range is empty (start >= end).

◆ enclosing_union()

template<typename T>
Range pulp::runtime::Range< T >::enclosing_union ( const Range< T > & other) const
inlineconstexpr

Union of two ranges (bounding box — may include a gap).

◆ expanded()

template<typename T>
Range pulp::runtime::Range< T >::expanded ( T value) const
inlineconstexpr

Expand range to include a value.

◆ from_start_length()

template<typename T>
constexpr Range pulp::runtime::Range< T >::from_start_length ( T s,
T len )
inlinestaticconstexpr

Create a range from start + length.

◆ intersection()

template<typename T>
Range pulp::runtime::Range< T >::intersection ( const Range< T > & other) const
inlineconstexpr

Intersection of two ranges (empty if no overlap).

◆ intersects()

template<typename T>
bool pulp::runtime::Range< T >::intersects ( const Range< T > & other) const
inlineconstexpr

Whether this range intersects another range.

◆ length()

template<typename T>
T pulp::runtime::Range< T >::length ( ) const
inlineconstexpr

Length of the range.

◆ operator!=()

template<typename T>
bool pulp::runtime::Range< T >::operator!= ( const Range< T > & other) const
inlineconstexpr

◆ operator==()

template<typename T>
bool pulp::runtime::Range< T >::operator== ( const Range< T > & other) const
inlineconstexpr

Member Data Documentation

◆ end

template<typename T>
T pulp::runtime::Range< T >::end {}

◆ start

template<typename T>
T pulp::runtime::Range< T >::start {}

The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/runtime/include/pulp/runtime/range.hpp