Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | // -*- c++ -*- |
2 | /* This is a generated file, do not edit. Generated from ../sigc++/macros/retbind.h.m4 */ |
||
3 | /* This was also shamelessly copied, hacked, munched, and carefully |
||
4 | * tweaked from KNelson's original bind.h.m4 |
||
5 | * CJN 3.22.00 |
||
6 | */ |
||
7 | |||
8 | #ifndef SIGCXX_RETBIND_H |
||
9 | #define SIGCXX_RETBIND_H |
||
10 | |||
11 | /* |
||
12 | SigC::retbind |
||
13 | ------------- |
||
14 | retbind() alters a Slot by fixing the return value to certain values |
||
15 | |||
16 | Return value fixing ignores any slot return value. The slot is |
||
17 | destroyed in the process and a new one is created, so references |
||
18 | holding onto the slot will no longer be valid. |
||
19 | |||
20 | Typecasting may be necessary to match arguments between the |
||
21 | slot and the binding return value. Types must be an exact match. |
||
22 | To insure the proper type, the type can be explicitly specified |
||
23 | on template instantation. |
||
24 | |||
25 | Simple Sample usage: |
||
26 | |||
27 | void f(int,int); |
||
28 | Slot2 |
||
29 | |||
30 | Slot1 |
||
31 | cout << "s2: " << s2(2,1) << endl; |
||
32 | |||
33 | Type specified usage: |
||
34 | |||
35 | struct A {}; |
||
36 | struct B :public A {}; |
||
37 | B* b; |
||
38 | Slot1 |
||
39 | |||
40 | Slot0 s2=retbind(s1,b); // B* must be told to match A* |
||
41 | |||
42 | */ |
||
43 | |||
44 | #include |
||
45 | #include |
||
46 | |||
47 | #ifdef SIGC_CXX_NAMESPACES |
||
48 | namespace SigC |
||
49 | { |
||
50 | #endif |
||
51 | |||
52 | |||
53 | |||
54 | |||
55 | /**************************************************************** |
||
56 | ***** Adaptor RetBind Slot 0 arguments |
||
57 | ****************************************************************/ |
||
58 | template |
||
59 | struct AdaptorRetBindSlot0: public AdaptorSlot_ |
||
60 | { |
||
61 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
62 | typedef Ret RType; |
||
63 | #else |
||
64 | typedef typename Trait |
||
65 | #endif |
||
66 | typedef Slot0 |
||
67 | typedef Slot0 |
||
68 | |||
69 | struct Node:public AdaptorNode |
||
70 | { |
||
71 | Ret ret_; |
||
72 | }; |
||
73 | |||
74 | typedef CallDataObj2 |
||
75 | |||
76 | static RType callback(void* d) |
||
77 | { |
||
78 | CallData* data=(CallData*)d; |
||
79 | Node* node=data->obj; |
||
80 | ((typename InSlotType::Callback&)(node->data_))(); |
||
81 | return node->ret_; |
||
82 | } |
||
83 | static SlotData* create(SlotData *s,Ret ret) |
||
84 | { |
||
85 | SlotData* tmp=(SlotData*)s; |
||
86 | Node *node=new Node(); |
||
87 | copy_callback(tmp,node); |
||
88 | node->ret_ = ret; |
||
89 | CallData &data=reinterpret_cast |
||
90 | data.callback=&callback; |
||
91 | data.obj=node; |
||
92 | return tmp; |
||
93 | } |
||
94 | }; |
||
95 | |||
96 | |||
97 | #ifndef SIGC_CXX_VOID_RETURN |
||
98 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
99 | template |
||
100 | struct AdaptorRetBindSlot0 |
||
101 |
|
||
102 | { |
||
103 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
104 | typedef Ret RType; |
||
105 | #else |
||
106 | typedef typename Trait |
||
107 | #endif |
||
108 | typedef Slot0 |
||
109 | typedef Slot0 |
||
110 | |||
111 | struct Node:public AdaptorNode |
||
112 | { |
||
113 | Ret ret_; |
||
114 | }; |
||
115 | |||
116 | typedef CallDataObj2 |
||
117 | |||
118 | static RType callback(void* d) |
||
119 | { |
||
120 | CallData* data=(CallData*)d; |
||
121 | Node* node=data->obj; |
||
122 | ((typename InSlotType::Callback&)(node->data_))(); |
||
123 | return node->ret_; |
||
124 | } |
||
125 | static SlotData* create(SlotData *s,Ret ret) |
||
126 | { |
||
127 | SlotData* tmp=(SlotData*)s; |
||
128 | Node *node=new Node(); |
||
129 | copy_callback(tmp,node); |
||
130 | node->ret_ = ret; |
||
131 | CallData &data=reinterpret_cast |
||
132 | data.callback=&callback; |
||
133 | data.obj=node; |
||
134 | return tmp; |
||
135 | } |
||
136 | }; |
||
137 | |||
138 | #endif |
||
139 | #endif |
||
140 | |||
141 | template |
||
142 | class R> |
||
143 | Slot0 |
||
144 | retbind(const Slot0 |
||
145 | Ret ret) |
||
146 | {return AdaptorRetBindSlot0 |
||
147 | } |
||
148 | |||
149 | |||
150 | /**************************************************************** |
||
151 | ***** Adaptor RetBind Slot 1 arguments |
||
152 | ****************************************************************/ |
||
153 | template |
||
154 | class P1> |
||
155 | struct AdaptorRetBindSlot1: public AdaptorSlot_ |
||
156 | { |
||
157 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
158 | typedef Ret RType; |
||
159 | #else |
||
160 | typedef typename Trait |
||
161 | #endif |
||
162 | typedef Slot1 |
||
163 | typedef Slot1 |
||
164 | |||
165 | struct Node:public AdaptorNode |
||
166 | { |
||
167 | Ret ret_; |
||
168 | }; |
||
169 | |||
170 | typedef CallDataObj2 |
||
171 | |||
172 | static RType callback(void* d,P1 p1) |
||
173 | { |
||
174 | CallData* data=(CallData*)d; |
||
175 | Node* node=data->obj; |
||
176 | ((typename InSlotType::Callback&)(node->data_))(p1); |
||
177 | return node->ret_; |
||
178 | } |
||
179 | static SlotData* create(SlotData *s,Ret ret) |
||
180 | { |
||
181 | SlotData* tmp=(SlotData*)s; |
||
182 | Node *node=new Node(); |
||
183 | copy_callback(tmp,node); |
||
184 | node->ret_ = ret; |
||
185 | CallData &data=reinterpret_cast |
||
186 | data.callback=&callback; |
||
187 | data.obj=node; |
||
188 | return tmp; |
||
189 | } |
||
190 | }; |
||
191 | |||
192 | |||
193 | #ifndef SIGC_CXX_VOID_RETURN |
||
194 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
195 | template |
||
196 | struct AdaptorRetBindSlot1 |
||
197 | |||
198 | P1> : public AdaptorSlot_ |
||
199 | { |
||
200 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
201 | typedef Ret RType; |
||
202 | #else |
||
203 | typedef typename Trait |
||
204 | #endif |
||
205 | typedef Slot1 |
||
206 | typedef Slot1 |
||
207 | |||
208 | struct Node:public AdaptorNode |
||
209 | { |
||
210 | Ret ret_; |
||
211 | }; |
||
212 | |||
213 | typedef CallDataObj2 |
||
214 | |||
215 | static RType callback(void* d,P1 p1) |
||
216 | { |
||
217 | CallData* data=(CallData*)d; |
||
218 | Node* node=data->obj; |
||
219 | ((typename InSlotType::Callback&)(node->data_))(p1); |
||
220 | return node->ret_; |
||
221 | } |
||
222 | static SlotData* create(SlotData *s,Ret ret) |
||
223 | { |
||
224 | SlotData* tmp=(SlotData*)s; |
||
225 | Node *node=new Node(); |
||
226 | copy_callback(tmp,node); |
||
227 | node->ret_ = ret; |
||
228 | CallData &data=reinterpret_cast |
||
229 | data.callback=&callback; |
||
230 | data.obj=node; |
||
231 | return tmp; |
||
232 | } |
||
233 | }; |
||
234 | |||
235 | #endif |
||
236 | #endif |
||
237 | |||
238 | template |
||
239 | class R, |
||
240 | class P1> |
||
241 | Slot1 |
||
242 | retbind(const Slot1 |
||
243 | Ret ret) |
||
244 | {return AdaptorRetBindSlot1 |
||
245 | P1>::create(s.data(),ret); |
||
246 | } |
||
247 | |||
248 | |||
249 | /**************************************************************** |
||
250 | ***** Adaptor RetBind Slot 2 arguments |
||
251 | ****************************************************************/ |
||
252 | template |
||
253 | class P1,class P2> |
||
254 | struct AdaptorRetBindSlot2: public AdaptorSlot_ |
||
255 | { |
||
256 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
257 | typedef Ret RType; |
||
258 | #else |
||
259 | typedef typename Trait |
||
260 | #endif |
||
261 | typedef Slot2 |
||
262 | typedef Slot2 |
||
263 | |||
264 | struct Node:public AdaptorNode |
||
265 | { |
||
266 | Ret ret_; |
||
267 | }; |
||
268 | |||
269 | typedef CallDataObj2 |
||
270 | |||
271 | static RType callback(void* d,P1 p1,P2 p2) |
||
272 | { |
||
273 | CallData* data=(CallData*)d; |
||
274 | Node* node=data->obj; |
||
275 | ((typename InSlotType::Callback&)(node->data_))(p1,p2); |
||
276 | return node->ret_; |
||
277 | } |
||
278 | static SlotData* create(SlotData *s,Ret ret) |
||
279 | { |
||
280 | SlotData* tmp=(SlotData*)s; |
||
281 | Node *node=new Node(); |
||
282 | copy_callback(tmp,node); |
||
283 | node->ret_ = ret; |
||
284 | CallData &data=reinterpret_cast |
||
285 | data.callback=&callback; |
||
286 | data.obj=node; |
||
287 | return tmp; |
||
288 | } |
||
289 | }; |
||
290 | |||
291 | |||
292 | #ifndef SIGC_CXX_VOID_RETURN |
||
293 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
294 | template |
||
295 | struct AdaptorRetBindSlot2 |
||
296 | |||
297 | P1,P2> : public AdaptorSlot_ |
||
298 | { |
||
299 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
300 | typedef Ret RType; |
||
301 | #else |
||
302 | typedef typename Trait |
||
303 | #endif |
||
304 | typedef Slot2 |
||
305 | typedef Slot2 |
||
306 | |||
307 | struct Node:public AdaptorNode |
||
308 | { |
||
309 | Ret ret_; |
||
310 | }; |
||
311 | |||
312 | typedef CallDataObj2 |
||
313 | |||
314 | static RType callback(void* d,P1 p1,P2 p2) |
||
315 | { |
||
316 | CallData* data=(CallData*)d; |
||
317 | Node* node=data->obj; |
||
318 | ((typename InSlotType::Callback&)(node->data_))(p1,p2); |
||
319 | return node->ret_; |
||
320 | } |
||
321 | static SlotData* create(SlotData *s,Ret ret) |
||
322 | { |
||
323 | SlotData* tmp=(SlotData*)s; |
||
324 | Node *node=new Node(); |
||
325 | copy_callback(tmp,node); |
||
326 | node->ret_ = ret; |
||
327 | CallData &data=reinterpret_cast |
||
328 | data.callback=&callback; |
||
329 | data.obj=node; |
||
330 | return tmp; |
||
331 | } |
||
332 | }; |
||
333 | |||
334 | #endif |
||
335 | #endif |
||
336 | |||
337 | template |
||
338 | class R, |
||
339 | class P1,class P2> |
||
340 | Slot2 |
||
341 | retbind(const Slot2 |
||
342 | Ret ret) |
||
343 | {return AdaptorRetBindSlot2 |
||
344 | P1,P2>::create(s.data(),ret); |
||
345 | } |
||
346 | |||
347 | |||
348 | /**************************************************************** |
||
349 | ***** Adaptor RetBind Slot 3 arguments |
||
350 | ****************************************************************/ |
||
351 | template |
||
352 | class P1,class P2,class P3> |
||
353 | struct AdaptorRetBindSlot3: public AdaptorSlot_ |
||
354 | { |
||
355 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
356 | typedef Ret RType; |
||
357 | #else |
||
358 | typedef typename Trait |
||
359 | #endif |
||
360 | typedef Slot3 |
||
361 | typedef Slot3 |
||
362 | |||
363 | struct Node:public AdaptorNode |
||
364 | { |
||
365 | Ret ret_; |
||
366 | }; |
||
367 | |||
368 | typedef CallDataObj2 |
||
369 | |||
370 | static RType callback(void* d,P1 p1,P2 p2,P3 p3) |
||
371 | { |
||
372 | CallData* data=(CallData*)d; |
||
373 | Node* node=data->obj; |
||
374 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3); |
||
375 | return node->ret_; |
||
376 | } |
||
377 | static SlotData* create(SlotData *s,Ret ret) |
||
378 | { |
||
379 | SlotData* tmp=(SlotData*)s; |
||
380 | Node *node=new Node(); |
||
381 | copy_callback(tmp,node); |
||
382 | node->ret_ = ret; |
||
383 | CallData &data=reinterpret_cast |
||
384 | data.callback=&callback; |
||
385 | data.obj=node; |
||
386 | return tmp; |
||
387 | } |
||
388 | }; |
||
389 | |||
390 | |||
391 | #ifndef SIGC_CXX_VOID_RETURN |
||
392 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
393 | template |
||
394 | struct AdaptorRetBindSlot3 |
||
395 | |||
396 | P1,P2,P3> : public AdaptorSlot_ |
||
397 | { |
||
398 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
399 | typedef Ret RType; |
||
400 | #else |
||
401 | typedef typename Trait |
||
402 | #endif |
||
403 | typedef Slot3 |
||
404 | typedef Slot3 |
||
405 | |||
406 | struct Node:public AdaptorNode |
||
407 | { |
||
408 | Ret ret_; |
||
409 | }; |
||
410 | |||
411 | typedef CallDataObj2 |
||
412 | |||
413 | static RType callback(void* d,P1 p1,P2 p2,P3 p3) |
||
414 | { |
||
415 | CallData* data=(CallData*)d; |
||
416 | Node* node=data->obj; |
||
417 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3); |
||
418 | return node->ret_; |
||
419 | } |
||
420 | static SlotData* create(SlotData *s,Ret ret) |
||
421 | { |
||
422 | SlotData* tmp=(SlotData*)s; |
||
423 | Node *node=new Node(); |
||
424 | copy_callback(tmp,node); |
||
425 | node->ret_ = ret; |
||
426 | CallData &data=reinterpret_cast |
||
427 | data.callback=&callback; |
||
428 | data.obj=node; |
||
429 | return tmp; |
||
430 | } |
||
431 | }; |
||
432 | |||
433 | #endif |
||
434 | #endif |
||
435 | |||
436 | template |
||
437 | class R, |
||
438 | class P1,class P2,class P3> |
||
439 | Slot3 |
||
440 | retbind(const Slot3 |
||
441 | Ret ret) |
||
442 | {return AdaptorRetBindSlot3 |
||
443 | P1,P2,P3>::create(s.data(),ret); |
||
444 | } |
||
445 | |||
446 | |||
447 | /**************************************************************** |
||
448 | ***** Adaptor RetBind Slot 4 arguments |
||
449 | ****************************************************************/ |
||
450 | template |
||
451 | class P1,class P2,class P3,class P4> |
||
452 | struct AdaptorRetBindSlot4: public AdaptorSlot_ |
||
453 | { |
||
454 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
455 | typedef Ret RType; |
||
456 | #else |
||
457 | typedef typename Trait |
||
458 | #endif |
||
459 | typedef Slot4 |
||
460 | typedef Slot4 |
||
461 | |||
462 | struct Node:public AdaptorNode |
||
463 | { |
||
464 | Ret ret_; |
||
465 | }; |
||
466 | |||
467 | typedef CallDataObj2 |
||
468 | |||
469 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4) |
||
470 | { |
||
471 | CallData* data=(CallData*)d; |
||
472 | Node* node=data->obj; |
||
473 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4); |
||
474 | return node->ret_; |
||
475 | } |
||
476 | static SlotData* create(SlotData *s,Ret ret) |
||
477 | { |
||
478 | SlotData* tmp=(SlotData*)s; |
||
479 | Node *node=new Node(); |
||
480 | copy_callback(tmp,node); |
||
481 | node->ret_ = ret; |
||
482 | CallData &data=reinterpret_cast |
||
483 | data.callback=&callback; |
||
484 | data.obj=node; |
||
485 | return tmp; |
||
486 | } |
||
487 | }; |
||
488 | |||
489 | |||
490 | #ifndef SIGC_CXX_VOID_RETURN |
||
491 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
492 | template |
||
493 | struct AdaptorRetBindSlot4 |
||
494 | |||
495 | P1,P2,P3,P4> : public AdaptorSlot_ |
||
496 | { |
||
497 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
498 | typedef Ret RType; |
||
499 | #else |
||
500 | typedef typename Trait |
||
501 | #endif |
||
502 | typedef Slot4 |
||
503 | typedef Slot4 |
||
504 | |||
505 | struct Node:public AdaptorNode |
||
506 | { |
||
507 | Ret ret_; |
||
508 | }; |
||
509 | |||
510 | typedef CallDataObj2 |
||
511 | |||
512 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4) |
||
513 | { |
||
514 | CallData* data=(CallData*)d; |
||
515 | Node* node=data->obj; |
||
516 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4); |
||
517 | return node->ret_; |
||
518 | } |
||
519 | static SlotData* create(SlotData *s,Ret ret) |
||
520 | { |
||
521 | SlotData* tmp=(SlotData*)s; |
||
522 | Node *node=new Node(); |
||
523 | copy_callback(tmp,node); |
||
524 | node->ret_ = ret; |
||
525 | CallData &data=reinterpret_cast |
||
526 | data.callback=&callback; |
||
527 | data.obj=node; |
||
528 | return tmp; |
||
529 | } |
||
530 | }; |
||
531 | |||
532 | #endif |
||
533 | #endif |
||
534 | |||
535 | template |
||
536 | class R, |
||
537 | class P1,class P2,class P3,class P4> |
||
538 | Slot4 |
||
539 | retbind(const Slot4 |
||
540 | Ret ret) |
||
541 | {return AdaptorRetBindSlot4 |
||
542 | P1,P2,P3,P4>::create(s.data(),ret); |
||
543 | } |
||
544 | |||
545 | |||
546 | /**************************************************************** |
||
547 | ***** Adaptor RetBind Slot 5 arguments |
||
548 | ****************************************************************/ |
||
549 | template |
||
550 | class P1,class P2,class P3,class P4,class P5> |
||
551 | struct AdaptorRetBindSlot5: public AdaptorSlot_ |
||
552 | { |
||
553 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
554 | typedef Ret RType; |
||
555 | #else |
||
556 | typedef typename Trait |
||
557 | #endif |
||
558 | typedef Slot5 |
||
559 | typedef Slot5 |
||
560 | |||
561 | struct Node:public AdaptorNode |
||
562 | { |
||
563 | Ret ret_; |
||
564 | }; |
||
565 | |||
566 | typedef CallDataObj2 |
||
567 | |||
568 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5) |
||
569 | { |
||
570 | CallData* data=(CallData*)d; |
||
571 | Node* node=data->obj; |
||
572 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5); |
||
573 | return node->ret_; |
||
574 | } |
||
575 | static SlotData* create(SlotData *s,Ret ret) |
||
576 | { |
||
577 | SlotData* tmp=(SlotData*)s; |
||
578 | Node *node=new Node(); |
||
579 | copy_callback(tmp,node); |
||
580 | node->ret_ = ret; |
||
581 | CallData &data=reinterpret_cast |
||
582 | data.callback=&callback; |
||
583 | data.obj=node; |
||
584 | return tmp; |
||
585 | } |
||
586 | }; |
||
587 | |||
588 | |||
589 | #ifndef SIGC_CXX_VOID_RETURN |
||
590 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
591 | template |
||
592 | struct AdaptorRetBindSlot5 |
||
593 | |||
594 | P1,P2,P3,P4,P5> : public AdaptorSlot_ |
||
595 | { |
||
596 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
597 | typedef Ret RType; |
||
598 | #else |
||
599 | typedef typename Trait |
||
600 | #endif |
||
601 | typedef Slot5 |
||
602 | typedef Slot5 |
||
603 | |||
604 | struct Node:public AdaptorNode |
||
605 | { |
||
606 | Ret ret_; |
||
607 | }; |
||
608 | |||
609 | typedef CallDataObj2 |
||
610 | |||
611 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5) |
||
612 | { |
||
613 | CallData* data=(CallData*)d; |
||
614 | Node* node=data->obj; |
||
615 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5); |
||
616 | return node->ret_; |
||
617 | } |
||
618 | static SlotData* create(SlotData *s,Ret ret) |
||
619 | { |
||
620 | SlotData* tmp=(SlotData*)s; |
||
621 | Node *node=new Node(); |
||
622 | copy_callback(tmp,node); |
||
623 | node->ret_ = ret; |
||
624 | CallData &data=reinterpret_cast |
||
625 | data.callback=&callback; |
||
626 | data.obj=node; |
||
627 | return tmp; |
||
628 | } |
||
629 | }; |
||
630 | |||
631 | #endif |
||
632 | #endif |
||
633 | |||
634 | template |
||
635 | class R, |
||
636 | class P1,class P2,class P3,class P4,class P5> |
||
637 | Slot5 |
||
638 | retbind(const Slot5 |
||
639 | Ret ret) |
||
640 | {return AdaptorRetBindSlot5 |
||
641 | P1,P2,P3,P4,P5>::create(s.data(),ret); |
||
642 | } |
||
643 | |||
644 | |||
645 | /**************************************************************** |
||
646 | ***** Adaptor RetBind Slot 6 arguments |
||
647 | ****************************************************************/ |
||
648 | template |
||
649 | class P1,class P2,class P3,class P4,class P5,class P6> |
||
650 | struct AdaptorRetBindSlot6: public AdaptorSlot_ |
||
651 | { |
||
652 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
653 | typedef Ret RType; |
||
654 | #else |
||
655 | typedef typename Trait |
||
656 | #endif |
||
657 | typedef Slot6 |
||
658 | typedef Slot6 |
||
659 | |||
660 | struct Node:public AdaptorNode |
||
661 | { |
||
662 | Ret ret_; |
||
663 | }; |
||
664 | |||
665 | typedef CallDataObj2 |
||
666 | |||
667 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6) |
||
668 | { |
||
669 | CallData* data=(CallData*)d; |
||
670 | Node* node=data->obj; |
||
671 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6); |
||
672 | return node->ret_; |
||
673 | } |
||
674 | static SlotData* create(SlotData *s,Ret ret) |
||
675 | { |
||
676 | SlotData* tmp=(SlotData*)s; |
||
677 | Node *node=new Node(); |
||
678 | copy_callback(tmp,node); |
||
679 | node->ret_ = ret; |
||
680 | CallData &data=reinterpret_cast |
||
681 | data.callback=&callback; |
||
682 | data.obj=node; |
||
683 | return tmp; |
||
684 | } |
||
685 | }; |
||
686 | |||
687 | |||
688 | #ifndef SIGC_CXX_VOID_RETURN |
||
689 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
690 | template |
||
691 | struct AdaptorRetBindSlot6 |
||
692 | |||
693 | P1,P2,P3,P4,P5,P6> : public AdaptorSlot_ |
||
694 | { |
||
695 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
696 | typedef Ret RType; |
||
697 | #else |
||
698 | typedef typename Trait |
||
699 | #endif |
||
700 | typedef Slot6 |
||
701 | typedef Slot6 |
||
702 | |||
703 | struct Node:public AdaptorNode |
||
704 | { |
||
705 | Ret ret_; |
||
706 | }; |
||
707 | |||
708 | typedef CallDataObj2 |
||
709 | |||
710 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6) |
||
711 | { |
||
712 | CallData* data=(CallData*)d; |
||
713 | Node* node=data->obj; |
||
714 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6); |
||
715 | return node->ret_; |
||
716 | } |
||
717 | static SlotData* create(SlotData *s,Ret ret) |
||
718 | { |
||
719 | SlotData* tmp=(SlotData*)s; |
||
720 | Node *node=new Node(); |
||
721 | copy_callback(tmp,node); |
||
722 | node->ret_ = ret; |
||
723 | CallData &data=reinterpret_cast |
||
724 | data.callback=&callback; |
||
725 | data.obj=node; |
||
726 | return tmp; |
||
727 | } |
||
728 | }; |
||
729 | |||
730 | #endif |
||
731 | #endif |
||
732 | |||
733 | template |
||
734 | class R, |
||
735 | class P1,class P2,class P3,class P4,class P5,class P6> |
||
736 | Slot6 |
||
737 | retbind(const Slot6 |
||
738 | Ret ret) |
||
739 | {return AdaptorRetBindSlot6 |
||
740 | P1,P2,P3,P4,P5,P6>::create(s.data(),ret); |
||
741 | } |
||
742 | |||
743 | |||
744 | /**************************************************************** |
||
745 | ***** Adaptor RetBind Slot 7 arguments |
||
746 | ****************************************************************/ |
||
747 | template |
||
748 | class P1,class P2,class P3,class P4,class P5,class P6,class P7> |
||
749 | struct AdaptorRetBindSlot7: public AdaptorSlot_ |
||
750 | { |
||
751 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
752 | typedef Ret RType; |
||
753 | #else |
||
754 | typedef typename Trait |
||
755 | #endif |
||
756 | typedef Slot7 |
||
757 | typedef Slot7 |
||
758 | |||
759 | struct Node:public AdaptorNode |
||
760 | { |
||
761 | Ret ret_; |
||
762 | }; |
||
763 | |||
764 | typedef CallDataObj2 |
||
765 | |||
766 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7) |
||
767 | { |
||
768 | CallData* data=(CallData*)d; |
||
769 | Node* node=data->obj; |
||
770 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,p7); |
||
771 | return node->ret_; |
||
772 | } |
||
773 | static SlotData* create(SlotData *s,Ret ret) |
||
774 | { |
||
775 | SlotData* tmp=(SlotData*)s; |
||
776 | Node *node=new Node(); |
||
777 | copy_callback(tmp,node); |
||
778 | node->ret_ = ret; |
||
779 | CallData &data=reinterpret_cast |
||
780 | data.callback=&callback; |
||
781 | data.obj=node; |
||
782 | return tmp; |
||
783 | } |
||
784 | }; |
||
785 | |||
786 | |||
787 | #ifndef SIGC_CXX_VOID_RETURN |
||
788 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
789 | template |
||
790 | struct AdaptorRetBindSlot7 |
||
791 | |||
792 | P1,P2,P3,P4,P5,P6,P7> : public AdaptorSlot_ |
||
793 | { |
||
794 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
795 | typedef Ret RType; |
||
796 | #else |
||
797 | typedef typename Trait |
||
798 | #endif |
||
799 | typedef Slot7 |
||
800 | typedef Slot7 |
||
801 | |||
802 | struct Node:public AdaptorNode |
||
803 | { |
||
804 | Ret ret_; |
||
805 | }; |
||
806 | |||
807 | typedef CallDataObj2 |
||
808 | |||
809 | static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7) |
||
810 | { |
||
811 | CallData* data=(CallData*)d; |
||
812 | Node* node=data->obj; |
||
813 | ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,p7); |
||
814 | return node->ret_; |
||
815 | } |
||
816 | static SlotData* create(SlotData *s,Ret ret) |
||
817 | { |
||
818 | SlotData* tmp=(SlotData*)s; |
||
819 | Node *node=new Node(); |
||
820 | copy_callback(tmp,node); |
||
821 | node->ret_ = ret; |
||
822 | CallData &data=reinterpret_cast |
||
823 | data.callback=&callback; |
||
824 | data.obj=node; |
||
825 | return tmp; |
||
826 | } |
||
827 | }; |
||
828 | |||
829 | #endif |
||
830 | #endif |
||
831 | |||
832 | template |
||
833 | class R, |
||
834 | class P1,class P2,class P3,class P4,class P5,class P6,class P7> |
||
835 | Slot7 |
||
836 | retbind(const Slot7 |
||
837 | Ret ret) |
||
838 | {return AdaptorRetBindSlot7 |
||
839 | P1,P2,P3,P4,P5,P6,P7>::create(s.data(),ret); |
||
840 | } |
||
841 | |||
842 | |||
843 | |||
844 | #ifdef SIGC_CXX_NAMESPACES |
||
845 | } // namespace |
||
846 | #endif |
||
847 | |||
848 | #endif |