PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 44 lines | 34 code | 10 blank | 0 comment | 0 complexity | 8a3b910ee3079f1df26a6308d9df2523 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module(directors="1") ruby_track_objects_directors
  2. %{
  3. #include <string>
  4. %}
  5. %include "std_string.i";
  6. %feature("director") Foo;
  7. %trackobjects;
  8. %inline %{
  9. class Foo {
  10. public:
  11. Foo() {}
  12. virtual ~Foo() {}
  13. virtual std::string ping()
  14. {
  15. return "Foo::ping()";
  16. }
  17. virtual std::string pong()
  18. {
  19. return "Foo::pong();" + ping();
  20. }
  21. };
  22. class Container {
  23. Foo* foo_;
  24. public:
  25. Foo* get_foo()
  26. {
  27. return foo_;
  28. }
  29. void set_foo(Foo *foo)
  30. {
  31. foo_ = foo;
  32. }
  33. };
  34. %}