annotate lib/swig/swigwin-2.0.11/Lib/std/std_set.i @ 1980:c1c74df0a33e

changing most of auto types to their actual types
author Grumpy7
date Wed, 30 Oct 2013 00:47:37 -0700
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 // std::set
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 %include <std_container.i>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 %include <std_pair.i>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 // Set
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 %define %std_set_methods_common(set...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 set();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 set( const set& );
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 bool empty() const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 size_type size() const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 void clear();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 void swap(set& v);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 size_type erase(const key_type& x);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 size_type count(const key_type& x) const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 #ifdef SWIG_EXPORT_ITERATOR_METHODS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 class iterator;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 class reverse_iterator;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 iterator begin();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 iterator end();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 reverse_iterator rbegin();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 reverse_iterator rend();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 void erase(iterator pos);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 void erase(iterator first, iterator last);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 iterator find(const key_type& x);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 iterator lower_bound(const key_type& x);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 iterator upper_bound(const key_type& x);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 std::pair<iterator,iterator> equal_range(const key_type& x);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 %define %std_set_methods(set...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 %std_set_methods_common(set);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 #ifdef SWIG_EXPORT_ITERATOR_METHODS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 std::pair<iterator,bool> insert(const value_type& __x);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 // ------------------------------------------------------------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 // std::set
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 // const declarations are used to guess the intent of the function being
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 // exported; therefore, the following rationale is applied:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 // -- f(std::set<T>), f(const std::set<T>&):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 // the parameter being read-only, either a sequence or a
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 // previously wrapped std::set<T> can be passed.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 // -- f(std::set<T>&), f(std::set<T>*):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 // the parameter may be modified; therefore, only a wrapped std::set
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 // can be passed.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 // -- std::set<T> f(), const std::set<T>& f():
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 // the set is returned by copy; therefore, a sequence of T:s
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 // is returned which is most easily used in other functions
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 // -- std::set<T>& f(), std::set<T>* f():
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 // the set is returned by reference; therefore, a wrapped std::set
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 // is returned
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 // -- const std::set<T>* f(), f(const std::set<T>*):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 // for consistency, they expect and return a plain set pointer.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 // ------------------------------------------------------------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 #include <set>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 // exported classes
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 namespace std {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 template <class _Key, class _Compare = std::less<_Key>,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 class _Alloc = allocator<_Key> >
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 class set {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 public:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 typedef size_t size_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 typedef ptrdiff_t difference_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85 typedef _Key value_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 typedef _Key key_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87 typedef value_type* pointer;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 typedef const value_type* const_pointer;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89 typedef value_type& reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90 typedef const value_type& const_reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91 typedef _Alloc allocator_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93 %traits_swigtype(_Key);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95 %fragment(SWIG_Traits_frag(std::set<_Key, _Compare, _Alloc >), "header",
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
96 fragment=SWIG_Traits_frag(_Key),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
97 fragment="StdSetTraits") {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
98 namespace swig {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
99 template <> struct traits<std::set<_Key, _Compare, _Alloc > > {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
100 typedef pointer_category category;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
101 static const char* type_name() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
102 return "std::set<" #_Key "," #_Compare "," #_Alloc " >";
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
103 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
104 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
105 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
106 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
107
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
108 %typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<_Key, _Compare, _Alloc >);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
109
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
110 set( const _Compare& );
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
111
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
112 #ifdef %swig_set_methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
113 // Add swig/language extra methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
114 %swig_set_methods(std::set<_Key, _Compare, _Alloc >);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
115 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
116
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
117 %std_set_methods(set);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
118 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
119 }