summaryrefslogtreecommitdiff
path: root/Examples/test-suite/ruby_track_objects_directors.i
blob: 131209828b428d078a087a3174061faed071fbd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
%module(directors="1") ruby_track_objects_directors

%{
#include <string>
%}

%include "std_string.i";
%feature("director") Foo;

%trackobjects;

%inline %{

class Foo {
public:
	Foo() {}
	virtual ~Foo() {}
	virtual std::string ping() 
	{
		return "Foo::ping()";
	}

	virtual std::string pong()
	{
		return "Foo::pong();" + ping();
	}
};


class Container {
	Foo* foo_;
public:
	Foo* get_foo() 
	{
		return foo_;
	}

	void set_foo(Foo *foo)
	{
		foo_ = foo;
	}
};

%}