Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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 51 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 853 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 887 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 856 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 851 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 894 of file GeometryDataContainers.h.

899  : GeoIDdataContainerIterator::iterator_adaptor_(current)
900  , fData{ &mapper, start }
901  {}
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 905 of file GeometryDataContainers.h.

910  : GeoIDdataContainerIterator::iterator_adaptor_(other.base())
911  , fData(other.fData)
912  {}
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 870 of file GeometryDataContainers.h.

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

Definition at line 872 of file GeometryDataContainers.h.

873  { 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 915 of file GeometryDataContainers.h.

915 { 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 883 of file GeometryDataContainers.h.

883 { 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 879 of file GeometryDataContainers.h.

880  { assert(fData.mapper); return *(fData.mapper); }
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 876 of file GeometryDataContainers.h.

876 { 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 867 of file GeometryDataContainers.h.


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