2018-11-06 16:24:59 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2018-11-06 16:24:59 +00:00
|
|
|
// 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.
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
#include <typeindex>
|
|
|
|
|
|
|
|
#include <vtkm/cont/ErrorBadValue.h>
|
2019-04-17 17:59:49 +00:00
|
|
|
#include <vtkm/cont/internal/VariantArrayHandleContainer.h>
|
2018-11-06 16:24:59 +00:00
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
|
|
|
namespace internal
|
|
|
|
{
|
|
|
|
|
2018-12-11 13:56:08 +00:00
|
|
|
VariantArrayHandleContainerBase::VariantArrayHandleContainerBase()
|
2019-03-15 20:47:32 +00:00
|
|
|
: TypeIndex(typeid(nullptr))
|
2019-01-08 14:37:20 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-03-15 20:47:32 +00:00
|
|
|
VariantArrayHandleContainerBase::VariantArrayHandleContainerBase(const std::type_info& typeinfo)
|
|
|
|
: TypeIndex(typeinfo)
|
2018-11-06 16:24:59 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-12-11 13:56:08 +00:00
|
|
|
VariantArrayHandleContainerBase::~VariantArrayHandleContainerBase()
|
2018-11-06 16:24:59 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace detail
|
|
|
|
{
|
2019-04-17 17:59:49 +00:00
|
|
|
VTKM_CONT_EXPORT void ThrowCastAndCallException(
|
|
|
|
const vtkm::cont::internal::VariantArrayHandleContainerBase& ref,
|
|
|
|
const std::type_info& type)
|
2018-11-06 16:24:59 +00:00
|
|
|
{
|
|
|
|
std::ostringstream out;
|
|
|
|
out << "Could not find appropriate cast for array in CastAndCall1.\n"
|
|
|
|
"Array: ";
|
|
|
|
ref.PrintSummary(out);
|
|
|
|
out << "TypeList: " << type.name() << "\n";
|
|
|
|
throw vtkm::cont::ErrorBadValue(out.str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::cont::detail
|