VTK  9.3.20231210
vtkRangeIterableTraits.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 #ifndef vtkRangeIterableTraits_h
5 #define vtkRangeIterableTraits_h
6 
7 #include "vtkABINamespace.h"
8 
9 VTK_ABI_NAMESPACE_BEGIN
10 class vtkCollection;
12 class vtkDataObjectTree;
13 VTK_ABI_NAMESPACE_END
14 
15 namespace vtk
16 {
17 namespace detail
18 {
19 VTK_ABI_NAMESPACE_BEGIN
20 
21 template <typename CollectionType>
22 struct CollectionRange;
23 
24 struct CompositeDataSetRange;
25 struct DataObjectTreeRange;
26 
27 //------------------------------------------------------------------------------
28 // DeduceRangeType:
29 // These function signatures define a mapping from an Iterable (e.g. vtkObject)
30 // to a RangeType (e.g. the for-range iterable object).
31 // They are not implemented, as only the signatures are important. Classes used
32 // should only be forward declared in this header.
33 // Since classes are only forward declared, the argument type should be const&
34 // qualified, and the return type should be a reference.
35 
36 // vtkCollection subclasses --> CollectionRange
37 template <typename CollectionType,
40 
41 // vtkCompositeDataSet --> CompositeDataSetRange
43 
44 // vtkDataObjectTree --> DataObjectTreeRange
46 
47 // Traits class that defines a RangeType corresponding to the iterable range
48 // type most appropriate for Iterable.
49 template <typename Iterable>
51 {
52 private:
53  using RangeTypeInternal = decltype(vtk::detail::DeduceRangeType(std::declval<Iterable>()));
54 
55 public:
57 };
58 
59 VTK_ABI_NAMESPACE_END
60 }
61 }
62 
63 #endif // vtkRangeIterableTraits_h
64 
65 // VTK-HeaderTest-Exclude: vtkRangeIterableTraits.h
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
abstract superclass for composite (multi-block or AMR) datasets
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
@ value
Definition: vtkX3D.h:220
@ type
Definition: vtkX3D.h:516
CollectionRange< CollectionType > & DeduceRangeType(const CollectionType &)
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
typename std::decay< RangeTypeInternal >::type RangeType