PageRenderTime 129ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 45 lines | 32 code | 13 blank | 0 comment | 0 complexity | 8cb69060d89a644f7c329c8a16f12806 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module(directors="1") director_finalizer
  2. %warnfilter(SWIGWARN_GO_NAME_CONFLICT); /* Ignoring 'deleteFoo' due to Go name ('DeleteFoo') conflict with '~Foo' */
  3. %{
  4. int status = 0;
  5. class Foo {
  6. public:
  7. virtual ~Foo() { orStatus(1); }
  8. virtual void orStatus(int x) { status |= x; }
  9. };
  10. void deleteFoo(Foo *f) {
  11. delete f;
  12. }
  13. Foo *launder(Foo *f) {
  14. return f;
  15. }
  16. int getStatus() {
  17. return status;
  18. }
  19. void resetStatus() {
  20. status = 0;
  21. }
  22. %}
  23. %feature("director") Foo;
  24. class Foo {
  25. public:
  26. virtual ~Foo();
  27. virtual void orStatus(int x);
  28. };
  29. void deleteFoo(Foo *f);
  30. int getStatus();
  31. Foo *launder(Foo *f);
  32. void resetStatus();