Commit d1db4ef8 authored by Allison Vacanti's avatar Allison Vacanti

Clarify intent of TypeString and TypeName functions.

TypeName is used for logging, and is now TypeToString.

TypeString is used for serialization, and is now SerializableTypeString.
parent 702e2276
......@@ -29,6 +29,7 @@
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/ErrorInternal.h>
#include <vtkm/cont/SerializableTypeString.h>
#include <vtkm/cont/Serialization.h>
#include <vtkm/cont/Storage.h>
#include <vtkm/cont/StorageBasic.h>
......@@ -683,11 +684,11 @@ namespace cont
{
template <typename T>
struct TypeString<ArrayHandle<T>>
struct SerializableTypeString<ArrayHandle<T>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH<" + TypeString<T>::Get() + ">";
static std::string name = "AH<" + SerializableTypeString<T>::Get() + ">";
return name;
}
};
......
......@@ -438,21 +438,21 @@ namespace cont
{
template <typename AH1, typename AH2, typename AH3>
struct TypeString<vtkm::cont::ArrayHandleCartesianProduct<AH1, AH2, AH3>>
struct SerializableTypeString<vtkm::cont::ArrayHandleCartesianProduct<AH1, AH2, AH3>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_CartesianProduct<" + TypeString<AH1>::Get() + "," +
TypeString<AH2>::Get() + "," + TypeString<AH3>::Get() + ">";
static std::string name = "AH_CartesianProduct<" + SerializableTypeString<AH1>::Get() + "," +
SerializableTypeString<AH2>::Get() + "," + SerializableTypeString<AH3>::Get() + ">";
return name;
}
};
template <typename AH1, typename AH2, typename AH3>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<vtkm::Vec<typename AH1::ValueType, 3>,
vtkm::cont::internal::StorageTagCartesianProduct<AH1, AH2, AH3>>>
: TypeString<vtkm::cont::ArrayHandleCartesianProduct<AH1, AH2, AH3>>
: SerializableTypeString<vtkm::cont::ArrayHandleCartesianProduct<AH1, AH2, AH3>>
{
};
}
......
......@@ -110,19 +110,19 @@ namespace cont
{
template <typename T1, typename T2>
struct TypeString<vtkm::cont::internal::Cast<T1, T2>>
struct SerializableTypeString<vtkm::cont::internal::Cast<T1, T2>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_Cast_Functor<" + TypeString<T1>::Get() + "," + TypeString<T2>::Get() + ">";
static std::string name = "AH_Cast_Functor<" + SerializableTypeString<T1>::Get() + "," +
SerializableTypeString<T2>::Get() + ">";
return name;
}
};
template <typename T, typename AH>
struct TypeString<vtkm::cont::ArrayHandleCast<T, AH>>
: TypeString<
struct SerializableTypeString<vtkm::cont::ArrayHandleCast<T, AH>>
: SerializableTypeString<
vtkm::cont::ArrayHandleTransform<AH, vtkm::cont::internal::Cast<typename AH::ValueType, T>>>
{
};
......
......@@ -732,21 +732,21 @@ namespace cont
{
template <typename... AHs>
struct TypeString<vtkm::cont::ArrayHandleCompositeVector<AHs...>>
struct SerializableTypeString<vtkm::cont::ArrayHandleCompositeVector<AHs...>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_CompositeVector<" + internal::GetVariadicTypeString(AHs{}...) + ">";
"AH_CompositeVector<" + internal::GetVariadicSerializableTypeString(AHs{}...) + ">";
return name;
}
};
template <typename... AHs>
struct TypeString<vtkm::cont::ArrayHandle<
struct SerializableTypeString<vtkm::cont::ArrayHandle<
typename vtkm::cont::internal::compvec::GetValueType<vtkmstd::tuple<AHs...>>::ValueType,
vtkm::cont::internal::StorageTagCompositeVector<vtkmstd::tuple<AHs...>>>>
: TypeString<vtkm::cont::ArrayHandleCompositeVector<AHs...>>
: SerializableTypeString<vtkm::cont::ArrayHandleCompositeVector<AHs...>>
{
};
}
......
......@@ -332,20 +332,20 @@ namespace cont
{
template <typename AH1, typename AH2>
struct TypeString<vtkm::cont::ArrayHandleConcatenate<AH1, AH2>>
struct SerializableTypeString<vtkm::cont::ArrayHandleConcatenate<AH1, AH2>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_Concatenate<" + TypeString<AH1>::Get() + "," + TypeString<AH2>::Get() + ">";
static std::string name = "AH_Concatenate<" + SerializableTypeString<AH1>::Get() + "," +
SerializableTypeString<AH2>::Get() + ">";
return name;
}
};
template <typename AH1, typename AH2>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<typename AH1::ValueType, vtkm::cont::StorageTagConcatenate<AH1, AH2>>>
: TypeString<vtkm::cont::ArrayHandleConcatenate<AH1, AH2>>
: SerializableTypeString<vtkm::cont::ArrayHandleConcatenate<AH1, AH2>>
{
};
}
......
......@@ -93,18 +93,18 @@ namespace cont
{
template <typename T>
struct TypeString<vtkm::cont::detail::ConstantFunctor<T>>
struct SerializableTypeString<vtkm::cont::detail::ConstantFunctor<T>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_ConstantFunctor<" + TypeString<T>::Get() + ">";
static std::string name = "AH_ConstantFunctor<" + SerializableTypeString<T>::Get() + ">";
return name;
}
};
template <typename T>
struct TypeString<vtkm::cont::ArrayHandleConstant<T>>
: TypeString<vtkm::cont::ArrayHandleImplicit<vtkm::cont::detail::ConstantFunctor<T>>>
struct SerializableTypeString<vtkm::cont::ArrayHandleConstant<T>>
: SerializableTypeString<vtkm::cont::ArrayHandleImplicit<vtkm::cont::detail::ConstantFunctor<T>>>
{
};
}
......
......@@ -156,19 +156,19 @@ namespace cont
{
template <typename T>
struct TypeString<vtkm::cont::ArrayHandleCounting<T>>
struct SerializableTypeString<vtkm::cont::ArrayHandleCounting<T>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_Counting<" + TypeString<T>::Get() + ">";
static std::string name = "AH_Counting<" + SerializableTypeString<T>::Get() + ">";
return name;
}
};
template <typename T>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<T, typename vtkm::cont::ArrayHandleCounting<T>::StorageTag>>
: TypeString<vtkm::cont::ArrayHandleCounting<T>>
: SerializableTypeString<vtkm::cont::ArrayHandleCounting<T>>
{
};
}
......
......@@ -318,20 +318,20 @@ namespace cont
{
template <typename AH>
struct TypeString<vtkm::cont::ArrayHandleExtractComponent<AH>>
struct SerializableTypeString<vtkm::cont::ArrayHandleExtractComponent<AH>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_ExtractComponent<" + TypeString<AH>::Get() + ">";
static std::string name = "AH_ExtractComponent<" + SerializableTypeString<AH>::Get() + ">";
return name;
}
};
template <typename AH>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<typename vtkm::VecTraits<typename AH::ValueType>::ComponentType,
vtkm::cont::StorageTagExtractComponent<AH>>>
: TypeString<vtkm::cont::ArrayHandleExtractComponent<AH>>
: SerializableTypeString<vtkm::cont::ArrayHandleExtractComponent<AH>>
{
};
}
......
......@@ -374,20 +374,21 @@ namespace cont
{
template <typename AH, vtkm::IdComponent NUM_COMPS>
struct TypeString<vtkm::cont::ArrayHandleGroupVec<AH, NUM_COMPS>>
struct SerializableTypeString<vtkm::cont::ArrayHandleGroupVec<AH, NUM_COMPS>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_GroupVec<" + TypeString<AH>::Get() + "," + std::to_string(NUM_COMPS) + ">";
"AH_GroupVec<" + SerializableTypeString<AH>::Get() + "," + std::to_string(NUM_COMPS) + ">";
return name;
}
};
template <typename AH, vtkm::IdComponent NUM_COMPS>
struct TypeString<vtkm::cont::ArrayHandle<vtkm::Vec<typename AH::ValueType, NUM_COMPS>,
vtkm::cont::internal::StorageTagGroupVec<AH, NUM_COMPS>>>
: TypeString<vtkm::cont::ArrayHandleGroupVec<AH, NUM_COMPS>>
struct SerializableTypeString<
vtkm::cont::ArrayHandle<vtkm::Vec<typename AH::ValueType, NUM_COMPS>,
vtkm::cont::internal::StorageTagGroupVec<AH, NUM_COMPS>>>
: SerializableTypeString<vtkm::cont::ArrayHandleGroupVec<AH, NUM_COMPS>>
{
};
}
......
......@@ -514,21 +514,21 @@ namespace cont
{
template <typename SAH, typename OAH>
struct TypeString<vtkm::cont::ArrayHandleGroupVecVariable<SAH, OAH>>
struct SerializableTypeString<vtkm::cont::ArrayHandleGroupVecVariable<SAH, OAH>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_GroupVecVariable<" + TypeString<SAH>::Get() + "," + TypeString<OAH>::Get() + ">";
static std::string name = "AH_GroupVecVariable<" + SerializableTypeString<SAH>::Get() + "," +
SerializableTypeString<OAH>::Get() + ">";
return name;
}
};
template <typename SAH, typename OAH>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<vtkm::VecFromPortal<typename SAH::PortalControl>,
vtkm::cont::internal::StorageTagGroupVecVariable<SAH, OAH>>>
: TypeString<vtkm::cont::ArrayHandleGroupVecVariable<SAH, OAH>>
: SerializableTypeString<vtkm::cont::ArrayHandleGroupVecVariable<SAH, OAH>>
{
};
}
......
......@@ -154,20 +154,20 @@ namespace cont
{
template <typename Functor>
struct TypeString<vtkm::cont::ArrayHandleImplicit<Functor>>
struct SerializableTypeString<vtkm::cont::ArrayHandleImplicit<Functor>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_Implicit<" + TypeString<Functor>::Get() + ">";
static std::string name = "AH_Implicit<" + SerializableTypeString<Functor>::Get() + ">";
return name;
}
};
template <typename Functor>
struct TypeString<vtkm::cont::ArrayHandle<
struct SerializableTypeString<vtkm::cont::ArrayHandle<
typename vtkm::cont::detail::ArrayHandleImplicitTraits<Functor>::ValueType,
vtkm::cont::StorageTagImplicit<vtkm::cont::detail::ArrayPortalImplicit<Functor>>>>
: TypeString<vtkm::cont::ArrayHandleImplicit<Functor>>
: SerializableTypeString<vtkm::cont::ArrayHandleImplicit<Functor>>
{
};
}
......
......@@ -70,14 +70,14 @@ namespace cont
{
template <>
struct TypeString<vtkm::cont::detail::IndexFunctor>
struct SerializableTypeString<vtkm::cont::detail::IndexFunctor>
{
static VTKM_CONT const std::string Get() { return "AH_IndexFunctor"; }
};
template <>
struct TypeString<vtkm::cont::ArrayHandleIndex>
: TypeString<vtkm::cont::ArrayHandleImplicit<vtkm::cont::detail::IndexFunctor>>
struct SerializableTypeString<vtkm::cont::ArrayHandleIndex>
: SerializableTypeString<vtkm::cont::ArrayHandleImplicit<vtkm::cont::detail::IndexFunctor>>
{
};
}
......
......@@ -380,21 +380,21 @@ namespace cont
{
template <typename IdxAH, typename ValAH>
struct TypeString<vtkm::cont::ArrayHandlePermutation<IdxAH, ValAH>>
struct SerializableTypeString<vtkm::cont::ArrayHandlePermutation<IdxAH, ValAH>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_Permutation<" + TypeString<IdxAH>::Get() + "," + TypeString<ValAH>::Get() + ">";
static std::string name = "AH_Permutation<" + SerializableTypeString<IdxAH>::Get() + "," +
SerializableTypeString<ValAH>::Get() + ">";
return name;
}
};
template <typename IdxAH, typename ValAH>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<typename ValAH::ValueType,
vtkm::cont::internal::StorageTagPermutation<IdxAH, ValAH>>>
: TypeString<vtkm::cont::ArrayHandlePermutation<IdxAH, ValAH>>
: SerializableTypeString<vtkm::cont::ArrayHandlePermutation<IdxAH, ValAH>>
{
};
}
......
......@@ -251,19 +251,19 @@ namespace cont
{
template <typename AH>
struct TypeString<vtkm::cont::ArrayHandleReverse<AH>>
struct SerializableTypeString<vtkm::cont::ArrayHandleReverse<AH>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_Reverse<" + TypeString<AH>::Get() + ">";
static std::string name = "AH_Reverse<" + SerializableTypeString<AH>::Get() + ">";
return name;
}
};
template <typename AH>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<typename AH::ValueType, vtkm::cont::StorageTagReverse<AH>>>
: TypeString<vtkm::cont::ArrayHandleReverse<AH>>
: SerializableTypeString<vtkm::cont::ArrayHandleReverse<AH>>
{
};
}
......
......@@ -406,21 +406,21 @@ namespace cont
{
template <typename AH, vtkm::IdComponent NComps>
struct TypeString<vtkm::cont::ArrayHandleSwizzle<AH, NComps>>
struct SerializableTypeString<vtkm::cont::ArrayHandleSwizzle<AH, NComps>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_Swizzle<" + TypeString<AH>::Get() + "," + std::to_string(NComps) + ">";
"AH_Swizzle<" + SerializableTypeString<AH>::Get() + "," + std::to_string(NComps) + ">";
return name;
}
};
template <typename AH, vtkm::IdComponent NComps>
struct TypeString<vtkm::cont::ArrayHandle<
struct SerializableTypeString<vtkm::cont::ArrayHandle<
vtkm::Vec<typename vtkm::VecTraits<typename AH::ValueType>::ComponentType, NComps>,
vtkm::cont::StorageTagSwizzle<AH, NComps>>>
: TypeString<vtkm::cont::ArrayHandleSwizzle<AH, NComps>>
: SerializableTypeString<vtkm::cont::ArrayHandleSwizzle<AH, NComps>>
{
};
}
......
......@@ -747,32 +747,33 @@ namespace cont
{
template <typename AH, typename Functor, typename InvFunctor>
struct TypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
struct SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_Transform<" + TypeString<AH>::Get() + "," +
TypeString<Functor>::Get() + "," + TypeString<InvFunctor>::Get() + ">";
static std::string name = "AH_Transform<" + SerializableTypeString<AH>::Get() + "," +
SerializableTypeString<Functor>::Get() + "," + SerializableTypeString<InvFunctor>::Get() +
">";
return name;
}
};
template <typename AH, typename Functor>
struct TypeString<vtkm::cont::ArrayHandleTransform<AH, Functor>>
struct SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_Transform<" + TypeString<AH>::Get() + "," + TypeString<Functor>::Get() + ">";
static std::string name = "AH_Transform<" + SerializableTypeString<AH>::Get() + "," +
SerializableTypeString<Functor>::Get() + ">";
return name;
}
};
template <typename AH, typename Functor, typename InvFunctor>
struct TypeString<vtkm::cont::ArrayHandle<
struct SerializableTypeString<vtkm::cont::ArrayHandle<
typename vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>::ValueType,
vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>>>
: TypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
: SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
{
};
}
......
......@@ -70,16 +70,16 @@ namespace cont
{
template <>
struct TypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>
struct SerializableTypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>
{
static VTKM_CONT const std::string Get() { return "AH_UniformPointCoordinates"; }
};
template <>
struct TypeString<vtkm::cont::ArrayHandle<
struct SerializableTypeString<vtkm::cont::ArrayHandle<
vtkm::Vec<vtkm::FloatDefault, 3>,
vtkm::cont::StorageTagImplicit<vtkm::internal::ArrayPortalUniformPointCoordinates>>>
: TypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>
: SerializableTypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>
{
};
}
......
......@@ -393,7 +393,7 @@ private:
std::true_type vtkmNotUsed(notFromArrayHandleVirtual)) const
{
VTKM_LOG_CAST_FAIL(*this, ArrayHandleType);
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeName<ArrayHandleType>());
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeToString<ArrayHandleType>());
return ArrayHandleType{};
}
......@@ -402,7 +402,7 @@ private:
std::false_type vtkmNotUsed(notFromArrayHandleVirtual)) const
{
VTKM_LOG_CAST_FAIL(*this, ArrayHandleType);
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeName<ArrayHandleType>());
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeToString<ArrayHandleType>());
return ArrayHandleType{};
}
......@@ -417,7 +417,7 @@ private:
if (!derived)
{
VTKM_LOG_CAST_FAIL(*this, ArrayHandleType);
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeName<ArrayHandleType>());
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeToString<ArrayHandleType>());
}
VTKM_LOG_CAST_SUCC(*this, derived);
return *derived;
......@@ -492,11 +492,11 @@ void CastAndCall(vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>
//=============================================================================
// Specializations of serialization related classes
template <typename T>
struct TypeString<vtkm::cont::ArrayHandleVirtual<T>>
struct SerializableTypeString<vtkm::cont::ArrayHandleVirtual<T>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "AH_Virtual<" + TypeString<T>::Get() + ">";
static std::string name = "AH_Virtual<" + SerializableTypeString<T>::Get() + ">";
return name;
}
};
......
......@@ -38,7 +38,7 @@ ArrayHandleType inline ArrayHandle<T, StorageTagVirtual>::CastToType(
if (!this->Storage)
{
VTKM_LOG_CAST_FAIL(*this, ArrayHandleType);
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeName<ArrayHandleType>());
throwFailedDynamicCast("ArrayHandleVirtual", vtkm::cont::TypeToString<ArrayHandleType>());
}
using S = typename ArrayHandleType::StorageTag;
const auto* any = this->Storage->template Cast<vtkm::cont::StorageAny<T, S>>();
......@@ -86,7 +86,7 @@ struct IntAnySerializer
{
if (obj.template IsType<CountingType>())
{
vtkmdiy::save(bb, vtkm::cont::TypeString<CountingType>::Get());
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<CountingType>::Get());
using S = typename CountingType::StorageTag;
const vtkm::cont::StorageVirtual* storage = obj.GetStorage();
......@@ -95,7 +95,7 @@ struct IntAnySerializer
}
else if (obj.template IsType<ConstantType>())
{
vtkmdiy::save(bb, vtkm::cont::TypeString<ConstantType>::Get());
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<ConstantType>::Get());
using S = typename ConstantType::StorageTag;
const vtkm::cont::StorageVirtual* storage = obj.GetStorage();
......@@ -104,7 +104,7 @@ struct IntAnySerializer
}
else
{
vtkmdiy::save(bb, vtkm::cont::TypeString<BasicType>::Get());
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<BasicType>::Get());
vtkm::cont::internal::ArrayHandleDefaultSerialization(bb, obj);
}
}
......@@ -114,13 +114,13 @@ struct IntAnySerializer
std::string typeString;
vtkmdiy::load(bb, typeString);
if (typeString == vtkm::cont::TypeString<CountingType>::Get())
if (typeString == vtkm::cont::SerializableTypeString<CountingType>::Get())
{
CountingType array;
vtkmdiy::load(bb, array);
obj = std::move(vtkm::cont::ArrayHandleVirtual<T>{ array });
}
else if (typeString == vtkm::cont::TypeString<ConstantType>::Get())
else if (typeString == vtkm::cont::SerializableTypeString<ConstantType>::Get())
{
ConstantType array;
vtkmdiy::load(bb, array);
......
......@@ -96,7 +96,7 @@ void CastAndCall(const vtkm::cont::ArrayHandleVirtualCoordinates& coords,
template <>
struct TypeString<vtkm::cont::ArrayHandleVirtualCoordinates>
struct SerializableTypeString<vtkm::cont::ArrayHandleVirtualCoordinates>
{
static VTKM_CONT const std::string Get() { return "AH_VirtualCoordinates"; }
};
......@@ -132,7 +132,7 @@ public:
using T = typename HandleType::ValueType;
using S = typename HandleType::StorageTag;
auto array = storage->Cast<vtkm::cont::StorageAny<T, S>>();
vtkmdiy::save(bb, vtkm::cont::TypeString<HandleType>::Get());
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<HandleType>::Get());
vtkmdiy::save(bb, array->GetHandle());
}
else if (obj.IsType<RectilinearCoordsArrayType>())
......@@ -141,12 +141,12 @@ public:
using T = typename HandleType::ValueType;
using S = typename HandleType::StorageTag;
auto array = storage->Cast<vtkm::cont::StorageAny<T, S>>();
vtkmdiy::save(bb, vtkm::cont::TypeString<HandleType>::Get());
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<HandleType>::Get());
vtkmdiy::save(bb, array->GetHandle());
}
else
{
vtkmdiy::save(bb, vtkm::cont::TypeString<BasicCoordsType>::Get());
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<BasicCoordsType>::Get());
vtkm::cont::internal::ArrayHandleDefaultSerialization(bb, obj);
}
}
......@@ -156,19 +156,20 @@ public:
std::string typeString;
vtkmdiy::load(bb, typeString);
if (typeString == vtkm::cont::TypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>::Get())
if (typeString ==
vtkm::cont::SerializableTypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>::Get())
{
vtkm::cont::ArrayHandleUniformPointCoordinates array;
vtkmdiy::load(bb, array);
obj = vtkm::cont::ArrayHandleVirtualCoordinates(array);
}
else if (typeString == vtkm::cont::TypeString<RectilinearCoordsArrayType>::Get())
else if (typeString == vtkm::cont::SerializableTypeString<RectilinearCoordsArrayType>::Get())
{
RectilinearCoordsArrayType array;
vtkmdiy::load(bb, array);
obj = vtkm::cont::ArrayHandleVirtualCoordinates(array);
}
else if (typeString == vtkm::cont::TypeString<BasicCoordsType>::Get())
else if (typeString == vtkm::cont::SerializableTypeString<BasicCoordsType>::Get())
{
BasicCoordsType array;
vtkmdiy::load(bb, array);
......
......@@ -392,21 +392,21 @@ namespace cont
{
template <typename AH1, typename AH2>
struct TypeString<vtkm::cont::ArrayHandleZip<AH1, AH2>>
struct SerializableTypeString<vtkm::cont::ArrayHandleZip<AH1, AH2>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"AH_Zip<" + TypeString<AH1>::Get() + "," + TypeString<AH2>::Get() + ">";
static std::string name = "AH_Zip<" + SerializableTypeString<AH1>::Get() + "," +
SerializableTypeString<AH2>::Get() + ">";
return name;
}
};
template <typename AH1, typename AH2>
struct TypeString<
struct SerializableTypeString<
vtkm::cont::ArrayHandle<vtkm::Pair<typename AH1::ValueType, typename AH2::ValueType>,
vtkm::cont::internal::StorageTagZip<AH1, AH2>>>
: TypeString<vtkm::cont::ArrayHandleZip<AH1, AH2>>
: SerializableTypeString<vtkm::cont::ArrayHandleZip<AH1, AH2>>
{
};
}
......
......@@ -107,7 +107,7 @@ set(headers
StorageVirtual.h
Timer.h
TryExecute.h
TypeString.h
SerializableTypeString.h
VariantArrayHandle.h
VirtualObjectHandle.h
)
......
......@@ -350,15 +350,16 @@ namespace cont
{
template <typename ShapeST, typename CountST, typename ConnectivityST, typename OffsetST>
struct TypeString<vtkm::cont::CellSetExplicit<ShapeST, CountST, ConnectivityST, OffsetST>>
struct SerializableTypeString<
vtkm::cont::CellSetExplicit<ShapeST, CountST, ConnectivityST, OffsetST>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name = "CS_Explicit<" +
TypeString<vtkm::cont::ArrayHandle<vtkm::UInt8, ShapeST>>::Get() + "_ST," +
TypeString<vtkm::cont::ArrayHandle<vtkm::IdComponent, CountST>>::Get() + "_ST," +
TypeString<vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityST>>::Get() + "_ST," +
TypeString<vtkm::cont::ArrayHandle<vtkm::Id, OffsetST>>::Get() + "_ST>";
SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::UInt8, ShapeST>>::Get() + "_ST," +
SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::IdComponent, CountST>>::Get() + "_ST," +
SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityST>>::Get() + "_ST," +
SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, OffsetST>>::Get() + "_ST>";
return name;
}
......
......@@ -402,12 +402,12 @@ namespace cont
{
template <typename CSType, typename AHValidCellIds>
struct TypeString<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
struct SerializableTypeString<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
{
static VTKM_CONT const std::string& Get()
{
static std::string name =
"CS_Permutation<" + TypeString<CSType>::Get() + "," + TypeString<AHValidCellIds>::Get() + ">";
static std::string name = "CS_Permutation<" + SerializableTypeString<CSType>::Get() + "," +
SerializableTypeString<AHValidCellIds>::Get() + ">";
return name;
}
};
......
......@@ -269,12 +269,12 @@ namespace cont
{
template <typename ConnectivityST>
struct TypeString<vtkm::cont::CellSetSingleType<ConnectivityST>>
struct SerializableTypeString<vtkm::cont::CellSetSingleType<ConnectivityST>>
{
static VTKM_CONT const std::string& Get()
{