| OpenMS 2.5.0

Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > Class Template Reference

Forward iterator for an area of peaks in an experiment. More...

`#include <OpenMS/KERNEL/AreaIterator.h>`

Inheritance diagram for AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >:

## Public Types

typedef double | CoordinateType
typedef ValueT | PeakType
typedef SpectrumIteratorT | SpectrumIteratorType
typedef PeakIteratorT | PeakIteratorType
Typedefs for STL compliance
typedef ValueT | value_type
| The iterator's value type. More...
typedef ReferenceT | reference
| The reference type as returned by operator*() More...
typedef PointerT | pointer
| The pointer type as returned by operator->() More...
typedef unsigned int | difference_type
| The difference type. More...

## Public Member Functions

| AreaIterator (SpectrumIteratorType first, SpectrumIteratorType begin, SpectrumIteratorType end, CoordinateType low_mz, CoordinateType high_mz)
| Constructor for the begin iterator. More...
| AreaIterator ()
| Default constructor (for the end iterator) More...
| ~AreaIterator ()
| Destructor. More...
| AreaIterator (const AreaIterator &rhs)
| Copy constructor. More...
AreaIterator & | operator= (const AreaIterator &rhs)
| Assignment operator. More...
bool | operator== (const AreaIterator &rhs) const
| Test for equality. More...
bool | operator!= (const AreaIterator &rhs) const
| Test for inequality. More...
AreaIterator & | operator++ ()
| Step forward by one (prefix operator) More...
AreaIterator | operator++ (int)
| Step forward by one (postfix operator) More...
reference | operator* () const
| Dereferencing of this pointer yields the underlying peak. More...
pointer | operator-> () const
| Dereferencing of this pointer yields the underlying peak. More...
CoordinateType | getRT () const
| returns the retention time of the current scan More...
PeakIndex | getPeakIndex () const
| returns the PeakIndex corresponding to the current iterator position More...

## Private Member Functions

void | nextScan_ ()

## Private Attributes

SpectrumIteratorType | first_
| Iterator to the first scan of the map (needed to calculate the index) More...
SpectrumIteratorType | current_scan_
| Iterator to the current spectrum. More...
SpectrumIteratorType | end_scan_
| Past-the-end iterator of spectra. More...
PeakIteratorType | current_peak_
| Iterator to the current peak. More...
PeakIteratorType | end_peak_
| Past-the-end iterator of peaks in the current spectrum. More...
CoordinateType | low_mz_
| low m/z boundary More...
CoordinateType | high_mz_
| high m/z boundary More...
bool | is_end_
| Flag that indicates that this iterator is the end iterator. More...

## Detailed Description

### template<class ValueT, class ReferenceT, class PointerT, class SpectrumIteratorT, class PeakIteratorT>
class OpenMS::Internal::AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >

Forward iterator for an area of peaks in an experiment.

This iterator allows us to move through the data structure in a linear manner i.e. we don't need to jump to the next spectrum manually.

Note
  This iterator iterates over spectra with MS level 1 only!

## Member Typedef Documentation

## ◆ CoordinateType

typedef double CoordinateType

## ◆ difference_type

typedef unsigned int difference_type

The difference type.

## ◆ PeakIteratorType

typedef PeakIteratorT PeakIteratorType

## ◆ PeakType

typedef ValueT PeakType

## ◆ pointer

typedef PointerT pointer

The pointer type as returned by operator->()

## ◆ reference

typedef ReferenceT reference

The reference type as returned by operator*()

## ◆ SpectrumIteratorType

typedef SpectrumIteratorT SpectrumIteratorType

## ◆ value_type

typedef ValueT value_type

The iterator's value type.

## Constructor & Destructor Documentation

## ◆ AreaIterator() [1/3]

AreaIterator | ( | SpectrumIteratorType | first,
|  | SpectrumIteratorType | begin,
|  | SpectrumIteratorType | end,
|  | CoordinateType | low_mz,
|  | CoordinateType | high_mz
| ) |  |

inline

Constructor for the begin iterator.

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_().

## ◆ AreaIterator() [2/3]

AreaIterator | ( |  | ) |

inline

Default constructor (for the end iterator)

## ◆ ~AreaIterator()

~AreaIterator | ( |  | ) |

inline

Destructor.

## ◆ AreaIterator() [3/3]

AreaIterator | ( | const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > & | rhs | ) |

inline

Copy constructor.

## Member Function Documentation

## ◆ getPeakIndex()

PeakIndex getPeakIndex | ( |  | ) | const

inline

returns the PeakIndex corresponding to the current iterator position

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_scan_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::first_, and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::is_end_.

## ◆ getRT()

CoordinateType getRT | ( |  | ) | const

inline

returns the retention time of the current scan

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_scan_.

Referenced by MetaProSIPXICExtraction::extractXICs().

## ◆ nextScan_()

void nextScan_ | ( |  | ) |

inline private

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_scan_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::end_peak_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::end_scan_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::high_mz_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::is_end_, and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::low_mz_.

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::AreaIterator(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator++().

## ◆ operator!=()

bool operator!= | ( | const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > & | rhs | ) | const

inline

Test for inequality.

## ◆ operator*()

reference operator* | ( |  | ) | const

inline

Dereferencing of this pointer yields the underlying peak.

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_.

## ◆ operator++() [1/2]

AreaIterator& operator++ | ( |  | ) |

inline

Step forward by one (prefix operator)

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_scan_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::end_peak_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::is_end_, and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_().

## ◆ operator++() [2/2]

AreaIterator operator++ | ( | int |  | ) |

inline

Step forward by one (postfix operator)

## ◆ operator->()

pointer operator-> | ( |  | ) | const

inline

Dereferencing of this pointer yields the underlying peak.

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_.

## ◆ operator=()

AreaIterator& operator= | ( | const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > & | rhs | ) |

inline

Assignment operator.

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_scan_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::end_peak_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::end_scan_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::first_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::high_mz_, AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::is_end_, and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::low_mz_.

## ◆ operator==()

bool operator== | ( | const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > & | rhs | ) | const

inline

Test for equality.

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_, and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::is_end_.

## Member Data Documentation

## ◆ current_peak_

PeakIteratorType current_peak_

private

Iterator to the current peak.

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::getPeakIndex(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator*(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator++(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator->(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator==().

## ◆ current_scan_

SpectrumIteratorType current_scan_

private

Iterator to the current spectrum.

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::getPeakIndex(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::getRT(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator++(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=().

## ◆ end_peak_

PeakIteratorType end_peak_

private

Past-the-end iterator of peaks in the current spectrum.

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator++(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=().

## ◆ end_scan_

SpectrumIteratorType end_scan_

private

Past-the-end iterator of spectra.

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=().

## ◆ first_

SpectrumIteratorType first_

private

Iterator to the first scan of the map (needed to calculate the index)

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::getPeakIndex(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=().

## ◆ high_mz_

CoordinateType high_mz_

private

high m/z boundary

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=().

## ◆ is_end_

bool is_end_

private

Flag that indicates that this iterator is the end iterator.

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::getPeakIndex(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator++(), AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator==().

## ◆ low_mz_

CoordinateType low_mz_

private

low m/z boundary

Referenced by AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::nextScan_(), and AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::operator=().