7#ifndef PXR_EXEC_EF_LEAF_NODE_INDEXER_H
8#define PXR_EXEC_EF_LEAF_NODE_INDEXER_H
17#include <tbb/concurrent_queue.h>
18#include <tbb/concurrent_unordered_map.h>
19#include <tbb/concurrent_vector.h>
21PXR_NAMESPACE_OPEN_SCOPE
61 return index < _nodes.size() ? _nodes[index].node :
nullptr;
68 return index < _nodes.size() ? _nodes[index].output :
nullptr;
75 return index < _nodes.size() ? _nodes[index].mask :
nullptr;
104 tbb::concurrent_unordered_map<VdfIndex, Index> _indices;
108 tbb::concurrent_vector<_LeafNode> _nodes;
112 tbb::concurrent_queue<Index> _freeList;
120 return it != _indices.end() ? it->second :
InvalidIndex;
123PXR_NAMESPACE_CLOSE_SCOPE
The leaf node indexer tracks leaf nodes added and removed from the network, and associates each leaf ...
const VdfOutput * GetSourceOutput(Index index) const
Returns the output a given leaf node index is sourcing data from.
const VdfMask * GetSourceMask(Index index) const
Returns the mask at the output a given leaf node index is sourcing data from.
void DidDisconnect(const VdfConnection &connection)
Call this to notify the cache of connections that have been deleted.
uint32_t Index
Data type of the index.
void DidConnect(const VdfConnection &connection)
Call this to notify the cache of newly added connections.
Index GetIndex(const VdfNode &node) const
Returns an index for a given leaf node.
static constexpr Index InvalidIndex
Sentinel for an invalid index.
const VdfNode * GetNode(Index index) const
Returns the node for a given index.
void Invalidate()
Invalidate the entire cache.
size_t GetCapacity() const
Returns the capacity of the indexer, i.e.
A class that fully represents a connection between two VdfNodes.
A VdfMask is placed on connections to specify the data flowing through them.
This is the base class for all nodes in a VdfNetwork.
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.
A VdfOutput represents an output on a node.