ProteoWizard
pwiz_RAMPAdapter.hpp
Go to the documentation of this file.
1 //
2 // pwiz_RAMPAdapter.hpp
3 //
4 // $Id: pwiz_RAMPAdapter.hpp 1862 2010-03-05 00:39:34Z pcbrefugee $
5 //
6 // a lightweight wrapper allowing SWIG to wrap some useful pwiz code
7 // Q: why wrap a wrapper? A: SWIG can't handle namespaces
8 //
9 //
10 // Original author: Brian Pratt <Brian.Pratt@insilicos.com>
11 //
12 // Copyright 2009 Insilicos LLC All Rights Reserved
13 //
14 // Licensed under the Apache License, Version 2.0 (the "License");
15 // you may not use this file except in compliance with the License.
16 // You may obtain a copy of the License at
17 //
18 // http://www.apache.org/licenses/LICENSE-2.0
19 //
20 // Unless required by applicable law or agreed to in writing, software
21 // distributed under the License is distributed on an "AS IS" BASIS,
22 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 // See the License for the specific language governing permissions and
24 // limitations under the License.
25 //
26 
27 #define RAMP_STRUCT_DECL_ONLY
28 #include "../../../data/msdata/RAMPAdapter.hpp"
29 #include <string>
30 
31 
32 /// SWIG-friendly wrapper to provide RAMP-friendly access to MSData library
34 {
35  public:
36 
37  /// constructor
38  pwiz_RAMPAdapter(const std::string& filename);
39 
40  /// destructor
42 
43  /// returns the number of scans stored in the data file
44  size_t scanCount() const;
45 
46  /// converts a scan number to a 0-based index;
47  /// returns scanCount() if scanNumber is not found
48  size_t index(int scanNumber) const;
49 
50  /// fills in RAMP ScanHeaderStruct for a specified scan
51  // index arg is a 0-based index into the scan table, as opposed to the scan ID
52  // (use the pwiz_RAMPAdapter::index(int scanNumber) to get that value)
53  void getScanHeader(size_t index, ScanHeaderStruct& result) const;
54 
55  /// fills in m/z-intensity pair array for a specified scan
56  // index arg is a 0-based index into the scan table, as opposed to the scan ID
57  // (use the pwiz_RAMPAdapter::index(int scanNumber) to get that value)
58  void getScanPeaks(size_t index, std::vector<double>& result) const;
59 
60  /// fills in RAMP RunHeaderStruct
61  void getRunHeader(RunHeaderStruct& result) const;
62 
63  /// fills in RAMP InstrumentHeaderStruct
64  void getInstrument(InstrumentStruct& result) const;
65 
66  private:
67  class pwiz::msdata::RAMPAdapter *m_guts; // this is where the magic happens
68 
69 };
70 
71