Loading...
Searching...
No Matches
EfDependencyCache Class Reference

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 VdfOutputToMaskMapFindOutputs (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.
 

Detailed Description

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.

Member Typedef Documentation

◆ PredicateFunction

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.

Constructor & Destructor Documentation

◆ EfDependencyCache()

EF_API EfDependencyCache ( PredicateFunction  predicate)
explicit

Constructor.

◆ ~EfDependencyCache()

EF_API ~EfDependencyCache ( )

Destructor.

Member Function Documentation

◆ DidConnect()

EF_API void DidConnect ( const VdfConnection connection)

Invalidate all traversals dependent on this new connection.

Note
Intermixed concurrent calls to this method and to WillDeleteConnection are supported. (Though it's not safe for any given source and target output pair to be concurrently connected and deleted.)

◆ FindNodes()

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.

Note
This method is not thread safe.

◆ FindOutputs()

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.

Note
This method is not thread safe.

◆ Invalidate()

EF_API void Invalidate ( )

Invalidate all cached dependencies.

Note
This method is not thread safe.

◆ WillDeleteConnection()

EF_API void WillDeleteConnection ( const VdfConnection connection)

Invalidate all traversals dependent on this connection.

Note
Intermixed concurrent calls to this method and to DidConnect are supported. (Though it's not safe for any given source and target output pair to be concurrently connected and deleted.)

The documentation for this class was generated from the following file: