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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-09-01 18:35:55 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050901183555-eq59uwhq8b62e44c
Tags: 1.3.24-1ubuntu4
* Use php5-dev instead of php4-dev, to kick php4 out of main.
* Drop support for generation of pike bindings, as nothing uses it,
  and swig is the only thing keeping pike7.6 in main (Ubuntu #13796)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module li_std_map
 
2
 
 
3
%include std_pair.i
 
4
%include std_map.i
 
5
%include std_multimap.i
 
6
 
 
7
%inline %{
 
8
struct A{
 
9
    int val;
 
10
    
 
11
    A(int v = 0): val(v)
 
12
    {
 
13
    }
 
14
 
 
15
};
 
16
%}
 
17
 
 
18
namespace std
 
19
{
 
20
  %template(pairii) pair<int, int>;
 
21
  %template(pairAA) pair<int, A>;
 
22
  %template(pairA) pair<int, A*>;
 
23
  %template(mapA) map<int, A*>;
 
24
  %template(mmapA) multimap<int, A*>;
 
25
 
 
26
  %template(paircA1) pair<const int, A*>;
 
27
  %template(paircA2) pair<const int, const A*>;
 
28
  %template(pairiiA) pair<int,pair<int, A*> >;
 
29
  %template(pairiiAc) pair<int,const pair<int, A*> >;
 
30
}
 
31
 
 
32
 
 
33
 
 
34
%inline 
 
35
{
 
36
std::pair<int, A*> 
 
37
p_identa(std::pair<int, A*> p) {
 
38
  return p;
 
39
}
 
40
 
 
41
std::map<int,A*> m_identa(const std::map<int,A*>& v)
 
42
{
 
43
  return v;
 
44
}
 
45
 
 
46
}
 
47
 
 
48
 
 
49
 
 
50