ProteoWizard
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
pwiz::proteome::ProteinListCache Class Reference

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

#include <ProteinListCache.hpp>

Inheritance diagram for pwiz::proteome::ProteinListCache:
pwiz::proteome::ProteinListWrapper pwiz::proteome::ProteinList

Public Types

typedef std::pair< size_t, ProteinPtrKeyValuePair
 a cache mapping spectrum indices to ProteinPtrs More...
 
typedef pwiz::util::mru_list< KeyValuePair, boost::multi_index::member_offset< KeyValuePair, size_t, first_offset > > CacheType
 

Public Member Functions

 BOOST_STATIC_CONSTANT (unsigned, first_offset=offsetof(KeyValuePair, first))
 
 ProteinListCache (const ProteinListPtr &inner, ProteinListCacheMode cacheMode, size_t cacheSize)
 
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 More...
 
virtual size_t find (const std::string &id) const
 
void setMode (ProteinListCacheMode mode)
 set the caching mode note: if the new mode is different than the current mode, the cache will be cleared More...
 
ProteinListCacheMode mode () const
 get the current caching mode More...
 
const CacheTypecache () const
 get a const-reference to the cache More...
 
- Public Member Functions inherited from pwiz::proteome::ProteinListWrapper
 ProteinListWrapper (const ProteinListPtr &inner)
 
virtual size_t size () const
 
- Public Member Functions inherited from pwiz::proteome::ProteinList
virtual bool empty () const
 
virtual IndexList findKeyword (const std::string &keyword, bool caseSensitive=true) const
 
virtual ~ProteinList ()
 

Private Member Functions

 ProteinListCache (ProteinListCache &)
 
ProteinListCacheoperator= (ProteinListCache &)
 

Private Attributes

CacheType cache_
 
ProteinListCacheMode mode_
 

Additional Inherited Members

- Protected Attributes inherited from pwiz::proteome::ProteinListWrapper
ProteinListPtr inner_
 

Detailed Description

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

Definition at line 45 of file ProteinListCache.hpp.

Member Typedef Documentation

§ KeyValuePair

a cache mapping spectrum indices to ProteinPtrs

Definition at line 50 of file ProteinListCache.hpp.

§ CacheType

typedef pwiz::util::mru_list<KeyValuePair, boost::multi_index::member_offset<KeyValuePair, size_t, first_offset> > pwiz::proteome::ProteinListCache::CacheType

Definition at line 52 of file ProteinListCache.hpp.

Constructor & Destructor Documentation

§ ProteinListCache() [1/2]

pwiz::proteome::ProteinListCache::ProteinListCache ( const ProteinListPtr inner,
ProteinListCacheMode  cacheMode,
size_t  cacheSize 
)

§ ProteinListCache() [2/2]

pwiz::proteome::ProteinListCache::ProteinListCache ( ProteinListCache )
private

Member Function Documentation

§ BOOST_STATIC_CONSTANT()

pwiz::proteome::ProteinListCache::BOOST_STATIC_CONSTANT ( unsigned  ,
first_offset  = offsetof(KeyValuePair, first) 
)

§ protein()

virtual ProteinPtr pwiz::proteome::ProteinListCache::protein ( size_t  index,
bool  getSequence = true 
) const
virtual

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

Reimplemented from pwiz::proteome::ProteinListWrapper.

Referenced by testModeMetaDataAndSequence(), testModeMetaDataOnly(), and testModeOff().

§ find()

virtual size_t pwiz::proteome::ProteinListCache::find ( const std::string &  id) const
virtual

Reimplemented from pwiz::proteome::ProteinList.

§ setMode()

void pwiz::proteome::ProteinListCache::setMode ( ProteinListCacheMode  mode)

set the caching mode note: if the new mode is different than the current mode, the cache will be cleared

§ mode()

ProteinListCacheMode pwiz::proteome::ProteinListCache::mode ( ) const

get the current caching mode

§ cache()

const CacheType& pwiz::proteome::ProteinListCache::cache ( ) const
inline

get a const-reference to the cache

Definition at line 72 of file ProteinListCache.hpp.

Referenced by testModeMetaDataAndSequence(), testModeMetaDataOnly(), and testModeOff().

§ operator=()

ProteinListCache& pwiz::proteome::ProteinListCache::operator= ( ProteinListCache )
private

Member Data Documentation

§ cache_

CacheType pwiz::proteome::ProteinListCache::cache_
mutableprivate

Definition at line 77 of file ProteinListCache.hpp.

§ mode_

ProteinListCacheMode pwiz::proteome::ProteinListCache::mode_
private

Definition at line 78 of file ProteinListCache.hpp.


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