1 %module(directors="1") ruby_track_objects_directors 2 3 %{ 4 #include <string> 5 %} 6 7 %include "std_string.i"; 8 %feature("director") Foo; 9 10 %trackobjects; 11 12 %inline %{ 13 14 class Foo { 15 public: Foo()16 Foo() {} ~Foo()17 virtual ~Foo() {} ping()18 virtual std::string ping() 19 { 20 return "Foo::ping()"; 21 } 22 pong()23 virtual std::string pong() 24 { 25 return "Foo::pong();" + ping(); 26 } 27 }; 28 29 30 class Container { 31 Foo* foo_; 32 public: get_foo()33 Foo* get_foo() 34 { 35 return foo_; 36 } 37 set_foo(Foo * foo)38 void set_foo(Foo *foo) 39 { 40 foo_ = foo; 41 } 42 }; 43 44 %} 45