HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EfDependencyCache Class Reference

#include <dependencyCache.h>

Public Types

using PredicateFunction = bool(*)(const VdfNode &node, VdfOutputToMaskMap *, std::vector< const VdfNode * > *)
 

Public Member Functions

EF_API EfDependencyCache (PredicateFunction predicate)
 
EF_API ~EfDependencyCache ()
 
EF_API const VdfOutputToMaskMapFindOutputs (const VdfMaskedOutputVector &outputs, bool updateIncrementally) const
 
EF_API const std::vector
< const VdfNode * > & 
FindNodes (const VdfMaskedOutputVector &outputs, bool updateIncrementally) const
 
EF_API void Invalidate ()
 
EF_API void WillDeleteConnection (const VdfConnection &connection)
 
EF_API void DidConnect (const VdfConnection &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

using EfDependencyCache::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 59 of file dependencyCache.h.

Constructor & Destructor Documentation

EF_API EfDependencyCache::EfDependencyCache ( PredicateFunction  predicate)
explicit

Constructor.

EF_API EfDependencyCache::~EfDependencyCache ( )

Destructor.

Member Function Documentation

EF_API void EfDependencyCache::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.)
EF_API const std::vector<const VdfNode *>& EfDependencyCache::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.
EF_API const VdfOutputToMaskMap& EfDependencyCache::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.
EF_API void EfDependencyCache::Invalidate ( )

Invalidate all cached dependencies.

Note
This method is not thread safe.
EF_API void EfDependencyCache::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: