[Insight-users] txx files

Luis Ibanez luis . ibanez at kitware . com
Tue, 27 Aug 2002 10:26:57 -0400


Hi Zein,

The files with the .txx extensions are the meat of ITK  :-)

ITK makes extensive use of C++ templates.
(Too much in some cases...)

When you write a templated C++ class, the code is not actually
compiled until you provide a particular instantiation. e.g. for
an itk::Image, the Image code will only be compiled when you
declare an Image type with a specific PixelType and Dimension,
like:

            itk::Image< float, 3 >

Without this, the code of the Image cannot compiled and should
not be put in a standard .cxx file.

You will notice that most ITK classes have .h and .txx files.
The .h header files contain the class declaration (as typical
C++) and the .txx files contain the class definition.

The header .h files include the .txx files in order to make
sure that the code for the class definition will be available
whenever the class is actually instantiated.

Non-templated ITK classes reside in standard .cxx files.


Please let us know if you have further questions,

Thanks

    Luis



============================================

Zein Salah wrote:
> Hi friends,
> 
>  
> 
> What are those files that have the .txx extention ??
> 
>  
> 
> Thanks,
> 
> Zein
> 
>