VTK  9.2.20230322
vtkTypeList.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTypeList.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 
17 // The Loki Library
18 // Copyright (c) 2001 by Andrei Alexandrescu
19 // This code accompanies the book:
20 // Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
21 // Patterns Applied". Copyright (c) 2001. Addison-Wesley.
22 // Permission to use, copy, modify, distribute and sell this software for any
23 // purpose is hereby granted without fee, provided that the above copyright
24 // notice appear in all copies and that both that copyright notice and this
25 // permission notice appear in supporting documentation.
26 // The author or Addison-Wesley Longman make no representations about the
27 // suitability of this software for any purpose. It is provided "as is"
28 // without express or implied warranty.
30 
53 #ifndef vtkTypeList_h
54 #define vtkTypeList_h
55 
56 #include "vtkABINamespace.h"
57 #include "vtkTypeListMacros.h"
58 
59 namespace vtkTypeList
60 {
61 VTK_ABI_NAMESPACE_BEGIN
62 
63 //------------------------------------------------------------------------------
67 struct NullType
68 {
69 };
70 
71 //------------------------------------------------------------------------------
73 
76 template <typename T, typename U>
77 struct TypeList
78 {
79  typedef T Head;
80  typedef U Tail;
81 };
83 
84 //------------------------------------------------------------------------------
88 template <bool Exp, typename T, typename F>
89 struct Select;
90 
91 //------------------------------------------------------------------------------
96 template <typename From, typename To>
97 struct CanConvert;
98 
99 //------------------------------------------------------------------------------
104 template <typename TList, typename T>
105 struct IndexOf;
106 
107 //------------------------------------------------------------------------------
112 template <typename TList, typename T>
113 struct Erase;
114 
115 //------------------------------------------------------------------------------
119 template <typename TList, typename T>
120 struct EraseAll;
121 
122 //------------------------------------------------------------------------------
127 template <typename TList>
128 struct Unique;
129 
130 //------------------------------------------------------------------------------
135 template <typename TList, typename Bad, typename Good>
136 struct Replace;
137 
138 //------------------------------------------------------------------------------
143 template <typename TList, typename Bad, typename Good>
144 struct ReplaceAll;
145 
146 //------------------------------------------------------------------------------
152 template <typename TList, typename T>
153 struct MostDerived;
154 
155 //------------------------------------------------------------------------------
161 template <typename TList>
163 
164 //------------------------------------------------------------------------------
168 template <typename TList, typename T>
169 struct Append;
170 
171 VTK_ABI_NAMESPACE_END
172 } // end namespace vtkTypeList
173 
174 #include "vtkTypeList.txx"
175 
176 namespace vtkTypeList
177 {
178 VTK_ABI_NAMESPACE_BEGIN
179 
180 template <typename... Ts>
181 using Create = typename vtkTypeList::detail::CreateImpl<Ts...>::type;
182 
183 VTK_ABI_NAMESPACE_END
184 } // end namespace vtkTypeList
185 
186 #endif // vtkTypeList_h
187 // VTK-HeaderTest-Exclude: vtkTypeList.h
typename vtkTypeList::detail::CreateImpl< Ts... >::type Create
Definition: vtkTypeList.h:181
@ type
Definition: vtkX3D.h:528
Appends type T to TypeList TList and stores the result in Result.
Definition: vtkTypeList.h:169
Sets member Result to true if a conversion exists to convert type From to type To.
Definition: vtkTypeList.h:97
Sort the TypeList from most-derived to least-derived type, storing the sorted TypeList in Result.
Definition: vtkTypeList.h:162
Erase all type T from TypeList TList, storing the new list in Result.
Definition: vtkTypeList.h:120
Erase the first element of type T from TypeList TList, storing the new list in Result.
Definition: vtkTypeList.h:113
Sets the enum value Result to the index of type T in the TypeList TList.
Definition: vtkTypeList.h:105
Given a type T and a TypeList TList, store the most derived type of T in TList as Result.
Definition: vtkTypeList.h:153
Used to terminate a TypeList.
Definition: vtkTypeList.h:68
Replace all instances of Bad with Good in the TypeList TList, storing the new list in Result.
Definition: vtkTypeList.h:144
Replace the first instance of Bad with Good in the TypeList TList, storing the new list in Result.
Definition: vtkTypeList.h:136
Sets Result to T if Exp is true, or F if Exp is false.
Definition: vtkTypeList.h:89
Generic implementation of TypeList.
Definition: vtkTypeList.h:78
Remove all duplicate types from TypeList TList, storing the new list in Result.
Definition: vtkTypeList.h:128