PageRenderTime 24ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/smart_pointer_protected.i

#
Swig | 33 lines | 26 code | 7 blank | 0 comment | 0 complexity | 4e878fa9d3520ef60ecb06f78df584a0 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module smart_pointer_protected
  2. %inline %{
  3. namespace hi
  4. {
  5. struct A
  6. {
  7. virtual ~A() { }
  8. virtual int value(A*) = 0;
  9. int index;
  10. };
  11. struct B : A
  12. {
  13. protected:
  14. int value(A*)
  15. {
  16. return 1;
  17. }
  18. };
  19. struct C
  20. {
  21. hi::B* operator->() const { return new hi::B(); }
  22. private:
  23. int index;
  24. };
  25. }
  26. %}