Commit be8d2a8e authored by David Gobbi's avatar David Gobbi

Simplify template macros in vtkPythonArgs

parent 3edd29cc
Pipeline #25732 passed with stage
......@@ -22,7 +22,7 @@ resulting in wrapper code that is faster and more compact.
-----------------------------------------------------------------------*/
// Keep vtkPythonArgs.h from declaring externs for templates we instantiate
#define VTK_PYTHON_ARGS_CXX
#define vtkPythonArgs_cxx
#include "vtkPythonArgs.h"
#include "vtkPythonUtil.h"
......@@ -1380,10 +1380,6 @@ vtkPythonArgs::Array<T>::Array(Py_ssize_t n) : Pointer(0)
}
// Instantiate the Array class template over all types:
#define vtkForPythonArrayTypeMacro(type) \
template class VTKWRAPPINGPYTHONCORE_EXPORT vtkPythonArgs::Array<type>;
vtkExpandForPythonArrayTypesMacro()
#undef vtkForPythonArrayTypeMacro
vtkPythonArgsTemplateMacro(
template class VTKWRAPPINGPYTHONCORE_EXPORT vtkPythonArgs::Array
)
......@@ -807,32 +807,27 @@ PyObject *vtkPythonArgs::BuildBytes(const char *a, int n)
// List of all types for the Array class template:
#define vtkExpandForPythonArrayTypesMacro() \
vtkForPythonArrayTypeMacro(bool) \
vtkForPythonArrayTypeMacro(float) \
vtkForPythonArrayTypeMacro(double) \
vtkForPythonArrayTypeMacro(char) \
vtkForPythonArrayTypeMacro(signed char) \
vtkForPythonArrayTypeMacro(unsigned char) \
vtkForPythonArrayTypeMacro(short) \
vtkForPythonArrayTypeMacro(unsigned short) \
vtkForPythonArrayTypeMacro(int) \
vtkForPythonArrayTypeMacro(unsigned int) \
vtkForPythonArrayTypeMacro(long) \
vtkForPythonArrayTypeMacro(unsigned long) \
vtkForPythonArrayTypeMacro(long long) \
vtkForPythonArrayTypeMacro(unsigned long long)
#define vtkPythonArgsTemplateMacro(decl) \
decl<bool>; \
decl<float>; \
decl<double>; \
decl<char>; \
decl<signed char>; \
decl<unsigned char>; \
decl<short>; \
decl<unsigned short>; \
decl<int>; \
decl<unsigned int>; \
decl<long>; \
decl<unsigned long>; \
decl<long long>; \
decl<unsigned long long>;
// Forward declare the Array class template over all types:
#if defined(VTK_USE_EXTERN_TEMPLATE) && !defined(VTK_PYTHON_ARGS_CXX)
#define vtkForPythonArrayTypeMacro(type) \
extern template class vtkPythonArgs::Array<type>;
vtkExpandForPythonArrayTypesMacro()
#undef vtkForPythonArrayTypeMacro
#if defined(VTK_USE_EXTERN_TEMPLATE) && !defined(vtkPythonArgs_cxx)
vtkPythonArgsTemplateMacro(
extern template class VTKWRAPPINGPYTHONCORE_EXPORT vtkPythonArgs::Array
)
#endif
#endif
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