/* File : example.i */ %module template_inherit /* This example tests template inheritance to see if it actually works */ %inline %{ template class Foo { public: virtual ~Foo() { } virtual char *blah() { return (char *) "Foo"; } virtual char *foomethod() { return (char *) "foomethod"; } }; template class Bar : public Foo { public: virtual char *blah() { return (char *) "Bar"; } }; template char *invoke_blah(Foo *x) { return x->blah(); } %} %template(FooInt) Foo; %template(FooDouble) Foo; %template(FooUInt) Foo; %template(BarInt) Bar; %template(BarDouble) Bar; %template(BarUInt) Bar; %template(invoke_blah_int) invoke_blah; %template(invoke_blah_double) invoke_blah; %template(invoke_blah_uint) invoke_blah;