import source from 1.3.40
[external/swig.git] / Examples / test-suite / using_namespace.i
1 %module(ruby_minherit="1") using_namespace
2
3 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) hi::hi0;  /* Ruby, wrong class name */
4 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) hi::hi1;  /* Ruby, wrong class name */
5
6 %warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
7             SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
8             SWIGWARN_PHP_MULTIPLE_INHERITANCE) Hi<hello::Hello, hi::hi0>; // C#, Java, PHP multiple inheritance
9
10 %inline %{
11   namespace hello
12   {  
13     struct Hello 
14     {
15     };
16
17     template <class _T1, class _T2>
18     struct Hi : _T1, _T2
19     {
20       int value1() const
21       {
22         return 1;
23       }      
24
25       int value2() const
26       {
27         return 2;
28       }      
29     };    
30   }
31
32   namespace hi
33   {
34
35     struct hi0
36     {
37     };
38     
39   }
40 %}
41
42 namespace hello
43 {
44   %template(Hi_hi0) Hi<hello::Hello, hi::hi0>;
45 }
46
47
48 %inline %{
49   namespace hi
50   {
51     struct hi1 : private hello::Hi< hello::Hello, hi0 >
52     {
53       using hello::Hi< hello::Hello, hi::hi0 >::value1;
54       using hello::Hi< hello::Hello, hi0 >::value2;
55     };
56     
57   }
58   
59 %}
60
61
62 %inline {
63 namespace foo {
64   typedef double mytype;
65 }
66
67 // global namespace
68 typedef float mytype;
69
70 using namespace foo;
71
72 struct X {
73   ::mytype d;
74 };
75
76 }