Upstream version 1.3.40
[profile/ivi/swig.git] / Examples / test-suite / namespace_nested.i
1 %module namespace_nested
2
3 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) hello::hi::hi0;   /* Ruby, wrong class name */
4 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::hi1<hello::Hi0 >;    /* Ruby, wrong class name */
5
6 %inline %{
7   namespace hello
8   {  
9     namespace hi
10     {      
11       struct hi0
12       {
13       };      
14     }
15
16     template < class T1 >
17     struct Hi : T1
18     {
19     };
20   }
21
22 %}
23
24 namespace hello 
25 {
26   %template(Hi_hi0) Hi<hi::hi0>;
27 }
28
29
30
31 %inline %{
32
33   namespace hello
34   {
35     //
36     // This works 
37     //
38     // typedef Hi<hello::hi::hi0> Hi0;
39     
40     //
41     // This doesn't work
42     //
43     typedef Hi<hi::hi0> Hi0;
44   }
45   
46   
47   namespace oss
48   {
49     template <class T1>
50     struct hi1 : T1
51     {
52     };
53
54     typedef hello::Hi<hello::hi::hi0> h0;
55   }
56   
57 %}
58
59 namespace oss
60 {
61   %template(hi1_hi0) hi1<hello::Hi0 >;
62 }
63
64
65 %rename(MyFoo) geos::algorithm::Foo;
66
67 %inline 
68 {
69   namespace geos {
70     namespace algorithm {
71       class Foo 
72       {
73       };
74     }
75     
76     namespace planargraph { // geos.planargraph
77       namespace algorithm { // geos.planargraph.algorithm
78         class Bar {
79         };
80       }
81       namespace algorithm { // geos.planargraph.algorithm
82
83         class Foo {
84         public:
85           typedef int size_type;
86         };
87       }
88       namespace algorithm { // geos.planargraph.algorithm
89
90         class ConnectedSubgraphFinder : public Foo {
91         public:
92           ConnectedSubgraphFinder(size_type)
93           {
94           }
95           
96         };
97       }
98     }
99   }
100 }
101