Go to the documentation of this file.
18 #ifndef viskores_cont_UncertainArrayHandle_h
19 #define viskores_cont_UncertainArrayHandle_h
46 template <
typename ValueTypeList,
typename StorageTypeList>
53 "Cannot use viskores::ListUniversal with UncertainArrayHandle.");
55 "Cannot use viskores::ListUniversal with UncertainArrayHandle.");
63 template <
typename T,
typename S>
74 template <
typename OtherValues,
typename OtherStorage>
90 template <
typename NewValueTypeList>
92 NewValueTypeList = NewValueTypeList{})
const
94 return this->ResetTypes<NewValueTypeList, StorageTypeList>();
99 template <
typename NewStorageTypeList>
101 NewStorageTypeList = NewStorageTypeList{})
const
103 return this->ResetTypes<ValueTypeList, NewStorageTypeList>();
111 template <
typename Functor,
typename... Args>
114 this->CastAndCallForTypes<ValueTypeList, StorageTypeList>(std::forward<Functor>(functor),
115 std::forward<Args>(args)...);
126 template <
typename Functor,
typename... Args>
129 this->
template CastAndCallForTypesWithFloatFallback<ValueTypeList, StorageTypeList>(
130 std::forward<Functor>(functor), std::forward<Args>(args)...);
135 template <
typename NewValueTypeList,
typename NewStorageTypeList>
145 template <
typename ValueTypeList,
typename StorageTypeList>
146 struct DynamicTransformTraits<viskores::cont::UncertainArrayHandle<ValueTypeList, StorageTypeList>>
148 using DynamicTag = viskores::cont::internal::DynamicTransformTagCastAndCall;
165 template <
typename ValueTypeList,
typename StorageTypeList>
166 struct SerializableTypeString<
viskores::cont::UncertainArrayHandle<ValueTypeList, StorageTypeList>>
179 struct UncertainArrayHandleSerializeFunctor
181 template <
typename ArrayHandleType>
182 void operator()(
const ArrayHandleType& ah, BinaryBuffer& bb)
const
185 viskoresdiy::save(bb, ah);
189 struct UncertainArrayHandleDeserializeFunctor
191 template <
typename T,
typename S>
194 const std::string& typeString,
196 BinaryBuffer& bb)
const
202 ArrayHandleType knownArray;
204 unknownArray = knownArray;
212 template <
typename ValueTypeList,
typename StorageTypeList>
213 struct Serialization<
viskores::cont::UncertainArrayHandle<ValueTypeList, StorageTypeList>>
218 static VISKORES_CONT void save(BinaryBuffer& bb,
const Type& obj)
220 obj.CastAndCall(internal::UncertainArrayHandleSerializeFunctor{}, bb);
225 std::string typeString;
228 bool success =
false;
230 internal::UncertainArrayHandleDeserializeFunctor{},
231 viskores::cont::internal::ListAllArrayTypes<ValueTypeList, StorageTypeList>{},
240 "Error deserializing Unknown/UncertainArrayHandle. Message TypeString: " + typeString);
249 #endif //viskores_cont_UncertainArrayHandle_h
T load(const U &u, viskores::Id v)
Definition: FetchTagArrayDirectIn.h:44
UncertainArrayHandle(const viskores::cont::ArrayHandle< T, S > &array)
Definition: UncertainArrayHandle.h:64
An ArrayHandle of an uncertain value type and storage.
Definition: UncertainArrayHandle.h:47
Thisclass NewInstance() const
Create a new array of the same type as this array.
Definition: UncertainArrayHandle.h:86
This class is thrown when Viskores encounters data of a type that is incompatible with the current op...
Definition: ErrorBadType.h:33
Manages an array-worth of data.
Definition: ArrayHandle.h:313
UncertainArrayHandle(const viskores::cont::UnknownArrayHandle &src)
Definition: UncertainArrayHandle.h:69
viskores::cont::UncertainArrayHandle< NewValueTypeList, NewStorageTypeList > ResetTypes(NewValueTypeList=NewValueTypeList{}, NewStorageTypeList=NewStorageTypeList{}) const
Assigns potential value and storage types.
Definition: UncertainArrayHandle.h:137
UncertainArrayHandle< ValueTypeList, NewStorageTypeList > ResetStorageTypes(NewStorageTypeList=NewStorageTypeList{}) const
Like ResetTypes except it only resets the storage types.
Definition: UncertainArrayHandle.h:100
Definition: Particle.h:373
A template used to hold a list of types.
Definition: List.h:47
#define VISKORES_CONT
Definition: ExportMacros.h:65
Groups connected points that have the same field value.
Definition: Atomic.h:27
UncertainArrayHandle(const UncertainArrayHandle< OtherValues, OtherStorage > &src)
Definition: UncertainArrayHandle.h:75
#define VISKORES_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:26
void ListForEach(Functor &&f, viskores::List< Ts... >, Args &&... args)
For each typename represented by the list, call the functor with a default instance of that type.
Definition: List.h:745
void CastAndCall(Functor &&functor, Args &&... args) const
Call a functor using the underlying array type.
Definition: UncertainArrayHandle.h:112
void CastAndCallWithFloatFallback(Functor &&functor, Args &&... args) const
Call a functor using the underlying array type with a float cast fallback.
Definition: UncertainArrayHandle.h:127
auto Get(const viskores::Tuple< Ts... > &tuple)
Retrieve the object from a viskores::Tuple at the given index.
Definition: Tuple.h:89
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:451
UncertainArrayHandle< NewValueTypeList, StorageTypeList > ResetValueTypes(NewValueTypeList=NewValueTypeList{}) const
Like ResetTypes except it only resets the value types.
Definition: UncertainArrayHandle.h:91
#define VISKORES_IS_LIST(type)
Checks that the argument is a proper list.
Definition: List.h:77