PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 52 lines | 42 code | 10 blank | 0 comment | 0 complexity | 7ba8166e0c8358ae8847c945fb79cfe9 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module(ruby_minherit="1") using_extend
  2. %warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
  3. SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
  4. SWIGWARN_D_MULTIPLE_INHERITANCE,
  5. SWIGWARN_PHP_MULTIPLE_INHERITANCE) FooBar; // C#, D, Java, PHP multiple inheritance
  6. #ifdef SWIGLUA // lua only has one numeric type, so some overloads shadow each other creating warnings
  7. %warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) blah;
  8. #endif
  9. %extend Foo {
  10. int blah(int x, int y) {
  11. return x+y;
  12. }
  13. };
  14. %extend Bar {
  15. double blah(double x, double y) {
  16. return x+y;
  17. }
  18. };
  19. %inline %{
  20. class Foo {
  21. public:
  22. int blah(int x) { return x; }
  23. char *blah(char *x) { return x; }
  24. };
  25. class Bar {
  26. public:
  27. int duh1() { return 1; }
  28. int duh(int x) { return x; }
  29. double blah(double x) { return x; }
  30. };
  31. class FooBar : public Foo, public Bar {
  32. public:
  33. using Foo::blah;
  34. using Bar::blah;
  35. char *blah(char *x) { return x; }
  36. };
  37. %}
  38. %extend FooBar
  39. {
  40. using Bar::duh1;
  41. using Bar::duh;
  42. }