ProteoWizard
MSIHandler.hpp
Go to the documentation of this file.
1 //
2 // $Id: MSIHandler.hpp 1195 2009-08-14 22:12:04Z chambm $
3 //
4 //
5 // Original author: Robert Burke <robert.burke@proteowizard.org>
6 //
7 // Copyright 2008 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 _MSIREADER_HPP_
25 #define _MSIREADER_HPP_
26 
28 #include "TabReader.hpp"
29 #include "boost/shared_ptr.hpp"
30 
31 namespace pwiz {
32 namespace utility {
33 
35 {
36 public:
37 
38  struct Record
39  {
40  Record() : scan(0), time(0), mz(0), intensity(0), charge(0), chargeStates(0), kl(0), background(0), median(0), peaks(0), scanFirst(0), scanLast(0), scanCount(0) {}
41  Record(const std::vector<std::string>& fields);
42  Record(const Record& r);
43 
44  size_t scan;
45  float time;
46  float mz;
47  float mass;
48  float intensity;
49  int charge;
51  float kl;
52  float background;
53  float median;
54  int peaks;
55  int scanFirst;
56  int scanLast;
57  int scanCount;
58 
59  };
60 
61  MSIHandler();
62 
63  virtual ~MSIHandler() {}
64 
65  virtual bool updateRecord(const std::vector<std::string>& fields);
66 
67  size_t size() const;
68 
69  Record record(size_t index) const;
70 
71  Record lastRecord() const;
72 
73 private:
74  class Impl;
75  boost::shared_ptr<Impl> pimpl;
76 };
77 
78 } // namespace pwiz
79 } // namespace utility
80 
81 
82 #endif // _MSIREADER_HPP_