ProteoWizard
SpectrumList_UIMF.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_UIMF.hpp 6770 2014-10-09 20:35:21Z chambm $
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 
23 #ifndef _SPECTRUMLIST_UIMF_
24 #define _SPECTRUMLIST_UIMF_
25 
26 
34 #include <boost/container/flat_map.hpp>
35 //#include "pwiz/analysis/spectrum_processing/SpectrumList_3D.hpp"
36 
37 
38 #ifdef PWIZ_READER_UIMF
39 #include "pwiz_aux/msrc/utility/vendor_api/UIMF/UIMFReader.hpp"
41 #include <boost/thread.hpp>
42 using namespace pwiz::vendor_api::UIMF;
43 #endif // PWIZ_READER_UIMF
44 
45 
46 namespace pwiz {
47 namespace msdata {
48 namespace detail {
49 
50 using boost::shared_ptr;
51 
53 {
54  public:
55 
56  virtual size_t size() const;
57  virtual const SpectrumIdentity& spectrumIdentity(size_t index) const;
58  virtual size_t find(const string& id) const;
59  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const;
60  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const;
61 
62  //virtual pwiz::analysis::Spectrum3DPtr spectrum3d(double scanStartTime, const boost::icl::interval_set<double>& driftTimeRanges) const;
63 
64 #ifdef PWIZ_READER_UIMF
65  SpectrumList_UIMF(const MSData& msd, UIMFReaderPtr rawfile, const Reader::Config& config);
66 
67  private:
68 
69  const MSData& msd_;
70  UIMFReaderPtr rawfile_;
71  Reader::Config config_;
72  mutable size_t size_;
73  mutable boost::mutex readMutex;
74 
75  mutable util::once_flag_proxy indexInitialized_;
76 
77  struct IndexEntry : public SpectrumIdentity
78  {
79  };
80 
81  mutable vector<IndexEntry> index_;
82  mutable map<string, size_t> idToIndexMap_;
83  mutable boost::container::flat_map<double, size_t> scanTimeToFrameMap_;
84 
85  void createIndex() const;
86 #endif // PWIZ_READER_UIMF
87 };
88 
89 
90 } // detail
91 } // msdata
92 } // pwiz
93 
94 #endif // _SPECTRUMLIST_UIMF_
common functionality for base SpectrumList implementations
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: MSData.hpp:569
#define PWIZ_API_DECL
Definition: Export.hpp:32
Identifying information for a spectrum.
Definition: MSData.hpp:469
Reader configuration.
Definition: Reader.hpp:43
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845