7#ifndef PXR_EXEC_VDF_READ_WRITE_ACCESSOR_H
8#define PXR_EXEC_VDF_READ_WRITE_ACCESSOR_H
19PXR_NAMESPACE_OPEN_SCOPE
47template <
typename T >
113template <
typename T >
129 const VdfMask *requestMask =
nullptr;
130 const VdfMask *affectsMask =
nullptr;
138 if (!
TF_VERIFY(v,
"Output '%s' is missing buffer.",
150 if (affectsMask && !affectsMask->
IsAllOnes()) {
154 _mask = *affectsMask;
167template <
typename T >
177 if (ARCH_LIKELY(_mask.IsEmpty())) {
178 return _accessor[index + _offset];
183 return _accessor[_mask.GetBits().FindNthSet(index)];
186PXR_NAMESPACE_CLOSE_SCOPE
Token for efficient comparison, assignment, and hashing of known strings.
char const * GetText() const
Return the text that this token represents.
A context is the parameter bundle passed to callbacks of computations.
Base class for libVdf iterators.
VDF_API const VdfOutput * _GetRequiredOutputForWriting(const VdfContext &context, const TfToken &name) const
Returns the output for writing based on the name provided.
VDF_API bool _GetOutputMasks(const VdfContext &context, const VdfOutput &output, const VdfMask **requestMask, const VdfMask **affectsMask) const
Retrieves the request and affects masks of the given output.
VDF_API VdfVector * _GetOutputValueForWriting(const VdfContext &context, const VdfOutput &output) const
Returns a vector for writing an output value into.
A VdfMask is placed on connections to specify the data flowing through them.
bool IsContiguous() const
Returns true if the set bits in the mask are contiguous.
bool IsAllOnes() const
Returns true if this mask has all entries set.
size_t GetFirstSet() const
Returns the first set bit in the mask.
size_t GetNumSet() const
Returns the number of set bits in the mask.
A VdfOutput represents an output on a node.
VDF_API const TfToken & GetName() const
Returns the name of this output.
VdfReadWriteAccessor allows for random access to output data.
size_t GetSize() const
Returns the size of the data stored at the output.
bool IsEmpty() const
Returns true if there is no data stored at the output.
VdfReadWriteAccessor(const VdfContext &context)
Constructs a read/write accessor for the only output on the current node.
VdfReadWriteAccessor(const VdfContext &context, const TfToken &name)
Constructs a read/write accessor for the given input or output.
const T & operator[](size_t index) const
Provides constant random access to the data stored at the output.
A read/write accessor for low-level access to the contents of the VdfVector.
size_t GetNumValues() const
Returns the size of the vector, i.e.
This class is used to abstract away knowledge of the cache data used for each node.
ReadWriteAccessor< TYPE > GetReadWriteAccessor() const
GetReadWriteAccessor() allows low level access to the content of the VdfVector via the Vdf_VectorData...
#define TF_DEV_AXIOM(cond)
The same as TF_AXIOM, but compiled only in dev builds.
#define TF_VERIFY(cond, format,...)
Checks a condition and reports an error if it evaluates false.