summaryrefslogtreecommitdiff
path: root/Examples/test-suite/abstract_access.i
blob: 557f2315479e60f5a43989b7cafa6dcc6e412034 (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
%module abstract_access

%warnfilter(SWIGWARN_LANG_DIRECTOR_ABSTRACT) A;

%inline %{
class A {
public:
  virtual ~A()
  {
  }

private:
	virtual int x() = 0;
protected:
	virtual int y() = 0;
public:
	virtual int z() = 0;
	int do_x() { return x(); }
};

class B : public A {
private:
	virtual int x() { return y(); }
};

class C : public B {
protected:
	virtual int y() { return z(); }
};

class D : public C {
private:
	virtual int z() { return 1; }
};

%}