Logo Search packages:      
Sourcecode: poco version File versions

Poco::AbstractCache< TKey, TValue, TStrategy > Class Template Reference

#include <AbstractCache.h>

Inheritance diagram for Poco::AbstractCache< TKey, TValue, TStrategy >:

Poco::AccessExpireCache< TKey, TValue > Poco::AccessExpireLRUCache< TKey, TValue > Poco::ExpireCache< TKey, TValue > Poco::ExpireLRUCache< TKey, TValue > Poco::LRUCache< TKey, TValue > Poco::UniqueAccessExpireCache< TKey, TValue > Poco::UniqueAccessExpireLRUCache< TKey, TValue > Poco::UniqueExpireCache< TKey, TValue > Poco::UniqueExpireLRUCache< TKey, TValue >

List of all members.

Detailed Description

template<class TKey, class TValue, class TStrategy>
class Poco::AbstractCache< TKey, TValue, TStrategy >

An AbstractCache is the interface of all caches.

Definition at line 60 of file AbstractCache.h.

Public Types

typedef DataHolder::const_iterator ConstIterator
typedef std::map< TKey,
SharedPtr< TValue > > 
typedef DataHolder::iterator Iterator
typedef std::set< TKey > KeySet

Public Member Functions

 AbstractCache (const TStrategy &strat)
void add (const TKey &key, SharedPtr< TValue > val)
void add (const TKey &key, const TValue &val)
void clear ()
 Removes all elements from the cache.
void forceReplace ()
SharedPtr< TValue > get (const TKey &key)
std::set< TKey > getAllKeys ()
 Returns a copy of all keys stored in the cache.
bool has (const TKey &key) const
 Returns true if the cache contains a value for the key.
void remove (const TKey &key)
std::size_t size ()
 Returns the number of cached elements.

Public Attributes

FIFOEvent< const KeyValueArgs
< TKey, TValue > > 
FIFOEvent< const EventArgsClear
FIFOEvent< const TKey > Get
FIFOEvent< const TKey > Remove

Protected Member Functions

void doAdd (const TKey &key, SharedPtr< TValue > &val)
void doAdd (const TKey &key, const TValue &val)
void doClear ()
SharedPtr< TValue > doGet (const TKey &key)
bool doHas (const TKey &key) const
 Returns true if the cache contains a value for the key.
void doRemove (Iterator it)
void doReplace ()
void initialize ()
 Sets up event registration.
void uninitialize ()
 Reverts event registration.

Protected Attributes

DataHolder _data
FastMutex _mutex
TStrategy _strategy
FIFOEvent< ValidArgs< TKey > > IsValid
FIFOEvent< KeySet > Replace

Private Member Functions

 AbstractCache (const AbstractCache &aCache)
AbstractCacheoperator= (const AbstractCache &aCache)

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

Generated by  Doxygen 1.6.0   Back to index