1 %module(directors="1") director_enum
2 
3 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::hi; /* Ruby, wrong constant name */
4 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::hello; /* Ruby, wrong constant name */
5 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::yo; /* Ruby, wrong constant name */
6 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::awright; /* Ruby, wrong constant name */
7 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::Foo::ciao; /* Ruby, wrong constant name */
8 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::Foo::aufwiedersehen; /* Ruby, wrong constant name */
9 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::Foo::adios; /* Ruby, wrong constant name */
10 %warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,
11 	    SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) EnumDirector::Foo; /* Thread/reentrant unsafe wrapping, consider returning by value instead. */
12 
13 
14 
15 %feature("director") Foo;
16 
17 %rename(Hallo) EnumDirector::Hello;
18 
19 %inline %{
20 namespace EnumDirector {
21   struct A;
22 
23   enum Hello {
24     hi, hello, yo, awright = 10
25   };
26 
27   class Foo {
28   public:
29     enum Bye {
30       ciao, aufwiedersehen = 100, adios
31     };
~Foo()32     virtual ~Foo() {}
say_hi(Hello h)33     virtual Hello say_hi(Hello h){ return h;}
say_hello(Hello)34     virtual Hello say_hello(Hello){ return hello;}
say_hi(A * a)35     virtual Hello say_hi(A *a){ return hi;}
say_bye(Bye b)36     virtual Bye say_bye(Bye b){ return b;}
say_hi_ref(const Hello & h)37     virtual const Hello & say_hi_ref(const Hello & h){ return h;}
38 
ping(Hello h)39     Hello ping(Hello h){ return say_hi(h);}
ping_ref(const Hello & h)40     const Hello & ping_ref(const Hello &h){ return say_hi_ref(h);}
ping_member_enum(Bye b)41     Bye ping_member_enum(Bye b){ return say_bye(b);}
42 
43   };
44 }
45 %}
46 
47 %feature("director");
48 
49 %inline %{
50 namespace EnumDirector {
51 enum FType{ SA = -1, NA_=0, EA=1};
52 
53 struct A{
AA54     A(const double a, const double b, const FType c)
55     {}
56 
~AA57     virtual ~A() {}
58 
59     virtual int f(int i=0) {return i;}
60 };
61 
62 struct B : public A{
BB63     B(const double a, const double b, const FType c)
64         : A(a, b, c)
65     {}
66 };
67 }
68 %}
69 
70 
71 %inline %{
72 namespace EnumDirector {
73 struct A2{
74     A2(const FType c = NA_) {}
75 
~A2A276     virtual ~A2() {}
77 
78     virtual int f(int i=0) {return i;}
79 };
80 
81 struct B2 : public A2{
B2B282     B2(const FType c) : A2(c) {}
83 };
84 }
85 
86 %}
87