|
HDK
|
Manages a page cache and provides methods for invalidation of cached values. More...
#include <pageCacheStorage.h>
Public Member Functions | |
| EF_API | ~EfPageCacheStorage () |
| EF_API bool | IsEnabled () const |
| EF_API void | SetEnabled (bool enable) |
| EF_API const VdfRequest & | GetCacheableRequest (const VdfRequest &request) const |
| EF_API bool | GetCachedKeys (const _CacheIteratorPredicateFunction &predicate, const VdfRequest &request, std::vector< const VdfVector * > *cachedKeys) const |
| EF_API void | Invalidate (const _CacheIteratorPredicateFunction &predicate) |
| EF_API void | Invalidate (const _CacheIteratorPredicateFunction &predicate, const VdfMaskedOutputVector &invalidationRequest) |
| EF_API void | Clear () |
| EF_API void | ClearNodes (const VdfNetwork &network, const tbb::concurrent_vector< VdfIndex > &nodes) |
| EF_API void | Resize (const VdfNetwork &network) |
| EF_API void | WillDeleteNode (const VdfNode &node) |
Static Public Member Functions | |
| template<typename T > | |
| static EfPageCacheStorage * | New (const VdfMaskedOutput &keyMaskedOutput, EfLeafNodeCache *leafNodeCache) |
| static EF_API size_t | GetNumBytesUsed () |
| static EF_API size_t | GetNumBytesLimit () |
| static EF_API bool | HasReachedMemoryLimit () |
| static EF_API void | SetMemoryUsageLimit (size_t bytes) |
Friends | |
| template<template< typename > class E, typename D > | |
| class | EfPageCacheBasedExecutor |
| class | EfPageCacheCommitRequest |
Manages a page cache and provides methods for invalidation of cached values.
Definition at line 43 of file pageCacheStorage.h.
| EF_API EfPageCacheStorage::~EfPageCacheStorage | ( | ) |
Destructor.
| EF_API void EfPageCacheStorage::ClearNodes | ( | const VdfNetwork & | network, |
| const tbb::concurrent_vector< VdfIndex > & | nodes | ||
| ) |
Clears the output values associated with all the given nodes in the provided network.
| EF_API const VdfRequest& EfPageCacheStorage::GetCacheableRequest | ( | const VdfRequest & | request | ) | const |
Given any request, returns another request containing the outputs, which are dependent on the key output, and thus can be committed to the page cache.
| EF_API bool EfPageCacheStorage::GetCachedKeys | ( | const _CacheIteratorPredicateFunction & | predicate, |
| const VdfRequest & | request, | ||
| std::vector< const VdfVector * > * | cachedKeys | ||
| ) | const |
Returns the set of keys that have been cached in the pages selected by the predicate, as determined by the set of outputs contained in the request. Returns false if the request does not contain any cacheable outputs.
|
static |
Returns the upper cache storage memory limit, in bytes.
|
static |
Returns the amount of memory currently used for cache storage, in bytes.
|
static |
Returns true, if the upper memory limit has been reached, and the object is no longer allowed to allocate additional storage to cache new values.
Invalidate the page cache by clearing the entire cache on the pages determined by the invalidation predicate.
| EF_API void EfPageCacheStorage::Invalidate | ( | const _CacheIteratorPredicateFunction & | predicate, |
| const VdfMaskedOutputVector & | invalidationRequest | ||
| ) |
Invalidate the page cache by clearing the output values dependent on the invalidationRequest, on the pages determined by the invalidation predicate.
| EF_API bool EfPageCacheStorage::IsEnabled | ( | ) | const |
Returns true if the storage is enabled, i.e. output values can be committed and retrieved from the cache.
|
static |
Constructor helper.
Use this to construct heap allocated instances of this class, with the given leafNodeCache.
Definition at line 257 of file pageCacheStorage.h.
| EF_API void EfPageCacheStorage::Resize | ( | const VdfNetwork & | network | ) |
Resizes the internal structures of the page cache to be able to accommodate output values for the provided network.
Sets the upper memory limit, denoting how much memory this object is allowed to allocate.
Call this to notify the page cache storage of nodes that have been deleted from the network.
|
friend |
Definition at line 47 of file pageCacheStorage.h.
|
friend |
Definition at line 50 of file pageCacheStorage.h.