[Insight-developers] itkSuperclassTraitMacro

Johnson, Hans J hans-johnson at uiowa.edu
Wed Oct 5 09:16:32 EDT 2011


I'd rather have verbose "naked" C++ than terse ambiguous macros.

With the macro, I am forced to look in two places to understand what is
going on.

My own internal rule is to only use macros when there is a significant
amount of "rubber stamp" code that is easy copy and paste incorrectly, but
can not be made into a function.  OR when conditional code is necessary to
deal with multiple platforms.  In this case the complexity of the macro is
equal to the complexity of the original c++ code, so I'd avoid the macro.

Just my opinion.

Hans


On 10/5/11 8:11 AM, "Cory Quammen" <cquammen at cs.unc.edu> wrote:

>I didn't know about that macro either, but it actually looks useful. I
>really hate having to write, e.g.
>
>typedef typename Superclass::PixelType PixelType
>
>over and over, or even having to copy and paste it.
>
>This
>
>itkSuperclassTraitMacro(PixelType)
>
>looks a lot nicer to me, but I suppose it makes code that much more
>opaque.
>
>Cory
>
>On Wed, Oct 5, 2011 at 8:57 AM, Gelas, Arnaud Joel Florent
><Arnaud_Gelas at hms.harvard.edu> wrote:
>> Here you go:
>>
>> http://review.source.kitware.com/#change,3050
>> ________________________________________
>> From: Johnson, Hans J [hans-johnson at uiowa.edu]
>> Sent: Wednesday, October 05, 2011 7:46 AM
>> To: Gelas, Arnaud Joel Florent; ITK
>> Subject: Re: [Insight-developers] itkSuperclassTraitMacro
>>
>> My vote is to remove it.
>>
>>
>> On 10/5/11 3:23 AM, "Gelas, Arnaud Joel Florent"
>> <Arnaud_Gelas at hms.harvard.edu> wrote:
>>
>>>Hi all,
>>>
>>>I have just found out about this macro,
>>>
>>>/** Macro used to redefine a type from the superclass. */
>>>#define itkSuperclassTraitMacro(traitnameType) \
>>>typedef typename Superclass::traitnameType traitnameType;
>>>
>>>This macro is only used in 14 classes...
>>>
>>>We should either make use of this macro in most of itk classes, or in
>>>none of them for consistency purpose.
>>>
>>>Should we keep and use this macro throughout the toolkit? or get rid of
>>>it?
>>>
>>>btw: when using this macro you should not add an extra ';' it creates a
>>>justified doxygen warning...
>>>
>>>Thanks,
>>>Arnaud
>>>_______________________________________________
>>>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://kitware.com/products/protraining.html
>>>
>>>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-developers
>>
>>
>>
>> ________________________________
>> Notice: This UI Health Care e-mail (including attachments) is covered
>>by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>>confidential and may be legally privileged.  If you are not the intended
>>recipient, you are hereby notified that any retention, dissemination,
>>distribution, or copying of this communication is strictly prohibited.
>>Please reply to the sender that you have received the message in error,
>>then delete it.  Thank you.
>> ________________________________
>> _______________________________________________
>> 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://kitware.com/products/protraining.html
>>
>> 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-developers
>>
>
>
>
>--
>Cory Quammen
>Research Associate
>Department of Computer Science
>The University of North Carolina at Chapel Hill



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list