7#ifndef PXR_EXEC_VDF_NETWORK_UTIL_H
8#define PXR_EXEC_VDF_NETWORK_UTIL_H
14#include "pxr/exec/vdf/api.h"
23PXR_NAMESPACE_OPEN_SCOPE
53 bool *foundSpecNode =
nullptr);
73template <
class Callable>
82 std::vector<const VdfNode *> stack(1, &startNode);
85 while (!stack.empty()) {
88 const VdfNode *top = stack.back();
93 if (visited.
IsSet(idx)) {
100 if (std::forward<Callable>(callback)(*top)) {
101 for (
const std::pair<TfToken, VdfInput *> &i :
104 stack.push_back(&c->GetSourceNode());
113PXR_NAMESPACE_CLOSE_SCOPE
Fast bit array that keeps track of the number of bits set and can find the next set in a timely manne...
void Set(size_t index)
Sets bit # index to one.
bool IsSet(size_t index) const
Returns true, if bit # index is set.
A class that fully represents a connection between two VdfNodes.
Class to hold on to an externally owned output and a mask.
size_t GetNodeCapacity() const
Returns the number of entries currently available for nodes and for which it is valid to call GetNode...
This is the base class for all nodes in a VdfNetwork.
const InputMapIterator GetInputsIterator() const
Returns an iterator class that can be used with TF_FOR_ALL to iterate through the inputs.
static VdfIndex GetIndexFromId(const VdfId id)
Get the node index from the node id.
VdfId GetId() const
Returns the unique id of this node in its network.
const VdfNetwork & GetNetwork() const
Returns the network to which this node belongs.
A VdfOutput represents an output on a node.
uint32_t VdfIndex
The index type for Vdf objects.
void VdfTraverseTopologicalSourceNodes(const VdfNode &startNode, Callable &&callback)
Traverses nodes starting at startNode and moving along its inputs.
VDF_API void VdfEmptyNodeCallback(const VdfNode &)
Empty callback node, does nothing.
VDF_API const VdfOutput * VdfGetAssociatedSourceOutput(const VdfOutput &output)
Returns the output that is the source of the associated input of output, if any and NULL otherwise.
VDF_API bool VdfIsTopologicalSourceNode(const VdfNode &startNode, const VdfNode &nodeToFind, bool *foundSpecNode=nullptr)
Searches for nodeToFind via topological (ie.
VDF_API bool VdfIsSpeculating(const VdfMaskedOutput &maskedOutput)
Returns true, if maskedOutput is computed via speculation node.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...