PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 62 lines | 42 code | 20 blank | 0 comment | 0 complexity | e6d41b231c294e94052462891842934c MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module abstract_inherit
  2. %warnfilter(SWIGWARN_TYPE_ABSTRACT) Spam;
  3. %warnfilter(SWIGWARN_TYPE_ABSTRACT) Bar;
  4. %inline %{
  5. class Foo {
  6. public:
  7. virtual ~Foo()
  8. {
  9. }
  10. virtual int blah() = 0;
  11. };
  12. class Bar : public Foo { };
  13. class Spam: public Foo {
  14. public:
  15. Spam() { }
  16. };
  17. template <class Type>
  18. class NRFilter {
  19. public:
  20. virtual ~NRFilter()
  21. {
  22. }
  23. protected:
  24. virtual void do_filter() = 0;
  25. };
  26. template <class Type>
  27. class NRRCFilter : public NRFilter<Type>
  28. {
  29. };
  30. template <class Type>
  31. class NRRCFilterpro : protected NRFilter<Type>
  32. {
  33. };
  34. template <class Type>
  35. class NRRCFilterpri : private NRFilter<Type>
  36. {
  37. };
  38. %}
  39. %template(NRFilter_i) NRFilter<int>;
  40. %template(NRRCFilter_i) NRRCFilter<int>;
  41. %template(NRRCFilterpro_i) NRRCFilterpro<int>;
  42. %template(NRRCFilterpri_i) NRRCFilterpri<int>;