HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
node.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_NODE_H
8 #define PXR_EXEC_VDF_NODE_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/api.h"
17 #include "pxr/exec/vdf/input.h"
19 #include "pxr/exec/vdf/mask.h"
20 #include "pxr/exec/vdf/output.h"
21 #include "pxr/exec/vdf/request.h"
22 #include "pxr/exec/vdf/types.h"
23 
24 #include "pxr/base/arch/demangle.h"
26 #include "pxr/base/tf/iterator.h"
27 #include "pxr/base/tf/mallocTag.h"
28 #include "pxr/base/tf/token.h"
29 
30 #include <functional>
31 #include <string>
32 #include <typeinfo>
33 #include <type_traits>
34 #include <utility>
35 #include <vector>
36 
38 
39 class VdfContext;
41 class VdfMaskedOutput;
42 class VdfNetwork;
44 class VdfVector;
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 ///
48 /// \class VdfNode
49 ///
50 /// This is the base class for all nodes in a VdfNetwork.
51 ///
53 {
54 private:
55 
56  // Map of tokens to output connectors.
57  //
59 
60  // Map of tokens to input connectors.
61  //
63 
64 public:
65 
66  TF_MALLOC_TAG_NEW("Vdf", "new VdfNode");
67 
68  // This little class allows clients to use TF_FOR_ALL to iterate
69  // through the input connectors.
70  //
72  public:
75 
76  InputMapIterator(const _TokenInputMap &map) : _map(map) {}
77  const_iterator begin() const { return _map.begin(); }
78  const_iterator end() const { return _map.end(); }
79  const_reverse_iterator rbegin() const { return _map.rbegin(); }
80  const_reverse_iterator rend() const { return _map.rend(); }
81 
82  private:
83  const _TokenInputMap &_map;
84  };
85 
86  // This little class allows clients to use TF_FOR_ALL to iterate
87  // through the output connectors.
88  //
90  public:
93 
94  OutputMapIterator(const _TokenOutputMap &map) : _map(map) {}
95  const_iterator begin() const { return _map.begin(); }
96  const_iterator end() const { return _map.end(); }
97  const_reverse_iterator rbegin() const { return _map.rbegin(); }
98  const_reverse_iterator rend() const { return _map.rend(); }
99 
100  private:
101  const _TokenOutputMap &_map;
102  };
103 
104 
105  /// Constructs a node in \p network with the inputs described by
106  /// \p inputSpecs and outputs described by \p outputSpecs.
107  ///
108  VDF_API
109  VdfNode(VdfNetwork *network,
110  const VdfInputSpecs &inputSpecs,
111  const VdfOutputSpecs &outputSpecs);
112 
113  /// Returns the unique id of this node in its network. No current, or
114  /// previously constructed node in the same network will share this id.
115  ///
116  VdfId GetId() const { return _id; }
117 
118  /// Get the node index from the node id. The index uniquely identifies
119  /// the node in the current state of the network, but may alias an index
120  /// which existed in a previous state of the network and has since been
121  /// destructed.
122  ///
123  static VdfIndex GetIndexFromId(const VdfId id) {
124  return static_cast<VdfIndex>(id);
125  }
126 
127  /// Get the node version from the node id. Node ids with the same
128  /// index are disambiguated by a version number. Given multiple node ids
129  /// with the same index, only one version will match the current state
130  /// of the network.
131  ///
132  static VdfVersion GetVersionFromId(const VdfId id) {
133  return static_cast<VdfVersion>(id >> 32);
134  }
135 
136  /// Returns the network to which this node belongs.
137  ///
138  const VdfNetwork &GetNetwork() const { return _network; }
139 
140  /// Returns the network to which this node belongs.
141  ///
142  VdfNetwork &GetNetwork() { return _network; }
143 
144  /// Returns true, if this node is of type \p TYPE.
145  ///
146  template<typename TYPE>
147  bool IsA() const
148  {
149  return dynamic_cast<const TYPE *>(this);
150  }
151 
152  /// \name Dataflow network management - Input API
153  /// @{
154 
155  /// Returns the list of input specs.
156  ///
157  const VdfInputSpecs &GetInputSpecs() const {
158  return _specs->GetInputSpecs();
159  }
160 
161  /// Returns the connector named \p inputName, returns NULL if no
162  /// input of that name exists.
163  ///
164  const VdfInput *GetInput(const TfToken &inputName) const {
165  return const_cast<VdfNode *>(this)->GetInput(inputName);
166  }
167 
168  /// Returns the input named \p inputName, returns NULL if no
169  /// input of that name exists.
170  ///
171  VDF_API
172  VdfInput *GetInput(const TfToken &inputName);
173 
174  /// Returns an iterator class that can be used with TF_FOR_ALL to
175  /// iterate through the inputs.
176  ///
178  return InputMapIterator(_inputs);
179  }
180 
181  /// Returns true if the node has input connections, false otherwise.
182  ///
183  bool HasInputConnections() const {
184  TF_FOR_ALL(i, _inputs) {
185  if (i->second->GetNumConnections())
186  return true;
187  }
188  return false;
189  }
190 
191  /// Returns true if the node has output connections, false otherwise.
192  ///
193  bool HasOutputConnections() const {
194  TF_FOR_ALL(output, _outputs) {
195  if (output->second->GetConnections().size())
196  return true;
197  }
198  return false;
199  }
200 
201  /// Returns a flat vector of all input connections.
202  ///
203  VDF_API
204  VdfConnectionVector GetInputConnections() const;
205 
206  /// Returns a flat vector of all output connections.
207  ///
208  VDF_API
209  VdfConnectionVector GetOutputConnections() const;
210 
211  /// @}
212 
213 
214  /// \name Dataflow network management - Output API
215  /// @{
216 
217  /// Returns the list of output specs.
218  ///
220  return _specs->GetOutputSpecs();
221  }
222 
223  /// Returns the output object named \p name.
224  ///
225  /// Returns \c NULL and issues a coding error if no such output exists.
226  ///
227  const VdfOutput *GetOutput(const TfToken &name) const {
228  return const_cast<VdfNode *>(this)->GetOutput(name);
229  }
230 
231  /// Returns the output object named \p name.
232  ///
233  /// Returns \c NULL and issues a coding error if no such output exists.
234  ///
235  VDF_API
236  VdfOutput *GetOutput(const TfToken &name);
237 
238  /// Returns the output object named \p name.
239  ///
240  /// Returns \c NULL if no such output exists, but issues no errors.
241  ///
242  VDF_API
243  VdfOutput *GetOptionalOutput(const TfToken &name);
244 
245  /// Returns the output object named \p name.
246  ///
247  /// Returns \c NULL if no such output exists, but issues no errors.
248  ///
249  const VdfOutput *GetOptionalOutput(const TfToken &name) const {
250  return const_cast<VdfNode *>(this)->GetOptionalOutput(name);
251  }
252 
253  /// Returns the only output object that this node contains.
254  ///
255  /// It is only valid to call this method on nodes that contain
256  /// exactly one output. A coding error will be issued otherwise.
257  ///
258  /// Returns \c NULL if the node doesn't have exactly one output.
259  ///
260  const VdfOutput *GetOutput() const {
261  return const_cast<VdfNode *>(this)->GetOutput();
262  }
263 
264  /// Returns the only output object that this node contains.
265  ///
266  /// It is only valid to call this method on nodes that contain
267  /// exactly one output. A coding error will be issued otherwise.
268  ///
269  /// Returns \c NULL if the node doesn't have exactly one output.
270  ///
271  VDF_API
272  VdfOutput *GetOutput();
273 
274  /// Returns an iterator class that can be used with TF_FOR_ALL to
275  /// iterator through the output connectors.
276  ///
278  return OutputMapIterator(_outputs);
279  }
280 
281  /// Returns the number of outputs that this node currently has.
282  ///
283  size_t GetNumOutputs() const {
284  return _outputs.size();
285  }
286 
287  /// Returns the number of inputs that this node currently has.
288  ///
289  size_t GetNumInputs() const {
290  return _inputs.size();
291  }
292 
293  /// @}
294 
295 
296  /// \name Diagnostic API
297  /// @{
298 
299  /// Sets the debug name for this node.
300  ///
301  /// By default, a node's debug name is the node type name; this function
302  /// appends \p name to the node type name.
303  ///
304  VDF_API
305  void SetDebugName(const std::string &name);
306 
307  /// Sets the debug name for this node with a lazily invoked callback.
308  ///
309  /// By default, a node's debug name is the node type name; this function
310  /// appends the string returned by \p f to the node type name.
311  ///
312  template <class F>
314  TfAutoMallocTag tag("Vdf", __ARCH_PRETTY_FUNCTION__);
315  SetDebugNameCallback(VdfNodeDebugNameCallback(std::forward<F>(f)));
316  }
317 
318  /// Sets the debug name for this node with a lazily invoked callback.
319  ///
320  /// By default, a node's debug name is the node type name; this function
321  /// appends the string returned by \p callback to the node type name.
322  ///
323  /// If \p callback is empty, return without setting the debug name.
324  ///
325  VDF_API
326  void SetDebugNameCallback(VdfNodeDebugNameCallback &&callback);
327 
328  /// Returns the debug name for this node, if one is registered. Otherwise,
329  /// returns the node type name by default.
330  ///
331  VDF_API
332  const std::string GetDebugName() const;
333 
334  /// Returns the amount of memory used by the node in bytes.
335  ///
336  /// Does not account for data structures to keep track of connections
337  /// etc.
338  ///
339  VDF_API
340  virtual size_t GetMemoryUsage() const;
341 
342  /// @}
343 
344 
345  /// \name VdfExecutor API
346  /// @{
347 
348  /// This is the method called to perform computation.
349  ///
350  /// Derived classes must ensure that this method is thread safe, in the
351  /// sense that Compute() may be called simultaneously on a single node.
352  ///
353  virtual void Compute(const VdfContext &context) const = 0;
354 
355  /// Returns \c true if this node performs speculation.
356  ///
357  /// The default implementation returns \c false.
358  ///
359  VDF_API
360  virtual bool IsSpeculationNode() const;
361 
362  /// Returns a predicate, determining whether a given input and its
363  /// connections are required in order to fulfill this node's input
364  /// dependencies.
365  ///
366  /// This method is only allowed to read input values on the inputs that
367  /// have been marked as prerequisites.
368  ///
369  VDF_API
370  virtual VdfRequiredInputsPredicate GetRequiredInputsPredicate(
371  const VdfContext &context) const;
372 
373  /// Returns a mask that indicates which elements of the data that flows
374  /// along \p output depend on the elements indicated by
375  /// \p inputDependencyMask that flow in via \p inputConnection.
376  ///
377  /// This is used for dependency queries in the input-to-output direction.
378  ///
379  /// - If \p output is an associated output, returns a mask that is computed
380  /// based on the semantics of associated input/output pairs.
381  /// - Otherwise, calls the virtual method _ComputeOutputDependencyMask().
382  ///
383  /// \p inputConnection must be a connection that connects to an input
384  /// on this node. \p output must be owned by this node.
385  ///
386  VDF_API
387  VdfMask ComputeOutputDependencyMask(
388  const VdfConnection &inputConnection,
389  const VdfMask &inputDependencyMask,
390  const VdfOutput &output) const;
391 
392  /// Vectorized version of ComputeOutputDependencyMask. For a given
393  /// inputConnection and inputDependencyMask, returns the outputs and
394  /// masks that depend on them in \p outputDependencies.
395  ///
396  VDF_API
397  void ComputeOutputDependencyMasks(
398  const VdfConnection &inputConnection,
399  const VdfMask &inputDependencyMask,
400  VdfMaskedOutputVector *outputDependencies) const;
401 
402  /// Returns a mask that indicates which elements of the data that flows
403  /// along \p inputConnection are needed to compute the data flowing out
404  /// as indicated by \p maskedOutput.
405  ///
406  /// This is used for dependency queries in the output-to-input direction.
407  ///
408  /// - If \p inputConnection is associated with the output in
409  /// \p maskedOutput, returns a mask that is computed based on the
410  /// semantics of associated input/output pairs.
411  /// - Otherwise, calls the virtual method _ComputeInputDependencyMask().
412  ///
413  /// \p inputConnection must be a connection that connects to an input
414  /// on this node. The output in \p maskedOutput must be owned
415  /// by this node.
416  ///
417  VDF_API
418  VdfMask::Bits ComputeInputDependencyMask(
419  const VdfMaskedOutput &maskedOutput,
420  const VdfConnection &inputConnection) const;
421 
422  /// Vectorized version of ComputeInputDependencyMask.
423  ///
424  /// Additional parameter \p skipAssociatedInputs can control if associated
425  /// inputs should be considered.
426  ///
427  VDF_API
428  VdfConnectionAndMaskVector ComputeInputDependencyMasks(
429  const VdfMaskedOutput &maskedOutput,
430  bool skipAssociatedInputs) const;
431 
432  /// Vectorized version of ComputeInputDependencyMasks().
433  ///
434  /// Computes all input dependencies for \p request in one go.
435  ///
436  VDF_API
437  VdfConnectionAndMaskVector ComputeInputDependencyRequest(
438  const VdfMaskedOutputVector &request) const;
439 
440  /// @}
441 
442 
443  /// Returns true, if \p rhs and this node compute the same value(s).
444  ///
445  VDF_API
446  bool IsEqual(const VdfNode &rhs) const;
447 
448 protected:
449 
450  /// Protected constructor.
451  ///
452  /// Can be used by derived classes that want to manage their own
453  /// storage for input/output specs.
454  ///
455  /// The derived constructor should call _InitializeInputAndOutputSpecs
456  /// because this version of the constructor won't do it.
457  ///
458  VDF_API
459  VdfNode(VdfNetwork *network);
460 
461  /// Builds inputs from the supplied input specs and appends them to
462  /// the already-existing set of inputs, if any.
463  ///
464  /// Pointers to the newly-created VdfInputs are appended to resultingInputs,
465  /// if resultingInputs is not NULL.
466  VDF_API
467  void _AppendInputs(
468  const VdfInputSpecs &inputSpecs,
469  std::vector<VdfInput*> *resultingInputs = NULL);
470 
471  /// Builds outputs from the supplied output specs and appends them to
472  /// the already-existing set of outputs, if any.
473  ///
474  /// Pointers to the newly-created VdfOutputs are appended to
475  /// resultingInputs, if resultingOutputs is not NULL.
476  VDF_API
477  void _AppendOutputs(
478  const VdfOutputSpecs &outputSpecs,
479  std::vector<VdfOutput*> *resultingOutputs = NULL);
480 
481  /// Can be overridden by derived classes to facilitate equality
482  /// comparision.
483  ///
484  /// The default implementation will always return false. Note that all
485  /// connector specs, etc. are already taken care of via VdfNode::IsEqual().
486  ///
487  VDF_API
488  virtual bool _IsDerivedEqual(const VdfNode &rhs) const;
489 
490  /// Notifies a node that one connection has been added.
491  ///
492  /// \p atIndex will either contain the `atIndex` parameter passed to
493  /// VdfNetwork's Connect() method, which specifies at what index a new
494  /// connection has been inserted, or VdfNetwork::AppendConnection if the new
495  /// connection was appended.
496  ///
497  /// \note
498  /// Note that this method will be called _after_ a connection has been made
499  /// and is linked into the respective VdfInput and VdfOutput.
500  ///
501  VDF_API
502  virtual void _DidAddInputConnection(const VdfConnection *c, int atIndex);
503 
504  /// Notifies a node that one connection will be removed.
505  ///
506  /// \note
507  /// Note that this method will be called _before_ a connection is unlinked
508  /// from the respective VdfInput and VdfOutput in case of deletion.
509  ///
510  VDF_API
511  virtual void _WillRemoveInputConnection(const VdfConnection *c);
512 
513  // The network is the only entity allowed to delete a node and set a node's
514  // id.
515  friend class VdfNetwork;
516 
517  /// Protected Destructor.
518  ///
519  /// Only the network is allowed to destroy nodes.
520  ///
521  VDF_API
522  virtual ~VdfNode();
523 
524  /// Sets the node id. The node id is controlled by VdfNetwork.
525  ///
526  void _SetId(const VdfVersion version, const VdfIndex index) {
527  _id = (static_cast<VdfId>(version) << 32) | static_cast<VdfId>(index);
528  }
529 
530  /// \name VdfInputAndOutputSpecs management
531  /// @{
532 
533  /// Gets an input/output specs pointer that the node can use. This is
534  /// virtual so that a derived class may specify exactly where the storage
535  /// comes from. This function is not called during performance-critical
536  /// code-paths.
537  ///
538  VDF_API
539  virtual const VdfInputAndOutputSpecs *_AcquireInputAndOutputSpecsPointer(
540  const VdfInputSpecs &inputSpecs,
541  const VdfOutputSpecs &outputSpecs);
542 
543  /// Releases an input/output specs pointer that was acquired with a
544  /// previous call to _AcquireInputAndOutputSpecsPointer(). This is virtual
545  /// so that a derived class may specify exactly where the storage comes
546  /// from. This function is not called during performance-critical
547  /// code-paths.
548  ///
549  VDF_API
550  virtual void _ReleaseInputAndOutputSpecsPointer(
551  const VdfInputAndOutputSpecs *specs);
552 
553  /// Initializes the input/output specs pointer for this node.
554  ///
555  /// Only to be called from constructors of derived classes that want to
556  /// manage their own storage for the input/output specs.
557  ///
558  VDF_API
559  void _InitializeInputAndOutputSpecs(
560  const VdfInputAndOutputSpecs *specs);
561 
562  /// Clears the input/output specs pointer.
563  ///
564  /// This can be used in the destructor of derived classes to avoid having
565  /// their own storage for the input/output specs go through the default
566  /// destruction pattern of the base class.
567  ///
568  VDF_API
569  void _ClearInputAndOutputSpecsPointer();
570 
571  /// Replaces the node's input specs with \p inputSpecs and rebuilds all
572  /// inputs.
573  ///
574  VDF_API
575  void _ReplaceInputSpecs(const VdfInputSpecs &inputSpecs);
576 
577  /// @}
578 
579  /// Helper method for determining the amount of memory that a node
580  /// uses.
581  ///
582  /// Using this function is much safer than trying to do the computation
583  /// manually, since it knows how to avoid double counting of base class
584  /// structures.
585  ///
586  template <typename BaseClassType, typename ClassType>
587  static size_t _GetMemoryUsage(const ClassType &c, size_t dynamicSize)
588  {
589  return c.BaseClassType::GetMemoryUsage() +
590  (sizeof(ClassType) - sizeof(BaseClassType)) +
591  dynamicSize;
592  }
593 
594  /// Returns a mask that indicates which elements of the data that flows
595  /// along \p output depend on the elements indicated by
596  /// \p inputDependencyMask that flow in via \p inputConnection.
597  ///
598  /// This is only called from ComputeOutputDependencyMask(), to handle
599  /// non-associated inputs.
600  ///
601  /// The default implementation does the following:
602  /// - If \p output has an affects mask, the affects mask is returned,
603  /// indicating that all affected elements depend on the input.
604  /// - Otherwise, returns an all-ones mask, indicating that all elements
605  /// depend on the input.
606  ///
607  /// Derived classes can override this method in order to make the
608  /// resulting dependencies more sparse.
609  ///
610  /// Derived classes must ensure that this method is thread safe, in the
611  /// sense that _ComputeOutputDependencyMask() may be called simultaneously
612  /// on a single node.
613  ///
614  VDF_API
615  virtual VdfMask _ComputeOutputDependencyMask(
616  const VdfConnection &inputConnection,
617  const VdfMask &inputDependencyMask,
618  const VdfOutput &output) const;
619 
620  /// Vectorized version of _ComputeOutputDependencyMask.
621  ///
622  /// Unlike _ComputeDependencyMask, non-trivial derived nodes do not have to
623  /// implement this function. If a derived node is capable of supporting
624  /// this vectorized API, then it must return \c true. The base class
625  /// returns \p false, meaning this is not implemented.
626  ///
627  VDF_API
628  virtual bool _ComputeOutputDependencyMasks(
629  const VdfConnection &inputConnection,
630  const VdfMask &inputDependencyMask,
631  VdfMaskedOutputVector *outputDependencies) const;
632 
633  /// Vectorized version of _ComputeOutputDependencyMasks.
634  ///
635  /// Unlike _ComputeDependencyMasks, non-trivial derived nodes do not have to
636  /// implement this function. If a derived node is capable of supporting
637  /// this vectorized API, then it can override this function.
638  ///
639  VDF_API
640  virtual VdfConnectionAndMaskVector _ComputeInputDependencyRequest(
641  const VdfMaskedOutputVector &request) const;
642 
643  /// Returns a mask that indicates which elements of the data that flows
644  /// along \p inputConnection are needed to compute the data flowing out
645  /// as indicated by \p maskedOutput.
646  ///
647  /// This is only called from ComputeInputDependencyMask(), to handle
648  /// non-associated inputs.
649  ///
650  /// The default implementation returns the connection mask on
651  /// \p inputConnection, indicating that all elements are required.
652  /// Derived classes can override this method in order to make the
653  /// resulting dependencies more sparse.
654  ///
655  /// This method should always return a mask that is a subset of the
656  /// connection mask on \p inputConnection or an empty mask to indicate
657  /// no dependencies.
658  ///
659  /// Derived classes must ensure that this method is thread safe, in the
660  /// sense that _ComputeInputDependencyMask() may be called simultaneously
661  /// on a single node.
662  ///
663  VDF_API
664  virtual VdfMask::Bits _ComputeInputDependencyMask(
665  const VdfMaskedOutput &maskedOutput,
666  const VdfConnection &inputConnection) const;
667 
668  /// Vectorized version of _ComputeInputDependencyMask.
669  ///
670  /// Unlike _ComputeInputDependencyMask, non-trivial derived nodes do not
671  /// have to implement this function.
672  ///
673  /// Additional parameter \p skipAssociatedInputs can control if associated
674  /// inputs should be considered.
675  ///
676  VDF_API
677  virtual VdfConnectionAndMaskVector _ComputeInputDependencyMasks(
678  const VdfMaskedOutput &maskedOutput,
679  bool skipAssociatedInputs) const;
680 
681 private:
682 
683  // This is the network to which the node belongs.
684  // XXX:memory
685  // We may want to come up with a better scheme than adding a back pointer
686  // per-node!
687  VdfNetwork &_network;
688 
689  // This is the unique id of this node in its network.
690  VdfId _id;
691 
692  // This object holds on to the specs of the input and output connectors.
693  // This object is never owned by VdfNode. In the base implementation,
694  // this object is owned by Vdf_InputAndOutputSpecsRegistry and must be
695  // acquired and released through this object. Derived classes may provide
696  // their own management of this pointer.
697  const VdfInputAndOutputSpecs *_specs;
698 
699  // The list of inputs. _inputs[i] gives you all the links into
700  // the i-th input of this node.
701  _TokenInputMap _inputs;
702 
703  // The list of outputs. _outputs[name] gives you all the links out of
704  // the output connector of this node with the label name.
705  //
706  // We require _outputs.size() be constant time.
707  _TokenOutputMap _outputs;
708 };
709 
710 template <>
711 struct Tf_ShouldIterateOverCopy<VdfNode::InputMapIterator> : std::true_type {};
712 template <>
713 struct Tf_ShouldIterateOverCopy<VdfNode::OutputMapIterator> : std::true_type {};
714 
715 ////////////////////////////////////////////////////////////////////////////////
716 
718 
719 #endif
const_reverse_iterator rend() const
Definition: node.h:80
uint32_t VdfVersion
The version type for Vdf objects.
Definition: types.h:113
const InputMapIterator GetInputsIterator() const
Definition: node.h:177
typename _Vector::const_reverse_iterator const_reverse_iterator
Definition: connectorMap.h:52
void SetDebugNameCallback(F &&f)
Definition: node.h:313
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
const_iterator begin() const
Definition: node.h:77
const_iterator end() const
Definition: node.h:78
bool IsA() const
Definition: node.h:147
Definition: node.h:52
bool HasInputConnections() const
Definition: node.h:183
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:36
_TokenInputMap::const_iterator const_iterator
Definition: node.h:73
const VdfOutput * GetOutput(const TfToken &name) const
Definition: node.h:227
const VdfInput * GetInput(const TfToken &inputName) const
Definition: node.h:164
#define VDF_API
Definition: api.h:25
const VdfInputSpecs & GetInputSpecs() const
Definition: node.h:157
Fast, compressed bit array which is capable of performing logical operations without first decompress...
const VdfOutput * GetOptionalOutput(const TfToken &name) const
Definition: node.h:249
bool HasOutputConnections() const
Definition: node.h:193
Definition: input.h:35
VdfNetwork & GetNetwork()
Definition: node.h:142
_TokenInputMap::const_reverse_iterator const_reverse_iterator
Definition: node.h:74
std::vector< VdfConnectionAndMask > VdfConnectionAndMaskVector
A vector of VdfConnectionAndMasks.
Definition: types.h:80
GLfloat f
Definition: glcorearb.h:1926
Definition: token.h:70
const_reverse_iterator rbegin() const
Definition: node.h:79
#define __ARCH_PRETTY_FUNCTION__
Definition: functionLite.h:29
const VdfNetwork & GetNetwork() const
Definition: node.h:138
const_iterator begin() const
Definition: node.h:95
VdfId GetId() const
Definition: node.h:116
GLuint id
Definition: glcorearb.h:655
GLuint const GLchar * name
Definition: glcorearb.h:786
static VdfIndex GetIndexFromId(const VdfId id)
Definition: node.h:123
size_t GetNumInputs() const
Definition: node.h:289
Hashable holder of a VdfInputSpec and VdfOutputSpec.
Class to hold on to an externally owned output and a mask.
Definition: maskedOutput.h:31
GT_API const UT_StringHolder version
const VdfOutputSpecs & GetOutputSpecs() const
Definition: node.h:219
const VdfOutput * GetOutput() const
Definition: node.h:260
const_iterator end() const
Definition: node.h:96
#define VDF_API_TYPE
Definition: api.h:26
static VdfVersion GetVersionFromId(const VdfId id)
Definition: node.h:132
typename _Vector::const_iterator const_iterator
Definition: connectorMap.h:51
GLuint index
Definition: glcorearb.h:786
_TokenOutputMap::const_reverse_iterator const_reverse_iterator
Definition: node.h:92
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
_TokenOutputMap::const_iterator const_iterator
Definition: node.h:91
const_reverse_iterator rend() const
Definition: node.h:98
This predicate determines whether a given input value is needed to fulfill the input dependencies req...
#define TF_FOR_ALL(iter, c)
Definition: iterator.h:373
static size_t _GetMemoryUsage(const ClassType &c, size_t dynamicSize)
Definition: node.h:587
void _SetId(const VdfVersion version, const VdfIndex index)
Definition: node.h:526
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values...
const_reverse_iterator rbegin() const
Definition: node.h:97
OutputMapIterator(const _TokenOutputMap &map)
Definition: node.h:94
const OutputMapIterator GetOutputsIterator() const
Definition: node.h:277
std::vector< VdfMaskedOutput > VdfMaskedOutputVector
std::function< std::string()> VdfNodeDebugNameCallback
Type of callback for building a node debug name.
Definition: types.h:71
InputMapIterator(const _TokenInputMap &map)
Definition: node.h:76
size_t GetNumOutputs() const
Definition: node.h:283
uint64_t VdfId
The unique identifier type for Vdf objects.
Definition: types.h:107
uint32_t VdfIndex
The index type for Vdf objects.
Definition: types.h:110