# itkTypeMacro

**URL:** https://discourse.itk.org/t/itktypemacro/1555
**Category:** Engineering
**Created:** [January 27, 2019, 3:54pm UTC](https://discourse.itk.org/t/itktypemacro/1555 "2019-01-27T15:54:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [January 27, 2019, 3:54pm UTC](https://discourse.itk.org/t/itktypemacro/1555/1 "2019-01-27T15:54:18Z")

</div>

Looking into the `itkMacro.h` file, I was surprised to discover that the macro called `itkTypeMacro` which takes as arguments the name of the class and the name of the superclass actually do not do anything with the name of the superclass. I looked at the history of the file, as far back as what github supports (I did not check past that point on my computer with git) and the superclass name has never been used. A new macro was added at some point for classes that do not have parents (`itkTypeMacroNoParent`) but I don’t see why that new macro is necessary since the original macro doesn’t use the parent class name anyway. Could anyone explain why the macro `itkTypeMacro` take the superclass name as an argument then?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [January 27, 2019, 3:58pm UTC](https://discourse.itk.org/t/itktypemacro/1555/2 "2019-01-27T15:58:49Z")

</div>

Likely just following the vtkTypeMacro as much of the original ITK infrastructure was based on VTK.

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [January 27, 2019, 4:36pm UTC](https://discourse.itk.org/t/itktypemacro/1555/3 "2019-01-27T16:36:28Z")

</div>

Yeah I was surprised too! But it is because they have different qualifiers.

The one with parent is of type:

```auto
const char *GetNameOfClass() const override

```

The `NoParent`

```auto
virtual const char *GetNameOfClass() const

```

The parent name itself is unused though.
