[Insight-users] no itkSetOutputMacro?

Joël Schaerer joel.schaerer at gmail.com
Mon Jan 13 04:25:49 EST 2014


Hi Luis, and thanks for your detailed answer! There are still a few 
points that I don't understand:

> Le 11/01/2014 16:55, Luis Ibanez a écrit :
>
> So, if a filter has a named output called "Transform", we can call
>
>               DataObject * myFilter->GetOutput("Transform");

That method is protected, so we can't call it from outside of the class. 
Which is fine since we can always define an accessor function, but a bit 
weird in my opinion..

> If we were to add a
>
>                                   itkGetOutputMacro()
>
> It would convert:
>
>               DataObject * myFilter->GetOutput("Transform");
>
> into
>
>               DataObject * myFilter->GetTransform();
> but
>
> Given that in C++, the return type is not part of the signature of a 
> function,
> we couldn't have two methods with the same name and input parameters
> but with different return types.
>
> Namely:
>
>               DataObject  * myFilter->GetTransform();
>               TransformType * myFilter->GetTransform();
>

Couldn't the output macro get a type parameter, similarly to the input 
macro?

         itkGetOutputMacro(name,type)

That would generate the second method directly, with no conflict if I 
understand correctly. Unless of course you want the output type to be 
dynamic, which doesn't seem like a very frequent case.

What am I missing?

Thanks again,

joel


More information about the Insight-users mailing list