LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::TrackPointIterator< TrackProxy > Class Template Reference

#include "Track.h"

Public Types

Iterator traits
using difference_type = std::ptrdiff_t
 
using value_type = TrackPoint
 
using pointer = TrackPoint const *
 
using reference = TrackPoint
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

 TrackPointIterator ()=default
 
 TrackPointIterator (track_proxy_t const &track, std::size_t index)
 
TrackPointIteratoroperator++ ()
 
TrackPointIterator operator++ (int)
 
value_type operator* () const
 
bool operator== (TrackPointIterator const &other) const
 
bool operator!= (TrackPointIterator const &other) const
 

Private Types

using track_proxy_t = TrackProxy
 

Private Attributes

track_proxy_t const * track = nullptr
 
std::size_t index = std::numeric_limits<std::size_t>::max()
 

Detailed Description

template<typename TrackProxy>
class proxy::TrackPointIterator< TrackProxy >

Iterator for points of a track proxy. Only supports range-for loops.

Definition at line 252 of file Track.h.

Member Typedef Documentation

template<typename TrackProxy >
using proxy::TrackPointIterator< TrackProxy >::difference_type = std::ptrdiff_t

Definition at line 1258 of file Track.h.

template<typename TrackProxy >
using proxy::TrackPointIterator< TrackProxy >::iterator_category = std::input_iterator_tag

Definition at line 1263 of file Track.h.

template<typename TrackProxy >
using proxy::TrackPointIterator< TrackProxy >::pointer = TrackPoint const*

Definition at line 1260 of file Track.h.

template<typename TrackProxy >
using proxy::TrackPointIterator< TrackProxy >::reference = TrackPoint

Definition at line 1261 of file Track.h.

template<typename TrackProxy >
using proxy::TrackPointIterator< TrackProxy >::track_proxy_t = TrackProxy
private

Definition at line 1250 of file Track.h.

template<typename TrackProxy >
using proxy::TrackPointIterator< TrackProxy >::value_type = TrackPoint

Definition at line 1259 of file Track.h.

Constructor & Destructor Documentation

template<typename TrackProxy >
proxy::TrackPointIterator< TrackProxy >::TrackPointIterator ( )
default
template<typename TrackProxy >
proxy::TrackPointIterator< TrackProxy >::TrackPointIterator ( track_proxy_t const &  track,
std::size_t  index 
)
inline

Definition at line 1268 of file Track.h.

1268  : track(&track), index(index)
1269  {}
track_proxy_t const * track
Definition: Track.h:1252

Member Function Documentation

template<typename TrackProxy >
bool proxy::TrackPointIterator< TrackProxy >::operator!= ( TrackPointIterator< TrackProxy > const &  other) const
inline

Definition at line 1295 of file Track.h.

References proxy::TrackPointIterator< TrackProxy >::index, and proxy::TrackPointIterator< TrackProxy >::track.

1296  {
1297  return (index != other.index) || (track != other.track);
1298  }
track_proxy_t const * track
Definition: Track.h:1252
template<typename TrackProxy >
value_type proxy::TrackPointIterator< TrackProxy >::operator* ( ) const
inline

Definition at line 1285 of file Track.h.

References proxy::makeTrackPointData().

1286  {
1287  return static_cast<value_type>(makeTrackPointData(*track, index));
1288  }
TrackPointData makeTrackPointData(TrackProxy const &track, std::size_t index)
Returns an object with information about the specified track point.
Definition: Track.h:684
TrackPoint value_type
Definition: Track.h:1259
track_proxy_t const * track
Definition: Track.h:1252
template<typename TrackProxy >
TrackPointIterator& proxy::TrackPointIterator< TrackProxy >::operator++ ( )
inline

Definition at line 1271 of file Track.h.

1272  {
1273  ++index;
1274  return *this;
1275  }
template<typename TrackProxy >
TrackPointIterator proxy::TrackPointIterator< TrackProxy >::operator++ ( int  )
inline

Definition at line 1277 of file Track.h.

1278  {
1279  auto it = *this;
1280  this->operator++();
1281  return it;
1282  }
TrackPointIterator & operator++()
Definition: Track.h:1271
template<typename TrackProxy >
bool proxy::TrackPointIterator< TrackProxy >::operator== ( TrackPointIterator< TrackProxy > const &  other) const
inline

Definition at line 1290 of file Track.h.

References proxy::TrackPointIterator< TrackProxy >::index, and proxy::TrackPointIterator< TrackProxy >::track.

1291  {
1292  return (index == other.index) && (track == other.track);
1293  }
track_proxy_t const * track
Definition: Track.h:1252

Member Data Documentation

template<typename TrackProxy >
std::size_t proxy::TrackPointIterator< TrackProxy >::index = std::numeric_limits<std::size_t>::max()
private
template<typename TrackProxy >
track_proxy_t const* proxy::TrackPointIterator< TrackProxy >::track = nullptr
private

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