/trunk/Examples/test-suite/valuewrapper_base.i
Swig | 28 lines | 24 code | 4 blank | 0 comment | 0 complexity | 52dbf0a5d36f3ecf542c6c4ecb62f298 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- %module valuewrapper_base
- %inline
- %{
- namespace oss
- {
- enum Polarization { UnaryPolarization, BinaryPolarization };
-
- struct Base
- {
- };
-
- template <Polarization P>
- struct Interface_ : Base
- {
- Interface_(const Base& b) { };
- };
-
- template <class Result>
- Result make() { return Result(*new Base()); }
- }
- %}
-
- namespace oss
- {
- // Interface
- %template(Interface_BP) Interface_<BinaryPolarization>;
- %template(make_Interface_BP) make<Interface_<BinaryPolarization> >;
- }