HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
readIteratorRange.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_READ_ITERATOR_RANGE_H
8 #define PXR_EXEC_VDF_READ_ITERATOR_RANGE_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
16 
18 
19 ////////////////////////////////////////////////////////////////////////////////
20 ///
21 /// \class VdfReadIteratorRange
22 ///
23 /// This class allows for construction of iterable ranges of input values. The
24 /// underlying iterator used is VdfReadIterator. The
25 /// VdfReadIteratorRange::begin() and VdfReadIteatorRange::end() methods return
26 /// an instance of VdfReadIterator<T> denoting the iterable range. The class
27 /// satisfies the STL API requirements that make it suitable for use in range-
28 /// based for loops.
29 ///
30 /// For example:
31 /// ```{.cpp}
32 /// VdfReadIteratorRange<double> range(context, _tokens->in);
33 /// for (const double x : range) {
34 /// ...
35 /// }
36 /// ```
37 ///
38 /// This class can also be used to copy ranges of input values into STL
39 /// containers. It can be used in range constructors, for example.
40 ///
41 /// ```{.cpp}
42 /// VdfReadIteratorRange<double> range(context, _tokens->in);
43 /// std::vector<double> values(range.begin(), range.end());
44 /// ```
45 ///
46 /// \warning Note that std::distance has linear complexity on this range.
47 ///
48 /// Determining the number of input values in a range is not trivial, and might
49 /// be costly. Invoking std::distance on VdfReadIterator is slightly more
50 /// expensive than calling VdfReadIteratorRange::ComputeSize() (i.e.
51 /// VdfReadIterator::ComputeSize().)
52 ///
53 template<typename T>
55 
57 
58 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74