ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::ranges::subrange< range_t, index_range_t > Struct Template Reference

interface type to construct a subrange_view with CTAD More...

#include <detray/utils/ranges/subrange.hpp>

Inheritance diagram for detray::ranges::subrange< range_t, index_range_t >:
[legend]
Collaboration diagram for detray::ranges::subrange< range_t, index_range_t >:
[legend]

Public Types

using base_type = detray::ranges::detail::subrange_view<range_t>
 Base view storing the selected iterators.
using difference_t = typename detray::ranges::range_difference_t<range_t>
 Difference type used for source range positions.
using iterator_t = typename detray::ranges::iterator_t<range_t>
 Iterator type of the source range.
Public Types inherited from detray::ranges::detail::subrange_view< range_t >
using const_iterator_t = typename detray::ranges::const_iterator_t<range_t>
 Iterator type used when accessing a const view.
using difference_t = typename detray::ranges::range_difference_t<range_t>
 Difference type used for range positions.
using iterator_t = typename detray::ranges::iterator_t<range_t>
 Iterator type used to delimit the range.

Public Member Functions

constexpr subrange ()=default
 Default constructor.
template<detray::ranges::range deduced_range_t>
requires (!std::same_as<subrange, deduced_range_t>)
constexpr subrange (deduced_range_t &&range)
 Construct from a range.
template<detray::ranges::range deduced_range_t, concepts::interval deduced_index_range_t>
constexpr subrange (deduced_range_t &&range, const deduced_index_range_t &pos)
 Construct from a range and an index range pos.
template<detray::ranges::range deduced_range_t, concepts::index index_t>
requires std::is_convertible_v< index_t, detray::ranges::range_difference_t<deduced_range_t>>
constexpr subrange (deduced_range_t &&range, index_t pos)
 Construct from a range and starting position pos.
template<concepts::index index_t>
constexpr subrange (index_t start, index_t end)
 Construct from two indices, storing them for later range composition.
constexpr subrange (iterator_t start, iterator_t end)
 Construct from an start and end iterator pair.
template<detray::ranges::range deduced_range_t>
constexpr auto operator() (deduced_range_t &&range)
 Call operator for range composition.
Public Member Functions inherited from detray::ranges::detail::subrange_view< range_t >
constexpr subrange_view ()=default
 Default constructor.
constexpr subrange_view (iterator_t start, iterator_t end)
 Construct from an start and end iterator pair.
constexpr auto begin () -> iterator_t
 Return the first iterator.
constexpr auto begin () const -> const_iterator_t
 Return the first iterator of a const view.
constexpr auto end () -> iterator_t
 Return the end iterator.
constexpr auto end () const -> const_iterator_t
 Return the end iterator of a const view.
constexpr auto operator== (const subrange_view &rhs) const -> bool
 Equality operator.
Public Member Functions inherited from detray::ranges::view_interface< subrange_view< range_t > >
constexpr decltype(auto) back () const
 Return a reference to the last element.
constexpr auto data () const
 Return a pointer to the first element, or null for an empty view.
constexpr auto empty () const -> bool
 Check whether the view contains no elements.
constexpr decltype(auto) front () const
 Return a reference to the first element.
constexpr operator bool () const
 Test whether the view contains at least one element.
constexpr decltype(auto) operator[] (const dindex i) const
 Subscript operator that takes detray dindex.
constexpr auto size () const
 Return the number of elements in the view.

Detailed Description

template<detray::ranges::range range_t, typename index_range_t = dindex_range>
struct detray::ranges::subrange< range_t, index_range_t >

interface type to construct a subrange_view with CTAD

Constructor & Destructor Documentation

◆ subrange() [1/5]

template<detray::ranges::range range_t, typename index_range_t = dindex_range>
template<concepts::index index_t>
detray::ranges::subrange< range_t, index_range_t >::subrange ( index_t start,
index_t end )
constexpr

Construct from two indices, storing them for later range composition.

Parameters
startFirst index of the selected interval.
endOne-past-the-end index of the selected interval.

◆ subrange() [2/5]

template<detray::ranges::range range_t, typename index_range_t = dindex_range>
detray::ranges::subrange< range_t, index_range_t >::subrange ( iterator_t start,
iterator_t end )
constexpr

Construct from an start and end iterator pair.

Parameters
startFirst iterator of the view.
endEnd iterator of the view.

◆ subrange() [3/5]

template<detray::ranges::range range_t, typename index_range_t = dindex_range>
template<detray::ranges::range deduced_range_t>
requires (!std::same_as<subrange, deduced_range_t>)
detray::ranges::subrange< range_t, index_range_t >::subrange ( deduced_range_t && range)
explicitconstexpr

Construct from a range.

Parameters
rangeSource range whose iterators define the view.

◆ subrange() [4/5]

template<detray::ranges::range range_t, typename index_range_t = dindex_range>
template<detray::ranges::range deduced_range_t, concepts::index index_t>
requires std::is_convertible_v< index_t, detray::ranges::range_difference_t<deduced_range_t>>
detray::ranges::subrange< range_t, index_range_t >::subrange ( deduced_range_t && range,
index_t pos )
constexpr

Construct from a range and starting position pos.

Used as an overload when only a single position is needed.

Parameters
rangeSource range.
posIndex of the first element in the view.

◆ subrange() [5/5]

template<detray::ranges::range range_t, typename index_range_t = dindex_range>
template<detray::ranges::range deduced_range_t, concepts::interval deduced_index_range_t>
detray::ranges::subrange< range_t, index_range_t >::subrange ( deduced_range_t && range,
const deduced_index_range_t & pos )
constexpr

Construct from a range and an index range pos.

Parameters
rangeSource range.
posHalf-open interval selecting elements from the range.

Member Function Documentation

◆ operator()()

template<detray::ranges::range range_t, typename index_range_t = dindex_range>
template<detray::ranges::range deduced_range_t>
auto detray::ranges::subrange< range_t, index_range_t >::operator() ( deduced_range_t && range)
constexpr

Call operator for range composition.

Parameters
rangeSource range to constrain.
Returns
A view spanning the stored interval of the source.