annotate lib/swig/swigwin-2.0.11/Lib/std/std_common.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 %include <std/std_except.i>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 // Use the following macro with modern STL implementations
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 //#define SWIG_STD_MODERN_STL
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 // Use this to deactive the previous definition, when using gcc-2.95
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 // or similar old compilers.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 //#define SWIG_STD_NOMODERN_STL
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 // Here, we identify compilers we know have problems with STL.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 #if defined(__GNUC__)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 # if __GNUC__ == 2 && __GNUC_MINOR <= 96
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 # define SWIG_STD_NOMODERN_STL
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 # endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 // Common code for supporting the C++ std namespace
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 //
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 #include <string>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 #include <stdexcept>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 #include <stddef.h>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 %fragment("StdIteratorTraits","header",fragment="<stddef.h>") %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 #if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 # if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 # define SWIG_STD_NOITERATOR_TRAITS_STL
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 # endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 #if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 #include <iterator>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 namespace std {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 template <class Iterator>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 struct iterator_traits {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 typedef ptrdiff_t difference_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 typedef typename Iterator::value_type value_type;
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 template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 typedef Distance difference_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 typedef T value_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 template <class T>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 struct iterator_traits<T*> {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 typedef T value_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 typedef ptrdiff_t difference_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 template<typename _InputIterator>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 inline typename iterator_traits<_InputIterator>::difference_type
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 distance(_InputIterator __first, _InputIterator __last)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 typename iterator_traits<_InputIterator>::difference_type __n = 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 while (__first != __last) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 ++__first; ++__n;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 return __n;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 %fragment("StdTraitsCommon","header") %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 namespace swig {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 template <class Type>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 struct noconst_traits {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 typedef Type noconst_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 template <class Type>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 struct noconst_traits<const Type> {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85 typedef Type noconst_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89 type categories
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91 struct pointer_category { };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92 struct value_category { };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95 General traits that provides type_name and type_info
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
96 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
97 template <class Type> struct traits { };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
98
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
99 template <class Type>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
100 inline const char* type_name() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
101 return traits<typename noconst_traits<Type >::noconst_type >::type_name();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
102 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
103
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
104 template <class Type>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
105 struct traits_info {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
106 static swig_type_info *type_query(std::string name) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
107 name += " *";
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
108 return SWIG_TypeQuery(name.c_str());
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
109 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
110 static swig_type_info *type_info() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
111 static swig_type_info *info = type_query(type_name<Type>());
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
112 return info;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
113 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
114 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
115
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
116 template <class Type>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
117 inline swig_type_info *type_info() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
118 return traits_info<Type>::type_info();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
119 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
120
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
121 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
122 Partial specialization for pointers
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
123 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
124 template <class Type> struct traits <Type *> {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
125 typedef pointer_category category;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
126 static std::string make_ptr_name(const char* name) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
127 std::string ptrname = name;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
128 ptrname += " *";
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
129 return ptrname;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
130 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
131 static const char* type_name() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
132 static std::string name = make_ptr_name(swig::type_name<Type>());
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
133 return name.c_str();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
134 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
135 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
136
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
137 template <class Type, class Category>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
138 struct traits_as { };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
139
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
140 template <class Type, class Category>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
141 struct traits_check { };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
142
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
143 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
144 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
145
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
146 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
147 Generate the traits for a swigtype
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
148 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
149
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
150 %define %traits_swigtype(Type...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
151 %fragment(SWIG_Traits_frag(Type),"header",fragment="StdTraits") {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
152 namespace swig {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
153 template <> struct traits<Type > {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
154 typedef pointer_category category;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
155 static const char* type_name() { return #Type; }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
156 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
157 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
158 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
159 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
160
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
161
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
162
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
163 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
164 Generate the typemaps for a class that has 'value' traits
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
165 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
166
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
167 %define %typemap_traits(Code,Type...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
168 %typemaps_asvalfrom(%arg(Code),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
169 %arg(swig::asval<Type >),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
170 %arg(swig::from),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
171 %arg(SWIG_Traits_frag(Type)),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
172 %arg(SWIG_Traits_frag(Type)),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
173 Type);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
174 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
175
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
176 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
177 Generate the typemaps for a class that behaves more like a 'pointer' or
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
178 plain wrapped Swigtype.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
179 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
180
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
181 %define %typemap_traits_ptr(Code,Type...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
182 %typemaps_asptrfrom(%arg(Code),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
183 %arg(swig::asptr),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
184 %arg(swig::from),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
185 %arg(SWIG_Traits_frag(Type)),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
186 %arg(SWIG_Traits_frag(Type)),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
187 Type);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
188 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
189
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
190
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
191 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
192 Equality methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
193 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
194 %define %std_equal_methods(Type...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
195 %extend Type {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
196 bool operator == (const Type& v) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
197 return *self == v;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
198 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
199
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
200 bool operator != (const Type& v) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
201 return *self != v;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
202 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
203 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
204
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
205 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
206
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
207 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
208 Order methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
209 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
210
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
211 %define %std_order_methods(Type...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
212 %extend Type {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
213 bool operator > (const Type& v) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
214 return *self > v;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
215 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
216
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
217 bool operator < (const Type& v) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
218 return *self < v;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
219 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
220
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
221 bool operator >= (const Type& v) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
222 return *self >= v;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
223 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
224
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
225 bool operator <= (const Type& v) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
226 return *self <= v;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
227 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
228 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
229 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
230
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
231 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
232 Comparison methods
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
233 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
234
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
235 %define %std_comp_methods(Type...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
236 %std_equal_methods(Type )
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
237 %std_order_methods(Type )
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
238 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
239