jameskilton-rice 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. data/COPYING +23 -0
  2. data/Doxyfile +1253 -0
  3. data/Makefile.am +26 -0
  4. data/Makefile.in +749 -0
  5. data/README +879 -0
  6. data/README.mingw +8 -0
  7. data/Rakefile +72 -0
  8. data/aclocal.m4 +891 -0
  9. data/bootstrap +8 -0
  10. data/config.guess +1526 -0
  11. data/config.sub +1658 -0
  12. data/configure +7668 -0
  13. data/configure.ac +52 -0
  14. data/depcomp +589 -0
  15. data/doxygen.ac +314 -0
  16. data/doxygen.am +186 -0
  17. data/extconf.rb +22 -0
  18. data/install-sh +519 -0
  19. data/missing +367 -0
  20. data/post-autoconf.rb +22 -0
  21. data/post-automake.rb +28 -0
  22. data/rice/Address_Registration_Guard.hpp +7 -0
  23. data/rice/Address_Registration_Guard.ipp +34 -0
  24. data/rice/Address_Registration_Guard_defn.hpp +65 -0
  25. data/rice/Allocation_Strategies.hpp +37 -0
  26. data/rice/Arg.hpp +8 -0
  27. data/rice/Arg_impl.hpp +116 -0
  28. data/rice/Arg_operators.cpp +21 -0
  29. data/rice/Arg_operators.hpp +18 -0
  30. data/rice/Array.hpp +220 -0
  31. data/rice/Array.ipp +263 -0
  32. data/rice/Builtin_Object.hpp +8 -0
  33. data/rice/Builtin_Object.ipp +50 -0
  34. data/rice/Builtin_Object_defn.hpp +51 -0
  35. data/rice/Class.cpp +57 -0
  36. data/rice/Class.hpp +8 -0
  37. data/rice/Class.ipp +6 -0
  38. data/rice/Class_defn.hpp +83 -0
  39. data/rice/Constructor.hpp +339 -0
  40. data/rice/Critical_Guard.hpp +40 -0
  41. data/rice/Critical_Guard.ipp +26 -0
  42. data/rice/Data_Object.hpp +8 -0
  43. data/rice/Data_Object.ipp +133 -0
  44. data/rice/Data_Object_defn.hpp +132 -0
  45. data/rice/Data_Type.cpp +21 -0
  46. data/rice/Data_Type.hpp +8 -0
  47. data/rice/Data_Type.ipp +306 -0
  48. data/rice/Data_Type_defn.hpp +219 -0
  49. data/rice/Data_Type_fwd.hpp +12 -0
  50. data/rice/Director.cpp +19 -0
  51. data/rice/Director.hpp +47 -0
  52. data/rice/Enum.hpp +118 -0
  53. data/rice/Enum.ipp +246 -0
  54. data/rice/Exception.cpp +59 -0
  55. data/rice/Exception.hpp +9 -0
  56. data/rice/Exception_Base.hpp +8 -0
  57. data/rice/Exception_Base.ipp +13 -0
  58. data/rice/Exception_Base_defn.hpp +27 -0
  59. data/rice/Exception_defn.hpp +69 -0
  60. data/rice/Hash.hpp +210 -0
  61. data/rice/Hash.ipp +338 -0
  62. data/rice/Identifier.cpp +8 -0
  63. data/rice/Identifier.hpp +50 -0
  64. data/rice/Identifier.ipp +33 -0
  65. data/rice/Jump_Tag.hpp +24 -0
  66. data/rice/Makefile.am +140 -0
  67. data/rice/Makefile.in +740 -0
  68. data/rice/Module.cpp +84 -0
  69. data/rice/Module.hpp +8 -0
  70. data/rice/Module.ipp +6 -0
  71. data/rice/Module_defn.hpp +88 -0
  72. data/rice/Module_impl.hpp +281 -0
  73. data/rice/Module_impl.ipp +348 -0
  74. data/rice/Object.cpp +153 -0
  75. data/rice/Object.hpp +8 -0
  76. data/rice/Object.ipp +19 -0
  77. data/rice/Object_defn.hpp +183 -0
  78. data/rice/Require_Guard.hpp +21 -0
  79. data/rice/String.cpp +94 -0
  80. data/rice/String.hpp +89 -0
  81. data/rice/Struct.cpp +117 -0
  82. data/rice/Struct.hpp +162 -0
  83. data/rice/Struct.ipp +26 -0
  84. data/rice/Symbol.cpp +25 -0
  85. data/rice/Symbol.hpp +66 -0
  86. data/rice/Symbol.ipp +44 -0
  87. data/rice/VM.cpp +92 -0
  88. data/rice/VM.hpp +32 -0
  89. data/rice/config.hpp +44 -0
  90. data/rice/config.hpp.in +43 -0
  91. data/rice/detail/Arguments.hpp +126 -0
  92. data/rice/detail/Auto_Function_Wrapper.hpp +861 -0
  93. data/rice/detail/Auto_Function_Wrapper.ipp +2929 -0
  94. data/rice/detail/Auto_Member_Function_Wrapper.hpp +828 -0
  95. data/rice/detail/Auto_Member_Function_Wrapper.ipp +2326 -0
  96. data/rice/detail/Caster.hpp +63 -0
  97. data/rice/detail/Exception_Handler.hpp +8 -0
  98. data/rice/detail/Exception_Handler.ipp +68 -0
  99. data/rice/detail/Exception_Handler_defn.hpp +96 -0
  100. data/rice/detail/Iterator.hpp +93 -0
  101. data/rice/detail/Not_Copyable.hpp +25 -0
  102. data/rice/detail/Wrapped_Function.hpp +33 -0
  103. data/rice/detail/check_ruby_type.cpp +27 -0
  104. data/rice/detail/check_ruby_type.hpp +23 -0
  105. data/rice/detail/creation_funcs.hpp +37 -0
  106. data/rice/detail/creation_funcs.ipp +36 -0
  107. data/rice/detail/default_allocation_func.hpp +23 -0
  108. data/rice/detail/default_allocation_func.ipp +11 -0
  109. data/rice/detail/define_method_and_auto_wrap.hpp +31 -0
  110. data/rice/detail/define_method_and_auto_wrap.ipp +30 -0
  111. data/rice/detail/demangle.cpp +56 -0
  112. data/rice/detail/demangle.hpp +19 -0
  113. data/rice/detail/env.hpp +19 -0
  114. data/rice/detail/from_ruby.hpp +43 -0
  115. data/rice/detail/from_ruby.ipp +60 -0
  116. data/rice/detail/method_data.cpp +392 -0
  117. data/rice/detail/method_data.cpp.rpp +301 -0
  118. data/rice/detail/method_data.hpp +21 -0
  119. data/rice/detail/mininode.cpp +1220 -0
  120. data/rice/detail/mininode.cpp.rpp +62 -0
  121. data/rice/detail/mininode.hpp +320 -0
  122. data/rice/detail/mininode.hpp.rpp +119 -0
  123. data/rice/detail/node.hpp +13 -0
  124. data/rice/detail/object_call.hpp +85 -0
  125. data/rice/detail/object_call.ipp +147 -0
  126. data/rice/detail/protect.cpp +29 -0
  127. data/rice/detail/protect.hpp +34 -0
  128. data/rice/detail/remove_const.hpp +21 -0
  129. data/rice/detail/ruby.hpp +89 -0
  130. data/rice/detail/ruby_version_code.hpp +6 -0
  131. data/rice/detail/ruby_version_code.hpp.in +6 -0
  132. data/rice/detail/rubysig.hpp +19 -0
  133. data/rice/detail/st.hpp +60 -0
  134. data/rice/detail/to_ruby.hpp +22 -0
  135. data/rice/detail/to_ruby.ipp +37 -0
  136. data/rice/detail/win32.hpp +16 -0
  137. data/rice/detail/wrap_function.hpp +345 -0
  138. data/rice/detail/wrap_function.ipp +531 -0
  139. data/rice/generate_code.rb +1311 -0
  140. data/rice/global_function.hpp +33 -0
  141. data/rice/global_function.ipp +22 -0
  142. data/rice/protect.hpp +91 -0
  143. data/rice/protect.ipp +803 -0
  144. data/rice/ruby_mark.hpp +13 -0
  145. data/rice/ruby_try_catch.hpp +86 -0
  146. data/rice/rubypp.rb +97 -0
  147. data/rice/to_from_ruby.hpp +8 -0
  148. data/rice/to_from_ruby.ipp +299 -0
  149. data/rice/to_from_ruby_defn.hpp +71 -0
  150. data/ruby.ac +150 -0
  151. data/ruby/Makefile.am +1 -0
  152. data/ruby/Makefile.in +497 -0
  153. data/ruby/lib/Makefile.am +3 -0
  154. data/ruby/lib/Makefile.in +374 -0
  155. data/ruby/lib/mkmf-rice.rb.in +209 -0
  156. data/ruby/lib/version.rb +3 -0
  157. data/sample/Makefile.am +47 -0
  158. data/sample/Makefile.in +380 -0
  159. data/sample/enum/extconf.rb +3 -0
  160. data/sample/enum/sample_enum.cpp +54 -0
  161. data/sample/enum/test.rb +8 -0
  162. data/sample/inheritance/animals.cpp +98 -0
  163. data/sample/inheritance/extconf.rb +3 -0
  164. data/sample/inheritance/test.rb +7 -0
  165. data/sample/map/extconf.rb +3 -0
  166. data/sample/map/map.cpp +81 -0
  167. data/sample/map/test.rb +7 -0
  168. data/test/Makefile.am +49 -0
  169. data/test/Makefile.in +603 -0
  170. data/test/test_Address_Registration_Guard.cpp +43 -0
  171. data/test/test_Allocation_Strategies.cpp +77 -0
  172. data/test/test_Array.cpp +241 -0
  173. data/test/test_Builtin_Object.cpp +72 -0
  174. data/test/test_Class.cpp +398 -0
  175. data/test/test_Constructor.cpp +238 -0
  176. data/test/test_Critical_Guard.cpp +51 -0
  177. data/test/test_Data_Object.cpp +275 -0
  178. data/test/test_Data_Type.cpp +121 -0
  179. data/test/test_Director.cpp +225 -0
  180. data/test/test_Enum.cpp +162 -0
  181. data/test/test_Exception.cpp +46 -0
  182. data/test/test_Hash.cpp +195 -0
  183. data/test/test_Identifier.cpp +70 -0
  184. data/test/test_Jump_Tag.cpp +17 -0
  185. data/test/test_Module.cpp +428 -0
  186. data/test/test_Object.cpp +148 -0
  187. data/test/test_String.cpp +94 -0
  188. data/test/test_Struct.cpp +192 -0
  189. data/test/test_Symbol.cpp +63 -0
  190. data/test/test_To_From_Ruby.cpp +263 -0
  191. data/test/test_VM.cpp +26 -0
  192. data/test/test_global_functions.cpp +97 -0
  193. data/test/test_rice.rb +35 -0
  194. data/test/unittest.cpp +136 -0
  195. data/test/unittest.hpp +292 -0
  196. metadata +247 -0
