Loading...
Searching...
No Matches
iterator.h
Go to the documentation of this file.
1//
2// Copyright 2025 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_EXEC_VDF_ITERATOR_H
8#define PXR_EXEC_VDF_ITERATOR_H
9
11
12#include "pxr/pxr.h"
13
14#include "pxr/exec/vdf/api.h"
16#include "pxr/exec/vdf/types.h"
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20class TfToken;
21class VdfConnection;
23class VdfMask;
24class VdfNode;
25class VdfOutput;
26class VdfVector;
27
36{
37protected:
38
41 ~VdfIterator() = default;
42
45 const VdfNode &_GetNode(const VdfContext &context) const {
46 return context._GetNode();
47 }
48
51 const VdfExecutorInterface &_GetExecutor(const VdfContext &context) const {
52 return context._GetExecutor();
53 }
54
59 VDF_API
61 const VdfContext &context,
62 const VdfConnection &connection,
63 const VdfMask &mask) const;
64
68 VDF_API
70 const VdfContext &context,
71 const VdfConnection &connection,
72 const VdfMask &mask) const;
73
80 VDF_API
82 const VdfContext &context,
83 const TfToken &name) const;
84
90 VDF_API
92 const VdfContext &context,
93 const VdfOutput &output) const;
94
105 VDF_API
107 const VdfContext &context,
108 const VdfOutput &output,
109 const VdfMask **requestMask,
110 const VdfMask **affectsMask) const;
111
116 VDF_API
118 const VdfContext &context,
119 const VdfConnection &connection) const;
120
124 VDF_API
126 const VdfContext &context,
127 const VdfOutput &output) const;
128
132 VDF_API
134 const VdfContext &context,
135 const VdfNode &node,
136 const VdfScheduledOutputCallback &callback) const;
137};
138
139PXR_NAMESPACE_CLOSE_SCOPE
140
141#endif
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
A class that fully represents a connection between two VdfNodes.
Definition: connection.h:30
A context is the parameter bundle passed to callbacks of computations.
Definition: context.h:40
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values.
Base class for libVdf iterators.
Definition: iterator.h:36
const VdfExecutorInterface & _GetExecutor(const VdfContext &context) const
Returns the executor for the given context.
Definition: iterator.h:51
VDF_API void _ForEachScheduledOutput(const VdfContext &context, const VdfNode &node, const VdfScheduledOutputCallback &callback) const
Loops over each scheduled output of node and calls callback with the output and request mask in an ef...
VDF_API const VdfVector * _GetInputValue(const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const
Returns a vector for reading an input value.
VDF_API const VdfOutput * _GetRequiredOutputForWriting(const VdfContext &context, const TfToken &name) const
Returns the output for writing based on the name provided.
VDF_API bool _IsRequiredInput(const VdfContext &context, const VdfConnection &connection) const
Returns true when the connection is scheduled and required, and false otherwise.
VDF_API const VdfVector & _GetRequiredInputValue(const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const
Returns the cached output value for a given output, or issues an error message if a cache value is no...
VDF_API const VdfMask * _GetRequestMask(const VdfContext &context, const VdfOutput &output) const
Returns the request mask of output, if the output has been scheduled and NULL otherwise.
VDF_API bool _GetOutputMasks(const VdfContext &context, const VdfOutput &output, const VdfMask **requestMask, const VdfMask **affectsMask) const
Retrieves the request and affects masks of the given output.
VDF_API VdfVector * _GetOutputValueForWriting(const VdfContext &context, const VdfOutput &output) const
Returns a vector for writing an output value into.
~VdfIterator()=default
Disallow destruction via base class pointers.
const VdfNode & _GetNode(const VdfContext &context) const
Returns the current node being run.
Definition: iterator.h:45
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:37
This is the base class for all nodes in a VdfNetwork.
Definition: node.h:53
A VdfOutput represents an output on a node.
Definition: output.h:32
This class is used to abstract away knowledge of the cache data used for each node.
Definition: vector.h:56
std::function< void(const VdfOutput *, const VdfMask &)> VdfScheduledOutputCallback
Function type to be used with ForEachScheduledOutput().
Definition: types.h:86