summaryrefslogtreecommitdiff
path: root/Examples/test-suite/director_unroll.i
blob: 6a11c3a90b101af30df50defb8a719e3ad17fd4c (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
%module(directors="1") director_unroll
%{
#include <string>

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

class Bar {
private:
	Foo *foo;
public:
	void set(Foo *x) { foo = x; }
	Foo *get() { return foo; }
};

%}

%include "std_string.i"

%feature("director") Foo;

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

class Bar {
private:
	Foo *foo;
public:
	void set(Foo *x) { foo = x; }
	Foo *get() { return foo; }
};