/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
- %module access_change
- // test access changing from protected to public
- %inline %{
- template<typename T> class Base {
- public:
- virtual ~Base() {}
- virtual int *PublicProtectedPublic1() { return 0; }
- int *PublicProtectedPublic2() { return 0; }
- virtual int *PublicProtectedPublic3() { return 0; }
- int *PublicProtectedPublic4() { return 0; }
- protected:
- virtual int * WasProtected1() { return 0; }
- int * WasProtected2() { return 0; }
- virtual int * WasProtected3() { return 0; }
- int * WasProtected4() { return 0; }
- };
- template<typename T> class Derived : public Base<T> {
- public:
- int * WasProtected1() { return 0; }
- int * WasProtected2() { return 0; }
- using Base<T>::WasProtected3;
- using Base<T>::WasProtected4;
- protected:
- virtual int *PublicProtectedPublic1() { return 0; }
- int *PublicProtectedPublic2() { return 0; }
- using Base<T>::PublicProtectedPublic3;
- using Base<T>::PublicProtectedPublic4;
- };
- template<typename T> class Bottom : public Derived<T> {
- public:
- int * WasProtected1() { return 0; }
- int * WasProtected2() { return 0; }
- using Base<T>::WasProtected3;
- using Base<T>::WasProtected4;
- int *PublicProtectedPublic1() { return 0; }
- int *PublicProtectedPublic2() { return 0; }
- int *PublicProtectedPublic3() { return 0; }
- int *PublicProtectedPublic4() { return 0; }
- };
- %}
- %template(BaseInt) Base<int>;
- %template(DerivedInt) Derived<int>;
- %template(BottomInt) Bottom<int>;