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
UncertainArrayHandle(const vtkm::cont::ArrayHandle< T, S > &array)
Definition: UncertainArrayHandle.h:56
Manages an array-worth of data.
Definition: ArrayHandle.h:300
T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
Groups connected points that have the same field value.
Definition: Atomic.h:19
auto Get(const vtkm::Tuple< Ts... > &tuple)
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:81
UncertainArrayHandle< ValueTypeList, NewStorageTypeList > ResetStorageTypes(NewStorageTypeList=NewStorageTypeList{}) const
Like ResetTypes except it only resets the storage types.
Definition: UncertainArrayHandle.h:92
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:430
Thisclass NewInstance() const
Create a new array of the same type as this array.
Definition: UncertainArrayHandle.h:78
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:351
void CastAndCall(Functor &&functor, Args &&... args) const
Call a functor using the underlying array type.
Definition: UncertainArrayHandle.h:104
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
#define VTKM_CONT
Definition: ExportMacros.h:57
void ListForEach(Functor &&f, vtkm::List< Ts... >, Args &&... args)
For each typename represented by the list, call the functor with a default instance of that type.
Definition: List.h:725
UncertainArrayHandle(const vtkm::cont::UnknownArrayHandle &src)
Definition: UncertainArrayHandle.h:61
An ArrayHandle of an uncertain value type and storage.
Definition: UncertainArrayHandle.h:39
#define VTKM_IS_LIST(type)
Checks that the argument is a proper list.
Definition: List.h:69
UncertainArrayHandle(const UncertainArrayHandle< OtherValues, OtherStorage > &src)
Definition: UncertainArrayHandle.h:67
A template used to hold a list of types.
Definition: List.h:39
vtkm::cont::UncertainArrayHandle< NewValueTypeList, NewStorageTypeList > ResetTypes(NewValueTypeList=NewValueTypeList{}, NewStorageTypeList=NewStorageTypeList{}) const
Assigns potential value and storage types.
Definition: UncertainArrayHandle.h:129
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
UncertainArrayHandle< NewValueTypeList, StorageTypeList > ResetValueTypes(NewValueTypeList=NewValueTypeList{}) const
Like ResetTypes except it only resets the value types.
Definition: UncertainArrayHandle.h:83
void CastAndCallWithFloatFallback(Functor &&functor, Args &&... args) const
Call a functor using the underlying array type with a float cast fallback.
Definition: UncertainArrayHandle.h:119