HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
extensibleNode.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_EXTENSIBLE_NODE_H
8 #define PXR_EXEC_VDF_EXTENSIBLE_NODE_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/api.h"
16 #include "pxr/exec/vdf/node.h"
18 
19 #include <vector>
20 
22 
23 class VdfInput;
24 class VdfOutput;
25 class VdfNetwork;
26 
27 /// \class VdfExtensibleNode
28 ///
29 /// Base class for nodes that support dynamic creation of input and
30 /// output connectors.
31 ///
33 {
34 public:
35 
36  VDF_API
38  VdfNetwork *network,
39  const VdfInputSpecs &inputSpecs,
40  const VdfOutputSpecs &outputSpecs);
41 
42  /// Appends the supplied specs to this node, and creates and stores
43  /// additional outputs from them. A vector of VdfOutput* of the same
44  /// size as \p specs is the result.
45  VDF_API
46  void AddOutputSpecs(
47  const VdfOutputSpecs &specs,
48  std::vector<VdfOutput*> *resultOutputs);
49 
50  /// Appends the supplied specs to this node, and creates and stores
51  /// additional inputs from them. A vector of VdfInput* of the same
52  /// size as \p specs is the result.
53  VDF_API
54  void AddInputSpecs(
55  const VdfInputSpecs &specs,
56  std::vector<VdfInput*> *resultInputs);
57 
58 protected:
59 
60  /// Gets an input/output specs pointer that the node can use. In the
61  /// case of VdfExtensibleNodes, we manage the storage for the input/output
62  /// specs as a member of node itself.
63  ///
64  VDF_API
66  const VdfInputSpecs &inputSpecs,
67  const VdfOutputSpecs &outputSpecs);
68 
69  /// Releases an input/output specs pointer that was acquired with a
70  /// previous call to _AcquireInputAndOutputSpecsPointer(). This is a
71  /// no-op for VdfExtensibleNode.
72  ///
73  VDF_API
75  const VdfInputAndOutputSpecs *specs);
76 
77  VDF_API
78  virtual ~VdfExtensibleNode();
79 
80 private:
81 
82  // Our own local input and output specs so that we can append to them
83  // very quickly.
84  VdfInputAndOutputSpecs _inputAndOutputSpecs;
85 
86 };
87 
89 
90 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
Definition: node.h:52
#define VDF_API
Definition: api.h:25
Definition: input.h:35
Hashable holder of a VdfInputSpec and VdfOutputSpec.
#define VDF_API_TYPE
Definition: api.h:26
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
virtual VDF_API const VdfInputAndOutputSpecs * _AcquireInputAndOutputSpecsPointer(const VdfInputSpecs &inputSpecs, const VdfOutputSpecs &outputSpecs)
virtual VDF_API void _ReleaseInputAndOutputSpecsPointer(const VdfInputAndOutputSpecs *specs)