I’m writing a few classes that derive from vtkSocketController. They have some things in common, so I’d like to write a small header-only abstract class for my other classes to inherit from. However, I’m having problems with vtkStandardNewMacro().
If I don’t call vtkStandardNewMacro(), then my_abstract_class::New() is undefined, as expected.
If I include vtkStandardNewMacro() in my_abstract_class.h, I get a “redefinition of ‘static my_abstract_class* my_abstract_class::New()’”, which is unexpected. This also happens if I try and manually expand the macro (and the macros it calls).
Are header-only vtk-derived classes possible? If so, what’s the recommended method for creating them?