Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
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-2013.
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 dont
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  OPENMS_DLLAPI 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 dont
100  * know whether all the chromatograms are loaded at any given timepoint
101  ConstChromatogramIterator beginChromatograms() const;
102  ConstChromatogramIterator endChromatograms() const;
103  */
104  };
105  OPENMS_DLLAPI 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  OPENMS_DLLAPI typedef boost::shared_ptr<ISpectraWriter> SpectraWriterPtr;
118 
119 
120  class OPENMS_DLLAPI IChromatogramsWriter
121  {
122 public:
123  virtual ~IChromatogramsWriter() {};
125  virtual void appendChromatogram(ChromatogramPtr chromatogram, bool write_through=false) = 0;
127  virtual void flush() = 0;
128  };
129  OPENMS_DLLAPI typedef boost::shared_ptr<IChromatogramsWriter> ChromatogramsWriterPtr;
130 
131 } //end namespace Interfaces
132 } //end namespace OpenMS
133 
134 #endif
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: INTERFACES/DataStructures.h:237
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: INTERFACES/DataStructures.h:157
boost::shared_ptr< IChromatogramsReader > ChromatogramsReaderPtr
Definition: INTERFACES/ISpectrumAccess.h:105
Definition: INTERFACES/ISpectrumAccess.h:120
boost::shared_ptr< IChromatogramsWriter > ChromatogramsWriterPtr
Definition: INTERFACES/ISpectrumAccess.h:129
boost::shared_ptr< ISpectraWriter > SpectraWriterPtr
Definition: INTERFACES/ISpectrumAccess.h:117
Definition: INTERFACES/ISpectrumAccess.h:108
The interface of read-access to a list of chromatograms.
Definition: INTERFACES/ISpectrumAccess.h:82
virtual ~IChromatogramsWriter()
Definition: INTERFACES/ISpectrumAccess.h:123
virtual ~ISpectraReader()
Definition: INTERFACES/ISpectrumAccess.h:55
boost::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition: INTERFACES/DataStructures.h:100
boost::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition: INTERFACES/DataStructures.h:180
virtual ~IChromatogramsReader()
Definition: INTERFACES/ISpectrumAccess.h:85
virtual ~ISpectraWriter()
Definition: INTERFACES/ISpectrumAccess.h:111
boost::shared_ptr< ISpectraReader > SpectraReaderPtr
Definition: INTERFACES/ISpectrumAccess.h:76
The interface of read-access to a list of spectra.
Definition: INTERFACES/ISpectrumAccess.h:52

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:15 using doxygen 1.8.5