From d6fcf92f4dd68d16720b284d8018443e85c4e1be Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 26 Mar 2012 00:22:47 +0000 Subject: Include the pregenerated signals.h file :) --- pregen/signals.h | 1208 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1208 insertions(+) create mode 100644 pregen/signals.h diff --git a/pregen/signals.h b/pregen/signals.h new file mode 100644 index 0000000..47ddad4 --- /dev/null +++ b/pregen/signals.h @@ -0,0 +1,1208 @@ +/* + * Copyright (C) 2007-2011 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. + */ + +#ifndef BU_SIGNALS_H +#define BU_SIGNALS_H + +#include "bu/util.h" +#include "bu/exceptionbase.h" + +namespace Bu +{ + subExceptionDecl( SignalException ); + +#ifndef BU_SIGNAL_PARAM_COUNT_0 +#define BU_SIGNAL_PARAM_COUNT_0 + // + // 0 Parameter(s) + // + template + class _Slot0 + { + public: + _Slot0() { } + virtual ~_Slot0() { } + virtual ret operator()( )=0; + virtual _Slot0 *clone() const=0; + }; + + template + class __Slot0 : public _Slot0 + { + public: + __Slot0( cls *pCls, ret (cls::*pFnc)( ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot0() { } + + virtual ret operator()( ) + { + return (pCls->*pFnc)( ); + } + + virtual _Slot0 *clone() const + { + return new __Slot0( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( ); + }; + + template + class __Slot0F : public _Slot0 + { + public: + __Slot0F( ret (*pFnc)( ) ) : + pFnc( pFnc ) { } + virtual ~__Slot0F() { } + + virtual ret operator()( ) + { + return (*pFnc)( ); + } + + virtual _Slot0 *clone() const + { + return new __Slot0F( pFnc ); + } + + private: + ret (*pFnc)( ); + }; + + template + class Signal0 + { + public: + Signal0() : pCb( NULL ) { } + Signal0( _Slot0 *pCb ) : pCb( pCb ) { } + Signal0( const Signal0 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal0() { delete pCb; pCb = NULL; } + + ret operator()( ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal0 &operator=( const Signal0 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot0 *pCb; + }; + + template + Signal0 slot( cls *pCls, ret (cls::*pFnc)( ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal0( + new __Slot0( pCls, pFnc ) + ); + } + + template + Signal0 slot( ret (*pFnc)( ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal0( + new __Slot0F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_0 + +#ifndef BU_SIGNAL_PARAM_COUNT_1 +#define BU_SIGNAL_PARAM_COUNT_1 + // + // 1 Parameter(s) + // + template + class _Slot1 + { + public: + _Slot1() { } + virtual ~_Slot1() { } + virtual ret operator()( p1t p1 )=0; + virtual _Slot1 *clone() const=0; + }; + + template + class __Slot1 : public _Slot1 + { + public: + __Slot1( cls *pCls, ret (cls::*pFnc)( p1t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot1() { } + + virtual ret operator()( p1t p1 ) + { + return (pCls->*pFnc)( p1 ); + } + + virtual _Slot1 *clone() const + { + return new __Slot1( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t ); + }; + + template + class __Slot1F : public _Slot1 + { + public: + __Slot1F( ret (*pFnc)( p1t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot1F() { } + + virtual ret operator()( p1t p1 ) + { + return (*pFnc)( p1 ); + } + + virtual _Slot1 *clone() const + { + return new __Slot1F( pFnc ); + } + + private: + ret (*pFnc)( p1t ); + }; + + template + class Signal1 + { + public: + Signal1() : pCb( NULL ) { } + Signal1( _Slot1 *pCb ) : pCb( pCb ) { } + Signal1( const Signal1 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal1() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal1 &operator=( const Signal1 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot1 *pCb; + }; + + template + Signal1 slot( cls *pCls, ret (cls::*pFnc)( p1t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal1( + new __Slot1( pCls, pFnc ) + ); + } + + template + Signal1 slot( ret (*pFnc)( p1t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal1( + new __Slot1F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_1 + +#ifndef BU_SIGNAL_PARAM_COUNT_2 +#define BU_SIGNAL_PARAM_COUNT_2 + // + // 2 Parameter(s) + // + template + class _Slot2 + { + public: + _Slot2() { } + virtual ~_Slot2() { } + virtual ret operator()( p1t p1, p2t p2 )=0; + virtual _Slot2 *clone() const=0; + }; + + template + class __Slot2 : public _Slot2 + { + public: + __Slot2( cls *pCls, ret (cls::*pFnc)( p1t, p2t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot2() { } + + virtual ret operator()( p1t p1, p2t p2 ) + { + return (pCls->*pFnc)( p1, p2 ); + } + + virtual _Slot2 *clone() const + { + return new __Slot2( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t ); + }; + + template + class __Slot2F : public _Slot2 + { + public: + __Slot2F( ret (*pFnc)( p1t, p2t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot2F() { } + + virtual ret operator()( p1t p1, p2t p2 ) + { + return (*pFnc)( p1, p2 ); + } + + virtual _Slot2 *clone() const + { + return new __Slot2F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t ); + }; + + template + class Signal2 + { + public: + Signal2() : pCb( NULL ) { } + Signal2( _Slot2 *pCb ) : pCb( pCb ) { } + Signal2( const Signal2 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal2() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal2 &operator=( const Signal2 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot2 *pCb; + }; + + template + Signal2 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal2( + new __Slot2( pCls, pFnc ) + ); + } + + template + Signal2 slot( ret (*pFnc)( p1t, p2t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal2( + new __Slot2F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_2 + +#ifndef BU_SIGNAL_PARAM_COUNT_3 +#define BU_SIGNAL_PARAM_COUNT_3 + // + // 3 Parameter(s) + // + template + class _Slot3 + { + public: + _Slot3() { } + virtual ~_Slot3() { } + virtual ret operator()( p1t p1, p2t p2, p3t p3 )=0; + virtual _Slot3 *clone() const=0; + }; + + template + class __Slot3 : public _Slot3 + { + public: + __Slot3( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot3() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3 ) + { + return (pCls->*pFnc)( p1, p2, p3 ); + } + + virtual _Slot3 *clone() const + { + return new __Slot3( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t ); + }; + + template + class __Slot3F : public _Slot3 + { + public: + __Slot3F( ret (*pFnc)( p1t, p2t, p3t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot3F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3 ) + { + return (*pFnc)( p1, p2, p3 ); + } + + virtual _Slot3 *clone() const + { + return new __Slot3F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t ); + }; + + template + class Signal3 + { + public: + Signal3() : pCb( NULL ) { } + Signal3( _Slot3 *pCb ) : pCb( pCb ) { } + Signal3( const Signal3 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal3() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal3 &operator=( const Signal3 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot3 *pCb; + }; + + template + Signal3 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal3( + new __Slot3( pCls, pFnc ) + ); + } + + template + Signal3 slot( ret (*pFnc)( p1t, p2t, p3t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal3( + new __Slot3F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_3 + +#ifndef BU_SIGNAL_PARAM_COUNT_4 +#define BU_SIGNAL_PARAM_COUNT_4 + // + // 4 Parameter(s) + // + template + class _Slot4 + { + public: + _Slot4() { } + virtual ~_Slot4() { } + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 )=0; + virtual _Slot4 *clone() const=0; + }; + + template + class __Slot4 : public _Slot4 + { + public: + __Slot4( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot4() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) + { + return (pCls->*pFnc)( p1, p2, p3, p4 ); + } + + virtual _Slot4 *clone() const + { + return new __Slot4( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t, p4t ); + }; + + template + class __Slot4F : public _Slot4 + { + public: + __Slot4F( ret (*pFnc)( p1t, p2t, p3t, p4t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot4F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) + { + return (*pFnc)( p1, p2, p3, p4 ); + } + + virtual _Slot4 *clone() const + { + return new __Slot4F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t, p4t ); + }; + + template + class Signal4 + { + public: + Signal4() : pCb( NULL ) { } + Signal4( _Slot4 *pCb ) : pCb( pCb ) { } + Signal4( const Signal4 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal4() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3, p4 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal4 &operator=( const Signal4 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot4 *pCb; + }; + + template + Signal4 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal4( + new __Slot4( pCls, pFnc ) + ); + } + + template + Signal4 slot( ret (*pFnc)( p1t, p2t, p3t, p4t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal4( + new __Slot4F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_4 + +#ifndef BU_SIGNAL_PARAM_COUNT_5 +#define BU_SIGNAL_PARAM_COUNT_5 + // + // 5 Parameter(s) + // + template + class _Slot5 + { + public: + _Slot5() { } + virtual ~_Slot5() { } + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )=0; + virtual _Slot5 *clone() const=0; + }; + + template + class __Slot5 : public _Slot5 + { + public: + __Slot5( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot5() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) + { + return (pCls->*pFnc)( p1, p2, p3, p4, p5 ); + } + + virtual _Slot5 *clone() const + { + return new __Slot5( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ); + }; + + template + class __Slot5F : public _Slot5 + { + public: + __Slot5F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot5F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) + { + return (*pFnc)( p1, p2, p3, p4, p5 ); + } + + virtual _Slot5 *clone() const + { + return new __Slot5F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ); + }; + + template + class Signal5 + { + public: + Signal5() : pCb( NULL ) { } + Signal5( _Slot5 *pCb ) : pCb( pCb ) { } + Signal5( const Signal5 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal5() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3, p4, p5 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal5 &operator=( const Signal5 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot5 *pCb; + }; + + template + Signal5 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal5( + new __Slot5( pCls, pFnc ) + ); + } + + template + Signal5 slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal5( + new __Slot5F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_5 + +#ifndef BU_SIGNAL_PARAM_COUNT_6 +#define BU_SIGNAL_PARAM_COUNT_6 + // + // 6 Parameter(s) + // + template + class _Slot6 + { + public: + _Slot6() { } + virtual ~_Slot6() { } + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )=0; + virtual _Slot6 *clone() const=0; + }; + + template + class __Slot6 : public _Slot6 + { + public: + __Slot6( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot6() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) + { + return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6 ); + } + + virtual _Slot6 *clone() const + { + return new __Slot6( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); + }; + + template + class __Slot6F : public _Slot6 + { + public: + __Slot6F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot6F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) + { + return (*pFnc)( p1, p2, p3, p4, p5, p6 ); + } + + virtual _Slot6 *clone() const + { + return new __Slot6F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); + }; + + template + class Signal6 + { + public: + Signal6() : pCb( NULL ) { } + Signal6( _Slot6 *pCb ) : pCb( pCb ) { } + Signal6( const Signal6 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal6() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3, p4, p5, p6 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal6 &operator=( const Signal6 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot6 *pCb; + }; + + template + Signal6 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal6( + new __Slot6( pCls, pFnc ) + ); + } + + template + Signal6 slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal6( + new __Slot6F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_6 + +#ifndef BU_SIGNAL_PARAM_COUNT_7 +#define BU_SIGNAL_PARAM_COUNT_7 + // + // 7 Parameter(s) + // + template + class _Slot7 + { + public: + _Slot7() { } + 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; + }; + + template + class __Slot7 : public _Slot7 + { + public: + __Slot7( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot7() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) + { + return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7 ); + } + + virtual _Slot7 *clone() const + { + return new __Slot7( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); + }; + + template + class __Slot7F : public _Slot7 + { + public: + __Slot7F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot7F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) + { + return (*pFnc)( p1, p2, p3, p4, p5, p6, p7 ); + } + + virtual _Slot7 *clone() const + { + return new __Slot7F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); + }; + + template + class Signal7 + { + public: + Signal7() : pCb( NULL ) { } + Signal7( _Slot7 *pCb ) : pCb( pCb ) { } + Signal7( const Signal7 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal7() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3, p4, p5, p6, p7 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal7 &operator=( const Signal7 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot7 *pCb; + }; + + template + Signal7 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal7( + new __Slot7( pCls, pFnc ) + ); + } + + template + Signal7 slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal7( + new __Slot7F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_7 + +#ifndef BU_SIGNAL_PARAM_COUNT_8 +#define BU_SIGNAL_PARAM_COUNT_8 + // + // 8 Parameter(s) + // + template + class _Slot8 + { + public: + _Slot8() { } + 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; + }; + + template + class __Slot8 : public _Slot8 + { + public: + __Slot8( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot8() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) + { + return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8 ); + } + + virtual _Slot8 *clone() const + { + return new __Slot8( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); + }; + + template + class __Slot8F : public _Slot8 + { + public: + __Slot8F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot8F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) + { + return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8 ); + } + + virtual _Slot8 *clone() const + { + return new __Slot8F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); + }; + + template + class Signal8 + { + public: + Signal8() : pCb( NULL ) { } + Signal8( _Slot8 *pCb ) : pCb( pCb ) { } + Signal8( const Signal8 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal8() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal8 &operator=( const Signal8 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot8 *pCb; + }; + + template + Signal8 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal8( + new __Slot8( pCls, pFnc ) + ); + } + + template + Signal8 slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal8( + new __Slot8F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_8 + +#ifndef BU_SIGNAL_PARAM_COUNT_9 +#define BU_SIGNAL_PARAM_COUNT_9 + // + // 9 Parameter(s) + // + template + class _Slot9 + { + public: + _Slot9() { } + 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; + }; + + template + class __Slot9 : public _Slot9 + { + public: + __Slot9( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + virtual ~__Slot9() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) + { + return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); + } + + virtual _Slot9 *clone() const + { + return new __Slot9( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); + }; + + template + class __Slot9F : public _Slot9 + { + public: + __Slot9F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot9F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) + { + return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); + } + + virtual _Slot9 *clone() const + { + return new __Slot9F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); + }; + + template + class Signal9 + { + public: + Signal9() : pCb( NULL ) { } + Signal9( _Slot9 *pCb ) : pCb( pCb ) { } + Signal9( const Signal9 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal9() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal9 &operator=( const Signal9 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot9 *pCb; + }; + + template + Signal9 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal9( + new __Slot9( pCls, pFnc ) + ); + } + + template + Signal9 slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal9( + new __Slot9F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_9 + +#ifndef BU_SIGNAL_PARAM_COUNT_10 +#define BU_SIGNAL_PARAM_COUNT_10 + // + // 10 Parameter(s) + // + template + class _Slot10 + { + public: + _Slot10() { } + 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; + }; + + template + class __Slot10 : public _Slot10 + { + public: + __Slot10( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) : + pCls( pCls ), pFnc( pFnc ) { } + 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 ) + { + return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); + } + + virtual _Slot10 *clone() const + { + return new __Slot10( pCls, pFnc ); + } + + private: + cls *pCls; + ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); + }; + + template + class __Slot10F : public _Slot10 + { + public: + __Slot10F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) : + pFnc( pFnc ) { } + virtual ~__Slot10F() { } + + virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) + { + return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); + } + + virtual _Slot10 *clone() const + { + return new __Slot10F( pFnc ); + } + + private: + ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); + }; + + template + class Signal10 + { + public: + Signal10() : pCb( NULL ) { } + Signal10( _Slot10 *pCb ) : pCb( pCb ) { } + Signal10( const Signal10 &rSrc ) : + pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } + virtual ~Signal10() { delete pCb; pCb = NULL; } + + ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) + { + if( !pCb ) throw SignalException("Uninitialized signal called."); + return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); + } + + bool isSet() const { return pCb != NULL; } + operator bool() const { return isSet(); } + + Signal10 &operator=( const Signal10 &rhs ) + { + pCb = rhs.pCb->clone(); + return *this; + } + + private: + _Slot10 *pCb; + }; + + template + Signal10 slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) + { + if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal10( + new __Slot10( pCls, pFnc ) + ); + } + + template + Signal10 slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) + { + if( !pFnc ) throw SignalException("NULL pointer in slot()."); + return Signal10( + new __Slot10F( pFnc ) + ); + } +#endif // BU_SIGNAL_PARAM_COUNT_10 + +}; + +#endif -- cgit v1.2.3