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/slot.h.m4 */ |
||
3 | |||
4 | |||
5 | #ifndef SIGCXX_SLOT_H |
||
6 | #define SIGCXX_SLOT_H |
||
7 | |||
8 | /* |
||
9 | |||
10 | This file just gives the basic definition of Slots. |
||
11 | |||
12 | Callback# is the 4 byte data necessary for representing all |
||
13 | callback types. |
||
14 | |||
15 | CallData is a specific interpretation of the Callback data. |
||
16 | |||
17 | Slot_ is a pimple on SlotData containing an Object for |
||
18 | holding its referencees, a Dependency that removes the slot |
||
19 | when its caller or receiver die, and a Callback. |
||
20 | |||
21 | Slot is a handle to a Slot_. |
||
22 | |||
23 | */ |
||
24 | |||
25 | #include |
||
26 | #include |
||
27 | #include |
||
28 | #include |
||
29 | |||
30 | #ifdef SIGC_CXX_NAMESPACES |
||
31 | namespace SigC |
||
32 | { |
||
33 | #endif |
||
34 | |||
35 | // Base node for a polymorphic list of "extra" data needed |
||
36 | // by various slots. |
||
37 | struct LIBSIGC_API SlotNode |
||
38 | { |
||
39 | void *next_; |
||
40 | SlotNode(); |
||
41 | virtual ~SlotNode()=0; |
||
42 | }; |
||
43 | |||
44 | struct LIBSIGC_API SlotIterator_ |
||
45 | { |
||
46 | typedef SlotNode NodeType; |
||
47 | typedef SlotIterator_ Iterator; |
||
48 | NodeType *node_; |
||
49 | |||
50 | NodeType* node() {return node_;} |
||
51 | const NodeType* node() const {return node_;} |
||
52 | |||
53 | NodeType& operator*() |
||
54 | {return *node_; |
||
55 | } |
||
56 | const NodeType& operator*() const |
||
57 | {return *node_; |
||
58 | } |
||
59 | |||
60 | bool operator==(const Iterator& i) const |
||
61 | {return node_==i.node_; |
||
62 | } |
||
63 | bool operator!=(const Iterator& i) const |
||
64 | {return node_!=i.node_; |
||
65 | } |
||
66 | |||
67 | Iterator& operator++() |
||
68 | { |
||
69 | if (node_) |
||
70 | node_=(NodeType*)node_->next_; |
||
71 | return *this; |
||
72 | } |
||
73 | |||
74 | Iterator operator++(int) |
||
75 | {Iterator tmp=*this; |
||
76 | ++*this; |
||
77 | return tmp; |
||
78 | } |
||
79 | |||
80 | Iterator& operator= (const Iterator& i) |
||
81 | { |
||
82 | node_=i.node_; |
||
83 | return *this; |
||
84 | } |
||
85 | |||
86 | SlotIterator_():node_(0) {} |
||
87 | SlotIterator_(NodeType *node):node_(node) {} |
||
88 | }; |
||
89 | |||
90 | // This is a list for storing internal data for slots |
||
91 | struct LIBSIGC_API SlotList_ |
||
92 | { |
||
93 | typedef SlotNode NodeType; |
||
94 | typedef SlotIterator_ Iterator; |
||
95 | NodeType* head_; |
||
96 | |||
97 | Iterator begin() {return ((NodeType*)head_);} |
||
98 | Iterator end() {return Iterator();} |
||
99 | const Iterator begin() const {return ((NodeType*)head_);} |
||
100 | const Iterator end() const {return Iterator();} |
||
101 | |||
102 | // this is best used at the begining of list. |
||
103 | Iterator insert_direct(Iterator pos,NodeType *n); |
||
104 | |||
105 | void clear(); |
||
106 | bool empty() const {return head_==0;} |
||
107 | |||
108 | SlotList_():head_(0) |
||
109 | {} |
||
110 | ~SlotList_() |
||
111 | {clear();} |
||
112 | |||
113 | private: |
||
114 | SlotList_(const SlotList_&); |
||
115 | }; |
||
116 | |||
117 | |||
118 | struct SlotData; |
||
119 | |||
120 | // SlotDependent is an internal of SlotData used to unreference the |
||
121 | // Slot when either the sender or receiver have gone away |
||
122 | struct LIBSIGC_API SlotDependent:public ScopeNode |
||
123 | { |
||
124 | struct LIBSIGC_API Dep: public ScopeNode |
||
125 | { |
||
126 | SlotData *parent; |
||
127 | virtual void erase(); |
||
128 | Dep() {} |
||
129 | virtual ~Dep(); |
||
130 | } dep; |
||
131 | |||
132 | ScopeNode* receiver() {return &dep;} |
||
133 | ScopeNode* sender() {return this;} |
||
134 | SlotData* parent() {return dep.parent;} |
||
135 | |||
136 | bool connected() |
||
137 | {return (next_!=this);} |
||
138 | |||
139 | virtual void erase(); |
||
140 | |||
141 | void set_parent(SlotData *s) |
||
142 | {dep.parent=s;} |
||
143 | |||
144 | SlotDependent(SlotData &s) |
||
145 | {dep.parent=&s;} |
||
146 | |||
147 | SlotDependent() |
||
148 | {} |
||
149 | |||
150 | virtual ~SlotDependent(); |
||
151 | }; |
||
152 | |||
153 | // common data to all callbacks. |
||
154 | struct Callback_ |
||
155 | { |
||
156 | // callback function |
||
157 | void* (*func_)(void*); |
||
158 | |||
159 | struct O; |
||
160 | struct C1 |
||
161 | { |
||
162 | void* (*f1)(void*); |
||
163 | }; |
||
164 | struct C2 |
||
165 | { |
||
166 | O* o; |
||
167 | void (O::*v)(void); |
||
168 | }; |
||
169 | |||
170 | // Object pointer or function pointer |
||
171 | union {C1 a1; C2 a2;}; |
||
172 | }; |
||
173 | |||
174 | // All slots have the same base |
||
175 | struct LIBSIGC_API SlotData:public ObjectScoped |
||
176 | { |
||
177 | typedef SlotList_ List; |
||
178 | |||
179 | SlotDependent dep_; |
||
180 | |||
181 | ScopeNode* receiver() {return dep_.receiver();} |
||
182 | ScopeNode* sender() {return dep_.sender();} |
||
183 | |||
184 | // Called from signals to tell slot object it is connected |
||
185 | // invalidates list and sets weak reference |
||
186 | void connect(); |
||
187 | |||
188 | List list_; |
||
189 | Callback_ data_; |
||
190 | |||
191 | Callback_& callback() {return data_;} |
||
192 | |||
193 | SlotData() |
||
194 | {dep_.set_parent(this);} |
||
195 | virtual ~SlotData(); |
||
196 | }; |
||
197 | |||
198 | |||
199 | typedef Scopes::Extend SlotExtend; |
||
200 | #ifdef LIBSIGC_MSC |
||
201 | #pragma warning(disable: 4231) |
||
202 | LIBSIGC_TMPL template class LIBSIGC_API Handle |
||
203 | #endif |
||
204 | class LIBSIGC_API Connection:protected Handle |
||
205 | { |
||
206 | typedef Handle |
||
207 | public: |
||
208 | // hides virtual method |
||
209 | void disconnect() {if (obj()) obj()->invalid();} |
||
210 | bool connected() {return Base::connected ();} |
||
211 | |||
212 | Connection():Base() {} |
||
213 | Connection(SlotData *s):Base(s) {} |
||
214 | Connection(const Connection& s):Base(s) { } |
||
215 | ~Connection() {} |
||
216 | }; |
||
217 | |||
218 | // possible casts of Callback |
||
219 | template |
||
220 | struct CallDataFunc |
||
221 | { |
||
222 | C callback; |
||
223 | F func; |
||
224 | }; |
||
225 | |||
226 | template |
||
227 | struct CallDataObj2 |
||
228 | { |
||
229 | C callback; |
||
230 | O *obj; |
||
231 | }; |
||
232 | |||
233 | template |
||
234 | struct CallDataObj3 |
||
235 | { |
||
236 | C callback; |
||
237 | O* obj; |
||
238 | F func; |
||
239 | }; |
||
240 | |||
241 | // from Abstract_Slots we build abstract slots |
||
242 | // with various lengths of arguments |
||
243 | // A slot is not concrete til it has a call |
||
244 | |||
245 | |||
246 | |||
247 | /**************************************************************** |
||
248 | ***** Abstract Slot 0 |
||
249 | ****************************************************************/ |
||
250 | |||
251 | template |
||
252 | struct Callback0:public Callback_ |
||
253 | { |
||
254 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
255 | typedef R RType; |
||
256 | #else |
||
257 | typedef Trait |
||
258 | #endif |
||
259 | typedef RType (*Func)(void*); |
||
260 | inline RType call() |
||
261 | {return ((Func)(func_))((void*)this);} |
||
262 | inline RType operator()() |
||
263 | {return ((Func)(func_))((void*)this);} |
||
264 | }; |
||
265 | |||
266 | template |
||
267 | class Slot0 |
||
268 | :public Handle |
||
269 | { |
||
270 | public: |
||
271 | typedef Handle |
||
272 | typedef Callback0 |
||
273 | typedef typename Callback::RType RType; |
||
274 | typedef RType (*Func)(void*); |
||
275 | |||
276 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
277 | |||
278 | Slot0() {} |
||
279 | Slot0(SlotData *s):Base(s) {} |
||
280 | Slot0(const Slot0& s):Base(s.obj()) {} |
||
281 | |||
282 | inline RType call() |
||
283 | { |
||
284 | if (connected()) |
||
285 | return ((Callback&)(data()->callback())).call(); |
||
286 | return RType(); |
||
287 | } |
||
288 | inline RType operator()() |
||
289 | { |
||
290 | if (connected()) |
||
291 | return ((Callback&)(data()->callback())).call(); |
||
292 | return RType(); |
||
293 | } |
||
294 | }; |
||
295 | |||
296 | |||
297 | #ifndef SIGC_CXX_VOID_RETURN |
||
298 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
299 | |||
300 | template <> |
||
301 | struct Callback0 |
||
302 | { |
||
303 | typedef void RType; |
||
304 | typedef RType (*Func)(void*); |
||
305 | inline RType call() |
||
306 | {((Func)(func_))((void*)this);} |
||
307 | inline RType operator()() |
||
308 | {((Func)(func_))((void*)this);} |
||
309 | }; |
||
310 | |||
311 | template <> |
||
312 | class Slot0 |
||
313 | :public Handle |
||
314 | { |
||
315 | public: |
||
316 | typedef Handle |
||
317 | typedef Callback0 |
||
318 | typedef Callback::RType RType; |
||
319 | typedef RType (*Func)(void*); |
||
320 | |||
321 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
322 | |||
323 | Slot0() {} |
||
324 | Slot0(SlotData *s):Base(s) {} |
||
325 | Slot0(const Slot0& s):Base(s.obj()) {} |
||
326 | |||
327 | inline RType call() |
||
328 | { |
||
329 | if (connected()) |
||
330 | |||
331 | ((Callback&)(data()->callback())).call(); |
||
332 | } |
||
333 | inline RType operator()() |
||
334 | { |
||
335 | if (connected()) |
||
336 | |||
337 | ((Callback&)(data()->callback())).call(); |
||
338 | } |
||
339 | }; |
||
340 | |||
341 | #endif |
||
342 | #endif |
||
343 | |||
344 | |||
345 | /**************************************************************** |
||
346 | ***** Abstract Slot 1 |
||
347 | ****************************************************************/ |
||
348 | |||
349 | template |
||
350 | struct Callback1:public Callback_ |
||
351 | { |
||
352 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
353 | typedef R RType; |
||
354 | #else |
||
355 | typedef Trait |
||
356 | #endif |
||
357 | typedef RType (*Func)(void*,P1); |
||
358 | inline RType call(typename Trait |
||
359 | {return ((Func)(func_))((void*)this,p1);} |
||
360 | inline RType operator()(typename Trait |
||
361 | {return ((Func)(func_))((void*)this,p1);} |
||
362 | }; |
||
363 | |||
364 | template |
||
365 | class Slot1 |
||
366 | :public Handle |
||
367 | { |
||
368 | public: |
||
369 | typedef Handle |
||
370 | typedef Callback1 |
||
371 | typedef typename Callback::RType RType; |
||
372 | typedef RType (*Func)(void*,P1); |
||
373 | |||
374 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
375 | |||
376 | Slot1() {} |
||
377 | Slot1(SlotData *s):Base(s) {} |
||
378 | Slot1(const Slot1& s):Base(s.obj()) {} |
||
379 | |||
380 | inline RType call(typename Trait |
||
381 | { |
||
382 | if (connected()) |
||
383 | return ((Callback&)(data()->callback())).call(p1); |
||
384 | return RType(); |
||
385 | } |
||
386 | inline RType operator()(typename Trait |
||
387 | { |
||
388 | if (connected()) |
||
389 | return ((Callback&)(data()->callback())).call(p1); |
||
390 | return RType(); |
||
391 | } |
||
392 | }; |
||
393 | |||
394 | |||
395 | #ifndef SIGC_CXX_VOID_RETURN |
||
396 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
397 | |||
398 | template |
||
399 | struct Callback1 |
||
400 | { |
||
401 | typedef void RType; |
||
402 | typedef RType (*Func)(void*,P1); |
||
403 | inline RType call(typename Trait |
||
404 | {((Func)(func_))((void*)this,p1);} |
||
405 | inline RType operator()(typename Trait |
||
406 | {((Func)(func_))((void*)this,p1);} |
||
407 | }; |
||
408 | |||
409 | template |
||
410 | class Slot1 |
||
411 | :public Handle |
||
412 | { |
||
413 | public: |
||
414 | typedef Handle |
||
415 | typedef Callback1 |
||
416 | typedef typename Callback::RType RType; |
||
417 | typedef RType (*Func)(void*,P1); |
||
418 | |||
419 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
420 | |||
421 | Slot1() {} |
||
422 | Slot1(SlotData *s):Base(s) {} |
||
423 | Slot1(const Slot1& s):Base(s.obj()) {} |
||
424 | |||
425 | inline RType call(typename Trait |
||
426 | { |
||
427 | if (connected()) |
||
428 | |||
429 | ((Callback&)(data()->callback())).call(p1); |
||
430 | } |
||
431 | inline RType operator()(typename Trait |
||
432 | { |
||
433 | if (connected()) |
||
434 | |||
435 | ((Callback&)(data()->callback())).call(p1); |
||
436 | } |
||
437 | }; |
||
438 | |||
439 | #endif |
||
440 | #endif |
||
441 | |||
442 | |||
443 | /**************************************************************** |
||
444 | ***** Abstract Slot 2 |
||
445 | ****************************************************************/ |
||
446 | |||
447 | template |
||
448 | struct Callback2:public Callback_ |
||
449 | { |
||
450 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
451 | typedef R RType; |
||
452 | #else |
||
453 | typedef Trait |
||
454 | #endif |
||
455 | typedef RType (*Func)(void*,P1,P2); |
||
456 | inline RType call(typename Trait |
||
457 | {return ((Func)(func_))((void*)this,p1,p2);} |
||
458 | inline RType operator()(typename Trait |
||
459 | {return ((Func)(func_))((void*)this,p1,p2);} |
||
460 | }; |
||
461 | |||
462 | template |
||
463 | class Slot2 |
||
464 | :public Handle |
||
465 | { |
||
466 | public: |
||
467 | typedef Handle |
||
468 | typedef Callback2 |
||
469 | typedef typename Callback::RType RType; |
||
470 | typedef RType (*Func)(void*,P1,P2); |
||
471 | |||
472 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
473 | |||
474 | Slot2() {} |
||
475 | Slot2(SlotData *s):Base(s) {} |
||
476 | Slot2(const Slot2& s):Base(s.obj()) {} |
||
477 | |||
478 | inline RType call(typename Trait |
||
479 | { |
||
480 | if (connected()) |
||
481 | return ((Callback&)(data()->callback())).call(p1,p2); |
||
482 | return RType(); |
||
483 | } |
||
484 | inline RType operator()(typename Trait |
||
485 | { |
||
486 | if (connected()) |
||
487 | return ((Callback&)(data()->callback())).call(p1,p2); |
||
488 | return RType(); |
||
489 | } |
||
490 | }; |
||
491 | |||
492 | |||
493 | #ifndef SIGC_CXX_VOID_RETURN |
||
494 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
495 | |||
496 | template |
||
497 | struct Callback2 |
||
498 | { |
||
499 | typedef void RType; |
||
500 | typedef RType (*Func)(void*,P1,P2); |
||
501 | inline RType call(typename Trait |
||
502 | {((Func)(func_))((void*)this,p1,p2);} |
||
503 | inline RType operator()(typename Trait |
||
504 | {((Func)(func_))((void*)this,p1,p2);} |
||
505 | }; |
||
506 | |||
507 | template |
||
508 | class Slot2 |
||
509 | :public Handle |
||
510 | { |
||
511 | public: |
||
512 | typedef Handle |
||
513 | typedef Callback2 |
||
514 | typedef typename Callback::RType RType; |
||
515 | typedef RType (*Func)(void*,P1,P2); |
||
516 | |||
517 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
518 | |||
519 | Slot2() {} |
||
520 | Slot2(SlotData *s):Base(s) {} |
||
521 | Slot2(const Slot2& s):Base(s.obj()) {} |
||
522 | |||
523 | inline RType call(typename Trait |
||
524 | { |
||
525 | if (connected()) |
||
526 | |||
527 | ((Callback&)(data()->callback())).call(p1,p2); |
||
528 | } |
||
529 | inline RType operator()(typename Trait |
||
530 | { |
||
531 | if (connected()) |
||
532 | |||
533 | ((Callback&)(data()->callback())).call(p1,p2); |
||
534 | } |
||
535 | }; |
||
536 | |||
537 | #endif |
||
538 | #endif |
||
539 | |||
540 | |||
541 | /**************************************************************** |
||
542 | ***** Abstract Slot 3 |
||
543 | ****************************************************************/ |
||
544 | |||
545 | template |
||
546 | struct Callback3:public Callback_ |
||
547 | { |
||
548 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
549 | typedef R RType; |
||
550 | #else |
||
551 | typedef Trait |
||
552 | #endif |
||
553 | typedef RType (*Func)(void*,P1,P2,P3); |
||
554 | inline RType call(typename Trait |
||
555 | {return ((Func)(func_))((void*)this,p1,p2,p3);} |
||
556 | inline RType operator()(typename Trait |
||
557 | {return ((Func)(func_))((void*)this,p1,p2,p3);} |
||
558 | }; |
||
559 | |||
560 | template |
||
561 | class Slot3 |
||
562 | :public Handle |
||
563 | { |
||
564 | public: |
||
565 | typedef Handle |
||
566 | typedef Callback3 |
||
567 | typedef typename Callback::RType RType; |
||
568 | typedef RType (*Func)(void*,P1,P2,P3); |
||
569 | |||
570 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
571 | |||
572 | Slot3() {} |
||
573 | Slot3(SlotData *s):Base(s) {} |
||
574 | Slot3(const Slot3& s):Base(s.obj()) {} |
||
575 | |||
576 | inline RType call(typename Trait |
||
577 | { |
||
578 | if (connected()) |
||
579 | return ((Callback&)(data()->callback())).call(p1,p2,p3); |
||
580 | return RType(); |
||
581 | } |
||
582 | inline RType operator()(typename Trait |
||
583 | { |
||
584 | if (connected()) |
||
585 | return ((Callback&)(data()->callback())).call(p1,p2,p3); |
||
586 | return RType(); |
||
587 | } |
||
588 | }; |
||
589 | |||
590 | |||
591 | #ifndef SIGC_CXX_VOID_RETURN |
||
592 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
593 | |||
594 | template |
||
595 | struct Callback3 |
||
596 | { |
||
597 | typedef void RType; |
||
598 | typedef RType (*Func)(void*,P1,P2,P3); |
||
599 | inline RType call(typename Trait |
||
600 | {((Func)(func_))((void*)this,p1,p2,p3);} |
||
601 | inline RType operator()(typename Trait |
||
602 | {((Func)(func_))((void*)this,p1,p2,p3);} |
||
603 | }; |
||
604 | |||
605 | template |
||
606 | class Slot3 |
||
607 | :public Handle |
||
608 | { |
||
609 | public: |
||
610 | typedef Handle |
||
611 | typedef Callback3 |
||
612 | typedef typename Callback::RType RType; |
||
613 | typedef RType (*Func)(void*,P1,P2,P3); |
||
614 | |||
615 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
616 | |||
617 | Slot3() {} |
||
618 | Slot3(SlotData *s):Base(s) {} |
||
619 | Slot3(const Slot3& s):Base(s.obj()) {} |
||
620 | |||
621 | inline RType call(typename Trait |
||
622 | { |
||
623 | if (connected()) |
||
624 | |||
625 | ((Callback&)(data()->callback())).call(p1,p2,p3); |
||
626 | } |
||
627 | inline RType operator()(typename Trait |
||
628 | { |
||
629 | if (connected()) |
||
630 | |||
631 | ((Callback&)(data()->callback())).call(p1,p2,p3); |
||
632 | } |
||
633 | }; |
||
634 | |||
635 | #endif |
||
636 | #endif |
||
637 | |||
638 | |||
639 | /**************************************************************** |
||
640 | ***** Abstract Slot 4 |
||
641 | ****************************************************************/ |
||
642 | |||
643 | template |
||
644 | struct Callback4:public Callback_ |
||
645 | { |
||
646 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
647 | typedef R RType; |
||
648 | #else |
||
649 | typedef Trait |
||
650 | #endif |
||
651 | typedef RType (*Func)(void*,P1,P2,P3,P4); |
||
652 | inline RType call(typename Trait |
||
653 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4);} |
||
654 | inline RType operator()(typename Trait |
||
655 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4);} |
||
656 | }; |
||
657 | |||
658 | template |
||
659 | class Slot4 |
||
660 | :public Handle |
||
661 | { |
||
662 | public: |
||
663 | typedef Handle |
||
664 | typedef Callback4 |
||
665 | typedef typename Callback::RType RType; |
||
666 | typedef RType (*Func)(void*,P1,P2,P3,P4); |
||
667 | |||
668 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
669 | |||
670 | Slot4() {} |
||
671 | Slot4(SlotData *s):Base(s) {} |
||
672 | Slot4(const Slot4& s):Base(s.obj()) {} |
||
673 | |||
674 | inline RType call(typename Trait |
||
675 | { |
||
676 | if (connected()) |
||
677 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4); |
||
678 | return RType(); |
||
679 | } |
||
680 | inline RType operator()(typename Trait |
||
681 | { |
||
682 | if (connected()) |
||
683 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4); |
||
684 | return RType(); |
||
685 | } |
||
686 | }; |
||
687 | |||
688 | |||
689 | #ifndef SIGC_CXX_VOID_RETURN |
||
690 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
691 | |||
692 | template |
||
693 | struct Callback4 |
||
694 | { |
||
695 | typedef void RType; |
||
696 | typedef RType (*Func)(void*,P1,P2,P3,P4); |
||
697 | inline RType call(typename Trait |
||
698 | {((Func)(func_))((void*)this,p1,p2,p3,p4);} |
||
699 | inline RType operator()(typename Trait |
||
700 | {((Func)(func_))((void*)this,p1,p2,p3,p4);} |
||
701 | }; |
||
702 | |||
703 | template |
||
704 | class Slot4 |
||
705 | :public Handle |
||
706 | { |
||
707 | public: |
||
708 | typedef Handle |
||
709 | typedef Callback4 |
||
710 | typedef typename Callback::RType RType; |
||
711 | typedef RType (*Func)(void*,P1,P2,P3,P4); |
||
712 | |||
713 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
714 | |||
715 | Slot4() {} |
||
716 | Slot4(SlotData *s):Base(s) {} |
||
717 | Slot4(const Slot4& s):Base(s.obj()) {} |
||
718 | |||
719 | inline RType call(typename Trait |
||
720 | { |
||
721 | if (connected()) |
||
722 | |||
723 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4); |
||
724 | } |
||
725 | inline RType operator()(typename Trait |
||
726 | { |
||
727 | if (connected()) |
||
728 | |||
729 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4); |
||
730 | } |
||
731 | }; |
||
732 | |||
733 | #endif |
||
734 | #endif |
||
735 | |||
736 | |||
737 | /**************************************************************** |
||
738 | ***** Abstract Slot 5 |
||
739 | ****************************************************************/ |
||
740 | |||
741 | template |
||
742 | struct Callback5:public Callback_ |
||
743 | { |
||
744 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
745 | typedef R RType; |
||
746 | #else |
||
747 | typedef Trait |
||
748 | #endif |
||
749 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5); |
||
750 | inline RType call(typename Trait |
||
751 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5);} |
||
752 | inline RType operator()(typename Trait |
||
753 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5);} |
||
754 | }; |
||
755 | |||
756 | template |
||
757 | class Slot5 |
||
758 | :public Handle |
||
759 | { |
||
760 | public: |
||
761 | typedef Handle |
||
762 | typedef Callback5 |
||
763 | typedef typename Callback::RType RType; |
||
764 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5); |
||
765 | |||
766 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
767 | |||
768 | Slot5() {} |
||
769 | Slot5(SlotData *s):Base(s) {} |
||
770 | Slot5(const Slot5& s):Base(s.obj()) {} |
||
771 | |||
772 | inline RType call(typename Trait |
||
773 | { |
||
774 | if (connected()) |
||
775 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5); |
||
776 | return RType(); |
||
777 | } |
||
778 | inline RType operator()(typename Trait |
||
779 | { |
||
780 | if (connected()) |
||
781 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5); |
||
782 | return RType(); |
||
783 | } |
||
784 | }; |
||
785 | |||
786 | |||
787 | #ifndef SIGC_CXX_VOID_RETURN |
||
788 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
789 | |||
790 | template |
||
791 | struct Callback5 |
||
792 | { |
||
793 | typedef void RType; |
||
794 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5); |
||
795 | inline RType call(typename Trait |
||
796 | {((Func)(func_))((void*)this,p1,p2,p3,p4,p5);} |
||
797 | inline RType operator()(typename Trait |
||
798 | {((Func)(func_))((void*)this,p1,p2,p3,p4,p5);} |
||
799 | }; |
||
800 | |||
801 | template |
||
802 | class Slot5 |
||
803 | :public Handle |
||
804 | { |
||
805 | public: |
||
806 | typedef Handle |
||
807 | typedef Callback5 |
||
808 | typedef typename Callback::RType RType; |
||
809 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5); |
||
810 | |||
811 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
812 | |||
813 | Slot5() {} |
||
814 | Slot5(SlotData *s):Base(s) {} |
||
815 | Slot5(const Slot5& s):Base(s.obj()) {} |
||
816 | |||
817 | inline RType call(typename Trait |
||
818 | { |
||
819 | if (connected()) |
||
820 | |||
821 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5); |
||
822 | } |
||
823 | inline RType operator()(typename Trait |
||
824 | { |
||
825 | if (connected()) |
||
826 | |||
827 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5); |
||
828 | } |
||
829 | }; |
||
830 | |||
831 | #endif |
||
832 | #endif |
||
833 | |||
834 | |||
835 | /**************************************************************** |
||
836 | ***** Abstract Slot 6 |
||
837 | ****************************************************************/ |
||
838 | |||
839 | template |
||
840 | struct Callback6:public Callback_ |
||
841 | { |
||
842 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
843 | typedef R RType; |
||
844 | #else |
||
845 | typedef Trait |
||
846 | #endif |
||
847 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6); |
||
848 | inline RType call(typename Trait |
||
849 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);} |
||
850 | inline RType operator()(typename Trait |
||
851 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);} |
||
852 | }; |
||
853 | |||
854 | template |
||
855 | class Slot6 |
||
856 | :public Handle |
||
857 | { |
||
858 | public: |
||
859 | typedef Handle |
||
860 | typedef Callback6 |
||
861 | typedef typename Callback::RType RType; |
||
862 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6); |
||
863 | |||
864 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
865 | |||
866 | Slot6() {} |
||
867 | Slot6(SlotData *s):Base(s) {} |
||
868 | Slot6(const Slot6& s):Base(s.obj()) {} |
||
869 | |||
870 | inline RType call(typename Trait |
||
871 | { |
||
872 | if (connected()) |
||
873 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6); |
||
874 | return RType(); |
||
875 | } |
||
876 | inline RType operator()(typename Trait |
||
877 | { |
||
878 | if (connected()) |
||
879 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6); |
||
880 | return RType(); |
||
881 | } |
||
882 | }; |
||
883 | |||
884 | |||
885 | #ifndef SIGC_CXX_VOID_RETURN |
||
886 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
887 | |||
888 | template |
||
889 | struct Callback6 |
||
890 | { |
||
891 | typedef void RType; |
||
892 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6); |
||
893 | inline RType call(typename Trait |
||
894 | {((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);} |
||
895 | inline RType operator()(typename Trait |
||
896 | {((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);} |
||
897 | }; |
||
898 | |||
899 | template |
||
900 | class Slot6 |
||
901 | :public Handle |
||
902 | { |
||
903 | public: |
||
904 | typedef Handle |
||
905 | typedef Callback6 |
||
906 | typedef typename Callback::RType RType; |
||
907 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6); |
||
908 | |||
909 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
910 | |||
911 | Slot6() {} |
||
912 | Slot6(SlotData *s):Base(s) {} |
||
913 | Slot6(const Slot6& s):Base(s.obj()) {} |
||
914 | |||
915 | inline RType call(typename Trait |
||
916 | { |
||
917 | if (connected()) |
||
918 | |||
919 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6); |
||
920 | } |
||
921 | inline RType operator()(typename Trait |
||
922 | { |
||
923 | if (connected()) |
||
924 | |||
925 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6); |
||
926 | } |
||
927 | }; |
||
928 | |||
929 | #endif |
||
930 | #endif |
||
931 | |||
932 | |||
933 | /**************************************************************** |
||
934 | ***** Abstract Slot 7 |
||
935 | ****************************************************************/ |
||
936 | |||
937 | template |
||
938 | struct Callback7:public Callback_ |
||
939 | { |
||
940 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
941 | typedef R RType; |
||
942 | #else |
||
943 | typedef Trait |
||
944 | #endif |
||
945 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7); |
||
946 | inline RType call(typename Trait |
||
947 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);} |
||
948 | inline RType operator()(typename Trait |
||
949 | {return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);} |
||
950 | }; |
||
951 | |||
952 | template |
||
953 | class Slot7 |
||
954 | :public Handle |
||
955 | { |
||
956 | public: |
||
957 | typedef Handle |
||
958 | typedef Callback7 |
||
959 | typedef typename Callback::RType RType; |
||
960 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7); |
||
961 | |||
962 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
963 | |||
964 | Slot7() {} |
||
965 | Slot7(SlotData *s):Base(s) {} |
||
966 | Slot7(const Slot7& s):Base(s.obj()) {} |
||
967 | |||
968 | inline RType call(typename Trait |
||
969 | { |
||
970 | if (connected()) |
||
971 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7); |
||
972 | return RType(); |
||
973 | } |
||
974 | inline RType operator()(typename Trait |
||
975 | { |
||
976 | if (connected()) |
||
977 | return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7); |
||
978 | return RType(); |
||
979 | } |
||
980 | }; |
||
981 | |||
982 | |||
983 | #ifndef SIGC_CXX_VOID_RETURN |
||
984 | #ifdef SIGC_CXX_PARTIAL_SPEC |
||
985 | |||
986 | template |
||
987 | struct Callback7 |
||
988 | { |
||
989 | typedef void RType; |
||
990 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7); |
||
991 | inline RType call(typename Trait |
||
992 | {((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);} |
||
993 | inline RType operator()(typename Trait |
||
994 | {((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);} |
||
995 | }; |
||
996 | |||
997 | template |
||
998 | class Slot7 |
||
999 | :public Handle |
||
1000 | { |
||
1001 | public: |
||
1002 | typedef Handle |
||
1003 | typedef Callback7 |
||
1004 | typedef typename Callback::RType RType; |
||
1005 | typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7); |
||
1006 | |||
1007 | SlotData* data() const {return (SlotData*)(scope_.object());} |
||
1008 | |||
1009 | Slot7() {} |
||
1010 | Slot7(SlotData *s):Base(s) {} |
||
1011 | Slot7(const Slot7& s):Base(s.obj()) {} |
||
1012 | |||
1013 | inline RType call(typename Trait |
||
1014 | { |
||
1015 | if (connected()) |
||
1016 | |||
1017 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7); |
||
1018 | } |
||
1019 | inline RType operator()(typename Trait |
||
1020 | { |
||
1021 | if (connected()) |
||
1022 | |||
1023 | ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7); |
||
1024 | } |
||
1025 | }; |
||
1026 | |||
1027 | #endif |
||
1028 | #endif |
||
1029 | |||
1030 | |||
1031 | |||
1032 | #ifdef SIGC_CXX_NAMESPACES |
||
1033 | } // namespace |
||
1034 | #endif |
||
1035 | |||
1036 | #endif // SIGCXX_SLOT_H>> |