PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-25/SWIG/Examples/test-suite/using_namespace.i

#
Swig | 57 lines | 44 code | 13 blank | 0 comment | 0 complexity | ee64d33a274963cb4e009101b3999db3 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module(ruby_minherit="1") using_namespace
  2. %warnfilter(801) hi::hi0; /* Ruby, wrong class name */
  3. %warnfilter(801) hi::hi1; /* Ruby, wrong class name */
  4. %warnfilter(813,833) Hi<hello::Hello, hi::hi0>; // C#, Java multiple inheritance
  5. %inline %{
  6. namespace hello
  7. {
  8. struct Hello
  9. {
  10. };
  11. template <class _T1, class _T2>
  12. struct Hi : _T1, _T2
  13. {
  14. int value1() const
  15. {
  16. return 1;
  17. }
  18. int value2() const
  19. {
  20. return 2;
  21. }
  22. };
  23. }
  24. namespace hi
  25. {
  26. struct hi0
  27. {
  28. };
  29. }
  30. %}
  31. namespace hello
  32. {
  33. %template(Hi_hi0) Hi<hello::Hello, hi::hi0>;
  34. }
  35. %inline %{
  36. namespace hi
  37. {
  38. struct hi1 : private hello::Hi< hello::Hello, hi0 >
  39. {
  40. using hello::Hi< hello::Hello, hi::hi0 >::value1;
  41. using hello::Hi< hello::Hello, hi0 >::value2;
  42. };
  43. }
  44. %}