wurlinc-rice 1.4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +23 -0
- data/Doxyfile +1253 -0
- data/Makefile.am +26 -0
- data/README +1119 -0
- data/README.mingw +8 -0
- data/Rakefile +33 -0
- data/bootstrap +9 -0
- data/configure.ac +52 -0
- data/doxygen.ac +314 -0
- data/doxygen.am +186 -0
- data/extconf.rb +41 -0
- data/post-autoconf.rb +22 -0
- data/post-automake.rb +28 -0
- data/rice/Address_Registration_Guard.hpp +7 -0
- data/rice/Address_Registration_Guard.ipp +34 -0
- data/rice/Address_Registration_Guard_defn.hpp +65 -0
- data/rice/Allocation_Strategies.hpp +37 -0
- data/rice/Arg.hpp +8 -0
- data/rice/Arg_impl.hpp +127 -0
- data/rice/Arg_operators.cpp +21 -0
- data/rice/Arg_operators.hpp +19 -0
- data/rice/Array.hpp +220 -0
- data/rice/Array.ipp +263 -0
- data/rice/Builtin_Object.hpp +8 -0
- data/rice/Builtin_Object.ipp +50 -0
- data/rice/Builtin_Object_defn.hpp +51 -0
- data/rice/Class.cpp +57 -0
- data/rice/Class.hpp +8 -0
- data/rice/Class.ipp +6 -0
- data/rice/Class_defn.hpp +83 -0
- data/rice/Constructor.hpp +367 -0
- data/rice/Critical_Guard.hpp +40 -0
- data/rice/Critical_Guard.ipp +26 -0
- data/rice/Data_Object.hpp +8 -0
- data/rice/Data_Object.ipp +133 -0
- data/rice/Data_Object_defn.hpp +132 -0
- data/rice/Data_Type.cpp +54 -0
- data/rice/Data_Type.hpp +8 -0
- data/rice/Data_Type.ipp +365 -0
- data/rice/Data_Type_defn.hpp +261 -0
- data/rice/Data_Type_fwd.hpp +12 -0
- data/rice/Director.cpp +13 -0
- data/rice/Director.hpp +39 -0
- data/rice/Enum.hpp +117 -0
- data/rice/Enum.ipp +246 -0
- data/rice/Exception.cpp +59 -0
- data/rice/Exception.hpp +9 -0
- data/rice/Exception_Base.hpp +8 -0
- data/rice/Exception_Base.ipp +13 -0
- data/rice/Exception_Base_defn.hpp +27 -0
- data/rice/Exception_defn.hpp +69 -0
- data/rice/Hash.hpp +210 -0
- data/rice/Hash.ipp +338 -0
- data/rice/Identifier.cpp +8 -0
- data/rice/Identifier.hpp +50 -0
- data/rice/Identifier.ipp +33 -0
- data/rice/Jump_Tag.hpp +24 -0
- data/rice/Makefile.am +129 -0
- data/rice/Module.cpp +84 -0
- data/rice/Module.hpp +8 -0
- data/rice/Module.ipp +6 -0
- data/rice/Module_defn.hpp +88 -0
- data/rice/Module_impl.hpp +281 -0
- data/rice/Module_impl.ipp +348 -0
- data/rice/Object.cpp +160 -0
- data/rice/Object.hpp +8 -0
- data/rice/Object.ipp +19 -0
- data/rice/Object_defn.hpp +191 -0
- data/rice/Require_Guard.hpp +21 -0
- data/rice/String.cpp +94 -0
- data/rice/String.hpp +89 -0
- data/rice/Struct.cpp +117 -0
- data/rice/Struct.hpp +162 -0
- data/rice/Struct.ipp +26 -0
- data/rice/Symbol.cpp +25 -0
- data/rice/Symbol.hpp +66 -0
- data/rice/Symbol.ipp +44 -0
- data/rice/VM.cpp +92 -0
- data/rice/VM.hpp +32 -0
- data/rice/config.hpp.in +40 -0
- data/rice/detail/Arguments.hpp +118 -0
- data/rice/detail/Auto_Function_Wrapper.hpp +829 -0
- data/rice/detail/Auto_Function_Wrapper.ipp +3391 -0
- data/rice/detail/Auto_Member_Function_Wrapper.hpp +828 -0
- data/rice/detail/Auto_Member_Function_Wrapper.ipp +2503 -0
- data/rice/detail/Caster.hpp +103 -0
- data/rice/detail/Exception_Handler.hpp +8 -0
- data/rice/detail/Exception_Handler.ipp +68 -0
- data/rice/detail/Exception_Handler_defn.hpp +96 -0
- data/rice/detail/Iterator.hpp +93 -0
- data/rice/detail/Not_Copyable.hpp +25 -0
- data/rice/detail/Wrapped_Function.hpp +33 -0
- data/rice/detail/cfp.hpp +24 -0
- data/rice/detail/cfp.ipp +51 -0
- data/rice/detail/check_ruby_type.cpp +27 -0
- data/rice/detail/check_ruby_type.hpp +23 -0
- data/rice/detail/creation_funcs.hpp +37 -0
- data/rice/detail/creation_funcs.ipp +36 -0
- data/rice/detail/default_allocation_func.hpp +23 -0
- data/rice/detail/default_allocation_func.ipp +11 -0
- data/rice/detail/define_method_and_auto_wrap.hpp +31 -0
- data/rice/detail/define_method_and_auto_wrap.ipp +30 -0
- data/rice/detail/demangle.cpp +56 -0
- data/rice/detail/demangle.hpp +19 -0
- data/rice/detail/env.hpp +19 -0
- data/rice/detail/from_ruby.hpp +43 -0
- data/rice/detail/from_ruby.ipp +60 -0
- data/rice/detail/method_data.cpp +159 -0
- data/rice/detail/method_data.hpp +21 -0
- data/rice/detail/mininode.cpp +1220 -0
- data/rice/detail/mininode.hpp +320 -0
- data/rice/detail/node.hpp +13 -0
- data/rice/detail/object_call.hpp +68 -0
- data/rice/detail/object_call.ipp +131 -0
- data/rice/detail/protect.cpp +29 -0
- data/rice/detail/protect.hpp +34 -0
- data/rice/detail/ruby.hpp +93 -0
- data/rice/detail/ruby_version_code.hpp.in +6 -0
- data/rice/detail/rubysig.hpp +19 -0
- data/rice/detail/st.hpp +60 -0
- data/rice/detail/to_ruby.hpp +22 -0
- data/rice/detail/to_ruby.ipp +36 -0
- data/rice/detail/traits.hpp +43 -0
- data/rice/detail/win32.hpp +16 -0
- data/rice/detail/wrap_function.hpp +341 -0
- data/rice/detail/wrap_function.ipp +514 -0
- data/rice/global_function.hpp +33 -0
- data/rice/global_function.ipp +22 -0
- data/rice/protect.hpp +91 -0
- data/rice/protect.ipp +1133 -0
- data/rice/ruby_mark.hpp +13 -0
- data/rice/ruby_try_catch.hpp +86 -0
- data/rice/rubypp.rb +97 -0
- data/rice/to_from_ruby.hpp +8 -0
- data/rice/to_from_ruby.ipp +297 -0
- data/rice/to_from_ruby_defn.hpp +71 -0
- data/ruby/Makefile.am +1 -0
- data/ruby/lib/Makefile.am +3 -0
- data/ruby/lib/mkmf-rice.rb.in +216 -0
- data/ruby/lib/version.rb +3 -0
- data/ruby.ac +136 -0
- data/sample/Makefile.am +47 -0
- data/sample/enum/extconf.rb +3 -0
- data/sample/enum/sample_enum.cpp +54 -0
- data/sample/enum/test.rb +8 -0
- data/sample/inheritance/animals.cpp +98 -0
- data/sample/inheritance/extconf.rb +3 -0
- data/sample/inheritance/test.rb +7 -0
- data/sample/map/extconf.rb +3 -0
- data/sample/map/map.cpp +81 -0
- data/sample/map/test.rb +7 -0
- data/test/Makefile.am +78 -0
- data/test/ext/Makefile.am +43 -0
- data/test/ext/t1/Foo.hpp +10 -0
- data/test/ext/t1/extconf.rb +2 -0
- data/test/ext/t1/t1.cpp +15 -0
- data/test/ext/t2/extconf.rb +2 -0
- data/test/ext/t2/t2.cpp +11 -0
- data/test/test_Address_Registration_Guard.cpp +43 -0
- data/test/test_Allocation_Strategies.cpp +77 -0
- data/test/test_Array.cpp +241 -0
- data/test/test_Builtin_Object.cpp +72 -0
- data/test/test_Class.cpp +498 -0
- data/test/test_Constructor.cpp +128 -0
- data/test/test_Critical_Guard.cpp +51 -0
- data/test/test_Data_Object.cpp +275 -0
- data/test/test_Data_Type.cpp +348 -0
- data/test/test_Director.cpp +301 -0
- data/test/test_Enum.cpp +195 -0
- data/test/test_Exception.cpp +46 -0
- data/test/test_Hash.cpp +195 -0
- data/test/test_Identifier.cpp +70 -0
- data/test/test_Jump_Tag.cpp +17 -0
- data/test/test_Memory_Management.cpp +50 -0
- data/test/test_Module.cpp +481 -0
- data/test/test_Object.cpp +148 -0
- data/test/test_String.cpp +94 -0
- data/test/test_Struct.cpp +192 -0
- data/test/test_Symbol.cpp +63 -0
- data/test/test_To_From_Ruby.cpp +263 -0
- data/test/test_VM.cpp +26 -0
- data/test/test_global_functions.cpp +114 -0
- data/test/test_rice.rb +43 -0
- data/test/unittest.cpp +136 -0
- data/test/unittest.hpp +292 -0
- metadata +276 -0
@@ -0,0 +1,367 @@
|
|
1
|
+
#ifndef Rice__Constructor__hpp_
|
2
|
+
#define Rice__Constructor__hpp_
|
3
|
+
|
4
|
+
// This is a generated file. DO NOT EDIT!!
|
5
|
+
|
6
|
+
|
7
|
+
// This causes problems with certain C++ libraries
|
8
|
+
#undef TYPE
|
9
|
+
|
10
|
+
#include "to_from_ruby_defn.hpp"
|
11
|
+
#include "detail/method_data.hpp"
|
12
|
+
namespace Rice
|
13
|
+
{
|
14
|
+
template<typename T, typename Arg0_T=void, typename Arg1_T=void, typename Arg2_T=void, typename Arg3_T=void, typename Arg4_T=void, typename Arg5_T=void, typename Arg6_T=void, typename Arg7_T=void, typename Arg8_T=void, typename Arg9_T=void, typename Arg10_T=void, typename Arg11_T=void, typename Arg12_T=void, typename Arg13_T=void, typename Arg14_T=void, typename Arg15_T=void>
|
15
|
+
class Constructor
|
16
|
+
{
|
17
|
+
private:
|
18
|
+
Constructor()
|
19
|
+
{
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
template<typename T>
|
24
|
+
class Constructor<T, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void>
|
25
|
+
{
|
26
|
+
public:
|
27
|
+
static void construct(Object self)
|
28
|
+
{
|
29
|
+
DATA_PTR(self.value()) = new T();
|
30
|
+
}
|
31
|
+
};
|
32
|
+
|
33
|
+
|
34
|
+
template<typename T>
|
35
|
+
class Constructor<T, Object, void, void, void, void, void, void, void, void, void, void, void, void, void, void>
|
36
|
+
{
|
37
|
+
public:
|
38
|
+
static void construct(Object self)
|
39
|
+
{
|
40
|
+
DATA_PTR(self.value()) = new T(self);
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
|
45
|
+
template<typename T, typename Arg0_T>
|
46
|
+
class Constructor<T, Arg0_T, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void>
|
47
|
+
{
|
48
|
+
public:
|
49
|
+
static void construct(Object self, Arg0_T arg0)
|
50
|
+
{
|
51
|
+
DATA_PTR(self.value()) = new T(arg0);
|
52
|
+
}
|
53
|
+
};
|
54
|
+
|
55
|
+
|
56
|
+
template<typename T, typename Arg0_T, typename Arg1_T>
|
57
|
+
class Constructor<T, Arg0_T, Arg1_T, void, void, void, void, void, void, void, void, void, void, void, void, void, void>
|
58
|
+
{
|
59
|
+
public:
|
60
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1)
|
61
|
+
{
|
62
|
+
DATA_PTR(self.value()) = new T(arg0, arg1);
|
63
|
+
}
|
64
|
+
};
|
65
|
+
|
66
|
+
|
67
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
|
68
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, void, void, void, void, void, void, void, void, void, void, void, void, void>
|
69
|
+
{
|
70
|
+
public:
|
71
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2)
|
72
|
+
{
|
73
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2);
|
74
|
+
}
|
75
|
+
};
|
76
|
+
|
77
|
+
|
78
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
|
79
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, void, void, void, void, void, void, void, void, void, void, void, void>
|
80
|
+
{
|
81
|
+
public:
|
82
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3)
|
83
|
+
{
|
84
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3);
|
85
|
+
}
|
86
|
+
};
|
87
|
+
|
88
|
+
|
89
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
|
90
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, void, void, void, void, void, void, void, void, void, void, void>
|
91
|
+
{
|
92
|
+
public:
|
93
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4)
|
94
|
+
{
|
95
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4);
|
96
|
+
}
|
97
|
+
};
|
98
|
+
|
99
|
+
|
100
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
|
101
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, void, void, void, void, void, void, void, void, void, void>
|
102
|
+
{
|
103
|
+
public:
|
104
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5)
|
105
|
+
{
|
106
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5);
|
107
|
+
}
|
108
|
+
};
|
109
|
+
|
110
|
+
|
111
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
|
112
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, void, void, void, void, void, void, void, void, void>
|
113
|
+
{
|
114
|
+
public:
|
115
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6)
|
116
|
+
{
|
117
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
|
118
|
+
}
|
119
|
+
};
|
120
|
+
|
121
|
+
|
122
|
+
template<typename 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>
|
123
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, void, void, void, void, void, void, void, void>
|
124
|
+
{
|
125
|
+
public:
|
126
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7)
|
127
|
+
{
|
128
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
|
129
|
+
}
|
130
|
+
};
|
131
|
+
|
132
|
+
|
133
|
+
template<typename 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>
|
134
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, void, void, void, void, void, void, void>
|
135
|
+
{
|
136
|
+
public:
|
137
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8)
|
138
|
+
{
|
139
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
140
|
+
}
|
141
|
+
};
|
142
|
+
|
143
|
+
|
144
|
+
template<typename 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>
|
145
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, void, void, void, void, void, void>
|
146
|
+
{
|
147
|
+
public:
|
148
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9)
|
149
|
+
{
|
150
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
|
151
|
+
}
|
152
|
+
};
|
153
|
+
|
154
|
+
|
155
|
+
template<typename 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>
|
156
|
+
class Constructor<T, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, void, void, void, void, void>
|
157
|
+
{
|
158
|
+
public:
|
159
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10)
|
160
|
+
{
|
161
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
|
162
|
+
}
|
163
|
+
};
|
164
|
+
|
165
|
+
|
166
|
+
template<typename 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>
|
167
|
+
class Constructor<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, void, void, void, void>
|
168
|
+
{
|
169
|
+
public:
|
170
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10, Arg11_T arg11)
|
171
|
+
{
|
172
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
|
173
|
+
}
|
174
|
+
};
|
175
|
+
|
176
|
+
|
177
|
+
template<typename 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>
|
178
|
+
class Constructor<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, void, void, void>
|
179
|
+
{
|
180
|
+
public:
|
181
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10, Arg11_T arg11, Arg12_T arg12)
|
182
|
+
{
|
183
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
|
184
|
+
}
|
185
|
+
};
|
186
|
+
|
187
|
+
|
188
|
+
template<typename 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>
|
189
|
+
class Constructor<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, void, void>
|
190
|
+
{
|
191
|
+
public:
|
192
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10, Arg11_T arg11, Arg12_T arg12, Arg13_T arg13)
|
193
|
+
{
|
194
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
|
195
|
+
}
|
196
|
+
};
|
197
|
+
|
198
|
+
|
199
|
+
template<typename 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>
|
200
|
+
class Constructor<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, void>
|
201
|
+
{
|
202
|
+
public:
|
203
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10, Arg11_T arg11, Arg12_T arg12, Arg13_T arg13, Arg14_T arg14)
|
204
|
+
{
|
205
|
+
DATA_PTR(self.value()) = new T(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
|
206
|
+
}
|
207
|
+
};
|
208
|
+
|
209
|
+
|
210
|
+
template<typename T, typename Arg0_T>
|
211
|
+
class Constructor<T, Object, Arg0_T, void, void, void, void, void, void, void, void, void, void, void, void, void, void>
|
212
|
+
{
|
213
|
+
public:
|
214
|
+
static void construct(Object self, Arg0_T arg0)
|
215
|
+
{
|
216
|
+
DATA_PTR(self.value()) = new T(self, arg0);
|
217
|
+
}
|
218
|
+
};
|
219
|
+
|
220
|
+
|
221
|
+
template<typename T, typename Arg0_T, typename Arg1_T>
|
222
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, void, void, void, void, void, void, void, void, void, void, void, void, void>
|
223
|
+
{
|
224
|
+
public:
|
225
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1)
|
226
|
+
{
|
227
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1);
|
228
|
+
}
|
229
|
+
};
|
230
|
+
|
231
|
+
|
232
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T>
|
233
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, void, void, void, void, void, void, void, void, void, void, void, void>
|
234
|
+
{
|
235
|
+
public:
|
236
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2)
|
237
|
+
{
|
238
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2);
|
239
|
+
}
|
240
|
+
};
|
241
|
+
|
242
|
+
|
243
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T>
|
244
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, void, void, void, void, void, void, void, void, void, void, void>
|
245
|
+
{
|
246
|
+
public:
|
247
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3)
|
248
|
+
{
|
249
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3);
|
250
|
+
}
|
251
|
+
};
|
252
|
+
|
253
|
+
|
254
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T>
|
255
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, void, void, void, void, void, void, void, void, void, void>
|
256
|
+
{
|
257
|
+
public:
|
258
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4)
|
259
|
+
{
|
260
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4);
|
261
|
+
}
|
262
|
+
};
|
263
|
+
|
264
|
+
|
265
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T>
|
266
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, void, void, void, void, void, void, void, void, void>
|
267
|
+
{
|
268
|
+
public:
|
269
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5)
|
270
|
+
{
|
271
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5);
|
272
|
+
}
|
273
|
+
};
|
274
|
+
|
275
|
+
|
276
|
+
template<typename T, typename Arg0_T, typename Arg1_T, typename Arg2_T, typename Arg3_T, typename Arg4_T, typename Arg5_T, typename Arg6_T>
|
277
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, void, void, void, void, void, void, void, void>
|
278
|
+
{
|
279
|
+
public:
|
280
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6)
|
281
|
+
{
|
282
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
|
283
|
+
}
|
284
|
+
};
|
285
|
+
|
286
|
+
|
287
|
+
template<typename 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>
|
288
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, void, void, void, void, void, void, void>
|
289
|
+
{
|
290
|
+
public:
|
291
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7)
|
292
|
+
{
|
293
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
|
294
|
+
}
|
295
|
+
};
|
296
|
+
|
297
|
+
|
298
|
+
template<typename 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>
|
299
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, void, void, void, void, void, void>
|
300
|
+
{
|
301
|
+
public:
|
302
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8)
|
303
|
+
{
|
304
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
305
|
+
}
|
306
|
+
};
|
307
|
+
|
308
|
+
|
309
|
+
template<typename 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>
|
310
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, void, void, void, void, void>
|
311
|
+
{
|
312
|
+
public:
|
313
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9)
|
314
|
+
{
|
315
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
|
316
|
+
}
|
317
|
+
};
|
318
|
+
|
319
|
+
|
320
|
+
template<typename 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>
|
321
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, void, void, void, void>
|
322
|
+
{
|
323
|
+
public:
|
324
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10)
|
325
|
+
{
|
326
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
|
327
|
+
}
|
328
|
+
};
|
329
|
+
|
330
|
+
|
331
|
+
template<typename 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>
|
332
|
+
class Constructor<T, Object, Arg0_T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, void, void, void>
|
333
|
+
{
|
334
|
+
public:
|
335
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10, Arg11_T arg11)
|
336
|
+
{
|
337
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
|
338
|
+
}
|
339
|
+
};
|
340
|
+
|
341
|
+
|
342
|
+
template<typename 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>
|
343
|
+
class Constructor<T, Object, 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, void, void>
|
344
|
+
{
|
345
|
+
public:
|
346
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10, Arg11_T arg11, Arg12_T arg12)
|
347
|
+
{
|
348
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
|
349
|
+
}
|
350
|
+
};
|
351
|
+
|
352
|
+
|
353
|
+
template<typename 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>
|
354
|
+
class Constructor<T, Object, 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, void>
|
355
|
+
{
|
356
|
+
public:
|
357
|
+
static void construct(Object self, Arg0_T arg0, Arg1_T arg1, Arg2_T arg2, Arg3_T arg3, Arg4_T arg4, Arg5_T arg5, Arg6_T arg6, Arg7_T arg7, Arg8_T arg8, Arg9_T arg9, Arg10_T arg10, Arg11_T arg11, Arg12_T arg12, Arg13_T arg13)
|
358
|
+
{
|
359
|
+
DATA_PTR(self.value()) = new T(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
|
360
|
+
}
|
361
|
+
};
|
362
|
+
|
363
|
+
} // namespace Rice
|
364
|
+
|
365
|
+
|
366
|
+
#endif // Rice__Constructor__hpp_
|
367
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#ifndef Rice__ruby_Critical_Guard__hpp_
|
2
|
+
#define Rice__ruby_Critical_Guard__hpp_
|
3
|
+
|
4
|
+
#include "detail/ruby_version_code.hpp"
|
5
|
+
|
6
|
+
#if RICE__RUBY_VERSION_CODE < 190
|
7
|
+
|
8
|
+
namespace Rice
|
9
|
+
{
|
10
|
+
|
11
|
+
//! A guard to prevent Ruby from switching threads.
|
12
|
+
/*! Sets rb_thread_critical to 1 upon construction and back to its
|
13
|
+
* original value upon destruction. This prevents the scheduler from
|
14
|
+
* changing threads. This does not work on YARV, however, which has a
|
15
|
+
* different threading model.
|
16
|
+
*/
|
17
|
+
class Critical_Guard
|
18
|
+
{
|
19
|
+
public:
|
20
|
+
//! Prevent ruby from switching threads.
|
21
|
+
/*! Prevent the ruby scheduler from switching threads by setting
|
22
|
+
* rb_thread_critical to 1.
|
23
|
+
*/
|
24
|
+
Critical_Guard();
|
25
|
+
|
26
|
+
//! Allow ruby to switch threads.
|
27
|
+
/*! Allow the ruby scheduler to switch threads by setting
|
28
|
+
* rb_thread_critical to 0.
|
29
|
+
*/
|
30
|
+
~Critical_Guard();
|
31
|
+
};
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
#endif
|
36
|
+
|
37
|
+
#include "Critical_Guard.ipp"
|
38
|
+
|
39
|
+
#endif // Rice__ruby_Critical_Guard__hpp_
|
40
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#ifndef Rice__ruby_Critical_Guard__ipp_
|
2
|
+
#define Rice__ruby_Critical_Guard__ipp_
|
3
|
+
|
4
|
+
#include "detail/ruby_version_code.hpp"
|
5
|
+
|
6
|
+
#if RICE__RUBY_VERSION_CODE < 190
|
7
|
+
|
8
|
+
#include "detail/ruby.hpp"
|
9
|
+
#include "detail/rubysig.hpp"
|
10
|
+
|
11
|
+
inline Rice::Critical_Guard::
|
12
|
+
Critical_Guard()
|
13
|
+
{
|
14
|
+
rb_thread_critical = 1;
|
15
|
+
}
|
16
|
+
|
17
|
+
inline Rice::Critical_Guard::
|
18
|
+
~Critical_Guard()
|
19
|
+
{
|
20
|
+
rb_thread_critical = 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#endif // Rice__ruby_Critical_Guard__ipp_
|
26
|
+
|
@@ -0,0 +1,133 @@
|
|
1
|
+
#ifndef Rice__Data_Object__ipp_
|
2
|
+
#define Rice__Data_Object__ipp_
|
3
|
+
|
4
|
+
#include "detail/check_ruby_type.hpp"
|
5
|
+
#include "protect.hpp"
|
6
|
+
|
7
|
+
#include <algorithm>
|
8
|
+
|
9
|
+
template<typename T>
|
10
|
+
const typename Rice::Default_Mark_Function<T>::Ruby_Data_Func
|
11
|
+
Rice::Default_Mark_Function<T>::mark = ruby_mark<T>;
|
12
|
+
|
13
|
+
namespace Rice
|
14
|
+
{
|
15
|
+
|
16
|
+
namespace detail
|
17
|
+
{
|
18
|
+
|
19
|
+
inline VALUE data_wrap_struct(
|
20
|
+
VALUE klass,
|
21
|
+
RUBY_DATA_FUNC mark,
|
22
|
+
RUBY_DATA_FUNC free,
|
23
|
+
void * obj)
|
24
|
+
{
|
25
|
+
return Data_Wrap_Struct(klass, mark, free, obj);
|
26
|
+
}
|
27
|
+
|
28
|
+
template<typename T>
|
29
|
+
inline VALUE wrap(
|
30
|
+
VALUE klass,
|
31
|
+
typename Data_Object<T>::Ruby_Data_Func mark,
|
32
|
+
typename Data_Object<T>::Ruby_Data_Func free,
|
33
|
+
T * obj)
|
34
|
+
{
|
35
|
+
// We cast to obj void* here before passing to Data_Wrap_Struct,
|
36
|
+
// becuase otherwise compilation will fail if obj is const. It's safe
|
37
|
+
// to do this, because unwrap() will always add the const back when
|
38
|
+
// the object is unwrapped.
|
39
|
+
return Rice::protect(data_wrap_struct,
|
40
|
+
klass,
|
41
|
+
reinterpret_cast<RUBY_DATA_FUNC>(mark),
|
42
|
+
reinterpret_cast<RUBY_DATA_FUNC>(free),
|
43
|
+
(void *)obj);
|
44
|
+
}
|
45
|
+
|
46
|
+
template<typename T>
|
47
|
+
inline VALUE data_get_struct(VALUE value, T * * obj)
|
48
|
+
{
|
49
|
+
Data_Get_Struct(value, T, *obj);
|
50
|
+
return Qnil;
|
51
|
+
}
|
52
|
+
|
53
|
+
template<typename T>
|
54
|
+
inline T * unwrap(VALUE value)
|
55
|
+
{
|
56
|
+
T * obj;
|
57
|
+
Rice::protect(data_get_struct<T>, value, &obj);
|
58
|
+
return obj;
|
59
|
+
}
|
60
|
+
|
61
|
+
} // namespace detail
|
62
|
+
|
63
|
+
} // namespace Rice
|
64
|
+
|
65
|
+
template<typename T>
|
66
|
+
inline Rice::Data_Object<T>::
|
67
|
+
Data_Object(
|
68
|
+
T * obj,
|
69
|
+
VALUE klass,
|
70
|
+
Ruby_Data_Func mark_func,
|
71
|
+
Ruby_Data_Func free_func)
|
72
|
+
: Object(detail::wrap(klass, mark_func, free_func, obj))
|
73
|
+
, obj_(obj)
|
74
|
+
{
|
75
|
+
}
|
76
|
+
|
77
|
+
template<typename T>
|
78
|
+
inline Rice::Data_Object<T>::
|
79
|
+
Data_Object(
|
80
|
+
Object value)
|
81
|
+
: Object(value)
|
82
|
+
, obj_(detail::unwrap<T>(value))
|
83
|
+
{
|
84
|
+
Data_Type<T> klass;
|
85
|
+
check_cpp_type(klass);
|
86
|
+
detail::check_ruby_type(value, klass, true);
|
87
|
+
}
|
88
|
+
|
89
|
+
template<typename T>
|
90
|
+
template<typename U>
|
91
|
+
inline Rice::Data_Object<T>::
|
92
|
+
Data_Object(
|
93
|
+
Object value,
|
94
|
+
Data_Type<U> const & klass)
|
95
|
+
: Object(value)
|
96
|
+
, obj_(detail::unwrap<T>(value))
|
97
|
+
{
|
98
|
+
check_cpp_type(klass);
|
99
|
+
detail::check_ruby_type(value, klass, true);
|
100
|
+
}
|
101
|
+
|
102
|
+
template<typename T>
|
103
|
+
inline Rice::Data_Object<T>::
|
104
|
+
Data_Object(Data_Object const & other)
|
105
|
+
: Object(other.value())
|
106
|
+
, obj_(other.obj_)
|
107
|
+
{
|
108
|
+
}
|
109
|
+
|
110
|
+
template<typename T>
|
111
|
+
template<typename U>
|
112
|
+
inline void Rice::Data_Object<T>::
|
113
|
+
swap(Data_Object<U> & ref)
|
114
|
+
{
|
115
|
+
std::swap(obj_, ref.obj_);
|
116
|
+
Object::swap(ref);
|
117
|
+
}
|
118
|
+
|
119
|
+
template<typename T>
|
120
|
+
inline void Rice::Data_Object<T>::
|
121
|
+
check_cpp_type(Data_Type<T> const & /* klass */)
|
122
|
+
{
|
123
|
+
}
|
124
|
+
|
125
|
+
template<typename T>
|
126
|
+
Rice::Object Rice::detail::to_ruby_<Rice::Data_Object<T> >::
|
127
|
+
convert(Rice::Data_Object<T> const & x)
|
128
|
+
{
|
129
|
+
return x;
|
130
|
+
}
|
131
|
+
|
132
|
+
#endif // Rice__Data_Object__ipp_
|
133
|
+
|