activemq-cpp-3.6.0
decaf::util::LRUCache< K, V, COMPARATOR > Class Template Reference

A Basic Least Recently Used (LRU) Cache Map. More...

#include <src/main/decaf/util/LRUCache.h>

Inheritance diagram for decaf::util::LRUCache< K, V, COMPARATOR >:

Public Member Functions

 LRUCache ()
virtual ~LRUCache ()
int getMaxCacheSize () const
 Gets the currently configured Max Cache Size setting.
void setMaxCacheSize (int size)
 Sets the maximum size allowed for this LRU Cache.

Protected Member Functions

virtual bool removeEldestEntry (const typename Map< K, V >::Entry &entry)

Protected Attributes

int maxCacheSize

Additional Inherited Members

- Private Member Functions inherited from decaf::util::AbstractMap< K, V >
 AbstractMap ()
 AbstractMap (const Map< K, V > &map)
 AbstractMap (const AbstractMap< K, V > &map)
virtual ~AbstractMap ()
virtual void lock ()
 Locks the object.
virtual bool tryLock ()
 Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
virtual void unlock ()
 Unlocks the object.
virtual void wait ()
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs, int nanos)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void notify ()
 Signals a waiter on this object that it can now wake up and continue.
virtual void notifyAll ()
 Signals the waiters on this object that it can now wake up and continue.

Detailed Description

template<typename K, typename V, typename COMPARATOR = std::less<K>>
class decaf::util::LRUCache< K, V, COMPARATOR >

A Basic Least Recently Used (LRU) Cache Map.

Since
1.0

Constructor & Destructor Documentation

template<typename K , typename V , typename COMPARATOR = std::less<K>>
decaf::util::LRUCache< K, V, COMPARATOR >::LRUCache ( )
inline
template<typename K , typename V , typename COMPARATOR = std::less<K>>
virtual decaf::util::LRUCache< K, V, COMPARATOR >::~LRUCache ( )
inlinevirtual

Member Function Documentation

template<typename K , typename V , typename COMPARATOR = std::less<K>>
int decaf::util::LRUCache< K, V, COMPARATOR >::getMaxCacheSize ( ) const
inline

Gets the currently configured Max Cache Size setting.

Returns
the current max cache size value.

References decaf::util::LRUCache< K, V, COMPARATOR >::maxCacheSize.

template<typename K , typename V , typename COMPARATOR = std::less<K>>
virtual bool decaf::util::LRUCache< K, V, COMPARATOR >::removeEldestEntry ( const typename Map< K, V >::Entry &  entry)
inlineprotectedvirtual
template<typename K , typename V , typename COMPARATOR = std::less<K>>
void decaf::util::LRUCache< K, V, COMPARATOR >::setMaxCacheSize ( int  size)
inline

Sets the maximum size allowed for this LRU Cache.

Parameters
sizeThe new maximum cache size setting.
Exceptions
IllegalArgumentExceptionis size is less than or equal to zero.

References decaf::util::LRUCache< K, V, COMPARATOR >::maxCacheSize, and decaf::util::Map< K, V >::size().

Field Documentation

template<typename K , typename V , typename COMPARATOR = std::less<K>>
int decaf::util::LRUCache< K, V, COMPARATOR >::maxCacheSize
protected

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