7 #ifndef PXR_EXEC_EF_DEPENDENCY_CACHE_H
8 #define PXR_EXEC_EF_DEPENDENCY_CACHE_H
21 #include <tbb/concurrent_vector.h>
24 #include <unordered_map>
59 std::vector<const VdfNode *> *);
87 bool updateIncrementally)
const;
98 const std::vector<const VdfNode *> &
FindNodes(
100 bool updateIncrementally)
const;
136 _Entry(
bool updateIncrementally)
137 : updateIncrementally(updateIncrementally)
142 bool ContainsNode(
const VdfNode &node)
const {
145 nodeRefs.GetSize() > nodeIndex &&
146 nodeRefs.IsSet(nodeIndex);
149 bool IsValid()
const {
150 return valid.load(std::memory_order_relaxed);
154 valid.store(std::memory_order_relaxed);
161 std::vector<const VdfNode *> nodeDeps;
198 tbb::concurrent_vector<_Connection> newConnections;
210 std::vector<size_t> nodeNumOutputs;
213 bool updateIncrementally;
216 std::atomic<bool> valid;
220 const _Entry & _Find(
222 bool updateIncrementally)
const;
225 const _Entry & _PopulateCache(
227 bool updateIncrementally)
const;
232 _Entry *entry)
const;
236 void _TraversePartially(
238 _Entry *entry)
const;
243 bool _GatherDependenciesForNewConnection(
250 void _GatherDependenciesForExtendedNode(
256 static bool _NodeCallback(
262 static bool _OutputCallback(
273 using _Cache = std::unordered_map<
277 mutable _Cache _cache;
EF_API void WillDeleteConnection(const VdfConnection &connection)
EF_API const VdfOutputToMaskMap & FindOutputs(const VdfMaskedOutputVector &outputs, bool updateIncrementally) const
EF_API const std::vector< const VdfNode * > & FindNodes(const VdfMaskedOutputVector &outputs, bool updateIncrementally) const
#define PXR_NAMESPACE_OPEN_SCOPE
_Connection(VdfId sourceNodeId_, TfToken outputName_, VdfId targetNodeId_, TfToken inputName_)
A VdfMask is placed on connections to specify the data flowing through them.
EF_API ~EfDependencyCache()
EF_API void DidConnect(const VdfConnection &connection)
Fast bit array that keeps track of the number of bits set and can find the next set in a timely manne...
static VdfIndex GetIndexFromId(const VdfId id)
std::unordered_map< const VdfOutput *, VdfMask, TfHash > VdfOutputToMaskMap
A map from output pointer to mask.
EF_API VdfConnection * GetConnection(const VdfNetwork *network) const
#define PXR_NAMESPACE_CLOSE_SCOPE
bool(*)(const VdfNode &node, VdfOutputToMaskMap *, std::vector< const VdfNode * > *) PredicateFunction
EF_API EfDependencyCache(PredicateFunction predicate)
std::vector< VdfMaskedOutput > VdfMaskedOutputVector
uint64_t VdfId
The unique identifier type for Vdf objects.
uint32_t VdfIndex
The index type for Vdf objects.