From ed5fa193d770a790d5b7aa3a9e7e4d6cc46292d3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 3 Feb 2014 22:03:35 +0000 Subject: Updated the build.sh script to be a little more friendly. Updated copyright date. --- bootstrap/signals.h | 774 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 773 insertions(+), 1 deletion(-) (limited to 'bootstrap') 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 @@ /* - * Copyright (C) 2007-2011 Xagasoft, All rights reserved. + * Copyright (C) 2007-2014 Xagasoft, All rights reserved. * * This file is part of the libbu++ library and is released under the * terms of the license contained in the file LICENSE. @@ -8,8 +8,10 @@ #ifndef BU_SIGNALS_H #define BU_SIGNALS_H +#include #include "bu/util.h" #include "bu/exceptionbase.h" +#include "bu/list.h" namespace Bu { @@ -28,6 +30,7 @@ namespace Bu virtual ~_Slot0() { } virtual ret operator()( )=0; virtual _Slot0 *clone() const=0; + virtual bool operator==( const _Slot0 &rhs ) const=0; }; template @@ -48,6 +51,12 @@ namespace Bu return new __Slot0( pCls, pFnc ); } + virtual bool operator==( const _Slot0 &rhs ) const + { + const __Slot0 &rrhs = (const __Slot0 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( ); @@ -71,6 +80,11 @@ namespace Bu return new __Slot0F( pFnc ); } + virtual bool operator==( const _Slot0 &rhs ) const + { + return pFnc == ((const __Slot0F &)rhs).pFnc; + } + private: ret (*pFnc)( ); }; @@ -100,6 +114,17 @@ namespace Bu return *this; } + bool operator==( const Signal0 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot0 *pCb; }; @@ -121,6 +146,53 @@ namespace Bu new __Slot0F( pFnc ) ); } + + template + class SignalList0 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList0() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( ); + else + return (*i)( ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template<> + class SignalList0 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList0() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_0 #ifndef BU_SIGNAL_PARAM_COUNT_1 @@ -136,6 +208,7 @@ namespace Bu virtual ~_Slot1() { } virtual ret operator()( p1t p1 )=0; virtual _Slot1 *clone() const=0; + virtual bool operator==( const _Slot1 &rhs ) const=0; }; template @@ -156,6 +229,12 @@ namespace Bu return new __Slot1( pCls, pFnc ); } + virtual bool operator==( const _Slot1 &rhs ) const + { + const __Slot1 &rrhs = (const __Slot1 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t ); @@ -179,6 +258,11 @@ namespace Bu return new __Slot1F( pFnc ); } + virtual bool operator==( const _Slot1 &rhs ) const + { + return pFnc == ((const __Slot1F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t ); }; @@ -208,6 +292,17 @@ namespace Bu return *this; } + bool operator==( const Signal1 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot1 *pCb; }; @@ -229,6 +324,53 @@ namespace Bu new __Slot1F( pFnc ) ); } + + template + class SignalList1 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList1() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1 ); + else + return (*i)( p1 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList1 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList1() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_1 #ifndef BU_SIGNAL_PARAM_COUNT_2 @@ -244,6 +386,7 @@ namespace Bu virtual ~_Slot2() { } virtual ret operator()( p1t p1, p2t p2 )=0; virtual _Slot2 *clone() const=0; + virtual bool operator==( const _Slot2 &rhs ) const=0; }; template @@ -264,6 +407,12 @@ namespace Bu return new __Slot2( pCls, pFnc ); } + virtual bool operator==( const _Slot2 &rhs ) const + { + const __Slot2 &rrhs = (const __Slot2 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t ); @@ -287,6 +436,11 @@ namespace Bu return new __Slot2F( pFnc ); } + virtual bool operator==( const _Slot2 &rhs ) const + { + return pFnc == ((const __Slot2F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t ); }; @@ -316,6 +470,17 @@ namespace Bu return *this; } + bool operator==( const Signal2 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot2 *pCb; }; @@ -337,6 +502,53 @@ namespace Bu new __Slot2F( pFnc ) ); } + + template + class SignalList2 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList2() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2 ); + else + return (*i)( p1, p2 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList2 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList2() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_2 #ifndef BU_SIGNAL_PARAM_COUNT_3 @@ -352,6 +564,7 @@ namespace Bu virtual ~_Slot3() { } virtual ret operator()( p1t p1, p2t p2, p3t p3 )=0; virtual _Slot3 *clone() const=0; + virtual bool operator==( const _Slot3 &rhs ) const=0; }; template @@ -372,6 +585,12 @@ namespace Bu return new __Slot3( pCls, pFnc ); } + virtual bool operator==( const _Slot3 &rhs ) const + { + const __Slot3 &rrhs = (const __Slot3 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t ); @@ -395,6 +614,11 @@ namespace Bu return new __Slot3F( pFnc ); } + virtual bool operator==( const _Slot3 &rhs ) const + { + return pFnc == ((const __Slot3F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t ); }; @@ -424,6 +648,17 @@ namespace Bu return *this; } + bool operator==( const Signal3 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot3 *pCb; }; @@ -445,6 +680,53 @@ namespace Bu new __Slot3F( pFnc ) ); } + + template + class SignalList3 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList3() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3 ); + else + return (*i)( p1, p2, p3 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList3 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList3() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_3 #ifndef BU_SIGNAL_PARAM_COUNT_4 @@ -460,6 +742,7 @@ namespace Bu virtual ~_Slot4() { } virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 )=0; virtual _Slot4 *clone() const=0; + virtual bool operator==( const _Slot4 &rhs ) const=0; }; template @@ -480,6 +763,12 @@ namespace Bu return new __Slot4( pCls, pFnc ); } + virtual bool operator==( const _Slot4 &rhs ) const + { + const __Slot4 &rrhs = (const __Slot4 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t, p4t ); @@ -503,6 +792,11 @@ namespace Bu return new __Slot4F( pFnc ); } + virtual bool operator==( const _Slot4 &rhs ) const + { + return pFnc == ((const __Slot4F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t, p4t ); }; @@ -532,6 +826,17 @@ namespace Bu return *this; } + bool operator==( const Signal4 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot4 *pCb; }; @@ -553,6 +858,53 @@ namespace Bu new __Slot4F( pFnc ) ); } + + template + class SignalList4 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList4() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3, p4 ); + else + return (*i)( p1, p2, p3, p4 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList4 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList4() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3, p4 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_4 #ifndef BU_SIGNAL_PARAM_COUNT_5 @@ -568,6 +920,7 @@ namespace Bu virtual ~_Slot5() { } virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )=0; virtual _Slot5 *clone() const=0; + virtual bool operator==( const _Slot5 &rhs ) const=0; }; template @@ -588,6 +941,12 @@ namespace Bu return new __Slot5( pCls, pFnc ); } + virtual bool operator==( const _Slot5 &rhs ) const + { + const __Slot5 &rrhs = (const __Slot5 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ); @@ -611,6 +970,11 @@ namespace Bu return new __Slot5F( pFnc ); } + virtual bool operator==( const _Slot5 &rhs ) const + { + return pFnc == ((const __Slot5F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ); }; @@ -640,6 +1004,17 @@ namespace Bu return *this; } + bool operator==( const Signal5 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot5 *pCb; }; @@ -661,6 +1036,53 @@ namespace Bu new __Slot5F( pFnc ) ); } + + template + class SignalList5 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList5() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3, p4, p5 ); + else + return (*i)( p1, p2, p3, p4, p5 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList5 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList5() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3, p4, p5 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_5 #ifndef BU_SIGNAL_PARAM_COUNT_6 @@ -676,6 +1098,7 @@ namespace Bu virtual ~_Slot6() { } virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )=0; virtual _Slot6 *clone() const=0; + virtual bool operator==( const _Slot6 &rhs ) const=0; }; template @@ -696,6 +1119,12 @@ namespace Bu return new __Slot6( pCls, pFnc ); } + virtual bool operator==( const _Slot6 &rhs ) const + { + const __Slot6 &rrhs = (const __Slot6 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); @@ -719,6 +1148,11 @@ namespace Bu return new __Slot6F( pFnc ); } + virtual bool operator==( const _Slot6 &rhs ) const + { + return pFnc == ((const __Slot6F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); }; @@ -748,6 +1182,17 @@ namespace Bu return *this; } + bool operator==( const Signal6 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot6 *pCb; }; @@ -769,6 +1214,53 @@ namespace Bu new __Slot6F( pFnc ) ); } + + template + class SignalList6 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList6() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3, p4, p5, p6 ); + else + return (*i)( p1, p2, p3, p4, p5, p6 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList6 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList6() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3, p4, p5, p6 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_6 #ifndef BU_SIGNAL_PARAM_COUNT_7 @@ -784,6 +1276,7 @@ namespace Bu virtual ~_Slot7() { } virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 )=0; virtual _Slot7 *clone() const=0; + virtual bool operator==( const _Slot7 &rhs ) const=0; }; template @@ -804,6 +1297,12 @@ namespace Bu return new __Slot7( pCls, pFnc ); } + virtual bool operator==( const _Slot7 &rhs ) const + { + const __Slot7 &rrhs = (const __Slot7 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); @@ -827,6 +1326,11 @@ namespace Bu return new __Slot7F( pFnc ); } + virtual bool operator==( const _Slot7 &rhs ) const + { + return pFnc == ((const __Slot7F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); }; @@ -856,6 +1360,17 @@ namespace Bu return *this; } + bool operator==( const Signal7 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot7 *pCb; }; @@ -877,6 +1392,53 @@ namespace Bu new __Slot7F( pFnc ) ); } + + template + class SignalList7 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList7() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3, p4, p5, p6, p7 ); + else + return (*i)( p1, p2, p3, p4, p5, p6, p7 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList7 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList7() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3, p4, p5, p6, p7 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_7 #ifndef BU_SIGNAL_PARAM_COUNT_8 @@ -892,6 +1454,7 @@ namespace Bu virtual ~_Slot8() { } virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 )=0; virtual _Slot8 *clone() const=0; + virtual bool operator==( const _Slot8 &rhs ) const=0; }; template @@ -912,6 +1475,12 @@ namespace Bu return new __Slot8( pCls, pFnc ); } + virtual bool operator==( const _Slot8 &rhs ) const + { + const __Slot8 &rrhs = (const __Slot8 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); @@ -935,6 +1504,11 @@ namespace Bu return new __Slot8F( pFnc ); } + virtual bool operator==( const _Slot8 &rhs ) const + { + return pFnc == ((const __Slot8F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); }; @@ -964,6 +1538,17 @@ namespace Bu return *this; } + bool operator==( const Signal8 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot8 *pCb; }; @@ -985,6 +1570,53 @@ namespace Bu new __Slot8F( pFnc ) ); } + + template + class SignalList8 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList8() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3, p4, p5, p6, p7, p8 ); + else + return (*i)( p1, p2, p3, p4, p5, p6, p7, p8 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList8 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList8() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3, p4, p5, p6, p7, p8 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_8 #ifndef BU_SIGNAL_PARAM_COUNT_9 @@ -1000,6 +1632,7 @@ namespace Bu virtual ~_Slot9() { } virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 )=0; virtual _Slot9 *clone() const=0; + virtual bool operator==( const _Slot9 &rhs ) const=0; }; template @@ -1020,6 +1653,12 @@ namespace Bu return new __Slot9( pCls, pFnc ); } + virtual bool operator==( const _Slot9 &rhs ) const + { + const __Slot9 &rrhs = (const __Slot9 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); @@ -1043,6 +1682,11 @@ namespace Bu return new __Slot9F( pFnc ); } + virtual bool operator==( const _Slot9 &rhs ) const + { + return pFnc == ((const __Slot9F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); }; @@ -1072,6 +1716,17 @@ namespace Bu return *this; } + bool operator==( const Signal9 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot9 *pCb; }; @@ -1093,6 +1748,53 @@ namespace Bu new __Slot9F( pFnc ) ); } + + template + class SignalList9 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList9() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); + else + return (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList9 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList9() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_9 #ifndef BU_SIGNAL_PARAM_COUNT_10 @@ -1108,6 +1810,7 @@ namespace Bu virtual ~_Slot10() { } virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 )=0; virtual _Slot10 *clone() const=0; + virtual bool operator==( const _Slot10 &rhs ) const=0; }; template @@ -1128,6 +1831,12 @@ namespace Bu return new __Slot10( pCls, pFnc ); } + virtual bool operator==( const _Slot10 &rhs ) const + { + const __Slot10 &rrhs = (const __Slot10 &)rhs; + return pCls == rrhs.pCls && pFnc == rrhs.pFnc; + } + private: cls *pCls; ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); @@ -1151,6 +1860,11 @@ namespace Bu return new __Slot10F( pFnc ); } + virtual bool operator==( const _Slot10 &rhs ) const + { + return pFnc == ((const __Slot10F &)rhs).pFnc; + } + private: ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); }; @@ -1180,6 +1894,17 @@ namespace Bu return *this; } + bool operator==( const Signal10 &rhs ) const + { + if( pCb == rhs.pCb ) + return true; + if( pCb == NULL || rhs.pCb == NULL ) + return false; + if( typeid(pCb) != typeid(rhs.pCb) ) + return false; + return *pCb == *rhs.pCb; + } + private: _Slot10 *pCb; }; @@ -1201,6 +1926,53 @@ namespace Bu new __Slot10F( pFnc ) ); } + + template + class SignalList10 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList10() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) + { + typename MyType::iterator i, n; + for(i = MyType::begin(); i; i=n) + { + n = i; + n++; + if( n ) + (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); + else + return (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); + } + throw Bu::SignalException("Empty SignalList with non-void return value called."); + } + }; + + template + class SignalList10 : public Bu::List > + { + typedef Bu::List > MyType; + public: + SignalList10() + { + } + + using typename Bu::List >::iterator; + using typename Bu::List >::const_iterator; + + void operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) + { + for( typename MyType::iterator i = MyType::begin(); i; i++ ) + (*i)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); + } + }; #endif // BU_SIGNAL_PARAM_COUNT_10 }; -- cgit v1.2.3