2014-10-22 21:15:14 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2014-10-22 21:15:14 +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.
|
|
|
|
//============================================================================
|
|
|
|
#ifndef vtk_m_cont_arg_TypeCheck_h
|
|
|
|
#define vtk_m_cont_arg_TypeCheck_h
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
|
|
|
namespace arg
|
|
|
|
{
|
2014-10-22 21:15:14 +00:00
|
|
|
|
|
|
|
/// \brief Class for checking that a type matches the semantics for an argument.
|
|
|
|
///
|
|
|
|
/// The \c TypeCheck class is used in dispatchers to test whether an argument
|
|
|
|
/// passed to the \c Invoke command matches the corresponding argument in the
|
|
|
|
/// \c ControlSignature.
|
|
|
|
///
|
|
|
|
/// This check happens after casting dynamic classes to static classes, so the
|
|
|
|
/// check need not worry about querying dynamic types.
|
|
|
|
///
|
|
|
|
/// The generic implementation of \c TypeCheck always results in failure. When
|
|
|
|
/// a new type check tag is defined, along with it should be partial
|
|
|
|
/// specializations that find valid types.
|
|
|
|
///
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename TypeCheckTag, typename Type>
|
2014-10-22 21:15:14 +00:00
|
|
|
struct TypeCheck
|
|
|
|
{
|
|
|
|
/// The static constant boolean \c value is set to \c true if the type is
|
|
|
|
/// valid for the given check tag and \c false otherwise.
|
|
|
|
///
|
2018-02-27 14:25:25 +00:00
|
|
|
static constexpr bool value = false;
|
2014-10-22 21:15:14 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::cont::arg
|
|
|
|
|
|
|
|
#endif //vtk_m_cont_arg_TypeCheck_h
|