PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 45 lines | 32 code | 13 blank | 0 comment | 0 complexity | 8cb69060d89a644f7c329c8a16f12806 MD5 | raw file
 1%module(directors="1") director_finalizer
 2
 3%warnfilter(SWIGWARN_GO_NAME_CONFLICT);                       /* Ignoring 'deleteFoo' due to Go name ('DeleteFoo') conflict with '~Foo' */
 4
 5%{
 6
 7int status = 0;
 8
 9class Foo {
10public:
11	virtual ~Foo() { orStatus(1); }
12	virtual void orStatus(int x) { status |= x; }
13};
14
15void deleteFoo(Foo *f) {
16	delete f;
17}
18
19Foo *launder(Foo *f) {
20	return f;
21}
22
23int getStatus() {
24	return status;
25}
26
27void resetStatus() {
28	status = 0;
29}
30
31%}
32
33%feature("director") Foo;
34
35class Foo {
36public:
37	virtual ~Foo();
38	virtual void orStatus(int x);
39};
40
41void deleteFoo(Foo *f);
42int getStatus();
43Foo *launder(Foo *f);
44void resetStatus();
45