7#ifndef PXR_EXEC_VDF_SUBRANGE_VIEW_H
8#define PXR_EXEC_VDF_SUBRANGE_VIEW_H
14#include "pxr/exec/vdf/boxedContainer.h"
20#include "pxr/exec/vdf/vectorSubrangeAccessor.h"
24PXR_NAMESPACE_OPEN_SCOPE
104 _view->_inputName == rhs._view->_inputName &&
105 _connectionIndex == rhs._connectionIndex &&
106 _rangeIndex == rhs._rangeIndex;
112 return !operator==(rhs);
118 const_iterator &operator++();
143 void _AdvanceSubrange(
unsigned int rangeIndex);
146 bool _SubrangeFromConnectionIndex(
151 bool _SubrangeFromRangeIndex(
161 void _AdvanceToEnd();
167 int _connectionIndex;
170 unsigned int _rangeIndex;
180 const_iterator begin()
const {
181 return const_iterator(*
this, 0);
187 const_iterator end()
const {
188 return const_iterator(*
this, -1);
207 int connectionIndex) :
209 _connectionIndex(connectionIndex),
211 _subrange(_SubrangeAtEnd())
214 if (connectionIndex >= 0) {
224 _AdvanceSubrange(_rangeIndex + 1);
231 unsigned int rangeIndex)
234 const TfToken &inputName = _view->_inputName;
235 const VdfInput *input = _view->_GetNode(context).GetInput(inputName);
238 _rangeIndex = rangeIndex;
241 if (input && _connectionIndex >= 0) {
247 for (; _connectionIndex < numConnections; ++_connectionIndex) {
255 if (mask.
IsAllZeros() || !_view->_IsRequiredInput(context, c)) {
261 const VdfVector *v = _view->_GetInputValue(context, c, mask);
263 if (_SubrangeFromConnectionIndex(context, inputName)) {
272 if (!accessor.IsBoxed()) {
273 if (_SubrangeFromConnectionIndex(context, inputName)) {
282 if (_SubrangeFromRangeIndex(context, inputName, accessor)) {
302 _SubrangeFromConnectionIndex(
306 using Iterator =
typename Subrange::iterator;
311 if (_rangeIndex > 0) {
317 _subrange = Subrange(
318 Iterator(context, inputName, _connectionIndex, 0),
319 Iterator(context, inputName, _connectionIndex + 1, 0));
327 _SubrangeFromRangeIndex(
332 using Iterator =
typename Subrange::iterator;
351 _subrange = Subrange(
352 Iterator(context, inputName, _connectionIndex, boxedRange.begin),
353 Iterator(context, inputName, _connectionIndex, boxedRange.end));
362 using Iterator =
typename Subrange::iterator;
365 Iterator(*_view->_context, _view->_inputName, -1, 0),
366 Iterator(*_view->_context, _view->_inputName, -1, 0));
373 _connectionIndex = -1;
375 _subrange = _SubrangeAtEnd();
378PXR_NAMESPACE_CLOSE_SCOPE
Token for efficient comparison, assignment, and hashing of known strings.
Each range represents a logical group of elements stored in a Vdf_BoxedContainer.
Range GetRange(unsigned int i) const
Returns the range at index i.
unsigned int GetNumRanges() const
Returns the number of individual ranges stored in this container.
A range of data elements as denoted by [ begin, end ) indices.
Specialized vector accessor for read access to boxed containers.
A class that fully represents a connection between two VdfNodes.
const VdfMask & GetMask() const
Returns the mask for this connection.
A context is the parameter bundle passed to callbacks of computations.
Base class for libVdf iterators.
A VdfMask is placed on connections to specify the data flowing through them.
bool IsAllZeros() const
Returns true if this mask has all entries unset.
This class allows for construction of iterable ranges of input values.
std::forward_iterator_tag iterator_category
The STL category of this iterator type.
bool operator!=(const const_iterator &rhs) const
Returns true if this iterator and rhs do not compare equal.
bool operator==(const const_iterator &rhs) const
Returns true if this iterator and rhs compare equal.
reference operator*() const
Returns a reference to the current subrange of input values.
pointer operator->() const
Returns a pointer to the current subrange of input values.
This class enables iteration over subranges of input values, where each subrange contains values orig...
This class is used to abstract away knowledge of the cache data used for each node.
Vdf_VectorSubrangeAccessor< TYPE > GetSubrangeAccessor() const
Provide read-only access to the boxed subranges held by this vector.