~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Examples/test-suite/access_change.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module access_change
 
2
 
 
3
// test access changing from protected to public
 
4
 
 
5
%inline %{
 
6
 
 
7
template<typename T> class Base {
 
8
public:
 
9
  virtual ~Base() {}
 
10
  virtual int *PublicProtectedPublic1() { return 0; }
 
11
  int *PublicProtectedPublic2() { return 0; }
 
12
  virtual int *PublicProtectedPublic3() { return 0; }
 
13
  int *PublicProtectedPublic4() { return 0; }
 
14
protected:
 
15
  virtual int * WasProtected1() { return 0; }
 
16
  int * WasProtected2() { return 0; }
 
17
  virtual int * WasProtected3() { return 0; }
 
18
  int * WasProtected4() { return 0; }
 
19
};
 
20
 
 
21
template<typename T> class Derived : public Base<T> {
 
22
public:
 
23
  int * WasProtected1() { return 0; }
 
24
  int * WasProtected2() { return 0; }
 
25
  using Base<T>::WasProtected3;
 
26
  using Base<T>::WasProtected4;
 
27
protected:
 
28
  virtual int *PublicProtectedPublic1() { return 0; }
 
29
  int *PublicProtectedPublic2() { return 0; }
 
30
  using Base<T>::PublicProtectedPublic3;
 
31
  using Base<T>::PublicProtectedPublic4;
 
32
};
 
33
 
 
34
template<typename T> class Bottom : public Derived<T> {
 
35
public:
 
36
  int * WasProtected1() { return 0; }
 
37
  int * WasProtected2() { return 0; }
 
38
  using Base<T>::WasProtected3;
 
39
  using Base<T>::WasProtected4;
 
40
  int *PublicProtectedPublic1() { return 0; }
 
41
  int *PublicProtectedPublic2() { return 0; }
 
42
  int *PublicProtectedPublic3() { return 0; }
 
43
  int *PublicProtectedPublic4() { return 0; }
 
44
};
 
45
%}
 
46
 
 
47
%template(BaseInt) Base<int>;
 
48
%template(DerivedInt) Derived<int>;
 
49
%template(BottomInt) Bottom<int>;
 
50
 
 
51