Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# slot.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *  Copyright (C) 2000 Red Hat, Inc.
    00004  *  Copyright 1999, Karl Einar Nelson
    00005  *
    00006  *  This program is free software; you can redistribute it and/or modify
    00007  *  it under the terms of the GNU General Public License as published by
    00008  *  the Free Software Foundation; either version 2 of the License, or
    00009  *  (at your option) any later version.
    00010  *
    00011  *  This program is distributed in the hope that it will be useful,
    00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00014  *  GNU Library General Public License for more details.
    00015  *
    00016  *  You should have received a copy of the GNU Library General Public License
    00017  *  along with this program; if not, write to the Free Software
    00018  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00019  */
    00020
    00027
    00028 #ifndef INTI_SLOT_H
    00029 #define INTI_SLOT_H
    00030
    00031 #ifndef INTI_OBJECT_H
    00032 #include <inti/object.h>
    00033 #endif
    00034
    00035 namespace Inti {
    00036
    00039
    00042
    00043 class Slot : public ReferencedObject
    00044 {
    00045         Slot(const Slot&);
    00046         Slot& operator=(const Slot&);
    00047
    00048 protected:
    00049         Slot();
    00051
    00052         virtual ~Slot() = 0;
    00054 };
    00055
    00058
    00059 template <typename R>
    00060 class Slot0 : public Slot
    00061 {
    00062 protected:
    00063         Slot0() {}
    00065
    00066 public:
    00067         virtual R call() const = 0;
    00069
    00070         R operator()() const { return call(); }
    00072 };
    00073
    00076
    00077 template <typename R>
    00078 class FunctionSlot0 : public Slot0<R>
    00079 {
    00080         typedef R (*PF)();
    00081         PF pf;
    00082
    00083 public:
    00084         FunctionSlot0(PF function) : pf(function) {}
    00087
    00088         virtual R call() const { return (*pf)(); }
    00091 };
    00092
    00100
    00101 template <typename R>
    00102 inline Slot0<R>*
    00103 slot(R (*function)())
    00104 {
    00105         return new FunctionSlot0<R>(function);
    00106 }
    00107
    00110
    00111 template <typename T, typename R>
    00112 class MethodSlot0 : public Slot0<R>
    00113 {
    00114         typedef R (T::*PMF)();
    00115         PMF pmf;
    00116         T *t;
    00117
    00118 public:
    00119         MethodSlot0(T *object, PMF function) : pmf(function), t(object) {}
    00123
    00124         virtual R call() const { return (t->*pmf)(); }
    00127 };
    00128
    00138
    00139 template <typename T1, typename T2, typename R>
    00140 inline Slot0<R>*
    00141 slot(T1* &object, R (T2::*function)())
    00142 {
    00143         return new MethodSlot0<T2, R>(object, function);
    00144 }
    00145
    00155
    00156 template <typename T1, typename T2, typename R>
    00157 inline Slot0<R>*
    00158 slot(T1* const &object, R (T2::*function)())
    00159 {
    00160         return new MethodSlot0<T2, R>(object, function);
    00161 }
    00162
    00172
    00173 template <typename T1, typename T2, typename R>
    00174 inline Slot0<R>*
    00175 slot(T1& object, R (T2::*function)())
    00176 {
    00177         return new MethodSlot0<T2, R>(&object, function);
    00178 }
    00179
    00180 /*  SignalSlot0
    00181  */
    00182
    00183 template <typename T, typename R>
    00184 class SignalSlot0 : public Slot0<R>
    00185 {
    00186         typedef R (*PF)(void*);
    00187         PF pf;
    00188         T *t;
    00189
    00190 public:
    00191         SignalSlot0(T *signal, PF function) : pf(function), t(signal) {}
    00192
    00193         virtual R call() const { return (*pf)(t); }
    00194 };
    00195
    00198
    00199 template <typename R, typename P1>
    00200 class Slot1 : public Slot
    00201 {
    00202 protected:
    00203         Slot1() {}
    00205
    00206 public:
    00207         virtual R call(P1 p1) const = 0;
    00209
    00210         R operator()(P1 p1) const { return call(p1); }
    00212 };
    00213
    00217
    00218 template <typename R, typename P1>
    00219 class FunctionSlot1 : public Slot1<R, P1>
    00220 {
    00221         typedef R (*PF)(P1);
    00222         PF pf;
    00223
    00224 public:
    00225         FunctionSlot1(PF function) : pf(function) {}
    00228
    00229         virtual R call(P1 p1) const { return (*pf)(p1); }
    00232 };
    00233
    00241
    00242 template <typename R, typename P1>
    00243 inline Slot1<R, P1>*
    00244 slot(R (*function)(P1))
    00245 {
    00246         return new FunctionSlot1<R, P1>(function);
    00247 }
    00248
    00252
    00253 template <typename T, typename R, typename P1>
    00254 class MethodSlot1 : public Slot1<R, P1>
    00255 {
    00256         typedef R (T::*PMF)(P1);
    00257         PMF pmf;
    00258         T *t;
    00259
    00260 public:
    00261         MethodSlot1(T *object, PMF function) : pmf(function), t(object) {}
    00265
    00266         virtual R call(P1 p1) const { return (t->*pmf)(p1); }
    00269 };
    00270
    00280
    00281 template <typename T1, typename T2, typename R, typename P1>
    00282 inline Slot1<R, P1>*
    00283 slot(T1* &object, R (T2::*function)(P1))
    00284 {
    00285         return new MethodSlot1<T2, R, P1>(object, function);
    00286 }
    00287
    00297
    00298 template <typename T1, typename T2, typename R, typename P1>
    00299 inline Slot1<R, P1>*
    00300 slot(T1* const &object, R (T2::*function)(P1))
    00301 {
    00302         return new MethodSlot1<T2, R, P1>(object, function);
    00303 }
    00304
    00314
    00315 template <typename T1, typename T2, typename R, typename P1>
    00316 inline Slot1<R, P1>*
    00317 slot(T1& object, R (T2::*function)(P1))
    00318 {
    00319         return new MethodSlot1<T2, R, P1>(&object, function);
    00320 }
    00321
    00322 /*  SignalSlot1
    00323  */
    00324
    00325 template <typename T, typename R, typename P1>
    00326 class SignalSlot1 : public Slot1<R, P1>
    00327 {
    00328         typedef R (*PF)(void*, P1);
    00329         PF pf;
    00330         T *t;
    00331
    00332 public:
    00333         SignalSlot1(T *signal, PF function) : pf(function), t(signal) {}
    00334
    00335         virtual R call(P1 p1) const { return (*pf)(t, p1); }
    00336 };
    00337
    00341
    00342 template <typename R, typename P1, typename P2>
    00343 class Slot2 : public Slot
    00344 {
    00345 protected:
    00346         Slot2() {}
    00348
    00349 public:
    00350         virtual R call(P1 p1, P2 p2) const = 0;
    00352
    00353         R operator()(P1 p1, P2 p2) const { return call(p1, p2); }
    00355 };
    00356
    00360
    00361 template <typename R, typename P1, typename P2>
    00362 class FunctionSlot2 : public Slot2<R, P1, P2>
    00363 {
    00364         typedef R (*PF)(P1, P2);
    00365         PF pf;
    00366
    00367 public:
    00368         FunctionSlot2(PF function) : pf(function) {}
    00371
    00372         virtual R call(P1 p1, P2 p2) const { return (*pf)(p1, p2); }
    00375 };
    00376
    00384
    00385 template <typename R, typename P1, typename P2>
    00386 inline Slot2<R, P1, P2>*
    00387 slot(R (*function)(P1, P2))
    00388 {
    00389         return new FunctionSlot2<R, P1, P2>(function);
    00390 }
    00391
    00395
    00396 template <typename T, typename R, typename P1, typename P2>
    00397 class MethodSlot2 : public Slot2<R, P1, P2>
    00398 {
    00399         typedef R (T::*PMF)(P1, P2);
    00400         PMF pmf;
    00401         T *t;
    00402
    00403 public:
    00404         MethodSlot2(T *object, PMF function) : pmf(function), t(object) {}
    00408
    00409         virtual R call(P1 p1, P2 p2) const { return (t->*pmf)(p1, p2); }
    00412 };
    00413
    00423
    00424 template <typename T1, typename T2, typename R, typename P1, typename P2>
    00425 inline Slot2<R, P1, P2>*
    00426 slot(T1* &object, R (T2::*function)(P1, P2))
    00427 {
    00428         return new MethodSlot2<T2, R, P1, P2>(object, function);
    00429 }
    00430
    00440
    00441 template <typename T1, typename T2, typename R, typename P1, typename P2>
    00442 inline Slot2<R, P1, P2>*
    00443 slot(T1* const &object, R (T2::*function)(P1, P2))
    00444 {
    00445         return new MethodSlot2<T2, R, P1, P2>(object, function);
    00446 }
    00447
    00457
    00458 template <typename T1, typename T2, typename R, typename P1, typename P2>
    00459 inline Slot2<R, P1, P2>*
    00460 slot(T1& object, R (T2::*function)(P1, P2))
    00461 {
    00462         return new MethodSlot2<T2, R, P1, P2>(&object, function);
    00463 }
    00464
    00465 /*  SignalSlot2
    00466  */
    00467
    00468 template <typename T, typename R, typename P1, typename P2>
    00469 class SignalSlot2 : public Slot2<R, P1, P2>
    00470 {
    00471         typedef R (*PF)(void*, P1, P2);
    00472         PF pf;
    00473         T *t;
    00474
    00475 public:
    00476         SignalSlot2(T *signal, PF function) : pf(function), t(signal) {}
    00477
    00478         virtual R call(P1 p1, P2 p2) const { return (*pf)(t, p1, p2); }
    00479 };
    00480
    00484
    00485 template <typename R, typename P1, typename P2, typename P3>
    00486 class Slot3 : public Slot
    00487 {
    00488 protected:
    00489         Slot3() {}
    00491
    00492 public:
    00493         virtual R call(P1 p1, P2 p2, P3 p3) const = 0;
    00495
    00496         R operator()(P1 p1, P2 p2, P3 p3) const { return call(p1, p2, p3); }
    00498 };
    00499
    00503
    00504 template <typename R, typename P1, typename P2, typename P3>
    00505 class FunctionSlot3 : public Slot3<R, P1, P2, P3>
    00506 {
    00507         typedef R (*PF)(P1, P2, P3);
    00508         PF pf;
    00509
    00510 public:
    00511         FunctionSlot3(PF function) : pf(function) {}
    00514
    00515         virtual R call(P1 p1, P2 p2, P3 p3) const { return (*pf)(p1, p2, p3); }
    00518 };
    00519
    00527
    00528 template <typename R, typename P1, typename P2, typename P3>
    00529 inline Slot3<R, P1, P2, P3>*
    00530 slot(R (*function)(P1, P2, P3))
    00531 {
    00532         return new FunctionSlot3<R, P1, P2, P3>(function);
    00533 }
    00534
    00538
    00539 template <typename T, typename R, typename P1, typename P2, typename P3>
    00540 class MethodSlot3 : public Slot3<R, P1, P2, P3>
    00541 {
    00542         typedef R (T::*PMF)(P1, P2, P3);
    00543         PMF pmf;
    00544         T *t;
    00545
    00546 public:
    00547         MethodSlot3(T *object, PMF function) : pmf(function), t(object) {}
    00551
    00552         virtual R call(P1 p1, P2 p2, P3 p3) const { return (t->*pmf)(p1, p2, p3); }
    00555 };
    00556
    00566
    00567 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3>
    00568 inline Slot3<R, P1, P2, P3>*
    00569 slot(T1* &object, R (T2::*function)(P1, P2, P3))
    00570 {
    00571         return new MethodSlot3<T2, R, P1, P2, P3>(object, function);
    00572 }
    00573
    00583
    00584 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3>
    00585 inline Slot3<R, P1, P2, P3>*
    00586 slot(T1* const &object, R (T2::*function)(P1, P2, P3))
    00587 {
    00588         return new MethodSlot3<T2, R, P1, P2, P3>(object, function);
    00589 }
    00590
    00600
    00601 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3>
    00602 inline Slot3<R, P1, P2, P3>*
    00603 slot(T1& object, R (T2::*function)(P1, P2, P3))
    00604 {
    00605         return new MethodSlot3<T2, R, P1, P2, P3>(&object, function);
    00606 }
    00607
    00608 /*  SignalSlot3
    00609  */
    00610
    00611 template <typename T, typename R, typename P1, typename P2, typename P3>
    00612 class SignalSlot3 : public Slot3<R, P1, P2, P3>
    00613 {
    00614         typedef R (*PF)(void*, P1, P2, P3);
    00615         PF pf;
    00616         T *t;
    00617
    00618 public:
    00619         SignalSlot3(T *signal, PF function) : pf(function), t(signal) {}
    00620
    00621         virtual R call(P1 p1, P2 p2, P3 p3) const { return (*pf)(t, p1, p2, p3); }
    00622 };
    00623
    00627
    00628 template <typename R, typename P1, typename P2, typename P3, typename P4>
    00629 class Slot4 : public Slot
    00630 {
    00631 protected:
    00632         Slot4() {}
    00634
    00635 public:
    00636         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4) const = 0;
    00638
    00639         R operator()(P1 p1, P2 p2, P3 p3, P4 p4) const { return call(p1, p2, p3, p4); }
    00641 };
    00642
    00646
    00647 template <typename R, typename P1, typename P2, typename P3, typename P4>
    00648 class FunctionSlot4 : public Slot4<R, P1, P2, P3, P4>
    00649 {
    00650         typedef R (*PF)(P1, P2, P3, P4);
    00651         PF pf;
    00652
    00653 public:
    00654         FunctionSlot4(PF function) : pf(function) {}
    00657
    00658         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4) const { return (*pf)(p1, p2, p3, p4); }
    00661 };
    00662
    00670
    00671 template <typename R, typename P1, typename P2, typename P3, typename P4>
    00672 inline Slot4<R, P1, P2, P3, P4>*
    00673 slot(R (*function)(P1, P2, P3, P4))
    00674 {
    00675         return new FunctionSlot4<R, P1, P2, P3, P4>(function);
    00676 }
    00677
    00681
    00682 template <typename T, typename R, typename P1, typename P2, typename P3, typename P4>
    00683 class MethodSlot4 : public Slot4<R, P1, P2, P3, P4>
    00684 {
    00685         typedef R (T::*PMF)(P1, P2, P3, P4);
    00686         PMF pmf;
    00687         T *t;
    00688
    00689 public:
    00690         MethodSlot4(T *object, PMF function) : pmf(function), t(object) {}
    00694
    00695         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4) const { return (t->*pmf)(p1, p2, p3, p4); }
    00698 };
    00699
    00709
    00710 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4>
    00711 inline Slot4<R, P1, P2, P3, P4>*
    00712 slot(T1* &object, R (T2::*function)(P1, P2, P3, P4))
    00713 {
    00714         return new MethodSlot4<T2, R, P1, P2, P3, P4>(object, function);
    00715 }
    00716
    00726
    00727 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4>
    00728 inline Slot4<R, P1, P2, P3, P4>*
    00729 slot(T1* const &object, R (T2::*function)(P1, P2, P3, P4))
    00730 {
    00731         return new MethodSlot4<T2, R, P1, P2, P3, P4>(object, function);
    00732 }
    00733
    00743
    00744 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4>
    00745 inline Slot4<R, P1, P2, P3, P4>*
    00746 slot(T1& object, R (T2::*function)(P1, P2, P3, P4))
    00747 {
    00748         return new MethodSlot4<T2, R, P1, P2, P3, P4>(&object, function);
    00749 }
    00750
    00751 /*  SignalSlot4
    00752  */
    00753
    00754 template <typename T, typename R, typename P1, typename P2, typename P3, typename P4>
    00755 class SignalSlot4 : public Slot4<R, P1, P2, P3, P4>
    00756 {
    00757         typedef R (*PF)(void*, P1, P2, P3, P4);
    00758         PF pf;
    00759         T *t;
    00760
    00761 public:
    00762         SignalSlot4(T *signal, PF function) : pf(function), t(signal) {}
    00763
    00764         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4) const { return (*pf)(t, p1, p2, p3, p4); }
    00765 };
    00766
    00770
    00771 template <typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00772 class Slot5 : public Slot
    00773 {
    00774 protected:
    00775         Slot5() {}
    00776
    00777 public:
    00778         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const = 0;
    00780
    00781         R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const { return call(p1, p2, p3, p4, p5); }
    00783 };
    00784
    00788
    00789 template <typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00790 class FunctionSlot5 : public Slot5<R, P1, P2, P3, P4, P5>
    00791 {
    00792         typedef R (*PF)(P1, P2, P3, P4, P5);
    00793         PF pf;
    00794
    00795 public:
    00796         FunctionSlot5(PF function) : pf(function) {}
    00799
    00800         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const { return (*pf)(p1, p2, p3, p4, p5); }
    00803 };
    00804
    00812
    00813 template <typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00814 inline Slot5<R, P1, P2, P3, P4, P5>*
    00815 slot(R (*function)(P1, P2, P3, P4, P5))
    00816 {
    00817         return new FunctionSlot5<R, P1, P2, P3, P4, P5>(function);
    00818 }
    00819
    00823
    00824 template <typename T, typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00825 class MethodSlot5 : public Slot5<R, P1, P2, P3, P4, P5>
    00826 {
    00827         typedef R (T::*PMF)(P1, P2, P3, P4, P5);
    00828         PMF pmf;
    00829         T *t;
    00830
    00831 public:
    00832         MethodSlot5(T *object, PMF function) : pmf(function), t(object) {}
    00836
    00837         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const { return (t->*pmf)(p1, p2, p3, p4, p5); }
    00840 };
    00841
    00851
    00852 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00853 inline Slot5<R, P1, P2, P3, P4, P5>*
    00854 slot(T1* &object, R (T2::*function)(P1, P2, P3, P4, P5))
    00855 {
    00856         return new MethodSlot5<T2, R, P1, P2, P3, P4, P5>(object, function);
    00857 }
    00858
    00868
    00869 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00870 inline Slot5<R, P1, P2, P3, P4, P5>*
    00871 slot(T1* const &object, R (T2::*function)(P1, P2, P3, P4, P5))
    00872 {
    00873         return new MethodSlot5<T2, R, P1, P2, P3, P4, P5>(object, function);
    00874 }
    00875
    00885
    00886 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00887 inline Slot5<R, P1, P2, P3, P4, P5>*
    00888 slot(T1& object, R (T2::*function)(P1, P2, P3, P4, P5))
    00889 {
    00890         return new MethodSlot5<T2, R, P1, P2, P3, P4, P5>(&object, function);
    00891 }
    00892
    00893 /*  SignalSlot5
    00894  */
    00895
    00896 template <typename T, typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
    00897 class SignalSlot5 : public Slot5<R, P1, P2, P3, P4, P5>
    00898 {
    00899         typedef R (*PF)(void*, P1, P2, P3, P4, P5);
    00900         PF pf;
    00901         T *t;
    00902
    00903 public:
    00904         SignalSlot5(T *signal, PF function) : pf(function), t(signal) {}
    00905
    00906         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const { return (*pf)(t, p1, p2, p3, p4, p5); }
    00907 };
    00908
    00912
    00913 template <typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    00914 class Slot6 : public Slot
    00915 {
    00916 protected:
    00917         Slot6() {}
    00919
    00920 public:
    00921         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const = 0;
    00923
    00924         R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const { return call(p1, p2, p3, p4, p5, p6); }
    00926 };
    00927
    00931
    00932 template <typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    00933 class FunctionSlot6 : public Slot6<R, P1, P2, P3, P4, P5, P6>
    00934 {
    00935         typedef R (*PF)(P1, P2, P3, P4, P5, P6);
    00936         PF pf;
    00937
    00938 public:
    00939         FunctionSlot6(PF function) : pf(function) {}
    00942
    00943         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const { return (*pf)(p1, p2, p3, p4, p5, p6); }
    00946 };
    00947
    00955
    00956 template <typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    00957 inline Slot6<R, P1, P2, P3, P4, P5, P6>*
    00958 slot(R (*function)(P1, P2, P3, P4, P5, P6))
    00959 {
    00960         return new FunctionSlot6<R, P1, P2, P3, P4, P5, P6>(function);
    00961 }
    00962
    00966
    00967 template <typename T, typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    00968 class MethodSlot6 : public Slot6<R, P1, P2, P3, P4, P5, P6>
    00969 {
    00970         typedef R (T::*PMF)(P1, P2, P3, P4, P5, P6);
    00971         PMF pmf;
    00972         T *t;
    00973
    00974 public:
    00975         MethodSlot6(T *object, PMF function) : pmf(function), t(object) {}
    00979
    00980         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const { return (t->*pmf)(p1, p2, p3, p4, p5, p6); }
    00983 };
    00984
    00994
    00995 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    00996 inline Slot6<R, P1, P2, P3, P4, P5, P6>*
    00997 slot(T1* &object, R (T2::*function)(P1, P2, P3, P4, P5, P6))
    00998 {
    00999         return new MethodSlot6<T2, R, P1, P2, P3, P4, P5, P6>(object, function);
    01000 }
    01001
    01011
    01012 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    01013 inline Slot6<R, P1, P2, P3, P4, P5, P6>*
    01014 slot(T1* const &object, R (T2::*function)(P1, P2, P3, P4, P5, P6))
    01015 {
    01016         return new MethodSlot6<T2, R, P1, P2, P3, P4, P5, P6>(object, function);
    01017 }
    01018
    01028
    01029 template <typename T1, typename T2, typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    01030 inline Slot6<R, P1, P2, P3, P4, P5, P6>*
    01031 slot(T1& object, R (T2::*function)(P1, P2, P3, P4, P5, P6))
    01032 {
    01033         return new MethodSlot6<T2, R, P1, P2, P3, P4, P5, P6>(&object, function);
    01034 }
    01035
    01036 /*  SignalSlot6
    01037  */
    01038
    01039 template <typename T, typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
    01040 class SignalSlot6 : public Slot6<R, P1, P2, P3, P4, P5, P6>
    01041 {
    01042         typedef R (*PF)(void*, P1, P2, P3, P4, P5, P6);
    01043         PF pf;
    01044         T *t;
    01045
    01046 public:
    01047         SignalSlot6(T *signal, PF function) : pf(function), t(signal) {}
    01048
    01049         virtual R call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const { return (*pf)(t, p1, p2, p3, p4, p5, p6); }
    01050 };
    01051
    01053
    01054 } // namespace Inti
    01055
    01056 #endif // INTI_SLOT_H
    01057

Main Page - Footer