1 /* This file is part of NIT ( http://www.nitlanguage.org ).
3 * Copyright 2011 Alexis Laferrière <alexis.laf@xymus.net>
5 * This file is free software, which comes along with NIT. This software is
6 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8 * PARTICULAR PURPOSE. You can modify it is you want, provided this header
9 * is kept unaltered, and a notification of the changes is added.
10 * You are allowed to redistribute it and sell it, alone or is a part of
14 #include "test_ni_operators.nit.h"
17 C implementation of test_ni_operators::A::+
19 Imported methods signatures:
20 bigint A_value( A recv ) for test_ni_operators::A::value
21 A new_A( bigint value ) for test_ni_operators::A::init
23 A
A__plus___impl( A recv
, A other
)
26 int s
= A_value( recv
);
27 int o
= A_value( other
);
29 return new_A( s
+ o
);
34 C implementation of test_ni_operators::A::-
36 Imported methods signatures:
37 bigint A_value( A recv ) for test_ni_operators::A::value
38 A new_A( bigint value ) for test_ni_operators::A::init
40 A
A__minus___impl( A recv
, A other
)
43 int s
= A_value( recv
);
44 int o
= A_value( other
);
46 return new_A( s
- o
);
51 C implementation of test_ni_operators::A::*
53 Imported methods signatures:
54 bigint A_value( A recv ) for test_ni_operators::A::value
55 A new_A( bigint value ) for test_ni_operators::A::init
57 A
A__star___impl( A recv
, bigint by
)
60 int s
= A_value( recv
);
62 return new_A( s
* by
);
67 C implementation of test_ni_operators::A::/
69 Imported methods signatures:
70 bigint A_value( A recv ) for test_ni_operators::A::value
71 A new_A( bigint value ) for test_ni_operators::A::init
73 A
A__slash___impl( A recv
, bigint by
)
76 int s
= A_value( recv
);
78 return new_A( s
/ by
);
83 C implementation of test_ni_operators::A::(kernel::Object::==)
85 Imported methods signatures:
86 bigint A_value( A recv ) for test_ni_operators::A::value
87 int nullable_Object_is_a_A( nullable_Object value ) to check if a nullable Object is a A
88 A nullable_Object_as_A( nullable_Object value ) to cast from nullable Object to A
90 int A__equal___impl( A recv
, nullable_Object other
)
93 if ( nullable_Object_is_a_A( other
) &&
94 A_value( nullable_Object_as_A(other
) ) == A_value( recv
) )
102 C implementation of test_ni_operators::A::%
104 Imported methods signatures:
105 bigint A_value( A recv ) for test_ni_operators::A::value
106 A new_A( bigint value ) for test_ni_operators::A::init
108 A
A__percent___impl( A recv
, A other
)
111 return new_A( A_value( recv
) % A_value( other
) );
116 C implementation of test_ni_operators::A::<=>
118 Imported methods signatures:
119 bigint A_value( A recv ) for test_ni_operators::A::value
120 A new_A( bigint value ) for test_ni_operators::A::init
122 A
A__starship___impl( A recv
, A other
)
125 return new_A( A_value( recv
)* 1024 );
130 C implementation of test_ni_operators::A::>
132 Imported methods signatures:
133 bigint A_value( A recv ) for test_ni_operators::A::value
135 int A__greater___impl( A recv
, A other
)
138 return A_value( recv
) > A_value( other
);
143 C implementation of test_ni_operators::A::<
145 Imported methods signatures:
146 bigint A_value( A recv ) for test_ni_operators::A::value
148 int A__less___impl( A recv
, A other
)
151 return A_value( recv
) < A_value( other
);
156 C implementation of test_ni_operators::A::>=
158 Imported methods signatures:
159 bigint A_value( A recv ) for test_ni_operators::A::value
161 int A__ge___impl( A recv
, A other
)
164 return A_value( recv
) >= A_value( other
);
169 C implementation of test_ni_operators::A::<=
171 Imported methods signatures:
172 bigint A_value( A recv ) for test_ni_operators::A::value
174 int A__less_or_equal___impl( A recv
, A other
)
177 return A_value( recv
) <= A_value( other
);
182 C implementation of test_ni_operators::A::>>
184 Imported methods signatures:
185 bigint A_value( A recv ) for test_ni_operators::A::value
186 void A_value__assign( A recv, bigint value ) for test_ni_operators::A::value=
187 A new_A( bigint value ) for test_ni_operators::A::init
189 void A__right___impl( A recv
, A other
)
192 int new_val
= A_value( recv
) >> A_value( other
);
193 A_value__assign( recv
, new_val
);
198 C implementation of test_ni_operators::A::<<
200 Imported methods signatures:
201 bigint A_value( A recv ) for test_ni_operators::A::value
202 A new_A( bigint value ) for test_ni_operators::A::init
204 void A__left___impl( A recv
, A other
)
207 int new_val
= A_value( recv
) << A_value( other
);
208 A_value__assign( recv
, new_val
);
213 C implementation of test_ni_operators::A::[]
215 Imported methods signatures:
216 A new_A( bigint value ) for test_ni_operators::A::init
218 A
A__index___impl( A recv
, bigint index
)
221 return new_A( index
);
226 C implementation of test_ni_operators::A::[]=
228 Imported methods signatures:
229 A new_A( bigint value ) for test_ni_operators::A::init
231 A
A__index_assign___impl( A recv
, bigint index
, A value
)
234 return new_A( index
+ A_value( value
) );