/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
- %module template_enum_typedef
- %warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::etraits; /* Ruby, wrong class name */
- %inline %{
-
- namespace oss
- {
- enum Polarization { UnaryPolarization, BinaryPolarization };
-
- template <Polarization P>
- struct Interface
- {
- };
-
- struct etraits
- {
- static const Polarization pmode = UnaryPolarization;
- };
-
-
- template <class Traits>
- struct Module
- {
- typedef Traits traits;
- static const Polarization P = traits::pmode;
-
- void get(Interface<P> arg) { }; // Here P is only replace by traits::pmode
-
- };
- }
-
- %}
-
- namespace oss
- {
- %template(Interface_UP) Interface<UnaryPolarization>;
- %template(Module_UP) Module<etraits>;
- }