|
ProteoWizard
|
adds a level of flexible MRU caching to a SpectrumList processor chain More...
#include <SpectrumListCache.hpp>
Public Types | |
| typedef std::pair< size_t, SpectrumPtr > | KeyValuePair |
| a cache mapping spectrum indices to SpectrumPtrs | |
| typedef MemoryMRUCache < KeyValuePair, boost::multi_index::member_offset < KeyValuePair, size_t, first_offset > > | CacheType |
Public Member Functions | |
| BOOST_STATIC_CONSTANT (unsigned, first_offset=offsetof(KeyValuePair, first)) | |
| 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 | |
| CacheType & | spectrumCache () |
| returns a reference to the cache, to enable clearing it or changing the mode | |
| const CacheType & | spectrumCache () const |
| returns a const-reference to the cache | |
Public Member Functions inherited from pwiz::msdata::SpectrumListWrapper | |
| SpectrumListWrapper (const SpectrumListPtr &inner) | |
| virtual size_t | size () const |
| returns the number of spectra | |
| virtual bool | empty () const |
| returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL) | |
| virtual const SpectrumIdentity & | spectrumIdentity (size_t index) const |
| access to a spectrum index | |
| virtual SpectrumPtr | spectrum (size_t index, DetailLevel detailLevel) const |
| retrieve a spectrum by index | |
| virtual const boost::shared_ptr< const DataProcessing > | dataProcessingPtr () const |
| returns the data processing affecting spectra retrieved through this interface | |
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) | |
| virtual IndexList | findNameValue (const std::string &name, const std::string &value) const |
| find all spectrum indexes with specified name/value pair | |
| virtual IndexList | findSpotID (const std::string &spotID) const |
| find all spectrum indexes with spotID (returns empty vector on failure) | |
| 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 | |
| virtual | ~SpectrumList () |
Protected Attributes | |
| CacheType | spectrumCache_ |
Protected Attributes inherited from pwiz::msdata::SpectrumListWrapper | |
| SpectrumListPtr | inner_ |
| DataProcessingPtr | dp_ |
Private Member Functions | |
| SpectrumListCache (SpectrumListCache &) | |
| SpectrumListCache & | operator= (SpectrumListCache &) |
adds a level of flexible MRU caching to a SpectrumList processor chain
Definition at line 37 of file SpectrumListCache.hpp.
| typedef std::pair<size_t, SpectrumPtr> pwiz::msdata::SpectrumListCache::KeyValuePair |
a cache mapping spectrum indices to SpectrumPtrs
Definition at line 42 of file SpectrumListCache.hpp.
| typedef MemoryMRUCache<KeyValuePair, boost::multi_index::member_offset<KeyValuePair, size_t, first_offset> > pwiz::msdata::SpectrumListCache::CacheType |
Definition at line 44 of file SpectrumListCache.hpp.
| pwiz::msdata::SpectrumListCache::SpectrumListCache | ( | const SpectrumListPtr & | inner, |
| MemoryMRUCacheMode | cacheMode, | ||
| size_t | cacheSize | ||
| ) |
|
private |
| pwiz::msdata::SpectrumListCache::BOOST_STATIC_CONSTANT | ( | unsigned | , |
| first_offset | = offsetof(KeyValuePair, first) |
||
| ) |
|
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().
| 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().
| const CacheType& pwiz::msdata::SpectrumListCache::spectrumCache | ( | ) | const |
returns a const-reference to the cache
|
private |
|
mutableprotected |
Definition at line 61 of file SpectrumListCache.hpp.
1.8.1.1