Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Public Attributes

PeakIndex Struct Reference

Index of a peak or feature. More...

#include <OpenMS/KERNEL/PeakIndex.h>

List of all members.

Public Member Functions

 PeakIndex ()
 Default constructor. Creates an invalid peak reference.
 PeakIndex (Size peak)
 Constructor that sets the peak index (for feaure maps).
 PeakIndex (Size spectrum, Size peak)
 Constructor that sets the peak and spectrum index (for peak maps).
bool isValid () const
 returns if the current peak ref is valid
void clear ()
 Invalidates the current index.
template<typename FeatureMapType >
const FeatureMapType::value_type & getFeature (const FeatureMapType &map) const
 Access to the feature (or consensus feature) corresponding to this index.
template<typename PeakMapType >
const PeakMapType::PeakType & getPeak (const PeakMapType &map) const
 Access to a peak corresponding to this index.
template<typename PeakMapType >
const PeakMapType::SpectrumType & getSpectrum (const PeakMapType &map) const
 Access to a spectrum corresponding to this index.
bool operator== (const PeakIndex &rhs) const
 Equality operator.
bool operator!= (const PeakIndex &rhs) const
 Inequality operator.

Public Attributes

Size peak
 Peak or feature index.
Size spectrum
 Spectrum index.

Detailed Description

Index of a peak or feature.

This struct can be used to store both peak or feature indices.


Constructor & Destructor Documentation

PeakIndex (  )  [inline]

Default constructor. Creates an invalid peak reference.

PeakIndex ( Size  peak  )  [inline, explicit]

Constructor that sets the peak index (for feaure maps).

PeakIndex ( Size  spectrum,
Size  peak 
) [inline]

Constructor that sets the peak and spectrum index (for peak maps).


Member Function Documentation

void clear (  )  [inline]

Invalidates the current index.

References PeakIndex::peak, and PeakIndex::spectrum.

const FeatureMapType::value_type& getFeature ( const FeatureMapType &  map  )  const [inline]

Access to the feature (or consensus feature) corresponding to this index.

This method is intended for arrays of features e.g. FeatureMap

The main advantage of using this method instead accessing the data directly is that range check performed in debug mode.

Exceptions:
Exception::Precondition is thrown if this index is invalid for the map (only in debug mode)

References OPENMS_PRECONDITION, and PeakIndex::peak.

const PeakMapType::PeakType& getPeak ( const PeakMapType &  map  )  const [inline]

Access to a peak corresponding to this index.

This method is intended for arrays of DSpectra e.g. MSExperiment

The main advantage of using this method instead accessing the data directly is that range check performed in debug mode.

Exceptions:
Exception::Precondition is thrown if this index is invalid for the map (only in debug mode)

References OPENMS_PRECONDITION, PeakIndex::peak, and PeakIndex::spectrum.

const PeakMapType::SpectrumType& getSpectrum ( const PeakMapType &  map  )  const [inline]

Access to a spectrum corresponding to this index.

This method is intended for arrays of DSpectra e.g. MSExperiment.

The main advantage of using this method instead accessing the data directly is that range check performed in debug mode.

Exceptions:
Exception::Precondition is thrown if this index is invalid for the map (only in debug mode)

References OPENMS_PRECONDITION, and PeakIndex::spectrum.

bool isValid (  )  const [inline]

returns if the current peak ref is valid

References PeakIndex::peak.

bool operator!= ( const PeakIndex rhs  )  const [inline]

Inequality operator.

References PeakIndex::peak, and PeakIndex::spectrum.

bool operator== ( const PeakIndex rhs  )  const [inline]

Equality operator.

References PeakIndex::peak, and PeakIndex::spectrum.


Member Data Documentation


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:55 using doxygen 1.7.1