PageRenderTime 21ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. %module valuewrapper_base
  2. %inline
  3. %{
  4. namespace oss
  5. {
  6. enum Polarization { UnaryPolarization, BinaryPolarization };
  7. struct Base
  8. {
  9. };
  10. template <Polarization P>
  11. struct Interface_ : Base
  12. {
  13. Interface_(const Base& b) { };
  14. };
  15. template <class Result>
  16. Result make() { return Result(*new Base()); }
  17. }
  18. %}
  19. namespace oss
  20. {
  21. // Interface
  22. %template(Interface_BP) Interface_<BinaryPolarization>;
  23. %template(make_Interface_BP) make<Interface_<BinaryPolarization> >;
  24. }