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

/tags/rel-1-3-26/SWIG/Examples/test-suite/python/template_matrix.i

#
Swig | 71 lines | 50 code | 21 blank | 0 comment | 0 complexity | 68fe073e8a0566884195a3fc80a38f6a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module template_matrix
  2. %{
  3. #include <vector>
  4. struct pop
  5. {
  6. };
  7. %}
  8. %include "std_vector.i"
  9. %inline {
  10. namespace simuPOP
  11. {
  12. struct POP
  13. {
  14. };
  15. template<class _POP1, class _POP2 = POP>
  16. class Operator
  17. {
  18. };
  19. }
  20. }
  21. %template(vectorop) std::vector< simuPOP::Operator<pop> >;
  22. namespace simuPOP
  23. {
  24. %template(baseOperator) Operator<pop>;
  25. }
  26. #if 1
  27. namespace std
  28. {
  29. %template(vectori) vector<int>;
  30. %template(matrixi) vector< vector<int> >;
  31. %template(cubei) vector< vector< vector<int> > >;
  32. }
  33. %inline %{
  34. std::vector<int>
  35. passVector(const std::vector<int>& a)
  36. {
  37. return a;
  38. }
  39. std::vector< std::vector<int> >
  40. passMatrix(const std::vector< std::vector<int> >& a)
  41. {
  42. return a;
  43. }
  44. std::vector< std::vector< std::vector<int> > >
  45. passCube(const std::vector< std::vector< std::vector<int> > >& a)
  46. {
  47. return a;
  48. }
  49. %}
  50. #endif