rice 2.1.3 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +121 -0
  3. data/CONTRIBUTORS.md +19 -0
  4. data/COPYING +2 -2
  5. data/Gemfile +3 -0
  6. data/README.md +45 -1028
  7. data/Rakefile +95 -12
  8. data/include/rice/rice.hpp +7766 -0
  9. data/include/rice/stl.hpp +1113 -0
  10. data/lib/mkmf-rice.rb +127 -0
  11. data/lib/version.rb +3 -0
  12. data/rice/Address_Registration_Guard.ipp +75 -32
  13. data/rice/Address_Registration_Guard_defn.hpp +60 -56
  14. data/rice/Arg.hpp +80 -4
  15. data/rice/Arg.ipp +51 -0
  16. data/rice/Constructor.hpp +30 -376
  17. data/rice/Data_Object.ipp +234 -107
  18. data/rice/Data_Object_defn.hpp +77 -117
  19. data/rice/Data_Type.hpp +1 -2
  20. data/rice/Data_Type.ipp +251 -295
  21. data/rice/Data_Type_defn.hpp +175 -243
  22. data/rice/Director.hpp +14 -9
  23. data/rice/Enum.hpp +54 -104
  24. data/rice/Enum.ipp +104 -230
  25. data/rice/Exception.hpp +2 -8
  26. data/rice/Exception.ipp +65 -0
  27. data/rice/Exception_defn.hpp +46 -47
  28. data/rice/Identifier.hpp +28 -28
  29. data/rice/Identifier.ipp +23 -27
  30. data/rice/Return.hpp +39 -0
  31. data/rice/Return.ipp +33 -0
  32. data/rice/detail/Exception_Handler.ipp +22 -62
  33. data/rice/detail/Exception_Handler_defn.hpp +76 -91
  34. data/rice/detail/Iterator.hpp +18 -88
  35. data/rice/detail/Iterator.ipp +47 -0
  36. data/rice/detail/Jump_Tag.hpp +21 -0
  37. data/rice/detail/MethodInfo.hpp +44 -0
  38. data/rice/detail/MethodInfo.ipp +78 -0
  39. data/rice/detail/NativeAttribute.hpp +53 -0
  40. data/rice/detail/NativeAttribute.ipp +83 -0
  41. data/rice/detail/NativeFunction.hpp +69 -0
  42. data/rice/detail/NativeFunction.ipp +248 -0
  43. data/rice/detail/RubyFunction.hpp +39 -0
  44. data/rice/detail/RubyFunction.ipp +92 -0
  45. data/rice/detail/Type.hpp +29 -0
  46. data/rice/detail/Type.ipp +138 -0
  47. data/rice/detail/TypeRegistry.hpp +50 -0
  48. data/rice/detail/TypeRegistry.ipp +106 -0
  49. data/rice/detail/Wrapper.hpp +51 -0
  50. data/rice/detail/Wrapper.ipp +151 -0
  51. data/rice/detail/default_allocation_func.hpp +8 -19
  52. data/rice/detail/default_allocation_func.ipp +9 -8
  53. data/rice/detail/from_ruby.hpp +2 -37
  54. data/rice/detail/from_ruby.ipp +1020 -46
  55. data/rice/detail/from_ruby_defn.hpp +38 -0
  56. data/rice/detail/function_traits.hpp +124 -0
  57. data/rice/detail/method_data.hpp +23 -15
  58. data/rice/detail/method_data.ipp +53 -0
  59. data/rice/detail/rice_traits.hpp +116 -0
  60. data/rice/detail/ruby.hpp +9 -50
  61. data/rice/detail/to_ruby.hpp +3 -17
  62. data/rice/detail/to_ruby.ipp +409 -31
  63. data/rice/detail/to_ruby_defn.hpp +48 -0
  64. data/rice/forward_declares.ipp +82 -0
  65. data/rice/global_function.hpp +16 -20
  66. data/rice/global_function.ipp +8 -17
  67. data/rice/rice.hpp +59 -0
  68. data/rice/ruby_mark.hpp +5 -3
  69. data/rice/ruby_try_catch.hpp +4 -4
  70. data/rice/stl.hpp +11 -0
  71. data/sample/callbacks/extconf.rb +6 -0
  72. data/sample/callbacks/sample_callbacks.cpp +35 -0
  73. data/sample/callbacks/test.rb +28 -0
  74. data/sample/enum/extconf.rb +3 -0
  75. data/sample/enum/sample_enum.cpp +3 -17
  76. data/sample/enum/test.rb +2 -2
  77. data/sample/inheritance/animals.cpp +8 -24
  78. data/sample/inheritance/extconf.rb +3 -0
  79. data/sample/inheritance/test.rb +1 -1
  80. data/sample/map/extconf.rb +3 -0
  81. data/sample/map/map.cpp +10 -18
  82. data/sample/map/test.rb +1 -1
  83. data/test/embed_ruby.cpp +34 -0
  84. data/test/embed_ruby.hpp +4 -0
  85. data/test/ext/t1/extconf.rb +3 -0
  86. data/test/ext/t1/t1.cpp +1 -3
  87. data/test/ext/t2/extconf.rb +3 -0
  88. data/test/ext/t2/t2.cpp +1 -1
  89. data/test/extconf.rb +23 -0
  90. data/test/ruby/test_callbacks_sample.rb +28 -0
  91. data/test/ruby/test_multiple_extensions.rb +18 -0
  92. data/test/ruby/test_multiple_extensions_same_class.rb +14 -0
  93. data/test/ruby/test_multiple_extensions_with_inheritance.rb +20 -0
  94. data/test/test_Address_Registration_Guard.cpp +25 -11
  95. data/test/test_Array.cpp +131 -74
  96. data/test/test_Attribute.cpp +147 -0
  97. data/test/test_Builtin_Object.cpp +36 -15
  98. data/test/test_Class.cpp +151 -276
  99. data/test/test_Constructor.cpp +10 -9
  100. data/test/test_Data_Object.cpp +135 -193
  101. data/test/test_Data_Type.cpp +323 -252
  102. data/test/test_Director.cpp +56 -42
  103. data/test/test_Enum.cpp +230 -104
  104. data/test/test_Exception.cpp +7 -7
  105. data/test/test_Hash.cpp +33 -31
  106. data/test/test_Identifier.cpp +6 -6
  107. data/test/test_Inheritance.cpp +221 -0
  108. data/test/test_Iterator.cpp +161 -0
  109. data/test/test_Jump_Tag.cpp +1 -1
  110. data/test/test_Keep_Alive.cpp +161 -0
  111. data/test/test_Memory_Management.cpp +4 -5
  112. data/test/test_Module.cpp +169 -111
  113. data/test/test_Object.cpp +51 -19
  114. data/test/test_Ownership.cpp +275 -0
  115. data/test/test_Self.cpp +205 -0
  116. data/test/test_Stl_Optional.cpp +90 -0
  117. data/test/test_Stl_Pair.cpp +144 -0
  118. data/test/test_Stl_SmartPointer.cpp +200 -0
  119. data/test/test_Stl_String.cpp +74 -0
  120. data/test/test_Stl_Vector.cpp +652 -0
  121. data/test/test_String.cpp +3 -3
  122. data/test/test_Struct.cpp +31 -40
  123. data/test/test_Symbol.cpp +3 -3
  124. data/test/test_To_From_Ruby.cpp +283 -218
  125. data/test/test_global_functions.cpp +41 -20
  126. data/test/unittest.cpp +34 -8
  127. data/test/unittest.hpp +0 -4
  128. metadata +121 -136
  129. data/Doxyfile +0 -2268
  130. data/Makefile.am +0 -26
  131. data/Makefile.in +0 -923
  132. data/README.mingw +0 -8
  133. data/aclocal.m4 +0 -1088
  134. data/bootstrap +0 -8
  135. data/check_stdcxx_11.ac +0 -103
  136. data/config.guess +0 -1421
  137. data/config.sub +0 -1807
  138. data/configure +0 -7367
  139. data/configure.ac +0 -55
  140. data/depcomp +0 -791
  141. data/doxygen.ac +0 -314
  142. data/doxygen.am +0 -186
  143. data/extconf.rb +0 -69
  144. data/install-sh +0 -501
  145. data/missing +0 -215
  146. data/post-autoconf.rb +0 -22
  147. data/post-automake.rb +0 -28
  148. data/rice/Address_Registration_Guard.cpp +0 -22
  149. data/rice/Arg_impl.hpp +0 -129
  150. data/rice/Arg_operators.cpp +0 -21
  151. data/rice/Arg_operators.hpp +0 -19
  152. data/rice/Array.hpp +0 -214
  153. data/rice/Array.ipp +0 -256
  154. data/rice/Builtin_Object.hpp +0 -8
  155. data/rice/Builtin_Object.ipp +0 -50
  156. data/rice/Builtin_Object_defn.hpp +0 -50
  157. data/rice/Class.cpp +0 -57
  158. data/rice/Class.hpp +0 -8
  159. data/rice/Class.ipp +0 -6
  160. data/rice/Class_defn.hpp +0 -83
  161. data/rice/Data_Type.cpp +0 -54
  162. data/rice/Data_Type_fwd.hpp +0 -12
  163. data/rice/Director.cpp +0 -13
  164. data/rice/Exception.cpp +0 -59
  165. data/rice/Exception_Base.hpp +0 -8
  166. data/rice/Exception_Base.ipp +0 -13
  167. data/rice/Exception_Base_defn.hpp +0 -27
  168. data/rice/Hash.hpp +0 -227
  169. data/rice/Hash.ipp +0 -329
  170. data/rice/Identifier.cpp +0 -8
  171. data/rice/Jump_Tag.hpp +0 -24
  172. data/rice/Makefile.am +0 -125
  173. data/rice/Makefile.in +0 -888
  174. data/rice/Module.cpp +0 -84
  175. data/rice/Module.hpp +0 -8
  176. data/rice/Module.ipp +0 -6
  177. data/rice/Module_defn.hpp +0 -88
  178. data/rice/Module_impl.hpp +0 -281
  179. data/rice/Module_impl.ipp +0 -345
  180. data/rice/Object.cpp +0 -169
  181. data/rice/Object.hpp +0 -8
  182. data/rice/Object.ipp +0 -19
  183. data/rice/Object_defn.hpp +0 -191
  184. data/rice/Require_Guard.hpp +0 -21
  185. data/rice/String.cpp +0 -94
  186. data/rice/String.hpp +0 -91
  187. data/rice/Struct.cpp +0 -117
  188. data/rice/Struct.hpp +0 -162
  189. data/rice/Struct.ipp +0 -26
  190. data/rice/Symbol.cpp +0 -25
  191. data/rice/Symbol.hpp +0 -66
  192. data/rice/Symbol.ipp +0 -44
  193. data/rice/config.hpp +0 -47
  194. data/rice/config.hpp.in +0 -46
  195. data/rice/detail/Arguments.hpp +0 -118
  196. data/rice/detail/Auto_Function_Wrapper.hpp +0 -898
  197. data/rice/detail/Auto_Function_Wrapper.ipp +0 -3694
  198. data/rice/detail/Auto_Member_Function_Wrapper.hpp +0 -897
  199. data/rice/detail/Auto_Member_Function_Wrapper.ipp +0 -2774
  200. data/rice/detail/Caster.hpp +0 -103
  201. data/rice/detail/Not_Copyable.hpp +0 -25
  202. data/rice/detail/Wrapped_Function.hpp +0 -33
  203. data/rice/detail/cfp.hpp +0 -24
  204. data/rice/detail/cfp.ipp +0 -51
  205. data/rice/detail/check_ruby_type.cpp +0 -27
  206. data/rice/detail/check_ruby_type.hpp +0 -23
  207. data/rice/detail/creation_funcs.hpp +0 -37
  208. data/rice/detail/creation_funcs.ipp +0 -36
  209. data/rice/detail/define_method_and_auto_wrap.hpp +0 -31
  210. data/rice/detail/define_method_and_auto_wrap.ipp +0 -30
  211. data/rice/detail/demangle.cpp +0 -56
  212. data/rice/detail/demangle.hpp +0 -19
  213. data/rice/detail/env.hpp +0 -11
  214. data/rice/detail/method_data.cpp +0 -86
  215. data/rice/detail/node.hpp +0 -13
  216. data/rice/detail/object_call.hpp +0 -69
  217. data/rice/detail/object_call.ipp +0 -131
  218. data/rice/detail/protect.cpp +0 -29
  219. data/rice/detail/protect.hpp +0 -34
  220. data/rice/detail/ruby_version_code.hpp +0 -6
  221. data/rice/detail/ruby_version_code.hpp.in +0 -6
  222. data/rice/detail/st.hpp +0 -22
  223. data/rice/detail/traits.hpp +0 -43
  224. data/rice/detail/win32.hpp +0 -16
  225. data/rice/detail/wrap_function.hpp +0 -341
  226. data/rice/detail/wrap_function.ipp +0 -514
  227. data/rice/protect.hpp +0 -92
  228. data/rice/protect.ipp +0 -1134
  229. data/rice/rubypp.rb +0 -97
  230. data/rice/to_from_ruby.hpp +0 -8
  231. data/rice/to_from_ruby.ipp +0 -294
  232. data/rice/to_from_ruby_defn.hpp +0 -70
  233. data/ruby.ac +0 -135
  234. data/ruby/Makefile.am +0 -1
  235. data/ruby/Makefile.in +0 -628
  236. data/ruby/lib/Makefile.am +0 -3
  237. data/ruby/lib/Makefile.in +0 -506
  238. data/ruby/lib/mkmf-rice.rb.in +0 -217
  239. data/ruby/lib/version.rb +0 -3
  240. data/sample/Makefile.am +0 -47
  241. data/sample/Makefile.in +0 -489
  242. data/test/Makefile.am +0 -72
  243. data/test/Makefile.in +0 -1213
  244. data/test/ext/Makefile.am +0 -41
  245. data/test/ext/Makefile.in +0 -483
  246. data/test/test_rice.rb +0 -41
