pageCacheCommitRequest.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_EXEC_EF_PAGE_CACHE_COMMIT_REQUEST_H
8 #define PXR_EXEC_EF_PAGE_CACHE_COMMIT_REQUEST_H
9 
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/ef/api.h"
16 
17 #include <vector>
18 
19 PXR_NAMESPACE_OPEN_SCOPE
20 
22 class EfPageCacheStorage;
24 class VdfRequest;
25 
36 {
37 public:
44  EF_API
46  const EfInputValueBlock &inputs,
47  EfPageCacheStorage *storage);
48 
51  EF_API
53 
56  const EfInputValueBlock &GetInputs() const {
57  return _inputs;
58  }
59 
63  return _cache;
64  }
65 
69  EF_API
70  bool IsUncached(const VdfRequest &request) const;
71 
74  EF_API
75  VdfRequest GetUncached(const VdfRequest &request) const;
76 
85  EF_API
86  bool Commit(
87  const VdfExecutorInterface &executor,
88  const VdfRequest &request,
89  size_t *bytesCommitted);
90 
91 private:
92  // The input value block containing the key output value.
93  EfInputValueBlock _inputs;
94 
95  // The output-to-value cache on the page indexed by the key value.
96  Ef_OutputValueCache *_cache;
97 
98  // A pointer to the page cache storage class.
99  EfPageCacheStorage *_storage;
100 
101 };
102 
105 typedef std::vector<EfPageCacheCommitRequest> EfPageCacheCommitRequestVector;
106 
107 PXR_NAMESPACE_CLOSE_SCOPE
108 
109 #endif
Manages a page cache and provides methods for invalidation of cached values.
const EfInputValueBlock & GetInputs() const
Returns the input value block containing the key output value.
EF_API VdfRequest GetUncached(const VdfRequest &request) const
Returns the subset of request, which is still not cached.
An output-to-value storage for caching.
This object signifies an intent to commit data to a page cache.
std::vector< EfPageCacheCommitRequest > EfPageCacheCommitRequestVector
A vector of page cache commit requests.
Ef_OutputValueCache * GetCache() const
Returns the output value cache where values will be committed to.
An input value block is a vector of (output, value) pairs, each of which will be used to initialize a...
EF_API bool Commit(const VdfExecutorInterface &executor, const VdfRequest &request, size_t *bytesCommitted)
Commits data for the outputs denoted by the request to the cache, reading their values from the speci...
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values.
EF_API ~EfPageCacheCommitRequest()
Destructor.
EF_API bool IsUncached(const VdfRequest &request) const
Returns true if any output in the specified request is still not cached.
EF_API EfPageCacheCommitRequest(const EfInputValueBlock &inputs, EfPageCacheStorage *storage)
Constructor.