HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
readWriteIteratorRange.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_WRITE_ITERATOR_RANGE_H
8 #define PXR_EXEC_VDF_READ_WRITE_ITERATOR_RANGE_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
16 
18 
19 ////////////////////////////////////////////////////////////////////////////////
20 ///
21 /// \class VdfReadWriteIteratorRange
22 ///
23 /// This class allows for construction of iterable ranges of input/output
24 /// values. The underlying iterator used is VdfReadWriteIterator. The
25 /// VdfReadWriteIteratorRange::begin() and VdfReadIteatorRange::end() methods
26 /// return an instance of VdfReadWriteIterator<T> denoting the iterable range.
27 /// The class satisfies the STL API requirements that make it suitable for use
28 /// in range-based for loops.
29 ///
30 /// For example:
31 /// ```{.cpp}
32 /// VdfReadWriteIteratorRange<double> range(context);
33 /// for (const double x : range) {
34 /// ...
35 /// }
36 /// ```
37 ///
38 /// This class can also be used to copy ranges of input/output values into STL
39 /// containers. It can be used in range constructors, for example.
40 ///
41 /// ```{.cpp}
42 /// VdfReadWriteIteratorRange<double> range(context);
43 /// std::vector<double> values(range.begin(), range.end());
44 /// ```
45 ///
46 /// It can also be used in STL algorithms that modify the iterated values:
47 ///
48 /// ```{.cpp}
49 /// VdfReadWriteIteratorRange<double> range(context);
50 /// std::copy(values.begin(), values.end(), range.begin());
51 /// ```
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