libpappsomspp
Library for mass spectrometry
datapoint.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <limits>
5 #include <memory>
6 
7 #include <QDataStream>
8 
9 #include <QMetaType>
10 
11 #include "../exportinmportconfig.h"
12 #include "../types.h"
13 
14 
15 namespace pappso
16 {
17 struct DataPoint;
18 typedef std::shared_ptr<const DataPoint> DataPointCstSPtr;
19 
20 
22 {
25 
26  DataPoint();
27  DataPoint(const DataPoint &other);
29  DataPoint(std::pair<pappso_double, pappso_double> pair);
30  DataPoint(const QString &text);
31 
32  // For debugging purposes.
33  //~DataPoint();
34 
35  DataPointCstSPtr makeDataPointCstSPtr() const;
36 
37  void initialize(pappso_double x, pappso_double y);
38  void initialize(const DataPoint &other);
39  bool initialize(const QString &text);
40 
41  void reset();
42 
43  void incrementX(pappso_double value);
44  void incrementY(pappso_double value);
45 
46  bool operator==(const DataPoint &other) const;
47 
48  DataPoint &operator=(const DataPoint &other);
49 
50  bool isValid() const;
51 
52  QString toString() const;
53  QString toString(int decimals) const;
54 };
55 
56 PMSPP_LIB_DECL QDataStream &operator<<(QDataStream &out, const DataPoint &dataPoint);
57 PMSPP_LIB_DECL QDataStream &operator>>(QDataStream &out, DataPoint &dataPoint);
58 } // namespace pappso
59 
61 extern int dataPointMetaTypeId;
62 
int dataPointCstSPtrMetaTypeId
Definition: datapoint.cpp:27
Q_DECLARE_METATYPE(pappso::DataPoint)
int dataPointMetaTypeId
Definition: datapoint.cpp:23
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
QDataStream & operator<<(QDataStream &outstream, const MassSpectrum &massSpectrum)
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
double pappso_double
A type definition for doubles.
Definition: types.h:49
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition: datapoint.h:17
bool operator==(Aa const &l, Aa const &r)
Definition: aa.cpp:280