PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
Swig | 44 lines | 34 code | 10 blank | 0 comment | 0 complexity | 8a3b910ee3079f1df26a6308d9df2523 MD5 | raw file
 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
14class Foo {
15public:
16	Foo() {}
17	virtual ~Foo() {}
18	virtual std::string ping() 
19	{
20		return "Foo::ping()";
21	}
22
23	virtual std::string pong()
24	{
25		return "Foo::pong();" + ping();
26	}
27};
28
29
30class Container {
31	Foo* foo_;
32public:
33	Foo* get_foo() 
34	{
35		return foo_;
36	}
37
38	void set_foo(Foo *foo)
39	{
40		foo_ = foo;
41	}
42};
43
44%}