aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/signals.h
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/signals.h')
-rw-r--r--bootstrap/signals.h774
1 files changed, 773 insertions, 1 deletions
diff --git a/bootstrap/signals.h b/bootstrap/signals.h
index 875f16e..5b06903 100644
--- a/bootstrap/signals.h
+++ b/bootstrap/signals.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved. 2 * Copyright (C) 2007-2014 Xagasoft, All rights reserved.
3 * 3 *
4 * This file is part of the libbu++ library and is released under the 4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
@@ -8,8 +8,10 @@
8#ifndef BU_SIGNALS_H 8#ifndef BU_SIGNALS_H
9#define BU_SIGNALS_H 9#define BU_SIGNALS_H
10 10
11#include <typeinfo>
11#include "bu/util.h" 12#include "bu/util.h"
12#include "bu/exceptionbase.h" 13#include "bu/exceptionbase.h"
14#include "bu/list.h"
13 15
14namespace Bu 16namespace Bu
15{ 17{
@@ -28,6 +30,7 @@ namespace Bu
28 virtual ~_Slot0() { } 30 virtual ~_Slot0() { }
29 virtual ret operator()( )=0; 31 virtual ret operator()( )=0;
30 virtual _Slot0<ret> *clone() const=0; 32 virtual _Slot0<ret> *clone() const=0;
33 virtual bool operator==( const _Slot0<ret> &rhs ) const=0;
31 }; 34 };
32 35
33 template<typename cls, typename ret> 36 template<typename cls, typename ret>
@@ -48,6 +51,12 @@ namespace Bu
48 return new __Slot0<cls, ret>( pCls, pFnc ); 51 return new __Slot0<cls, ret>( pCls, pFnc );
49 } 52 }
50 53
54 virtual bool operator==( const _Slot0<ret> &rhs ) const
55 {
56 const __Slot0<cls, ret> &rrhs = (const __Slot0<cls, ret> &)rhs;
57 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
58 }
59
51 private: 60 private:
52 cls *pCls; 61 cls *pCls;
53 ret (cls::*pFnc)( ); 62 ret (cls::*pFnc)( );
@@ -71,6 +80,11 @@ namespace Bu
71 return new __Slot0F<ret>( pFnc ); 80 return new __Slot0F<ret>( pFnc );
72 } 81 }
73 82
83 virtual bool operator==( const _Slot0<ret> &rhs ) const
84 {
85 return pFnc == ((const __Slot0F<ret> &)rhs).pFnc;
86 }
87
74 private: 88 private:
75 ret (*pFnc)( ); 89 ret (*pFnc)( );
76 }; 90 };
@@ -100,6 +114,17 @@ namespace Bu
100 return *this; 114 return *this;
101 } 115 }
102 116
117 bool operator==( const Signal0<ret> &rhs ) const
118 {
119 if( pCb == rhs.pCb )
120 return true;
121 if( pCb == NULL || rhs.pCb == NULL )
122 return false;
123 if( typeid(pCb) != typeid(rhs.pCb) )
124 return false;
125 return *pCb == *rhs.pCb;
126 }
127
103 private: 128 private:
104 _Slot0<ret> *pCb; 129 _Slot0<ret> *pCb;
105 }; 130 };
@@ -121,6 +146,53 @@ namespace Bu
121 new __Slot0F<ret>( pFnc ) 146 new __Slot0F<ret>( pFnc )
122 ); 147 );
123 } 148 }
149
150 template<typename ret>
151 class SignalList0 : public Bu::List<Bu::Signal0<ret> >
152 {
153 typedef Bu::List<Bu::Signal0<ret> > MyType;
154 public:
155 SignalList0()
156 {
157 }
158
159 using typename Bu::List<Bu::Signal0<ret> >::iterator;
160 using typename Bu::List<Bu::Signal0<ret> >::const_iterator;
161
162 ret operator()( )
163 {
164 typename MyType::iterator i, n;
165 for(i = MyType::begin(); i; i=n)
166 {
167 n = i;
168 n++;
169 if( n )
170 (*i)( );
171 else
172 return (*i)( );
173 }
174 throw Bu::SignalException("Empty SignalList with non-void return value called.");
175 }
176 };
177
178 template<>
179 class SignalList0<void> : public Bu::List<Bu::Signal0<void> >
180 {
181 typedef Bu::List<Bu::Signal0<void> > MyType;
182 public:
183 SignalList0()
184 {
185 }
186
187 using typename Bu::List<Bu::Signal0<void> >::iterator;
188 using typename Bu::List<Bu::Signal0<void> >::const_iterator;
189
190 void operator()( )
191 {
192 for( typename MyType::iterator i = MyType::begin(); i; i++ )
193 (*i)( );
194 }
195 };
124#endif // BU_SIGNAL_PARAM_COUNT_0 196#endif // BU_SIGNAL_PARAM_COUNT_0
125 197
126#ifndef BU_SIGNAL_PARAM_COUNT_1 198#ifndef BU_SIGNAL_PARAM_COUNT_1
@@ -136,6 +208,7 @@ namespace Bu
136 virtual ~_Slot1() { } 208 virtual ~_Slot1() { }
137 virtual ret operator()( p1t p1 )=0; 209 virtual ret operator()( p1t p1 )=0;
138 virtual _Slot1<ret, p1t> *clone() const=0; 210 virtual _Slot1<ret, p1t> *clone() const=0;
211 virtual bool operator==( const _Slot1<ret, p1t> &rhs ) const=0;
139 }; 212 };
140 213
141 template<typename cls, typename ret, typename p1t> 214 template<typename cls, typename ret, typename p1t>
@@ -156,6 +229,12 @@ namespace Bu
156 return new __Slot1<cls, ret, p1t>( pCls, pFnc ); 229 return new __Slot1<cls, ret, p1t>( pCls, pFnc );
157 } 230 }
158 231
232 virtual bool operator==( const _Slot1<ret, p1t> &rhs ) const
233 {
234 const __Slot1<cls, ret, p1t> &rrhs = (const __Slot1<cls, ret, p1t> &)rhs;
235 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
236 }
237
159 private: 238 private:
160 cls *pCls; 239 cls *pCls;
161 ret (cls::*pFnc)( p1t ); 240 ret (cls::*pFnc)( p1t );
@@ -179,6 +258,11 @@ namespace Bu
179 return new __Slot1F<ret, p1t>( pFnc ); 258 return new __Slot1F<ret, p1t>( pFnc );
180 } 259 }
181 260
261 virtual bool operator==( const _Slot1<ret, p1t> &rhs ) const
262 {
263 return pFnc == ((const __Slot1F<ret, p1t> &)rhs).pFnc;
264 }
265
182 private: 266 private:
183 ret (*pFnc)( p1t ); 267 ret (*pFnc)( p1t );
184 }; 268 };
@@ -208,6 +292,17 @@ namespace Bu
208 return *this; 292 return *this;
209 } 293 }
210 294
295 bool operator==( const Signal1<ret, p1t> &rhs ) const
296 {
297 if( pCb == rhs.pCb )
298 return true;
299 if( pCb == NULL || rhs.pCb == NULL )
300 return false;
301 if( typeid(pCb) != typeid(rhs.pCb) )
302 return false;
303 return *pCb == *rhs.pCb;
304 }
305
211 private: 306 private:
212 _Slot1<ret, p1t> *pCb; 307 _Slot1<ret, p1t> *pCb;
213 }; 308 };
@@ -229,6 +324,53 @@ namespace Bu
229 new __Slot1F<ret, p1t>( pFnc ) 324 new __Slot1F<ret, p1t>( pFnc )
230 ); 325 );
231 } 326 }
327
328 template<typename ret, typename p1t>
329 class SignalList1 : public Bu::List<Bu::Signal1<ret, p1t> >
330 {
331 typedef Bu::List<Bu::Signal1<ret, p1t> > MyType;
332 public:
333 SignalList1()
334 {
335 }
336
337 using typename Bu::List<Bu::Signal1<ret, p1t> >::iterator;
338 using typename Bu::List<Bu::Signal1<ret, p1t> >::const_iterator;
339
340 ret operator()( p1t p1 )
341 {
342 typename MyType::iterator i, n;
343 for(i = MyType::begin(); i; i=n)
344 {
345 n = i;
346 n++;
347 if( n )
348 (*i)( p1 );
349 else
350 return (*i)( p1 );
351 }
352 throw Bu::SignalException("Empty SignalList with non-void return value called.");
353 }
354 };
355
356 template<typename p1t>
357 class SignalList1<void, p1t> : public Bu::List<Bu::Signal1<void, p1t> >
358 {
359 typedef Bu::List<Bu::Signal1<void, p1t> > MyType;
360 public:
361 SignalList1()
362 {
363 }
364
365 using typename Bu::List<Bu::Signal1<void, p1t> >::iterator;
366 using typename Bu::List<Bu::Signal1<void, p1t> >::const_iterator;
367
368 void operator()( p1t p1 )
369 {
370 for( typename MyType::iterator i = MyType::begin(); i; i++ )
371 (*i)( p1 );
372 }
373 };
232#endif // BU_SIGNAL_PARAM_COUNT_1 374#endif // BU_SIGNAL_PARAM_COUNT_1
233 375
234#ifndef BU_SIGNAL_PARAM_COUNT_2 376#ifndef BU_SIGNAL_PARAM_COUNT_2
@@ -244,6 +386,7 @@ namespace Bu
244 virtual ~_Slot2() { } 386 virtual ~_Slot2() { }
245 virtual ret operator()( p1t p1, p2t p2 )=0; 387 virtual ret operator()( p1t p1, p2t p2 )=0;
246 virtual _Slot2<ret, p1t, p2t> *clone() const=0; 388 virtual _Slot2<ret, p1t, p2t> *clone() const=0;
389 virtual bool operator==( const _Slot2<ret, p1t, p2t> &rhs ) const=0;
247 }; 390 };
248 391
249 template<typename cls, typename ret, typename p1t, typename p2t> 392 template<typename cls, typename ret, typename p1t, typename p2t>
@@ -264,6 +407,12 @@ namespace Bu
264 return new __Slot2<cls, ret, p1t, p2t>( pCls, pFnc ); 407 return new __Slot2<cls, ret, p1t, p2t>( pCls, pFnc );
265 } 408 }
266 409
410 virtual bool operator==( const _Slot2<ret, p1t, p2t> &rhs ) const
411 {
412 const __Slot2<cls, ret, p1t, p2t> &rrhs = (const __Slot2<cls, ret, p1t, p2t> &)rhs;
413 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
414 }
415
267 private: 416 private:
268 cls *pCls; 417 cls *pCls;
269 ret (cls::*pFnc)( p1t, p2t ); 418 ret (cls::*pFnc)( p1t, p2t );
@@ -287,6 +436,11 @@ namespace Bu
287 return new __Slot2F<ret, p1t, p2t>( pFnc ); 436 return new __Slot2F<ret, p1t, p2t>( pFnc );
288 } 437 }
289 438
439 virtual bool operator==( const _Slot2<ret, p1t, p2t> &rhs ) const
440 {
441 return pFnc == ((const __Slot2F<ret, p1t, p2t> &)rhs).pFnc;
442 }
443
290 private: 444 private:
291 ret (*pFnc)( p1t, p2t ); 445 ret (*pFnc)( p1t, p2t );
292 }; 446 };
@@ -316,6 +470,17 @@ namespace Bu
316 return *this; 470 return *this;
317 } 471 }
318 472
473 bool operator==( const Signal2<ret, p1t, p2t> &rhs ) const
474 {
475 if( pCb == rhs.pCb )
476 return true;
477 if( pCb == NULL || rhs.pCb == NULL )
478 return false;
479 if( typeid(pCb) != typeid(rhs.pCb) )
480 return false;
481 return *pCb == *rhs.pCb;
482 }
483
319 private: 484 private:
320 _Slot2<ret, p1t, p2t> *pCb; 485 _Slot2<ret, p1t, p2t> *pCb;
321 }; 486 };
@@ -337,6 +502,53 @@ namespace Bu
337 new __Slot2F<ret, p1t, p2t>( pFnc ) 502 new __Slot2F<ret, p1t, p2t>( pFnc )
338 ); 503 );
339 } 504 }
505
506 template<typename ret, typename p1t, typename p2t>
507 class SignalList2 : public Bu::List<Bu::Signal2<ret, p1t, p2t> >
508 {
509 typedef Bu::List<Bu::Signal2<ret, p1t, p2t> > MyType;
510 public:
511 SignalList2()
512 {
513 }
514
515 using typename Bu::List<Bu::Signal2<ret, p1t, p2t> >::iterator;
516 using typename Bu::List<Bu::Signal2<ret, p1t, p2t> >::const_iterator;
517
518 ret operator()( p1t p1, p2t p2 )
519 {
520 typename MyType::iterator i, n;
521 for(i = MyType::begin(); i; i=n)
522 {
523 n = i;
524 n++;
525 if( n )
526 (*i)( p1, p2 );
527 else
528 return (*i)( p1, p2 );
529 }
530 throw Bu::SignalException("Empty SignalList with non-void return value called.");
531 }
532 };
533
534 template<typename p1t, typename p2t>
535 class SignalList2<void, p1t, p2t> : public Bu::List<Bu::Signal2<void, p1t, p2t> >
536 {
537 typedef Bu::List<Bu::Signal2<void, p1t, p2t> > MyType;
538 public:
539 SignalList2()
540 {
541 }
542
543 using typename Bu::List<Bu::Signal2<void, p1t, p2t> >::iterator;
544 using typename Bu::List<Bu::Signal2<void, p1t, p2t> >::const_iterator;
545
546 void operator()( p1t p1, p2t p2 )
547 {
548 for( typename MyType::iterator i = MyType::begin(); i; i++ )
549 (*i)( p1, p2 );
550 }
551 };
340#endif // BU_SIGNAL_PARAM_COUNT_2 552#endif // BU_SIGNAL_PARAM_COUNT_2
341 553
342#ifndef BU_SIGNAL_PARAM_COUNT_3 554#ifndef BU_SIGNAL_PARAM_COUNT_3
@@ -352,6 +564,7 @@ namespace Bu
352 virtual ~_Slot3() { } 564 virtual ~_Slot3() { }
353 virtual ret operator()( p1t p1, p2t p2, p3t p3 )=0; 565 virtual ret operator()( p1t p1, p2t p2, p3t p3 )=0;
354 virtual _Slot3<ret, p1t, p2t, p3t> *clone() const=0; 566 virtual _Slot3<ret, p1t, p2t, p3t> *clone() const=0;
567 virtual bool operator==( const _Slot3<ret, p1t, p2t, p3t> &rhs ) const=0;
355 }; 568 };
356 569
357 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t> 570 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t>
@@ -372,6 +585,12 @@ namespace Bu
372 return new __Slot3<cls, ret, p1t, p2t, p3t>( pCls, pFnc ); 585 return new __Slot3<cls, ret, p1t, p2t, p3t>( pCls, pFnc );
373 } 586 }
374 587
588 virtual bool operator==( const _Slot3<ret, p1t, p2t, p3t> &rhs ) const
589 {
590 const __Slot3<cls, ret, p1t, p2t, p3t> &rrhs = (const __Slot3<cls, ret, p1t, p2t, p3t> &)rhs;
591 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
592 }
593
375 private: 594 private:
376 cls *pCls; 595 cls *pCls;
377 ret (cls::*pFnc)( p1t, p2t, p3t ); 596 ret (cls::*pFnc)( p1t, p2t, p3t );
@@ -395,6 +614,11 @@ namespace Bu
395 return new __Slot3F<ret, p1t, p2t, p3t>( pFnc ); 614 return new __Slot3F<ret, p1t, p2t, p3t>( pFnc );
396 } 615 }
397 616
617 virtual bool operator==( const _Slot3<ret, p1t, p2t, p3t> &rhs ) const
618 {
619 return pFnc == ((const __Slot3F<ret, p1t, p2t, p3t> &)rhs).pFnc;
620 }
621
398 private: 622 private:
399 ret (*pFnc)( p1t, p2t, p3t ); 623 ret (*pFnc)( p1t, p2t, p3t );
400 }; 624 };
@@ -424,6 +648,17 @@ namespace Bu
424 return *this; 648 return *this;
425 } 649 }
426 650
651 bool operator==( const Signal3<ret, p1t, p2t, p3t> &rhs ) const
652 {
653 if( pCb == rhs.pCb )
654 return true;
655 if( pCb == NULL || rhs.pCb == NULL )
656 return false;
657 if( typeid(pCb) != typeid(rhs.pCb) )
658 return false;
659 return *pCb == *rhs.pCb;
660 }
661
427 private: 662 private:
428 _Slot3<ret, p1t, p2t, p3t> *pCb; 663 _Slot3<ret, p1t, p2t, p3t> *pCb;
429 }; 664 };
@@ -445,6 +680,53 @@ namespace Bu
445 new __Slot3F<ret, p1t, p2t, p3t>( pFnc ) 680 new __Slot3F<ret, p1t, p2t, p3t>( pFnc )
446 ); 681 );
447 } 682 }
683
684 template<typename ret, typename p1t, typename p2t, typename p3t>
685 class SignalList3 : public Bu::List<Bu::Signal3<ret, p1t, p2t, p3t> >
686 {
687 typedef Bu::List<Bu::Signal3<ret, p1t, p2t, p3t> > MyType;
688 public:
689 SignalList3()
690 {
691 }
692
693 using typename Bu::List<Bu::Signal3<ret, p1t, p2t, p3t> >::iterator;
694 using typename Bu::List<Bu::Signal3<ret, p1t, p2t, p3t> >::const_iterator;
695
696 ret operator()( p1t p1, p2t p2, p3t p3 )
697 {
698 typename MyType::iterator i, n;
699 for(i = MyType::begin(); i; i=n)
700 {
701 n = i;
702 n++;
703 if( n )
704 (*i)( p1, p2, p3 );
705 else
706 return (*i)( p1, p2, p3 );
707 }
708 throw Bu::SignalException("Empty SignalList with non-void return value called.");
709 }
710 };
711
712 template<typename p1t, typename p2t, typename p3t>
713 class SignalList3<void, p1t, p2t, p3t> : public Bu::List<Bu::Signal3<void, p1t, p2t, p3t> >
714 {
715 typedef Bu::List<Bu::Signal3<void, p1t, p2t, p3t> > MyType;
716 public:
717 SignalList3()
718 {
719 }
720
721 using typename Bu::List<Bu::Signal3<void, p1t, p2t, p3t> >::iterator;
722 using typename Bu::List<Bu::Signal3<void, p1t, p2t, p3t> >::const_iterator;
723
724 void operator()( p1t p1, p2t p2, p3t p3 )
725 {
726 for( typename MyType::iterator i = MyType::begin(); i; i++ )
727 (*i)( p1, p2, p3 );
728 }
729 };
448#endif // BU_SIGNAL_PARAM_COUNT_3 730#endif // BU_SIGNAL_PARAM_COUNT_3
449 731
450#ifndef BU_SIGNAL_PARAM_COUNT_4 732#ifndef BU_SIGNAL_PARAM_COUNT_4
@@ -460,6 +742,7 @@ namespace Bu
460 virtual ~_Slot4() { } 742 virtual ~_Slot4() { }
461 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 )=0; 743 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 )=0;
462 virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const=0; 744 virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const=0;
745 virtual bool operator==( const _Slot4<ret, p1t, p2t, p3t, p4t> &rhs ) const=0;
463 }; 746 };
464 747
465 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t> 748 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t>
@@ -480,6 +763,12 @@ namespace Bu
480 return new __Slot4<cls, ret, p1t, p2t, p3t, p4t>( pCls, pFnc ); 763 return new __Slot4<cls, ret, p1t, p2t, p3t, p4t>( pCls, pFnc );
481 } 764 }
482 765
766 virtual bool operator==( const _Slot4<ret, p1t, p2t, p3t, p4t> &rhs ) const
767 {
768 const __Slot4<cls, ret, p1t, p2t, p3t, p4t> &rrhs = (const __Slot4<cls, ret, p1t, p2t, p3t, p4t> &)rhs;
769 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
770 }
771
483 private: 772 private:
484 cls *pCls; 773 cls *pCls;
485 ret (cls::*pFnc)( p1t, p2t, p3t, p4t ); 774 ret (cls::*pFnc)( p1t, p2t, p3t, p4t );
@@ -503,6 +792,11 @@ namespace Bu
503 return new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc ); 792 return new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc );
504 } 793 }
505 794
795 virtual bool operator==( const _Slot4<ret, p1t, p2t, p3t, p4t> &rhs ) const
796 {
797 return pFnc == ((const __Slot4F<ret, p1t, p2t, p3t, p4t> &)rhs).pFnc;
798 }
799
506 private: 800 private:
507 ret (*pFnc)( p1t, p2t, p3t, p4t ); 801 ret (*pFnc)( p1t, p2t, p3t, p4t );
508 }; 802 };
@@ -532,6 +826,17 @@ namespace Bu
532 return *this; 826 return *this;
533 } 827 }
534 828
829 bool operator==( const Signal4<ret, p1t, p2t, p3t, p4t> &rhs ) const
830 {
831 if( pCb == rhs.pCb )
832 return true;
833 if( pCb == NULL || rhs.pCb == NULL )
834 return false;
835 if( typeid(pCb) != typeid(rhs.pCb) )
836 return false;
837 return *pCb == *rhs.pCb;
838 }
839
535 private: 840 private:
536 _Slot4<ret, p1t, p2t, p3t, p4t> *pCb; 841 _Slot4<ret, p1t, p2t, p3t, p4t> *pCb;
537 }; 842 };
@@ -553,6 +858,53 @@ namespace Bu
553 new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc ) 858 new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc )
554 ); 859 );
555 } 860 }
861
862 template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t>
863 class SignalList4 : public Bu::List<Bu::Signal4<ret, p1t, p2t, p3t, p4t> >
864 {
865 typedef Bu::List<Bu::Signal4<ret, p1t, p2t, p3t, p4t> > MyType;
866 public:
867 SignalList4()
868 {
869 }
870
871 using typename Bu::List<Bu::Signal4<ret, p1t, p2t, p3t, p4t> >::iterator;
872 using typename Bu::List<Bu::Signal4<ret, p1t, p2t, p3t, p4t> >::const_iterator;
873
874 ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 )
875 {
876 typename MyType::iterator i, n;
877 for(i = MyType::begin(); i; i=n)
878 {
879 n = i;
880 n++;
881 if( n )
882 (*i)( p1, p2, p3, p4 );
883 else
884 return (*i)( p1, p2, p3, p4 );
885 }
886 throw Bu::SignalException("Empty SignalList with non-void return value called.");
887 }
888 };
889
890 template<typename p1t, typename p2t, typename p3t, typename p4t>
891 class SignalList4<void, p1t, p2t, p3t, p4t> : public Bu::List<Bu::Signal4<void, p1t, p2t, p3t, p4t> >
892 {
893 typedef Bu::List<Bu::Signal4<void, p1t, p2t, p3t, p4t> > MyType;
894 public:
895 SignalList4()
896 {
897 }
898
899 using typename Bu::List<Bu::Signal4<void, p1t, p2t, p3t, p4t> >::iterator;
900 using typename Bu::List<Bu::Signal4<void, p1t, p2t, p3t, p4t> >::const_iterator;
901
902 void operator()( p1t p1, p2t p2, p3t p3, p4t p4 )
903 {
904 for( typename MyType::iterator i = MyType::begin(); i; i++ )
905 (*i)( p1, p2, p3, p4 );
906 }
907 };
556#endif // BU_SIGNAL_PARAM_COUNT_4 908#endif // BU_SIGNAL_PARAM_COUNT_4
557 909
558#ifndef BU_SIGNAL_PARAM_COUNT_5 910#ifndef BU_SIGNAL_PARAM_COUNT_5
@@ -568,6 +920,7 @@ namespace Bu
568 virtual ~_Slot5() { } 920 virtual ~_Slot5() { }
569 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )=0; 921 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )=0;
570 virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const=0; 922 virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const=0;
923 virtual bool operator==( const _Slot5<ret, p1t, p2t, p3t, p4t, p5t> &rhs ) const=0;
571 }; 924 };
572 925
573 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> 926 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t>
@@ -588,6 +941,12 @@ namespace Bu
588 return new __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t>( pCls, pFnc ); 941 return new __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t>( pCls, pFnc );
589 } 942 }
590 943
944 virtual bool operator==( const _Slot5<ret, p1t, p2t, p3t, p4t, p5t> &rhs ) const
945 {
946 const __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t> &rrhs = (const __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t> &)rhs;
947 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
948 }
949
591 private: 950 private:
592 cls *pCls; 951 cls *pCls;
593 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ); 952 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t );
@@ -611,6 +970,11 @@ namespace Bu
611 return new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc ); 970 return new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc );
612 } 971 }
613 972
973 virtual bool operator==( const _Slot5<ret, p1t, p2t, p3t, p4t, p5t> &rhs ) const
974 {
975 return pFnc == ((const __Slot5F<ret, p1t, p2t, p3t, p4t, p5t> &)rhs).pFnc;
976 }
977
614 private: 978 private:
615 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ); 979 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t );
616 }; 980 };
@@ -640,6 +1004,17 @@ namespace Bu
640 return *this; 1004 return *this;
641 } 1005 }
642 1006
1007 bool operator==( const Signal5<ret, p1t, p2t, p3t, p4t, p5t> &rhs ) const
1008 {
1009 if( pCb == rhs.pCb )
1010 return true;
1011 if( pCb == NULL || rhs.pCb == NULL )
1012 return false;
1013 if( typeid(pCb) != typeid(rhs.pCb) )
1014 return false;
1015 return *pCb == *rhs.pCb;
1016 }
1017
643 private: 1018 private:
644 _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *pCb; 1019 _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *pCb;
645 }; 1020 };
@@ -661,6 +1036,53 @@ namespace Bu
661 new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc ) 1036 new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc )
662 ); 1037 );
663 } 1038 }
1039
1040 template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t>
1041 class SignalList5 : public Bu::List<Bu::Signal5<ret, p1t, p2t, p3t, p4t, p5t> >
1042 {
1043 typedef Bu::List<Bu::Signal5<ret, p1t, p2t, p3t, p4t, p5t> > MyType;
1044 public:
1045 SignalList5()
1046 {
1047 }
1048
1049 using typename Bu::List<Bu::Signal5<ret, p1t, p2t, p3t, p4t, p5t> >::iterator;
1050 using typename Bu::List<Bu::Signal5<ret, p1t, p2t, p3t, p4t, p5t> >::const_iterator;
1051
1052 ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )
1053 {
1054 typename MyType::iterator i, n;
1055 for(i = MyType::begin(); i; i=n)
1056 {
1057 n = i;
1058 n++;
1059 if( n )
1060 (*i)( p1, p2, p3, p4, p5 );
1061 else
1062 return (*i)( p1, p2, p3, p4, p5 );
1063 }
1064 throw Bu::SignalException("Empty SignalList with non-void return value called.");
1065 }
1066 };
1067
1068 template<typename p1t, typename p2t, typename p3t, typename p4t, typename p5t>
1069 class SignalList5<void, p1t, p2t, p3t, p4t, p5t> : public Bu::List<Bu::Signal5<void, p1t, p2t, p3t, p4t, p5t> >
1070 {
1071 typedef Bu::List<Bu::Signal5<void, p1t, p2t, p3t, p4t, p5t> > MyType;
1072 public:
1073 SignalList5()
1074 {
1075 }
1076
1077 using typename Bu::List<Bu::Signal5<void, p1t, p2t, p3t, p4t, p5t> >::iterator;
1078 using typename Bu::List<Bu::Signal5<void, p1t, p2t, p3t, p4t, p5t> >::const_iterator;
1079
1080 void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )
1081 {
1082 for( typename MyType::iterator i = MyType::begin(); i; i++ )
1083 (*i)( p1, p2, p3, p4, p5 );
1084 }
1085 };
664#endif // BU_SIGNAL_PARAM_COUNT_5 1086#endif // BU_SIGNAL_PARAM_COUNT_5
665 1087
666#ifndef BU_SIGNAL_PARAM_COUNT_6 1088#ifndef BU_SIGNAL_PARAM_COUNT_6
@@ -676,6 +1098,7 @@ namespace Bu
676 virtual ~_Slot6() { } 1098 virtual ~_Slot6() { }
677 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )=0; 1099 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )=0;
678 virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const=0; 1100 virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const=0;
1101 virtual bool operator==( const _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rhs ) const=0;
679 }; 1102 };
680 1103
681 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> 1104 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t>
@@ -696,6 +1119,12 @@ namespace Bu
696 return new __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t>( pCls, pFnc ); 1119 return new __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t>( pCls, pFnc );
697 } 1120 }
698 1121
1122 virtual bool operator==( const _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rhs ) const
1123 {
1124 const __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t> &rrhs = (const __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t> &)rhs;
1125 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
1126 }
1127
699 private: 1128 private:
700 cls *pCls; 1129 cls *pCls;
701 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); 1130 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t );
@@ -719,6 +1148,11 @@ namespace Bu
719 return new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc ); 1148 return new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc );
720 } 1149 }
721 1150
1151 virtual bool operator==( const _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rhs ) const
1152 {
1153 return pFnc == ((const __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t> &)rhs).pFnc;
1154 }
1155
722 private: 1156 private:
723 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); 1157 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t );
724 }; 1158 };
@@ -748,6 +1182,17 @@ namespace Bu
748 return *this; 1182 return *this;
749 } 1183 }
750 1184
1185 bool operator==( const Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rhs ) const
1186 {
1187 if( pCb == rhs.pCb )
1188 return true;
1189 if( pCb == NULL || rhs.pCb == NULL )
1190 return false;
1191 if( typeid(pCb) != typeid(rhs.pCb) )
1192 return false;
1193 return *pCb == *rhs.pCb;
1194 }
1195
751 private: 1196 private:
752 _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *pCb; 1197 _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *pCb;
753 }; 1198 };
@@ -769,6 +1214,53 @@ namespace Bu
769 new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc ) 1214 new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc )
770 ); 1215 );
771 } 1216 }
1217
1218 template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t>
1219 class SignalList6 : public Bu::List<Bu::Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> >
1220 {
1221 typedef Bu::List<Bu::Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> > MyType;
1222 public:
1223 SignalList6()
1224 {
1225 }
1226
1227 using typename Bu::List<Bu::Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> >::iterator;
1228 using typename Bu::List<Bu::Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> >::const_iterator;
1229
1230 ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )
1231 {
1232 typename MyType::iterator i, n;
1233 for(i = MyType::begin(); i; i=n)
1234 {
1235 n = i;
1236 n++;
1237 if( n )
1238 (*i)( p1, p2, p3, p4, p5, p6 );
1239 else
1240 return (*i)( p1, p2, p3, p4, p5, p6 );
1241 }
1242 throw Bu::SignalException("Empty SignalList with non-void return value called.");
1243 }
1244 };
1245
1246 template<typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t>
1247 class SignalList6<void, p1t, p2t, p3t, p4t, p5t, p6t> : public Bu::List<Bu::Signal6<void, p1t, p2t, p3t, p4t, p5t, p6t> >
1248 {
1249 typedef Bu::List<Bu::Signal6<void, p1t, p2t, p3t, p4t, p5t, p6t> > MyType;
1250 public:
1251 SignalList6()
1252 {
1253 }
1254
1255 using typename Bu::List<Bu::Signal6<void, p1t, p2t, p3t, p4t, p5t, p6t> >::iterator;
1256 using typename Bu::List<Bu::Signal6<void, p1t, p2t, p3t, p4t, p5t, p6t> >::const_iterator;
1257
1258 void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )
1259 {
1260 for( typename MyType::iterator i = MyType::begin(); i; i++ )
1261 (*i)( p1, p2, p3, p4, p5, p6 );
1262 }
1263 };
772#endif // BU_SIGNAL_PARAM_COUNT_6 1264#endif // BU_SIGNAL_PARAM_COUNT_6
773 1265
774#ifndef BU_SIGNAL_PARAM_COUNT_7 1266#ifndef BU_SIGNAL_PARAM_COUNT_7
@@ -784,6 +1276,7 @@ namespace Bu
784 virtual ~_Slot7() { } 1276 virtual ~_Slot7() { }
785 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 )=0; 1277 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 )=0;
786 virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const=0; 1278 virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const=0;
1279 virtual bool operator==( const _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rhs ) const=0;
787 }; 1280 };
788 1281
789 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> 1282 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t>
@@ -804,6 +1297,12 @@ namespace Bu
804 return new __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pCls, pFnc ); 1297 return new __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pCls, pFnc );
805 } 1298 }
806 1299
1300 virtual bool operator==( const _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rhs ) const
1301 {
1302 const __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rrhs = (const __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &)rhs;
1303 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
1304 }
1305
807 private: 1306 private:
808 cls *pCls; 1307 cls *pCls;
809 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); 1308 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t );
@@ -827,6 +1326,11 @@ namespace Bu
827 return new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc ); 1326 return new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc );
828 } 1327 }
829 1328
1329 virtual bool operator==( const _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rhs ) const
1330 {
1331 return pFnc == ((const __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &)rhs).pFnc;
1332 }
1333
830 private: 1334 private:
831 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); 1335 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t );
832 }; 1336 };
@@ -856,6 +1360,17 @@ namespace Bu
856 return *this; 1360 return *this;
857 } 1361 }
858 1362
1363 bool operator==( const Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rhs ) const
1364 {
1365 if( pCb == rhs.pCb )
1366 return true;
1367 if( pCb == NULL || rhs.pCb == NULL )
1368 return false;
1369 if( typeid(pCb) != typeid(rhs.pCb) )
1370 return false;
1371 return *pCb == *rhs.pCb;
1372 }
1373
859 private: 1374 private:
860 _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *pCb; 1375 _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *pCb;
861 }; 1376 };
@@ -877,6 +1392,53 @@ namespace Bu
877 new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc ) 1392 new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc )
878 ); 1393 );
879 } 1394 }
1395
1396 template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t>
1397 class SignalList7 : public Bu::List<Bu::Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> >
1398 {
1399 typedef Bu::List<Bu::Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> > MyType;
1400 public:
1401 SignalList7()
1402 {
1403 }
1404
1405 using typename Bu::List<Bu::Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> >::iterator;
1406 using typename Bu::List<Bu::Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> >::const_iterator;
1407
1408 ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 )
1409 {
1410 typename MyType::iterator i, n;
1411 for(i = MyType::begin(); i; i=n)
1412 {
1413 n = i;
1414 n++;
1415 if( n )
1416 (*i)( p1, p2, p3, p4, p5, p6, p7 );
1417 else
1418 return (*i)( p1, p2, p3, p4, p5, p6, p7 );
1419 }
1420 throw Bu::SignalException("Empty SignalList with non-void return value called.");
1421 }
1422 };
1423
1424 template<typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t>
1425 class SignalList7<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t> : public Bu::List<Bu::Signal7<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t> >
1426 {
1427 typedef Bu::List<Bu::Signal7<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t> > MyType;
1428 public:
1429 SignalList7()
1430 {
1431 }
1432
1433 using typename Bu::List<Bu::Signal7<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t> >::iterator;
1434 using typename Bu::List<Bu::Signal7<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t> >::const_iterator;
1435
1436 void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 )
1437 {
1438 for( typename MyType::iterator i = MyType::begin(); i; i++ )
1439 (*i)( p1, p2, p3, p4, p5, p6, p7 );
1440 }
1441 };
880#endif // BU_SIGNAL_PARAM_COUNT_7 1442#endif // BU_SIGNAL_PARAM_COUNT_7
881 1443
882#ifndef BU_SIGNAL_PARAM_COUNT_8 1444#ifndef BU_SIGNAL_PARAM_COUNT_8
@@ -892,6 +1454,7 @@ namespace Bu
892 virtual ~_Slot8() { } 1454 virtual ~_Slot8() { }
893 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 )=0; 1455 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 )=0;
894 virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const=0; 1456 virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const=0;
1457 virtual bool operator==( const _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rhs ) const=0;
895 }; 1458 };
896 1459
897 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> 1460 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t>
@@ -912,6 +1475,12 @@ namespace Bu
912 return new __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pCls, pFnc ); 1475 return new __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pCls, pFnc );
913 } 1476 }
914 1477
1478 virtual bool operator==( const _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rhs ) const
1479 {
1480 const __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rrhs = (const __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &)rhs;
1481 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
1482 }
1483
915 private: 1484 private:
916 cls *pCls; 1485 cls *pCls;
917 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); 1486 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t );
@@ -935,6 +1504,11 @@ namespace Bu
935 return new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc ); 1504 return new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc );
936 } 1505 }
937 1506
1507 virtual bool operator==( const _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rhs ) const
1508 {
1509 return pFnc == ((const __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &)rhs).pFnc;
1510 }
1511
938 private: 1512 private:
939 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); 1513 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t );
940 }; 1514 };
@@ -964,6 +1538,17 @@ namespace Bu
964 return *this; 1538 return *this;
965 } 1539 }
966 1540
1541 bool operator==( const Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rhs ) const
1542 {
1543 if( pCb == rhs.pCb )
1544 return true;
1545 if( pCb == NULL || rhs.pCb == NULL )
1546 return false;
1547 if( typeid(pCb) != typeid(rhs.pCb) )
1548 return false;
1549 return *pCb == *rhs.pCb;
1550 }
1551
967 private: 1552 private:
968 _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *pCb; 1553 _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *pCb;
969 }; 1554 };
@@ -985,6 +1570,53 @@ namespace Bu
985 new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc ) 1570 new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc )
986 ); 1571 );
987 } 1572 }
1573
1574 template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t>
1575 class SignalList8 : public Bu::List<Bu::Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> >
1576 {
1577 typedef Bu::List<Bu::Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> > MyType;
1578 public:
1579 SignalList8()
1580 {
1581 }
1582
1583 using typename Bu::List<Bu::Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> >::iterator;
1584 using typename Bu::List<Bu::Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> >::const_iterator;
1585
1586 ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 )
1587 {
1588 typename MyType::iterator i, n;
1589 for(i = MyType::begin(); i; i=n)
1590 {
1591 n = i;
1592 n++;
1593 if( n )
1594 (*i)( p1, p2, p3, p4, p5, p6, p7, p8 );
1595 else
1596 return (*i)( p1, p2, p3, p4, p5, p6, p7, p8 );
1597 }
1598 throw Bu::SignalException("Empty SignalList with non-void return value called.");
1599 }
1600 };
1601
1602 template<typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t>
1603 class SignalList8<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> : public Bu::List<Bu::Signal8<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> >
1604 {
1605 typedef Bu::List<Bu::Signal8<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> > MyType;
1606 public:
1607 SignalList8()
1608 {
1609 }
1610
1611 using typename Bu::List<Bu::Signal8<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> >::iterator;
1612 using typename Bu::List<Bu::Signal8<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> >::const_iterator;
1613
1614 void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 )
1615 {
1616 for( typename MyType::iterator i = MyType::begin(); i; i++ )
1617 (*i)( p1, p2, p3, p4, p5, p6, p7, p8 );
1618 }
1619 };
988#endif // BU_SIGNAL_PARAM_COUNT_8 1620#endif // BU_SIGNAL_PARAM_COUNT_8
989 1621
990#ifndef BU_SIGNAL_PARAM_COUNT_9 1622#ifndef BU_SIGNAL_PARAM_COUNT_9
@@ -1000,6 +1632,7 @@ namespace Bu
1000 virtual ~_Slot9() { } 1632 virtual ~_Slot9() { }
1001 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 )=0; 1633 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 )=0;
1002 virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const=0; 1634 virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const=0;
1635 virtual bool operator==( const _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rhs ) const=0;
1003 }; 1636 };
1004 1637
1005 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> 1638 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t>
@@ -1020,6 +1653,12 @@ namespace Bu
1020 return new __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pCls, pFnc ); 1653 return new __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pCls, pFnc );
1021 } 1654 }
1022 1655
1656 virtual bool operator==( const _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rhs ) const
1657 {
1658 const __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rrhs = (const __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &)rhs;
1659 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
1660 }
1661
1023 private: 1662 private:
1024 cls *pCls; 1663 cls *pCls;
1025 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); 1664 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t );
@@ -1043,6 +1682,11 @@ namespace Bu
1043 return new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc ); 1682 return new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc );
1044 } 1683 }
1045 1684
1685 virtual bool operator==( const _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rhs ) const
1686 {
1687 return pFnc == ((const __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &)rhs).pFnc;
1688 }
1689
1046 private: 1690 private:
1047 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); 1691 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t );
1048 }; 1692 };
@@ -1072,6 +1716,17 @@ namespace Bu
1072 return *this; 1716 return *this;
1073 } 1717 }
1074 1718
1719 bool operator==( const Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rhs ) const
1720 {
1721 if( pCb == rhs.pCb )
1722 return true;
1723 if( pCb == NULL || rhs.pCb == NULL )
1724 return false;
1725 if( typeid(pCb) != typeid(rhs.pCb) )
1726 return false;
1727 return *pCb == *rhs.pCb;
1728 }
1729
1075 private: 1730 private:
1076 _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *pCb; 1731 _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *pCb;
1077 }; 1732 };
@@ -1093,6 +1748,53 @@ namespace Bu
1093 new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc ) 1748 new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc )
1094 ); 1749 );
1095 } 1750 }
1751
1752 template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t>
1753 class SignalList9 : public Bu::List<Bu::Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> >
1754 {
1755 typedef Bu::List<Bu::Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> > MyType;
1756 public:
1757 SignalList9()
1758 {
1759 }
1760
1761 using typename Bu::List<Bu::Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> >::iterator;
1762 using typename Bu::List<Bu::Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> >::const_iterator;
1763
1764 ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 )
1765 {
1766 typename MyType::iterator i, n;
1767 for(i = MyType::begin(); i; i=n)
1768 {
1769 n = i;
1770 n++;
1771 if( n )
1772 (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9 );
1773 else
1774 return (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9 );
1775 }
1776 throw Bu::SignalException("Empty SignalList with non-void return value called.");
1777 }
1778 };
1779
1780 template<typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t>
1781 class SignalList9<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> : public Bu::List<Bu::Signal9<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> >
1782 {
1783 typedef Bu::List<Bu::Signal9<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> > MyType;
1784 public:
1785 SignalList9()
1786 {
1787 }
1788
1789 using typename Bu::List<Bu::Signal9<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> >::iterator;
1790 using typename Bu::List<Bu::Signal9<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> >::const_iterator;
1791
1792 void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 )
1793 {
1794 for( typename MyType::iterator i = MyType::begin(); i; i++ )
1795 (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9 );
1796 }
1797 };
1096#endif // BU_SIGNAL_PARAM_COUNT_9 1798#endif // BU_SIGNAL_PARAM_COUNT_9
1097 1799
1098#ifndef BU_SIGNAL_PARAM_COUNT_10 1800#ifndef BU_SIGNAL_PARAM_COUNT_10
@@ -1108,6 +1810,7 @@ namespace Bu
1108 virtual ~_Slot10() { } 1810 virtual ~_Slot10() { }
1109 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 )=0; 1811 virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 )=0;
1110 virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const=0; 1812 virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const=0;
1813 virtual bool operator==( const _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rhs ) const=0;
1111 }; 1814 };
1112 1815
1113 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> 1816 template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t>
@@ -1128,6 +1831,12 @@ namespace Bu
1128 return new __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pCls, pFnc ); 1831 return new __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pCls, pFnc );
1129 } 1832 }
1130 1833
1834 virtual bool operator==( const _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rhs ) const
1835 {
1836 const __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rrhs = (const __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &)rhs;
1837 return pCls == rrhs.pCls && pFnc == rrhs.pFnc;
1838 }
1839
1131 private: 1840 private:
1132 cls *pCls; 1841 cls *pCls;
1133 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); 1842 ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t );
@@ -1151,6 +1860,11 @@ namespace Bu
1151 return new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc ); 1860 return new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc );
1152 } 1861 }
1153 1862
1863 virtual bool operator==( const _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rhs ) const
1864 {
1865 return pFnc == ((const __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &)rhs).pFnc;
1866 }
1867
1154 private: 1868 private:
1155 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); 1869 ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t );
1156 }; 1870 };
@@ -1180,6 +1894,17 @@ namespace Bu
1180 return *this; 1894 return *this;
1181 } 1895 }
1182 1896
1897 bool operator==( const Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rhs ) const
1898 {
1899 if( pCb == rhs.pCb )
1900 return true;
1901 if( pCb == NULL || rhs.pCb == NULL )
1902 return false;
1903 if( typeid(pCb) != typeid(rhs.pCb) )
1904 return false;
1905 return *pCb == *rhs.pCb;
1906 }
1907
1183 private: 1908 private:
1184 _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *pCb; 1909 _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *pCb;
1185 }; 1910 };
@@ -1201,6 +1926,53 @@ namespace Bu
1201 new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc ) 1926 new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc )
1202 ); 1927 );
1203 } 1928 }
1929
1930 template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t>
1931 class SignalList10 : public Bu::List<Bu::Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> >
1932 {
1933 typedef Bu::List<Bu::Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> > MyType;
1934 public:
1935 SignalList10()
1936 {
1937 }
1938
1939 using typename Bu::List<Bu::Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> >::iterator;
1940 using typename Bu::List<Bu::Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> >::const_iterator;
1941
1942 ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 )
1943 {
1944 typename MyType::iterator i, n;
1945 for(i = MyType::begin(); i; i=n)
1946 {
1947 n = i;
1948 n++;
1949 if( n )
1950 (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 );
1951 else
1952 return (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 );
1953 }
1954 throw Bu::SignalException("Empty SignalList with non-void return value called.");
1955 }
1956 };
1957
1958 template<typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t>
1959 class SignalList10<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> : public Bu::List<Bu::Signal10<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> >
1960 {
1961 typedef Bu::List<Bu::Signal10<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> > MyType;
1962 public:
1963 SignalList10()
1964 {
1965 }
1966
1967 using typename Bu::List<Bu::Signal10<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> >::iterator;
1968 using typename Bu::List<Bu::Signal10<void, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> >::const_iterator;
1969
1970 void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 )
1971 {
1972 for( typename MyType::iterator i = MyType::begin(); i; i++ )
1973 (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 );
1974 }
1975 };
1204#endif // BU_SIGNAL_PARAM_COUNT_10 1976#endif // BU_SIGNAL_PARAM_COUNT_10
1205 1977
1206}; 1978};