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 authored and dzenanz committed Jan 27, 2025
1 parent 6cc788b commit 457f94a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/itkSWCMeshIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class IOMeshSWC_EXPORT SWCMeshIO : public MeshIOBase
itkNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro(SWCMeshIO, MeshIOBase);
itkOverrideGetNameOfClassMacro(SWCMeshIO);

/*-------- This part of the interfaces deals with reading data. ----- */

Expand Down
2 changes: 1 addition & 1 deletion include/itkSWCMeshIOFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class IOMeshSWC_EXPORT SWCMeshIOFactory : public ObjectFactoryBase
itkFactorylessNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro(SWCMeshIOFactory, ObjectFactoryBase);
itkOverrideGetNameOfClassMacro(SWCMeshIOFactory);

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

0 comments on commit 457f94a

Please sign in to comment.