@@ -1,2774 +0,0 @@
1
- #ifndef Rice__detail__Auto_Member_Function_Wrapper__ipp_
2
- #define Rice__detail__Auto_Member_Function_Wrapper__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 "method_data.hpp"
11
- #include "../ruby_try_catch.hpp"
12
- #include "../to_from_ruby.hpp"
13
- #include "traits.hpp"
14
- #include <typeinfo>
15
- namespace Rice
16
- {
17
-
18
- namespace detail
19
- {
20
-
21
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T, typename Arg15_T>
22
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T>::
23
- Auto_Member_Function_Wrapper(
24
- Func func,
25
- Data_Object<Exception_Handler> handler,
26
- Arguments* arguments)
27
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
28
- , func_(func)
29
- , handler_(handler)
30
- , handler_guard_(&handler_)
31
- , arguments_(arguments)
32
- {
33
- if(arguments == 0) {
34
- arguments_ = new Arguments();
35
- } else {
36
- arguments_ = arguments;
37
- }
38
- }
39
-
40
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T, typename Arg15_T>
41
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T>::
42
- ~Auto_Member_Function_Wrapper()
43
- {
44
- if(arguments_) { delete arguments_; }
45
- }
46
-
47
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T, typename Arg15_T>
48
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T>::
49
- call(int argc, VALUE* argv, VALUE self)
50
- {
51
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T> * wrapper = 0;
52
- try
53
- {
54
- Data_Object<Wrapped_Function> data(detail::method_data());
55
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T> *)data.get();
56
- Arguments* args = wrapper->arguments_;
57
-
58
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15;
59
-
60
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14, &varg15);
61
-
62
- Self_T * obj = from_ruby<Self_T *>(self);
63
-
64
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
65
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
66
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
67
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
68
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
69
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
70
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
71
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
72
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
73
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
74
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
75
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
76
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
77
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
78
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
79
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
80
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
81
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
82
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
83
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
84
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
85
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
86
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
87
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
88
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
89
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
90
- typedef typename sanitize< Arg13_T >::Type Arg13_Type;
91
- Arg13_Type arg13 = args->getArgumentOrDefault<Arg13_Type>(13, varg13);
92
- typedef typename sanitize< Arg14_T >::Type Arg14_Type;
93
- Arg14_Type arg14 = args->getArgumentOrDefault<Arg14_Type>(14, varg14);
94
- typedef typename sanitize< Arg15_T >::Type Arg15_Type;
95
- Arg15_Type arg15 = args->getArgumentOrDefault<Arg15_Type>(15, varg15);
96
-
97
- Func func = wrapper->func_;
98
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15));
99
- }
100
- catch(...)
101
- {
102
- RUBY_TRY
103
- {
104
- if(wrapper)
105
- {
106
- return wrapper->handler_->handle_exception();
107
- }
108
- else
109
- {
110
- throw;
111
- }
112
- }
113
- RUBY_CATCH
114
- }
115
- }
116
-
117
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T, typename Arg15_T>
118
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T>::
119
- Auto_Member_Function_Wrapper(
120
- Func func,
121
- Data_Object<Exception_Handler> handler,
122
- Arguments* arguments)
123
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
124
- , func_(func)
125
- , handler_(handler)
126
- , handler_guard_(&handler_)
127
- , arguments_(arguments)
128
- {
129
- if(arguments == 0) {
130
- arguments_ = new Arguments();
131
- } else {
132
- arguments_ = arguments;
133
- }
134
- }
135
-
136
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T, typename Arg15_T>
137
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T>::
138
- ~Auto_Member_Function_Wrapper()
139
- {
140
- if(arguments_) { delete arguments_; }
141
- }
142
-
143
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T, typename Arg15_T>
144
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T>::
145
- call(int argc, VALUE* argv, VALUE self)
146
- {
147
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T> * wrapper = 0;
148
- try
149
- {
150
- Data_Object<Wrapped_Function> data(detail::method_data());
151
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T> *)data.get();
152
- Arguments* args = wrapper->arguments_;
153
-
154
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15;
155
-
156
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14, &varg15);
157
-
158
- Self_T * obj = from_ruby<Self_T *>(self);
159
-
160
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
161
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
162
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
163
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
164
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
165
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
166
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
167
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
168
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
169
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
170
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
171
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
172
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
173
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
174
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
175
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
176
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
177
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
178
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
179
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
180
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
181
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
182
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
183
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
184
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
185
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
186
- typedef typename sanitize< Arg13_T >::Type Arg13_Type;
187
- Arg13_Type arg13 = args->getArgumentOrDefault<Arg13_Type>(13, varg13);
188
- typedef typename sanitize< Arg14_T >::Type Arg14_Type;
189
- Arg14_Type arg14 = args->getArgumentOrDefault<Arg14_Type>(14, varg14);
190
- typedef typename sanitize< Arg15_T >::Type Arg15_Type;
191
- Arg15_Type arg15 = args->getArgumentOrDefault<Arg15_Type>(15, varg15);
192
-
193
- Func func = wrapper->func_;
194
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
195
- return Qnil;
196
- }
197
- catch(...)
198
- {
199
- RUBY_TRY
200
- {
201
- if(wrapper)
202
- {
203
- return wrapper->handler_->handle_exception();
204
- }
205
- else
206
- {
207
- throw;
208
- }
209
- }
210
- RUBY_CATCH
211
- }
212
- }
213
-
214
- // ---------------------------------------------------------------------
215
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T>
216
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T>::
217
- Auto_Member_Function_Wrapper(
218
- Func func,
219
- Data_Object<Exception_Handler> handler,
220
- Arguments* arguments)
221
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
222
- , func_(func)
223
- , handler_(handler)
224
- , handler_guard_(&handler_)
225
- , arguments_(arguments)
226
- {
227
- if(arguments == 0) {
228
- arguments_ = new Arguments();
229
- } else {
230
- arguments_ = arguments;
231
- }
232
- }
233
-
234
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T>
235
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T>::
236
- ~Auto_Member_Function_Wrapper()
237
- {
238
- if(arguments_) { delete arguments_; }
239
- }
240
-
241
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T>
242
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T>::
243
- call(int argc, VALUE* argv, VALUE self)
244
- {
245
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T> * wrapper = 0;
246
- try
247
- {
248
- Data_Object<Wrapped_Function> data(detail::method_data());
249
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T> *)data.get();
250
- Arguments* args = wrapper->arguments_;
251
-
252
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14;
253
-
254
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14);
255
-
256
- Self_T * obj = from_ruby<Self_T *>(self);
257
-
258
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
259
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
260
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
261
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
262
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
263
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
264
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
265
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
266
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
267
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
268
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
269
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
270
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
271
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
272
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
273
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
274
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
275
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
276
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
277
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
278
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
279
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
280
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
281
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
282
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
283
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
284
- typedef typename sanitize< Arg13_T >::Type Arg13_Type;
285
- Arg13_Type arg13 = args->getArgumentOrDefault<Arg13_Type>(13, varg13);
286
- typedef typename sanitize< Arg14_T >::Type Arg14_Type;
287
- Arg14_Type arg14 = args->getArgumentOrDefault<Arg14_Type>(14, varg14);
288
-
289
- Func func = wrapper->func_;
290
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14));
291
- }
292
- catch(...)
293
- {
294
- RUBY_TRY
295
- {
296
- if(wrapper)
297
- {
298
- return wrapper->handler_->handle_exception();
299
- }
300
- else
301
- {
302
- throw;
303
- }
304
- }
305
- RUBY_CATCH
306
- }
307
- }
308
-
309
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T>
310
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T>::
311
- Auto_Member_Function_Wrapper(
312
- Func func,
313
- Data_Object<Exception_Handler> handler,
314
- Arguments* arguments)
315
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
316
- , func_(func)
317
- , handler_(handler)
318
- , handler_guard_(&handler_)
319
- , arguments_(arguments)
320
- {
321
- if(arguments == 0) {
322
- arguments_ = new Arguments();
323
- } else {
324
- arguments_ = arguments;
325
- }
326
- }
327
-
328
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T>
329
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T>::
330
- ~Auto_Member_Function_Wrapper()
331
- {
332
- if(arguments_) { delete arguments_; }
333
- }
334
-
335
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T, typename Arg14_T>
336
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T>::
337
- call(int argc, VALUE* argv, VALUE self)
338
- {
339
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T> * wrapper = 0;
340
- try
341
- {
342
- Data_Object<Wrapped_Function> data(detail::method_data());
343
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T> *)data.get();
344
- Arguments* args = wrapper->arguments_;
345
-
346
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14;
347
-
348
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14);
349
-
350
- Self_T * obj = from_ruby<Self_T *>(self);
351
-
352
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
353
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
354
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
355
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
356
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
357
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
358
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
359
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
360
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
361
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
362
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
363
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
364
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
365
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
366
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
367
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
368
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
369
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
370
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
371
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
372
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
373
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
374
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
375
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
376
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
377
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
378
- typedef typename sanitize< Arg13_T >::Type Arg13_Type;
379
- Arg13_Type arg13 = args->getArgumentOrDefault<Arg13_Type>(13, varg13);
380
- typedef typename sanitize< Arg14_T >::Type Arg14_Type;
381
- Arg14_Type arg14 = args->getArgumentOrDefault<Arg14_Type>(14, varg14);
382
-
383
- Func func = wrapper->func_;
384
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
385
- return Qnil;
386
- }
387
- catch(...)
388
- {
389
- RUBY_TRY
390
- {
391
- if(wrapper)
392
- {
393
- return wrapper->handler_->handle_exception();
394
- }
395
- else
396
- {
397
- throw;
398
- }
399
- }
400
- RUBY_CATCH
401
- }
402
- }
403
-
404
- // ---------------------------------------------------------------------
405
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T>
406
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T>::
407
- Auto_Member_Function_Wrapper(
408
- Func func,
409
- Data_Object<Exception_Handler> handler,
410
- Arguments* arguments)
411
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
412
- , func_(func)
413
- , handler_(handler)
414
- , handler_guard_(&handler_)
415
- , arguments_(arguments)
416
- {
417
- if(arguments == 0) {
418
- arguments_ = new Arguments();
419
- } else {
420
- arguments_ = arguments;
421
- }
422
- }
423
-
424
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T>
425
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T>::
426
- ~Auto_Member_Function_Wrapper()
427
- {
428
- if(arguments_) { delete arguments_; }
429
- }
430
-
431
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T>
432
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T>::
433
- call(int argc, VALUE* argv, VALUE self)
434
- {
435
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T> * wrapper = 0;
436
- try
437
- {
438
- Data_Object<Wrapped_Function> data(detail::method_data());
439
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T> *)data.get();
440
- Arguments* args = wrapper->arguments_;
441
-
442
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13;
443
-
444
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13);
445
-
446
- Self_T * obj = from_ruby<Self_T *>(self);
447
-
448
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
449
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
450
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
451
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
452
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
453
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
454
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
455
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
456
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
457
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
458
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
459
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
460
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
461
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
462
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
463
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
464
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
465
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
466
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
467
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
468
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
469
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
470
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
471
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
472
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
473
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
474
- typedef typename sanitize< Arg13_T >::Type Arg13_Type;
475
- Arg13_Type arg13 = args->getArgumentOrDefault<Arg13_Type>(13, varg13);
476
-
477
- Func func = wrapper->func_;
478
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13));
479
- }
480
- catch(...)
481
- {
482
- RUBY_TRY
483
- {
484
- if(wrapper)
485
- {
486
- return wrapper->handler_->handle_exception();
487
- }
488
- else
489
- {
490
- throw;
491
- }
492
- }
493
- RUBY_CATCH
494
- }
495
- }
496
-
497
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T>
498
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T>::
499
- Auto_Member_Function_Wrapper(
500
- Func func,
501
- Data_Object<Exception_Handler> handler,
502
- Arguments* arguments)
503
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
504
- , func_(func)
505
- , handler_(handler)
506
- , handler_guard_(&handler_)
507
- , arguments_(arguments)
508
- {
509
- if(arguments == 0) {
510
- arguments_ = new Arguments();
511
- } else {
512
- arguments_ = arguments;
513
- }
514
- }
515
-
516
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T>
517
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T>::
518
- ~Auto_Member_Function_Wrapper()
519
- {
520
- if(arguments_) { delete arguments_; }
521
- }
522
-
523
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T, typename Arg13_T>
524
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T>::
525
- call(int argc, VALUE* argv, VALUE self)
526
- {
527
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T> * wrapper = 0;
528
- try
529
- {
530
- Data_Object<Wrapped_Function> data(detail::method_data());
531
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T> *)data.get();
532
- Arguments* args = wrapper->arguments_;
533
-
534
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13;
535
-
536
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13);
537
-
538
- Self_T * obj = from_ruby<Self_T *>(self);
539
-
540
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
541
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
542
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
543
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
544
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
545
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
546
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
547
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
548
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
549
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
550
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
551
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
552
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
553
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
554
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
555
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
556
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
557
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
558
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
559
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
560
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
561
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
562
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
563
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
564
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
565
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
566
- typedef typename sanitize< Arg13_T >::Type Arg13_Type;
567
- Arg13_Type arg13 = args->getArgumentOrDefault<Arg13_Type>(13, varg13);
568
-
569
- Func func = wrapper->func_;
570
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
571
- return Qnil;
572
- }
573
- catch(...)
574
- {
575
- RUBY_TRY
576
- {
577
- if(wrapper)
578
- {
579
- return wrapper->handler_->handle_exception();
580
- }
581
- else
582
- {
583
- throw;
584
- }
585
- }
586
- RUBY_CATCH
587
- }
588
- }
589
-
590
- // ---------------------------------------------------------------------
591
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T>
592
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T>::
593
- Auto_Member_Function_Wrapper(
594
- Func func,
595
- Data_Object<Exception_Handler> handler,
596
- Arguments* arguments)
597
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
598
- , func_(func)
599
- , handler_(handler)
600
- , handler_guard_(&handler_)
601
- , arguments_(arguments)
602
- {
603
- if(arguments == 0) {
604
- arguments_ = new Arguments();
605
- } else {
606
- arguments_ = arguments;
607
- }
608
- }
609
-
610
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T>
611
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T>::
612
- ~Auto_Member_Function_Wrapper()
613
- {
614
- if(arguments_) { delete arguments_; }
615
- }
616
-
617
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T>
618
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T>::
619
- call(int argc, VALUE* argv, VALUE self)
620
- {
621
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T> * wrapper = 0;
622
- try
623
- {
624
- Data_Object<Wrapped_Function> data(detail::method_data());
625
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T> *)data.get();
626
- Arguments* args = wrapper->arguments_;
627
-
628
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12;
629
-
630
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12);
631
-
632
- Self_T * obj = from_ruby<Self_T *>(self);
633
-
634
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
635
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
636
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
637
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
638
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
639
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
640
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
641
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
642
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
643
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
644
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
645
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
646
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
647
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
648
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
649
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
650
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
651
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
652
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
653
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
654
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
655
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
656
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
657
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
658
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
659
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
660
-
661
- Func func = wrapper->func_;
662
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12));
663
- }
664
- catch(...)
665
- {
666
- RUBY_TRY
667
- {
668
- if(wrapper)
669
- {
670
- return wrapper->handler_->handle_exception();
671
- }
672
- else
673
- {
674
- throw;
675
- }
676
- }
677
- RUBY_CATCH
678
- }
679
- }
680
-
681
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T>
682
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T>::
683
- Auto_Member_Function_Wrapper(
684
- Func func,
685
- Data_Object<Exception_Handler> handler,
686
- Arguments* arguments)
687
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
688
- , func_(func)
689
- , handler_(handler)
690
- , handler_guard_(&handler_)
691
- , arguments_(arguments)
692
- {
693
- if(arguments == 0) {
694
- arguments_ = new Arguments();
695
- } else {
696
- arguments_ = arguments;
697
- }
698
- }
699
-
700
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T>
701
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T>::
702
- ~Auto_Member_Function_Wrapper()
703
- {
704
- if(arguments_) { delete arguments_; }
705
- }
706
-
707
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T, typename Arg12_T>
708
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T>::
709
- call(int argc, VALUE* argv, VALUE self)
710
- {
711
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T> * wrapper = 0;
712
- try
713
- {
714
- Data_Object<Wrapped_Function> data(detail::method_data());
715
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T> *)data.get();
716
- Arguments* args = wrapper->arguments_;
717
-
718
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12;
719
-
720
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12);
721
-
722
- Self_T * obj = from_ruby<Self_T *>(self);
723
-
724
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
725
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
726
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
727
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
728
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
729
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
730
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
731
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
732
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
733
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
734
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
735
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
736
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
737
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
738
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
739
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
740
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
741
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
742
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
743
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
744
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
745
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
746
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
747
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
748
- typedef typename sanitize< Arg12_T >::Type Arg12_Type;
749
- Arg12_Type arg12 = args->getArgumentOrDefault<Arg12_Type>(12, varg12);
750
-
751
- Func func = wrapper->func_;
752
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
753
- return Qnil;
754
- }
755
- catch(...)
756
- {
757
- RUBY_TRY
758
- {
759
- if(wrapper)
760
- {
761
- return wrapper->handler_->handle_exception();
762
- }
763
- else
764
- {
765
- throw;
766
- }
767
- }
768
- RUBY_CATCH
769
- }
770
- }
771
-
772
- // ---------------------------------------------------------------------
773
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T>
774
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T>::
775
- Auto_Member_Function_Wrapper(
776
- Func func,
777
- Data_Object<Exception_Handler> handler,
778
- Arguments* arguments)
779
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
780
- , func_(func)
781
- , handler_(handler)
782
- , handler_guard_(&handler_)
783
- , arguments_(arguments)
784
- {
785
- if(arguments == 0) {
786
- arguments_ = new Arguments();
787
- } else {
788
- arguments_ = arguments;
789
- }
790
- }
791
-
792
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T>
793
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T>::
794
- ~Auto_Member_Function_Wrapper()
795
- {
796
- if(arguments_) { delete arguments_; }
797
- }
798
-
799
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T>
800
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T>::
801
- call(int argc, VALUE* argv, VALUE self)
802
- {
803
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T> * wrapper = 0;
804
- try
805
- {
806
- Data_Object<Wrapped_Function> data(detail::method_data());
807
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T> *)data.get();
808
- Arguments* args = wrapper->arguments_;
809
-
810
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11;
811
-
812
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11);
813
-
814
- Self_T * obj = from_ruby<Self_T *>(self);
815
-
816
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
817
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
818
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
819
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
820
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
821
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
822
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
823
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
824
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
825
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
826
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
827
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
828
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
829
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
830
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
831
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
832
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
833
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
834
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
835
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
836
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
837
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
838
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
839
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
840
-
841
- Func func = wrapper->func_;
842
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11));
843
- }
844
- catch(...)
845
- {
846
- RUBY_TRY
847
- {
848
- if(wrapper)
849
- {
850
- return wrapper->handler_->handle_exception();
851
- }
852
- else
853
- {
854
- throw;
855
- }
856
- }
857
- RUBY_CATCH
858
- }
859
- }
860
-
861
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T>
862
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T>::
863
- Auto_Member_Function_Wrapper(
864
- Func func,
865
- Data_Object<Exception_Handler> handler,
866
- Arguments* arguments)
867
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
868
- , func_(func)
869
- , handler_(handler)
870
- , handler_guard_(&handler_)
871
- , arguments_(arguments)
872
- {
873
- if(arguments == 0) {
874
- arguments_ = new Arguments();
875
- } else {
876
- arguments_ = arguments;
877
- }
878
- }
879
-
880
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T>
881
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T>::
882
- ~Auto_Member_Function_Wrapper()
883
- {
884
- if(arguments_) { delete arguments_; }
885
- }
886
-
887
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T, typename Arg11_T>
888
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T>::
889
- call(int argc, VALUE* argv, VALUE self)
890
- {
891
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T> * wrapper = 0;
892
- try
893
- {
894
- Data_Object<Wrapped_Function> data(detail::method_data());
895
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T> *)data.get();
896
- Arguments* args = wrapper->arguments_;
897
-
898
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11;
899
-
900
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11);
901
-
902
- Self_T * obj = from_ruby<Self_T *>(self);
903
-
904
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
905
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
906
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
907
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
908
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
909
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
910
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
911
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
912
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
913
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
914
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
915
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
916
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
917
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
918
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
919
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
920
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
921
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
922
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
923
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
924
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
925
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
926
- typedef typename sanitize< Arg11_T >::Type Arg11_Type;
927
- Arg11_Type arg11 = args->getArgumentOrDefault<Arg11_Type>(11, varg11);
928
-
929
- Func func = wrapper->func_;
930
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
931
- return Qnil;
932
- }
933
- catch(...)
934
- {
935
- RUBY_TRY
936
- {
937
- if(wrapper)
938
- {
939
- return wrapper->handler_->handle_exception();
940
- }
941
- else
942
- {
943
- throw;
944
- }
945
- }
946
- RUBY_CATCH
947
- }
948
- }
949
-
950
- // ---------------------------------------------------------------------
951
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T>
952
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T>::
953
- Auto_Member_Function_Wrapper(
954
- Func func,
955
- Data_Object<Exception_Handler> handler,
956
- Arguments* arguments)
957
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
958
- , func_(func)
959
- , handler_(handler)
960
- , handler_guard_(&handler_)
961
- , arguments_(arguments)
962
- {
963
- if(arguments == 0) {
964
- arguments_ = new Arguments();
965
- } else {
966
- arguments_ = arguments;
967
- }
968
- }
969
-
970
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T>
971
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T>::
972
- ~Auto_Member_Function_Wrapper()
973
- {
974
- if(arguments_) { delete arguments_; }
975
- }
976
-
977
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T>
978
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T>::
979
- call(int argc, VALUE* argv, VALUE self)
980
- {
981
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T> * wrapper = 0;
982
- try
983
- {
984
- Data_Object<Wrapped_Function> data(detail::method_data());
985
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T> *)data.get();
986
- Arguments* args = wrapper->arguments_;
987
-
988
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10;
989
-
990
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10);
991
-
992
- Self_T * obj = from_ruby<Self_T *>(self);
993
-
994
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
995
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
996
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
997
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
998
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
999
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1000
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1001
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1002
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1003
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1004
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1005
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1006
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1007
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1008
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1009
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1010
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
1011
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
1012
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
1013
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
1014
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
1015
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
1016
-
1017
- Func func = wrapper->func_;
1018
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10));
1019
- }
1020
- catch(...)
1021
- {
1022
- RUBY_TRY
1023
- {
1024
- if(wrapper)
1025
- {
1026
- return wrapper->handler_->handle_exception();
1027
- }
1028
- else
1029
- {
1030
- throw;
1031
- }
1032
- }
1033
- RUBY_CATCH
1034
- }
1035
- }
1036
-
1037
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T>
1038
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T>::
1039
- Auto_Member_Function_Wrapper(
1040
- Func func,
1041
- Data_Object<Exception_Handler> handler,
1042
- Arguments* arguments)
1043
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1044
- , func_(func)
1045
- , handler_(handler)
1046
- , handler_guard_(&handler_)
1047
- , arguments_(arguments)
1048
- {
1049
- if(arguments == 0) {
1050
- arguments_ = new Arguments();
1051
- } else {
1052
- arguments_ = arguments;
1053
- }
1054
- }
1055
-
1056
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T>
1057
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T>::
1058
- ~Auto_Member_Function_Wrapper()
1059
- {
1060
- if(arguments_) { delete arguments_; }
1061
- }
1062
-
1063
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T, typename Arg10_T>
1064
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T>::
1065
- call(int argc, VALUE* argv, VALUE self)
1066
- {
1067
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T> * wrapper = 0;
1068
- try
1069
- {
1070
- Data_Object<Wrapped_Function> data(detail::method_data());
1071
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T> *)data.get();
1072
- Arguments* args = wrapper->arguments_;
1073
-
1074
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10;
1075
-
1076
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10);
1077
-
1078
- Self_T * obj = from_ruby<Self_T *>(self);
1079
-
1080
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1081
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1082
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1083
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1084
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1085
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1086
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1087
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1088
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1089
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1090
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1091
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1092
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1093
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1094
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1095
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1096
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
1097
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
1098
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
1099
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
1100
- typedef typename sanitize< Arg10_T >::Type Arg10_Type;
1101
- Arg10_Type arg10 = args->getArgumentOrDefault<Arg10_Type>(10, varg10);
1102
-
1103
- Func func = wrapper->func_;
1104
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
1105
- return Qnil;
1106
- }
1107
- catch(...)
1108
- {
1109
- RUBY_TRY
1110
- {
1111
- if(wrapper)
1112
- {
1113
- return wrapper->handler_->handle_exception();
1114
- }
1115
- else
1116
- {
1117
- throw;
1118
- }
1119
- }
1120
- RUBY_CATCH
1121
- }
1122
- }
1123
-
1124
- // ---------------------------------------------------------------------
1125
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T>
1126
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T>::
1127
- Auto_Member_Function_Wrapper(
1128
- Func func,
1129
- Data_Object<Exception_Handler> handler,
1130
- Arguments* arguments)
1131
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1132
- , func_(func)
1133
- , handler_(handler)
1134
- , handler_guard_(&handler_)
1135
- , arguments_(arguments)
1136
- {
1137
- if(arguments == 0) {
1138
- arguments_ = new Arguments();
1139
- } else {
1140
- arguments_ = arguments;
1141
- }
1142
- }
1143
-
1144
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T>
1145
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T>::
1146
- ~Auto_Member_Function_Wrapper()
1147
- {
1148
- if(arguments_) { delete arguments_; }
1149
- }
1150
-
1151
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T>
1152
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T>::
1153
- call(int argc, VALUE* argv, VALUE self)
1154
- {
1155
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T> * wrapper = 0;
1156
- try
1157
- {
1158
- Data_Object<Wrapped_Function> data(detail::method_data());
1159
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T> *)data.get();
1160
- Arguments* args = wrapper->arguments_;
1161
-
1162
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9;
1163
-
1164
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9);
1165
-
1166
- Self_T * obj = from_ruby<Self_T *>(self);
1167
-
1168
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1169
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1170
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1171
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1172
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1173
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1174
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1175
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1176
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1177
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1178
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1179
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1180
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1181
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1182
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1183
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1184
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
1185
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
1186
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
1187
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
1188
-
1189
- Func func = wrapper->func_;
1190
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9));
1191
- }
1192
- catch(...)
1193
- {
1194
- RUBY_TRY
1195
- {
1196
- if(wrapper)
1197
- {
1198
- return wrapper->handler_->handle_exception();
1199
- }
1200
- else
1201
- {
1202
- throw;
1203
- }
1204
- }
1205
- RUBY_CATCH
1206
- }
1207
- }
1208
-
1209
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T>
1210
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T>::
1211
- Auto_Member_Function_Wrapper(
1212
- Func func,
1213
- Data_Object<Exception_Handler> handler,
1214
- Arguments* arguments)
1215
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1216
- , func_(func)
1217
- , handler_(handler)
1218
- , handler_guard_(&handler_)
1219
- , arguments_(arguments)
1220
- {
1221
- if(arguments == 0) {
1222
- arguments_ = new Arguments();
1223
- } else {
1224
- arguments_ = arguments;
1225
- }
1226
- }
1227
-
1228
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T>
1229
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T>::
1230
- ~Auto_Member_Function_Wrapper()
1231
- {
1232
- if(arguments_) { delete arguments_; }
1233
- }
1234
-
1235
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T, typename Arg9_T>
1236
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T>::
1237
- call(int argc, VALUE* argv, VALUE self)
1238
- {
1239
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T> * wrapper = 0;
1240
- try
1241
- {
1242
- Data_Object<Wrapped_Function> data(detail::method_data());
1243
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T> *)data.get();
1244
- Arguments* args = wrapper->arguments_;
1245
-
1246
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9;
1247
-
1248
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9);
1249
-
1250
- Self_T * obj = from_ruby<Self_T *>(self);
1251
-
1252
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1253
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1254
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1255
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1256
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1257
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1258
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1259
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1260
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1261
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1262
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1263
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1264
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1265
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1266
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1267
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1268
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
1269
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
1270
- typedef typename sanitize< Arg9_T >::Type Arg9_Type;
1271
- Arg9_Type arg9 = args->getArgumentOrDefault<Arg9_Type>(9, varg9);
1272
-
1273
- Func func = wrapper->func_;
1274
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
1275
- return Qnil;
1276
- }
1277
- catch(...)
1278
- {
1279
- RUBY_TRY
1280
- {
1281
- if(wrapper)
1282
- {
1283
- return wrapper->handler_->handle_exception();
1284
- }
1285
- else
1286
- {
1287
- throw;
1288
- }
1289
- }
1290
- RUBY_CATCH
1291
- }
1292
- }
1293
-
1294
- // ---------------------------------------------------------------------
1295
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T>
1296
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T>::
1297
- Auto_Member_Function_Wrapper(
1298
- Func func,
1299
- Data_Object<Exception_Handler> handler,
1300
- Arguments* arguments)
1301
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1302
- , func_(func)
1303
- , handler_(handler)
1304
- , handler_guard_(&handler_)
1305
- , arguments_(arguments)
1306
- {
1307
- if(arguments == 0) {
1308
- arguments_ = new Arguments();
1309
- } else {
1310
- arguments_ = arguments;
1311
- }
1312
- }
1313
-
1314
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T>
1315
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T>::
1316
- ~Auto_Member_Function_Wrapper()
1317
- {
1318
- if(arguments_) { delete arguments_; }
1319
- }
1320
-
1321
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T>
1322
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T>::
1323
- call(int argc, VALUE* argv, VALUE self)
1324
- {
1325
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T> * wrapper = 0;
1326
- try
1327
- {
1328
- Data_Object<Wrapped_Function> data(detail::method_data());
1329
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T> *)data.get();
1330
- Arguments* args = wrapper->arguments_;
1331
-
1332
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8;
1333
-
1334
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8);
1335
-
1336
- Self_T * obj = from_ruby<Self_T *>(self);
1337
-
1338
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1339
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1340
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1341
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1342
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1343
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1344
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1345
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1346
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1347
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1348
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1349
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1350
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1351
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1352
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1353
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1354
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
1355
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
1356
-
1357
- Func func = wrapper->func_;
1358
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8));
1359
- }
1360
- catch(...)
1361
- {
1362
- RUBY_TRY
1363
- {
1364
- if(wrapper)
1365
- {
1366
- return wrapper->handler_->handle_exception();
1367
- }
1368
- else
1369
- {
1370
- throw;
1371
- }
1372
- }
1373
- RUBY_CATCH
1374
- }
1375
- }
1376
-
1377
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T>
1378
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T>::
1379
- Auto_Member_Function_Wrapper(
1380
- Func func,
1381
- Data_Object<Exception_Handler> handler,
1382
- Arguments* arguments)
1383
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1384
- , func_(func)
1385
- , handler_(handler)
1386
- , handler_guard_(&handler_)
1387
- , arguments_(arguments)
1388
- {
1389
- if(arguments == 0) {
1390
- arguments_ = new Arguments();
1391
- } else {
1392
- arguments_ = arguments;
1393
- }
1394
- }
1395
-
1396
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T>
1397
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T>::
1398
- ~Auto_Member_Function_Wrapper()
1399
- {
1400
- if(arguments_) { delete arguments_; }
1401
- }
1402
-
1403
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T, typename Arg8_T>
1404
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T>::
1405
- call(int argc, VALUE* argv, VALUE self)
1406
- {
1407
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T> * wrapper = 0;
1408
- try
1409
- {
1410
- Data_Object<Wrapped_Function> data(detail::method_data());
1411
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T> *)data.get();
1412
- Arguments* args = wrapper->arguments_;
1413
-
1414
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8;
1415
-
1416
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8);
1417
-
1418
- Self_T * obj = from_ruby<Self_T *>(self);
1419
-
1420
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1421
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1422
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1423
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1424
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1425
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1426
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1427
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1428
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1429
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1430
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1431
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1432
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1433
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1434
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1435
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1436
- typedef typename sanitize< Arg8_T >::Type Arg8_Type;
1437
- Arg8_Type arg8 = args->getArgumentOrDefault<Arg8_Type>(8, varg8);
1438
-
1439
- Func func = wrapper->func_;
1440
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1441
- return Qnil;
1442
- }
1443
- catch(...)
1444
- {
1445
- RUBY_TRY
1446
- {
1447
- if(wrapper)
1448
- {
1449
- return wrapper->handler_->handle_exception();
1450
- }
1451
- else
1452
- {
1453
- throw;
1454
- }
1455
- }
1456
- RUBY_CATCH
1457
- }
1458
- }
1459
-
1460
- // ---------------------------------------------------------------------
1461
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T>
1462
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T>::
1463
- Auto_Member_Function_Wrapper(
1464
- Func func,
1465
- Data_Object<Exception_Handler> handler,
1466
- Arguments* arguments)
1467
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1468
- , func_(func)
1469
- , handler_(handler)
1470
- , handler_guard_(&handler_)
1471
- , arguments_(arguments)
1472
- {
1473
- if(arguments == 0) {
1474
- arguments_ = new Arguments();
1475
- } else {
1476
- arguments_ = arguments;
1477
- }
1478
- }
1479
-
1480
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T>
1481
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T>::
1482
- ~Auto_Member_Function_Wrapper()
1483
- {
1484
- if(arguments_) { delete arguments_; }
1485
- }
1486
-
1487
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T>
1488
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T>::
1489
- call(int argc, VALUE* argv, VALUE self)
1490
- {
1491
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T> * wrapper = 0;
1492
- try
1493
- {
1494
- Data_Object<Wrapped_Function> data(detail::method_data());
1495
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T> *)data.get();
1496
- Arguments* args = wrapper->arguments_;
1497
-
1498
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7;
1499
-
1500
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7);
1501
-
1502
- Self_T * obj = from_ruby<Self_T *>(self);
1503
-
1504
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1505
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1506
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1507
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1508
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1509
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1510
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1511
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1512
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1513
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1514
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1515
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1516
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1517
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1518
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1519
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1520
-
1521
- Func func = wrapper->func_;
1522
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7));
1523
- }
1524
- catch(...)
1525
- {
1526
- RUBY_TRY
1527
- {
1528
- if(wrapper)
1529
- {
1530
- return wrapper->handler_->handle_exception();
1531
- }
1532
- else
1533
- {
1534
- throw;
1535
- }
1536
- }
1537
- RUBY_CATCH
1538
- }
1539
- }
1540
-
1541
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T>
1542
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T>::
1543
- Auto_Member_Function_Wrapper(
1544
- Func func,
1545
- Data_Object<Exception_Handler> handler,
1546
- Arguments* arguments)
1547
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1548
- , func_(func)
1549
- , handler_(handler)
1550
- , handler_guard_(&handler_)
1551
- , arguments_(arguments)
1552
- {
1553
- if(arguments == 0) {
1554
- arguments_ = new Arguments();
1555
- } else {
1556
- arguments_ = arguments;
1557
- }
1558
- }
1559
-
1560
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T>
1561
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T>::
1562
- ~Auto_Member_Function_Wrapper()
1563
- {
1564
- if(arguments_) { delete arguments_; }
1565
- }
1566
-
1567
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T, typename Arg7_T>
1568
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T>::
1569
- call(int argc, VALUE* argv, VALUE self)
1570
- {
1571
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T> * wrapper = 0;
1572
- try
1573
- {
1574
- Data_Object<Wrapped_Function> data(detail::method_data());
1575
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T> *)data.get();
1576
- Arguments* args = wrapper->arguments_;
1577
-
1578
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6, varg7;
1579
-
1580
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7);
1581
-
1582
- Self_T * obj = from_ruby<Self_T *>(self);
1583
-
1584
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1585
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1586
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1587
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1588
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1589
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1590
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1591
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1592
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1593
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1594
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1595
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1596
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1597
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1598
- typedef typename sanitize< Arg7_T >::Type Arg7_Type;
1599
- Arg7_Type arg7 = args->getArgumentOrDefault<Arg7_Type>(7, varg7);
1600
-
1601
- Func func = wrapper->func_;
1602
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1603
- return Qnil;
1604
- }
1605
- catch(...)
1606
- {
1607
- RUBY_TRY
1608
- {
1609
- if(wrapper)
1610
- {
1611
- return wrapper->handler_->handle_exception();
1612
- }
1613
- else
1614
- {
1615
- throw;
1616
- }
1617
- }
1618
- RUBY_CATCH
1619
- }
1620
- }
1621
-
1622
- // ---------------------------------------------------------------------
1623
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
1624
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T>::
1625
- Auto_Member_Function_Wrapper(
1626
- Func func,
1627
- Data_Object<Exception_Handler> handler,
1628
- Arguments* arguments)
1629
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1630
- , func_(func)
1631
- , handler_(handler)
1632
- , handler_guard_(&handler_)
1633
- , arguments_(arguments)
1634
- {
1635
- if(arguments == 0) {
1636
- arguments_ = new Arguments();
1637
- } else {
1638
- arguments_ = arguments;
1639
- }
1640
- }
1641
-
1642
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
1643
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T>::
1644
- ~Auto_Member_Function_Wrapper()
1645
- {
1646
- if(arguments_) { delete arguments_; }
1647
- }
1648
-
1649
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
1650
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T>::
1651
- call(int argc, VALUE* argv, VALUE self)
1652
- {
1653
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T> * wrapper = 0;
1654
- try
1655
- {
1656
- Data_Object<Wrapped_Function> data(detail::method_data());
1657
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T> *)data.get();
1658
- Arguments* args = wrapper->arguments_;
1659
-
1660
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6;
1661
-
1662
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6);
1663
-
1664
- Self_T * obj = from_ruby<Self_T *>(self);
1665
-
1666
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1667
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1668
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1669
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1670
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1671
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1672
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1673
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1674
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1675
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1676
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1677
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1678
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1679
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1680
-
1681
- Func func = wrapper->func_;
1682
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6));
1683
- }
1684
- catch(...)
1685
- {
1686
- RUBY_TRY
1687
- {
1688
- if(wrapper)
1689
- {
1690
- return wrapper->handler_->handle_exception();
1691
- }
1692
- else
1693
- {
1694
- throw;
1695
- }
1696
- }
1697
- RUBY_CATCH
1698
- }
1699
- }
1700
-
1701
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
1702
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T>::
1703
- Auto_Member_Function_Wrapper(
1704
- Func func,
1705
- Data_Object<Exception_Handler> handler,
1706
- Arguments* arguments)
1707
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1708
- , func_(func)
1709
- , handler_(handler)
1710
- , handler_guard_(&handler_)
1711
- , arguments_(arguments)
1712
- {
1713
- if(arguments == 0) {
1714
- arguments_ = new Arguments();
1715
- } else {
1716
- arguments_ = arguments;
1717
- }
1718
- }
1719
-
1720
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
1721
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T>::
1722
- ~Auto_Member_Function_Wrapper()
1723
- {
1724
- if(arguments_) { delete arguments_; }
1725
- }
1726
-
1727
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
1728
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T>::
1729
- call(int argc, VALUE* argv, VALUE self)
1730
- {
1731
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T> * wrapper = 0;
1732
- try
1733
- {
1734
- Data_Object<Wrapped_Function> data(detail::method_data());
1735
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T> *)data.get();
1736
- Arguments* args = wrapper->arguments_;
1737
-
1738
- VALUE varg0, varg1, varg2, varg3, varg4, varg5, varg6;
1739
-
1740
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5, &varg6);
1741
-
1742
- Self_T * obj = from_ruby<Self_T *>(self);
1743
-
1744
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1745
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1746
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1747
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1748
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1749
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1750
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1751
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1752
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1753
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1754
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1755
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1756
- typedef typename sanitize< Arg6_T >::Type Arg6_Type;
1757
- Arg6_Type arg6 = args->getArgumentOrDefault<Arg6_Type>(6, varg6);
1758
-
1759
- Func func = wrapper->func_;
1760
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
1761
- return Qnil;
1762
- }
1763
- catch(...)
1764
- {
1765
- RUBY_TRY
1766
- {
1767
- if(wrapper)
1768
- {
1769
- return wrapper->handler_->handle_exception();
1770
- }
1771
- else
1772
- {
1773
- throw;
1774
- }
1775
- }
1776
- RUBY_CATCH
1777
- }
1778
- }
1779
-
1780
- // ---------------------------------------------------------------------
1781
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
1782
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T>::
1783
- Auto_Member_Function_Wrapper(
1784
- Func func,
1785
- Data_Object<Exception_Handler> handler,
1786
- Arguments* arguments)
1787
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1788
- , func_(func)
1789
- , handler_(handler)
1790
- , handler_guard_(&handler_)
1791
- , arguments_(arguments)
1792
- {
1793
- if(arguments == 0) {
1794
- arguments_ = new Arguments();
1795
- } else {
1796
- arguments_ = arguments;
1797
- }
1798
- }
1799
-
1800
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
1801
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T>::
1802
- ~Auto_Member_Function_Wrapper()
1803
- {
1804
- if(arguments_) { delete arguments_; }
1805
- }
1806
-
1807
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
1808
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T>::
1809
- call(int argc, VALUE* argv, VALUE self)
1810
- {
1811
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T> * wrapper = 0;
1812
- try
1813
- {
1814
- Data_Object<Wrapped_Function> data(detail::method_data());
1815
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T> *)data.get();
1816
- Arguments* args = wrapper->arguments_;
1817
-
1818
- VALUE varg0, varg1, varg2, varg3, varg4, varg5;
1819
-
1820
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5);
1821
-
1822
- Self_T * obj = from_ruby<Self_T *>(self);
1823
-
1824
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1825
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1826
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1827
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1828
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1829
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1830
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1831
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1832
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1833
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1834
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1835
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1836
-
1837
- Func func = wrapper->func_;
1838
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5));
1839
- }
1840
- catch(...)
1841
- {
1842
- RUBY_TRY
1843
- {
1844
- if(wrapper)
1845
- {
1846
- return wrapper->handler_->handle_exception();
1847
- }
1848
- else
1849
- {
1850
- throw;
1851
- }
1852
- }
1853
- RUBY_CATCH
1854
- }
1855
- }
1856
-
1857
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
1858
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T>::
1859
- Auto_Member_Function_Wrapper(
1860
- Func func,
1861
- Data_Object<Exception_Handler> handler,
1862
- Arguments* arguments)
1863
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1864
- , func_(func)
1865
- , handler_(handler)
1866
- , handler_guard_(&handler_)
1867
- , arguments_(arguments)
1868
- {
1869
- if(arguments == 0) {
1870
- arguments_ = new Arguments();
1871
- } else {
1872
- arguments_ = arguments;
1873
- }
1874
- }
1875
-
1876
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
1877
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T>::
1878
- ~Auto_Member_Function_Wrapper()
1879
- {
1880
- if(arguments_) { delete arguments_; }
1881
- }
1882
-
1883
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
1884
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T>::
1885
- call(int argc, VALUE* argv, VALUE self)
1886
- {
1887
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T> * wrapper = 0;
1888
- try
1889
- {
1890
- Data_Object<Wrapped_Function> data(detail::method_data());
1891
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T> *)data.get();
1892
- Arguments* args = wrapper->arguments_;
1893
-
1894
- VALUE varg0, varg1, varg2, varg3, varg4, varg5;
1895
-
1896
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4, &varg5);
1897
-
1898
- Self_T * obj = from_ruby<Self_T *>(self);
1899
-
1900
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1901
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1902
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1903
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1904
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1905
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1906
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1907
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1908
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1909
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1910
- typedef typename sanitize< Arg5_T >::Type Arg5_Type;
1911
- Arg5_Type arg5 = args->getArgumentOrDefault<Arg5_Type>(5, varg5);
1912
-
1913
- Func func = wrapper->func_;
1914
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4, arg5);
1915
- return Qnil;
1916
- }
1917
- catch(...)
1918
- {
1919
- RUBY_TRY
1920
- {
1921
- if(wrapper)
1922
- {
1923
- return wrapper->handler_->handle_exception();
1924
- }
1925
- else
1926
- {
1927
- throw;
1928
- }
1929
- }
1930
- RUBY_CATCH
1931
- }
1932
- }
1933
-
1934
- // ---------------------------------------------------------------------
1935
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
1936
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T>::
1937
- Auto_Member_Function_Wrapper(
1938
- Func func,
1939
- Data_Object<Exception_Handler> handler,
1940
- Arguments* arguments)
1941
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
1942
- , func_(func)
1943
- , handler_(handler)
1944
- , handler_guard_(&handler_)
1945
- , arguments_(arguments)
1946
- {
1947
- if(arguments == 0) {
1948
- arguments_ = new Arguments();
1949
- } else {
1950
- arguments_ = arguments;
1951
- }
1952
- }
1953
-
1954
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
1955
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T>::
1956
- ~Auto_Member_Function_Wrapper()
1957
- {
1958
- if(arguments_) { delete arguments_; }
1959
- }
1960
-
1961
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
1962
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T>::
1963
- call(int argc, VALUE* argv, VALUE self)
1964
- {
1965
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T> * wrapper = 0;
1966
- try
1967
- {
1968
- Data_Object<Wrapped_Function> data(detail::method_data());
1969
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T> *)data.get();
1970
- Arguments* args = wrapper->arguments_;
1971
-
1972
- VALUE varg0, varg1, varg2, varg3, varg4;
1973
-
1974
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4);
1975
-
1976
- Self_T * obj = from_ruby<Self_T *>(self);
1977
-
1978
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
1979
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
1980
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
1981
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
1982
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
1983
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
1984
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
1985
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
1986
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
1987
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
1988
-
1989
- Func func = wrapper->func_;
1990
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3, arg4));
1991
- }
1992
- catch(...)
1993
- {
1994
- RUBY_TRY
1995
- {
1996
- if(wrapper)
1997
- {
1998
- return wrapper->handler_->handle_exception();
1999
- }
2000
- else
2001
- {
2002
- throw;
2003
- }
2004
- }
2005
- RUBY_CATCH
2006
- }
2007
- }
2008
-
2009
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
2010
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T>::
2011
- Auto_Member_Function_Wrapper(
2012
- Func func,
2013
- Data_Object<Exception_Handler> handler,
2014
- Arguments* arguments)
2015
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2016
- , func_(func)
2017
- , handler_(handler)
2018
- , handler_guard_(&handler_)
2019
- , arguments_(arguments)
2020
- {
2021
- if(arguments == 0) {
2022
- arguments_ = new Arguments();
2023
- } else {
2024
- arguments_ = arguments;
2025
- }
2026
- }
2027
-
2028
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
2029
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T>::
2030
- ~Auto_Member_Function_Wrapper()
2031
- {
2032
- if(arguments_) { delete arguments_; }
2033
- }
2034
-
2035
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
2036
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T>::
2037
- call(int argc, VALUE* argv, VALUE self)
2038
- {
2039
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T> * wrapper = 0;
2040
- try
2041
- {
2042
- Data_Object<Wrapped_Function> data(detail::method_data());
2043
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T> *)data.get();
2044
- Arguments* args = wrapper->arguments_;
2045
-
2046
- VALUE varg0, varg1, varg2, varg3, varg4;
2047
-
2048
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3, &varg4);
2049
-
2050
- Self_T * obj = from_ruby<Self_T *>(self);
2051
-
2052
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2053
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2054
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
2055
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
2056
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
2057
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
2058
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
2059
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
2060
- typedef typename sanitize< Arg4_T >::Type Arg4_Type;
2061
- Arg4_Type arg4 = args->getArgumentOrDefault<Arg4_Type>(4, varg4);
2062
-
2063
- Func func = wrapper->func_;
2064
- (*obj.*func)(arg0, arg1, arg2, arg3, arg4);
2065
- return Qnil;
2066
- }
2067
- catch(...)
2068
- {
2069
- RUBY_TRY
2070
- {
2071
- if(wrapper)
2072
- {
2073
- return wrapper->handler_->handle_exception();
2074
- }
2075
- else
2076
- {
2077
- throw;
2078
- }
2079
- }
2080
- RUBY_CATCH
2081
- }
2082
- }
2083
-
2084
- // ---------------------------------------------------------------------
2085
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
2086
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T>::
2087
- Auto_Member_Function_Wrapper(
2088
- Func func,
2089
- Data_Object<Exception_Handler> handler,
2090
- Arguments* arguments)
2091
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2092
- , func_(func)
2093
- , handler_(handler)
2094
- , handler_guard_(&handler_)
2095
- , arguments_(arguments)
2096
- {
2097
- if(arguments == 0) {
2098
- arguments_ = new Arguments();
2099
- } else {
2100
- arguments_ = arguments;
2101
- }
2102
- }
2103
-
2104
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
2105
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T>::
2106
- ~Auto_Member_Function_Wrapper()
2107
- {
2108
- if(arguments_) { delete arguments_; }
2109
- }
2110
-
2111
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
2112
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T>::
2113
- call(int argc, VALUE* argv, VALUE self)
2114
- {
2115
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T> * wrapper = 0;
2116
- try
2117
- {
2118
- Data_Object<Wrapped_Function> data(detail::method_data());
2119
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T> *)data.get();
2120
- Arguments* args = wrapper->arguments_;
2121
-
2122
- VALUE varg0, varg1, varg2, varg3;
2123
-
2124
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3);
2125
-
2126
- Self_T * obj = from_ruby<Self_T *>(self);
2127
-
2128
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2129
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2130
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
2131
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
2132
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
2133
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
2134
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
2135
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
2136
-
2137
- Func func = wrapper->func_;
2138
- return to_ruby((*obj.*func)(arg0, arg1, arg2, arg3));
2139
- }
2140
- catch(...)
2141
- {
2142
- RUBY_TRY
2143
- {
2144
- if(wrapper)
2145
- {
2146
- return wrapper->handler_->handle_exception();
2147
- }
2148
- else
2149
- {
2150
- throw;
2151
- }
2152
- }
2153
- RUBY_CATCH
2154
- }
2155
- }
2156
-
2157
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
2158
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T>::
2159
- Auto_Member_Function_Wrapper(
2160
- Func func,
2161
- Data_Object<Exception_Handler> handler,
2162
- Arguments* arguments)
2163
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2164
- , func_(func)
2165
- , handler_(handler)
2166
- , handler_guard_(&handler_)
2167
- , arguments_(arguments)
2168
- {
2169
- if(arguments == 0) {
2170
- arguments_ = new Arguments();
2171
- } else {
2172
- arguments_ = arguments;
2173
- }
2174
- }
2175
-
2176
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
2177
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T>::
2178
- ~Auto_Member_Function_Wrapper()
2179
- {
2180
- if(arguments_) { delete arguments_; }
2181
- }
2182
-
2183
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
2184
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T>::
2185
- call(int argc, VALUE* argv, VALUE self)
2186
- {
2187
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T> * wrapper = 0;
2188
- try
2189
- {
2190
- Data_Object<Wrapped_Function> data(detail::method_data());
2191
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T, Arg3_T> *)data.get();
2192
- Arguments* args = wrapper->arguments_;
2193
-
2194
- VALUE varg0, varg1, varg2, varg3;
2195
-
2196
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2, &varg3);
2197
-
2198
- Self_T * obj = from_ruby<Self_T *>(self);
2199
-
2200
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2201
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2202
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
2203
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
2204
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
2205
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
2206
- typedef typename sanitize< Arg3_T >::Type Arg3_Type;
2207
- Arg3_Type arg3 = args->getArgumentOrDefault<Arg3_Type>(3, varg3);
2208
-
2209
- Func func = wrapper->func_;
2210
- (*obj.*func)(arg0, arg1, arg2, arg3);
2211
- return Qnil;
2212
- }
2213
- catch(...)
2214
- {
2215
- RUBY_TRY
2216
- {
2217
- if(wrapper)
2218
- {
2219
- return wrapper->handler_->handle_exception();
2220
- }
2221
- else
2222
- {
2223
- throw;
2224
- }
2225
- }
2226
- RUBY_CATCH
2227
- }
2228
- }
2229
-
2230
- // ---------------------------------------------------------------------
2231
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
2232
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T>::
2233
- Auto_Member_Function_Wrapper(
2234
- Func func,
2235
- Data_Object<Exception_Handler> handler,
2236
- Arguments* arguments)
2237
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2238
- , func_(func)
2239
- , handler_(handler)
2240
- , handler_guard_(&handler_)
2241
- , arguments_(arguments)
2242
- {
2243
- if(arguments == 0) {
2244
- arguments_ = new Arguments();
2245
- } else {
2246
- arguments_ = arguments;
2247
- }
2248
- }
2249
-
2250
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
2251
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T>::
2252
- ~Auto_Member_Function_Wrapper()
2253
- {
2254
- if(arguments_) { delete arguments_; }
2255
- }
2256
-
2257
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
2258
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T>::
2259
- call(int argc, VALUE* argv, VALUE self)
2260
- {
2261
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T> * wrapper = 0;
2262
- try
2263
- {
2264
- Data_Object<Wrapped_Function> data(detail::method_data());
2265
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T, Arg2_T> *)data.get();
2266
- Arguments* args = wrapper->arguments_;
2267
-
2268
- VALUE varg0, varg1, varg2;
2269
-
2270
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2);
2271
-
2272
- Self_T * obj = from_ruby<Self_T *>(self);
2273
-
2274
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2275
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2276
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
2277
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
2278
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
2279
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
2280
-
2281
- Func func = wrapper->func_;
2282
- return to_ruby((*obj.*func)(arg0, arg1, arg2));
2283
- }
2284
- catch(...)
2285
- {
2286
- RUBY_TRY
2287
- {
2288
- if(wrapper)
2289
- {
2290
- return wrapper->handler_->handle_exception();
2291
- }
2292
- else
2293
- {
2294
- throw;
2295
- }
2296
- }
2297
- RUBY_CATCH
2298
- }
2299
- }
2300
-
2301
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
2302
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T>::
2303
- Auto_Member_Function_Wrapper(
2304
- Func func,
2305
- Data_Object<Exception_Handler> handler,
2306
- Arguments* arguments)
2307
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2308
- , func_(func)
2309
- , handler_(handler)
2310
- , handler_guard_(&handler_)
2311
- , arguments_(arguments)
2312
- {
2313
- if(arguments == 0) {
2314
- arguments_ = new Arguments();
2315
- } else {
2316
- arguments_ = arguments;
2317
- }
2318
- }
2319
-
2320
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
2321
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T>::
2322
- ~Auto_Member_Function_Wrapper()
2323
- {
2324
- if(arguments_) { delete arguments_; }
2325
- }
2326
-
2327
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
2328
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T>::
2329
- call(int argc, VALUE* argv, VALUE self)
2330
- {
2331
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T> * wrapper = 0;
2332
- try
2333
- {
2334
- Data_Object<Wrapped_Function> data(detail::method_data());
2335
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T, Arg2_T> *)data.get();
2336
- Arguments* args = wrapper->arguments_;
2337
-
2338
- VALUE varg0, varg1, varg2;
2339
-
2340
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1, &varg2);
2341
-
2342
- Self_T * obj = from_ruby<Self_T *>(self);
2343
-
2344
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2345
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2346
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
2347
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
2348
- typedef typename sanitize< Arg2_T >::Type Arg2_Type;
2349
- Arg2_Type arg2 = args->getArgumentOrDefault<Arg2_Type>(2, varg2);
2350
-
2351
- Func func = wrapper->func_;
2352
- (*obj.*func)(arg0, arg1, arg2);
2353
- return Qnil;
2354
- }
2355
- catch(...)
2356
- {
2357
- RUBY_TRY
2358
- {
2359
- if(wrapper)
2360
- {
2361
- return wrapper->handler_->handle_exception();
2362
- }
2363
- else
2364
- {
2365
- throw;
2366
- }
2367
- }
2368
- RUBY_CATCH
2369
- }
2370
- }
2371
-
2372
- // ---------------------------------------------------------------------
2373
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T>
2374
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T>::
2375
- Auto_Member_Function_Wrapper(
2376
- Func func,
2377
- Data_Object<Exception_Handler> handler,
2378
- Arguments* arguments)
2379
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2380
- , func_(func)
2381
- , handler_(handler)
2382
- , handler_guard_(&handler_)
2383
- , arguments_(arguments)
2384
- {
2385
- if(arguments == 0) {
2386
- arguments_ = new Arguments();
2387
- } else {
2388
- arguments_ = arguments;
2389
- }
2390
- }
2391
-
2392
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T>
2393
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T>::
2394
- ~Auto_Member_Function_Wrapper()
2395
- {
2396
- if(arguments_) { delete arguments_; }
2397
- }
2398
-
2399
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T, typename Arg1_T>
2400
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T>::
2401
- call(int argc, VALUE* argv, VALUE self)
2402
- {
2403
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T> * wrapper = 0;
2404
- try
2405
- {
2406
- Data_Object<Wrapped_Function> data(detail::method_data());
2407
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T, Arg1_T> *)data.get();
2408
- Arguments* args = wrapper->arguments_;
2409
-
2410
- VALUE varg0, varg1;
2411
-
2412
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1);
2413
-
2414
- Self_T * obj = from_ruby<Self_T *>(self);
2415
-
2416
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2417
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2418
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
2419
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
2420
-
2421
- Func func = wrapper->func_;
2422
- return to_ruby((*obj.*func)(arg0, arg1));
2423
- }
2424
- catch(...)
2425
- {
2426
- RUBY_TRY
2427
- {
2428
- if(wrapper)
2429
- {
2430
- return wrapper->handler_->handle_exception();
2431
- }
2432
- else
2433
- {
2434
- throw;
2435
- }
2436
- }
2437
- RUBY_CATCH
2438
- }
2439
- }
2440
-
2441
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T>
2442
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T>::
2443
- Auto_Member_Function_Wrapper(
2444
- Func func,
2445
- Data_Object<Exception_Handler> handler,
2446
- Arguments* arguments)
2447
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2448
- , func_(func)
2449
- , handler_(handler)
2450
- , handler_guard_(&handler_)
2451
- , arguments_(arguments)
2452
- {
2453
- if(arguments == 0) {
2454
- arguments_ = new Arguments();
2455
- } else {
2456
- arguments_ = arguments;
2457
- }
2458
- }
2459
-
2460
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T>
2461
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T>::
2462
- ~Auto_Member_Function_Wrapper()
2463
- {
2464
- if(arguments_) { delete arguments_; }
2465
- }
2466
-
2467
- template<typename Func_T, typename Self_T, typename Arg0_T, typename Arg1_T>
2468
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T>::
2469
- call(int argc, VALUE* argv, VALUE self)
2470
- {
2471
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T> * wrapper = 0;
2472
- try
2473
- {
2474
- Data_Object<Wrapped_Function> data(detail::method_data());
2475
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T, Arg1_T> *)data.get();
2476
- Arguments* args = wrapper->arguments_;
2477
-
2478
- VALUE varg0, varg1;
2479
-
2480
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0, &varg1);
2481
-
2482
- Self_T * obj = from_ruby<Self_T *>(self);
2483
-
2484
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2485
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2486
- typedef typename sanitize< Arg1_T >::Type Arg1_Type;
2487
- Arg1_Type arg1 = args->getArgumentOrDefault<Arg1_Type>(1, varg1);
2488
-
2489
- Func func = wrapper->func_;
2490
- (*obj.*func)(arg0, arg1);
2491
- return Qnil;
2492
- }
2493
- catch(...)
2494
- {
2495
- RUBY_TRY
2496
- {
2497
- if(wrapper)
2498
- {
2499
- return wrapper->handler_->handle_exception();
2500
- }
2501
- else
2502
- {
2503
- throw;
2504
- }
2505
- }
2506
- RUBY_CATCH
2507
- }
2508
- }
2509
-
2510
- // ---------------------------------------------------------------------
2511
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T>
2512
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T>::
2513
- Auto_Member_Function_Wrapper(
2514
- Func func,
2515
- Data_Object<Exception_Handler> handler,
2516
- Arguments* arguments)
2517
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2518
- , func_(func)
2519
- , handler_(handler)
2520
- , handler_guard_(&handler_)
2521
- , arguments_(arguments)
2522
- {
2523
- if(arguments == 0) {
2524
- arguments_ = new Arguments();
2525
- } else {
2526
- arguments_ = arguments;
2527
- }
2528
- }
2529
-
2530
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T>
2531
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T>::
2532
- ~Auto_Member_Function_Wrapper()
2533
- {
2534
- if(arguments_) { delete arguments_; }
2535
- }
2536
-
2537
- template<typename Func_T, typename Ret_T, typename Self_T, typename Arg0_T>
2538
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T>::
2539
- call(int argc, VALUE* argv, VALUE self)
2540
- {
2541
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T> * wrapper = 0;
2542
- try
2543
- {
2544
- Data_Object<Wrapped_Function> data(detail::method_data());
2545
- wrapper = (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T, Arg0_T> *)data.get();
2546
- Arguments* args = wrapper->arguments_;
2547
-
2548
- VALUE varg0;
2549
-
2550
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0);
2551
-
2552
- Self_T * obj = from_ruby<Self_T *>(self);
2553
-
2554
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2555
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2556
-
2557
- Func func = wrapper->func_;
2558
- return to_ruby((*obj.*func)(arg0));
2559
- }
2560
- catch(...)
2561
- {
2562
- RUBY_TRY
2563
- {
2564
- if(wrapper)
2565
- {
2566
- return wrapper->handler_->handle_exception();
2567
- }
2568
- else
2569
- {
2570
- throw;
2571
- }
2572
- }
2573
- RUBY_CATCH
2574
- }
2575
- }
2576
-
2577
- template<typename Func_T, typename Self_T, typename Arg0_T>
2578
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T>::
2579
- Auto_Member_Function_Wrapper(
2580
- Func func,
2581
- Data_Object<Exception_Handler> handler,
2582
- Arguments* arguments)
2583
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2584
- , func_(func)
2585
- , handler_(handler)
2586
- , handler_guard_(&handler_)
2587
- , arguments_(arguments)
2588
- {
2589
- if(arguments == 0) {
2590
- arguments_ = new Arguments();
2591
- } else {
2592
- arguments_ = arguments;
2593
- }
2594
- }
2595
-
2596
- template<typename Func_T, typename Self_T, typename Arg0_T>
2597
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T>::
2598
- ~Auto_Member_Function_Wrapper()
2599
- {
2600
- if(arguments_) { delete arguments_; }
2601
- }
2602
-
2603
- template<typename Func_T, typename Self_T, typename Arg0_T>
2604
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T>::
2605
- call(int argc, VALUE* argv, VALUE self)
2606
- {
2607
- Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T> * wrapper = 0;
2608
- try
2609
- {
2610
- Data_Object<Wrapped_Function> data(detail::method_data());
2611
- wrapper = (Auto_Member_Function_Wrapper<Func_T, void, Self_T, Arg0_T> *)data.get();
2612
- Arguments* args = wrapper->arguments_;
2613
-
2614
- VALUE varg0;
2615
-
2616
- rb_scan_args(argc, argv, args->formatString(Num_Args).c_str(), &varg0);
2617
-
2618
- Self_T * obj = from_ruby<Self_T *>(self);
2619
-
2620
- typedef typename sanitize< Arg0_T >::Type Arg0_Type;
2621
- Arg0_Type arg0 = args->getArgumentOrDefault<Arg0_Type>(0, varg0);
2622
-
2623
- Func func = wrapper->func_;
2624
- (*obj.*func)(arg0);
2625
- return Qnil;
2626
- }
2627
- catch(...)
2628
- {
2629
- RUBY_TRY
2630
- {
2631
- if(wrapper)
2632
- {
2633
- return wrapper->handler_->handle_exception();
2634
- }
2635
- else
2636
- {
2637
- throw;
2638
- }
2639
- }
2640
- RUBY_CATCH
2641
- }
2642
- }
2643
-
2644
- // ---------------------------------------------------------------------
2645
-
2646
- template<typename Func_T, typename Ret_T, typename Self_T>
2647
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T>::
2648
- Auto_Member_Function_Wrapper(
2649
- Func func,
2650
- Data_Object<Exception_Handler> handler,
2651
- Arguments* arguments)
2652
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2653
- , func_(func)
2654
- , handler_(handler)
2655
- , handler_guard_(&handler_)
2656
- , arguments_(arguments)
2657
- {
2658
- if(arguments == 0) {
2659
- arguments_ = new Arguments();
2660
- } else {
2661
- arguments_ = arguments;
2662
- }
2663
- }
2664
-
2665
- template<typename Func_T, typename Ret_T, typename Self_T>
2666
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T>::
2667
- ~Auto_Member_Function_Wrapper()
2668
- {
2669
- if(arguments_) { delete arguments_; }
2670
- }
2671
-
2672
- template<typename Func_T, typename Ret_T, typename Self_T>
2673
- VALUE Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T>::
2674
- call(int argc, VALUE* argv, VALUE self)
2675
- {
2676
- Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T> * wrapper = 0;
2677
- try
2678
- {
2679
- Data_Object<Wrapped_Function> data(detail::method_data());
2680
- wrapper =
2681
- (Auto_Member_Function_Wrapper<Func_T, Ret_T, Self_T> *)data.get();
2682
-
2683
- rb_scan_args(argc, argv, "0");
2684
- Self_T * obj = from_ruby<Self_T *>(self);
2685
-
2686
- Func func = wrapper->func_;
2687
- return to_ruby((*obj.*func)());
2688
- }
2689
- catch(...)
2690
- {
2691
- RUBY_TRY
2692
- {
2693
- if(wrapper)
2694
- {
2695
- return wrapper->handler_->handle_exception();
2696
- }
2697
- else
2698
- {
2699
- throw;
2700
- }
2701
- }
2702
- RUBY_CATCH
2703
- }
2704
- }
2705
-
2706
- template<typename Func_T, typename Self_T>
2707
- Auto_Member_Function_Wrapper<Func_T, void, Self_T>::
2708
- Auto_Member_Function_Wrapper(
2709
- Func func,
2710
- Data_Object<Exception_Handler> handler,
2711
- Arguments* arguments)
2712
- : Wrapped_Function(RUBY_METHOD_FUNC(call), Num_Args)
2713
- , func_(func)
2714
- , handler_(handler)
2715
- , handler_guard_(&handler_)
2716
- , arguments_(arguments)
2717
- {
2718
- if(arguments == 0) {
2719
- arguments_ = new Arguments();
2720
- } else {
2721
- arguments_ = arguments;
2722
- }
2723
- }
2724
-
2725
- template<typename Func_T, typename Self_T>
2726
- Auto_Member_Function_Wrapper<Func_T, void, Self_T>::
2727
- ~Auto_Member_Function_Wrapper()
2728
- {
2729
- if(arguments_) { delete arguments_; }
2730
- }
2731
-
2732
- template<typename Func_T, typename Self_T>
2733
- VALUE Auto_Member_Function_Wrapper<Func_T, void, Self_T>::
2734
- call(int argc, VALUE* argv, VALUE self)
2735
- {
2736
- Auto_Member_Function_Wrapper<Func_T, void, Self_T> * wrapper = 0;
2737
- try
2738
- {
2739
- Data_Object<Wrapped_Function> data(detail::method_data());
2740
- wrapper =
2741
- (Auto_Member_Function_Wrapper<Func_T, void, Self_T> *)data.get();
2742
- rb_scan_args(argc, argv, "0");
2743
- Self_T * obj = from_ruby<Self_T *>(self);
2744
-
2745
- Func func = wrapper->func_;
2746
- (*obj.*func)();
2747
- return Qnil;
2748
- }
2749
- catch(...)
2750
- {
2751
- RUBY_TRY
2752
- {
2753
- if(wrapper)
2754
- {
2755
- return wrapper->handler_->handle_exception();
2756
- }
2757
- else
2758
- {
2759
- throw;
2760
- }
2761
- }
2762
- RUBY_CATCH
2763
- }
2764
- }
2765
-
2766
- // ---------------------------------------------------------------------
2767
-
2768
- } // namespace detail
2769
-
2770
- } // namespace Rice
2771
-
2772
-
2773
- #endif // Rice__detail__Auto_Member_Function_Wrapper__ipp_
2774
-