LDMX Software
|
iterator class so we can do range-based loops over digi collections More...
#include <HgcrocDigiCollection.h>
Public Member Functions | |
iterator (HgcrocDigiCollection &c, long index=0) | |
Connect the parent collection with an index to this iterator. | |
iterator & | operator++ () |
Increment the digi index and return the iterator afterwards. | |
iterator | operator++ (int) |
Increment the digi index and return the iterator before. | |
bool | operator== (iterator other) const |
Check if two iterators are on the same index. | |
bool | operator!= (iterator other) const |
Check if two iterators are not on the same index. | |
const HgcrocDigi | operator* () const |
De-reference this iterator by using the parent collection to get the actual digi at the index. | |
Private Attributes | |
long | digi_index_ {0} |
the index of the digi this iterator represents | |
HgcrocDigiCollection & | coll_ |
the parent collection this iterator is looping over | |
iterator class so we can do range-based loops over digi collections
We inherit from the standard iterator class and tag this iterator as one that de-references to an HgcrocDigi.
Internally, we are merely keeping track of the index of the digi in the collection and only getting the digi when the iterator is asked to de-reference.
Definition at line 440 of file HgcrocDigiCollection.h.
|
inlineexplicit |
Connect the parent collection with an index to this iterator.
Definition at line 444 of file HgcrocDigiCollection.h.
|
inline |
Check if two iterators are not on the same index.
Definition at line 462 of file HgcrocDigiCollection.h.
|
inline |
De-reference this iterator by using the parent collection to get the actual digi at the index.
Definition at line 467 of file HgcrocDigiCollection.h.
References coll_, digi_index_, and ldmx::HgcrocDigiCollection::getDigi().
|
inline |
Increment the digi index and return the iterator afterwards.
Definition at line 447 of file HgcrocDigiCollection.h.
References digi_index_.
|
inline |
Increment the digi index and return the iterator before.
Definition at line 452 of file HgcrocDigiCollection.h.
|
inline |
Check if two iterators are on the same index.
Definition at line 458 of file HgcrocDigiCollection.h.
References digi_index_.
|
private |
the parent collection this iterator is looping over
Definition at line 473 of file HgcrocDigiCollection.h.
Referenced by operator*().
|
private |
the index of the digi this iterator represents
Definition at line 471 of file HgcrocDigiCollection.h.
Referenced by operator*(), operator++(), and operator==().