ProteoWizard
Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
pwiz::msdata::SpectrumListCache Class Reference

adds a level of flexible MRU caching to a SpectrumList processor chain More...

#include <SpectrumListCache.hpp>

Inheritance diagram for pwiz::msdata::SpectrumListCache:
pwiz::msdata::SpectrumListWrapper pwiz::msdata::SpectrumList

Classes

struct  CacheEntry
 a cache mapping spectrum indices to SpectrumPtrs More...
 

Public Types

typedef MemoryMRUCache< CacheEntry, BOOST_MULTI_INDEX_MEMBER(CacheEntry, size_t, index) > CacheType
 

Public Member Functions

 SpectrumListCache (const SpectrumListPtr &inner, MemoryMRUCacheMode cacheMode, size_t cacheSize)
 
virtual SpectrumPtr spectrum (size_t index, bool getBinaryData=false) const
 returns the requested spectrum which may or may not be cached depending on the current cache mode More...
 
CacheTypespectrumCache ()
 returns a reference to the cache, to enable clearing it or changing the mode More...
 
const CacheTypespectrumCache () const
 returns a const-reference to the cache More...
 
- Public Member Functions inherited from pwiz::msdata::SpectrumListWrapper
 SpectrumListWrapper (const SpectrumListPtr &inner)
 
virtual size_t size () const
 returns the number of spectra More...
 
virtual bool empty () const
 returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL) More...
 
virtual const SpectrumIdentityspectrumIdentity (size_t index) const
 access to a spectrum index More...
 
virtual SpectrumPtr spectrum (size_t index, DetailLevel detailLevel) const
 retrieve a spectrum by index More...
 
virtual const boost::shared_ptr< const DataProcessingdataProcessingPtr () const
 returns the data processing affecting spectra retrieved through this interface More...
 
SpectrumListPtr inner () const
 
SpectrumListPtr innermost () const
 
- Public Member Functions inherited from pwiz::msdata::SpectrumList
virtual size_t find (const std::string &id) const
 find id in the spectrum index (returns size() on failure) More...
 
virtual size_t findAbbreviated (const std::string &abbreviatedId, char delimiter='.') const
 find an abbreviated id (e.g. "1.1.123.2" for "sample=1 period=1 cycle=123 experiment=2") in the spectrum index (returns size() on failure) More...
 
virtual IndexList findNameValue (const std::string &name, const std::string &value) const
 find all spectrum indexes with specified name/value pair More...
 
virtual IndexList findSpotID (const std::string &spotID) const
 find all spectrum indexes with spotID (returns empty vector on failure) More...
 
virtual SpectrumPtr spectrum (const SpectrumPtr &seed, bool getBinaryData) const
 get a copy of the seed spectrum, optionally with its binary data populated this is useful for formats like mzML that can delay loading of binary data More...
 
virtual void warn_once (const char *msg) const
 issues a warning once per SpectrumList instance (based on string hash) More...
 
virtual ~SpectrumList ()
 

Protected Attributes

CacheType spectrumCache_
 
- Protected Attributes inherited from pwiz::msdata::SpectrumListWrapper
SpectrumListPtr inner_
 
DataProcessingPtr dp_
 

Private Member Functions

 SpectrumListCache (SpectrumListCache &)
 
SpectrumListCacheoperator= (SpectrumListCache &)
 

Detailed Description

adds a level of flexible MRU caching to a SpectrumList processor chain

Definition at line 37 of file SpectrumListCache.hpp.

Member Typedef Documentation

§ CacheType

typedef MemoryMRUCache<CacheEntry, BOOST_MULTI_INDEX_MEMBER(CacheEntry, size_t, index) > pwiz::msdata::SpectrumListCache::CacheType

Definition at line 43 of file SpectrumListCache.hpp.

Constructor & Destructor Documentation

§ SpectrumListCache() [1/2]

pwiz::msdata::SpectrumListCache::SpectrumListCache ( const SpectrumListPtr inner,
MemoryMRUCacheMode  cacheMode,
size_t  cacheSize 
)

§ SpectrumListCache() [2/2]

pwiz::msdata::SpectrumListCache::SpectrumListCache ( SpectrumListCache )
private

Member Function Documentation

§ spectrum()

virtual SpectrumPtr pwiz::msdata::SpectrumListCache::spectrum ( size_t  index,
bool  getBinaryData = false 
) const
virtual

returns the requested spectrum which may or may not be cached depending on the current cache mode

Implements pwiz::msdata::SpectrumListWrapper.

Referenced by testFileReads(), testModeBinaryDataOnly(), testModeMetaDataAndBinaryData(), testModeMetaDataOnly(), and testModeOff().

§ spectrumCache() [1/2]

CacheType& pwiz::msdata::SpectrumListCache::spectrumCache ( )

returns a reference to the cache, to enable clearing it or changing the mode

Referenced by testModeBinaryDataOnly(), testModeMetaDataAndBinaryData(), testModeMetaDataOnly(), and testModeOff().

§ spectrumCache() [2/2]

const CacheType& pwiz::msdata::SpectrumListCache::spectrumCache ( ) const

returns a const-reference to the cache

§ operator=()

SpectrumListCache& pwiz::msdata::SpectrumListCache::operator= ( SpectrumListCache )
private

Member Data Documentation

§ spectrumCache_

CacheType pwiz::msdata::SpectrumListCache::spectrumCache_
mutableprotected

Definition at line 60 of file SpectrumListCache.hpp.


The documentation for this class was generated from the following file: