/tags/rel-1.3.35/Examples/test-suite/template_enum_typedef.i
Swig | 39 lines | 28 code | 11 blank | 0 comment | 0 complexity | 546897901ec72250e5baa233c96edf77 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1%module template_enum_typedef
2
3%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::etraits; /* Ruby, wrong class name */
4
5%inline %{
6
7 namespace oss
8 {
9 enum Polarization { UnaryPolarization, BinaryPolarization };
10
11 template <Polarization P>
12 struct Interface
13 {
14 };
15
16 struct etraits
17 {
18 static const Polarization pmode = UnaryPolarization;
19 };
20
21
22 template <class Traits>
23 struct Module
24 {
25 typedef Traits traits;
26 static const Polarization P = traits::pmode;
27
28 void get(Interface<P> arg) { }; // Here P is only replace by traits::pmode
29
30 };
31 }
32
33%}
34
35namespace oss
36{
37 %template(Interface_UP) Interface<UnaryPolarization>;
38 %template(Module_UP) Module<etraits>;
39}