7#ifndef PXR_EXEC_VDF_INPUT_VECTOR_H
8#define PXR_EXEC_VDF_INPUT_VECTOR_H
14#include "pxr/exec/vdf/api.h"
21PXR_NAMESPACE_OPEN_SCOPE
27class VDF_API_TYPE Vdf_InputVectorBase :
public VdfNode
33 size_t GetSize()
const {
34 return _values.GetSize();
56 ~Vdf_InputVectorBase() override;
65class VDF_API_TYPE VdfInputVector final : public Vdf_InputVectorBase
71 VdfInputVector(
VdfNetwork *network,
size_t n) :
75 .Connector<T>(VdfTokens->out),
82 void SetValue(
size_t index,
const T &val)
84 if (!
TF_VERIFY(index >= 0 && index < _values.GetSize()))
93 bool IsValueEqual(
size_t index,
const T &val)
const
95 if (
const T *v = GetValue(index))
104 const T *GetValue(
size_t index)
const
106 if (!
TF_VERIFY(index >= 0 && index < _values.GetSize()))
117 ~VdfInputVector()
override;
119 typedef VdfInputVector<T> This;
124 if (
const This *other =
dynamic_cast<const This *
>(&rhs))
125 return _ValuesAreEqual(other);
136 bool _ValuesAreEqual(
const This *rhs)
const
138 const size_t size = _values.GetSize();
139 if (size == rhs->_values.GetSize()) {
141 _values.GetReadAccessor<T>();
142 const VdfVector &rhsValues = rhs->_values;
144 rhsValues.GetReadAccessor<T>();
145 for (
size_t i = 0; i < size; ++i) {
182VdfInputVector<T>::~VdfInputVector() =
default;
184PXR_NAMESPACE_CLOSE_SCOPE
Low-level utilities for informing users of various internal and external diagnostic conditions.
TfType represents a dynamic runtime type.
A context is the parameter bundle passed to callbacks of computations.
A VdfNetwork is a collection of VdfNodes and their connections.
This is the base class for all nodes in a VdfNetwork.
virtual VDF_API bool _IsDerivedEqual(const VdfNode &rhs) const
Can be overridden by derived classes to facilitate equality comparision.
virtual VDF_API size_t GetMemoryUsage() const
Returns the amount of memory used by the node in bytes.
virtual void Compute(const VdfContext &context) const =0
This is the method called to perform computation.
VdfOutputSpecs is a container for VdfOutputSpec objects.
A VdfTypedVector implements a VdfVector with a specific type.
A read-only accessor for low-level acces to the contents of the VdfVector.
A read/write accessor for low-level access to the contents of the VdfVector.
This class is used to abstract away knowledge of the cache data used for each node.
#define TF_VERIFY(cond, format,...)
Checks a condition and reports an error if it evaluates false.