[ITK Community] [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
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list