version 3.3

VRS::LRUMap< KEY, VALUE > Class Template Reference

Class for managing key-value-pairs in a least recently usage manner. More...

#include <vrs/container/lrumap.h>

Inheritance diagram for VRS::LRUMap< KEY, VALUE >:

VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

UINT size () const
 Returns the number of key-value-pairs in the map.
bool isEmpty () const
 Returns if the map is empty.
bool contains (const KEY &key) const
 Returns if the given key is contained in the map.
const KEY & frontKey () const
const VALUE & frontValue () const
const KEY & backKey () const
const VALUE & backValue () const
const VALUE & value (const KEY &key) const
void pushFront (const KEY &key, const VALUE &value)
void pushFront (const KEY &key)
void popBack ()
void clear ()
 Removes all key-value-pairs from the list.
void erase (const KEY &key)
 VRS_TYPEINFO (LRUMap, SharedObj)


Detailed Description

template<typename KEY, typename VALUE>
class VRS::LRUMap< KEY, VALUE >

Class for managing key-value-pairs in a least recently usage manner.

Member Function Documentation

template<typename KEY, typename VALUE>
UINT VRS::LRUMap< KEY, VALUE >::size (  )  const

Returns the number of key-value-pairs in the map.

template<typename KEY, typename VALUE>
bool VRS::LRUMap< KEY, VALUE >::isEmpty (  )  const

Returns if the map is empty.

template<typename KEY, typename VALUE>
bool VRS::LRUMap< KEY, VALUE >::contains ( const KEY &  key  )  const

Returns if the given key is contained in the map.

template<typename KEY, typename VALUE>
const KEY& VRS::LRUMap< KEY, VALUE >::frontKey (  )  const

Returns the first key in the map (the key of the key-value-pairs that has been used most recently.)

template<typename KEY, typename VALUE>
const VALUE& VRS::LRUMap< KEY, VALUE >::frontValue (  )  const

Returns the first value in the map (the value of the key-value-pairs that has been used most recently.)

template<typename KEY, typename VALUE>
const KEY& VRS::LRUMap< KEY, VALUE >::backKey (  )  const

Returns the last key in the list (the key of the key-value-pair that has not been used for the longest time of all pairs in the lru map).

template<typename KEY, typename VALUE>
const VALUE& VRS::LRUMap< KEY, VALUE >::backValue (  )  const

Returns the last value in the list (the value of the key-value-pair that has not been used for the longest time of all pairs in the lru map).

template<typename KEY, typename VALUE>
const VALUE& VRS::LRUMap< KEY, VALUE >::value ( const KEY &  key  )  const

Returns the value associated with the given key. Note: the given key must be contained in the lru map!

template<typename KEY, typename VALUE>
void VRS::LRUMap< KEY, VALUE >::pushFront ( const KEY &  key,
const VALUE &  value 
)

Associates the given value with the given key (releasing a possible association of the given key with another value) and pushes the key-value-pair to the front of the lru map (meaning using the pair).

template<typename KEY, typename VALUE>
void VRS::LRUMap< KEY, VALUE >::pushFront ( const KEY &  key  ) 

Pushes the given key (together with the associated value) to the front of the lru map (meaning using the pair). Note: the given key must be contained in the lru map!

template<typename KEY, typename VALUE>
void VRS::LRUMap< KEY, VALUE >::popBack (  ) 

Removes the key-value-pair from the map that has not been used for the longest time of all contained pairs.

template<typename KEY, typename VALUE>
void VRS::LRUMap< KEY, VALUE >::clear (  ) 

Removes all key-value-pairs from the list.

template<typename KEY, typename VALUE>
void VRS::LRUMap< KEY, VALUE >::erase ( const KEY &  key  ) 

If the given key is contained in the map it it removed from the map together with the associated value.

template<typename KEY, typename VALUE>
VRS::LRUMap< KEY, VALUE >::VRS_TYPEINFO ( LRUMap< KEY, VALUE >  ,
SharedObj   
)


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

Generated on Mon May 21 06:00:16 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact