vtk-m/vtkm/source/Source.h
Robert Maynard 257dc1f84e Sources have a more consistent API and internal style.
`vtkm::source::Source` now uses virtual inheritance for
the `Execute` method. This will allow us to enforce that
all vtkm::source have a consistent calling convention.

To make the code inside filters and sources more similar the
base `vtkm::source::Source` class has a `vtkm::cont::Invoker`
as a member variable. This will allow sources to use the
`this->Invoke()` pattern that filters use to launch worklets.
2019-09-13 10:22:25 -04:00

41 lines
936 B
C++

//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_source_Source_h
#define vtk_m_source_Source_h
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Invoker.h>
#include <vtkm/source/vtkm_source_export.h>
namespace vtkm
{
namespace source
{
class VTKM_SOURCE_EXPORT Source
{
public:
VTKM_CONT
Source();
VTKM_CONT
virtual ~Source();
virtual vtkm::cont::DataSet Execute() const = 0;
protected:
vtkm::cont::Invoker Invoke;
};
} // namespace source
} // namespace vtkm
#endif // vtk_m_source_Source_h