Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
openms/include/OpenMS/INTERFACES/ISpectrumAccess.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hannes Roest $
32 // $Authors: Hannes Roest, Witold Wolski $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_INTERFACES_ISPECTRUMACCESS_H
36 #define OPENMS_INTERFACES_ISPECTRUMACCESS_H
37 
39 
40 #include <vector>
41 #include <string>
42 #include <boost/shared_ptr.hpp>
43 
44 namespace OpenMS
45 {
46 namespace Interfaces
47 {
48 
52  class OPENMS_DLLAPI ISpectraReader
53  {
54 public:
55  virtual ~ISpectraReader() {}
57  virtual SpectrumPtr getSpectrumById(int id) const = 0;
59  virtual SpectrumPtr getSpectrumById(const std::string& id) const = 0;
61  virtual std::vector<std::size_t> getSpectraByRT(double RT, double deltaRT) const = 0;
63  virtual size_t getNrSpectra() const = 0;
65  virtual SpectrumMetaPtr getSpectrumMetaById(int id) const = 0;
66 
67  /*
68  * Do we need an Iterator here?
69  * We would have to provide our own iterator wrapper class because we don't
70  * know whether all the spectra are loaded at any given timepoint
71  typedef SpectrumPtr const ConstSpectraIterator;
72  ConstSpectraIterator beginSpectra() const;
73  ConstSpectraIterator endSpectra() const;
74  */
75  };
76  typedef boost::shared_ptr<ISpectraReader> SpectraReaderPtr;
77 
78 
82  class OPENMS_DLLAPI IChromatogramsReader
83  {
84 public:
85  virtual ~IChromatogramsReader() {}
87  virtual ChromatogramPtr getChromatogramById(int id) const = 0;
89  virtual ChromatogramPtr getChromatogramById(const std::string& id) const = 0;
91  virtual std::vector<std::size_t> getChromatogramByPrecursorMZ(double mz, double deltaMZ) const = 0;
93  virtual std::size_t getNrChromatograms() const = 0;
95  virtual ChromatogramMetaPtr getChromatogramMetaById(int id) const = 0;
96 
97  /*
98  * Do we need an Iterator here?
99  * We would have to provide our own iterator wrapper class because we don't
100  * know whether all the chromatograms are loaded at any given timepoint
101  ConstChromatogramIterator beginChromatograms() const;
102  ConstChromatogramIterator endChromatograms() const;
103  */
104  };
105  typedef boost::shared_ptr<IChromatogramsReader> ChromatogramsReaderPtr;
106 
107 
108  class OPENMS_DLLAPI ISpectraWriter
109  {
110 public:
111  virtual ~ISpectraWriter() {}
113  virtual void appendSpectrum(SpectrumPtr spectrum, bool write_through=false) = 0;
115  virtual void flush() = 0;
116  };
117  typedef boost::shared_ptr<ISpectraWriter> SpectraWriterPtr;
118 
119 
120  class OPENMS_DLLAPI IChromatogramsWriter
121  {
122 public:
125  virtual void appendChromatogram(ChromatogramPtr chromatogram, bool write_through=false) = 0;
127  virtual void flush() = 0;
128  };
129  typedef boost::shared_ptr<IChromatogramsWriter> ChromatogramsWriterPtr;
130 
131 } //end namespace Interfaces
132 } //end namespace OpenMS
133 
134 #endif
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:237
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:157
boost::shared_ptr< IChromatogramsReader > ChromatogramsReaderPtr
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:105
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:120
boost::shared_ptr< IChromatogramsWriter > ChromatogramsWriterPtr
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:129
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
boost::shared_ptr< ISpectraWriter > SpectraWriterPtr
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:117
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:108
The interface of read-access to a list of chromatograms.
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:82
virtual ~IChromatogramsWriter()
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:123
virtual ~ISpectraReader()
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:55
boost::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:100
boost::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:180
virtual ~IChromatogramsReader()
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:85
virtual ~ISpectraWriter()
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:111
boost::shared_ptr< ISpectraReader > SpectraReaderPtr
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:76
The interface of read-access to a list of spectra.
Definition: openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:52

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:01 using doxygen 1.8.13