PageRenderTime 31ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/director_wombat.i

#
Swig | 49 lines | 41 code | 8 blank | 0 comment | 0 complexity | cb5c6a2a3b6dbf17c7ce002a9ef50c19 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module(directors="1") director_wombat
  2. #pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR
  3. %feature(director) Bar;
  4. %feature(director) Foo<int>;
  5. %inline %{
  6. template<typename T> class Foo
  7. {
  8. public:
  9. Foo()
  10. { /* NOP */ }
  11. virtual ~Foo()
  12. { /* NOP */ }
  13. virtual int meth(T param)
  14. { return param; }
  15. };
  16. typedef Foo<int> Foo_int;
  17. class Bar
  18. {
  19. public:
  20. virtual ~Bar();
  21. virtual Foo_int *meth();
  22. virtual void foo_meth_ref(Foo_int &, int);
  23. virtual void foo_meth_ptr(Foo_int *, int);
  24. virtual void foo_meth_val(Foo_int, int);
  25. virtual void foo_meth_cref(const Foo_int &, int);
  26. virtual void foo_meth_cptr(const Foo_int *, int);
  27. };
  28. Bar::~Bar()
  29. { /* NOP */ }
  30. Foo_int *
  31. Bar::meth()
  32. {
  33. return new Foo_int();
  34. }
  35. void Bar::foo_meth_ref(Foo_int &arg, int param) { }
  36. void Bar::foo_meth_ptr(Foo_int *arg, int param) { }
  37. void Bar::foo_meth_val(Foo_int arg, int param) { }
  38. void Bar::foo_meth_cref(const Foo_int &arg, int param) { }
  39. void Bar::foo_meth_cptr(const Foo_int *arg, int param) { }
  40. %}
  41. %template(Foo_integers) Foo<int>;