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
hjmjohnson committed Jan 26, 2025
1 parent de7ba0f commit 8fdd6a1
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/itkBioCellularAggregate.h
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ class ITK_TEMPLATE_EXPORT CellularAggregate : public CellularAggregateBase
using ConstPointer = SmartPointer<const Self>;

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

/** Method for creation through the object factory. */
itkNewMacro(Self);
2 changes: 1 addition & 1 deletion include/itkBioCellularAggregateBase.h
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ class BioCell_EXPORT CellularAggregateBase : public Object
using ConstPointer = SmartPointer<const Self>;

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

/** Method for creation through the object factory. */
itkNewMacro(Self);

0 comments on commit 8fdd6a1

Please sign in to comment.