[C++-sig] py++ and templates

Roman Yakovenko roman.yakovenko at gmail.com
Thu Aug 23 21:57:23 CEST 2007

On 8/23/07, Jeff Winkelman <winkatl1213 at yahoo.com> wrote:
> Roman,
> They are the template instances defined in the bottom of the Easy_EImage.h
> file.
> I'll list them here for reference:
> // Predefined ROI types
> typedef EROI<EBW1> EROIBW1;
> typedef EROI<EBW8> EROIBW8;
> typedef EROI<EBW16> EROIBW16;
> typedef EROI<EBW32> EROIBW32;
> typedef EROI<EC15> EROIC15;
> typedef EROI<EC16> EROIC16;
> typedef EROI<EC24> EROIC24;
> typedef EROI<EYUY2> EROIYUY2;
> typedef EROI<EC24A> EROIC24A;
> typedef EROI<ESubPixel64> EROISubPixel64;
> typedef EROI<EComplex64> EROIComplex64;
> typedef EROI<ERaw32> EROIRaw32;
> typedef EROI<ERaw96> EROIRaw96;
> // Predefined image types
> typedef EImage<EBW1> EImageBW1;
> typedef
>  EImage<EBW8> EImageBW8;
> typedef EImage<EBW16> EImageBW16;
> typedef EImage<EBW32> EImageBW32;
> typedef EImage<EC15> EImageC15;
> typedef EImage<EC16> EImageC16;
> typedef EImage<EC24> EImageC24;
> typedef EImage<EYUY2> EImageYUY2;
> typedef EImage<EC24A> EImageC24A;
> typedef EImage<ESubPixel64> EImageSubPixel64;
> typedef EImage<EComplex64> EImageComplex64;
> typedef EImage<ERaw32> EImageRaw32;
> typedef EImage<ERaw96> EImageRaw96;
> typedef EImage<EFLOAT32> EImageFLOAT32;
> typedef EImage<EFLOAT64> EImageFLOAT64;

If this is the case, than the solution is really simple: use sizeof operator:

sizeof( EImageBW16 );

This should help. For starting I suggest you to write sizeof within
the code or within other header that you will use as input to Py++.
Later, you can generate the template instantiations from the Py++

Roman Yakovenko
C++ Python language binding

More information about the Cplusplus-sig mailing list