7 #ifndef PXR_EXEC_EF_PAGE_CACHE_STORAGE_H
8 #define PXR_EXEC_EF_PAGE_CACHE_STORAGE_H
22 #include <tbb/concurrent_vector.h>
46 template <
template <
typename>
class E,
typename D>
55 using _CacheIteratorPredicateFunction =
56 std::function<bool (const VdfVector &)>;
69 template <
typename T >
123 const _CacheIteratorPredicateFunction &predicate,
125 std::vector<const VdfVector *> *cachedKeys)
const;
132 const _CacheIteratorPredicateFunction &predicate);
140 const _CacheIteratorPredicateFunction &predicate,
154 const tbb::concurrent_vector<VdfIndex> &nodes);
220 std::unique_ptr<Ef_PageCache> _pageCache;
225 struct _CacheableRequestEntry {
226 _CacheableRequestEntry() :
version(0) {}
232 using _CacheableRequests =
234 mutable _CacheableRequests _cacheableRequests;
241 std::unique_ptr<std::atomic<bool>[]> _nodeRefs;
245 static std::atomic<size_t> _numBytesUsed;
248 static std::atomic<size_t> _numBytesLimit;
255 template <
typename T >
262 keyMaskedOutput, leafNodeCache, Ef_PageCache::New<T>());
EF_API bool GetCachedKeys(const _CacheIteratorPredicateFunction &predicate, const VdfRequest &request, std::vector< const VdfVector * > *cachedKeys) const
Manages a page cache and provides methods for invalidation of cached values.
#define PXR_NAMESPACE_OPEN_SCOPE
GLsizei const GLfloat * value
EF_API void SetEnabled(bool enable)
A VdfMask is placed on connections to specify the data flowing through them.
An output-to-value storage for caching. The class provides accessor types for thread-safe, as well as unprotected access.
static EF_API size_t GetNumBytesLimit()
Executes a VdfNetwork to compute a requested set of values. Caches the computed data in a EfPageCache...
EF_API const VdfRequest & GetCacheableRequest(const VdfRequest &request) const
This object signifies an intent to commit data to a page cache. It ensures that the page exists and t...
Organizes output-to-value caches into logical groups, called pages. Pages are keyed off of VdfVector ...
static EF_API bool HasReachedMemoryLimit()
EF_API void WillDeleteNode(const VdfNode &node)
static EfPageCacheStorage * New(const VdfMaskedOutput &keyMaskedOutput, EfLeafNodeCache *leafNodeCache)
std::unordered_map< const VdfOutput *, VdfMask, TfHash > VdfOutputToMaskMap
A map from output pointer to mask.
Class to hold on to an externally owned output and a mask.
GT_API const UT_StringHolder version
static EF_API size_t GetNumBytesUsed()
EF_API void Resize(const VdfNetwork &network)
EF_API bool IsEnabled() const
#define PXR_NAMESPACE_CLOSE_SCOPE
EF_API void Invalidate(const _CacheIteratorPredicateFunction &predicate)
static EF_API void SetMemoryUsageLimit(size_t bytes)
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values...
std::vector< VdfMaskedOutput > VdfMaskedOutputVector
EF_API void ClearNodes(const VdfNetwork &network, const tbb::concurrent_vector< VdfIndex > &nodes)
EF_API ~EfPageCacheStorage()