Commit 0a40c620 authored by Robert Maynard's avatar Robert Maynard

Rename ArrayHandleVariant to VariantArrayHandle.

parent b1387986
......@@ -22,10 +22,10 @@
#include <vtkm/VectorAnalysis.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/ImplicitFunctionHandle.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/cont/VariantArrayHandle.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/worklet/DispatcherMapTopology.h>
......@@ -319,9 +319,9 @@ class BenchmarkFieldAlgorithms
using Timer = vtkm::cont::Timer<DeviceAdapterTag>;
using ValueVariantHandle = vtkm::cont::ArrayHandleVariantBase<ValueTypes>;
using InterpVariantHandle = vtkm::cont::ArrayHandleVariantBase<InterpValueTypes>;
using IdVariantHandle = vtkm::cont::ArrayHandleVariantBase<vtkm::TypeListTagIndex>;
using ValueVariantHandle = vtkm::cont::VariantArrayHandleBase<ValueTypes>;
using InterpVariantHandle = vtkm::cont::VariantArrayHandleBase<InterpValueTypes>;
using IdVariantHandle = vtkm::cont::VariantArrayHandleBase<vtkm::TypeListTagIndex>;
private:
template <typename Value>
......@@ -484,7 +484,7 @@ private:
vtkm::cont::ArrayHandle<Value> temp1;
vtkm::cont::ArrayHandle<Value> temp2;
vtkm::cont::ArrayHandleVariantBase<MathTypes> dinput(this->InputHandle);
vtkm::cont::VariantArrayHandleBase<MathTypes> dinput(this->InputHandle);
ValueVariantHandle dtemp1(temp1);
ValueVariantHandle dtemp2(temp2);
......@@ -560,7 +560,7 @@ private:
{
using MathTypes = vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Float64, 3>>;
vtkm::cont::ArrayHandleVariantBase<MathTypes> dinput(this->InputHandle);
vtkm::cont::VariantArrayHandleBase<MathTypes> dinput(this->InputHandle);
vtkm::cont::ArrayHandle<Value, StorageTag> result;
......
......@@ -840,7 +840,7 @@ public:
}
};
// Get the number of components in a ArrayHandleVariant, ArrayHandle, or Field's
// Get the number of components in a VariantArrayHandle, ArrayHandle, or Field's
// ValueType.
struct NumberOfComponents
{
......
......@@ -146,7 +146,7 @@ class BenchmarkTopologyAlgorithms
using Timer = vtkm::cont::Timer<DeviceAdapterTag>;
using ValueVariantHandle = vtkm::cont::ArrayHandleVariantBase<ValueTypes>;
using ValueVariantHandle = vtkm::cont::VariantArrayHandleBase<ValueTypes>;
private:
template <typename T, typename Enable = void>
......
......@@ -38,11 +38,11 @@ namespace
struct FieldMapper
{
vtkm::cont::ArrayHandleVariant& Output;
vtkm::cont::VariantArrayHandle& Output;
vtkm::worklet::Clip& Worklet;
bool IsCellField;
FieldMapper(vtkm::cont::ArrayHandleVariant& output,
FieldMapper(vtkm::cont::VariantArrayHandle& output,
vtkm::worklet::Clip& worklet,
bool isCellField)
: Output(output)
......@@ -124,7 +124,7 @@ int main(int argc, char* argv[])
continue;
}
vtkm::cont::ArrayHandleVariant outField;
vtkm::cont::VariantArrayHandle outField;
FieldMapper fieldMapper(outField, clip, isCellField);
inField.GetData().CastAndCall(fieldMapper);
output.AddField(vtkm::cont::Field(inField.GetName(), inField.GetAssociation(), outField));
......
......@@ -23,13 +23,14 @@ set(headers
ArrayCopy.h
ArrayHandle.h
ArrayHandleAny.h
ArrayHandleCast.h
ArrayHandleCartesianProduct.h
ArrayHandleCast.h
ArrayHandleCompositeVector.h
ArrayHandleConcatenate.h
ArrayHandleConstant.h
ArrayHandleCounting.h
ArrayHandleExtractComponent.h
ArrayHandleDiscard.h
ArrayHandleExtractComponent.h
ArrayHandleGroupVec.h
ArrayHandleGroupVecVariable.h
ArrayHandleImplicit.h
......@@ -40,19 +41,17 @@ set(headers
ArrayHandleSwizzle.h
ArrayHandleTransform.h
ArrayHandleUniformPointCoordinates.h
ArrayHandleVariant.h
ArrayHandleView.h
ArrayHandleVirtual.h
ArrayHandleVirtualCoordinates.h
ArrayHandleZip.h
ArrayPortal.h
ArrayPortalToIterators.h
ArrayHandleConcatenate.h
ArrayRangeCompute.h
AssignerMultiBlock.h
AtomicArray.h
BoundingIntervalHierarchyNode.h
BoundingIntervalHierarchy.h
BoundingIntervalHierarchyNode.h
BoundsCompute.h
BoundsGlobalCompute.h
CellLocator.h
......@@ -61,9 +60,9 @@ set(headers
CellSet.h
CellSetExplicit.h
CellSetListTag.h
CellSetPermutation.h
CellSetSingleType.h
CellSetStructured.h
CellSetPermutation.h
ColorTable.h
ColorTableSamples.h
CoordinateSystem.h
......@@ -83,8 +82,8 @@ set(headers
ErrorBadDevice.h
ErrorBadType.h
ErrorBadValue.h
ErrorFilterExecution.h
ErrorExecution.h
ErrorFilterExecution.h
ErrorInternal.h
ExecutionAndControlObjectBase.h
ExecutionObjectBase.h
......@@ -103,11 +102,12 @@ set(headers
Storage.h
StorageBasic.h
StorageImplicit.h
StorageVirtual.h
StorageListTag.h
StorageVirtual.h
Timer.h
TryExecute.h
TypeString.h
VariantArrayHandle.h
VirtualObjectHandle.h
)
......@@ -128,7 +128,6 @@ set(template_sources
set(sources
ArrayHandle.cxx
ArrayHandleVariant.cxx
AssignerMultiBlock.cxx
BoundsCompute.cxx
BoundsGlobalCompute.cxx
......@@ -161,6 +160,7 @@ set(sources
StorageBasic.cxx
StorageVirtual.cxx
TryExecute.cxx
VariantArrayHandle.cxx
)
# This list of sources has code that uses devices and so might need to be
......
......@@ -25,9 +25,9 @@
#include <vtkm/StaticAssert.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/Field.h>
#include <vtkm/cont/VariantArrayHandle.h>
namespace vtkm
{
......
......@@ -118,12 +118,12 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>>::StorageTag>&);
template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(std::string name,
const vtkm::cont::ArrayHandleVariant&);
const vtkm::cont::VariantArrayHandle&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandle<vtkm::Vec<float, 3>>&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandle<vtkm::Vec<double, 3>>&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(const vtkm::cont::ArrayHandleVariant&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(const vtkm::cont::VariantArrayHandle&);
}
} // namespace vtkm::cont
......@@ -46,7 +46,7 @@ public:
template <typename TypeList>
VTKM_CONT CoordinateSystem(std::string name,
const vtkm::cont::ArrayHandleVariantBase<TypeList>& data);
const vtkm::cont::VariantArrayHandleBase<TypeList>& data);
template <typename T, typename Storage>
VTKM_CONT CoordinateSystem(std::string name, const ArrayHandle<T, Storage>& data);
......@@ -71,7 +71,7 @@ public:
VTKM_CONT
template <typename TypeList>
void SetData(const vtkm::cont::ArrayHandleVariantBase<TypeList>& newdata);
void SetData(const vtkm::cont::VariantArrayHandleBase<TypeList>& newdata);
VTKM_CONT
void GetRange(vtkm::Range* range) const
......
......@@ -50,7 +50,7 @@ struct MakeArrayHandleVirtualCoordinatesFunctor
template <typename TypeList>
VTKM_CONT vtkm::cont::ArrayHandleVirtualCoordinates MakeArrayHandleVirtualCoordinates(
const vtkm::cont::ArrayHandleVariantBase<TypeList>& array)
const vtkm::cont::VariantArrayHandleBase<TypeList>& array)
{
vtkm::cont::ArrayHandleVirtualCoordinates output;
vtkm::cont::CastAndCall(array.ResetTypes(vtkm::TypeListTagFieldVec3{}),
......@@ -63,7 +63,7 @@ VTKM_CONT vtkm::cont::ArrayHandleVirtualCoordinates MakeArrayHandleVirtualCoordi
template <typename TypeList>
VTKM_CONT CoordinateSystem::CoordinateSystem(
std::string name,
const vtkm::cont::ArrayHandleVariantBase<TypeList>& data)
const vtkm::cont::VariantArrayHandleBase<TypeList>& data)
: Superclass(name, Association::POINTS, detail::MakeArrayHandleVirtualCoordinates(data))
{
}
......@@ -83,7 +83,7 @@ VTKM_CONT void CoordinateSystem::SetData(const vtkm::cont::ArrayHandle<T, Storag
template <typename TypeList>
VTKM_CONT void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandleVariantBase<TypeList>& newdata)
const vtkm::cont::VariantArrayHandleBase<TypeList>& newdata)
{
this->SetData(detail::MakeArrayHandleVirtualCoordinates(newdata));
}
......
......@@ -23,12 +23,12 @@
#include <vtkm/cont/vtkm_cont_export.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/Field.h>
#include <vtkm/cont/VariantArrayHandle.h>
namespace vtkm
{
......
......@@ -38,7 +38,7 @@ public:
VTKM_CONT
static void AddPointField(vtkm::cont::DataSet& dataSet,
const std::string& fieldName,
const vtkm::cont::ArrayHandleVariant& field)
const vtkm::cont::VariantArrayHandle& field)
{
dataSet.AddField(Field(fieldName, vtkm::cont::Field::Association::POINTS, field));
}
......@@ -74,7 +74,7 @@ public:
VTKM_CONT
static void AddCellField(vtkm::cont::DataSet& dataSet,
const std::string& fieldName,
const vtkm::cont::ArrayHandleVariant& field,
const vtkm::cont::VariantArrayHandle& field,
const std::string& cellSetName)
{
dataSet.AddField(
......@@ -119,7 +119,7 @@ public:
VTKM_CONT
static void AddCellField(vtkm::cont::DataSet& dataSet,
const std::string& fieldName,
const vtkm::cont::ArrayHandleVariant& field,
const vtkm::cont::VariantArrayHandle& field,
vtkm::Id cellSetIndex = 0)
{
std::string cellSetName = dataSet.GetCellSet(cellSetIndex).GetName();
......
......@@ -45,7 +45,7 @@ VTKM_SILENCE_WEAK_VTABLE_WARNING_END
/// Throws an ErrorBadType exception with the following message:
/// Cast failed: \c baseType --> \c derivedType".
/// This is generally caused by asking for a casting of a ArrayHandleVariant
/// This is generally caused by asking for a casting of a VariantArrayHandle
/// with an insufficient type list.
//
VTKM_CONT_EXPORT void throwFailedDynamicCast(const std::string& baseType,
......
......@@ -27,7 +27,7 @@ namespace cont
/// constructors for points / whole mesh
VTKM_CONT
Field::Field(std::string name, Association association, const vtkm::cont::ArrayHandleVariant& data)
Field::Field(std::string name, Association association, const vtkm::cont::VariantArrayHandle& data)
: Name(name)
, FieldAssociation(association)
, AssocCellSetName()
......@@ -45,7 +45,7 @@ VTKM_CONT
Field::Field(std::string name,
Association association,
const std::string& cellSetName,
const vtkm::cont::ArrayHandleVariant& data)
const vtkm::cont::VariantArrayHandle& data)
: Name(name)
, FieldAssociation(association)
, AssocCellSetName(cellSetName)
......@@ -62,7 +62,7 @@ VTKM_CONT
Field::Field(std::string name,
Association association,
vtkm::IdComponent logicalDim,
const vtkm::cont::ArrayHandleVariant& data)
const vtkm::cont::VariantArrayHandle& data)
: Name(name)
, FieldAssociation(association)
, AssocCellSetName()
......@@ -157,13 +157,13 @@ Field::~Field()
VTKM_CONT
const vtkm::cont::ArrayHandleVariant& Field::GetData() const
const vtkm::cont::VariantArrayHandle& Field::GetData() const
{
return this->Data;
}
VTKM_CONT
vtkm::cont::ArrayHandleVariant& Field::GetData()
vtkm::cont::VariantArrayHandle& Field::GetData()
{
this->ModifiedFlag = true;
return this->Data;
......
......@@ -26,10 +26,10 @@
#include <vtkm/Types.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/ArrayRangeCompute.h>
#include <vtkm/cont/ArrayRangeCompute.hxx>
#include <vtkm/cont/VariantArrayHandle.h>
namespace vtkm
{
......@@ -71,13 +71,13 @@ public:
/// constructors for points / whole mesh
VTKM_CONT
Field(std::string name, Association association, const vtkm::cont::ArrayHandleVariant& data);
Field(std::string name, Association association, const vtkm::cont::VariantArrayHandle& data);
template <typename T, typename Storage>
VTKM_CONT Field(std::string name,
Association association,
const vtkm::cont::ArrayHandle<T, Storage>& data)
: Field(name, association, vtkm::cont::ArrayHandleVariant{ data })
: Field(name, association, vtkm::cont::VariantArrayHandle{ data })
{
}
......@@ -86,14 +86,14 @@ public:
Field(std::string name,
Association association,
const std::string& cellSetName,
const vtkm::cont::ArrayHandleVariant& data);
const vtkm::cont::VariantArrayHandle& data);
template <typename T, typename Storage>
VTKM_CONT Field(std::string name,
Association association,
const std::string& cellSetName,
const vtkm::cont::ArrayHandle<T, Storage>& data)
: Field(name, association, cellSetName, vtkm::cont::ArrayHandleVariant{ data })
: Field(name, association, cellSetName, vtkm::cont::VariantArrayHandle{ data })
{
}
......@@ -102,14 +102,14 @@ public:
Field(std::string name,
Association association,
vtkm::IdComponent logicalDim,
const vtkm::cont::ArrayHandleVariant& data);
const vtkm::cont::VariantArrayHandle& data);
template <typename T, typename Storage>
VTKM_CONT Field(std::string name,
Association association,
vtkm::IdComponent logicalDim,
const vtkm::cont::ArrayHandle<T, Storage>& data)
: Field(name, association, logicalDim, vtkm::cont::ArrayHandleVariant{ data })
: Field(name, association, logicalDim, vtkm::cont::VariantArrayHandle{ data })
{
}
......@@ -125,8 +125,8 @@ public:
VTKM_CONT Association GetAssociation() const { return this->FieldAssociation; }
VTKM_CONT std::string GetAssocCellSet() const { return this->AssocCellSetName; }
VTKM_CONT vtkm::IdComponent GetAssocLogicalDim() const { return this->AssocLogicalDim; }
const vtkm::cont::ArrayHandleVariant& GetData() const;
vtkm::cont::ArrayHandleVariant& GetData();
const vtkm::cont::VariantArrayHandle& GetData() const;
vtkm::cont::VariantArrayHandle& GetData();
template <typename TypeList>
......@@ -165,7 +165,7 @@ public:
}
VTKM_CONT
void SetData(const vtkm::cont::ArrayHandleVariant& newdata)
void SetData(const vtkm::cont::VariantArrayHandle& newdata)
{
this->Data = newdata;
this->ModifiedFlag = true;
......@@ -188,7 +188,7 @@ private:
std::string AssocCellSetName; ///< only populate if assoc is cells
vtkm::IdComponent AssocLogicalDim; ///< only populate if assoc is logical dim
vtkm::cont::ArrayHandleVariant Data;
vtkm::cont::VariantArrayHandle Data;
mutable vtkm::cont::ArrayHandle<vtkm::Range> Range;
mutable bool ModifiedFlag = true;
......@@ -358,26 +358,26 @@ public:
diy::load(bb, assocVal);
auto assoc = static_cast<vtkm::cont::Field::Association>(assocVal);
vtkm::cont::ArrayHandleVariantBase<TypeList> data;
vtkm::cont::VariantArrayHandleBase<TypeList> data;
if (assoc == vtkm::cont::Field::Association::CELL_SET)
{
std::string assocCellSetName;
diy::load(bb, assocCellSetName);
diy::load(bb, data);
field =
vtkm::cont::Field(name, assoc, assocCellSetName, vtkm::cont::ArrayHandleVariant(data));
vtkm::cont::Field(name, assoc, assocCellSetName, vtkm::cont::VariantArrayHandle(data));
}
else if (assoc == vtkm::cont::Field::Association::LOGICAL_DIM)
{
vtkm::IdComponent assocLogicalDim;
diy::load(bb, assocLogicalDim);
diy::load(bb, data);
field = vtkm::cont::Field(name, assoc, assocLogicalDim, vtkm::cont::ArrayHandleVariant(data));
field = vtkm::cont::Field(name, assoc, assocLogicalDim, vtkm::cont::VariantArrayHandle(data));
}
else
{
diy::load(bb, data);
field = vtkm::cont::Field(name, assoc, vtkm::cont::ArrayHandleVariant(data));
field = vtkm::cont::Field(name, assoc, vtkm::cont::VariantArrayHandle(data));
}
}
};
......
......@@ -21,8 +21,8 @@
#include <sstream>
#include <typeindex>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/VariantArrayHandle.h>
namespace vtkm
{
......@@ -31,18 +31,18 @@ namespace cont
namespace internal
{
ArrayHandleVariantContainerBase::ArrayHandleVariantContainerBase()
VariantArrayHandleContainerBase::VariantArrayHandleContainerBase()
{
}
ArrayHandleVariantContainerBase::~ArrayHandleVariantContainerBase()
VariantArrayHandleContainerBase::~VariantArrayHandleContainerBase()
{
}
}
namespace detail
{
void ThrowCastAndCallException(const vtkm::cont::internal::ArrayHandleVariantContainerBase& ref,
void ThrowCastAndCallException(const vtkm::cont::internal::VariantArrayHandleContainerBase& ref,
const std::type_info& type)
{
std::ostringstream out;
......
......@@ -23,7 +23,7 @@ set(headers
ArrayHandleBasicImpl.h
ArrayHandleBasicImpl.hxx
ArrayHandleExecutionManager.h
ArrayHandleVariantContainer.h
VariantArrayHandleContainer.h
ArrayManagerExecution.h
ArrayManagerExecutionShareWithControl.h
ArrayPortalFromIterators.h
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_cont_ArrayHandleVariantContainer_h
#define vtk_m_cont_ArrayHandleVariantContainer_h
#ifndef vtk_m_cont_VariantArrayHandleContainer_h
#define vtk_m_cont_VariantArrayHandleContainer_h
#include <vtkm/cont/vtkm_cont_export.h>
......@@ -38,19 +38,19 @@ namespace cont
// Forward declaration needed for GetContainer
template <typename TypeList>
class ArrayHandleVariantBase;
class VariantArrayHandleBase;
namespace internal
{
/// \brief Base class for ArrayHandleVariantContainer
/// \brief Base class for VariantArrayHandleContainer
///
struct VTKM_CONT_EXPORT ArrayHandleVariantContainerBase
struct VTKM_CONT_EXPORT VariantArrayHandleContainerBase
{
ArrayHandleVariantContainerBase();
VariantArrayHandleContainerBase();
// This must exist so that subclasses are destroyed correctly.
virtual ~ArrayHandleVariantContainerBase();
virtual ~VariantArrayHandleContainerBase();
virtual vtkm::Id GetNumberOfValues() const = 0;
virtual vtkm::IdComponent GetNumberOfComponents() const = 0;
......@@ -60,35 +60,35 @@ struct VTKM_CONT_EXPORT ArrayHandleVariantContainerBase
virtual void PrintSummary(std::ostream& out) const = 0;
virtual std::shared_ptr<ArrayHandleVariantContainerBase> NewInstance() const = 0;
virtual std::shared_ptr<VariantArrayHandleContainerBase> NewInstance() const = 0;
virtual const vtkm::cont::StorageVirtual* GetStorage() const = 0;
};
/// \brief ArrayHandle container that can use C++ run-time type information.
///
/// The \c ArrayHandleVariantContainer is similar to the
/// The \c VariantArrayHandleContainer is similar to the
/// \c SimplePolymorphicContainer in that it can contain an object of an
/// unknown type. However, this class specifically holds ArrayHandle objects
/// (with different template parameters) so that it can polymorphically answer
/// simple questions about the object.
///
template <typename T>
struct VTKM_ALWAYS_EXPORT ArrayHandleVariantContainer final : public ArrayHandleVariantContainerBase
struct VTKM_ALWAYS_EXPORT VariantArrayHandleContainer final : public VariantArrayHandleContainerBase
{
vtkm::cont::ArrayHandleVirtual<T> Array;
ArrayHandleVariantContainer()
VariantArrayHandleContainer()
: Array()
{
}
ArrayHandleVariantContainer(const vtkm::cont::ArrayHandleVirtual<T>& array)
VariantArrayHandleContainer(const vtkm::cont::ArrayHandleVirtual<T>& array)
: Array(array)
{
}
~ArrayHandleVariantContainer<T>() = default;
~VariantArrayHandleContainer<T>() = default;
vtkm::Id GetNumberOfValues() const { return this->Array.GetNumberOfValues(); }
......@@ -103,9 +103,9 @@ struct VTKM_ALWAYS_EXPORT ArrayHandleVariantContainer final : public ArrayHandle
vtkm::cont::printSummary_ArrayHandle(this->Array, out);
}
std::shared_ptr<ArrayHandleVariantContainerBase> NewInstance() const
std::shared_ptr<VariantArrayHandleContainerBase> NewInstance() const
{
return std::make_shared<ArrayHandleVariantContainer<T>>(this->Array.NewInstance());
return std::make_shared<VariantArrayHandleContainer<T>>(this->Array.NewInstance());
}
const vtkm::cont::StorageVirtual* GetStorage() const { return this->Array.GetStorage(); }
......@@ -116,21 +116,21 @@ namespace variant
// One instance of a template class cannot access the private members of
// another instance of a template class. However, I want to be able to copy
// construct a ArrayHandleVariant from another ArrayHandleVariant of any other
// construct a VariantArrayHandle from another VariantArrayHandle of any other
// type. Since you cannot partially specialize friendship, use this accessor
// class to get at the internals for the copy constructor.
struct GetContainer
{
template <typename TypeList>
VTKM_CONT static const std::shared_ptr<ArrayHandleVariantContainerBase>& Extract(
const vtkm::cont::ArrayHandleVariantBase<TypeList>& src)
VTKM_CONT static const std::shared_ptr<VariantArrayHandleContainerBase>& Extract(
const vtkm::cont::VariantArrayHandleBase<TypeList>& src)
{
return src.ArrayContainer;
}
};
template <typename ArrayHandleType>
VTKM_CONT bool IsType(const ArrayHandleVariantContainerBase* container)
VTKM_CONT bool IsType(const VariantArrayHandleContainerBase* container)
{ //container could be nullptr
VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
if (!container)
......@@ -145,20 +145,20 @@ VTKM_CONT bool IsType(const ArrayHandleVariantContainerBase* container)
}
template <typename T>
VTKM_CONT bool IsVirtualType(const ArrayHandleVariantContainerBase* container)
VTKM_CONT bool IsVirtualType(const VariantArrayHandleContainerBase* container)
{
if (container == nullptr)
{ //you can't use typeid on nullptr of polymorphic types
return false;
}
return typeid(ArrayHandleVariantContainer<T>) == typeid(*container);
return typeid(VariantArrayHandleContainer<T>) == typeid(*container);
}
template <typename T, typename S>
struct VTKM_ALWAYS_EXPORT Caster
{
vtkm::cont::ArrayHandle<T, S> operator()(const ArrayHandleVariantContainerBase* container) const
vtkm::cont::ArrayHandle<T, S> operator()(const VariantArrayHandleContainerBase* container) const
{
using ArrayHandleType = vtkm::cont::ArrayHandle<T, S>;
if (!IsType<ArrayHandleType>(container))
......@@ -180,7 +180,7 @@ template <typename T>
struct VTKM_ALWAYS_EXPORT Caster<T, vtkm::cont::StorageTagVirtual>
{
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagVirtual> operator()(
const ArrayHandleVariantContainerBase* container) const
const VariantArrayHandleContainerBase* container) const
{
if (!IsVirtualType<T>(container))
{
......@@ -192,7 +192,7 @@ struct VTKM_ALWAYS_EXPORT Caster<T, vtkm::cont::StorageTagVirtual>
// Technically, this method returns a copy of the \c ArrayHandle. But
// because \c ArrayHandle acts like a shared pointer, it is valid to
// do the copy.
const auto* derived = static_cast<const ArrayHandleVariantContainer<T>*>(container);
const auto* derived = static_cast<const VariantArrayHandleContainer<T>*>(container);
VTKM_LOG_CAST_SUCC(container, derived->Array);
return derived->Array;
}
......@@ -200,7 +200,7 @@ struct VTKM_ALWAYS_EXPORT Caster<T, vtkm::cont::StorageTagVirtual>
template <typename ArrayHandleType>
VTKM_CONT ArrayHandleType Cast(const ArrayHandleVariantContainerBase* container)
VTKM_CONT ArrayHandleType Cast(const VariantArrayHandleContainerBase* container)
{ //container could be nullptr
VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
using Type = typename ArrayHandleType::ValueType;
......
......@@ -55,7 +55,7 @@ set(unit_tests
UnitTestArrayHandleTransform.cxx
UnitTestArrayHandleUniformPointCoordinates.cxx
UnitTestArrayHandleConcatenate.cxx
UnitTestArrayHandleVariant.cxx
UnitTestVariantArrayHandle.cxx
UnitTestArrayPortalToIterators.cxx
UnitTestCellLocator.cxx
UnitTestCellSetExplicit.cxx
......
......@@ -27,11 +27,11 @@
#include <vtkm/thirdparty/diy/Configure.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/CellSetExplicit.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/VariantArrayHandle.h>
// clang-format off
......@@ -219,7 +219,7 @@ struct TestEqualArrayHandle
template <typename T, typename StorageTag, typename TypeList>
VTKM_CONT void operator()(
const vtkm::cont::ArrayHandle<T, StorageTag>& array1,
const vtkm::cont::ArrayHandleVariantBase<TypeList>& array2,
const vtkm::cont::VariantArrayHandleBase<TypeList>& array2,
TestEqualResult& result) const
{
array2.CastAndCall(*this, array1, result);
......@@ -227,7 +227,7 @@ struct TestEqualArrayHandle
template <typename T, typename StorageTag, typename TypeList>
VTKM_CONT void operator()(
const vtkm::cont::ArrayHandleVariantBase<TypeList>& array1,
const vtkm::cont::VariantArrayHandleBase<TypeList>& array1,
const vtkm::cont::ArrayHandle<T, StorageTag>& array2,
TestEqualResult& result) const
{
......@@ -236,8 +236,8 @@ struct TestEqualArrayHandle
template <typename TypeList1, typename TypeList2>
VTKM_CONT void operator()(
const vtkm::cont::ArrayHandleVariantBase<TypeList1>& array1,
const vtkm::cont::ArrayHandleVariantBase<TypeList2>& array2,
const vtkm::cont::VariantArrayHandleBase<TypeList1>& array1,
const vtkm::cont::VariantArrayHandleBase<TypeList2>& array2,
TestEqualResult& result) const
{
array2.CastAndCall(*this, array1, result);
......
......@@ -21,7 +21,7 @@
#define vtk_m_cont_testing_TestingSerialization_h
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/VariantArrayHandle.h>
#include <vtkm/cont/testing/Testing.h>