LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
util::details::RangeForWrapperIterator< BeginIter, EndIter > Class Template Reference

#include "RangeForWrapper.h"

Classes

struct  Comparer
 Visitor to compare iterators (returns whether they differ). More...
 
struct  Decrementer
 Visitor to decrement an iterator. More...
 
struct  Dereferencer
 Visitor to dereference an iterator. More...
 
struct  Difference
 Visitor to compare iterators (returns whether they differ). More...
 
struct  Incrementer
 Visitor to increment an iterator. More...
 
struct  IndexAccessor
 Visitor to access element by index. More...
 
struct  MemberAccessor
 Visitor to access a data member of the pointed class. More...
 

Public Types

using begin_t = BeginIter
 Type of begin iterator we can store. More...
 
using end_t = EndIter
 Type of end iterator we can store. More...
 
using this_t = RangeForWrapperIterator< begin_t, end_t >
 This class. More...
 
using difference_type = typename traits_t::difference_type
 Iterator traits, imported from the wrapped begin iterator. More...
 
using value_type = typename traits_t::value_type
 Iterator traits, imported from the wrapped begin iterator. More...
 
using pointer = typename traits_t::pointer
 Iterator traits, imported from the wrapped begin iterator. More...
 
using reference = typename traits_t::reference
 Iterator traits, imported from the wrapped begin iterator. More...
 
using iterator_category = std::conditional_t< std::is_base_of< std::bidirectional_iterator_tag, typename traits_t::iterator_category >::value, std::bidirectional_iterator_tag, typename traits_t::iterator_category >
 Iterator traits, imported from the wrapped begin iterator. More...
 

Public Member Functions

 RangeForWrapperIterator ()
 Constructor: initializes with a end-type default-constructed iterator. More...
 
 RangeForWrapperIterator (begin_t &&begin)
 Constructor: initializes with a begin-type iterator. More...
 
 RangeForWrapperIterator (end_t &&end)
 Constructor: initializes with a end-type iterator. More...
 
reference operator* () const
 Returns the pointed value (just like the original iterator). More...
 
pointer operator-> () const
 Returns the pointed value (just like the original iterator). More...
 
this_toperator++ ()
 Increments the iterator (prefix operator). More...
 
this_toperator-- ()
 Decrements the iterator (prefix operator). More...
 
this_t operator++ (int)
 Increments the iterator (postfix operator). More...
 
this_t operator-- (int)
 Decrements the iterator (postfix operator). More...
 
bool operator!= (this_t const &other) const
 Returns whether the other iterator is not equal to this one. More...
 
bool operator== (this_t const &other) const
 Returns whether the other iterator is equal to this one. More...
 
reference operator[] (difference_type offset) const
 
difference_type operator- (this_t const &other) const
 

Private Types

using traits_t = std::iterator_traits< BeginIter >
 

Private Attributes

boost::variant< begin_t, end_tfIter
 The actual iterator we store. More...
 

Detailed Description

template<typename BeginIter, typename EndIter>
class util::details::RangeForWrapperIterator< BeginIter, EndIter >

Iterator wrapping one of two types of iterators.

See also
RangeForWrapperBox

Definition at line 33 of file RangeForWrapper.h.

Member Typedef Documentation

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::begin_t = BeginIter

Type of begin iterator we can store.

Definition at line 42 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::difference_type = typename traits_t::difference_type

Iterator traits, imported from the wrapped begin iterator.

Definition at line 48 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::end_t = EndIter

Type of end iterator we can store.

Definition at line 43 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::iterator_category = std::conditional_t< std::is_base_of<std::bidirectional_iterator_tag, typename traits_t::iterator_category>::value, std::bidirectional_iterator_tag, typename traits_t::iterator_category >

Iterator traits, imported from the wrapped begin iterator.

Definition at line 63 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::pointer = typename traits_t::pointer

Iterator traits, imported from the wrapped begin iterator.

Definition at line 50 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::reference = typename traits_t::reference

Iterator traits, imported from the wrapped begin iterator.

Definition at line 51 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::this_t = RangeForWrapperIterator<begin_t, end_t>

This class.

Definition at line 44 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::traits_t = std::iterator_traits<BeginIter>
private

Definition at line 39 of file RangeForWrapper.h.

template<typename BeginIter , typename EndIter >
using util::details::RangeForWrapperIterator< BeginIter, EndIter >::value_type = typename traits_t::value_type

