David Piepgrass - 2012-06-01

I've got a class where with 23 virtual functions and I only want directors for 3 of them. At first I made a %nodirector statement for each of the 20 unwanted functions, but then I thought of an easier workaround. In my header file I do:

#ifdef SWIG
#define INTERNAL protected
#define INTERNAL public
#define VIRTUAL_IN_CPP virtual

Then instead of "virtual", I use "VIRTUAL_IN_CPP" on the functions for which I don't want directors (and INTERNAL for public members that I don't want wrapped at all). Of course, such a workaround only applies if you can modify the original header files.