@@ -0,0 +1,348 @@
1
+ #include "detail/define_method_and_auto_wrap.hpp"
2
+ #include "Object.hpp"
3
+ #include "Address_Registration_Guard.hpp"
4
+ #include "Data_Object.hpp"
5
+ #include "Data_Type.hpp"
6
+ #include "Symbol.hpp"
7
+ #include "Exception.hpp"
8
+ #include "protect.hpp"
9
+
10
+ #include "Module.hpp"
11
+ #include "Class.hpp"
12
+ #include "Data_Type.hpp"
13
+
14
+ #include "detail/ruby.hpp"
15
+ #include "detail/method_data.hpp"
16
+ #include "detail/Iterator.hpp"
17
+
18
+
19
+ inline
20
+ Rice::Module_base::
21
+ Module_base(VALUE v)
22
+ : Object(v)
23
+ , handler_(Qnil)
24
+ , handler_guard_(&handler_)
25
+ {
26
+ }
27
+
28
+ inline
29
+ Rice::Module_base::
30
+ Module_base(Module_base const & other)
31
+ : Object(other)
32
+ , handler_(other.handler_)
33
+ , handler_guard_(&handler_)
34
+ {
35
+ }
36
+
37
+ inline
38
+ Rice::Module_base &
39
+ Rice::Module_base::
40
+ operator=(Module_base const & other)
41
+ {
42
+ Module_base tmp(other);
43
+ swap(tmp);
44
+ return *this;
45
+ }
46
+
47
+ inline
48
+ void
49
+ Rice::Module_base::
50
+ swap(Module_base & other)
51
+ {
52
+ std::swap(handler_, other.handler_);
53
+ Object::swap(other);
54
+ }
55
+
56
+ template<typename Exception_T, typename Functor_T>
57
+ inline
58
+ void
59
+ Rice::Module_base::
60
+ add_handler(Functor_T functor)
61
+ {
62
+ Data_Object<detail::Exception_Handler> handler(
63
+ new detail::
64
+ Functor_Exception_Handler<Exception_T, Functor_T>(
65
+ functor,
66
+ this->handler()),
67
+ rb_cObject);
68
+ this->handler_.swap(handler);
69
+ }
70
+
71
+ inline
72
+ Rice::Object
73
+ Rice::Module_base::
74
+ handler() const
75
+ {
76
+ if(!handler_.test())
77
+ {
78
+ Data_Object<Rice::detail::Default_Exception_Handler> handler(
79
+ new Rice::detail::Default_Exception_Handler,
80
+ rb_cObject);
81
+ handler_.swap(handler);
82
+ }
83
+
84
+ return handler_;
85
+ }
86
+
87
+ template<typename Base_T, typename Derived_T>
88
+ inline
89
+ Rice::Module_impl<Base_T, Derived_T>::
90
+ Module_impl()
91
+ : Base_T()
92
+ {
93
+ }
94
+
95
+ template<typename Base_T, typename Derived_T>
96
+ template<typename T>
97
+ inline
98
+ Rice::Module_impl<Base_T, Derived_T>::
99
+ Module_impl(T const & arg)
100
+ : Base_T(arg)
101
+ {
102
+ }
103
+
104
+ template<typename Base_T, typename Derived_T>
105
+ template<typename Exception_T, typename Functor_T>
106
+ inline
107
+ Derived_T &
108
+ Rice::Module_impl<Base_T, Derived_T>::
109
+ add_handler(
110
+ Functor_T functor)
111
+ {
112
+ Module_base::add_handler<Exception_T>(functor);
113
+ return (Derived_T &)*this;
114
+ }
115
+
116
+ template<typename Base_T, typename Derived_T>
117
+ template<typename Func_T>
118
+ inline
119
+ Derived_T &
120
+ Rice::Module_impl<Base_T, Derived_T>::
121
+ define_method(
122
+ Identifier name,
123
+ Func_T func,
124
+ Arguments* arguments)
125
+ {
126
+ detail::define_method_and_auto_wrap(
127
+ *this, name, func, this->handler(), arguments);
128
+ return (Derived_T &)*this;
129
+ }
130
+
131
+ template<typename Base_T, typename Derived_T>
132
+ template<typename Func_T>
133
+ inline
134
+ Derived_T &
135
+ Rice::Module_impl<Base_T, Derived_T>::
136
+ define_method(
137
+ Identifier name,
138
+ Func_T func,
139
+ Arg const& arg)
140
+ {
141
+ Arguments* args = new Arguments();
142
+ args->add(&arg);
143
+ return define_method(name, func, args);
144
+ }
145
+
146
+
147
+ template<typename Base_T, typename Derived_T>
148
+ template<typename Func_T>
149
+ inline
150
+ Derived_T &
151
+ Rice::Module_impl<Base_T, Derived_T>::
152
+ define_singleton_method(
153
+ Identifier name,
154
+ Func_T func,
155
+ Arguments* arguments)
156
+ {
157
+ detail::define_method_and_auto_wrap(
158
+ rb_class_of(*this), name, func, this->handler(), arguments);
159
+ return (Derived_T &)*this;
160
+ }
161
+
162
+ template<typename Base_T, typename Derived_T>
163
+ template<typename Func_T>
164
+ inline
165
+ Derived_T &
166
+ Rice::Module_impl<Base_T, Derived_T>::
167
+ define_singleton_method(
168
+ Identifier name,
169
+ Func_T func,
170
+ Arg const& arg)
171
+ {
172
+ Arguments* args = new Arguments();
173
+ args->add(&arg);
174
+ return define_singleton_method(name, func, args);
175
+ }
176
+
177
+ template<typename Base_T, typename Derived_T>
178
+ template<typename Func_T>
179
+ inline
180
+ Derived_T &
181
+ Rice::Module_impl<Base_T, Derived_T>::
182
+ define_module_function(
183
+ Identifier name,
184
+ Func_T func,
185
+ Arguments* arguments)
186
+ {
187
+ if(this->rb_type() != T_MODULE)
188
+ {
189
+ throw Rice::Exception(
190
+ rb_eTypeError,
191
+ "can only define module functions for modules");
192
+ }
193
+
194
+ define_method(name, func, arguments);
195
+ define_singleton_method(name, func, arguments);
196
+ return (Derived_T &)*this;
197
+ }
198
+
199
+ template<typename Base_T, typename Derived_T>
200
+ template<typename Func_T>
201
+ inline
202
+ Derived_T &
203
+ Rice::Module_impl<Base_T, Derived_T>::
204
+ define_module_function(
205
+ Identifier name,
206
+ Func_T func,
207
+ Arg const& arg)
208
+ {
209
+ Arguments* args = new Arguments();
210
+ args->add(&arg);
211
+ return define_module_function(name, func, args);
212
+ }
213
+
214
+ template<typename Base_T, typename Derived_T>
215
+ template<typename T, typename Iterator_T>
216
+ inline
217
+ Derived_T &
218
+ Rice::Module_impl<Base_T, Derived_T>::
219
+ define_iterator(
220
+ Iterator_T (T::*begin)(),
221
+ Iterator_T (T::*end)(),
222
+ Identifier name)
223
+ {
224
+ detail::define_iterator(*this, name, begin, end);
225
+ return (Derived_T &)*this;
226
+ }
227
+
228
+ namespace Rice
229
+ {
230
+
231
+ namespace detail
232
+ {
233
+
234
+ inline VALUE
235
+ include_module(VALUE mod, VALUE inc)
236
+ {
237
+ rb_include_module(mod, inc);
238
+ return Qnil;
239
+ }
240
+
241
+ inline VALUE
242
+ const_set(VALUE mod, ID name, VALUE value)
243
+ {
244
+ rb_const_set(mod, name, value);
245
+ return Qnil;
246
+ }
247
+
248
+ } // namespace detail
249
+
250
+ } // namespace Rice
251
+
252
+ template<typename Base_T, typename Derived_T>
253
+ inline
254
+ Derived_T &
255
+ Rice::Module_impl<Base_T, Derived_T>::
256
+ include_module(
257
+ Module const & inc)
258
+ {
259
+ protect(detail::include_module, *this, inc);
260
+ return (Derived_T &)*this;
261
+ }
262
+
263
+ template<typename Base_T, typename Derived_T>
264
+ inline
265
+ Derived_T &
266
+ Rice::Module_impl<Base_T, Derived_T>::
267
+ const_set(
268
+ Identifier name,
269
+ Object value)
270
+ {
271
+ protect(detail::const_set, *this, name, value);
272
+ return (Derived_T &)*this;
273
+ }
274
+
275
+ template<typename Base_T, typename Derived_T>
276
+ inline
277
+ Rice::Object
278
+ Rice::Module_impl<Base_T, Derived_T>::
279
+ const_get(
280
+ Identifier name) const
281
+ {
282
+ return protect(rb_const_get, *this, name);
283
+ }
284
+
285
+ template<typename Base_T, typename Derived_T>
286
+ inline
287
+ bool
288
+ Rice::Module_impl<Base_T, Derived_T>::
289
+ const_defined(Identifier name) const
290
+ {
291
+ int result = protect(rb_const_defined, *this, name);
292
+ return bool(result);
293
+ }
294
+
295
+ template<typename Base_T, typename Derived_T>
296
+ inline
297
+ void
298
+ Rice::Module_impl<Base_T, Derived_T>::
299
+ remove_const(Identifier name)
300
+ {
301
+ protect(rb_mod_remove_const, *this, Symbol(name));
302
+ }
303
+
304
+ template<typename Base_T, typename Derived_T>
305
+ inline
306
+ Rice::Module
307
+ Rice::Module_impl<Base_T, Derived_T>::
308
+ define_module(
309
+ char const * name)
310
+ {
311
+ return Rice::define_module_under(*this, name);
312
+ }
313
+
314
+ template<typename Base_T, typename Derived_T>
315
+ inline
316
+ Rice::Class
317
+ Rice::Module_impl<Base_T, Derived_T>::
318
+ define_class(
319
+ char const * name,
320
+ Object superclass)
321
+ {
322
+ return Rice::define_class_under(*this, name, superclass);
323
+ }
324
+
325
+ template<typename Base_T, typename Derived_T>
326
+ template<typename T>
327
+ inline
328
+ Rice::Data_Type<T>
329
+ Rice::Module_impl<Base_T, Derived_T>::
330
+ define_class_with_object_as_base(
331
+ char const * name)
332
+ {
333
+ return Rice::define_class_under<T>(*this, name);
334
+ }
335
+
336
+ template<typename Base_T, typename Derived_T>
337
+ template<typename T, typename T_Base_T>
338
+ inline
339
+ Rice::Data_Type<T>
340
+ Rice::Module_impl<Base_T, Derived_T>::
341
+ define_class(
342
+ char const * name)
343
+ {
344
+ return Rice::define_class_under<T, T_Base_T>(
345
+ *this,
346
+ name);
347
+ }
348
+
data/rice/Object.cpp ADDED
@@ -0,0 +1,153 @@
1
+ #include "Object.hpp"
2
+ #include "Class.hpp"
3
+ #include "String.hpp"
4
+ #include "Array.hpp"
5
+
6
+ #include <algorithm>
7
+ #include <iostream>
8
+
9
+ namespace Rice
10
+ {
11
+
12
+ Object const Nil(Qnil);
13
+ Object const True(Qtrue);
14
+ Object const False(Qfalse);
15
+ Object const Undef(Qundef);
16
+
17
+ }
18
+
19
+ Rice::Class Rice::Object::
20
+ class_of() const {
21
+ return rb_class_of(value_);
22
+ }
23
+
24
+ int Rice::Object::
25
+ compare(Object const & other) const
26
+ {
27
+ Object result = call("<=>", other);
28
+ return from_ruby<int>(result);
29
+ }
30
+
31
+ void Rice::Object::
32
+ freeze()
33
+ {
34
+ protect(rb_obj_freeze, value());
35
+ }
36
+
37
+ bool Rice::Object::
38
+ is_frozen() const
39
+ {
40
+ return bool(OBJ_FROZEN(value()));
41
+ }
42
+
43
+ Rice::String Rice::Object::
44
+ to_s() const {
45
+ return call("to_s");
46
+ }
47
+
48
+ Rice::String Rice::Object::
49
+ inspect() const {
50
+ return call("inspect");
51
+ }
52
+
53
+ void Rice::Object::
54
+ swap(Rice::Object & other)
55
+ {
56
+ std::swap(value_, other.value_);
57
+ }
58
+
59
+ Rice::Object Rice::Object::
60
+ instance_eval(String const & s)
61
+ {
62
+ VALUE argv[] = { s.value() };
63
+ return protect(rb_obj_instance_eval, 1, &argv[0], *this);
64
+ }
65
+
66
+ int Rice::Object::
67
+ rb_type() const
68
+ {
69
+ return ::rb_type(*this);
70
+ }
71
+
72
+ bool Rice::Object::
73
+ is_a(Object klass) const
74
+ {
75
+ Object result = protect(rb_obj_is_kind_of, *this, klass);
76
+ return result.test();
77
+ }
78
+
79
+ bool Rice::Object::
80
+ respond_to(Identifier id) const
81
+ {
82
+ return bool(rb_respond_to(*this, id));
83
+ }
84
+
85
+ bool Rice::Object::
86
+ is_instance_of(Object klass) const
87
+ {
88
+ Object result = protect(rb_obj_is_instance_of, *this, klass);
89
+ return result.test();
90
+ }
91
+
92
+ Rice::Object Rice::Object::
93
+ iv_get(
94
+ Identifier name) const
95
+ {
96
+ return protect(rb_iv_get, *this, name.c_str());
97
+ }
98
+
99
+ Rice::Object Rice::Object::
100
+ vcall(
101
+ Identifier id,
102
+ Array args)
103
+ {
104
+ return protect(rb_funcall3, *this, id, args.size(), args.to_c_array());
105
+ }
106
+
107
+ void Rice::Object::
108
+ mark() const
109
+ {
110
+ rb_gc_mark(*this);
111
+ }
112
+
113
+ void Rice::Object::
114
+ set_value(VALUE v)
115
+ {
116
+ value_ = v;
117
+ }
118
+
119
+ std::ostream & Rice::
120
+ operator<<(std::ostream & out, Rice::Object const & obj)
121
+ {
122
+ String s(obj.to_s());
123
+ out << s.c_str();
124
+ return out;
125
+ }
126
+
127
+ bool Rice::
128
+ operator==(Rice::Object const & lhs, Rice::Object const & rhs)
129
+ {
130
+ Object result = lhs.call("==", rhs);
131
+ return result.test();
132
+ }
133
+
134
+ bool Rice::
135
+ operator!=(Rice::Object const & lhs, Rice::Object const & rhs)
136
+ {
137
+ return !(lhs == rhs);
138
+ }
139
+
140
+ bool Rice::
141
+ operator<(Rice::Object const & lhs, Rice::Object const & rhs)
142
+ {
143
+ Object result = lhs.call("<", rhs);
144
+ return result.test();
145
+ }
146
+
147
+ bool Rice::
148
+ operator>(Rice::Object const & lhs, Rice::Object const & rhs)
149
+ {
150
+ Object result = lhs.call(">", rhs);
151
+ return result.test();
152
+ }
153
+