~ubuntu-branches/ubuntu/hardy/swig1.3/hardy

« back to all changes in this revision

Viewing changes to Examples/test-suite/python/template_matrix.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module template_matrix
 
2
%{
 
3
#include <vector>
 
4
 
 
5
  struct pop 
 
6
  {
 
7
  };  
 
8
 
 
9
%}
 
10
 
 
11
%include "std_vector.i"
 
12
 
 
13
 
 
14
%inline {
 
15
namespace simuPOP
 
16
{
 
17
  struct POP
 
18
  {
 
19
  };  
 
20
 
 
21
  template<class _POP1, class _POP2 = POP>
 
22
  class Operator
 
23
  {
 
24
  };
 
25
}
 
26
 
 
27
}
 
28
 
 
29
%template(vectorop) std::vector< simuPOP::Operator<pop> >;
 
30
 
 
31
 
 
32
 
 
33
namespace simuPOP
 
34
{
 
35
  %template(baseOperator)        Operator<pop>;
 
36
}
 
37
 
 
38
 
 
39
#if 1
 
40
 
 
41
namespace std
 
42
{
 
43
%template(vectori)     vector<int>;
 
44
%template(matrixi)     vector< vector<int> >;
 
45
%template(cubei)       vector< vector< vector<int> > >;
 
46
}
 
47
 
 
48
 
 
49
 
 
50
%inline %{
 
51
std::vector<int>
 
52
passVector(const std::vector<int>& a)
 
53
{
 
54
  return a;
 
55
}
 
56
 
 
57
std::vector< std::vector<int> >
 
58
passMatrix(const  std::vector< std::vector<int> >& a)
 
59
{
 
60
  return a;
 
61
}
 
62
 
 
63
std::vector< std::vector< std::vector<int> > >
 
64
passCube(const  std::vector< std::vector< std::vector<int> > >& a)
 
65
{
 
66
  return a;
 
67
}
 
68
 
 
69
%}
 
70
 
 
71
#endif