Commit 7eb1e31b authored by Robert Maynard's avatar Robert Maynard

Remove vtkm::cont::DynamicArrayHandle.

parent 0a40c620
......@@ -74,7 +74,6 @@ set(headers
DeviceAdapter.h
DeviceAdapterAlgorithm.h
DeviceAdapterListTag.h
DynamicArrayHandle.h
DynamicCellSet.h
EnvironmentTracker.h
Error.h
......@@ -139,7 +138,6 @@ set(sources
DataSetBuilderExplicit.cxx
DataSetBuilderRectilinear.cxx
DataSetBuilderUniform.cxx
DynamicArrayHandle.cxx
EnvironmentTracker.cxx
ErrorBadDevice.cxx
ErrorBadType.cxx
......
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2015 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2015 UT-Battelle, LLC.
// Copyright 2015 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#include <sstream>
#include <typeindex>
#include <vtkm/cont/DynamicArrayHandle.h>
namespace vtkm
{
namespace cont
{
namespace detail
{
PolymorphicArrayHandleContainerBase::PolymorphicArrayHandleContainerBase()
{
}
PolymorphicArrayHandleContainerBase::~PolymorphicArrayHandleContainerBase()
{
}
void ThrowCastAndCallException(PolymorphicArrayHandleContainerBase* ptr,
const std::type_info* type,
const std::type_info* storage)
{
std::ostringstream out;
out << "Could not find appropriate cast for array in CastAndCall1.\n"
"Array: ";
ptr->PrintSummary(out);
out << "TypeList: " << type->name() << "\nStorageList: " << storage->name() << "\n";
throw vtkm::cont::ErrorBadValue(out.str());
}
}
}
} // namespace vtkm::cont::detail
This diff is collapsed.
......@@ -21,8 +21,8 @@
#include "vtkm/cont/internal/DynamicTransform.h"
#include "vtkm/cont/ArrayHandle.h"
#include "vtkm/cont/DynamicArrayHandle.h"
#include "vtkm/cont/DynamicCellSet.h"
#include "vtkm/cont/VariantArrayHandle.h"
#include "vtkm/internal/FunctionInterface.h"
......@@ -31,7 +31,7 @@
namespace vtkm
{
// DynamicArrayHandle requires its value type to have a defined VecTraits
// VariantArrayHandle requires its value type to have a defined VecTraits
// class. One of the tests is to use an "unusual" array of std::string
// (which is pretty pointless but might tease out some assumptions).
// Make an implementation here. Because I am lazy, this is only a partial
......@@ -71,10 +71,15 @@ struct ScalarFunctor
struct ArrayHandleScalarFunctor
{
template <typename T>
void operator()(const vtkm::cont::ArrayHandle<T>&) const
void operator()(const vtkm::cont::ArrayHandleVirtual<T>&) const
{
VTKM_TEST_FAIL("Called wrong form of functor operator.");
}
void operator()(const vtkm::cont::ArrayHandleVirtual<vtkm::FloatDefault>&) const
{
std::cout << " In ArrayHandleVirtual<Scalar> functor." << std::endl;
g_FunctionCalls++;
}
void operator()(const vtkm::cont::ArrayHandle<vtkm::FloatDefault>&) const
{
std::cout << " In ArrayHandle<Scalar> functor." << std::endl;
......@@ -84,9 +89,9 @@ struct ArrayHandleScalarFunctor
struct ArrayHandleStringFunctor
{
void operator()(const vtkm::cont::ArrayHandle<std::string>&) const
void operator()(const vtkm::cont::ArrayHandleVirtual<std::string>&) const
{
std::cout << " In ArrayHandle<string> functor." << std::endl;
std::cout << " In ArrayHandleVirtual<string> functor." << std::endl;
g_FunctionCalls++;
}
};
......@@ -121,6 +126,16 @@ struct FunctionInterfaceFunctor
std::cout << " In FunctionInterface<...> functor." << std::endl;
g_FunctionCalls++;
}
void operator()(
const vtkm::internal::FunctionInterface<void(vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandleVirtual<vtkm::FloatDefault>,
vtkm::cont::ArrayHandleVirtual<std::string>,
vtkm::cont::CellSetStructured<3>)>&) const
{
std::cout << " In FunctionInterface<...> functor." << std::endl;
g_FunctionCalls++;
}
};
void TestBasicTransform()
......@@ -138,13 +153,13 @@ void TestBasicTransform()
TRY_TRANSFORM(transform(concreteArray, ArrayHandleScalarFunctor(), indexTag));
std::cout << " Trying scalar dynamic array." << std::endl;
vtkm::cont::DynamicArrayHandle dynamicArray = concreteArray;
vtkm::cont::VariantArrayHandle dynamicArray = concreteArray;
TRY_TRANSFORM(transform(dynamicArray, ArrayHandleScalarFunctor(), indexTag));
std::cout << " Trying with unusual (string) dynamic array." << std::endl;
dynamicArray = vtkm::cont::ArrayHandle<std::string>();
TRY_TRANSFORM(transform(
dynamicArray.ResetTypeList(TypeListTagString()), ArrayHandleStringFunctor(), indexTag));
TRY_TRANSFORM(
transform(dynamicArray.ResetTypes(TypeListTagString()), ArrayHandleStringFunctor(), indexTag));
std::cout << " Trying with structured cell set." << std::endl;
vtkm::cont::CellSetStructured<3> concreteCellSet;
......@@ -171,8 +186,8 @@ void TestFunctionTransform()
TRY_TRANSFORM(
vtkm::internal::make_FunctionInterface<void>(
scalarArray,
vtkm::cont::DynamicArrayHandle(scalarArray),
vtkm::cont::DynamicArrayHandle(stringArray).ResetTypeList(TypeListTagString()),
vtkm::cont::VariantArrayHandle(scalarArray),
vtkm::cont::VariantArrayHandle(stringArray).ResetTypes(TypeListTagString()),
vtkm::cont::DynamicCellSet(structuredCellSet))
.DynamicTransformCont(vtkm::cont::internal::DynamicTransform(), FunctionInterfaceFunctor()));
}
......
......@@ -236,7 +236,7 @@ struct TestArrayHandleGroupVecVariable
vtkm::cont::make_ArrayHandle(comps));
RunTest(array);
// cannot make a DynamicArrayHandle containing ArrayHandleGroupVecVariable
// cannot make a VariantArrayHandle containing ArrayHandleGroupVecVariable
// because of the variable number of components of its values.
// RunTest(MakeTestVariantArrayHandle(array));
}
......
......@@ -21,7 +21,6 @@
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/CellSetSingleType.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorFilterExecution.h>
......
......@@ -21,7 +21,6 @@
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/CellSetSingleType.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorFilterExecution.h>
......
......@@ -21,7 +21,6 @@
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/CellSetSingleType.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorFilterExecution.h>
......
......@@ -21,7 +21,6 @@
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/CellSetSingleType.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorFilterExecution.h>
......
......@@ -21,7 +21,6 @@
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/CellSetSingleType.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorFilterExecution.h>
......
......@@ -21,7 +21,6 @@
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/CellSetSingleType.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorFilterExecution.h>
......
......@@ -24,7 +24,6 @@
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/testing/Testing.h>
#include <vtkm/filter/CleanGrid.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment