Skip to content

Commit

Permalink
STYLE: Add itkVirtualGetNameOfClassMacro + itkOverrideGetNameOfClassM…
Browse files Browse the repository at this point in the history
…acro

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
  • Loading branch information
hjmjohnson committed Jan 26, 2025
1 parent 1054ece commit 52c4f22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/itkSCIFIOImageIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class SCIFIO_EXPORT SCIFIOImageIO : public StreamingImageIOBase
itkNewMacro(Self);

/** RTTI (and related methods) **/
itkTypeMacro(SCIFIOImageIO, Superclass);
itkOverrideGetNameOfClassMacro(SCIFIOImageIO);

bool
SupportsDimension(unsigned long dim) override;
Expand Down
2 changes: 1 addition & 1 deletion include/itkSCIFIOImageIOFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SCIFIO_EXPORT SCIFIOImageIOFactory : public ObjectFactoryBase
itkFactorylessNewMacro(Self);

/** RTTI (and related methods) **/
itkTypeMacro(SCIFIOImageIOFactory, ObjectFactoryBase);
itkOverrideGetNameOfClassMacro(SCIFIOImageIOFactory);

/** Register one factory of this type **/
static void
Expand Down

0 comments on commit 52c4f22

Please sign in to comment.