[Dcmlib] static ::New() / Factory

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Nov 9 16:03:53 CET 2005


Jean-Pierre Roux wrote:
> Mathieu Malaterre wrote:
> 
>> Benoit,
>>
>>     So what is the deal with New ? What purpose does it do (except Yet 
>> Another API change) ? I have to explain why `we' needed that to the 
>> ITK group ?
> 
> 
> Benoit is not at the Lab this week.
> I was very proud to do something 'ITK like'.

1. Half way done...
2. Has nothing to do with ITK, it is `kind of' VTK like maybe. There is 
no smart pointer, eg. In ITK you do:

{
ReaderType::Pointer r = ReaderType::New();
}
-> the dealloaction is done for you.


> I though he discussed with you before.

I thought I convinced him not to do it, because VTK is a special case 
where when you do::

vtkRenderWindow::New()

it creates depending where you build VTK:

vtkWin32RenderWindow
vtkX11RenderWindow
vtkCarbonRenderWindow
vtkCocoaRenderWindow

whereas there is no such thing in gdcm !

The only plateform dependant thing we do is the Big vs Little endian thing.

Mathieu



More information about the Dcmlib mailing list