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

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

#
Swig | 52 lines | 42 code | 10 blank | 0 comment | 0 complexity | 7ba8166e0c8358ae8847c945fb79cfe9 MD5 | raw file
 1%module(ruby_minherit="1") using_extend
 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#ifdef SWIGLUA	// lua only has one numeric type, so some overloads shadow each other creating warnings
 8%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) blah;
 9#endif
10
11%extend Foo {
12     int blah(int x, int y) {
13        return x+y;
14     }
15};
16
17%extend Bar {
18     double blah(double x, double y) {
19        return x+y;
20     }
21};
22
23%inline %{
24class Foo {
25public:
26     int blah(int x) { return x; }
27     char *blah(char *x) { return x; }
28};
29
30class Bar {
31public:
32     int duh1() { return 1; }
33     int duh(int x) { return x; }
34     double blah(double x) { return x; }
35};
36
37class FooBar : public Foo, public Bar {
38public:
39     using Foo::blah;
40     using Bar::blah;
41     char *blah(char *x) { return x; }
42};
43
44%}
45
46%extend FooBar 
47{
48  using Bar::duh1;
49  using Bar::duh;
50}
51
52