Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Public Attributes | List of all members
PeakIndex Struct Reference

Index of a peak or feature. More...

#include <OpenMS/KERNEL/PeakIndex.h>

Public Member Functions

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

Public Attributes

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

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)
inlineexplicit

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::Preconditionis 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::Preconditionis 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::Preconditionis 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

Size peak
Size spectrum

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:32 using doxygen 1.8.5