29 using namespace pwiz::msdata;
30 using namespace pwiz::util;
47 virtual SpectrumPtr spectrum(
size_t index,
bool getBinaryData =
false)
const {
return inner_->spectrum(index, getBinaryData);}
61 virtual size_t size()
const {
return inner_->size()/2;}
63 virtual SpectrumPtr spectrum(
size_t index,
bool getBinaryData =
false)
const {
return inner_->spectrum(index*2, getBinaryData);}
71 const size_t spectrumCount = 10;
72 for (
size_t i=0; i<spectrumCount; i++)
75 Spectrum& s = *simple->spectra.back();
82 shared_ptr<MyWrapper> wrapper(
new MyWrapper(simple));
84 wrapper->verifySize(10);
86 for (
size_t i=0; i<spectrumCount; i++)
91 IndexList indexList = wrapper->findNameValue(
"scan", lexical_cast<string>(i));
92 unit_assert(indexList.size()==1 && indexList[0]==i);
103 shared_ptr<FilterWrapper> filterWrapper(
new FilterWrapper(simple));
107 for (
size_t i=0; i<filterWrapper->size(); i++)
113 IndexList indexList = filterWrapper->findNameValue(
"scan", scanNumber);
114 unit_assert(indexList.size()==1 && indexList[0]==i);
125 int main(
int argc,
const char* argv[])
PWIZ_API_DECL const CV & cv(const std::string &prefix)
returns a CV object for the specified namespace (prefix); currently supported namespaces are: MS UO ...
FilterWrapper(const SpectrumListPtr &inner)
virtual size_t size() const
boost::shared_ptr< Spectrum > SpectrumPtr
void verifySize(size_t size)
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const
float lexical_cast(const std::string &str)
MyWrapper(const SpectrumListPtr &inner)
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
Inheritable pass-through implementation for wrapping a SpectrumList.
boost::shared_ptr< SpectrumList > SpectrumListPtr
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const
Identifying information for a spectrum.
#define TEST_PROLOG(argc, argv)
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Simple writeable in-memory implementation of SpectrumList.