![]() |
|
Caches output traversals by associating an input request with a set of stored output dependencies, as determined by a predicate function. More...
#include <dependencyCache.h>
Public Types | |
| using | PredicateFunction = bool(*)(const VdfNode &node, VdfOutputToMaskMap *, std::vector< const VdfNode * > *) |
| The predicate function that determines the cached dependencies. | |
Public Member Functions | |
| EF_API | EfDependencyCache (PredicateFunction predicate) |
| Constructor. | |
| EF_API | ~EfDependencyCache () |
| Destructor. | |
| EF_API const VdfOutputToMaskMap & | FindOutputs (const VdfMaskedOutputVector &outputs, bool updateIncrementally) const |
| Find the output dependencies associated with the given request. | |
| EF_API const std::vector< const VdfNode * > & | FindNodes (const VdfMaskedOutputVector &outputs, bool updateIncrementally) const |
| Find the node dependencies associated with the given request. | |
| EF_API void | Invalidate () |
| Invalidate all cached dependencies. | |
| EF_API void | WillDeleteConnection (const VdfConnection &connection) |
| Invalidate all traversals dependent on this connection. | |
| EF_API void | DidConnect (const VdfConnection &connection) |
| Invalidate all traversals dependent on this new connection. | |
Caches output traversals by associating an input request with a set of stored output dependencies, as determined by a predicate function.
The traversals in this cache are invalidated by calling the WillDeleteConnection and DidConnect methods in response to network edits (WillDeleteNode, WillDeleteConnection, DidConnect). Invalidation is optionally sparse, depending on the value of the updateIncrementally flag passed to FindOutputs and FindNodes.
Definition at line 44 of file dependencyCache.h.
| using PredicateFunction = bool (*) ( const VdfNode &node, VdfOutputToMaskMap *, std::vector<const VdfNode *> *) |
The predicate function that determines the cached dependencies.
Takes the node currently being visited, as well as a result map to insert output and node dependencies into.
Returns false in order to stop the traversal at the current branch, and true to continue.
Definition at line 55 of file dependencyCache.h.
|
explicit |
Constructor.
| EF_API ~EfDependencyCache | ( | ) |
Destructor.
| EF_API void DidConnect | ( | const VdfConnection & | connection | ) |
Invalidate all traversals dependent on this new connection.
| EF_API const std::vector< const VdfNode * > & FindNodes | ( | const VdfMaskedOutputVector & | outputs, |
| bool | updateIncrementally | ||
| ) | const |
Find the node dependencies associated with the given request.
Set updateIncrementally to true for cached dependencies that should be sparsely invalidated and updated incrementally.
| EF_API const VdfOutputToMaskMap & FindOutputs | ( | const VdfMaskedOutputVector & | outputs, |
| bool | updateIncrementally | ||
| ) | const |
Find the output dependencies associated with the given request.
Set updateIncrementally to true for cached dependencies that should be sparsely invalidated and updated incrementally.
Note that the masks here may sometimes be empty, to signify that an output mask couldn't be inferred for that output. If an output is returned with an empty mask, that output is reachable from the provided outputs but the mask associated with the traversal is unknown.
| EF_API void Invalidate | ( | ) |
Invalidate all cached dependencies.
| EF_API void WillDeleteConnection | ( | const VdfConnection & | connection | ) |
Invalidate all traversals dependent on this connection.