ProteoWizard
SpectrumList_Shimadzu.hpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6//
7// Copyright 2009 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
28#include <boost/thread/mutex.hpp>
29#include <boost/container/flat_map.hpp>
30
31#ifdef PWIZ_READER_SHIMADZU
32#include "pwiz_aux/msrc/utility/vendor_api/Shimadzu/ShimadzuReader.hpp"
34#include <boost/thread.hpp>
35using namespace pwiz::vendor_api::Shimadzu;
36#endif // PWIZ_READER_SHIMADZU
37
38
39namespace pwiz {
40namespace msdata {
41namespace detail {
42
44{
45 public:
46
47 virtual size_t size() const;
48 virtual const SpectrumIdentity& spectrumIdentity(size_t index) const;
49 virtual size_t find(const std::string& id) const;
50 virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const;
51 virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const;
52 virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
53 virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
54
55#ifdef PWIZ_READER_SHIMADZU
56 SpectrumList_Shimadzu(const MSData& msd, ShimadzuReaderPtr rawfile, const Reader::Config& config);
57
58 private:
59
60 const MSData& msd_;
61 const Reader::Config config_;
62 ShimadzuReaderPtr rawfile_;
63 mutable boost::mutex readMutex;
64
65 mutable size_t size_;
66
67 mutable util::once_flag_proxy indexInitialized_;
68
69 struct IndexEntry : public SpectrumIdentity
70 {
71 int scanNumber;
72 };
73
74 mutable std::vector<IndexEntry> index_;
75 mutable std::map<std::string, size_t> idToIndexMap_;
76
77 // Cache last accessed spectrum for fast in order access
78 mutable boost::mutex spectrum_mutex;
79 mutable size_t spectrumLastIndex_;
80 mutable pwiz::vendor_api::Shimadzu::SpectrumPtr spectrumLast_;
81
82 void createIndex() const;
83#endif // PWIZ_READER_SHIMADZU
84};
85
86
87} // detail
88} // msdata
89} // pwiz
#define PWIZ_API_DECL
Definition Export.hpp:32
common functionality for base SpectrumList implementations
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const
retrieve a spectrum by index
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet &msLevelsToCentroid) const
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
virtual size_t find(const std::string &id) const
find id in the spectrum index (returns size() on failure)
virtual size_t size() const
returns the number of spectra
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, const pwiz::util::IntegerSet &msLevelsToCentroid) const
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const
retrieve a spectrum by index
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
boost::shared_ptr< Spectrum > SpectrumPtr
Definition MSData.hpp:573
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition MSData.hpp:850
Reader configuration.
Definition Reader.hpp:45
Identifying information for a spectrum.
Definition MSData.hpp:471