Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

DataFilters Class Reference

#include <OpenMS/FILTERING/DATAREDUCTION/DataFilters.h>

List of all members.


Detailed Description

DataFilter array providing some convenience functions.

Improvement:
This might be speeded up by using a function pointer for each filter instead of the nested if clauses. Test this approach. (Marc)

Public Types

enum  FilterType { INTENSITY, QUALITY, CHARGE, META_DATA }
 Information to filter. More...
enum  FilterOperation { GREATER_EQUAL, EQUAL, LESS_EQUAL, EXISTS }
 Filter operation. More...

Public Member Functions

UInt size () const
 Filter count.
const DataFilteroperator[] (UInt index) const throw (Exception::IndexOverflow)
 Filter accessor.
void add (const DataFilter &filter)
 Adds a filter.
void remove (UInt index) throw (Exception::IndexOverflow)
 Removes the filter corresponding to index.
void replace (UInt index, const DataFilter &filter) throw (Exception::IndexOverflow)
 Replaces the filter corresponding to index.
void clear ()
 Removes all filters.
template<class PeakType>
bool passes (const PeakType &peak) const
 Returns if the peak fulfills the current filter criteria.
bool passes (const Feature &feature) const
 Returns if the feature fulfills the current filter criteria.

Protected Member Functions

bool metaPasses_ (const MetaInfoInterface &meta_interface, const DataFilters::DataFilter &filter, UInt index) const
 Returns if the meta value at index of meta_interface (a peak or feature) passes the filter.

Protected Attributes

std::vector< DataFilterfilters_
 Array of DataFilters.
std::vector< UIntmeta_indices_
 Vector of meta indices acting as index cache.

Classes

struct  DataFilter
 Representation of a peak/feature filter combining FilterType, FilterOperation and a value. More...

Member Enumeration Documentation

enum FilterType

Information to filter.

Enumerator:
INTENSITY  Filter the intensity value.
QUALITY  Filter the overall quality value.
CHARGE  Filter the charge value.
META_DATA  Filter meta data.

enum FilterOperation

Filter operation.

Enumerator:
GREATER_EQUAL  Greater than the value or equal to the value.
EQUAL  Equal to the value.
LESS_EQUAL  Less than the value or equal to the value.
EXISTS  Only for META_DATA filter type, tests if meta data exists.


Member Function Documentation

UInt size (  )  const

Filter count.

const DataFilter& operator[] ( UInt  index  )  const throw (Exception::IndexOverflow)

Filter accessor.

void add ( const DataFilter filter  ) 

Adds a filter.

void remove ( UInt  index  )  throw (Exception::IndexOverflow)

Removes the filter corresponding to index.

void replace ( UInt  index,
const DataFilter filter 
) throw (Exception::IndexOverflow)

Replaces the filter corresponding to index.

void clear (  ) 

Removes all filters.

bool passes ( const PeakType &  peak  )  const [inline]

Returns if the peak fulfills the current filter criteria.

bool passes ( const Feature feature  )  const

Returns if the feature fulfills the current filter criteria.

bool metaPasses_ ( const MetaInfoInterface meta_interface,
const DataFilters::DataFilter filter,
UInt  index 
) const [inline, protected]

Returns if the meta value at index of meta_interface (a peak or feature) passes the filter.


Member Data Documentation

std::vector<DataFilter> filters_ [protected]

Array of DataFilters.

std::vector<UInt> meta_indices_ [protected]

Vector of meta indices acting as index cache.


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1