rice 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/COPYING +23 -0
  2. data/Doxyfile +1253 -0
  3. data/Makefile.am +26 -0
  4. data/Makefile.in +736 -0
  5. data/README +881 -0
  6. data/README.mingw +8 -0
  7. data/bootstrap +8 -0
  8. data/config.guess +1535 -0
  9. data/config.sub +1644 -0
  10. data/configure +7310 -0
  11. data/configure.ac +48 -0
  12. data/depcomp +584 -0
  13. data/doxygen.ac +314 -0
  14. data/doxygen.am +186 -0
  15. data/install-sh +507 -0
  16. data/missing +367 -0
  17. data/post-autoconf.rb +22 -0
  18. data/post-automake.rb +28 -0
  19. data/rice/Address_Registration_Guard.hpp +7 -0
  20. data/rice/Address_Registration_Guard.ipp +34 -0
  21. data/rice/Address_Registration_Guard_defn.hpp +65 -0
  22. data/rice/Allocation_Strategies.hpp +37 -0
  23. data/rice/Array.hpp +220 -0
  24. data/rice/Array.ipp +262 -0
  25. data/rice/Builtin_Object.hpp +8 -0
  26. data/rice/Builtin_Object.ipp +50 -0
  27. data/rice/Builtin_Object_defn.hpp +51 -0
  28. data/rice/Class.cpp +57 -0
  29. data/rice/Class.hpp +8 -0
  30. data/rice/Class.ipp +4 -0
  31. data/rice/Class_defn.hpp +83 -0
  32. data/rice/Constructor.hpp +189 -0
  33. data/rice/Critical_Guard.hpp +34 -0
  34. data/rice/Critical_Guard.ipp +20 -0
  35. data/rice/Data_Object.hpp +127 -0
  36. data/rice/Data_Object.ipp +129 -0
  37. data/rice/Data_Type.cpp +21 -0
  38. data/rice/Data_Type.hpp +8 -0
  39. data/rice/Data_Type.ipp +227 -0
  40. data/rice/Data_Type_defn.hpp +219 -0
  41. data/rice/Data_Type_fwd.hpp +12 -0
  42. data/rice/Enum.hpp +118 -0
  43. data/rice/Enum.ipp +246 -0
  44. data/rice/Exception.cpp +59 -0
  45. data/rice/Exception.hpp +69 -0
  46. data/rice/Exception_Base.hpp +30 -0
  47. data/rice/Exception_Base.ipp +11 -0
  48. data/rice/Hash.hpp +206 -0
  49. data/rice/Hash.ipp +336 -0
  50. data/rice/Identifier.cpp +8 -0
  51. data/rice/Identifier.hpp +50 -0
  52. data/rice/Identifier.ipp +33 -0
  53. data/rice/Jump_Tag.hpp +24 -0
  54. data/rice/Makefile.am +112 -0
  55. data/rice/Makefile.in +675 -0
  56. data/rice/Module.cpp +75 -0
  57. data/rice/Module.hpp +8 -0
  58. data/rice/Module.ipp +6 -0
  59. data/rice/Module_defn.hpp +87 -0
  60. data/rice/Module_impl.hpp +237 -0
  61. data/rice/Module_impl.ipp +302 -0
  62. data/rice/Object.cpp +153 -0
  63. data/rice/Object.hpp +8 -0
  64. data/rice/Object.ipp +19 -0
  65. data/rice/Object_defn.hpp +183 -0
  66. data/rice/Require_Guard.hpp +21 -0
  67. data/rice/String.cpp +93 -0
  68. data/rice/String.hpp +88 -0
  69. data/rice/Struct.cpp +117 -0
  70. data/rice/Struct.hpp +162 -0
  71. data/rice/Struct.ipp +26 -0
  72. data/rice/Symbol.cpp +25 -0
  73. data/rice/Symbol.hpp +66 -0
  74. data/rice/Symbol.ipp +44 -0
  75. data/rice/VM.cpp +79 -0
  76. data/rice/VM.hpp +27 -0
  77. data/rice/config.hpp +23 -0
  78. data/rice/config.hpp.in +22 -0
  79. data/rice/detail/Auto_Function_Wrapper.hpp +719 -0
  80. data/rice/detail/Auto_Function_Wrapper.ipp +1354 -0
  81. data/rice/detail/Auto_Member_Function_Wrapper.hpp +685 -0
  82. data/rice/detail/Auto_Member_Function_Wrapper.ipp +1435 -0
  83. data/rice/detail/Caster.hpp +61 -0
  84. data/rice/detail/Exception_Handler.hpp +118 -0
  85. data/rice/detail/Iterator_Definer.hpp +98 -0
  86. data/rice/detail/Not_Copyable.hpp +25 -0
  87. data/rice/detail/Wrapped_Function.hpp +33 -0
  88. data/rice/detail/check_ruby_type.cpp +21 -0
  89. data/rice/detail/check_ruby_type.hpp +23 -0
  90. data/rice/detail/creation_funcs.hpp +45 -0
  91. data/rice/detail/creation_funcs.ipp +62 -0
  92. data/rice/detail/default_allocation_func.hpp +23 -0
  93. data/rice/detail/default_allocation_func.ipp +11 -0
  94. data/rice/detail/define_method_and_auto_wrap.hpp +27 -0
  95. data/rice/detail/define_method_and_auto_wrap.ipp +20 -0
  96. data/rice/detail/env.hpp +13 -0
  97. data/rice/detail/from_ruby.hpp +43 -0
  98. data/rice/detail/from_ruby.ipp +74 -0
  99. data/rice/detail/method_data.cpp +105 -0
  100. data/rice/detail/method_data.hpp +33 -0
  101. data/rice/detail/node.hpp +13 -0
  102. data/rice/detail/object_call.hpp +85 -0
  103. data/rice/detail/object_call.ipp +147 -0
  104. data/rice/detail/protect.cpp +27 -0
  105. data/rice/detail/protect.hpp +34 -0
  106. data/rice/detail/remove_const.hpp +21 -0
  107. data/rice/detail/ruby.hpp +85 -0
  108. data/rice/detail/rubysig.hpp +13 -0
  109. data/rice/detail/st.hpp +56 -0
  110. data/rice/detail/to_ruby.hpp +16 -0
  111. data/rice/detail/to_ruby.ipp +10 -0
  112. data/rice/detail/win32.hpp +16 -0
  113. data/rice/detail/wrap_function.hpp +288 -0
  114. data/rice/detail/wrap_function.ipp +473 -0
  115. data/rice/generate_code.rb +1092 -0
  116. data/rice/global_function.hpp +16 -0
  117. data/rice/global_function.ipp +11 -0
  118. data/rice/protect.hpp +91 -0
  119. data/rice/protect.ipp +803 -0
  120. data/rice/ruby_try_catch.hpp +86 -0
  121. data/rice/to_from_ruby.hpp +8 -0
  122. data/rice/to_from_ruby.ipp +299 -0
  123. data/rice/to_from_ruby_defn.hpp +71 -0
  124. data/ruby.ac +105 -0
  125. data/ruby/Makefile.am +1 -0
  126. data/ruby/Makefile.in +493 -0
  127. data/ruby/lib/Makefile.am +3 -0
  128. data/ruby/lib/Makefile.in +369 -0
  129. data/ruby/lib/mkmf-rice.rb.in +199 -0
  130. data/sample/Makefile.am +47 -0
  131. data/sample/Makefile.in +375 -0
  132. data/sample/enum/extconf.rb +3 -0
  133. data/sample/enum/sample_enum.cpp +54 -0
  134. data/sample/enum/test.rb +8 -0
  135. data/sample/inheritance/animals.cpp +98 -0
  136. data/sample/inheritance/extconf.rb +3 -0
  137. data/sample/inheritance/test.rb +7 -0
  138. data/sample/map/extconf.rb +3 -0
  139. data/sample/map/map.cpp +81 -0
  140. data/sample/map/test.rb +7 -0
  141. data/test/Makefile.am +44 -0
  142. data/test/Makefile.in +575 -0
  143. data/test/test_Address_Registration_Guard.cpp +43 -0
  144. data/test/test_Allocation_Strategies.cpp +77 -0
  145. data/test/test_Array.cpp +241 -0
  146. data/test/test_Builtin_Object.cpp +72 -0
  147. data/test/test_Class.cpp +350 -0
  148. data/test/test_Constructor.cpp +30 -0
  149. data/test/test_Critical_Guard.cpp +47 -0
  150. data/test/test_Data_Object.cpp +235 -0
  151. data/test/test_Enum.cpp +162 -0
  152. data/test/test_Exception.cpp +46 -0
  153. data/test/test_Hash.cpp +195 -0
  154. data/test/test_Identifier.cpp +70 -0
  155. data/test/test_Jump_Tag.cpp +17 -0
  156. data/test/test_Module.cpp +253 -0
  157. data/test/test_Object.cpp +148 -0
  158. data/test/test_String.cpp +94 -0
  159. data/test/test_Struct.cpp +192 -0
  160. data/test/test_Symbol.cpp +63 -0
  161. data/test/test_To_From_Ruby.cpp +281 -0
  162. data/test/test_VM.cpp +26 -0
  163. data/test/test_rice.rb +30 -0
  164. data/test/unittest.cpp +136 -0
  165. data/test/unittest.hpp +292 -0
  166. metadata +209 -0
