VTK-m  2.0
ArrayPortal.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_ArrayPortal_h
11 #define vtk_m_cont_ArrayPortal_h
12 
13 #include <vtkm/Types.h>
14 
15 namespace vtkm
16 {
17 namespace cont
18 {
19 
20 #ifdef VTKM_DOXYGEN_ONLY
21 
61 template <typename T>
63 {
64 public:
67  using ValueType = T;
68 
74 
78  ValueType Get(vtkm::Id index) const;
79 
84  void Set(vtkm::Id index, const ValueType& value) const;
85 };
86 
87 #endif // VTKM_DOXYGEN_ONLY
88 }
89 } // namespace vtkm::cont
90 
91 #endif //vtk_m_cont_ArrayPortal_h
vtkm::cont::ArrayPortal::Set
VTKM_EXEC_CONT void Set(vtkm::Id index, const ValueType &value) const
Sets a value in the array.
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::cont::ArrayPortal::ValueType
T ValueType
The type of each value in the array.
Definition: ArrayPortal.h:67
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::cont::ArrayPortal::GetNumberOfValues
VTKM_EXEC_CONT vtkm::Id GetNumberOfValues() const
The total number of values in the array.
vtkm::cont::ArrayPortal::Get
VTKM_EXEC_CONT ValueType Get(vtkm::Id index) const
Gets a value from the array.
vtkm::cont::ArrayPortal
A class that points to and access and array of data.
Definition: ArrayPortal.h:62