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
33namespace pwiz {
34namespace 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
#define PWIZ_API_DECL
Definition Export.hpp:32
Inheritable pass-through implementation for wrapping a ChromatogramList.
static bool accept(const msdata::ChromatogramListPtr &inner)
virtual size_t size() const
returns the number of chromatograms
ChromatogramListWrapper(const msdata::ChromatogramListPtr &inner)
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
virtual const boost::shared_ptr< const msdata::DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
virtual msdata::ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const
retrieve a chromatogram by index
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW,...
Definition MSData.hpp:757
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition MSData.hpp:288
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition MSData.hpp:624
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition MSData.hpp:785
Identifying information for a chromatogram.
Definition MSData.hpp:490
Description of the way in which a particular software was used.
Definition MSData.hpp:274