ProteoWizard
Serializer_mzML.hpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Darren Kessner <darren@proteowizard.org>
6//
7// Copyright 2007 Spielberg Family Center for Applied Proteomics
8// Cedars-Sinai Medical Center, Los Angeles, California 90048
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21//
22
23
24#ifndef _SERIALIZER_MZML_HPP_
25#define _SERIALIZER_MZML_HPP_
26
27
29#include "MSData.hpp"
30#include "BinaryDataEncoder.hpp"
32
33
34namespace pwiz {
35namespace msdata {
36
37
38/// MSData <-> mzML stream serialization
40{
41 public:
42
43 /// Serializer_mzML configuration
45 {
46 /// configuration for binary data encoding in write()
47 /// note: byteOrder is ignored (mzML always little endian)
49
50 /// (indexed==true): read/write with <indexedmzML> wrapper
51 bool indexed;
52
53 Config() : indexed(true) {}
54 };
55
56 /// constructor
57 Serializer_mzML(const Config& config = Config());
58
59 /// write MSData object to ostream as mzML;
60 /// iterationListenerRegistry may be used to receive progress updates
61 void write(std::ostream& os, const MSData& msd,
62 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0) const;
63
64 /// read in MSData object from an mzML istream
65 /// note: istream may be managed by MSData's SpectrumList, to allow for
66 /// lazy evaluation of Spectrum data
67 void read(boost::shared_ptr<std::istream> is, MSData& msd) const;
68
69 private:
70 class Impl;
71 boost::shared_ptr<Impl> impl_;
74};
75
76
77PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, const Serializer_mzML::Config& config);
78
79
80} // namespace msdata
81} // namespace pwiz
82
83
84#endif // _SERIALIZER_MZML_HPP_
85
#define PWIZ_API_DECL
Definition Export.hpp:32
MSData <-> mzML stream serialization.
Serializer_mzML(const Config &config=Config())
constructor
void write(std::ostream &os, const MSData &msd, const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0) const
write MSData object to ostream as mzML; iterationListenerRegistry may be used to receive progress upd...
Serializer_mzML & operator=(Serializer_mzML &)
void read(boost::shared_ptr< std::istream > is, MSData &msd) const
read in MSData object from an mzML istream note: istream may be managed by MSData's SpectrumList,...
Serializer_mzML(Serializer_mzML &)
boost::shared_ptr< Impl > impl_
handles registration of IterationListeners and broadcast of update messages
std::ostream & operator<<(std::ostream &os, const Diff< object_type, config_type > &diff)
stream insertion of Diff results
Definition diff_std.hpp:200
encoding/decoding configuration
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition MSData.hpp:850
Serializer_mzML configuration.
BinaryDataEncoder::Config binaryDataEncoderConfig
configuration for binary data encoding in write() note: byteOrder is ignored (mzML always little endi...
bool indexed
(indexed==true): read/write with <indexedmzML> wrapper