Skip to content

Commit 626fedd

Browse files
committed
style(itk-wasm): Add itkVirtualGetNameOfClassMacro + itkOverrideGetNameOfClassMacro
Added two new macro's, intended to replace the old 'itkTypeMacro' and 'itkTypeMacroNoParent'. The main aim is to be clearer about what those macro's do: add a virtual 'GetNameOfClass()' member function and override it. Unlike 'itkTypeMacro', 'itkOverrideGetNameOfClassMacro' does not have a 'superclass' parameter, as it was not used anyway. Note that originally 'itkTypeMacro' did not use its 'superclass' parameter either, looking at commit 699b66cb04d410e555656828e8892107add38ccb, Will Schroeder, June 27, 2001: https://github.com/InsightSoftwareConsortium/ITK/blob/699b66cb04d410e555656828e8892107add38ccb/Code/Common/itkMacro.h#L331-L337
1 parent 182501a commit 626fedd

32 files changed

+32
-32
lines changed

include/itkImageToWasmImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ITK_TEMPLATE_EXPORT ImageToWasmImageFilter : public ProcessObject
4545
itkNewMacro(Self);
4646

4747
/** Run-time type information (and related methods). */
48-
itkTypeMacro(ImageToWasmImageFilter, ProcessObject);
48+
itkOverrideGetNameOfClassMacro(ImageToWasmImageFilter);
4949

5050
using DataObjectIdentifierType = Superclass::DataObjectIdentifierType;
5151
using DataObjectPointerArraySizeType = Superclass::DataObjectPointerArraySizeType;

include/itkImportVectorImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ITK_TEMPLATE_EXPORT ImportVectorImageFilter : public ImageSource<TOutputIm
6464
itkNewMacro(Self);
6565

6666
/** Run-time type information (and related methods). */
67-
itkTypeMacro(ImportVectorImageFilter, ImageSource);
67+
itkOverrideGetNameOfClassMacro(ImportVectorImageFilter);
6868

6969
/** Index type alias support An index is used to access pixel values. */
7070
using IndexType = Index<OutputImageType::ImageDimension>;

include/itkMeshToWasmMeshFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ITK_TEMPLATE_EXPORT MeshToWasmMeshFilter : public ProcessObject
4747
itkNewMacro(Self);
4848

4949
/** Run-time type information (and related methods). */
50-
itkTypeMacro(MeshToWasmMeshFilter, ProcessObject);
50+
itkOverrideGetNameOfClassMacro(MeshToWasmMeshFilter);
5151

5252
using DataObjectIdentifierType = Superclass::DataObjectIdentifierType;
5353
using DataObjectPointerArraySizeType = Superclass::DataObjectPointerArraySizeType;

include/itkPointSetToWasmPointSetFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ITK_TEMPLATE_EXPORT PointSetToWasmPointSetFilter : public ProcessObject
4545
itkNewMacro(Self);
4646

4747
/** Run-time type information (and related methods). */
48-
itkTypeMacro(PointSetToWasmPointSetFilter, ProcessObject);
48+
itkOverrideGetNameOfClassMacro(PointSetToWasmPointSetFilter);
4949

5050
using DataObjectIdentifierType = Superclass::DataObjectIdentifierType;
5151
using DataObjectPointerArraySizeType = Superclass::DataObjectPointerArraySizeType;

include/itkPolyDataToWasmPolyDataFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ITK_TEMPLATE_EXPORT PolyDataToWasmPolyDataFilter : public ProcessObject
4545
itkNewMacro(Self);
4646

4747
/** Run-time type information (and related methods). */
48-
itkTypeMacro(PolyDataToWasmPolyDataFilter, ProcessObject);
48+
itkOverrideGetNameOfClassMacro(PolyDataToWasmPolyDataFilter);
4949

5050
using DataObjectIdentifierType = Superclass::DataObjectIdentifierType;
5151
using DataObjectPointerArraySizeType = Superclass::DataObjectPointerArraySizeType;

include/itkTransformToWasmTransformFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ITK_TEMPLATE_EXPORT TransformToWasmTransformFilter : public ProcessObject
4747
itkNewMacro(Self);
4848

4949
/** Run-time type information (and related methods). */
50-
itkTypeMacro(TransformToWasmTransformFilter, ProcessObject);
50+
itkOverrideGetNameOfClassMacro(TransformToWasmTransformFilter);
5151

5252
using DataObjectIdentifierType = Superclass::DataObjectIdentifierType;
5353
using DataObjectPointerArraySizeType = Superclass::DataObjectPointerArraySizeType;

include/itkWasmDataObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class WebAssemblyInterface_EXPORT WasmDataObject : public DataObject
4343
using Pointer = SmartPointer<Self>;
4444
using ConstPointer = SmartPointer<const Self>;
4545
itkNewMacro(Self);
46-
itkTypeMacro(WasmDataObject, DataObject);
46+
itkOverrideGetNameOfClassMacro(WasmDataObject);
4747

4848
/** Get/Set the DataObject JSON representation. */
4949
itkSetStringMacro(JSON);

include/itkWasmImage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ITK_TEMPLATE_EXPORT WasmImage : public WasmDataObject
5151

5252
itkNewMacro(Self);
5353
/** Run-time type information (and related methods). */
54-
itkTypeMacro(WasmImage, WasmDataObject);
54+
itkOverrideGetNameOfClassMacro(WasmImage);
5555

5656
using ImageType = TImage;
5757

include/itkWasmImageIO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class WebAssemblyInterface_EXPORT WasmImageIO: public StreamingImageIOBase
5151
itkNewMacro(Self);
5252

5353
/** Run-time type information (and related methods). */
54-
itkTypeMacro(WasmImageIO, StreamingImageIOBase);
54+
itkOverrideGetNameOfClassMacro(WasmImageIO);
5555

5656
/** The different types of ImageIO's can support data of varying
5757
* dimensionality. For example, some file formats are strictly 2D

include/itkWasmImageIOFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class WebAssemblyInterface_EXPORT WasmImageIOFactory: public ObjectFactoryBase
4848
itkFactorylessNewMacro(Self);
4949

5050
/** Run-time type information (and related methods). */
51-
itkTypeMacro(WasmImageIOFactory, ObjectFactoryBase);
51+
itkOverrideGetNameOfClassMacro(WasmImageIOFactory);
5252

5353
/** Register one factory of this type */
5454
static void RegisterOneFactory(void)

0 commit comments

Comments
 (0)