Public Member Functions | Static Public Member Functions

VDRIVE::RSCache Class Reference

#include <RSCache.h>

Inheritance diagram for VDRIVE::RSCache:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual std::pair< const
int32_t, mpq_class * > * 
getHighValue (int32_t *query)=0
virtual std::pair< const
int32_t, mpq_class * > * 
getLowValue (int32_t *query)=0
virtual void setValue (int32_t *query, mpq_class &value)=0
virtual mpq_class * getValue (int32_t *query)=0
virtual ~RSCache ()

Static Public Member Functions

static RSCachecreateInstance (int32_t depth)

Detailed Description

The RSCace is used for differen caching puposes during initialization of a DistRedundantShare. It is organized as a tree over the several parameters. The deepth of this tree id for every leaf depth. Each node can (and will) hold many Elements in an unorderd map, which gives an O(1) access to the next node. Therefore the RSCache has a O(depth) complexity for adding and searching elements.

To access entities in the cache the user has to pass a query to the cache. Such a query is an array of int32_t-values with the length depth.

The subclasses RSCacheLeaf and RSCacheNode will build the real tree.

Author:
Sascha Effert <fermat@uni-paderborn.de>

Constructor & Destructor Documentation

virtual VDRIVE::RSCache::~RSCache (  ) [inline, virtual]

destructor. Destroys the whole cache.


Member Function Documentation

RSCache * RSCache::createInstance ( int32_t  depth ) [static]

create a new RSCache with the given depth (depth has to be greater or equal to 1).

Parameters:
depthThe depth of the cache
Returns:
a new RSCache with the given depth
virtual std::pair<const int32_t, mpq_class*>* VDRIVE::RSCache::getHighValue ( int32_t *  query ) [pure virtual]

get the next best value for the query out of the cache. This is a Elment where the first (depth-1) values hit and the last value is lower or equal to the given value.

Parameters:
queryThe query to the searched Element
Returns:
The best matching value and the position it was placed.

Implemented in VDRIVE::RSCacheLeaf, and VDRIVE::RSCacheNode.

virtual std::pair<const int32_t, mpq_class*>* VDRIVE::RSCache::getLowValue ( int32_t *  query ) [pure virtual]

get the next best value for the query out of the cache. This is a Elment where the first (depth-1) values hit and the last value is higher or equal to the given value.

Parameters:
queryThe query to the searched Element
Returns:
The best matching value and the position it was placed.

Implemented in VDRIVE::RSCacheLeaf, and VDRIVE::RSCacheNode.

virtual mpq_class* VDRIVE::RSCache::getValue ( int32_t *  query ) [pure virtual]

get the value at the given position.

Parameters:
querythe position the value is placed
Returns:
the value at the given position or 0 if there is none.

Implemented in VDRIVE::RSCacheLeaf, and VDRIVE::RSCacheNode.

virtual void VDRIVE::RSCache::setValue ( int32_t *  query,
mpq_class &  value 
) [pure virtual]

set the value at the given position.

Parameters:
querythe position to place the value
valuethe value to place

Implemented in VDRIVE::RSCacheLeaf, and VDRIVE::RSCacheNode.


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