ProteoWizard
SpectrumList_UNIFI.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_UNIFI
32 #include "pwiz_aux/msrc/utility/vendor_api/UNIFI/UnifiData.hpp"
34 #include <boost/thread.hpp>
35 using namespace pwiz::vendor_api::UNIFI;
36 #endif // PWIZ_READER_UNIFI
37 
38 
39 namespace pwiz {
40 namespace msdata {
41 namespace 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_UNIFI
56  SpectrumList_UNIFI(const MSData& msd, UnifiDataPtr unifiData,
57  const Reader::Config& config);
58 
59  private:
60 
61  const MSData& msd_;
62  UnifiDataPtr unifiData_;
63  const Reader::Config config_;
64  mutable boost::mutex readMutex;
65 
66  mutable size_t size_;
67 
68  mutable util::once_flag_proxy indexInitialized_;
69 
70  struct IndexEntry : public SpectrumIdentity
71  {
72  };
73 
74  mutable std::vector<IndexEntry> index_;
75  mutable std::map<std::string, size_t> idToIndexMap_;
76 
77  void createIndex() const;
78 #endif // PWIZ_READER_UNIFI
79 };
80 
81 
82 } // detail
83 } // msdata
84 } // pwiz
common functionality for base SpectrumList implementations
a virtual container of integers, accessible via an iterator interface, stored as union of intervals ...
Definition: IntegerSet.hpp:37
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: MSData.hpp:573
#define PWIZ_API_DECL
Definition: Export.hpp:32
Identifying information for a spectrum.
Definition: MSData.hpp:470
Reader configuration.
Definition: Reader.hpp:44
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:849