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 
pwiz::analysis::ChromatogramListWrapper::chromatogram
virtual msdata::ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const
retrieve a chromatogram by index
Definition: ChromatogramListWrapper.hpp:56
pwiz::analysis::ChromatogramListWrapper::inner_
msdata::ChromatogramListPtr inner_
Definition: ChromatogramListWrapper.hpp:62
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::analysis::ChromatogramListWrapper::dataProcessingPtr
virtual const boost::shared_ptr< const msdata::DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
Definition: ChromatogramListWrapper.hpp:58
MSData.hpp
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
pwiz::msdata::ChromatogramIdentity
Identifying information for a chromatogram.
Definition: MSData.hpp:490
pwiz::analysis::ChromatogramListWrapper::dp_
msdata::DataProcessingPtr dp_
Definition: ChromatogramListWrapper.hpp:63
pwiz::analysis::ChromatogramListWrapper::empty
virtual bool empty() const
Definition: ChromatogramListWrapper.hpp:53
pwiz::analysis::ChromatogramListWrapper::ChromatogramListWrapper
ChromatogramListWrapper(const msdata::ChromatogramListPtr &inner)
Definition: ChromatogramListWrapper.hpp:42
pwiz::msdata::ChromatogramListPtr
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition: MSData.hpp:785
pwiz::analysis::ChromatogramListWrapper::chromatogramIdentity
virtual const msdata::ChromatogramIdentity & chromatogramIdentity(size_t index) const
access to a chromatogram index
Definition: ChromatogramListWrapper.hpp:54
pwiz::util::env::get
T get(const char *name, const T &defaultValue)
Definition: Environment.hpp:34
pwiz::analysis::ChromatogramListWrapper::accept
static bool accept(const msdata::ChromatogramListPtr &inner)
Definition: ChromatogramListWrapper.hpp:50
pwiz::msdata::DataProcessingPtr
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: MSData.hpp:288
pwiz::analysis::ChromatogramListWrapper::find
virtual size_t find(const std::string &id) const
find id in the chromatogram index (returns size() on failure)
Definition: ChromatogramListWrapper.hpp:55
pwiz::analysis::ChromatogramListWrapper
Inheritable pass-through implementation for wrapping a ChromatogramList.
Definition: ChromatogramListWrapper.hpp:39
pwiz::msdata::DataProcessing
Description of the way in which a particular software was used.
Definition: MSData.hpp:274
pwiz::msdata::ChromatogramPtr
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: MSData.hpp:624
pwiz::analysis::ChromatogramListWrapper::size
virtual size_t size() const
returns the number of chromatograms
Definition: ChromatogramListWrapper.hpp:52
pwiz::msdata::ChromatogramList
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW,...
Definition: MSData.hpp:757