VTK
vtkRangeIterableTraits.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRangeIterableTraits.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 =========================================================================*/
15 
16 #ifndef vtkRangeIterableTraits_h
17 #define vtkRangeIterableTraits_h
18 
19 class vtkCollection;
21 class vtkDataObjectTree;
22 
23 namespace vtk
24 {
25 namespace detail
26 {
27 
28 template <typename CollectionType>
29 struct CollectionRange;
30 
31 struct CompositeDataSetRange;
32 struct DataObjectTreeRange;
33 
34 //------------------------------------------------------------------------------
35 // DeduceRangeType:
36 // These function signatures define a mapping from an Iterable (e.g. vtkObject)
37 // to a RangeType (e.g. the for-range iterable object).
38 // They are not implemented, as only the signatures are important. Classes used
39 // should only be forward declared in this header.
40 // Since classes are only forward declared, the argument type should be const&
41 // qualified, and the return type should be a reference.
42 
43 // vtkCollection subclasses --> CollectionRange
44 template <typename CollectionType,
46 CollectionRange<CollectionType>& DeduceRangeType(const CollectionType&);
47 
48 // vtkCompositeDataSet --> CompositeDataSetRange
49 CompositeDataSetRange& DeduceRangeType(const vtkCompositeDataSet&);
50 
51 // vtkDataObjectTree --> DataObjectTreeRange
52 DataObjectTreeRange& DeduceRangeType(const vtkDataObjectTree&);
53 
54 // Traits class that defines a RangeType corresponding to the iterable range
55 // type most appropriate for Iterable.
56 template <typename Iterable>
58 {
59 private:
60  using RangeTypeInternal = decltype(vtk::detail::DeduceRangeType(std::declval<Iterable>()));
61 
62 public:
64 };
65 
66 }
67 }
68 
69 #endif // vtkRangeIterableTraits_h
70 
71 // VTK-HeaderTest-Exclude: vtkRangeIterableTraits.h
vtkDataObjectTree
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
Definition: vtkDataObjectTree.h:46
vtkX3D::value
Definition: vtkX3D.h:226
vtkX3D::type
Definition: vtkX3D.h:522
vtk::detail::IterableTraits::RangeType
typename std::decay< RangeTypeInternal >::type RangeType
Definition: vtkRangeIterableTraits.h:63
detail
Definition: vtkGenericDataArrayLookupHelper.h:31
vtk::detail::IterableTraits
Definition: vtkRangeIterableTraits.h:57
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:45
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtk
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
Definition: vtkAtomicTypeConcepts.h:21
vtk::detail::DeduceRangeType
CollectionRange< CollectionType > & DeduceRangeType(const CollectionType &)