VTK-m  2.0
TypeCheckTagArrayIn.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_arg_TypeCheckTagArrayIn_h
11 #define vtk_m_cont_arg_TypeCheckTagArrayIn_h
12 
14 
15 #include <vtkm/List.h>
16 
17 #include <vtkm/cont/ArrayHandle.h>
18 
20 
21 namespace vtkm
22 {
23 namespace cont
24 {
25 namespace arg
26 {
27 
32 {
33 };
34 
35 namespace detail
36 {
37 
38 template <typename ArrayType,
39  bool IsArrayHandle = vtkm::cont::internal::ArrayHandleCheck<ArrayType>::type::value>
40 struct IsArrayHandleIn;
41 
42 template <typename ArrayType>
43 struct IsArrayHandleIn<ArrayType, true>
44 {
45  static constexpr bool value =
46  vtkm::internal::PortalSupportsGets<typename ArrayType::ReadPortalType>::value;
47 };
48 
49 template <typename ArrayType>
50 struct IsArrayHandleIn<ArrayType, false>
51 {
52  static constexpr bool value = false;
53 };
54 
55 } // namespace detail
56 
57 template <typename ArrayType>
58 struct TypeCheck<TypeCheckTagArrayIn, ArrayType>
59 {
60  static constexpr bool value = detail::IsArrayHandleIn<ArrayType>::value;
61 };
62 }
63 }
64 } // namespace vtkm::cont::arg
65 
66 #endif //vtk_m_cont_arg_TypeCheckTagArray_h
ArrayHandle.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
ArrayPortalHelpers.h
vtkm::cont::arg::TypeCheckTagArrayIn
The Array type check passes for any object that behaves like an ArrayHandle class and can be passed t...
Definition: TypeCheckTagArrayIn.h:31
vtkm::cont::arg::TypeCheck
Class for checking that a type matches the semantics for an argument.
Definition: TypeCheck.h:34
vtkm::cont::arg::TypeCheck::value
static constexpr bool value
The static constant boolean value is set to true if the type is valid for the given check tag and fal...
Definition: TypeCheck.h:39
TypeCheck.h
List.h