PageRenderTime 33ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 64 lines | 46 code | 18 blank | 0 comment | 0 complexity | 5b88b57e1f66605ddfb975dfbcb825dd MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module template_specialization_enum
  2. %warnfilter(SWIGWARN_RUBY_WRONG_NAME) Hello; /* Ruby, wrong class name */
  3. %warnfilter(SWIGWARN_RUBY_WRONG_NAME) Hi; /* Ruby, wrong class name */
  4. %warnfilter(SWIGWARN_GO_NAME_CONFLICT); /* Ignoring 'hello due to Go name ('Hello) conflict with 'Hello' */
  5. %inline %{
  6. enum Hello
  7. {
  8. hi, hello
  9. };
  10. template <Hello, class A>
  11. struct C
  12. {
  13. };
  14. template <Hello, class BB>
  15. struct Base
  16. {
  17. };
  18. template <class A>
  19. struct C<hello , A> : Base<hello, A>
  20. {
  21. int fhello()
  22. {
  23. return hello;
  24. }
  25. protected:
  26. C()
  27. {
  28. }
  29. };
  30. template <class A>
  31. struct C<hi , A> : Base<hi, A>
  32. {
  33. int fhi()
  34. {
  35. return hi;
  36. }
  37. protected:
  38. C()
  39. {
  40. }
  41. };
  42. %}
  43. %template(Base_dd) Base<hi, int>;
  44. %template(Base_ii) Base<hello, int>;
  45. %template(C_i) C<hi, int>;
  46. %template(C_d) C<hello, int>;