OpenMS
DataFilters::DataFilter Struct Reference

Representation of a peak/feature filter combining FilterType, FilterOperation and a value (either double or String) More...

#include <OpenMS/PROCESSING/MISC/DataFilters.h>

Collaboration diagram for DataFilters::DataFilter:
[legend]

Public Member Functions

 DataFilter ()
 
 DataFilter (const FilterType type, const FilterOperation op, const double val, const String &meta_name="")
 ctor for common case of numerical filter More...
 
 DataFilter (const FilterType type, const FilterOperation op, const String &val, const String &meta_name="")
 ctor for common case of string filter More...
 
String toString () const
 Returns a string representation of the filter. More...
 
void fromString (const String &filter)
 Parses filter and sets the filter properties accordingly. More...
 
bool operator== (const DataFilter &rhs) const
 Equality operator. More...
 
bool operator!= (const DataFilter &rhs) const
 Inequality operator. More...
 

Public Attributes

FilterType field { DataFilters::INTENSITY }
 Field to filter. More...
 
FilterOperation op { DataFilters::GREATER_EQUAL}
 Filter operation. More...
 
double value { 0.0 }
 Value for comparison. More...
 
String value_string
 String value for comparison (for meta data) More...
 
String meta_name
 Name of the considered meta information (key) More...
 
bool value_is_numerical { false }
 use value or value_string ? More...
 

Detailed Description

Representation of a peak/feature filter combining FilterType, FilterOperation and a value (either double or String)

Constructor & Destructor Documentation

◆ DataFilter() [1/3]

DataFilter ( )
inline

◆ DataFilter() [2/3]

DataFilter ( const FilterType  type,
const FilterOperation  op,
const double  val,
const String meta_name = "" 
)
inline

ctor for common case of numerical filter

◆ DataFilter() [3/3]

DataFilter ( const FilterType  type,
const FilterOperation  op,
const String val,
const String meta_name = "" 
)
inline

ctor for common case of string filter

Member Function Documentation

◆ fromString()

void fromString ( const String filter)

Parses filter and sets the filter properties accordingly.

This method accepts the format provided by toString().

Exceptions
Exception::InvalidValueis thrown when the filter is not formatted properly

◆ operator!=()

bool operator!= ( const DataFilter rhs) const

Inequality operator.

◆ operator==()

bool operator== ( const DataFilter rhs) const

Equality operator.

◆ toString()

String toString ( ) const

Returns a string representation of the filter.

Member Data Documentation

◆ field

Field to filter.

Referenced by DataFilters::passes().

◆ meta_name

String meta_name

Name of the considered meta information (key)

Referenced by DataFilters::passes().

◆ op

Filter operation.

Referenced by DataFilters::passes().

◆ value

double value { 0.0 }

Value for comparison.

Referenced by DataFilters::passes().

◆ value_is_numerical

bool value_is_numerical { false }

use value or value_string ?

◆ value_string

String value_string

String value for comparison (for meta data)