Iterator traits, imported from the wrapped begin iterator.

Definition at line 49 of file RangeForWrapper.h.

Constructor & Destructor Documentation

template<typename BeginIter , typename EndIter >
util::details::RangeForWrapperIterator< BeginIter, EndIter >::RangeForWrapperIterator ( )
inlineexplicit

Constructor: initializes with a end-type default-constructed iterator.

Definition at line 67 of file RangeForWrapper.h.

68  : fIter(end_t{})
69  {}
EndIter end_t
Type of end iterator we can store.
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
template<typename BeginIter , typename EndIter >
util::details::RangeForWrapperIterator< BeginIter, EndIter >::RangeForWrapperIterator ( begin_t &&  begin)
inlineexplicit

Constructor: initializes with a begin-type iterator.

Definition at line 72 of file RangeForWrapper.h.

73  : fIter(std::move(begin))
74  {}
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
template<typename BeginIter , typename EndIter >
util::details::RangeForWrapperIterator< BeginIter, EndIter >::RangeForWrapperIterator ( end_t &&  end)
inlineexplicit

Constructor: initializes with a end-type iterator.

Definition at line 77 of file RangeForWrapper.h.

78  : fIter(std::move(end))
79  {}
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)

Member Function Documentation

template<typename BeginIter , typename EndIter >
bool util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator!= ( this_t const &  other) const
inline

Returns whether the other iterator is not equal to this one.

Definition at line 106 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::fIter.

Referenced by util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator==().

107  { return boost::apply_visitor(Comparer(), fIter, other.fIter); }
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
template<typename BeginIter , typename EndIter >
reference util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator* ( ) const
inline

Returns the pointed value (just like the original iterator).

Definition at line 82 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::fIter.

83  { return boost::apply_visitor(Dereferencer(), fIter); }
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
template<typename BeginIter , typename EndIter >
this_t& util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator++ ( )
inline

Increments the iterator (prefix operator).

Definition at line 90 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::fIter.

Referenced by util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator++().

91  { boost::apply_visitor(Incrementer(), fIter); return *this; }
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
template<typename BeginIter , typename EndIter >
this_t util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator++ ( int  )
inline

Increments the iterator (postfix operator).

Definition at line 98 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator++().

99  { auto old = *this; this_t::operator++(); return old; }
this_t & operator++()
Increments the iterator (prefix operator).
template<typename BeginIter , typename EndIter >
difference_type util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator- ( this_t const &  other) const
inline

Definition at line 117 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::fIter, and fhicl::detail::atom::value().

118  { return boost::apply_visitor(Difference(), fIter, other.fIter); }
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
template<typename BeginIter , typename EndIter >
this_t& util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator-- ( )
inline

Decrements the iterator (prefix operator).

Definition at line 94 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::fIter.

Referenced by util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator--().

95  { boost::apply_visitor(Decrementer(), fIter); return *this; }
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
template<typename BeginIter , typename EndIter >
this_t util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator-- ( int  )
inline

Decrements the iterator (postfix operator).

Definition at line 102 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator--().

103  { auto old = *this; this_t::operator--(); return old; }
this_t & operator--()
Decrements the iterator (prefix operator).
template<typename BeginIter , typename EndIter >
pointer util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator-> ( ) const
inline

Returns the pointed value (just like the original iterator).

Definition at line 86 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::fIter.

87  { return boost::apply_visitor(MemberAccessor(), fIter); }
boost::variant< begin_t, end_t > fIter
The actual iterator we store.
template<typename BeginIter , typename EndIter >
bool util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator== ( this_t const &  other) const
inline

Returns whether the other iterator is equal to this one.

Definition at line 110 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator!=().

111  { return !(this->operator!=(other)); }
bool operator!=(this_t const &other) const
Returns whether the other iterator is not equal to this one.
template<typename BeginIter , typename EndIter >
reference util::details::RangeForWrapperIterator< BeginIter, EndIter >::operator[] ( difference_type  offset) const
inline

Definition at line 114 of file RangeForWrapper.h.

References util::details::RangeForWrapperIterator< BeginIter, EndIter >::fIter.

115  { return boost::apply_visitor(IndexAccessor(offset), fIter); }
boost::variant< begin_t, end_t > fIter
The actual iterator we store.

Member Data Documentation


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