ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::ranges::pointer_view< value_t > Class Template Reference

Struct that implements a pointer based view on a single element. More...

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

Inheritance diagram for detray::ranges::pointer_view< value_t >:
[legend]
Collaboration diagram for detray::ranges::pointer_view< value_t >:
[legend]

Public Types

using iterator_t = value_t*
 Pointer iterator over the referenced element.

Public Member Functions

 pointer_view ()=default
 Default constructor.
constexpr pointer_view (value_t &value)
 Construct iterator from the single.
constexpr auto back () noexcept -> value_t
constexpr auto begin () const noexcept -> const value_t *
constexpr auto begin () noexcept -> value_t *
constexpr auto data () const noexcept -> const value_t *
constexpr auto data () noexcept -> value_t *
constexpr auto end () const noexcept -> const value_t *
constexpr auto end () noexcept -> value_t *
constexpr auto front () noexcept -> value_t
constexpr auto operator* () -> value_t &
constexpr auto operator* () const -> const value_t &
constexpr auto operator[] (const dindex) const -> value_t
Public Member Functions inherited from detray::ranges::view_interface< pointer_view< value_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.

Static Public Member Functions

static constexpr auto size () noexcept -> std::size_t

Detailed Description

template<typename value_t>
class detray::ranges::pointer_view< value_t >

Struct that implements a pointer based view on a single element.

Template Parameters
value_ttype of the single element (outside of a container)
Note
Does not take ownership of the value it operates on. Its lifetime needs to be guaranteed throughout iteration or between iterations with the same view instance.
Is not fit for lazy evaluation.

Constructor & Destructor Documentation

◆ pointer_view()

template<typename value_t>
detray::ranges::pointer_view< value_t >::pointer_view ( value_t & value)
explicitconstexpr

Construct iterator from the single.

Parameters
value- copy

Member Function Documentation

◆ back()

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::back ( ) ->value_t
constexprnoexcept
Returns
the value directly

◆ begin() [1/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::begin ( ) const->constvalue_t *
constexprnoexcept
Returns
value pointer - const

◆ begin() [2/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::begin ( ) ->value_t *
constexprnoexcept
Returns
value pointer.

◆ data() [1/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::data ( ) const->constvalue_t *
constexprnoexcept
Returns
a pointer to the beginning of the data - const

◆ data() [2/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::data ( ) ->value_t *
constexprnoexcept
Returns
a pointer to the beginning of the data

◆ end() [1/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::end ( ) const->constvalue_t *
constexprnoexcept
Returns
sentinel position - const

◆ end() [2/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::end ( ) ->value_t *
constexprnoexcept
Returns
sentinel position.

◆ front()

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::front ( ) ->value_t
constexprnoexcept
Returns
the value directly

◆ operator*() [1/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::operator* ( ) ->value_t &
constexpr
Returns
the pointer value

◆ operator*() [2/2]

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::operator* ( ) const->constvalue_t &
constexpr
Returns
the pointer value

◆ operator[]()

template<typename value_t>
auto detray::ranges::pointer_view< value_t >::operator[] ( const dindex ) const->value_t
constexpr
Returns
the value directly

◆ size()

template<typename value_t>
constexpr auto detray::ranges::pointer_view< value_t >::size ( ) ->std::size_t
staticconstexprnoexcept
Returns
the size of the pointer view, which is always 'one'.