PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/using_composition.i

#
Swig | 52 lines | 45 code | 7 blank | 0 comment | 0 complexity | 59aeac61756f2105305091aff6f7c7f0 MD5 | raw file
 1%module(ruby_minherit="1") using_composition
 2
 3%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
 4	    SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
 5	    SWIGWARN_D_MULTIPLE_INHERITANCE,
 6	    SWIGWARN_PHP_MULTIPLE_INHERITANCE) FooBar;   // C#, D, Java, PHP multiple inheritance
 7%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
 8	    SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
 9	    SWIGWARN_D_MULTIPLE_INHERITANCE,
10	    SWIGWARN_PHP_MULTIPLE_INHERITANCE) FooBar2;   // C#, D, Java, PHP multiple inheritance
11%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
12	    SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
13	    SWIGWARN_D_MULTIPLE_INHERITANCE,
14	    SWIGWARN_PHP_MULTIPLE_INHERITANCE) FooBar3;   // C#, D, Java, PHP multiple inheritance
15#ifdef SWIGLUA	// lua only has one numeric type, so some overloads shadow each other creating warnings
16%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) blah;
17#endif
18
19%inline %{
20class Foo {
21public:
22     int blah(int x) { return x; }
23     char *blah(char *x) { return x; }
24};
25
26class Bar {
27public:
28     double blah(double x) { return x; }
29};
30
31class FooBar : public Foo, public Bar {
32public:
33     using Foo::blah;
34     using Bar::blah;
35     char *blah(char *x) { return x; }
36};
37
38class FooBar2 : public Foo, public Bar {
39public:
40     char *blah(char *x) { return x; }
41     using Foo::blah;
42     using Bar::blah;
43};
44
45class FooBar3 : public Foo, public Bar {
46public:
47     using Foo::blah;
48     char *blah(char *x) { return x; }
49     using Bar::blah;
50};
51
52%}