VTK-m  2.0
ArrayPortalDummy.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_internal_ArrayPortalDummy
11 #define vtk_m_internal_ArrayPortalDummy
12 
13 #include <vtkm/Assert.h>
14 #include <vtkm/Types.h>
15 
16 namespace vtkm
17 {
18 namespace internal
19 {
20 
24 template <typename T>
25 struct ArrayPortalDummy
26 {
27  using ValueType = T;
28 
29  VTKM_EXEC_CONT vtkm::Id GetNumberOfValues() const { return 0; }
30 
31  VTKM_EXEC_CONT ValueType Get(vtkm::Id) const
32  {
33  VTKM_ASSERT(false && "Tried to use a dummy portal.");
34  return ValueType{};
35  }
36 };
37 
38 }
39 } // namespace vtkm::internal
40 
41 #endif //vtk_m_internal_ArrayPortalDummy
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
VTKM_ASSERT
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::Get
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto Get(const vtkm::Tuple< Ts... > &tuple) -> decltype(tuple.template Get< Index >())
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:83
Assert.h
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191