PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 7ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/test-suite/access_change.i

#
Swig | 51 lines | 43 code | 8 blank | 0 comment | 0 complexity | c6f863c62bfa1dd5d5fc1c77eacb7865 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1%module access_change
 2
 3// test access changing from protected to public
 4
 5%inline %{
 6
 7template<typename T> class Base {
 8public:
 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; }
14protected:
15  virtual int * WasProtected1() { return 0; }
16  int * WasProtected2() { return 0; }
17  virtual int * WasProtected3() { return 0; }
18  int * WasProtected4() { return 0; }
19};
20
21template<typename T> class Derived : public Base<T> {
22public:
23  int * WasProtected1() { return 0; }
24  int * WasProtected2() { return 0; }
25  using Base<T>::WasProtected3;
26  using Base<T>::WasProtected4;
27protected:
28  virtual int *PublicProtectedPublic1() { return 0; }
29  int *PublicProtectedPublic2() { return 0; }
30  using Base<T>::PublicProtectedPublic3;
31  using Base<T>::PublicProtectedPublic4;
32};
33
34template<typename T> class Bottom : public Derived<T> {
35public:
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