LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::details::BoundaryListRangeIterator< BoundaryIter > Class Template Reference

Iterator exposing elements of a boundary list as ranges. More...

#include "AssociatedData.h"

Inheritance diagram for proxy::details::BoundaryListRangeIterator< BoundaryIter >:
proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter >, BoundaryIter >

Public Types

using boundary_iterator_t = BoundaryIter
 Type of boundary iterator. More...
 
using rangeview_t = decltype(makeBoundaryListRange(std::declval< boundary_iterator_t >()))
 Type of range returned when dereferencing. More...
 
using value_type = rangeview_t
 
using pointer = std::add_pointer_t< std::decay_t< value_type >>
 
using reference = std::add_lvalue_reference_t< std::decay_t< value_type >>
 
using iterator = BoundaryListRangeIterator< BoundaryIter >
 
Iterator traits

!< The type of base iterator wrapper.

using iterator_category = std::forward_iterator_tag
 

Public Member Functions

iteratoroperator++ ()
 Prefix increment operator. More...
 
bool operator!= (data_iterator_t const &other) const
 Comparison with a data iterator (makes unnecessary to wrap end iterators). More...
 
bool operator!= (iterator const &other) const
 Comparison with another iterator. More...
 
auto operator[] (std::size_t index) const -> decltype(auto)
 
auto operator* () const -> decltype(auto)
 Dereference operator; need to be redefined by derived classes. More...
 
auto operator-> () const -> decltype(auto)
 Dereference operator; need to be redefined by derived classes. More...
 

Static Public Member Functions

static auto transform (BoundaryIter const &iter)
 Returns the pointed range. More...
 

Protected Types

using data_iterator_t = BoundaryIter
 

Protected Member Functions

data_iterator_t const & asDataIterator () const
 

Private Types

using base_t = IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter >, BoundaryIter >
 

Detailed Description

template<typename BoundaryIter>
class proxy::details::BoundaryListRangeIterator< BoundaryIter >

Iterator exposing elements of a boundary list as ranges.

Template Parameters
BoundaryItertype of iterator to boundary iterators

This iterator wraps an iterator (BoundaryIter) to a sequence of iterators representing ranges of data. As an example, let the data be a collection of real numbers:

std::vector<float> data;

and we have a list of iterators that define subranges within that data:

std::vector<data_iterator_t> rangeStart;

Here rangeStart holds the begin iterator of each of the subranges, plus a "global" end iterator, as in the convention described in lar::makeBoundaryListRange() (which takes an iterator to rangeStart as argument). The BoundaryIter type in this example would be

.

When dereferenced, this iterator returns a view of the range currently pointed. This view has a STL-vector-like interface (again, see lar::makeBoundaryListRange()).

Definition at line 587 of file AssociatedData.h.

Member Typedef Documentation

template<typename BoundaryIter >
using proxy::details::BoundaryListRangeIterator< BoundaryIter >::base_t = IteratorWrapperBase<BoundaryListRangeIterator<BoundaryIter>, BoundaryIter>
private

Definition at line 589 of file AssociatedData.h.

template<typename BoundaryIter >
using proxy::details::BoundaryListRangeIterator< BoundaryIter >::boundary_iterator_t = BoundaryIter

Type of boundary iterator.

Definition at line 592 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::data_iterator_t = BoundaryIter
protectedinherited

Definition at line 99 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::iterator = BoundaryListRangeIterator< BoundaryIter >
inherited

Definition at line 102 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::iterator_category = std::forward_iterator_tag
inherited

Definition at line 110 of file AssociatedData.h.

template<typename BoundaryIter >
using proxy::details::BoundaryListRangeIterator< BoundaryIter >::pointer = std::add_pointer_t<std::decay_t<value_type>>

Definition at line 598 of file AssociatedData.h.

template<typename BoundaryIter >
using proxy::details::BoundaryListRangeIterator< BoundaryIter >::rangeview_t = decltype(makeBoundaryListRange(std::declval<boundary_iterator_t>()))

Type of range returned when dereferencing.

Definition at line 595 of file AssociatedData.h.

template<typename BoundaryIter >
using proxy::details::BoundaryListRangeIterator< BoundaryIter >::reference = std::add_lvalue_reference_t<std::decay_t<value_type>>

Definition at line 599 of file AssociatedData.h.

template<typename BoundaryIter >
using proxy::details::BoundaryListRangeIterator< BoundaryIter >::value_type = rangeview_t

Definition at line 597 of file AssociatedData.h.

Member Function Documentation

data_iterator_t const& proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::asDataIterator ( ) const
inlineprotectedinherited

Definition at line 150 of file AssociatedData.h.

151  {
152  return static_cast<data_iterator_t const&>(*this);
153  }
bool proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::operator!= ( data_iterator_t const &  other) const
inlineinherited

Comparison with a data iterator (makes unnecessary to wrap end iterators).

Definition at line 127 of file AssociatedData.h.

bool proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::operator!= ( iterator const &  other) const
inlineinherited

Comparison with another iterator.

Definition at line 130 of file AssociatedData.h.

130 { return operator!=(other.asDataIterator()); }
bool operator!=(data_iterator_t const &other) const
Comparison with a data iterator (makes unnecessary to wrap end iterators).
auto proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::operator* ( ) const-> decltype(auto)
inlineinherited

Dereference operator; need to be redefined by derived classes.

Definition at line 138 of file AssociatedData.h.

iterator& proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::operator++ ( )
inlineinherited

Prefix increment operator.

Definition at line 120 of file AssociatedData.h.

121  {
122  data_iterator_t::operator++();
123  return asIterator();
124  }
auto proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::operator-> ( ) const-> decltype(auto)
inlineinherited

Dereference operator; need to be redefined by derived classes.

Definition at line 141 of file AssociatedData.h.

141 { return makeValuePointer(operator*()); }
auto proxy::details::IteratorWrapperBase< BoundaryListRangeIterator< BoundaryIter > , BoundaryIter , typename BoundaryIter ::value_type >::operator[] ( std::size_t  index) const-> decltype(auto)
inlineinherited

Definition at line 132 of file AssociatedData.h.

template<typename BoundaryIter >
static auto proxy::details::BoundaryListRangeIterator< BoundaryIter >::transform ( BoundaryIter const &  iter)
inlinestatic

Returns the pointed range.

Returns
the pointed range, as a view

The returned value may be a view object, that is a pure interface overlaid on a different data structure. As such, it may be not copiable and need to be propagated by reference.

Definition at line 611 of file AssociatedData.h.

References proxy::details::makeBoundaryListRange().

611 { return makeBoundaryListRange(iter); }
BoundaryListRange< BoundaryIter > makeBoundaryListRange(BoundaryIter const &iBegin)
Reinterprets a iterator to boundaries list as a range collection.

The documentation for this class was generated from the following file: