PageRenderTime 16ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
Swig | 56 lines | 43 code | 13 blank | 0 comment | 0 complexity | c7e892675bcf9daff91919a7f8c4b178 MD5 | raw file
 1%module smart_pointer_member
 2
 3%warnfilter(SWIGWARN_GO_NAME_CONFLICT);                       /* Ignoring 'foo' due to Go name ('Foo') conflict with 'Foo' */
 4
 5%inline %{
 6
 7  class Foo {
 8  public:
 9    int x[4];
10    int y;
11    static const int z;
12    static const int ZZ = 3;
13    static int zx;
14
15    static int boo() { return 0;}
16
17    friend int foo(Foo* foo) { return 0;}
18  };
19  
20  class Bar {
21    Foo *f;
22  public:
23    Bar(Foo *f) : f(f) { }
24    Foo *operator->() {
25      return f;
26    }
27
28    static int bua() { return 0;}
29  };
30
31  class CBar {
32    Foo *f;
33  public:
34    CBar(Foo *f) : f(f) { }
35    const Foo *operator->()  {
36      return f;
37    }
38  };
39
40  
41  int get_y(Bar *b) 
42  {
43    return (*b)->y;
44  }
45  
46  int get_z(Bar *b) 
47  {
48    return (*b)->z;
49  }
50%}
51
52
53%{
54  const int Foo::z = 3;
55  int Foo::zx;
56%}