ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::bins::single< entry_t > Class Template Reference

Bin with a single entry. More...

#include <detray/utils/grid/grid_bins.hpp>

Inheritance diagram for detray::bins::single< entry_t >:
[legend]
Collaboration diagram for detray::bins::single< entry_t >:
[legend]

Public Types

using entry_type = entry_t
 Type stored in each bin.
Public Types inherited from detray::ranges::single_view< entry_t >
using iterator_t
 Pointer iterator over the single stored element.

Public Member Functions

constexpr single ()
 Default constructor initializer the bin with an invalid value.
constexpr dindex capacity () noexcept
constexpr auto init (entry_t entry=detail::invalid_value< entry_t >()) -> single &
constexpr bool operator== (const single &rhs) const
 Equality operator.
template<typename E = entry_t>
constexpr void push_back (E &&entry) noexcept
 Add a new entry to the bin.
Public Member Functions inherited from detray::ranges::single_view< entry_t >
constexpr single_view ()=default
 Default constructor.
constexpr single_view (const entry_t &value)
 Construct the view by copying its single element.
constexpr single_view (entry_t &&value)
 Construct the view by moving in its single element.
constexpr single_view (std::in_place_t, Args &&... args)
 Construct value in place from args.
constexpr auto back () noexcept -> entry_t
constexpr auto begin () const noexcept -> const entry_t *
constexpr auto begin () noexcept -> entry_t *
constexpr auto data () const noexcept -> const entry_t *
constexpr auto data () noexcept -> entry_t *
constexpr auto end () const noexcept -> const entry_t *
constexpr auto end () noexcept -> entry_t *
constexpr auto front () noexcept -> entry_t
constexpr auto operator[] (const dindex) const -> entry_t
constexpr auto ref () -> entry_t &
 Return a mutable reference to the stored element.
constexpr auto ref () const -> const entry_t &
 Return a const reference to the stored element.
constexpr auto value () const -> entry_t
 Return the single stored value by value.
Public Member Functions inherited from detray::ranges::view_interface< view_impl_t >
template<detray::ranges::bidirectional_range R = view_impl_t>
constexpr decltype(auto) back ()
 Return a writable reference to the last element.
template<detray::ranges::bidirectional_range R = view_impl_t>
constexpr decltype(auto) back () const
 Return a reference to the last element.
constexpr auto data ()
 Return a writable pointer to the first element, or null if empty.
constexpr auto data () const
 Return a pointer to the first element, or null for an empty view.
template<detray::ranges::forward_range R = view_impl_t>
constexpr auto empty () const -> bool
 Check whether the view contains no elements.
template<detray::ranges::forward_range R = view_impl_t>
constexpr decltype(auto) front ()
 Return a writable reference to the first element.
template<detray::ranges::forward_range R = view_impl_t>
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.
template<detray::ranges::random_access_range R = view_impl_t>
constexpr decltype(auto) operator[] (const dindex i)
 Subscript operator that takes detray dindex.
template<detray::ranges::random_access_range R = view_impl_t>
constexpr decltype(auto) operator[] (const dindex i) const
 Subscript operator that takes detray dindex.
template<detray::ranges::forward_range R = view_impl_t>
constexpr auto size () const
 Return the number of elements in the view.

Additional Inherited Members

Static Public Member Functions inherited from detray::ranges::single_view< entry_t >
static constexpr auto size () noexcept -> std::size_t

Detailed Description

template<typename entry_t>
class detray::bins::single< entry_t >

Bin with a single entry.

Member Function Documentation

◆ capacity()

template<typename entry_t>
dindex detray::bins::single< entry_t >::capacity ( )
constexprnoexcept
Returns
the storage capacity of this bin

◆ init()

template<typename entry_t>
auto detray::bins::single< entry_t >::init ( entry_t entry = detail::invalid_value<entry_t>()) ->single &
constexpr
Returns
an initialized bin in the backend storage
Parameters
entryInitial value; the invalid sentinel leaves the bin empty.

◆ operator==()

template<typename entry_t>
bool detray::bins::single< entry_t >::operator== ( const single< entry_t > & rhs) const
constexpr

Equality operator.

Parameters
rhsthe single view to compare with
Returns
true if the single value is equal

◆ push_back()

template<typename entry_t>
template<typename E = entry_t>
void detray::bins::single< entry_t >::push_back ( E && entry)
constexprnoexcept

Add a new entry to the bin.

Parameters
entryValue to store.