@@ -0,0 +1,16 @@
1
+ #ifndef Rice__global_function__hpp_
2
+ #define Rice__global_function__hpp_
3
+
4
+ namespace Rice
5
+ {
6
+
7
+ template<typename Func_T>
8
+ void define_global_function(
9
+ char const * name,
10
+ Func_T func);
11
+
12
+ } // Rice
13
+
14
+ #include "global_function.ipp"
15
+
16
+ #endif // Rice__global_function__hpp_
@@ -0,0 +1,11 @@
1
+ #include "detail/define_method_and_auto_wrap.hpp"
2
+
3
+ template<typename Func_T>
4
+ void Rice::define_global_function(
5
+ char const * name,
6
+ Func_T func)
7
+ {
8
+ detail::define_method_and_auto_wrap(
9
+ rb_cObject, name, func);
10
+ }
11
+
data/rice/protect.hpp ADDED
@@ -0,0 +1,91 @@
1
+ #ifndef Rice__protect__hpp_
2
+ #define Rice__protect__hpp_
3
+
4
+ // This is a generated file. DO NOT EDIT!!
5
+
6
+
7
+ // This causes problems with certain C++ libraries
8
+ #undef TYPE
9
+
10
+ #include "Object_defn.hpp"
11
+ namespace Rice
12
+ {
13
+
14
+ #ifdef DOXYGEN
15
+ /*! \file
16
+ * \brief A collection of functions (overloaded on number of
17
+ * arguments) for calling C functions that might raise Ruby exceptions.
18
+ */
19
+
20
+ //! Call the C function f with arguments (arg1, arg2, ...).
21
+ /*! E.g.:
22
+ * \code
23
+ * VALUE x = protect(rb_ary_new);
24
+ * protect(rb_ary_push(x, INT2NUM(42));
25
+ * \endcode
26
+ *
27
+ * Note that this function makes copies of all of its arguments; it
28
+ * does not take anything by reference. All of the copies are const so
29
+ * that protect will not work if f takes a non-const
30
+ * reference to any of its arguments (though you can use non-const
31
+ * pointers).
32
+ */
33
+ VALUE protect(Function f, T1 arg1, T2 arg2, ...);
34
+ #else
35
+
36
+ template<typename Fun>
37
+ VALUE protect(Fun fun);
38
+
39
+ template<typename Fun, typename T1>
40
+ VALUE protect(Fun fun, T1 const & t1);
41
+
42
+ template<typename Fun, typename T1, typename T2>
43
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2);
44
+
45
+ template<typename Fun, typename T1, typename T2, typename T3>
46
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3);
47
+
48
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4>
49
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4);
50
+
51
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5>
52
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5);
53
+
54
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
55
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6);
56
+
57
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
58
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7);
59
+
60
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
61
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8);
62
+
63
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
64
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9);
65
+
66
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
67
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10);
68
+
69
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
70
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11);
71
+
72
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
73
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12);
74
+
75
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
76
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13);
77
+
78
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
79
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14);
80
+
81
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
82
+ VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14, T15 const & t15);
83
+
84
+ #endif // DOXYGEN
85
+
86
+ } // namespace Rice
87
+
88
+ #include "protect.ipp"
89
+
90
+ #endif // Rice__protect__hpp_
91
+
data/rice/protect.ipp ADDED
@@ -0,0 +1,803 @@
1
+ #ifndef Rice__protect__ipp_
2
+ #define Rice__protect__ipp_
3
+
4
+ // This is a generated file. DO NOT EDIT!!
5
+
6
+
7
+ // This causes problems with certain C++ libraries
8
+ #undef TYPE
9
+
10
+ #include "detail/protect.hpp"
11
+ namespace Rice
12
+ {
13
+
14
+ namespace detail
15
+ {
16
+
17
+ template<typename Fun>
18
+ class Ruby_Function_0
19
+ {
20
+ public:
21
+ Ruby_Function_0(Fun f);
22
+ inline VALUE operator()();
23
+ static inline VALUE call(Ruby_Function_0 * f);
24
+ private:
25
+ Fun f_;
26
+
27
+ };
28
+
29
+ template<typename Fun>
30
+ inline Ruby_Function_0<Fun>::
31
+ Ruby_Function_0(Fun f)
32
+ : f_(f)
33
+ { }
34
+
35
+ template<typename Fun>
36
+ inline VALUE Ruby_Function_0<Fun>::
37
+ operator()()
38
+ {
39
+ return f_();
40
+ }
41
+
42
+ template<typename Fun>
43
+ inline VALUE Ruby_Function_0<Fun>::
44
+ call(Ruby_Function_0 * f)
45
+ {
46
+ return (*f)();
47
+ }
48
+
49
+ } // namespace detail
50
+
51
+ template<typename Fun>
52
+ inline VALUE protect(Fun fun)
53
+ {
54
+ typedef detail::Ruby_Function_0<Fun> RF;
55
+ RF f(fun);
56
+ return detail::protect(
57
+ RUBY_VALUE_FUNC(RF::call),
58
+ reinterpret_cast<VALUE>(&f));
59
+ }
60
+
61
+ // ---------------------------------------------------------------------
62
+
63
+ namespace detail
64
+ {
65
+
66
+ template<typename Fun, typename T1>
67
+ class Ruby_Function_1
68
+ {
69
+ public:
70
+ Ruby_Function_1(Fun f, T1 const & t1);
71
+ inline VALUE operator()();
72
+ static inline VALUE call(Ruby_Function_1 * f);
73
+ private:
74
+ Fun f_;
75
+ T1 const & t1_;
76
+ };
77
+
78
+ template<typename Fun, typename T1>
79
+ inline Ruby_Function_1<Fun, T1>::
80
+ Ruby_Function_1(Fun f, T1 const & t1)
81
+ : f_(f), t1_(t1)
82
+ { }
83
+
84
+ template<typename Fun, typename T1>
85
+ inline VALUE Ruby_Function_1<Fun, T1>::
86
+ operator()()
87
+ {
88
+ return f_(t1_);
89
+ }
90
+
91
+ template<typename Fun, typename T1>
92
+ inline VALUE Ruby_Function_1<Fun, T1>::
93
+ call(Ruby_Function_1 * f)
94
+ {
95
+ return (*f)();
96
+ }
97
+
98
+ } // namespace detail
99
+
100
+ template<typename Fun, typename T1>
101
+ inline VALUE protect(Fun fun, T1 const & t1)
102
+ {
103
+ typedef detail::Ruby_Function_1<Fun, T1> RF;
104
+ RF f(fun, t1);
105
+ return detail::protect(
106
+ RUBY_VALUE_FUNC(RF::call),
107
+ reinterpret_cast<VALUE>(&f));
108
+ }
109
+
110
+ // ---------------------------------------------------------------------
111
+
112
+ namespace detail
113
+ {
114
+
115
+ template<typename Fun, typename T1, typename T2>
116
+ class Ruby_Function_2
117
+ {
118
+ public:
119
+ Ruby_Function_2(Fun f, T1 const & t1, T2 const & t2);
120
+ inline VALUE operator()();
121
+ static inline VALUE call(Ruby_Function_2 * f);
122
+ private:
123
+ Fun f_;
124
+ T1 const & t1_; T2 const & t2_;
125
+ };
126
+
127
+ template<typename Fun, typename T1, typename T2>
128
+ inline Ruby_Function_2<Fun, T1, T2>::
129
+ Ruby_Function_2(Fun f, T1 const & t1, T2 const & t2)
130
+ : f_(f), t1_(t1), t2_(t2)
131
+ { }
132
+
133
+ template<typename Fun, typename T1, typename T2>
134
+ inline VALUE Ruby_Function_2<Fun, T1, T2>::
135
+ operator()()
136
+ {
137
+ return f_(t1_, t2_);
138
+ }
139
+
140
+ template<typename Fun, typename T1, typename T2>
141
+ inline VALUE Ruby_Function_2<Fun, T1, T2>::
142
+ call(Ruby_Function_2 * f)
143
+ {
144
+ return (*f)();
145
+ }
146
+
147
+ } // namespace detail
148
+
149
+ template<typename Fun, typename T1, typename T2>
150
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2)
151
+ {
152
+ typedef detail::Ruby_Function_2<Fun, T1, T2> RF;
153
+ RF f(fun, t1, t2);
154
+ return detail::protect(
155
+ RUBY_VALUE_FUNC(RF::call),
156
+ reinterpret_cast<VALUE>(&f));
157
+ }
158
+
159
+ // ---------------------------------------------------------------------
160
+
161
+ namespace detail
162
+ {
163
+
164
+ template<typename Fun, typename T1, typename T2, typename T3>
165
+ class Ruby_Function_3
166
+ {
167
+ public:
168
+ Ruby_Function_3(Fun f, T1 const & t1, T2 const & t2, T3 const & t3);
169
+ inline VALUE operator()();
170
+ static inline VALUE call(Ruby_Function_3 * f);
171
+ private:
172
+ Fun f_;
173
+ T1 const & t1_; T2 const & t2_; T3 const & t3_;
174
+ };
175
+
176
+ template<typename Fun, typename T1, typename T2, typename T3>
177
+ inline Ruby_Function_3<Fun, T1, T2, T3>::
178
+ Ruby_Function_3(Fun f, T1 const & t1, T2 const & t2, T3 const & t3)
179
+ : f_(f), t1_(t1), t2_(t2), t3_(t3)
180
+ { }
181
+
182
+ template<typename Fun, typename T1, typename T2, typename T3>
183
+ inline VALUE Ruby_Function_3<Fun, T1, T2, T3>::
184
+ operator()()
185
+ {
186
+ return f_(t1_, t2_, t3_);
187
+ }
188
+
189
+ template<typename Fun, typename T1, typename T2, typename T3>
190
+ inline VALUE Ruby_Function_3<Fun, T1, T2, T3>::
191
+ call(Ruby_Function_3 * f)
192
+ {
193
+ return (*f)();
194
+ }
195
+
196
+ } // namespace detail
197
+
198
+ template<typename Fun, typename T1, typename T2, typename T3>
199
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3)
200
+ {
201
+ typedef detail::Ruby_Function_3<Fun, T1, T2, T3> RF;
202
+ RF f(fun, t1, t2, t3);
203
+ return detail::protect(
204
+ RUBY_VALUE_FUNC(RF::call),
205
+ reinterpret_cast<VALUE>(&f));
206
+ }
207
+
208
+ // ---------------------------------------------------------------------
209
+
210
+ namespace detail
211
+ {
212
+
213
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4>
214
+ class Ruby_Function_4
215
+ {
216
+ public:
217
+ Ruby_Function_4(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4);
218
+ inline VALUE operator()();
219
+ static inline VALUE call(Ruby_Function_4 * f);
220
+ private:
221
+ Fun f_;
222
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_;
223
+ };
224
+
225
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4>
226
+ inline Ruby_Function_4<Fun, T1, T2, T3, T4>::
227
+ Ruby_Function_4(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4)
228
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4)
229
+ { }
230
+
231
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4>
232
+ inline VALUE Ruby_Function_4<Fun, T1, T2, T3, T4>::
233
+ operator()()
234
+ {
235
+ return f_(t1_, t2_, t3_, t4_);
236
+ }
237
+
238
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4>
239
+ inline VALUE Ruby_Function_4<Fun, T1, T2, T3, T4>::
240
+ call(Ruby_Function_4 * f)
241
+ {
242
+ return (*f)();
243
+ }
244
+
245
+ } // namespace detail
246
+
247
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4>
248
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4)
249
+ {
250
+ typedef detail::Ruby_Function_4<Fun, T1, T2, T3, T4> RF;
251
+ RF f(fun, t1, t2, t3, t4);
252
+ return detail::protect(
253
+ RUBY_VALUE_FUNC(RF::call),
254
+ reinterpret_cast<VALUE>(&f));
255
+ }
256
+
257
+ // ---------------------------------------------------------------------
258
+
259
+ namespace detail
260
+ {
261
+
262
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5>
263
+ class Ruby_Function_5
264
+ {
265
+ public:
266
+ Ruby_Function_5(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5);
267
+ inline VALUE operator()();
268
+ static inline VALUE call(Ruby_Function_5 * f);
269
+ private:
270
+ Fun f_;
271
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_;
272
+ };
273
+
274
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5>
275
+ inline Ruby_Function_5<Fun, T1, T2, T3, T4, T5>::
276
+ Ruby_Function_5(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5)
277
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5)
278
+ { }
279
+
280
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5>
281
+ inline VALUE Ruby_Function_5<Fun, T1, T2, T3, T4, T5>::
282
+ operator()()
283
+ {
284
+ return f_(t1_, t2_, t3_, t4_, t5_);
285
+ }
286
+
287
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5>
288
+ inline VALUE Ruby_Function_5<Fun, T1, T2, T3, T4, T5>::
289
+ call(Ruby_Function_5 * f)
290
+ {
291
+ return (*f)();
292
+ }
293
+
294
+ } // namespace detail
295
+
296
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5>
297
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5)
298
+ {
299
+ typedef detail::Ruby_Function_5<Fun, T1, T2, T3, T4, T5> RF;
300
+ RF f(fun, t1, t2, t3, t4, t5);
301
+ return detail::protect(
302
+ RUBY_VALUE_FUNC(RF::call),
303
+ reinterpret_cast<VALUE>(&f));
304
+ }
305
+
306
+ // ---------------------------------------------------------------------
307
+
308
+ namespace detail
309
+ {
310
+
311
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
312
+ class Ruby_Function_6
313
+ {
314
+ public:
315
+ Ruby_Function_6(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6);
316
+ inline VALUE operator()();
317
+ static inline VALUE call(Ruby_Function_6 * f);
318
+ private:
319
+ Fun f_;
320
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_;
321
+ };
322
+
323
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
324
+ inline Ruby_Function_6<Fun, T1, T2, T3, T4, T5, T6>::
325
+ Ruby_Function_6(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6)
326
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6)
327
+ { }
328
+
329
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
330
+ inline VALUE Ruby_Function_6<Fun, T1, T2, T3, T4, T5, T6>::
331
+ operator()()
332
+ {
333
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_);
334
+ }
335
+
336
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
337
+ inline VALUE Ruby_Function_6<Fun, T1, T2, T3, T4, T5, T6>::
338
+ call(Ruby_Function_6 * f)
339
+ {
340
+ return (*f)();
341
+ }
342
+
343
+ } // namespace detail
344
+
345
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
346
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6)
347
+ {
348
+ typedef detail::Ruby_Function_6<Fun, T1, T2, T3, T4, T5, T6> RF;
349
+ RF f(fun, t1, t2, t3, t4, t5, t6);
350
+ return detail::protect(
351
+ RUBY_VALUE_FUNC(RF::call),
352
+ reinterpret_cast<VALUE>(&f));
353
+ }
354
+
355
+ // ---------------------------------------------------------------------
356
+
357
+ namespace detail
358
+ {
359
+
360
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
361
+ class Ruby_Function_7
362
+ {
363
+ public:
364
+ Ruby_Function_7(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7);
365
+ inline VALUE operator()();
366
+ static inline VALUE call(Ruby_Function_7 * f);
367
+ private:
368
+ Fun f_;
369
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_;
370
+ };
371
+
372
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
373
+ inline Ruby_Function_7<Fun, T1, T2, T3, T4, T5, T6, T7>::
374
+ Ruby_Function_7(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7)
375
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7)
376
+ { }
377
+
378
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
379
+ inline VALUE Ruby_Function_7<Fun, T1, T2, T3, T4, T5, T6, T7>::
380
+ operator()()
381
+ {
382
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_);
383
+ }
384
+
385
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
386
+ inline VALUE Ruby_Function_7<Fun, T1, T2, T3, T4, T5, T6, T7>::
387
+ call(Ruby_Function_7 * f)
388
+ {
389
+ return (*f)();
390
+ }
391
+
392
+ } // namespace detail
393
+
394
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
395
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7)
396
+ {
397
+ typedef detail::Ruby_Function_7<Fun, T1, T2, T3, T4, T5, T6, T7> RF;
398
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7);
399
+ return detail::protect(
400
+ RUBY_VALUE_FUNC(RF::call),
401
+ reinterpret_cast<VALUE>(&f));
402
+ }
403
+
404
+ // ---------------------------------------------------------------------
405
+
406
+ namespace detail
407
+ {
408
+
409
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
410
+ class Ruby_Function_8
411
+ {
412
+ public:
413
+ Ruby_Function_8(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8);
414
+ inline VALUE operator()();
415
+ static inline VALUE call(Ruby_Function_8 * f);
416
+ private:
417
+ Fun f_;
418
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_;
419
+ };
420
+
421
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
422
+ inline Ruby_Function_8<Fun, T1, T2, T3, T4, T5, T6, T7, T8>::
423
+ Ruby_Function_8(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8)
424
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8)
425
+ { }
426
+
427
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
428
+ inline VALUE Ruby_Function_8<Fun, T1, T2, T3, T4, T5, T6, T7, T8>::
429
+ operator()()
430
+ {
431
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_);
432
+ }
433
+
434
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
435
+ inline VALUE Ruby_Function_8<Fun, T1, T2, T3, T4, T5, T6, T7, T8>::
436
+ call(Ruby_Function_8 * f)
437
+ {
438
+ return (*f)();
439
+ }
440
+
441
+ } // namespace detail
442
+
443
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
444
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8)
445
+ {
446
+ typedef detail::Ruby_Function_8<Fun, T1, T2, T3, T4, T5, T6, T7, T8> RF;
447
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8);
448
+ return detail::protect(
449
+ RUBY_VALUE_FUNC(RF::call),
450
+ reinterpret_cast<VALUE>(&f));
451
+ }
452
+
453
+ // ---------------------------------------------------------------------
454
+
455
+ namespace detail
456
+ {
457
+
458
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
459
+ class Ruby_Function_9
460
+ {
461
+ public:
462
+ Ruby_Function_9(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9);
463
+ inline VALUE operator()();
464
+ static inline VALUE call(Ruby_Function_9 * f);
465
+ private:
466
+ Fun f_;
467
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_;
468
+ };
469
+
470
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
471
+ inline Ruby_Function_9<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9>::
472
+ Ruby_Function_9(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9)
473
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9)
474
+ { }
475
+
476
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
477
+ inline VALUE Ruby_Function_9<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9>::
478
+ operator()()
479
+ {
480
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_);
481
+ }
482
+
483
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
484
+ inline VALUE Ruby_Function_9<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9>::
485
+ call(Ruby_Function_9 * f)
486
+ {
487
+ return (*f)();
488
+ }
489
+
490
+ } // namespace detail
491
+
492
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
493
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9)
494
+ {
495
+ typedef detail::Ruby_Function_9<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9> RF;
496
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8, t9);
497
+ return detail::protect(
498
+ RUBY_VALUE_FUNC(RF::call),
499
+ reinterpret_cast<VALUE>(&f));
500
+ }
501
+
502
+ // ---------------------------------------------------------------------
503
+
504
+ namespace detail
505
+ {
506
+
507
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
508
+ class Ruby_Function_10
509
+ {
510
+ public:
511
+ Ruby_Function_10(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10);
512
+ inline VALUE operator()();
513
+ static inline VALUE call(Ruby_Function_10 * f);
514
+ private:
515
+ Fun f_;
516
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_;
517
+ };
518
+
519
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
520
+ inline Ruby_Function_10<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::
521
+ Ruby_Function_10(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10)
522
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10)
523
+ { }
524
+
525
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
526
+ inline VALUE Ruby_Function_10<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::
527
+ operator()()
528
+ {
529
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_);
530
+ }
531
+
532
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
533
+ inline VALUE Ruby_Function_10<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::
534
+ call(Ruby_Function_10 * f)
535
+ {
536
+ return (*f)();
537
+ }
538
+
539
+ } // namespace detail
540
+
541
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
542
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10)
543
+ {
544
+ typedef detail::Ruby_Function_10<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> RF;
545
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
546
+ return detail::protect(
547
+ RUBY_VALUE_FUNC(RF::call),
548
+ reinterpret_cast<VALUE>(&f));
549
+ }
550
+
551
+ // ---------------------------------------------------------------------
552
+
553
+ namespace detail
554
+ {
555
+
556
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
557
+ class Ruby_Function_11
558
+ {
559
+ public:
560
+ Ruby_Function_11(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11);
561
+ inline VALUE operator()();
562
+ static inline VALUE call(Ruby_Function_11 * f);
563
+ private:
564
+ Fun f_;
565
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_;
566
+ };
567
+
568
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
569
+ inline Ruby_Function_11<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::
570
+ Ruby_Function_11(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11)
571
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11)
572
+ { }
573
+
574
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
575
+ inline VALUE Ruby_Function_11<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::
576
+ operator()()
577
+ {
578
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_);
579
+ }
580
+
581
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
582
+ inline VALUE Ruby_Function_11<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::
583
+ call(Ruby_Function_11 * f)
584
+ {
585
+ return (*f)();
586
+ }
587
+
588
+ } // namespace detail
589
+
590
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
591
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11)
592
+ {
593
+ typedef detail::Ruby_Function_11<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> RF;
594
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11);
595
+ return detail::protect(
596
+ RUBY_VALUE_FUNC(RF::call),
597
+ reinterpret_cast<VALUE>(&f));
598
+ }
599
+
600
+ // ---------------------------------------------------------------------
601
+
602
+ namespace detail
603
+ {
604
+
605
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
606
+ class Ruby_Function_12
607
+ {
608
+ public:
609
+ Ruby_Function_12(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12);
610
+ inline VALUE operator()();
611
+ static inline VALUE call(Ruby_Function_12 * f);
612
+ private:
613
+ Fun f_;
614
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; T12 const & t12_;
615
+ };
616
+
617
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
618
+ inline Ruby_Function_12<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::
619
+ Ruby_Function_12(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12)
620
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11), t12_(t12)
621
+ { }
622
+
623
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
624
+ inline VALUE Ruby_Function_12<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::
625
+ operator()()
626
+ {
627
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_, t12_);
628
+ }
629
+
630
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
631
+ inline VALUE Ruby_Function_12<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::
632
+ call(Ruby_Function_12 * f)
633
+ {
634
+ return (*f)();
635
+ }
636
+
637
+ } // namespace detail
638
+
639
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
640
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12)
641
+ {
642
+ typedef detail::Ruby_Function_12<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> RF;
643
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12);
644
+ return detail::protect(
645
+ RUBY_VALUE_FUNC(RF::call),
646
+ reinterpret_cast<VALUE>(&f));
647
+ }
648
+
649
+ // ---------------------------------------------------------------------
650
+
651
+ namespace detail
652
+ {
653
+
654
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
655
+ class Ruby_Function_13
656
+ {
657
+ public:
658
+ Ruby_Function_13(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13);
659
+ inline VALUE operator()();
660
+ static inline VALUE call(Ruby_Function_13 * f);
661
+ private:
662
+ Fun f_;
663
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; T12 const & t12_; T13 const & t13_;
664
+ };
665
+
666
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
667
+ inline Ruby_Function_13<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::
668
+ Ruby_Function_13(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13)
669
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11), t12_(t12), t13_(t13)
670
+ { }
671
+
672
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
673
+ inline VALUE Ruby_Function_13<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::
674
+ operator()()
675
+ {
676
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_, t12_, t13_);
677
+ }
678
+
679
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
680
+ inline VALUE Ruby_Function_13<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::
681
+ call(Ruby_Function_13 * f)
682
+ {
683
+ return (*f)();
684
+ }
685
+
686
+ } // namespace detail
687
+
688
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
689
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13)
690
+ {
691
+ typedef detail::Ruby_Function_13<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> RF;
692
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13);
693
+ return detail::protect(
694
+ RUBY_VALUE_FUNC(RF::call),
695
+ reinterpret_cast<VALUE>(&f));
696
+ }
697
+
698
+ // ---------------------------------------------------------------------
699
+
700
+ namespace detail
701
+ {
702
+
703
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
704
+ class Ruby_Function_14
705
+ {
706
+ public:
707
+ Ruby_Function_14(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14);
708
+ inline VALUE operator()();
709
+ static inline VALUE call(Ruby_Function_14 * f);
710
+ private:
711
+ Fun f_;
712
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; T12 const & t12_; T13 const & t13_; T14 const & t14_;
713
+ };
714
+
715
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
716
+ inline Ruby_Function_14<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::
717
+ Ruby_Function_14(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14)
718
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11), t12_(t12), t13_(t13), t14_(t14)
719
+ { }
720
+
721
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
722
+ inline VALUE Ruby_Function_14<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::
723
+ operator()()
724
+ {
725
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_, t12_, t13_, t14_);
726
+ }
727
+
728
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
729
+ inline VALUE Ruby_Function_14<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::
730
+ call(Ruby_Function_14 * f)
731
+ {
732
+ return (*f)();
733
+ }
734
+
735
+ } // namespace detail
736
+
737
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
738
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14)
739
+ {
740
+ typedef detail::Ruby_Function_14<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> RF;
741
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14);
742
+ return detail::protect(
743
+ RUBY_VALUE_FUNC(RF::call),
744
+ reinterpret_cast<VALUE>(&f));
745
+ }
746
+
747
+ // ---------------------------------------------------------------------
748
+
749
+ namespace detail
750
+ {
751
+
752
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
753
+ class Ruby_Function_15
754
+ {
755
+ public:
756
+ Ruby_Function_15(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14, T15 const & t15);
757
+ inline VALUE operator()();
758
+ static inline VALUE call(Ruby_Function_15 * f);
759
+ private:
760
+ Fun f_;
761
+ T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; T12 const & t12_; T13 const & t13_; T14 const & t14_; T15 const & t15_;
762
+ };
763
+
764
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
765
+ inline Ruby_Function_15<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::
766
+ Ruby_Function_15(Fun f, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14, T15 const & t15)
767
+ : f_(f), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11), t12_(t12), t13_(t13), t14_(t14), t15_(t15)
768
+ { }
769
+
770
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
771
+ inline VALUE Ruby_Function_15<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::
772
+ operator()()
773
+ {
774
+ return f_(t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_, t12_, t13_, t14_, t15_);
775
+ }
776
+
777
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
778
+ inline VALUE Ruby_Function_15<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::
779
+ call(Ruby_Function_15 * f)
780
+ {
781
+ return (*f)();
782
+ }
783
+
784
+ } // namespace detail
785
+
786
+ template<typename Fun, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
787
+ inline VALUE protect(Fun fun, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14, T15 const & t15)
788
+ {
789
+ typedef detail::Ruby_Function_15<Fun, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> RF;
790
+ RF f(fun, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15);
791
+ return detail::protect(
792
+ RUBY_VALUE_FUNC(RF::call),
793
+ reinterpret_cast<VALUE>(&f));
794
+ }
795
+
796
+ // ---------------------------------------------------------------------
797
+
798
+
799
+ } // namespace Rice
800
+
801
+
802
+ #endif // Rice__protect__ipp_
803
+