ProteoWizard
Serializer_MSn.hpp
Go to the documentation of this file.
1 //
2 // $Id: Serializer_MSn.hpp 1852 2010-03-01 17:49:01Z tabaker $
3 //
4 //
5 // Original author: Barbara Frewen <frewen@u.washington.edu>
6 //
7 // Copyright 2008 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 #ifndef _SERIALIZER_MSn_HPP_
23 #define _SERIALIZER_MSn_HPP_
24 
26 #include "MSData.hpp"
27 #include "BinaryDataEncoder.hpp"
29 #include "SpectrumList_MSn.hpp"
30 
31 
32 namespace pwiz {
33 namespace msdata {
34 
35 
36 /// MSData <-> MSn stream serialization
38 {
39  public:
40 
41  /// constructor
42  Serializer_MSn(MSn_Type filetype);
43 
44  /// write MSData object to ostream as MSn;
45  /// iterationListenerRegistry may be used to receive progress updates
46  void write(std::ostream& os, const MSData& msd,
47  const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0) const;
48 
49  /// read in MSData object from an MGF istream
50  /// note: istream may be managed by MSData's SpectrumList, to allow for
51  /// lazy evaluation of Spectrum data
52  void read(boost::shared_ptr<std::istream> is, MSData& msd) const;
53 
54  private:
55  class Impl;
56  boost::shared_ptr<Impl> impl_;
58  Serializer_MSn& operator=(Serializer_MSn&);
59 };
60 
61 
62 } // namespace msdata
63 } // namespace pwiz
64 
65 #endif // _SERIALIZER_MSn_HPP_