Lucene++ - a full-featured, c++ search engine
API Documentation

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Types | Public Member Functions | Protected Attributes
Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL > Class Template Reference

General purpose LRU cache map. Accessing an entry will keep the entry cached. get(const KEY&) and put(const KEY&, const VALUE&) results in an access to the corresponding entry. More...

`#include <SimpleLRUCache.h>`

Inheritance diagram for Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >:

## Public Types

typedef std::pair< KEY, VALUE > | key_value
typedef std::list< key_value > | key_list
typedef key_list::const_iterator | const_iterator
typedef boost::unordered_map< KEY, typename key_list::iterator, HASH, EQUAL > | map_type
typedef map_type::const_iterator | map_iterator

## Public Member Functions

| SimpleLRUCache (int32_t cacheSize)
virtual | ~SimpleLRUCache ()
void | put (const KEY &key, const VALUE &value)
VALUE | get (const KEY &key)
bool | contains (const KEY &key) const
int32_t | size () const
const_iterator | begin () const
const_iterator | end () const
Public Member Functions inherited from Lucene::LuceneObject
virtual | ~LuceneObject ()
virtual void | initialize ()
| Called directly after instantiation to create objects that depend on this object being fully constructed. More...
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Protected Attributes

int32_t | cacheSize
key_list | cacheList
map_type | cacheMap
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Additional Inherited Members

Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Detailed Description

### template<class KEY, class VALUE, class HASH, class EQUAL>
class Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >

General purpose LRU cache map. Accessing an entry will keep the entry cached. get(const KEY&) and put(const KEY&, const VALUE&) results in an access to the corresponding entry.

## Member Typedef Documentation

template<class KEY , class VALUE , class HASH , class EQUAL >

typedef key_list::const_iterator Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::const_iterator

template<class KEY , class VALUE , class HASH , class EQUAL >

typedef std::list< key_value > Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::key_list

template<class KEY , class VALUE , class HASH , class EQUAL >

typedef std::pair<KEY, VALUE> Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::key_value

template<class KEY , class VALUE , class HASH , class EQUAL >

typedef map_type::const_iterator Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::map_iterator

template<class KEY , class VALUE , class HASH , class EQUAL >

typedef boost::unordered_map<KEY, typename key_list::iterator, HASH, EQUAL> Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::map_type

## Constructor & Destructor Documentation

template<class KEY , class VALUE , class HASH , class EQUAL >

Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::SimpleLRUCache | ( | int32_t | cacheSize | ) |

inline

References Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::cacheSize.

template<class KEY , class VALUE , class HASH , class EQUAL >

virtual Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::~SimpleLRUCache | ( |  | ) |

inline virtual

## Member Function Documentation

template<class KEY , class VALUE , class HASH , class EQUAL >

const_iterator Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::begin | ( |  | ) | const

inline

template<class KEY , class VALUE , class HASH , class EQUAL >

bool Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::contains | ( | const KEY & | key | ) | const

inline

template<class KEY , class VALUE , class HASH , class EQUAL >

const_iterator Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::end | ( |  | ) | const

inline

template<class KEY , class VALUE , class HASH , class EQUAL >

VALUE Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::get | ( | const KEY & | key | ) |

inline

template<class KEY , class VALUE , class HASH , class EQUAL >

void Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::put | ( | const KEY & | key,
|  | const VALUE & | value
| ) |  |

inline

References Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::cacheSize.

template<class KEY , class VALUE , class HASH , class EQUAL >

int32_t Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::size | ( |  | ) | const

inline

## Field Documentation

template<class KEY , class VALUE , class HASH , class EQUAL >

key_list Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::cacheList

protected

template<class KEY , class VALUE , class HASH , class EQUAL >

map_type Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::cacheMap

protected

template<class KEY , class VALUE , class HASH , class EQUAL >

int32_t Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::cacheSize

protected

Referenced by Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::put(), and Lucene::SimpleLRUCache< KEY, VALUE, HASH, EQUAL >::SimpleLRUCache().

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

- SimpleLRUCache.h

clucene.sourceforge.net