]>
Commit | Line | Data |
---|---|---|
e1d3601a PC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/xtictor.h | |
3 | // Purpose: XTI constructors | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: Francesco Montorsi | |
6 | // Created: 27/07/03 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1997 Julian Smart | |
9 | // (c) 2003 Stefan Csomor | |
10 | // Licence: wxWindows licence | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | #ifndef _XTICTOR_H_ | |
14 | #define _XTICTOR_H_ | |
15 | ||
16 | #include "wx/defs.h" | |
17 | ||
18 | #if wxUSE_EXTENDED_RTTI | |
19 | ||
20 | #include "wx/string.h" | |
21 | #include "wx/variant.h" | |
22 | ||
23 | class WXDLLIMPEXP_BASE wxObject; | |
24 | class WXDLLIMPEXP_BASE wxClassInfo; | |
25 | class WXDLLIMPEXP_BASE wxDynamicClassInfo; | |
26 | class WXDLLIMPEXP_BASE wxHashTable; | |
27 | class WXDLLIMPEXP_BASE wxHashTable_Node; | |
28 | class WXDLLIMPEXP_BASE wxObjectRefData; | |
29 | class WXDLLIMPEXP_BASE wxEvent; | |
30 | class WXDLLIMPEXP_BASE wxEvtHandler; | |
31 | ||
32 | // ---------------------------------------------------------------------------- | |
33 | // Constructor Bridges | |
34 | // ---------------------------------------------------------------------------- | |
35 | ||
36 | // A constructor bridge allows to call a ctor with an arbitrary number | |
37 | // or parameters during runtime | |
38 | class WXDLLIMPEXP_BASE wxObjectAllocatorAndCreator | |
39 | { | |
40 | public: | |
41 | virtual ~wxObjectAllocatorAndCreator() { } | |
42 | virtual bool Create(wxObject * &o, wxVariantBase *args) = 0; | |
43 | }; | |
44 | ||
45 | // a direct constructor bridge calls the operator new for this class and | |
46 | // passes all params to the constructor. Needed for classes that cannot be | |
47 | // instantiated using alloc-create semantics | |
48 | class WXDLLIMPEXP_BASE wxObjectAllocator : public wxObjectAllocatorAndCreator | |
49 | { | |
50 | public: | |
51 | virtual bool Create(wxObject * &o, wxVariantBase *args) = 0; | |
52 | }; | |
53 | ||
54 | ||
55 | // ---------------------------------------------------------------------------- | |
56 | // Constructor Bridges for all Numbers of Params | |
57 | // ---------------------------------------------------------------------------- | |
58 | ||
59 | // no params | |
60 | ||
61 | template<typename Class> | |
62 | struct wxObjectAllocatorAndCreator_0 : public wxObjectAllocatorAndCreator | |
63 | { | |
64 | bool Create(wxObject * &o, wxVariantBase *) | |
65 | { | |
66 | Class *obj = wx_dynamic_cast(Class*, o); | |
67 | return obj->Create(); | |
68 | } | |
69 | }; | |
70 | ||
71 | struct wxObjectAllocatorAndCreator_Dummy : public wxObjectAllocatorAndCreator | |
72 | { | |
73 | bool Create(wxObject *&, wxVariantBase *) | |
74 | { | |
75 | return true; | |
76 | } | |
77 | }; | |
78 | ||
79 | #define wxCONSTRUCTOR_0(klass) \ | |
80 | wxObjectAllocatorAndCreator_0<klass> constructor##klass; \ | |
81 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
82 | const wxChar *klass::ms_constructorProperties[] = { NULL }; \ | |
83 | const int klass::ms_constructorPropertiesCount = 0; | |
84 | ||
85 | #define wxCONSTRUCTOR_DUMMY(klass) \ | |
86 | wxObjectAllocatorAndCreator_Dummy constructor##klass; \ | |
87 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
88 | const wxChar *klass::ms_constructorProperties[] = { NULL }; \ | |
89 | const int klass::ms_constructorPropertiesCount = 0; | |
90 | ||
91 | // direct constructor version | |
92 | ||
93 | template<typename Class> | |
94 | struct wxDirectConstructorBridge_0 : public wxObjectAllocator | |
95 | { | |
96 | bool Create(wxObject * &o, wxVariantBase *args) | |
97 | { | |
98 | o = new Class( ); | |
99 | return o != NULL; | |
100 | } | |
101 | }; | |
102 | ||
103 | #define wxDIRECT_CONSTRUCTOR_0(klass) \ | |
104 | wxDirectConstructorBridge_0<klass> constructor##klass; \ | |
105 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
106 | const wxChar *klass::ms_constructorProperties[] = { NULL }; \ | |
107 | const int klass::ms_constructorPropertiesCount = 0; | |
108 | ||
109 | ||
110 | // 1 param | |
111 | ||
112 | template<typename Class, typename T0> | |
113 | struct wxObjectAllocatorAndCreator_1 : public wxObjectAllocatorAndCreator | |
114 | { | |
115 | bool Create(wxObject * &o, wxVariantBase *args) | |
116 | { | |
117 | Class *obj = wx_dynamic_cast(Class*, o); | |
118 | return obj->Create( | |
119 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0) | |
120 | ); | |
121 | } | |
122 | }; | |
123 | ||
124 | #define wxCONSTRUCTOR_1(klass,t0,v0) \ | |
125 | wxObjectAllocatorAndCreator_1<klass,t0> constructor##klass; \ | |
126 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
127 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ | |
128 | const int klass::ms_constructorPropertiesCount = 1; | |
129 | ||
130 | // direct constructor version | |
131 | ||
132 | template<typename Class, typename T0> | |
133 | struct wxDirectConstructorBridge_1 : public wxObjectAllocator | |
134 | { | |
135 | bool Create(wxObject * &o, wxVariantBase *args) | |
136 | { | |
137 | o = new Class( | |
138 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0) | |
139 | ); | |
140 | return o != NULL; | |
141 | } | |
142 | }; | |
143 | ||
144 | #define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \ | |
145 | wxDirectConstructorBridge_1<klass,t0,t1> constructor##klass; \ | |
146 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
147 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ | |
148 | const int klass::ms_constructorPropertiesCount = 1; | |
149 | ||
150 | ||
151 | // 2 params | |
152 | ||
153 | template<typename Class, | |
154 | typename T0, typename T1> | |
155 | struct wxObjectAllocatorAndCreator_2 : public wxObjectAllocatorAndCreator | |
156 | { | |
157 | bool Create(wxObject * &o, wxVariantBase *args) | |
158 | { | |
159 | Class *obj = wx_dynamic_cast(Class*, o); | |
160 | return obj->Create( | |
161 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
162 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1) | |
163 | ); | |
164 | } | |
165 | }; | |
166 | ||
167 | #define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \ | |
168 | wxObjectAllocatorAndCreator_2<klass,t0,t1> constructor##klass; \ | |
169 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
170 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ | |
171 | const int klass::ms_constructorPropertiesCount = 2; | |
172 | ||
173 | // direct constructor version | |
174 | ||
175 | template<typename Class, | |
176 | typename T0, typename T1> | |
177 | struct wxDirectConstructorBridge_2 : public wxObjectAllocator | |
178 | { | |
179 | bool Create(wxObject * &o, wxVariantBase *args) | |
180 | { | |
181 | o = new Class( | |
182 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
183 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1) | |
184 | ); | |
185 | return o != NULL; | |
186 | } | |
187 | }; | |
188 | ||
189 | #define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \ | |
190 | wxDirectConstructorBridge_2<klass,t0,t1> constructor##klass; \ | |
191 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
192 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ | |
193 | const int klass::ms_constructorPropertiesCount = 2; | |
194 | ||
195 | ||
196 | // 3 params | |
197 | ||
198 | template<typename Class, | |
199 | typename T0, typename T1, typename T2> | |
200 | struct wxObjectAllocatorAndCreator_3 : public wxObjectAllocatorAndCreator | |
201 | { | |
202 | bool Create(wxObject * &o, wxVariantBase *args) | |
203 | { | |
204 | Class *obj = wx_dynamic_cast(Class*, o); | |
205 | return obj->Create( | |
206 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
207 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
208 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2) | |
209 | ); | |
210 | } | |
211 | }; | |
212 | ||
213 | #define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ | |
214 | wxObjectAllocatorAndCreator_3<klass,t0,t1,t2> constructor##klass; \ | |
215 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
216 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ | |
217 | const int klass::ms_constructorPropertiesCount = 3; | |
218 | ||
219 | // direct constructor version | |
220 | ||
221 | template<typename Class, | |
222 | typename T0, typename T1, typename T2> | |
223 | struct wxDirectConstructorBridge_3 : public wxObjectAllocator | |
224 | { | |
225 | bool Create(wxObject * &o, wxVariantBase *args) | |
226 | { | |
227 | o = new Class( | |
228 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
229 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
230 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2) | |
231 | ); | |
232 | return o != NULL; | |
233 | } | |
234 | }; | |
235 | ||
236 | #define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ | |
237 | wxDirectConstructorBridge_3<klass,t0,t1,t2> constructor##klass; \ | |
238 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
239 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ | |
240 | const int klass::ms_constructorPropertiesCount = 3; | |
241 | ||
242 | ||
243 | // 4 params | |
244 | ||
245 | template<typename Class, | |
246 | typename T0, typename T1, typename T2, typename T3> | |
247 | struct wxObjectAllocatorAndCreator_4 : public wxObjectAllocatorAndCreator | |
248 | { | |
249 | bool Create(wxObject * &o, wxVariantBase *args) | |
250 | { | |
251 | Class *obj = wx_dynamic_cast(Class*, o); | |
252 | return obj->Create( | |
253 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
254 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
255 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
256 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3) | |
257 | ); | |
258 | } | |
259 | }; | |
260 | ||
261 | #define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ | |
262 | wxObjectAllocatorAndCreator_4<klass,t0,t1,t2,t3> constructor##klass; \ | |
263 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
264 | const wxChar *klass::ms_constructorProperties[] = \ | |
265 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ | |
266 | const int klass::ms_constructorPropertiesCount = 4; | |
267 | ||
268 | // direct constructor version | |
269 | ||
270 | template<typename Class, | |
271 | typename T0, typename T1, typename T2, typename T3> | |
272 | struct wxDirectConstructorBridge_4 : public wxObjectAllocator | |
273 | { | |
274 | bool Create(wxObject * &o, wxVariantBase *args) | |
275 | { | |
276 | o = new Class( | |
277 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
278 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
279 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
280 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3) | |
281 | ); | |
282 | return o != NULL; | |
283 | } | |
284 | }; | |
285 | ||
286 | #define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ | |
287 | wxDirectConstructorBridge_4<klass,t0,t1,t2,t3> constructor##klass; \ | |
288 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
289 | const wxChar *klass::ms_constructorProperties[] = \ | |
290 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ | |
291 | const int klass::ms_constructorPropertiesCount = 4; | |
292 | ||
293 | ||
294 | // 5 params | |
295 | ||
296 | template<typename Class, | |
297 | typename T0, typename T1, typename T2, typename T3, typename T4> | |
298 | struct wxObjectAllocatorAndCreator_5 : public wxObjectAllocatorAndCreator | |
299 | { | |
300 | bool Create(wxObject * &o, wxVariantBase *args) | |
301 | { | |
302 | Class *obj = wx_dynamic_cast(Class*, o); | |
303 | return obj->Create( | |
304 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
305 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
306 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
307 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
308 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4) | |
309 | ); | |
310 | } | |
311 | }; | |
312 | ||
313 | #define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ | |
314 | wxObjectAllocatorAndCreator_5<klass,t0,t1,t2,t3,t4> constructor##klass; \ | |
315 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
316 | const wxChar *klass::ms_constructorProperties[] = \ | |
317 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ | |
318 | const int klass::ms_constructorPropertiesCount = 5; | |
319 | ||
320 | // direct constructor version | |
321 | ||
322 | template<typename Class, | |
323 | typename T0, typename T1, typename T2, typename T3, typename T4> | |
324 | struct wxDirectConstructorBridge_5 : public wxObjectAllocator | |
325 | { | |
326 | bool Create(wxObject * &o, wxVariantBase *args) | |
327 | { | |
328 | o = new Class( | |
329 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
330 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
331 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
332 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
333 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4) | |
334 | ); | |
335 | return o != NULL; | |
336 | } | |
337 | }; | |
338 | ||
339 | #define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ | |
340 | wxDirectConstructorBridge_5<klass,t0,t1,t2,t3,t4> constructor##klass; \ | |
341 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
342 | const wxChar *klass::ms_constructorProperties[] = \ | |
343 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ | |
344 | const int klass::ms_constructorPropertiesCount = 5; | |
345 | ||
346 | ||
347 | // 6 params | |
348 | ||
349 | template<typename Class, | |
350 | typename T0, typename T1, typename T2, typename T3, typename T4, typename T5> | |
351 | struct wxObjectAllocatorAndCreator_6 : public wxObjectAllocatorAndCreator | |
352 | { | |
353 | bool Create(wxObject * &o, wxVariantBase *args) | |
354 | { | |
355 | Class *obj = wx_dynamic_cast(Class*, o); | |
356 | return obj->Create( | |
357 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
358 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
359 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
360 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
361 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), | |
362 | args[5].wxTEMPLATED_MEMBER_CALL(Get, T5) | |
363 | ); | |
364 | } | |
365 | }; | |
366 | ||
367 | #define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ | |
368 | wxObjectAllocatorAndCreator_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass; \ | |
369 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
370 | const wxChar *klass::ms_constructorProperties[] = \ | |
371 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ | |
372 | const int klass::ms_constructorPropertiesCount = 6; | |
373 | ||
374 | // direct constructor version | |
375 | ||
376 | template<typename Class, | |
377 | typename T0, typename T1, typename T2, typename T3, typename T4, typename T5> | |
378 | struct wxDirectConstructorBridge_6 : public wxObjectAllocator | |
379 | { | |
380 | bool Create(wxObject * &o, wxVariantBase *args) | |
381 | { | |
382 | o = new Class( | |
383 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
384 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
385 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
386 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
387 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), | |
388 | args[5].wxTEMPLATED_MEMBER_CALL(Get, T5) | |
389 | ); | |
390 | return o != NULL; | |
391 | } | |
392 | }; | |
393 | ||
394 | #define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ | |
395 | wxDirectConstructorBridge_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass; \ | |
396 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
397 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ | |
398 | wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ | |
399 | const int klass::ms_constructorPropertiesCount = 6; | |
400 | ||
401 | ||
402 | // 7 params | |
403 | ||
404 | template<typename Class, | |
405 | typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> | |
406 | struct wxObjectAllocatorAndCreator_7 : public wxObjectAllocatorAndCreator | |
407 | { | |
408 | bool Create(wxObject * &o, wxVariantBase *args) | |
409 | { | |
410 | Class *obj = wx_dynamic_cast(Class*, o); | |
411 | return obj->Create( | |
412 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
413 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
414 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
415 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
416 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), | |
417 | args[5].wxTEMPLATED_MEMBER_CALL(Get, T5), | |
418 | args[6].wxTEMPLATED_MEMBER_CALL(Get, T6) | |
419 | ); | |
420 | } | |
421 | }; | |
422 | ||
423 | #define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ | |
424 | wxObjectAllocatorAndCreator_7<klass,t0,t1,t2,t3,t4,t5,t6> constructor##klass; \ | |
425 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
426 | const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ | |
427 | wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ | |
428 | const int klass::ms_constructorPropertiesCount = 7; | |
429 | ||
430 | // direct constructor version | |
431 | ||
432 | template<typename Class, | |
433 | typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> | |
434 | struct wxDirectConstructorBridge_7 : public wxObjectAllocator | |
435 | { | |
436 | bool Create(wxObject * &o, wxVariantBase *args) | |
437 | { | |
438 | o = new Class( | |
439 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
440 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
441 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
442 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
443 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), | |
444 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T5), | |
445 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T6) | |
446 | ); | |
447 | return o != NULL; | |
448 | } | |
449 | }; | |
450 | ||
451 | #define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ | |
452 | wxDirectConstructorBridge_7<klass,t0,t1,t2,t3,t4,t5,t6> constructor##klass; \ | |
453 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
454 | const wxChar *klass::ms_constructorProperties[] = \ | |
455 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ | |
456 | const int klass::ms_constructorPropertiesCount = 7; | |
457 | ||
458 | ||
459 | // 8 params | |
460 | ||
461 | template<typename Class, | |
462 | typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, \ | |
463 | typename T6, typename T7> | |
464 | struct wxObjectAllocatorAndCreator_8 : public wxObjectAllocatorAndCreator | |
465 | { | |
466 | bool Create(wxObject * &o, wxVariantBase *args) | |
467 | { | |
468 | Class *obj = wx_dynamic_cast(Class*, o); | |
469 | return obj->Create( | |
470 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
471 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
472 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
473 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
474 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), | |
475 | args[5].wxTEMPLATED_MEMBER_CALL(Get, T5), | |
476 | args[6].wxTEMPLATED_MEMBER_CALL(Get, T6), | |
477 | args[7].wxTEMPLATED_MEMBER_CALL(Get, T7) | |
478 | ); | |
479 | } | |
480 | }; | |
481 | ||
482 | #define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ | |
483 | wxObjectAllocatorAndCreator_8<klass,t0,t1,t2,t3,t4,t5,t6,t7> constructor##klass; \ | |
484 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
485 | const wxChar *klass::ms_constructorProperties[] = \ | |
486 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ | |
487 | const int klass::ms_constructorPropertiesCount = 8; | |
488 | ||
489 | // direct constructor version | |
490 | ||
491 | template<typename Class, | |
492 | typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, \ | |
493 | typename T6, typename T7> | |
494 | struct wxDirectConstructorBridge_8 : public wxObjectAllocator | |
495 | { | |
496 | bool Create(wxObject * &o, wxVariantBase *args) | |
497 | { | |
498 | o = new Class( | |
499 | args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), | |
500 | args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), | |
501 | args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), | |
502 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), | |
503 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), | |
504 | args[3].wxTEMPLATED_MEMBER_CALL(Get, T5), | |
505 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T6), | |
506 | args[4].wxTEMPLATED_MEMBER_CALL(Get, T7) | |
507 | ); | |
508 | return o != NULL; | |
509 | } | |
510 | }; | |
511 | ||
512 | #define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ | |
513 | wxDirectConstructorBridge_8<klass,t0,t1,t2,t3,t4,t5,t6,t7> constructor##klass; \ | |
514 | wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ | |
515 | const wxChar *klass::ms_constructorProperties[] = \ | |
516 | { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ | |
517 | const int klass::ms_constructorPropertiesCount = 8; | |
518 | ||
519 | #endif // wxUSE_EXTENDED_RTTI | |
520 | #endif // _XTICTOR_H_ |