LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator > Class Template Reference

Iterator for geo::GeoIDdataContainer class. More...

#include "GeometryDataContainers.h"

Inheritance diagram for geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >:

Classes

struct  ExtraData_t
 

Public Types

using ID_t = typename Mapper_t::ID_t
 Type of the ID in this iterator. More...
 

Public Member Functions

 GeoIDdataContainerIterator ()=default
 Default constructor: undefined status. More...
 
 GeoIDdataContainerIterator (Mapper_t const &mapper, BaseIterator_t const &start, BaseIterator_t const &current)
 Constructor: points to data pointed by current. More...
 
template<typename OBaseIterator >
 GeoIDdataContainerIterator (GeoIDdataContainerIterator< Mapper_t, OBaseIterator > const &other, std::enable_if_t< std::is_convertible_v< OBaseIterator, BaseIterator_t >>=nullptr)
 Generalized copy constructor, only if argument iterator can be converted. More...
 
ID_t ID () const
 Returns the ID corresponding to the current element. More...
 

Private Types

using Mapper_t = GeoIDmapperClass
 < Type of mapping of the container this class iterates. More...
 
using BaseIterator_t = BaseIterator
 Type of iterator to the actual data. More...
 
using Index_t = typename Mapper_t::index_type
 Type of index in the container mapping. More...
 

Private Member Functions

BaseIterator_t const & current () const
 Returns the iterator to the current element. More...
 
BaseIterator_tcurrent ()
 
BaseIterator_t const & start () const
 Returns the iterator to the begin element. More...
 
Mapper_t const & mapper () const
 Returns the mapping of the container being iterated. More...
 
Index_t index () const
 Returns the index of the current element. More...
 

Private Attributes

ExtraData_t fData
 Data for extended features of this iterator. More...
 

Detailed Description

template<typename GeoIDmapperClass, typename BaseIterator>
class geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >

Iterator for geo::GeoIDdataContainer class.

Template Parameters
GeoIDdataContainerClasstype of the class being iterated
BaseIteratortype of iterator to the actual data
Note
These iterators haven't been extensively tested. Caveat emptor...

Definition at line 50 of file GeometryDataContainers.h.

Member Typedef Documentation

template<typename GeoIDmapperClass, typename BaseIterator>
using geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::BaseIterator_t = BaseIterator
private

Type of iterator to the actual data.

Definition at line 814 of file GeometryDataContainers.h.

template<typename GeoIDmapperClass, typename BaseIterator>
using geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::ID_t = typename Mapper_t::ID_t

Type of the ID in this iterator.

Definition at line 851 of file GeometryDataContainers.h.

template<typename GeoIDmapperClass, typename BaseIterator>
using geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::Index_t = typename Mapper_t::index_type
private

Type of index in the container mapping.

Definition at line 817 of file GeometryDataContainers.h.

template<typename GeoIDmapperClass, typename BaseIterator>
using geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::Mapper_t = GeoIDmapperClass
private

< Type of mapping of the container this class iterates.

Definition at line 812 of file GeometryDataContainers.h.

Constructor & Destructor Documentation

template<typename GeoIDmapperClass, typename BaseIterator>
geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::GeoIDdataContainerIterator ( )
default

Default constructor: undefined status.

template<typename GeoIDmapperClass, typename BaseIterator>
geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::GeoIDdataContainerIterator ( Mapper_t const &  mapper,
BaseIterator_t const &  start,
BaseIterator_t const &  current 
)
inline

Constructor: points to data pointed by current.

Definition at line 857 of file GeometryDataContainers.h.

860  : GeoIDdataContainerIterator::iterator_adaptor_(current), fData{&mapper, start}
861  {}
BaseIterator_t const & start() const
Returns the iterator to the begin element.
ExtraData_t fData
Data for extended features of this iterator.
BaseIterator_t const & current() const
Returns the iterator to the current element.
Mapper_t const & mapper() const
Returns the mapping of the container being iterated.
template<typename GeoIDmapperClass, typename BaseIterator>
template<typename OBaseIterator >
geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::GeoIDdataContainerIterator ( GeoIDdataContainerIterator< Mapper_t, OBaseIterator > const &  other,
std::enable_if_t< std::is_convertible_v< OBaseIterator, BaseIterator_t >>  = nullptr 
)
inline

Generalized copy constructor, only if argument iterator can be converted.

Definition at line 865 of file GeometryDataContainers.h.

868  : GeoIDdataContainerIterator::iterator_adaptor_(other.base()), fData(other.fData)
869  {}
ExtraData_t fData
Data for extended features of this iterator.

Member Function Documentation

template<typename GeoIDmapperClass, typename BaseIterator>
BaseIterator_t const& geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::current ( ) const
inlineprivate

Returns the iterator to the current element.

Definition at line 831 of file GeometryDataContainers.h.

832  {
833  return GeoIDdataContainerIterator::iterator_adaptor_::base();
834  }
template<typename GeoIDmapperClass, typename BaseIterator>
BaseIterator_t& geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::current ( )
inlineprivate

Definition at line 835 of file GeometryDataContainers.h.

835 { return GeoIDdataContainerIterator::iterator_adaptor_::base(); }
template<typename GeoIDmapperClass, typename BaseIterator>
ID_t geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::ID ( ) const
inline

Returns the ID corresponding to the current element.

Definition at line 872 of file GeometryDataContainers.h.

872 { return mapper().ID(index()); }
Mapper_t const & mapper() const
Returns the mapping of the container being iterated.
Index_t index() const
Returns the index of the current element.
template<typename GeoIDmapperClass, typename BaseIterator>
Index_t geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::index ( ) const
inlineprivate

Returns the index of the current element.

Definition at line 848 of file GeometryDataContainers.h.

848 { return static_cast<Index_t>(current() - start()); }
BaseIterator_t const & start() const
Returns the iterator to the begin element.
typename Mapper_t::index_type Index_t
Type of index in the container mapping.
BaseIterator_t const & current() const
Returns the iterator to the current element.
template<typename GeoIDmapperClass, typename BaseIterator>
Mapper_t const& geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::mapper ( ) const
inlineprivate

Returns the mapping of the container being iterated.

Definition at line 841 of file GeometryDataContainers.h.

References geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::ExtraData_t::mapper.

842  {
843  assert(fData.mapper);
844  return *(fData.mapper);
845  }
ExtraData_t fData
Data for extended features of this iterator.
Mapper_t const * mapper
Mapping of the container being iterated.
template<typename GeoIDmapperClass, typename BaseIterator>
BaseIterator_t const& geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::start ( ) const
inlineprivate

Returns the iterator to the begin element.

Definition at line 838 of file GeometryDataContainers.h.

References geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::ExtraData_t::start.

838 { return fData.start; }
ExtraData_t fData
Data for extended features of this iterator.
BaseIterator_t start
Iterator to the first element.

Member Data Documentation

template<typename GeoIDmapperClass, typename BaseIterator>
ExtraData_t geo::details::GeoIDdataContainerIterator< GeoIDmapperClass, BaseIterator >::fData
private

Data for extended features of this iterator.

Definition at line 828 of file GeometryDataContainers.h.


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