Go to the documentation of this file.
10 #ifndef vtk_m_cont_UncertainArrayHandle_h
11 #define vtk_m_cont_UncertainArrayHandle_h
38 template <
typename ValueTypeList,
typename StorageTypeList>
45 "Cannot use vtkm::ListUniversal with UncertainArrayHandle.");
47 "Cannot use vtkm::ListUniversal with UncertainArrayHandle.");
55 template <
typename T,
typename S>
66 template <
typename OtherValues,
typename OtherStorage>
82 template <
typename NewValueTypeList>
84 NewValueTypeList = NewValueTypeList{})
const
86 return this->ResetTypes<NewValueTypeList, StorageTypeList>();
91 template <
typename NewStorageTypeList>
93 NewStorageTypeList = NewStorageTypeList{})
const
95 return this->ResetTypes<ValueTypeList, NewStorageTypeList>();
103 template <
typename Functor,
typename... Args>
106 this->CastAndCallForTypes<ValueTypeList, StorageTypeList>(std::forward<Functor>(functor),
107 std::forward<Args>(args)...);
118 template <
typename Functor,
typename... Args>
121 this->
template CastAndCallForTypesWithFloatFallback<ValueTypeList, StorageTypeList>(
122 std::forward<Functor>(functor), std::forward<Args>(args)...);
127 template <
typename NewValueTypeList,
typename NewStorageTypeList>
137 template <
typename ValueTypeList,
typename StorageTypeList>
138 struct DynamicTransformTraits<vtkm::cont::UncertainArrayHandle<ValueTypeList, StorageTypeList>>
140 using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
157 template <
typename ValueTypeList,
typename StorageTypeList>
158 struct SerializableTypeString<
vtkm::cont::UncertainArrayHandle<ValueTypeList, StorageTypeList>>
160 static VTKM_CONT std::string
Get() {
return "UncertainAH"; }
171 struct UncertainArrayHandleSerializeFunctor
173 template <
typename ArrayHandleType>
174 void operator()(
const ArrayHandleType& ah, BinaryBuffer& bb)
const
177 vtkmdiy::save(bb, ah);
181 struct UncertainArrayHandleDeserializeFunctor
183 template <
typename T,
typename S>
186 const std::string& typeString,
188 BinaryBuffer& bb)
const
194 ArrayHandleType knownArray;
196 unknownArray = knownArray;
204 template <
typename ValueTypeList,
typename StorageTypeList>
205 struct Serialization<
vtkm::cont::UncertainArrayHandle<ValueTypeList, StorageTypeList>>
210 static VTKM_CONT void save(BinaryBuffer& bb,
const Type& obj)
212 obj.CastAndCall(internal::UncertainArrayHandleSerializeFunctor{}, bb);
217 std::string typeString;
220 bool success =
false;
222 vtkm::cont::internal::ListAllArrayTypes<ValueTypeList, StorageTypeList>{},
231 "Error deserializing Unknown/UncertainArrayHandle. Message TypeString: " + typeString);
240 #endif //vtk_m_cont_UncertainArrayHandle_h
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_CONT UncertainArrayHandle(const UncertainArrayHandle< OtherValues, OtherStorage > &src)
Definition: UncertainArrayHandle.h:67
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
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:406
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT void ListForEach(Functor &&f, vtkm::List< Ts... >, Args &&... args)
Definition: List.h:720
VTKM_CONT UncertainArrayHandle< ValueTypeList, NewStorageTypeList > ResetStorageTypes(NewStorageTypeList=NewStorageTypeList{}) const
Like ResetTypes except it only resets the storage types.
Definition: UncertainArrayHandle.h:92
This class is thrown when VTK-m encounters data of a type that is incompatible with the current opera...
Definition: ErrorBadType.h:25
Definition: Particle.h:331
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
VTKM_CONT UncertainArrayHandle(const vtkm::cont::UnknownArrayHandle &src)
Definition: UncertainArrayHandle.h:61
VTKM_CONT void CastAndCall(Functor &&functor, Args &&... args) const
Call a functor using the underlying array type.
Definition: UncertainArrayHandle.h:104
VTKM_CONT Thisclass NewInstance() const
Create a new array of the same type as this array.
Definition: UncertainArrayHandle.h:78
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_CONT void CastAndCallWithFloatFallback(Functor &&functor, Args &&... args) const
Call a functor using the underlying array type with a float cast fallback.
Definition: UncertainArrayHandle.h:119
VTKM_CONT UncertainArrayHandle(const vtkm::cont::ArrayHandle< T, S > &array)
Definition: UncertainArrayHandle.h:56
An ArrayHandle of an uncertain value type and storage.
Definition: UncertainArrayHandle.h:39
VTKM_CONT vtkm::cont::UncertainArrayHandle< NewValueTypeList, NewStorageTypeList > ResetTypes(NewValueTypeList=NewValueTypeList{}, NewStorageTypeList=NewStorageTypeList{}) const
Assigns potential value and storage types.
Definition: UncertainArrayHandle.h:129
#define VTKM_IS_LIST(type)
Checks that the argument is a proper list.
Definition: List.h:64
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
VTKM_CONT UncertainArrayHandle< NewValueTypeList, StorageTypeList > ResetValueTypes(NewValueTypeList=NewValueTypeList{}) const
Like ResetTypes except it only resets the value types.
Definition: UncertainArrayHandle.h:83