//============================================================================ // 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. //============================================================================ #ifndef vtk_m_BaseComponent_h #define vtk_m_BaseComponent_h #include #include #include namespace vtkm { namespace detail { template struct BaseComponentImpl; template struct BaseComponentImpl { private: using ComponentType = typename vtkm::VecTraits::ComponentType; public: using Type = typename BaseComponentImpl::DimensionalityTag>::Type; }; template struct BaseComponentImpl : BaseComponentImpl { }; template struct BaseComponentImpl { using Type = ScalarType; }; } // namespace detail // Finds the base component type of a Vec. If you have a Vec of Vecs, it will // descend all Vecs until you get to the scalar type. template struct BaseComponent { using Type = typename detail::BaseComponentImpl::DimensionalityTag>::Type; }; } // namespace vtkm #endif //vtk_m_BaseComponent_h