PageRenderTime 38ms CodeModel.GetById 15ms 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. // test access changing from protected to public
  3. %inline %{
  4. template<typename T> class Base {
  5. public:
  6. virtual ~Base() {}
  7. virtual int *PublicProtectedPublic1() { return 0; }
  8. int *PublicProtectedPublic2() { return 0; }
  9. virtual int *PublicProtectedPublic3() { return 0; }
  10. int *PublicProtectedPublic4() { return 0; }
  11. protected:
  12. virtual int * WasProtected1() { return 0; }
  13. int * WasProtected2() { return 0; }
  14. virtual int * WasProtected3() { return 0; }
  15. int * WasProtected4() { return 0; }
  16. };
  17. template<typename T> class Derived : public Base<T> {
  18. public:
  19. int * WasProtected1() { return 0; }
  20. int * WasProtected2() { return 0; }
  21. using Base<T>::WasProtected3;
  22. using Base<T>::WasProtected4;
  23. protected:
  24. virtual int *PublicProtectedPublic1() { return 0; }
  25. int *PublicProtectedPublic2() { return 0; }
  26. using Base<T>::PublicProtectedPublic3;
  27. using Base<T>::PublicProtectedPublic4;
  28. };
  29. template<typename T> class Bottom : public Derived<T> {
  30. public:
  31. int * WasProtected1() { return 0; }
  32. int * WasProtected2() { return 0; }
  33. using Base<T>::WasProtected3;
  34. using Base<T>::WasProtected4;
  35. int *PublicProtectedPublic1() { return 0; }
  36. int *PublicProtectedPublic2() { return 0; }
  37. int *PublicProtectedPublic3() { return 0; }
  38. int *PublicProtectedPublic4() { return 0; }
  39. };
  40. %}
  41. %template(BaseInt) Base<int>;
  42. %template(DerivedInt) Derived<int>;
  43. %template(BottomInt) Bottom<int>;