Loading...
Searching...
No Matches
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
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
23PXR_NAMESPACE_OPEN_SCOPE
24
30{
31public:
32
33 VdfConnection(VdfOutput &output, const VdfMask &mask, VdfInput &input) :
34 _output(&output),
35 _mask(mask),
36 _input(&input) {}
37
39 const VdfNode &GetSourceNode() const {
40 TF_DEV_AXIOM(_output);
41 return _output->GetNode();
42 }
43
46 TF_DEV_AXIOM(_output);
47 return _output->GetNode();
48 }
49
51 const VdfNode &GetTargetNode() const {
52 TF_DEV_AXIOM(_input);
53 return _input->GetNode();
54 }
55
58 TF_DEV_AXIOM(_input);
59 return _input->GetNode();
60 }
61
63 const VdfOutput &GetSourceOutput() const {
64 TF_DEV_AXIOM(_output);
65 return *_output;
66 }
67
70 TF_DEV_AXIOM(_output);
71 return *_output;
72 }
73
75 //XXX: Remove this method and provide a VdfMaskedConstOutput
77 TF_DEV_AXIOM(_output);
78 return *_output;
79 }
80
84 }
85
87 const VdfInput &GetTargetInput() const {
88 TF_DEV_AXIOM(_input);
89 return *_input;
90 }
91
94 TF_DEV_AXIOM(_input);
95 return *_input;
96 }
97
99 const VdfMask &GetMask() const { return _mask; }
100
102 VDF_API
103 std::string GetDebugName() const;
104
105private:
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
118
119PXR_NAMESPACE_CLOSE_SCOPE
120
121#endif
A class that fully represents a connection between two VdfNodes.
Definition: connection.h:30
VdfMaskedOutput GetSourceMaskedOutput() const
Return the masked output (ie. source) for this connection.
Definition: connection.h:82
const VdfOutput & GetSourceOutput() const
Returns the output (ie. source) for this connection.
Definition: connection.h:63
const VdfNode & GetSourceNode() const
Returns the source (ie. output) node for this connection.
Definition: connection.h:39
VdfNode & GetTargetNode()
Returns the target (ie. input) node for this connection.
Definition: connection.h:57
VDF_API std::string GetDebugName() const
Returns a debug string for this connection.
const VdfInput & GetTargetInput() const
Returns the input connector (ie. target) for this connection.
Definition: connection.h:87
VdfOutput & GetSourceOutput()
Returns the output (ie. source) for this connection.
Definition: connection.h:69
const VdfNode & GetTargetNode() const
Returns the target (ie. input) node for this connection.
Definition: connection.h:51
const VdfMask & GetMask() const
Returns the mask for this connection.
Definition: connection.h:99
VdfNode & GetSourceNode()
Returns the source (ie. output) node for this connection.
Definition: connection.h:45
VdfOutput & GetNonConstSourceOutput() const
Returns the output (ie. source) for this connection.
Definition: connection.h:76
VdfInput & GetTargetInput()
Returns the input connector (ie. target) for this connection.
Definition: connection.h:93
A VdfInput is used to connect a VdfNode to one or more VdfNodes' outputs.
Definition: input.h:36
const VdfNode & GetNode() const
Returns the owning node for this input connector.
Definition: input.h:86
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:37
Class to hold on to an externally owned output and a mask.
Definition: maskedOutput.h:32
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
const VdfNode & GetNode() const
Returns the owning node for this output.
Definition: output.h:57
#define TF_DEV_AXIOM(cond)
The same as TF_AXIOM, but compiled only in dev builds.
Definition: diagnostic.h:205