VTK
vtkDataArrayValueRange_Generic.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataArrayValueRange_Generic.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
20 #ifndef vtkDataArrayValueRange_Generic_h
21 #define vtkDataArrayValueRange_Generic_h
22 
23 #include "vtkDataArrayAccessor.h"
24 #include "vtkDataArrayMeta.h"
25 
26 #include <algorithm>
27 #include <cassert>
28 #include <iterator>
29 #include <tuple>
30 #include <type_traits>
31 
32 #ifndef __VTK_WRAP__
33 
35 
36 namespace vtk
37 {
38 
39 namespace detail
40 {
41 
42 // Forward decs for friends/args
43 template <typename ArrayType, ComponentIdType>
45 template <typename ArrayType, ComponentIdType>
47 template <typename ArrayType, ComponentIdType>
49 template <typename ArrayType, ComponentIdType>
51 template <typename ArrayType, ComponentIdType>
52 struct ValueRange;
53 
54 //------------------------------------------------------------------------------
55 // Helper that converts ValueId <--> { TupleId, ComponentId }
56 // This class stores both representations. Profiling and assembly inspection
57 // show that ValueId is much more efficient for comparing Ids, while Tuple/Comp
58 // ids are much faster for looking up elements (especially when considering
59 // SOA arrays). The overhead of maintaining both is low, and this class is
60 // transparent enough that the compiler will produce efficient ASM with
61 // simple optimizations enabled.
62 template <ComponentIdType TupleSize>
63 struct IdStorage
64 {
66 
68  IdStorage() noexcept
69  : ValueId(0)
70  , TupleId(0)
71  , ComponentId(0)
72  {
73  }
74 
76  IdStorage(ValueIdType valueId, NumCompsType numComps) noexcept
77  : ValueId(valueId)
78  , TupleId(static_cast<TupleIdType>(valueId) / static_cast<TupleIdType>(numComps.value))
79  , ComponentId(static_cast<ComponentIdType>(valueId % static_cast<ValueIdType>(numComps.value)))
80  , NumComps(numComps)
81  {
82  }
83 
85  IdStorage(TupleIdType tupleId, ComponentIdType comp, NumCompsType numComps) noexcept
86  : ValueId(tupleId* numComps.value + comp)
87  , TupleId(tupleId)
88  , ComponentId(comp)
89  , NumComps(numComps)
90  {
91  }
92 
95  ValueIdType valueId, TupleIdType tupleId, ComponentIdType comp, NumCompsType numComps) noexcept
96  : ValueId(valueId)
97  , TupleId(tupleId)
98  , ComponentId(comp)
99  , NumComps(numComps)
100  {
101  }
102 
103  template <typename ArrayType>
104  VTK_ITER_INLINE void DebugAsserts(ArrayType* array) const noexcept
105  {
106  (void)array;
107  VTK_ITER_ASSERT(array != nullptr, "Invalid array.");
108  VTK_ITER_ASSERT(this->ValueId == this->TupleId * this->GetTupleSize() + this->ComponentId,
109  "Inconsistent internal state in IdStorage.");
110  VTK_ITER_ASSERT(this->GetTupleSize() > 0, "Invalid number of components.");
112  this->ValueId >= 0 && this->ValueId <= array->GetNumberOfValues(), "Invalid value id.");
113  VTK_ITER_ASSERT(this->GetTupleId() >= 0 && this->GetTupleId() <= array->GetNumberOfTuples(),
114  "Invalid tuple id.");
115  VTK_ITER_ASSERT(this->GetComponentId() >= 0 &&
116  (this->GetComponentId() < this->GetTupleSize() ||
117  (this->GetComponentId() == this->GetTupleSize() &&
118  this->GetTupleId() == array->GetNumberOfTuples())),
119  "Invalid component id.");
120  VTK_ITER_ASSERT(this->GetValueId() >= 0 && this->GetValueId() <= array->GetNumberOfValues(),
121  "Invalid value id.");
122  }
123 
125  IdStorage& operator++() noexcept // prefix
126  {
127  ++this->ValueId;
128  ++this->ComponentId;
129  if (this->ComponentId == this->GetTupleSize())
130  {
131  this->ComponentId = 0;
132  ++this->TupleId;
133  }
134  return *this;
135  }
136 
138  IdStorage operator++(int) noexcept // postfix
139  {
140  auto v = this->ValueId++;
141  auto t = this->TupleId;
142  auto c = this->ComponentId++;
143  if (this->ComponentId == this->GetTupleSize())
144  {
145  this->ComponentId = 0;
146  ++this->TupleId;
147  }
148  return IdStorage{ v, t, c, this->NumComps };
149  }
150 
152  {
153  IdStorage res = id;
154  res.AddOffset(offset);
155  return res;
156  }
157 
159  IdStorage& operator--() noexcept // prefix
160  {
161  --this->ValueId;
162  --this->ComponentId;
163  if (this->ComponentId < 0)
164  {
165  this->ComponentId = this->GetTupleSize() - 1;
166  --this->TupleId;
167  }
168  return *this;
169  }
170 
172  IdStorage operator--(int) noexcept // postfix
173  {
174  auto v = this->ValueId--;
175  auto t = this->TupleId;
176  auto c = this->ComponentId--;
177  if (this->ComponentId < 0)
178  {
179  this->ComponentId = this->GetTupleSize() - 1;
180  --this->TupleId;
181  }
182  return IdStorage{ v, t, c, this->NumComps };
183  }
184 
186  ValueIdType Convert(TupleIdType tuple, ComponentIdType comp) const noexcept
187  {
188  return static_cast<ValueIdType>(tuple) * this->NumComps.value + comp;
189  }
190 
192  std::pair<TupleIdType, ComponentIdType> Convert(ValueIdType value) const noexcept
193  {
194  return std::make_pair(static_cast<TupleIdType>(value / this->NumComps.value),
195  static_cast<ComponentIdType>(value % this->NumComps.value));
196  }
197 
199  void AddOffset(ValueIdType offset) noexcept
200  {
201  this->ValueId += offset;
202  std::tie(this->TupleId, this->ComponentId) = this->Convert(this->ValueId);
203  }
204 
206  ComponentIdType GetTupleSize() const noexcept { return this->NumComps.value; }
207 
209  TupleIdType GetTupleId() const noexcept { return this->TupleId; }
210 
212  ComponentIdType GetComponentId() const noexcept { return this->ComponentId; }
213 
215  ValueIdType GetValueId() const noexcept { return this->ValueId; }
216 
217  friend VTK_ITER_INLINE void swap(IdStorage& lhs, IdStorage& rhs) noexcept
218  {
219  using std::swap;
220  swap(lhs.ValueId, rhs.ValueId);
221  swap(lhs.TupleId, rhs.TupleId);
222  swap(lhs.ComponentId, rhs.ComponentId);
223  }
224 
225 private:
226  vtk::ValueIdType ValueId;
227  vtk::TupleIdType TupleId;
228  vtk::ComponentIdType ComponentId;
229  NumCompsType NumComps;
230 };
231 
232 //------------------------------------------------------------------------------
233 // Value reference
234 template <typename ArrayType, ComponentIdType TupleSize>
235 struct ConstValueReference
236 {
237 private:
238  static_assert(IsValidTupleSize<TupleSize>::value, "Invalid tuple size.");
239  static_assert(IsVtkDataArray<ArrayType>::value, "Invalid array type.");
240 
241  using IdStorageType = IdStorage<TupleSize>;
242  using APIType = GetAPIType<ArrayType>;
243 
244 public:
247  : Array{ nullptr }
248  , Id{}
249  {
250  }
251 
253  ConstValueReference(ArrayType* array, IdStorageType id) noexcept
254  : Array{ array }
255  , Id{ id }
256  {
257  this->Id.DebugAsserts(array);
258  }
259 
262  : Array{ o.Array }
263  , Id{ o.Id }
264  {
265  }
266 
268  ConstValueReference(const ConstValueReference& o) noexcept = default;
269 
271  ConstValueReference(ConstValueReference&& o) noexcept = default;
272 
275  {
276  VTK_ITER_ASSERT(!this->Array, "Const reference already initialized.");
277  // Initialize the reference.
278  this->Array = o.Array;
279  this->Id = o.Id;
280  return *this;
281  }
282 
285  {
286  VTK_ITER_ASSERT(!this->Array, "Const reference already initialized.");
287  // Initialize the reference.
288  this->Array = std::move(o.Array);
289  this->Id = std::move(o.Id);
290  return *this;
291  }
292 
294  operator APIType() const noexcept
295  {
296  VTK_ITER_ASSUME(this->Id.GetTupleSize() > 0);
297  VTK_ITER_ASSUME(this->Array->GetNumberOfComponents() == this->Id.GetTupleSize());
299  return acc.Get(this->Id.GetTupleId(), this->Id.GetComponentId());
300  }
301 
302 protected:
303  mutable ArrayType* Array;
305 };
306 
307 //------------------------------------------------------------------------------
308 // Value reference
309 template <typename ArrayType, ComponentIdType TupleSize>
310 struct ValueReference
311 {
312 private:
313  static_assert(IsValidTupleSize<TupleSize>::value, "Invalid tuple size.");
314  static_assert(IsVtkDataArray<ArrayType>::value, "Invalid array type.");
315 
316  using APIType = GetAPIType<ArrayType>;
317  using IdStorageType = IdStorage<TupleSize>;
318 
319 public:
320  using value_type = APIType;
321 
323  ValueReference() noexcept
324  : Array{ nullptr }
325  , Id{}
326  {
327  }
328 
330  ValueReference(ArrayType* array, IdStorageType id) noexcept
331  : Array{ array }
332  , Id{ id }
333  {
334  this->Id.DebugAsserts(this->Array);
335  }
336 
338  ValueReference(const ValueReference& o) noexcept = default;
340  ValueReference(ValueReference&& o) noexcept = default;
341 
344  {
345  if (this->Array)
346  { // Already initialized. Assign the value, not the reference:
347  return *this = static_cast<APIType>(o);
348  }
349  else
350  { // Initialize the reference:
351  this->Array = o.Array;
352  this->Id = o.Id;
353  return *this;
354  }
355  }
356 
359  {
360  if (this->Array)
361  { // Already initialized. Assign the value, not the reference:
362  return *this = static_cast<APIType>(o);
363  }
364  else
365  { // Initialize the reference:
366  this->Array = std::move(o.Array);
367  this->Id = std::move(o.Id);
368  return *this;
369  }
370  }
371 
372  template <typename OArray, ComponentIdType OSize>
374  { // Always copy the value for different reference types:
375  const APIType tmp = o;
376  return *this = std::move(tmp);
377  }
378 
380  operator APIType() const noexcept
381  {
382  VTK_ITER_ASSUME(this->Id.GetTupleSize() > 0);
383  VTK_ITER_ASSUME(this->Array->GetNumberOfComponents() == this->Id.GetTupleSize());
385  return acc.Get(this->Id.GetTupleId(), this->Id.GetComponentId());
386  }
387 
389  ValueReference operator=(APIType val) noexcept
390  {
391  VTK_ITER_ASSUME(this->Id.GetTupleSize() > 0);
392  VTK_ITER_ASSUME(this->Array->GetNumberOfComponents() == this->Id.GetTupleSize());
394  acc.Set(this->Id.GetTupleId(), this->Id.GetComponentId(), val);
395  return *this;
396  }
397 
398  friend VTK_ITER_INLINE void swap(ValueReference lhs, ValueReference rhs) noexcept
399  { // Swap values, not references:
400  APIType tmp = std::move(static_cast<APIType>(lhs));
401  lhs = std::move(static_cast<APIType>(rhs));
402  rhs = std::move(tmp);
403  }
404 
405  template <typename OArray, ComponentIdType OSize>
407  { // Swap values, not references:
408  using OAPIType = typename ValueReference<OArray, OSize>::value_type;
409  static_assert(
410  std::is_same<APIType, OAPIType>::value, "Cannot swap components with different types.");
411 
412  APIType tmp = std::move(static_cast<APIType>(lhs));
413  lhs = std::move(static_cast<APIType>(rhs));
414  rhs = std::move(tmp);
415  }
416 
417  friend VTK_ITER_INLINE void swap(ValueReference lhs, APIType& rhs) noexcept
418  {
419  APIType tmp = std::move(static_cast<APIType>(lhs));
420  lhs = std::move(rhs);
421  rhs = std::move(tmp);
422  }
423 
424  friend VTK_ITER_INLINE void swap(APIType& lhs, ValueReference rhs) noexcept
425  {
426  APIType tmp = std::move(lhs);
427  lhs = std::move(static_cast<APIType>(rhs));
428  rhs = std::move(tmp);
429  }
430 
432  ValueReference operator++() noexcept // prefix
433  {
434  const APIType newVal = *this + 1;
435  *this = newVal;
436  return *this;
437  }
438 
440  APIType operator++(int) noexcept // postfix
441  {
442  const APIType retVal = *this;
443  *this = *this + 1;
444  return retVal;
445  }
446 
448  ValueReference operator--() noexcept // prefix
449  {
450  const APIType newVal = *this - 1;
451  *this = newVal;
452  return *this;
453  }
454 
456  APIType operator--(int) noexcept // postfix
457  {
458  const APIType retVal = *this;
459  *this = *this - 1;
460  return retVal;
461  }
462 
463 #define VTK_REF_OP_OVERLOADS(Op, ImplOp) \
464  friend VTK_ITER_INLINE ValueReference operator Op(ValueReference lhs, APIType val) noexcept \
465  { \
466  const APIType newVal = lhs ImplOp val; \
467  lhs = newVal; \
468  return lhs; \
469  } \
470  friend VTK_ITER_INLINE ValueReference operator Op(ValueReference lhs, ValueReference val) \
471  noexcept \
472  { \
473  const APIType newVal = lhs ImplOp val; \
474  lhs = newVal; \
475  return lhs; \
476  } \
477  friend VTK_ITER_INLINE APIType& operator Op(APIType& lhs, ValueReference val) noexcept \
478  { \
479  const APIType newVal = lhs ImplOp val; \
480  lhs = newVal; \
481  return lhs; \
482  }
483 
484  VTK_REF_OP_OVERLOADS(+=, +)
485  VTK_REF_OP_OVERLOADS(-=, -)
486  VTK_REF_OP_OVERLOADS(*=, *)
487  VTK_REF_OP_OVERLOADS(/=, /)
488 
489 #undef VTK_REF_OP_OVERLOADS
490 
491  friend struct ConstValueReference<ArrayType, TupleSize>;
492  friend struct ValueIterator<ArrayType, TupleSize>;
493 
494 protected:
495  void CopyReference(const ValueReference& o) noexcept
496  {
497  this->Array = o.Array;
498  this->Id = o.Id;
499  }
500 
501  mutable ArrayType* Array;
503 };
504 
505 //------------------------------------------------------------------------------
506 // Const value iterator
507 template <typename ArrayType, ComponentIdType TupleSize>
508 struct ConstValueIterator
509  : public std::iterator<std::random_access_iterator_tag, GetAPIType<ArrayType>, ValueIdType,
510  // expected types don't have members, no op->().
511  void, ConstValueReference<ArrayType, TupleSize> >
512 {
513 private:
514  static_assert(IsValidTupleSize<TupleSize>::value, "Invalid tuple size.");
515  static_assert(IsVtkDataArray<ArrayType>::value, "Invalid array type.");
516 
517  using APIType = GetAPIType<ArrayType>;
518  using IdStorageType = IdStorage<TupleSize>;
519  using Superclass = std::iterator<std::random_access_iterator_tag, APIType, ValueIdType, void,
521 
522 public:
523  using iterator_category = typename Superclass::iterator_category;
524  using value_type = typename Superclass::value_type;
525  using difference_type = typename Superclass::difference_type;
526  using pointer = typename Superclass::pointer;
528 
531  : Array(nullptr)
532  , Id()
533  {
534  }
535 
537  ConstValueIterator(ArrayType* array, IdStorageType id) noexcept
538  : Array(array)
539  , Id(id)
540  {
541  this->Id.DebugAsserts(this->Array);
542  }
543 
546  : Array{ o.GetArray() }
547  , Id{ o.GetId() }
548  {
549  }
550 
552  ConstValueIterator(const ConstValueIterator& o) noexcept = default;
554  ConstValueIterator& operator=(const ConstValueIterator& o) noexcept = default;
555 
557  ConstValueIterator& operator++() noexcept // prefix
558  {
559  ++this->Id;
560  this->Id.DebugAsserts(this->Array);
561  return *this;
562  }
563 
565  ConstValueIterator operator++(int) noexcept // postfix
566  {
567  auto ret = this->Id++;
568  this->Id.DebugAsserts(this->Array);
569  return ConstValueIterator{ this->Array, ret };
570  }
571 
573  ConstValueIterator& operator--() noexcept // prefix
574  {
575  --this->Id;
576  this->Id.DebugAsserts(this->Array);
577  return *this;
578  }
579 
581  ConstValueIterator operator--(int) noexcept // postfix
582  {
583  auto ret = this->Id--;
584  this->Id.DebugAsserts(this->Array);
585  return ConstValueIterator{ this->Array, ret };
586  }
587 
590  {
591  return reference{ this->Array, this->Id + i };
592  }
593 
595  reference operator*() const noexcept { return reference{ this->Array, this->Id }; }
596 
597  // Using GetValueType here makes iteration 50% faster by reducing comparisons
598  // and jumps (instead of comparing std::tie(tupleId, compId)).
599 #define VTK_TMP_MAKE_OPERATOR(OP) \
600  friend VTK_ITER_INLINE bool operator OP( \
601  const ConstValueIterator& lhs, const ConstValueIterator& rhs) noexcept \
602  { \
603  VTK_ITER_ASSERT(lhs.Array == rhs.Array, "Mismatched arrays in iterator comparison."); \
604  return lhs.Id.GetValueId() OP rhs.Id.GetValueId(); \
605  }
606 
613 
614 #undef VTK_TMP_MAKE_OPERATOR
615 
618  {
619  this->Id.AddOffset(offset);
620  this->Id.DebugAsserts(this->Array);
621  return *this;
622  }
623 
625  const ConstValueIterator& it, difference_type offset) noexcept
626  {
627  return ConstValueIterator{ it.Array, it.Id + offset };
628  }
629 
631  difference_type offset, const ConstValueIterator& it) noexcept
632  {
633  return ConstValueIterator{ it.Array, it.Id + offset };
634  }
635 
638  {
639  this->Id.AddOffset(-offset);
640  this->Id.DebugAsserts(this->Array);
641  return *this;
642  }
643 
645  const ConstValueIterator& it, difference_type offset) noexcept
646  {
647  return ConstValueIterator{ it.Array, it.Id + (-offset) };
648  }
649 
651  const ConstValueIterator& it1, const ConstValueIterator& it2) noexcept
652  {
653  VTK_ITER_ASSERT(it1.Array == it2.Array, "Cannot do math with iterators from different arrays.");
654  return it1.Id.GetValueId() - it2.Id.GetValueId();
655  }
656 
658  {
659  // Different arrays may use different iterator implementations.
660  VTK_ITER_ASSERT(lhs.Array == rhs.Array, "Cannot swap iterators from different arrays.");
661 
662  using std::swap;
663  swap(lhs.Id, rhs.Id);
664  }
665 
666 private:
667  mutable ArrayType* Array;
668  IdStorageType Id;
669 };
670 
671 //------------------------------------------------------------------------------
672 // Component iterator
673 template <typename ArrayType, ComponentIdType TupleSize>
674 struct ValueIterator
675  : public std::iterator<std::random_access_iterator_tag, vtk::GetAPIType<ArrayType>, ValueIdType,
676  ValueReference<ArrayType, TupleSize>, ValueReference<ArrayType, TupleSize> >
677 {
678 private:
679  static_assert(IsValidTupleSize<TupleSize>::value, "Invalid tuple size.");
680  static_assert(IsVtkDataArray<ArrayType>::value, "Invalid array type.");
681 
682  using APIType = GetAPIType<ArrayType>;
683  using IdStorageType = IdStorage<TupleSize>;
684  using Superclass = std::iterator<std::random_access_iterator_tag, GetAPIType<ArrayType>,
685  ValueIdType, ValueReference<ArrayType, TupleSize>, ValueReference<ArrayType, TupleSize> >;
686 
687 public:
688  using iterator_category = typename Superclass::iterator_category;
689  using value_type = typename Superclass::value_type;
690  using difference_type = typename Superclass::difference_type;
691  using pointer = typename Superclass::pointer;
693 
695  ValueIterator() noexcept = default;
696 
698  ValueIterator(ArrayType* array, IdStorageType id) noexcept : Ref{ array, id }
699  {
700  this->DebugIdAsserts();
701  }
702 
704  ValueIterator(const ValueIterator& o) noexcept = default;
705 
708  {
709  this->Ref.CopyReference(o.Ref);
710  this->DebugIdAsserts();
711  return *this;
712  }
713 
715  ValueIterator& operator++() noexcept // prefix
716  {
717  ++this->Ref.Id;
718  this->DebugIdAsserts();
719  return *this;
720  }
721 
723  ValueIterator operator++(int) noexcept // postfix
724  {
725  auto ret = this->Ref.Id++;
726  this->DebugIdAsserts();
727  return ValueIterator{ this->Ref.Array, ret };
728  }
729 
731  ValueIterator& operator--() noexcept // prefix
732  {
733  --this->Ref.Id;
734  this->DebugIdAsserts();
735  return *this;
736  }
737 
739  ValueIterator operator--(int) noexcept // postfix
740  {
741  auto ret = this->Ref.Id--;
742  this->DebugIdAsserts();
743  return ValueIterator{ this->Ref.Array, ret };
744  }
745 
748  {
749  return reference{ this->Ref.Array, this->Ref.Id + i };
750  }
751 
753  reference operator*() const noexcept { return this->Ref; }
754 
756  const pointer& operator->() const noexcept { return this->Ref; }
757 
758 #define VTK_TMP_MAKE_OPERATOR(OP) \
759  friend VTK_ITER_INLINE bool operator OP(const ValueIterator& lhs, const ValueIterator& rhs) \
760  noexcept \
761  { \
762  VTK_ITER_ASSERT( \
763  lhs.GetArray() == rhs.GetArray(), "Mismatched arrays in iterator comparison."); \
764  return lhs.GetId().GetValueId() OP rhs.GetId().GetValueId(); \
765  }
766 
773 
774 #undef VTK_TMP_MAKE_OPERATOR
775 
778  {
779  this->Ref.Id.AddOffset(offset);
780  this->DebugIdAsserts();
781  return *this;
782  }
783 
785  const ValueIterator& it, difference_type offset) noexcept
786  {
787  return ValueIterator{ it.GetArray(), it.GetId() + offset };
788  }
789 
791  difference_type offset, const ValueIterator& it) noexcept
792  {
793  return ValueIterator{ it.GetArray(), it.GetId() + offset };
794  }
795 
798  {
799  this->Ref.Id.AddOffset(-offset);
800  this->Ref.Id.DebugAsserts(this->Ref.Array);
801  return *this;
802  }
803 
805  const ValueIterator& it, difference_type offset) noexcept
806  {
807  return ValueIterator{ it.GetArray(), it.GetId() + (-offset) };
808  }
809 
811  const ValueIterator& it1, const ValueIterator& it2) noexcept
812  {
814  it1.Ref.Array == it2.Ref.Array, "Cannot do math with iterators from different arrays.");
815  return it1.GetId().GetValueId() - it2.GetId().GetValueId();
816  }
817 
818  friend VTK_ITER_INLINE void swap(ValueIterator& lhs, ValueIterator& rhs) noexcept
819  {
820  // Different arrays may use different iterator implementations.
822  lhs.GetArray() == rhs.GetArray(), "Cannot swap iterators from different arrays.");
823 
824  using std::swap;
825  swap(lhs.GetId(), rhs.GetId());
826  }
827 
828  friend struct ConstValueIterator<ArrayType, TupleSize>;
829 
830 protected:
832  void DebugIdAsserts() const { this->Ref.Id.DebugAsserts(this->Ref.Array); }
833 
834  // Needed for access from friend functions. We could just store the array
835  // and ID here instead of the ref, but meh.
836  ArrayType* GetArray() const noexcept { return this->Ref.Array; }
837  IdStorageType& GetId() noexcept { return this->Ref.Id; }
838  const IdStorageType& GetId() const noexcept { return this->Ref.Id; }
839 
840  ValueReference<ArrayType, TupleSize> Ref;
841 };
842 
843 //------------------------------------------------------------------------------
844 // ValueRange
845 template <typename ArrayTypeT, ComponentIdType TupleSize>
846 struct ValueRange
847 {
848 private:
849  static_assert(IsValidTupleSize<TupleSize>::value, "Invalid tuple size.");
850  static_assert(IsVtkDataArray<ArrayTypeT>::value, "Invalid array type.");
851 
852  using IdStorageType = IdStorage<TupleSize>;
853  using NumCompsType = GenericTupleSize<TupleSize>;
854 
855 public:
856  using ArrayType = ArrayTypeT;
858 
863 
864  // May be DynamicTupleSize, or the actual tuple size.
865  constexpr static ComponentIdType TupleSizeTag = TupleSize;
866 
867  // STL-compat
874 
876  ValueRange() noexcept = default;
877 
879  ValueRange(ArrayType* arr, ValueIdType beginValue, ValueIdType endValue) noexcept
880  : Array(arr)
881  , NumComps(arr)
882  , BeginValue(beginValue, this->NumComps)
883  , EndValue(endValue, this->NumComps)
884  {
885  assert(this->Array);
886  assert(beginValue >= 0 && beginValue <= endValue);
887  assert(endValue >= 0 && endValue <= this->Array->GetNumberOfValues());
888  }
889 
891  ValueRange GetSubRange(ValueIdType beginValue = 0, ValueIdType endValue = -1) const noexcept
892  {
893  const ValueIdType realBegin = this->BeginValue.GetValueId() + beginValue;
894  const ValueIdType realEnd =
895  endValue >= 0 ? this->BeginValue.GetValueId() + endValue : this->EndValue.GetValueId();
896 
897  return ValueRange{ this->Array, realBegin, realEnd };
898  }
899 
901  ArrayType* GetArray() const noexcept { return this->Array; }
903  ComponentIdType GetTupleSize() const noexcept { return this->NumComps.value; }
904 
906  ValueIdType GetBeginValueId() const noexcept { return this->BeginValue.GetValueId(); }
907 
909  ValueIdType GetEndValueId() const noexcept { return this->EndValue.GetValueId(); }
910 
912  size_type size() const noexcept
913  {
914  return this->EndValue.GetValueId() - this->BeginValue.GetValueId();
915  }
916 
918  iterator begin() noexcept { return this->NewIterator(this->BeginValue); }
920  iterator end() noexcept { return this->NewIterator(this->EndValue); }
921 
923  const_iterator begin() const noexcept { return this->NewConstIterator(this->BeginValue); }
925  const_iterator end() const noexcept { return this->NewConstIterator(this->EndValue); }
926 
928  const_iterator cbegin() const noexcept { return this->NewConstIterator(this->BeginValue); }
930  const_iterator cend() const noexcept { return this->NewConstIterator(this->EndValue); }
931 
934  {
935  return reference{ this->Array, this->BeginValue + i };
936  }
939  {
940  return const_reference{ this->Array, this->BeginValue + i };
941  }
942 
943 private:
945  iterator NewIterator(IdStorageType id) const noexcept { return iterator{ this->Array, id }; }
946 
948  const_iterator NewConstIterator(IdStorageType id) const noexcept
949  {
950  return const_iterator{ this->Array, id };
951  }
952 
953  mutable ArrayType* Array{ nullptr };
954  NumCompsType NumComps{};
955  IdStorageType BeginValue{};
956  IdStorageType EndValue{};
957 };
958 
959 // Unimplemented, only used inside decltype in SelectValueRange:
960 template <typename ArrayType, ComponentIdType TupleSize>
961 ValueRange<ArrayType, TupleSize> DeclareValueRangeSpecialization(vtkDataArray*);
962 
963 } // end namespace detail
964 } // end namespace vtk
965 
967 
968 #endif // __VTK_WRAP__
969 #endif // vtkDataArrayValueRange_Generic_h
970 
971 // VTK-HeaderTest-Exclude: vtkDataArrayValueRange_Generic.h
vtk::detail::ValueReference::operator=
VTK_ITER_INLINE ValueReference operator=(const ValueReference &o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:343
VTK_ITER_ASSUME
#define VTK_ITER_ASSUME
Definition: vtkDataArrayMeta.h:53
vtkDataArrayAccessor
Efficient templated access to vtkDataArray.
Definition: vtkDataArrayAccessor.h:107
vtk::detail::ConstValueIterator::operator=
VTK_ITER_INLINE ConstValueIterator & operator=(const ConstValueIterator &o) noexcept=default
vtk::detail::ValueRange::size
VTK_ITER_INLINE size_type size() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:912
vtk::detail::ConstValueReference::operator=
VTK_ITER_INLINE ConstValueReference operator=(ConstValueReference &&o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:284
vtk::detail::ValueReference::value_type
APIType value_type
Definition: vtkDataArrayValueRange_Generic.h:320
vtk::detail::ValueReference::swap
friend VTK_ITER_INLINE void swap(APIType &lhs, ValueReference rhs) noexcept
Definition: vtkDataArrayValueRange_Generic.h:424
vtk::detail::ValueRange::GetArray
VTK_ITER_INLINE ArrayType * GetArray() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:901
vtk::detail::ConstValueIterator::operator-
friend VTK_ITER_INLINE difference_type operator-(const ConstValueIterator &it1, const ConstValueIterator &it2) noexcept
Definition: vtkDataArrayValueRange_Generic.h:650
vtk::detail::IsVtkDataArray
Definition: vtkDataArrayMeta.h:82
VTK_TMP_MAKE_OPERATOR
#define VTK_TMP_MAKE_OPERATOR(OP)
Definition: vtkDataArrayValueRange_Generic.h:758
vtk::detail::IdStorage::GetTupleSize
VTK_ITER_INLINE ComponentIdType GetTupleSize() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:206
vtkX3D::value
Definition: vtkX3D.h:226
vtk::detail::ValueIterator::GetId
IdStorageType & GetId() noexcept
Definition: vtkDataArrayValueRange_Generic.h:837
vtk::detail::ConstValueIterator::ConstValueIterator
VTK_ITER_INLINE ConstValueIterator(ArrayType *array, IdStorageType id) noexcept
Definition: vtkDataArrayValueRange_Generic.h:537
vtk::detail::ValueIterator::DebugIdAsserts
VTK_ITER_INLINE void DebugIdAsserts() const
Definition: vtkDataArrayValueRange_Generic.h:832
vtk::detail::ValueIterator::difference_type
typename Superclass::difference_type difference_type
Definition: vtkDataArrayValueRange_Generic.h:690
vtk::detail::IdStorage::GetValueId
VTK_ITER_INLINE ValueIdType GetValueId() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:215
VTK_ITER_OPTIMIZE_START
#define VTK_ITER_OPTIMIZE_START
Definition: vtkDataArrayMeta.h:54
vtk::detail::ConstValueIterator::operator--
VTK_ITER_INLINE ConstValueIterator & operator--() noexcept
Definition: vtkDataArrayValueRange_Generic.h:573
vtk::detail::IdStorage::GetComponentId
VTK_ITER_INLINE ComponentIdType GetComponentId() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:212
vtk::detail::ValueReference::operator++
VTK_ITER_INLINE ValueReference operator++() noexcept
Definition: vtkDataArrayValueRange_Generic.h:432
vtk::detail::ConstValueIterator::operator+=
VTK_ITER_INLINE ConstValueIterator & operator+=(difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:617
vtk::detail::ValueReference::swap
friend VTK_ITER_INLINE void swap(ValueReference lhs, APIType &rhs) noexcept
Definition: vtkDataArrayValueRange_Generic.h:417
vtk::detail::ValueRange::ArrayType
ArrayTypeT ArrayType
Definition: vtkDataArrayValueRange_Generic.h:856
vtk::ValueIdType
vtkIdType ValueIdType
Definition: vtkDataArrayMeta.h:70
vtk::detail::ValueRange::value_type
ValueType value_type
Definition: vtkDataArrayValueRange_Generic.h:868
vtk::detail::ConstValueIterator::difference_type
typename Superclass::difference_type difference_type
Definition: vtkDataArrayValueRange_Generic.h:525
vtk::detail::ValueIterator::GetArray
ArrayType * GetArray() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:836
vtk::detail::ValueIterator::operator-
friend VTK_ITER_INLINE ValueIterator operator-(const ValueIterator &it, difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:804
vtk::detail::ConstValueIterator::ConstValueIterator
VTK_ITER_INLINE ConstValueIterator(const ValueIterator< ArrayType, TupleSize > &o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:545
vtk::detail::ValueIterator::swap
friend VTK_ITER_INLINE void swap(ValueIterator &lhs, ValueIterator &rhs) noexcept
Definition: vtkDataArrayValueRange_Generic.h:818
vtk::detail::ValueRange::GetSubRange
VTK_ITER_INLINE ValueRange GetSubRange(ValueIdType beginValue=0, ValueIdType endValue=-1) const noexcept
Definition: vtkDataArrayValueRange_Generic.h:891
vtk::detail::ConstValueIterator
Definition: vtkDataArrayValueRange_Generic.h:50
vtk::detail::IdStorage::operator++
VTK_ITER_INLINE IdStorage & operator++() noexcept
Definition: vtkDataArrayValueRange_Generic.h:125
detail
Definition: vtkGenericDataArrayLookupHelper.h:31
vtk::detail::ValueRange::operator[]
VTK_ITER_INLINE reference operator[](size_type i) noexcept
Definition: vtkDataArrayValueRange_Generic.h:933
vtk::detail::ValueRange::GetTupleSize
VTK_ITER_INLINE ComponentIdType GetTupleSize() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:903
vtk::detail::ConstValueIterator::operator++
VTK_ITER_INLINE ConstValueIterator & operator++() noexcept
Definition: vtkDataArrayValueRange_Generic.h:557
vtk::detail::IdStorage::NumCompsType
GenericTupleSize< TupleSize > NumCompsType
Definition: vtkDataArrayValueRange_Generic.h:65
vtk::detail::ValueIterator::Ref
ValueReference< ArrayType, TupleSize > Ref
Definition: vtkDataArrayValueRange_Generic.h:840
vtk::detail::ValueRange::cend
VTK_ITER_INLINE const_iterator cend() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:930
vtk::ComponentIdType
int ComponentIdType
Definition: vtkDataArrayMeta.h:68
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtk::detail::ConstValueIterator::operator-
friend VTK_ITER_INLINE ConstValueIterator operator-(const ConstValueIterator &it, difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:644
vtk::detail::ValueIterator::pointer
typename Superclass::pointer pointer
Definition: vtkDataArrayValueRange_Generic.h:691
vtk::detail::ValueIterator::GetId
const IdStorageType & GetId() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:838
vtk::detail::IdStorage::Convert
VTK_ITER_INLINE std::pair< TupleIdType, ComponentIdType > Convert(ValueIdType value) const noexcept
Definition: vtkDataArrayValueRange_Generic.h:192
vtk::detail::IdStorage::DebugAsserts
VTK_ITER_INLINE void DebugAsserts(ArrayType *array) const noexcept
Definition: vtkDataArrayValueRange_Generic.h:104
vtk::GetAPIType
typename detail::GetAPITypeImpl< ArrayType >::APIType GetAPIType
Definition: vtkDataArrayMeta.h:185
vtk::detail::ConstValueReference::ConstValueReference
VTK_ITER_INLINE ConstValueReference(const ValueReference< ArrayType, TupleSize > &o)
Definition: vtkDataArrayValueRange_Generic.h:261
vtkDataArrayAccessor.h
vtk::detail::ValueIterator::reference
typename Superclass::reference reference
Definition: vtkDataArrayValueRange_Generic.h:692
vtk::detail::ValueRange::IteratorType
ValueIterator< ArrayType, TupleSize > IteratorType
Definition: vtkDataArrayValueRange_Generic.h:859
vtk::detail::ValueIterator::operator->
const VTK_ITER_INLINE pointer & operator->() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:756
vtk::detail::ConstValueIterator::pointer
typename Superclass::pointer pointer
Definition: vtkDataArrayValueRange_Generic.h:526
vtk::detail::ValueIterator::iterator_category
typename Superclass::iterator_category iterator_category
Definition: vtkDataArrayValueRange_Generic.h:688
vtk::detail::ValueIterator::operator-
friend VTK_ITER_INLINE difference_type operator-(const ValueIterator &it1, const ValueIterator &it2) noexcept
Definition: vtkDataArrayValueRange_Generic.h:810
vtk::detail::ValueIterator::operator+
friend VTK_ITER_INLINE ValueIterator operator+(const ValueIterator &it, difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:784
vtk::detail::ValueRange
Definition: vtkDataArrayValueRange_Generic.h:52
vtk::detail::ConstValueIterator::swap
friend VTK_ITER_INLINE void swap(ConstValueIterator &lhs, ConstValueIterator &rhs) noexcept
Definition: vtkDataArrayValueRange_Generic.h:657
vtk::detail::ConstValueIterator::operator*
VTK_ITER_INLINE reference operator*() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:595
vtk::detail::ConstValueIterator::operator+
friend VTK_ITER_INLINE ConstValueIterator operator+(difference_type offset, const ConstValueIterator &it) noexcept
Definition: vtkDataArrayValueRange_Generic.h:630
vtk::detail::ConstValueReference::operator=
VTK_ITER_INLINE ConstValueReference operator=(const ConstValueReference &o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:274
vtk::detail::ValueRange::const_iterator
ConstIteratorType const_iterator
Definition: vtkDataArrayValueRange_Generic.h:871
vtk::detail::ValueRange::GetBeginValueId
VTK_ITER_INLINE ValueIdType GetBeginValueId() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:906
vtk::detail::IdStorage
Definition: vtkDataArrayValueRange_Generic.h:63
vtk::detail::ValueIterator::operator--
VTK_ITER_INLINE ValueIterator & operator--() noexcept
Definition: vtkDataArrayValueRange_Generic.h:731
vtk::detail::ValueRange::cbegin
VTK_ITER_INLINE const_iterator cbegin() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:928
vtk::detail::ConstValueReference::Id
IdStorageType Id
Definition: vtkDataArrayValueRange_Generic.h:304
vtk::detail::ValueReference::Id
IdStorageType Id
Definition: vtkDataArrayValueRange_Generic.h:502
vtkX3D::offset
Definition: vtkX3D.h:444
vtk::detail::IdStorage::operator--
VTK_ITER_INLINE IdStorage & operator--() noexcept
Definition: vtkDataArrayValueRange_Generic.h:159
vtk::detail::ValueReference::swap
friend VTK_ITER_INLINE void swap(ValueReference lhs, ValueReference< OArray, OSize > rhs) noexcept
Definition: vtkDataArrayValueRange_Generic.h:406
vtk::detail::ValueRange::size_type
ValueIdType size_type
Definition: vtkDataArrayValueRange_Generic.h:869
vtk::detail::ConstValueReference
Definition: vtkDataArrayValueRange_Generic.h:46
vtk::detail::ValueRange::GetEndValueId
VTK_ITER_INLINE ValueIdType GetEndValueId() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:909
vtk::detail::ValueIterator::operator-=
VTK_ITER_INLINE ValueIterator & operator-=(difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:797
vtk::detail::ConstValueIterator::operator++
VTK_ITER_INLINE ConstValueIterator operator++(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:565
vtk::detail::ValueRange::TupleSizeTag
constexpr static ComponentIdType TupleSizeTag
Definition: vtkDataArrayValueRange_Generic.h:865
vtk::detail::ValueIterator::operator+=
VTK_ITER_INLINE ValueIterator & operator+=(difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:777
vtk::detail::ValueRange::operator[]
VTK_ITER_INLINE const_reference operator[](size_type i) const noexcept
Definition: vtkDataArrayValueRange_Generic.h:938
vtk::detail::IdStorage::IdStorage
VTK_ITER_INLINE IdStorage() noexcept
Definition: vtkDataArrayValueRange_Generic.h:68
vtk::detail::IdStorage::operator++
VTK_ITER_INLINE IdStorage operator++(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:138
vtk::detail::ValueIterator
Definition: vtkDataArrayValueRange_Generic.h:48
vtk::detail::ValueRange::begin
VTK_ITER_INLINE const_iterator begin() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:923
vtk::detail::ValueIterator::operator++
VTK_ITER_INLINE ValueIterator operator++(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:723
vtk::detail::ValueRange::end
VTK_ITER_INLINE iterator end() noexcept
Definition: vtkDataArrayValueRange_Generic.h:920
vtk::detail::ValueReference::ValueReference
VTK_ITER_INLINE ValueReference(ArrayType *array, IdStorageType id) noexcept
Definition: vtkDataArrayValueRange_Generic.h:330
VTK_ITER_OPTIMIZE_END
#define VTK_ITER_OPTIMIZE_END
Definition: vtkDataArrayMeta.h:55
vtkX3D::reference
Definition: vtkX3D.h:470
vtk::detail::ValueIterator::operator++
VTK_ITER_INLINE ValueIterator & operator++() noexcept
Definition: vtkDataArrayValueRange_Generic.h:715
VTK_REF_OP_OVERLOADS
#define VTK_REF_OP_OVERLOADS(Op, ImplOp)
Definition: vtkDataArrayValueRange_Generic.h:463
vtk::detail::ValueIterator::operator+
friend VTK_ITER_INLINE ValueIterator operator+(difference_type offset, const ValueIterator &it) noexcept
Definition: vtkDataArrayValueRange_Generic.h:790
vtk::detail::ValueIterator::ValueIterator
VTK_ITER_INLINE ValueIterator() noexcept=default
vtk::detail::IdStorage::IdStorage
VTK_ITER_INLINE IdStorage(ValueIdType valueId, NumCompsType numComps) noexcept
Definition: vtkDataArrayValueRange_Generic.h:76
vtk::detail::IdStorage::Convert
VTK_ITER_INLINE ValueIdType Convert(TupleIdType tuple, ComponentIdType comp) const noexcept
Definition: vtkDataArrayValueRange_Generic.h:186
vtk::detail::ValueRange::end
VTK_ITER_INLINE const_iterator end() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:925
vtk::detail::ValueRange::ConstReferenceType
ConstValueReference< ArrayType, TupleSize > ConstReferenceType
Definition: vtkDataArrayValueRange_Generic.h:862
vtk::detail::ConstValueIterator::operator+
friend VTK_ITER_INLINE ConstValueIterator operator+(const ConstValueIterator &it, difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:624
vtk::detail::ValueIterator::value_type
typename Superclass::value_type value_type
Definition: vtkDataArrayValueRange_Generic.h:689
vtk::detail::IdStorage::operator--
VTK_ITER_INLINE IdStorage operator--(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:172
vtk::detail::ConstValueIterator::operator[]
VTK_ITER_INLINE reference operator[](difference_type i) const noexcept
Definition: vtkDataArrayValueRange_Generic.h:589
vtk::detail::IdStorage::AddOffset
VTK_ITER_INLINE void AddOffset(ValueIdType offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:199
vtk::detail::ValueRange::iterator
IteratorType iterator
Definition: vtkDataArrayValueRange_Generic.h:870
vtk::detail::ValueRange::ConstIteratorType
ConstValueIterator< ArrayType, TupleSize > ConstIteratorType
Definition: vtkDataArrayValueRange_Generic.h:860
vtk::detail::ValueReference::ValueReference
VTK_ITER_INLINE ValueReference() noexcept
Definition: vtkDataArrayValueRange_Generic.h:323
vtk::detail::ValueIterator::operator--
VTK_ITER_INLINE ValueIterator operator--(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:739
vtk::TupleIdType
vtkIdType TupleIdType
Definition: vtkDataArrayMeta.h:69
vtk::detail::ValueReference::operator--
VTK_ITER_INLINE APIType operator--(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:456
vtk::detail::ConstValueIterator::operator-=
VTK_ITER_INLINE ConstValueIterator & operator-=(difference_type offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:637
vtk::detail::ConstValueReference::Array
ArrayType * Array
Definition: vtkDataArrayValueRange_Generic.h:303
vtk::detail::ValueReference::operator++
VTK_ITER_INLINE APIType operator++(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:440
vtk
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
Definition: vtkAtomicTypeConcepts.h:21
vtk::detail::ConstValueIterator::value_type
typename Superclass::value_type value_type
Definition: vtkDataArrayValueRange_Generic.h:524
vtk::detail::ValueReference::operator=
VTK_ITER_INLINE ValueReference operator=(APIType val) noexcept
Definition: vtkDataArrayValueRange_Generic.h:389
vtk::detail::ConstValueIterator::iterator_category
typename Superclass::iterator_category iterator_category
Definition: vtkDataArrayValueRange_Generic.h:523
vtk::detail::IsValidTupleSize
Definition: vtkDataArrayMeta.h:92
vtk::detail::ConstValueIterator::operator--
VTK_ITER_INLINE ConstValueIterator operator--(int) noexcept
Definition: vtkDataArrayValueRange_Generic.h:581
VTK_ITER_ASSERT
#define VTK_ITER_ASSERT(x, msg)
Definition: vtkDataArrayMeta.h:43
vtk::detail::ValueReference::swap
friend VTK_ITER_INLINE void swap(ValueReference lhs, ValueReference rhs) noexcept
Definition: vtkDataArrayValueRange_Generic.h:398
vtk::detail::ValueRange::ValueType
GetAPIType< ArrayTypeT > ValueType
Definition: vtkDataArrayValueRange_Generic.h:857
vtk::detail::ValueReference::CopyReference
void CopyReference(const ValueReference &o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:495
vtk::detail::ValueRange::ReferenceType
ValueReference< ArrayType, TupleSize > ReferenceType
Definition: vtkDataArrayValueRange_Generic.h:861
vtk::detail::ValueRange::ValueRange
VTK_ITER_INLINE ValueRange() noexcept=default
vtk::detail::IdStorage::operator+
friend VTK_ITER_INLINE IdStorage operator+(const IdStorage &id, ValueIdType offset) noexcept
Definition: vtkDataArrayValueRange_Generic.h:151
vtk::detail::ValueReference::operator--
VTK_ITER_INLINE ValueReference operator--() noexcept
Definition: vtkDataArrayValueRange_Generic.h:448
vtk::detail::ValueIterator::operator=
VTK_ITER_INLINE ValueIterator & operator=(const ValueIterator &o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:707
vtkDataArrayMeta.h
vtk::detail::ConstValueIterator::reference
typename Superclass::reference reference
Definition: vtkDataArrayValueRange_Generic.h:527
VTK_ITER_INLINE
#define VTK_ITER_INLINE
Definition: vtkDataArrayMeta.h:52
vtk::detail::IdStorage::IdStorage
VTK_ITER_INLINE IdStorage(ValueIdType valueId, TupleIdType tupleId, ComponentIdType comp, NumCompsType numComps) noexcept
Definition: vtkDataArrayValueRange_Generic.h:94
vtk::detail::IdStorage::swap
friend VTK_ITER_INLINE void swap(IdStorage &lhs, IdStorage &rhs) noexcept
Definition: vtkDataArrayValueRange_Generic.h:217
vtk::detail::GenericTupleSize
Definition: vtkDataArrayMeta.h:137
vtk::detail::ValueRange::begin
VTK_ITER_INLINE iterator begin() noexcept
Definition: vtkDataArrayValueRange_Generic.h:918
vtk::detail::ValueIterator::operator*
VTK_ITER_INLINE reference operator*() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:753
vtk::detail::ConstValueReference::ConstValueReference
VTK_ITER_INLINE ConstValueReference() noexcept
Definition: vtkDataArrayValueRange_Generic.h:246
vtk::detail::ConstValueIterator::ConstValueIterator
VTK_ITER_INLINE ConstValueIterator() noexcept
Definition: vtkDataArrayValueRange_Generic.h:530
vtk::detail::ConstValueReference::ConstValueReference
VTK_ITER_INLINE ConstValueReference(ArrayType *array, IdStorageType id) noexcept
Definition: vtkDataArrayValueRange_Generic.h:253
vtk::detail::ValueReference::operator=
VTK_ITER_INLINE ValueReference operator=(ValueReference &&o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:358
vtk::detail::ValueIterator::operator[]
VTK_ITER_INLINE reference operator[](difference_type i) const noexcept
Definition: vtkDataArrayValueRange_Generic.h:747
vtk::detail::ValueReference::Array
ArrayType * Array
Definition: vtkDataArrayValueRange_Generic.h:501
vtk::detail::DeclareValueRangeSpecialization
ValueRange< AOSArrayType, TupleSize > DeclareValueRangeSpecialization(ArrayType *)
vtk::detail::IdStorage::GetTupleId
VTK_ITER_INLINE TupleIdType GetTupleId() const noexcept
Definition: vtkDataArrayValueRange_Generic.h:209
vtk::detail::ValueReference
Definition: vtkDataArrayValueRange_Generic.h:44
vtk::detail::ValueReference::operator=
VTK_ITER_INLINE ValueReference operator=(const ValueReference< OArray, OSize > &o) noexcept
Definition: vtkDataArrayValueRange_Generic.h:373
vtk::detail::IdStorage::IdStorage
VTK_ITER_INLINE IdStorage(TupleIdType tupleId, ComponentIdType comp, NumCompsType numComps) noexcept
Definition: vtkDataArrayValueRange_Generic.h:85