Commit a1a94d0c authored by David Gobbi's avatar David Gobbi Committed by Kitware Robot
Browse files

Merge topic 'extern-template'

e7b9d312 Add extern template decls for vtkArrayIterator
31a63a45 Simplify extern template declarations for arrays
ff7ce07d Simplify extern template declaration
be8d2a8e

 Simplify template macros in vtkPythonArgs
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !1904
parents 7a18dbd8 e7b9d312
Pipeline #25869 failed with stage
in 0 seconds
...@@ -156,6 +156,7 @@ SET(Module_SRCS ...@@ -156,6 +156,7 @@ SET(Module_SRCS
vtkArrayExtentsList.cxx vtkArrayExtentsList.cxx
vtkArrayIterator.cxx vtkArrayIterator.cxx
vtkArrayIteratorTemplate.txx vtkArrayIteratorTemplate.txx
vtkArrayIteratorTemplateInstantiate.cxx
vtkArrayRange.cxx vtkArrayRange.cxx
vtkArraySort.cxx vtkArraySort.cxx
vtkArrayWeights.cxx vtkArrayWeights.cxx
...@@ -584,6 +585,7 @@ set_source_files_properties( ...@@ -584,6 +585,7 @@ set_source_files_properties(
vtkArrayExtents.cxx vtkArrayExtents.cxx
vtkArrayExtentsList.cxx vtkArrayExtentsList.cxx
vtkArrayIteratorTemplate.txx vtkArrayIteratorTemplate.txx
vtkArrayIteratorTemplateInstantiate.cxx
vtkArrayRange.cxx vtkArrayRange.cxx
vtkArraySort.cxx vtkArraySort.cxx
vtkArrayWeights.cxx vtkArrayWeights.cxx
...@@ -621,7 +623,6 @@ set_source_files_properties( ...@@ -621,7 +623,6 @@ set_source_files_properties(
vtkArrayIteratorIncludes.h vtkArrayIteratorIncludes.h
vtkArrayIteratorTemplate.h vtkArrayIteratorTemplate.h
vtkArrayIteratorTemplateImplicit.txx vtkArrayIteratorTemplateImplicit.txx
vtkArrayIteratorTemplate.txx
vtkArrayPrint.h vtkArrayPrint.h
vtkArrayPrint.txx vtkArrayPrint.txx
vtkAtomicTypeConcepts.h vtkAtomicTypeConcepts.h
...@@ -670,6 +671,7 @@ set_source_files_properties( ...@@ -670,6 +671,7 @@ set_source_files_properties(
set_source_files_properties( set_source_files_properties(
vtkABI.h vtkABI.h
vtkAOSDataArrayTemplate.txx vtkAOSDataArrayTemplate.txx
vtkArrayIteratorTemplateInstantiate.cxx
vtkAtomic.h vtkAtomic.h
vtkAutoInit.h vtkAutoInit.h
vtkIOStream.cxx vtkIOStream.cxx
...@@ -704,6 +706,7 @@ set_source_files_properties( ...@@ -704,6 +706,7 @@ set_source_files_properties(
) )
set_source_files_properties( set_source_files_properties(
vtkArrayIteratorTemplateInstantiate.cxx # Has no header
vtkSOADataArrayTemplateInstantiate.cxx # Has no header vtkSOADataArrayTemplateInstantiate.cxx # Has no header
PROPERTIES SKIP_HEADER_INSTALL 1 PROPERTIES SKIP_HEADER_INSTALL 1
) )
......
...@@ -226,9 +226,6 @@ private: ...@@ -226,9 +226,6 @@ private:
// Declare vtkArrayDownCast implementations for AoS containers: // Declare vtkArrayDownCast implementations for AoS containers:
vtkArrayDownCast_TemplateFastCastMacro(vtkAOSDataArrayTemplate) vtkArrayDownCast_TemplateFastCastMacro(vtkAOSDataArrayTemplate)
# define VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
template class VTKCOMMONCORE_EXPORT vtkAOSDataArrayTemplate< T >
// This macro is used by the subclasses to create dummy // This macro is used by the subclasses to create dummy
// declarations for these functions such that the wrapper // declarations for these functions such that the wrapper
// can see them. The wrappers ignore vtkAOSDataArrayTemplate. // can see them. The wrappers ignore vtkAOSDataArrayTemplate.
...@@ -264,9 +261,27 @@ vtkArrayDownCast_TemplateFastCastMacro(vtkAOSDataArrayTemplate) ...@@ -264,9 +261,27 @@ vtkArrayDownCast_TemplateFastCastMacro(vtkAOSDataArrayTemplate)
// libraries other than vtkCommonCore that instantiations of // libraries other than vtkCommonCore that instantiations of
// vtkAOSDataArrayTemplate can be found externally. This prevents each library // vtkAOSDataArrayTemplate can be found externally. This prevents each library
// from instantiating these on their own. // from instantiating these on their own.
#ifndef VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATING #ifdef VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATING
#if defined(VTK_BUILD_SHARED_LIBS) #define VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
#if defined(_MSC_VER) template class VTKCOMMONCORE_EXPORT vtkAOSDataArrayTemplate< T >
#elif defined(VTK_USE_EXTERN_TEMPLATE)
#ifndef VTK_AOS_DATA_ARRAY_TEMPLATE_EXTERN
#define VTK_AOS_DATA_ARRAY_TEMPLATE_EXTERN
#ifdef _MSC_VER
#pragma warning (push)
// The following is needed when the vtkAOSDataArrayTemplate is declared
// dllexport and is used from another class in vtkCommonCore
#pragma warning (disable: 4910) // extern and dllexport incompatible
#endif
vtkExternTemplateMacro(
extern template class VTKCOMMONCORE_EXPORT vtkAOSDataArrayTemplate)
#ifdef _MSC_VER
#pragma warning (pop)
#endif
#endif // VTK_AOS_DATA_ARRAY_TEMPLATE_EXTERN
// The following clause is only for MSVC 2008 and 2010
#elif defined(_MSC_VER) && !defined(VTK_BUILD_SHARED_LIBS)
#pragma warning (push) #pragma warning (push)
// C4091: 'extern ' : ignored on left of 'int' when no variable is declared // C4091: 'extern ' : ignored on left of 'int' when no variable is declared
...@@ -290,37 +305,11 @@ vtkArrayDownCast_TemplateFastCastMacro(vtkAOSDataArrayTemplate) ...@@ -290,37 +305,11 @@ vtkArrayDownCast_TemplateFastCastMacro(vtkAOSDataArrayTemplate)
// Use an "extern explicit instantiation" to give the class a DLL // Use an "extern explicit instantiation" to give the class a DLL
// interface. This is a compiler-specific extension. // interface. This is a compiler-specific extension.
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(char); vtkInstantiateTemplateMacro(
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(double); extern template class VTKCOMMONCORE_EXPORT vtkAOSDataArrayTemplate)
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(float);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(int);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(long);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(long long);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(short);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(signed char);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned char);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned int);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned long);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned long long);
extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned short);
#pragma warning (pop) #pragma warning (pop)
#elif defined(VTK_USE_EXTERN_TEMPLATE)
extern template class vtkAOSDataArrayTemplate<char>; #endif
extern template class vtkAOSDataArrayTemplate<double>;
extern template class vtkAOSDataArrayTemplate<float>;
extern template class vtkAOSDataArrayTemplate<int>;
extern template class vtkAOSDataArrayTemplate<long>;
extern template class vtkAOSDataArrayTemplate<long long>;
extern template class vtkAOSDataArrayTemplate<short>;
extern template class vtkAOSDataArrayTemplate<signed char>;
extern template class vtkAOSDataArrayTemplate<unsigned char>;
extern template class vtkAOSDataArrayTemplate<unsigned int>;
extern template class vtkAOSDataArrayTemplate<unsigned long>;
extern template class vtkAOSDataArrayTemplate<unsigned long long>;
extern template class vtkAOSDataArrayTemplate<unsigned short>;
#endif // _MSC_VER
#endif // VTK_BUILD_SHARED_LIBS
#endif // VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATING
// VTK-HeaderTest-Exclude: vtkAOSDataArrayTemplate.h // VTK-HeaderTest-Exclude: vtkAOSDataArrayTemplate.h
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#include "vtkArrayIteratorTemplate.h" #include "vtkArrayIteratorTemplate.h"
#include "vtkBitArrayIterator.h" #include "vtkBitArrayIterator.h"
// DataTypes for Iterators.
#include "vtkStdString.h"
#endif #endif
// VTK-HeaderTest-Exclude: vtkArrayIteratorIncludes.h // VTK-HeaderTest-Exclude: vtkArrayIteratorIncludes.h
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
#include "vtkCommonCoreModule.h" // For export macro #include "vtkCommonCoreModule.h" // For export macro
#include "vtkArrayIterator.h" #include "vtkArrayIterator.h"
#include "vtkStdString.h" // For template instantiation
#include "vtkUnicodeString.h" // For template instantiation
#include "vtkVariant.h" // For template instantiation
template <class T> template <class T>
class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate : public vtkArrayIterator class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate : public vtkArrayIterator
{ {
...@@ -101,26 +105,28 @@ private: ...@@ -101,26 +105,28 @@ private:
vtkAbstractArray* Array; vtkAbstractArray* Array;
}; };
#define VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(T) \ #ifdef VTK_USE_EXTERN_TEMPLATE
template class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate< T > #ifndef vtkArrayIteratorTemplateInstantiate_cxx
#ifdef _MSC_VER
#endif // !defined(vtkArrayIteratorTemplate_h) #pragma warning (push)
// The following is needed when the vtkArrayIteratorTemplate is declared
// This portion must be OUTSIDE the include blockers. Each // dllexport and is used from another class in vtkCommonCore
// vtkArrayIteratorTemplate subclass uses this to give its instantiation #pragma warning (disable: 4910) // extern and dllexport incompatible
// of this template a DLL interface. #endif
#if defined(VTK_ARRAY_ITERATOR_TEMPLATE_TYPE) vtkInstantiateTemplateMacro(
# if defined(VTK_BUILD_SHARED_LIBS) && defined(_MSC_VER) extern template class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate)
# pragma warning (push) extern template class VTKCOMMONCORE_EXPORT
# pragma warning (disable: 4091) // warning C4091: 'extern ' : vtkArrayIteratorTemplate<vtkStdString>;
// ignored on left of 'int' when no variable is declared extern template class VTKCOMMONCORE_EXPORT
# pragma warning (disable: 4231) // Compiler-specific extension warning. vtkArrayIteratorTemplate<vtkUnicodeString>;
// Use an "extern explicit instantiation" to give the class a DLL extern template class VTKCOMMONCORE_EXPORT
// interface. This is a compiler-specific extension. vtkArrayIteratorTemplate<vtkVariant>;
extern VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(VTK_ARRAY_ITERATOR_TEMPLATE_TYPE); #ifdef _MSC_VER
# pragma warning (pop) #pragma warning (pop)
# endif #endif
# undef VTK_ARRAY_ITERATOR_TEMPLATE_TYPE #endif
#endif // VTK_USE_EXTERN_TEMPLATE
#endif #endif
// VTK-HeaderTest-Exclude: vtkArrayIteratorTemplate.h // VTK-HeaderTest-Exclude: vtkArrayIteratorTemplate.h
/*=========================================================================
Program: Visualization Toolkit
Module: vtkArrayIteratorTemplateInstantiate.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#define vtkArrayIteratorTemplateInstantiate_cxx
#include "vtkArrayIteratorTemplate.txx"
vtkInstantiateTemplateMacro(
template class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate)
template class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate<vtkStdString>;
template class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate<vtkUnicodeString>;
template class VTKCOMMONCORE_EXPORT vtkArrayIteratorTemplate<vtkVariant>;
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(char); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(char);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(char);
#include "vtkCharArray.h" #include "vtkCharArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
/** extern template declarations for C++11 /** extern template declarations for C++11
*/ */
#if __cplusplus >= 201103L && !defined(_MSC_VER) && !defined(__MINGW32__) #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1700)
#define VTK_USE_EXTERN_TEMPLATE #define VTK_USE_EXTERN_TEMPLATE
#endif #endif
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(double); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(double);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(double);
#include "vtkDoubleArray.h" #include "vtkDoubleArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(float); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(float);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(float);
#include "vtkFloatArray.h" #include "vtkFloatArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
// #define VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATING // #define VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATING
// #include "vtkAOSDataArrayTemplate.txx" // #include "vtkAOSDataArrayTemplate.txx"
// VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(vtkIdType); // VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(vtkIdType);
// #include "vtkArrayIteratorTemplate.txx"
// VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(vtkIdType);
#include "vtkIdTypeArray.h" #include "vtkIdTypeArray.h"
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(int); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(int);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(int);
#include "vtkIntArray.h" #include "vtkIntArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(long); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(long);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(long);
#include "vtkLongArray.h" #include "vtkLongArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(long long); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(long long);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(long long);
#include "vtkLongLongArray.h" #include "vtkLongLongArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -211,18 +211,33 @@ private: ...@@ -211,18 +211,33 @@ private:
// Declare vtkArrayDownCast implementations for SoA containers: // Declare vtkArrayDownCast implementations for SoA containers:
vtkArrayDownCast_TemplateFastCastMacro(vtkSOADataArrayTemplate) vtkArrayDownCast_TemplateFastCastMacro(vtkSOADataArrayTemplate)
# define VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
template class VTKCOMMONCORE_EXPORT vtkSOADataArrayTemplate< T >
#endif // header guard #endif // header guard
// This portion must be OUTSIDE the include blockers. This is used to tell // This portion must be OUTSIDE the include blockers. This is used to tell
// libraries other than vtkCommonCore that instantiations of // libraries other than vtkCommonCore that instantiations of
// vtkSOADataArrayTemplate can be found externally. This prevents each library // vtkSOADataArrayTemplate can be found externally. This prevents each library
// from instantiating these on their own. // from instantiating these on their own.
#ifndef VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATING #ifdef VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATING
#if defined(VTK_BUILD_SHARED_LIBS) #define VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
#if defined(_MSC_VER) template class VTKCOMMONCORE_EXPORT vtkSOADataArrayTemplate< T >
#elif defined(VTK_USE_EXTERN_TEMPLATE)
#ifndef VTK_SOA_DATA_ARRAY_TEMPLATE_EXTERN
#define VTK_SOA_DATA_ARRAY_TEMPLATE_EXTERN
#ifdef _MSC_VER
#pragma warning (push)
// The following is needed when the vtkSOADataArrayTemplate is declared
// dllexport and is used from another class in vtkCommonCore
#pragma warning (disable: 4910) // extern and dllexport incompatible
#endif
vtkExternTemplateMacro(
extern template class VTKCOMMONCORE_EXPORT vtkSOADataArrayTemplate)
#ifdef _MSC_VER
#pragma warning (pop)
#endif
#endif // VTK_SOA_DATA_ARRAY_TEMPLATE_EXTERN
// The following clause is only for MSVC 2008 and 2010
#elif defined(_MSC_VER) && !defined(VTK_BUILD_SHARED_LIBS)
#pragma warning (push) #pragma warning (push)
// C4091: 'extern ' : ignored on left of 'int' when no variable is declared // C4091: 'extern ' : ignored on left of 'int' when no variable is declared
...@@ -246,37 +261,11 @@ vtkArrayDownCast_TemplateFastCastMacro(vtkSOADataArrayTemplate) ...@@ -246,37 +261,11 @@ vtkArrayDownCast_TemplateFastCastMacro(vtkSOADataArrayTemplate)
// Use an "extern explicit instantiation" to give the class a DLL // Use an "extern explicit instantiation" to give the class a DLL
// interface. This is a compiler-specific extension. // interface. This is a compiler-specific extension.
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(char); vtkInstantiateTemplateMacro(
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(double); extern template class VTKCOMMONCORE_EXPORT vtkSOADataArrayTemplate)
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(float);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(int);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(long);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(long long);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(short);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(signed char);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned char);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned int);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned long);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned long long);
extern VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned short);
#pragma warning (pop) #pragma warning (pop)
#elif defined(VTK_USE_EXTERN_TEMPLATE)
extern template class vtkSOADataArrayTemplate<char>; #endif
extern template class vtkSOADataArrayTemplate<double>;
extern template class vtkSOADataArrayTemplate<float>;
extern template class vtkSOADataArrayTemplate<int>;
extern template class vtkSOADataArrayTemplate<long>;
extern template class vtkSOADataArrayTemplate<long long>;
extern template class vtkSOADataArrayTemplate<short>;
extern template class vtkSOADataArrayTemplate<signed char>;
extern template class vtkSOADataArrayTemplate<unsigned char>;
extern template class vtkSOADataArrayTemplate<unsigned int>;
extern template class vtkSOADataArrayTemplate<unsigned long>;
extern template class vtkSOADataArrayTemplate<unsigned long long>;
extern template class vtkSOADataArrayTemplate<unsigned short>;
#endif // _MSC_VER
#endif // VTK_BUILD_SHARED_LIBS
#endif // VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATING
// VTK-HeaderTest-Exclude: vtkSOADataArrayTemplate.h // VTK-HeaderTest-Exclude: vtkSOADataArrayTemplate.h
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(short); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(short);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(short);
#include "vtkShortArray.h" #include "vtkShortArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(signed char); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(signed char);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(signed char);
#include "vtkSignedCharArray.h" #include "vtkSignedCharArray.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
=========================================================================*/ =========================================================================*/
// We do not provide a definition for the copy constructor or // We do not provide a definition for the copy constructor or
// operator=. Block the warning. // operator=. Block the warning.
#ifdef _MSC_VER #ifdef _MSC_VER
...@@ -23,9 +21,6 @@ ...@@ -23,9 +21,6 @@
#include "vtkStdString.h" #include "vtkStdString.h"
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(vtkStdString);
#include "vtkStringArray.h" #include "vtkStringArray.h"
#include "vtkArrayIteratorTemplate.h" #include "vtkArrayIteratorTemplate.h"
......
...@@ -298,6 +298,4 @@ private: ...@@ -298,6 +298,4 @@ private:
}; };
#endif #endif
...@@ -320,5 +320,30 @@ inline vtkTypeBool vtkDataTypesCompare(int a, int b) ...@@ -320,5 +320,30 @@ inline vtkTypeBool vtkDataTypesCompare(int a, int b)
} }
#endif #endif
/*--------------------------------------------------------------------------*/
/** A macro to instantiate a template over all numerical types */
#define vtkInstantiateTemplateMacro(decl) \
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>;
/** A macro to declare extern templates for all numerical types */
#ifdef VTK_USE_EXTERN_TEMPLATE
#define vtkExternTemplateMacro(decl) \
vtkInstantiateTemplateMacro(decl)
#else
#define vtkExternTemplateMacro(decl)
#endif
#endif #endif
// VTK-HeaderTest-Exclude: vtkType.h // VTK-HeaderTest-Exclude: vtkType.h
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
#include "vtkUnicodeString.h" #include "vtkUnicodeString.h"
#include "vtkArrayIteratorTemplate.txx" #include "vtkArrayIteratorTemplate.h"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(vtkUnicodeString);
#include "vtkIdList.h" #include "vtkIdList.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
#include "vtkUnicodeStringArray.h" #include "vtkUnicodeStringArray.h"
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "vtkAOSDataArrayTemplate.txx" #include "vtkAOSDataArrayTemplate.txx"
VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned char); VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE(unsigned char);
#include "vtkArrayIteratorTemplate.txx"
VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(unsigned char);<