#include <RSCache.h>
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 RSCache * | createInstance (int32_t depth) |
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.
virtual VDRIVE::RSCache::~RSCache | ( | ) | [inline, virtual] |
destructor. Destroys the whole cache.
RSCache * RSCache::createInstance | ( | int32_t | depth ) | [static] |
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.
query | The query to the searched Element |
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.
query | The query to the searched Element |
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.
query | the position the value is placed |
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.
query | the position to place the value |
value | the value to place |
Implemented in VDRIVE::RSCacheLeaf, and VDRIVE::RSCacheNode.