ProteoWizard
ChromatogramListWrapper.hpp
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 //
5 // Original author: Eric Purser <Eric.Purser .@. Vanderbilt.edu>
6 //
7 
8 // Copyright 2008 Spielberg Family Center for Applied Proteomics
9 // Cedars-Sinai Medical Center, Los Angeles, California 90048
10 //
11 // Licensed under the Apache License, Version 2.0 (the "License");
12 // you may not use this file except in compliance with the License.
13 // You may obtain a copy of the License at
14 //
15 // http://www.apache.org/licenses/LICENSE-2.0
16 //
17 // Unless required by applicable law or agreed to in writing, software
18 // distributed under the License is distributed on an "AS IS" BASIS,
19 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 // See the License for the specific language governing permissions and
21 // limitations under the License.
22 //
23 
24 
25 #ifndef _CHROMATOGRAMLISTWRAPPER_HPP_
26 #define _CHROMATOGRAMLISTWRAPPER_HPP_
27 
28 
30 #include <stdexcept>
31 
32 
33 namespace pwiz {
34 namespace analysis {
35 
36 
37 /// Inheritable pass-through implementation for wrapping a ChromatogramList
39 {
40  public:
41 
43  : inner_(inner),
44  dp_(inner->dataProcessingPtr().get() ? new msdata::DataProcessing(*inner->dataProcessingPtr())
45  : new msdata::DataProcessing("pwiz_Chromatogram_Processing"))
46  {
47  if (!inner.get()) throw std::runtime_error("[ChromatogramListWrapper] Null ChromatogramListPtr.");
48  }
49 
50  static bool accept(const msdata::ChromatogramListPtr& inner) {return true;}
51 
52  virtual size_t size() const {return inner_->size();}
53  virtual bool empty() const {return inner_->empty();}
54  virtual const msdata::ChromatogramIdentity& chromatogramIdentity(size_t index) const {return inner_->chromatogramIdentity(index);}
55  virtual size_t find(const std::string& id) const {return inner_->find(id);}
56  virtual msdata::ChromatogramPtr chromatogram(size_t index, bool getBinaryData = false) const { return inner_->chromatogram(index, getBinaryData); }
57 
58  virtual const boost::shared_ptr<const msdata::DataProcessing> dataProcessingPtr() const { return dp_; }
59 
60  protected:
61 
64 };
65 
66 
67 } // namespace analysis
68 } // namespace pwiz
69 
70 
71 #endif // _CHROMATOGRAMLISTWRAPPER_HPP_
72 
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW...
Definition: MSData.hpp:756
Description of the way in which a particular software was used.
Definition: MSData.hpp:273
virtual size_t find(const std::string &id) const
find id in the chromatogram index (returns size() on failure)
virtual const msdata::ChromatogramIdentity & chromatogramIdentity(size_t index) const
access to a chromatogram index
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition: MSData.hpp:785
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: MSData.hpp:288
static bool accept(const msdata::ChromatogramListPtr &inner)
virtual msdata::ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const
retrieve a chromatogram by index
T get(const char *name, const T &defaultValue)
Definition: Environment.hpp:34
virtual size_t size() const
returns the number of chromatograms
#define PWIZ_API_DECL
Definition: Export.hpp:32
virtual const boost::shared_ptr< const msdata::DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
Inheritable pass-through implementation for wrapping a ChromatogramList.
ChromatogramListWrapper(const msdata::ChromatogramListPtr &inner)
Identifying information for a chromatogram.
Definition: MSData.hpp:489
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: MSData.hpp:624