Loading...
Searching...
No Matches
rootNode.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_ROOT_NODE_H
8#define PXR_EXEC_VDF_ROOT_NODE_H
9
11
12#include "pxr/pxr.h"
13
14#include "pxr/exec/vdf/api.h"
15#include "pxr/exec/vdf/node.h"
16
17PXR_NAMESPACE_OPEN_SCOPE
18
29class VDF_API_TYPE VdfRootNode : public VdfNode
30{
31public:
32
36 static bool IsARootNode(const VdfNode &node) {
37 return node.GetNumInputs() == 0 && node.IsA<VdfRootNode>();
38 }
39
40protected:
41
45 VdfNetwork *network,
46 const VdfOutputSpecs &outputSpecs)
47 : VdfNode(network, VdfInputSpecs(), outputSpecs) {}
48
49 VDF_API
50 ~VdfRootNode() override;
51
52private:
53
54 // VdfRootNodes can't be computed. Therefore this class overrides
55 // the Compute() method finally which only produces an error message.
56 VDF_API
57 void Compute(const VdfContext &context) const override final;
58};
59
60PXR_NAMESPACE_CLOSE_SCOPE
61
62#endif
A context is the parameter bundle passed to callbacks of computations.
Definition: context.h:40
VdfInputSpecs is a container for VdfInputSpec objects.
A VdfNetwork is a collection of VdfNodes and their connections.
Definition: network.h:60
This is the base class for all nodes in a VdfNetwork.
Definition: node.h:53
bool IsA() const
Returns true, if this node is of type TYPE.
Definition: node.h:147
size_t GetNumInputs() const
Returns the number of inputs that this node currently has.
Definition: node.h:289
virtual void Compute(const VdfContext &context) const =0
This is the method called to perform computation.
VdfOutputSpecs is a container for VdfOutputSpec objects.
Base class for root nodes.
Definition: rootNode.h:30
static bool IsARootNode(const VdfNode &node)
Returns true if the given node is a VdfRootNode.
Definition: rootNode.h:36
VdfRootNode(VdfNetwork *network, const VdfOutputSpecs &outputSpecs)
Note that VdfRootNodes don't have inputs.
Definition: rootNode.h:44