7#ifndef PXR_EXEC_VDF_SPARSE_OUTPUT_TRAVERSER_H
8#define PXR_EXEC_VDF_SPARSE_OUTPUT_TRAVERSER_H
14#include "pxr/exec/vdf/api.h"
18#include "pxr/base/tf/hashmap.h"
23PXR_NAMESPACE_OPEN_SCOPE
74 typedef std::function<
97 const VdfMaskedOutputVector &outputs,
110 const VdfMaskedOutputVector &outputs,
133 std::vector<int> rootIndices;
136 typedef std::vector<_CacheEntry> CacheEntries;
137 CacheEntries cacheEntries;
142 _Cache* _GetOrCreateCacheEntry(
const VdfMaskedOutputVector &sortedOutputs);
144 class _TraversalHelper;
152 using _TraversalCache =
153 TfHashMap<VdfMaskedOutputVector, _Cache, VdfMaskedOutputVector_Hash>;
156 _TraversalCache _cache;
159 using _CacheHistory = std::queue<_TraversalCache::iterator>;
163 _CacheHistory _cacheHistory;
167PXR_NAMESPACE_CLOSE_SCOPE
A VdfMask is placed on connections to specify the data flowing through them.
A VdfOutput represents an output on a node.
A class used for fast traversals of VdfNetworks in the input-to-output direction.
VDF_API void InvalidateAll()
Invalidates all cached traversals.
VDF_API VdfSparseOutputTraverser(bool enableCaching=true)
Creates a new VdfSparseOutputTraverser.
static VDF_API void Traverse(const VdfMaskedOutputVector &outputs, const OutputCallback &outputCallback, const VdfNodeCallback &nodeCallback)
Traverses the network, starting from the masked outputs in outputs.
std::function< bool(const VdfOutput &, const VdfMask &, const VdfInput *) > OutputCallback
Callback used when traversing a network.
VDF_API void TraverseWithCaching(const VdfMaskedOutputVector &outputs, const OutputCallback &outputCallback, const VdfNodeCallback &nodeCallback)
Traverses the network, starting from the masked outputs in request.
static const int MaxRequestsBeforeEviction
The number of requests to remain in the cache.
std::function< void(const VdfNode &)> VdfNodeCallback
Type of callback used when processing nodes.