HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
connection.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_CONNECTION_H
8 #define PXR_EXEC_VDF_CONNECTION_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/api.h"
15 #include "pxr/exec/vdf/input.h"
16 #include "pxr/exec/vdf/mask.h"
18 #include "pxr/exec/vdf/node.h"
19 #include "pxr/exec/vdf/output.h"
20 
21 #include <vector>
22 
24 
25 ////////////////////////////////////////////////////////////////////////////////
26 ///
27 /// A class that fully represents a connection between two VdfNodes.
28 ///
30 {
31 public:
32 
33  VdfConnection(VdfOutput &output, const VdfMask &mask, VdfInput &input) :
34  _output(&output),
35  _mask(mask),
36  _input(&input) {}
37 
38  /// Returns the source (ie. output) node for this connection.
39  const VdfNode &GetSourceNode() const {
40  TF_DEV_AXIOM(_output);
41  return _output->GetNode();
42  }
43 
44  /// Returns the source (ie. output) node for this connection.
46  TF_DEV_AXIOM(_output);
47  return _output->GetNode();
48  }
49 
50  /// Returns the target (ie. input) node for this connection.
51  const VdfNode &GetTargetNode() const {
52  TF_DEV_AXIOM(_input);
53  return _input->GetNode();
54  }
55 
56  /// Returns the target (ie. input) node for this connection.
58  TF_DEV_AXIOM(_input);
59  return _input->GetNode();
60  }
61 
62  /// Returns the output (ie. source) for this connection.
63  const VdfOutput &GetSourceOutput() const {
64  TF_DEV_AXIOM(_output);
65  return *_output;
66  }
67 
68  /// Returns the output (ie. source) for this connection.
70  TF_DEV_AXIOM(_output);
71  return *_output;
72  }
73 
74  /// Returns the output (ie. source) for this connection.
75  //XXX: Remove this method and provide a VdfMaskedConstOutput
77  TF_DEV_AXIOM(_output);
78  return *_output;
79  }
80 
81  /// Return the masked output (ie. source) for this connection.
84  }
85 
86  /// Returns the input connector (ie. target) for this connection.
87  const VdfInput &GetTargetInput() const {
88  TF_DEV_AXIOM(_input);
89  return *_input;
90  }
91 
92  /// Returns the input connector (ie. target) for this connection.
94  TF_DEV_AXIOM(_input);
95  return *_input;
96  }
97 
98  /// Returns the mask for this connection.
99  const VdfMask &GetMask() const { return _mask; }
100 
101  /// Returns a debug string for this connection.
102  VDF_API
103  std::string GetDebugName() const;
104 
105 private:
106 
107  // The output to which we are connected.
108  VdfOutput *_output;
109 
110  // The mask for this connection.
111  VdfMask _mask;
112 
113  // The target input-connector on the target node.
114  VdfInput *_input;
115 };
116 
117 ////////////////////////////////////////////////////////////////////////////////
118 
120 
121 #endif
VdfOutput & GetNonConstSourceOutput() const
Returns the output (ie. source) for this connection.
Definition: connection.h:76
VdfNode & GetTargetNode()
Returns the target (ie. input) node for this connection.
Definition: connection.h:57
const VdfNode & GetSourceNode() const
Returns the source (ie. output) node for this connection.
Definition: connection.h:39
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
Definition: node.h:52
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:36
const VdfNode & GetNode() const
Definition: output.h:57
#define VDF_API
Definition: api.h:25
VDF_API std::string GetDebugName() const
Returns a debug string for this connection.
Definition: input.h:35
const VdfNode & GetTargetNode() const
Returns the target (ie. input) node for this connection.
Definition: connection.h:51
#define TF_DEV_AXIOM(cond)
VdfOutput & GetSourceOutput()
Returns the output (ie. source) for this connection.
Definition: connection.h:69
VdfInput & GetTargetInput()
Returns the input connector (ie. target) for this connection.
Definition: connection.h:93
const VdfInput & GetTargetInput() const
Returns the input connector (ie. target) for this connection.
Definition: connection.h:87
GLint GLuint mask
Definition: glcorearb.h:124
VdfConnection(VdfOutput &output, const VdfMask &mask, VdfInput &input)
Definition: connection.h:33
Class to hold on to an externally owned output and a mask.
Definition: maskedOutput.h:31
const VdfOutput & GetSourceOutput() const
Returns the output (ie. source) for this connection.
Definition: connection.h:63
VdfNode & GetSourceNode()
Returns the source (ie. output) node for this connection.
Definition: connection.h:45
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
const VdfMask & GetMask() const
Returns the mask for this connection.
Definition: connection.h:99
const VdfNode & GetNode() const
Definition: input.h:86
VdfMaskedOutput GetSourceMaskedOutput() const
Return the masked output (ie. source) for this connection.
Definition: connection.h:82