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

Range adaptor that joins different ranges of the same type (static). More...

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

Inheritance diagram for detray::ranges::join_view< range_t >:
[legend]
Collaboration diagram for detray::ranges::join_view< range_t >:
[legend]

Public Types

using inner_iterator_t = detray::ranges::iterator_t<outer_value_t>
 Iterator over a single range.
using iterator_t = detray::ranges::detail::join_iterator<range_t>
 Iterator that walks across all nested ranges.
using outer_iterator_t = detray::ranges::iterator_t<range_t>
 Iterator over the range of ranges.
using outer_value_t
 Type of a single range.
using value_t = std::iter_value_t<iterator_t>
 Element value type yielded by the joined view.

Public Member Functions

constexpr join_view ()=default
 Default constructor.
template<detray::ranges::range R>
requires (!std::same_as<R, join_view>)
constexpr join_view (R &&ranges)
 Construct from a range of ranges.
constexpr auto begin () const -> iterator_t
constexpr auto data () -> value_t *
constexpr auto data () const -> const value_t *
constexpr auto end () const -> iterator_t
constexpr auto size () const noexcept -> std::size_t
Public Member Functions inherited from detray::ranges::view_interface< join_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.

Public Attributes

outer_iterator_t m_begin {}
 Start and end position of the subranges.
outer_iterator_t m_end {}
 End iterator of the outer range.

Detailed Description

template<detray::ranges::range range_t>
struct detray::ranges::join_view< range_t >

Range adaptor that joins different ranges of the same type (static).

See also
https://en.cppreference.com/w/cpp/ranges/join_view
Template Parameters
range_ta range of the ranges that should be joined.
Note
Static implementation: The number of ranges needs to be know at compile time
Does not take ownership of the ranges it operates on. Their lifetime needs to be guaranteed throughout iteration or between iterations with the same join instance.

Member Typedef Documentation

◆ outer_value_t

template<detray::ranges::range range_t>
using detray::ranges::join_view< range_t >::outer_value_t
Initial value:
std::conditional_t<std::is_const_v<range_t>,
const detray::ranges::range_value_t<range_t>,
detray::ranges::range_value_t<range_t>>

Type of a single range.

Constructor & Destructor Documentation

◆ join_view()

template<detray::ranges::range range_t>
template<detray::ranges::range R>
requires (!std::same_as<R, join_view>)
detray::ranges::join_view< range_t >::join_view ( R && ranges)
explicitconstexpr

Construct from a range of ranges.

Parameters
rangesouter range containing the nested ranges

Member Function Documentation

◆ begin()

template<detray::ranges::range range_t>
auto detray::ranges::join_view< range_t >::begin ( ) const->iterator_t
constexpr
Returns
start position of range - const

◆ data() [1/2]

template<detray::ranges::range range_t>
auto detray::ranges::join_view< range_t >::data ( ) ->value_t *
constexpr
Returns
a pointer to the beginning of the data of the first underlying range - non-const

◆ data() [2/2]

template<detray::ranges::range range_t>
auto detray::ranges::join_view< range_t >::data ( ) const->constvalue_t *
constexpr
Returns
a pointer to the beginning of the data of the first underlying range - const

◆ end()

template<detray::ranges::range range_t>
auto detray::ranges::join_view< range_t >::end ( ) const->iterator_t
constexpr
Returns
sentinel of the range.

◆ size()

template<detray::ranges::range range_t>
auto detray::ranges::join_view< range_t >::size ( ) const->std::size_t
constexprnoexcept
Returns
sum of the number elements of all ranges in the join

Member Data Documentation

◆ m_begin

template<detray::ranges::range range_t>
outer_iterator_t detray::ranges::join_view< range_t >::m_begin {}

Start and end position of the subranges.

Begin iterator of the outer range.