Go to the documentation of this file.
24 #ifndef _MZRTFIELD_HPP_
25 #define _MZRTFIELD_HPP_
31 #include "boost/shared_ptr.hpp"
32 #include "boost/concept/assert.hpp"
33 #include "boost/concept/usage.hpp"
42 using chemistry::MZTolerance;
53 typedef boost::shared_ptr<T> TPtr;
55 bool operator()(
const T& a,
const T& b)
const
57 if (a.mz < b.mz)
return true;
58 if (b.mz < a.mz)
return false;
59 return (a.retentionTime < b.retentionTime);
62 bool operator()(
const TPtr& a,
const TPtr& b)
const
64 return (*
this)(*a, *b);
75 BOOST_CONCEPT_USAGE(HasMZRT)
81 a = c.retentionTimeMin();
82 a = c.retentionTimeMax();
94 struct MZRTField :
public std::set< boost::shared_ptr<T>, LessThan_MZRT<T> >
98 typedef boost::shared_ptr<T>
TPtr;
102 template <
typename RTMatches>
120 template <
typename T>
129 template <
typename T>
147 template <
typename T>
165 template <
typename T>
166 template <
typename RTMatches>
167 std::vector< boost::shared_ptr<T> >
174 target->mz =
mz - mzTolerance;
177 target->mz =
mz + mzTolerance;
182 std::vector<TPtr> result;
186 result.push_back(*it);
192 template <
typename T>
196 range = this->equal_range(p);
199 found = std::find(range.first, range.second, p);
201 if (found == range.second)
throw std::runtime_error(
"[MZRTField::remove()] TPtr not found.");
211 #endif // _MZRTFIELD_HPP_
void remove(const TPtr &p)
remove an object via a shared reference, rather than an iterator into the set
struct for expressing m/z tolerance in either amu or ppm
MZRTField is a std::set of boost::shared_ptrs, stored as a binary tree ordered by LessThan_MZRT.
RTMatches_Contains(double rt, double rtTolerance=0)
predicate returns true iff the object's retention time range is completely contained within the range...
predicate always returns true
boost::shared_ptr< T > TPtr
std::vector< TPtr > find(double mz, MZTolerance mzTolerance, RTMatches matches) const
find all objects with a given m/z, within a given m/z tolerance, satisfying the 'matches' predicate
PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, PepxmlRecordReader &prr)
bool operator()(const T &t) const
MZRTField< pwiz::data::peakdata::Feature > FeatureField
predicate returns true iff the object's retention time range contains the specified retention time
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
bool operator()(const T &t) const
RTMatches_IsContainedIn(const T &reference, double rtTolerance=0)
bool operator()(const T &t) const
MZRTField< pwiz::data::peakdata::Peakel > PeakelField