22#ifndef _PROTEINLISTCACHE_HPP_
23#define _PROTEINLISTCACHE_HPP_
40 ProteinListCacheMode_MetaDataAndSequence
55 ProteinListCacheMode cacheMode,
62 virtual size_t find(
const std::string&
id)
const;
69 ProteinListCacheMode
mode()
const;
ProteinListCacheMode_MetaDataOnly
adds a level of flexible MRU caching to a ProteinList processor chain
std::pair< size_t, ProteinPtr > KeyValuePair
a cache mapping spectrum indices to ProteinPtrs
const CacheType & cache() const
get a const-reference to the cache
ProteinListCacheMode mode() const
get the current caching mode
pwiz::util::mru_list< KeyValuePair, boost::multi_index::member_offset< KeyValuePair, size_t, first_offset > > CacheType
BOOST_STATIC_CONSTANT(unsigned, first_offset=offsetof(KeyValuePair, first))
ProteinListCache & operator=(ProteinListCache &)
virtual ProteinPtr protein(size_t index, bool getSequence=true) const
returns the requested spectrum which may or may not be cached depending on the current cache mode
void setMode(ProteinListCacheMode mode)
set the caching mode note: if the new mode is different than the current mode, the cache will be clea...
virtual size_t find(const std::string &id) const
ProteinListCache(const ProteinListPtr &inner, ProteinListCacheMode cacheMode, size_t cacheSize)
ProteinListCacheMode mode_
ProteinListCache(ProteinListCache &)
Inheritable pass-through implementation for wrapping a ProteinList.
boost::shared_ptr< Protein > ProteinPtr
boost::shared_ptr< ProteinList > ProteinListPtr