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

FeatureHandle Class Reference
[Kernel]

Representation of a Peak2D, RichPeak2D or Feature . More...

#include <OpenMS/KERNEL/FeatureHandle.h>

Inheritance diagram for FeatureHandle:
Peak2D UniqueIdInterface FeatureHandle::FeatureHandleMutable_

List of all members.

Classes

class  FeatureHandleMutable_
 Helper class returned by FeatureHandle::asMutable(), which see. More...
struct  IndexLess
 Comparator by map and unique id. More...

Public Types

Type definitions

typedef Int ChargeType
 Charge type.
typedef Real WidthType
 Feature width type.

Public Member Functions

bool operator== (const FeatureHandle &i) const
 Equality operator.
bool operator!= (const FeatureHandle &i) const
 Equality operator.
Constructors and destructor

 FeatureHandle ()
 Default constructor.
 FeatureHandle (UInt64 map_index, const Peak2D &point, UInt64 element_index)
 Constructor with map index, element index and position.
 FeatureHandle (UInt64 map_index, const BaseFeature &feature)
 Constructor from map index and basic feature.
 FeatureHandle (const FeatureHandle &rhs)
 Copy constructor.
FeatureHandleoperator= (const FeatureHandle &rhs)
 Assignment operator.
virtual ~FeatureHandle ()
 Destructor.
FeatureHandleMutable_asMutable () const
 Override (most of all) constness.
Accessors

UInt64 getMapIndex () const
 Returns the map index.
void setMapIndex (UInt64 i)
 Set the map index.
void setCharge (ChargeType charge)
 Sets the charge.
ChargeType getCharge () const
 Returns the charge.
void setWidth (WidthType width)
 Sets the width (FWHM).
WidthType getWidth () const
 Returns the width (FWHM).

Protected Attributes

UInt64 map_index_
 Index of the element's container.
Int charge_
 Charge of the feature.
Real width_
 Width of the feature (FWHM).

Detailed Description

Representation of a Peak2D, RichPeak2D or Feature .

The position and the intensity of the referenced feature are stored in the base class Peak2D. The original datapoint is referenced by the map and unique id.


Member Typedef Documentation

typedef Int ChargeType

Charge type.

typedef Real WidthType

Feature width type.


Constructor & Destructor Documentation

FeatureHandle (  )  [inline]

Default constructor.

FeatureHandle ( UInt64  map_index,
const Peak2D point,
UInt64  element_index 
) [inline]

Constructor with map index, element index and position.

FeatureHandle ( UInt64  map_index,
const BaseFeature feature 
) [inline]

Constructor from map index and basic feature.

FeatureHandle ( const FeatureHandle rhs  )  [inline]

Copy constructor.

virtual ~FeatureHandle (  )  [inline, virtual]

Destructor.


Member Function Documentation

FeatureHandle::FeatureHandleMutable_ & asMutable (  )  const [inline]

Override (most of all) constness.

We provide this such that you can modify instances FeatureHandle which are stored within a ConsensusFeature. Note that std::set does not provide non-const iterators, because these could be used to change the relative ordering of the elements, and iterators are (by design/concept) unaware of their containers. Since ConsensusFeature uses the ordering by IndexLess (which see), you must not modify the map index of element index if there is more than one FeatureHandle stored in a ConsensusFeature. Consequently, we "disable" setMapIndex() or setElementIndex() even within FeatureHandleMutable_. On the other hand, it is perfectly safe to apply FeatureHandle::setRT(), FeatureHandle::setMZ(), FeatureHandle::setIntensity(), FeatureHandle::setCharge(), etc..

ChargeType getCharge (  )  const [inline]

Returns the charge.

UInt64 getMapIndex (  )  const [inline]

Returns the map index.

WidthType getWidth (  )  const [inline]

Returns the width (FWHM).

bool operator!= ( const FeatureHandle i  )  const [inline]

Equality operator.

bool operator== ( const FeatureHandle i  )  const [inline]
void setCharge ( ChargeType  charge  )  [inline]

Sets the charge.

void setMapIndex ( UInt64  i  )  [inline]

Set the map index.

void setWidth ( WidthType  width  )  [inline]

Sets the width (FWHM).


Member Data Documentation

Int charge_ [protected]

Charge of the feature.

Referenced by FeatureHandle::operator=(), and FeatureHandle::operator==().

UInt64 map_index_ [protected]
Real width_ [protected]

Width of the feature (FWHM).

Referenced by FeatureHandle::operator=(), and FeatureHandle::operator==().


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