Mercurial > mm7
comparison lib/swig/swigwin-2.0.11/Lib/std/std_multiset.i @ 1899:b3009adc0e2f
Adding swig, gitignore, hgignore
author | Nomad |
---|---|
date | Mon, 21 Oct 2013 10:42:27 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1867:eb580660bbbb | 1899:b3009adc0e2f |
---|---|
1 // | |
2 // std::set | |
3 // | |
4 | |
5 %include <std_set.i> | |
6 | |
7 // Multiset | |
8 | |
9 %define %std_multiset_methods(multiset...) | |
10 %std_set_methods_common(multiset); | |
11 %enddef | |
12 | |
13 | |
14 // ------------------------------------------------------------------------ | |
15 // std::multiset | |
16 // | |
17 // const declarations are used to guess the intent of the function being | |
18 // exported; therefore, the following rationale is applied: | |
19 // | |
20 // -- f(std::multiset<T>), f(const std::multiset<T>&): | |
21 // the parameter being read-only, either a sequence or a | |
22 // previously wrapped std::multiset<T> can be passed. | |
23 // -- f(std::multiset<T>&), f(std::multiset<T>*): | |
24 // the parameter may be modified; therefore, only a wrapped std::multiset | |
25 // can be passed. | |
26 // -- std::multiset<T> f(), const std::multiset<T>& f(): | |
27 // the set is returned by copy; therefore, a sequence of T:s | |
28 // is returned which is most easily used in other functions | |
29 // -- std::multiset<T>& f(), std::multiset<T>* f(): | |
30 // the set is returned by reference; therefore, a wrapped std::multiset | |
31 // is returned | |
32 // -- const std::multiset<T>* f(), f(const std::multiset<T>*): | |
33 // for consistency, they expect and return a plain set pointer. | |
34 // ------------------------------------------------------------------------ | |
35 | |
36 | |
37 // exported classes | |
38 | |
39 namespace std { | |
40 | |
41 //multiset | |
42 | |
43 template <class _Key, class _Compare = std::less<_Key>, | |
44 class _Alloc = allocator<_Key> > | |
45 class multiset { | |
46 public: | |
47 typedef size_t size_type; | |
48 typedef ptrdiff_t difference_type; | |
49 typedef _Key value_type; | |
50 typedef _Key key_type; | |
51 typedef value_type* pointer; | |
52 typedef const value_type* const_pointer; | |
53 typedef value_type& reference; | |
54 typedef const value_type& const_reference; | |
55 typedef _Alloc allocator_type; | |
56 | |
57 %traits_swigtype(_Key); | |
58 | |
59 %fragment(SWIG_Traits_frag(std::multiset<_Key, _Compare, _Alloc >), "header", | |
60 fragment=SWIG_Traits_frag(_Key), | |
61 fragment="StdMultisetTraits") { | |
62 namespace swig { | |
63 template <> struct traits<std::multiset<_Key, _Compare, _Alloc > > { | |
64 typedef pointer_category category; | |
65 static const char* type_name() { | |
66 return "std::multiset<" #_Key "," #_Compare "," #_Alloc " >"; | |
67 } | |
68 }; | |
69 } | |
70 } | |
71 | |
72 %typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >); | |
73 | |
74 multiset( const _Compare& ); | |
75 | |
76 #ifdef %swig_multiset_methods | |
77 // Add swig/language extra methods | |
78 %swig_multiset_methods(std::multiset<_Key, _Compare, _Alloc >); | |
79 #endif | |
80 | |
81 %std_multiset_methods(multiset); | |
82 }; | |
83 } |