VTK-m  2.0
TypeCheckTagArrayInOut.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_TypeCheckTagArrayInOut_h
11 #define vtk_m_cont_arg_TypeCheckTagArrayInOut_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 IsArrayHandleInOut;
41 
42 template <typename ArrayType>
43 struct IsArrayHandleInOut<ArrayType, true>
44 {
45  static constexpr bool value =
46  (vtkm::internal::PortalSupportsGets<typename ArrayType::ReadPortalType>::value &&
47  vtkm::internal::PortalSupportsSets<typename ArrayType::WritePortalType>::value);
48 };
49 
50 template <typename ArrayType>
51 struct IsArrayHandleInOut<ArrayType, false>
52 {
53  static constexpr bool value = false;
54 };
55 
56 } // namespace detail
57 
58 template <typename ArrayType>
60 {
61  static constexpr bool value = detail::IsArrayHandleInOut<ArrayType>::value;
62 };
63 }
64 }
65 } // namespace vtkm::cont::arg
66 
67 #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::TypeCheckTagArrayInOut
The Array type check passes for any object that behaves like an ArrayHandle class and can be passed t...
Definition: TypeCheckTagArrayInOut.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