|
HDK
|
#include <readWriteAccessor.h>
Inheritance diagram for VdfReadWriteAccessor< T >:Public Member Functions | |
| VdfReadWriteAccessor (const VdfContext &context, const TfToken &name) | |
| VdfReadWriteAccessor (const VdfContext &context) | |
| const T & | operator[] (size_t index) const |
| T & | operator[] (size_t index) |
| bool | IsEmpty () const |
| size_t | GetSize () const |
Additional Inherited Members | |
Protected Member Functions inherited from VdfIterator | |
| ~VdfIterator ()=default | |
| const VdfNode & | _GetNode (const VdfContext &context) const |
| const VdfExecutorInterface & | _GetExecutor (const VdfContext &context) const |
| VDF_API const VdfVector * | _GetInputValue (const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const |
| VDF_API const VdfVector & | _GetRequiredInputValue (const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const |
| VDF_API const VdfOutput * | _GetRequiredOutputForWriting (const VdfContext &context, const TfToken &name) const |
| VDF_API VdfVector * | _GetOutputValueForWriting (const VdfContext &context, const VdfOutput &output) const |
| VDF_API bool | _GetOutputMasks (const VdfContext &context, const VdfOutput &output, const VdfMask **requestMask, const VdfMask **affectsMask) const |
| VDF_API bool | _IsRequiredInput (const VdfContext &context, const VdfConnection &connection) const |
| VDF_API const VdfMask * | _GetRequestMask (const VdfContext &context, const VdfOutput &output) const |
| VDF_API void | _ForEachScheduledOutput (const VdfContext &context, const VdfNode &node, const VdfScheduledOutputCallback &callback) const |
VdfReadWriteAccessor allows for random access to output data. The index into the data is in iteration space, i.e. access to index N returns the value of the N-th element as visited by the VdfReadWriteIterator.
If the memory layout of the output values is not contiguous in the output buffer (e.g. a non-contiguous affects mask), the accessor will redirect access to the underlying data. This indirection can be costly. If the data is contiguous in memory, fast access will be provided through what is essentially access through pointer indirection / indexing of array elements.
Note that the memory layout of output buffers is an implementation detail of the system influenced by many factors. Subsequently, no assumptions can be made about whether access will take the fast- or the slow-path.
The only way to guarantee fast indirection is by accessing data through iterators (e.g. VdfReadWriteIterator). The use of iterators instead of using VdfReadWriteAccessor is strongly encouraged.
Definition at line 48 of file readWriteAccessor.h.
| VdfReadWriteAccessor< T >::VdfReadWriteAccessor | ( | const VdfContext & | context, |
| const TfToken & | name | ||
| ) |
Constructs a read/write accessor for the given input or output. If no input with the specified name exists on the current node, or if the input does not have an associated output, attempt to find an output named name. Emits a coding error if name does not name an input or an output.
Definition at line 114 of file readWriteAccessor.h.
|
inline |
Constructs a read/write accessor for the only output on the current node. If the node has more than a single output, a coding error will be emitted.
Definition at line 64 of file readWriteAccessor.h.
|
inline |
Returns the size of the data stored at the output.
Definition at line 90 of file readWriteAccessor.h.
|
inline |
Returns true if there is no data stored at the output.
Definition at line 84 of file readWriteAccessor.h.
|
inline |
Provides constant random access to the data stored at the output. Note that index must be within [0, GetSize()). Out of bounds access will lead to undefined behavior.
Definition at line 72 of file readWriteAccessor.h.
| T & VdfReadWriteAccessor< T >::operator[] | ( | size_t | index | ) |
Provides mutable random access to the data stored at the output. Note that index must be within [0, GetSize()). Out of bounds access will lead to undefined behavior.
Definition at line 169 of file readWriteAccessor.h.