[Insight-developers] itkSetMacro with STL types

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Fri Apr 15 03:44:49 EDT 2011


Le 15 avr. 11 à 00:30, David Cole a écrit :

> I'm fairly certain we avoid STL types in public set/get method
> signatures for a handful of reasons.
>
> The two that come immediately to mind are:
> 1) compilation speed (avoiding including the stl headers in other
> headers is a good thing)

They are used in several places in ITK, included in some very common  
places like itkProcessObject.h.

> 2) wrapping languages
>

As long as they are not used with fancy types, it is usually easier to  
use STL types, because swig usually provide some nice customizations  
for them.

> Maybe both of these are, at this point, merely historical footnotes,
> ... but first, before solving "the problem", I'd see if I couldn't
> rather avoid it in the first place.
>
> Where do you need a vector or a set that's in the public API of ITK?
>
>
> On Thu, Apr 14, 2011 at 6:23 PM, Luis Ibanez  
> <luis.ibanez at kitware.com> wrote:
>> David,
>>
>> Two options come to mind:
>>
>> A) Create a variant of itkSetMacro that doesn't call
>>     the DebugMacro
>>
>> or
>>
>> B)  Create a trait that indicates whether the Type has the
>>      stream << operator overloaded, and depending on that
>>      trait condition the print statement inside of the DebugMacro.
>>
>>
>> There are probably other and smarter options out there...    :-)
>>
>>
>>     Luis
>>
>> --------------------------------------------------
>> On Thu, Apr 14, 2011 at 3:32 PM, David Doria <daviddoria at gmail.com>  
>> wrote:
>>> On Thu, Apr 14, 2011 at 3:29 PM, Bill Lorensen <bill.lorensen at gmail.com 
>>> >
>>> wrote:
>>>>
>>>> You would need to implement <<  for set<int>
>>>
>>> Sure, that'll fix it, but it seems like you should be able to use  
>>> the
>>> SetMacro even for types which cannot be output. Could a few <<  
>>> operators for
>>> set, vector, etc be included somewhere to at least catch these  
>>> common cases?
>>>
>>> David
>>> _______________________________________________
>>> 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
>>>
>>>
>> _______________________________________________
>> 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
>>
> _______________________________________________
> 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

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110415/e622e6d1/attachment.pgp>


More information about the Insight-developers mailing list