Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:19:51

0001 // sigslot.h: Signal/Slot classes

0002 // 

0003 // Written by Sarah Thompson (sarah@telergy.com) 2002.

0004 //

0005 // License: Public domain. You are free to use this code however you like, with the proviso that

0006 //          the author takes on no responsibility or liability for any use.

0007 //

0008 // QUICK DOCUMENTATION 

0009 //      

0010 //              (see also the full documentation at http://sigslot.sourceforge.net/)

0011 //

0012 //      #define switches

0013 //          SIGSLOT_PURE_ISO            - Define this to force ISO C++ compliance. This also disables

0014 //                                        all of the thread safety support on platforms where it is 

0015 //                                        available.

0016 //

0017 //          SIGSLOT_USE_POSIX_THREADS   - Force use of Posix threads when using a C++ compiler other than

0018 //                                        gcc on a platform that supports Posix threads. (When using gcc,

0019 //                                        this is the default - use SIGSLOT_PURE_ISO to disable this if 

0020 //                                        necessary)

0021 //

0022 //          SIGSLOT_DEFAULT_MT_POLICY   - Where thread support is enabled, this defaults to multi_threaded_global.

0023 //                                        Otherwise, the default is single_threaded. #define this yourself to

0024 //                                        override the default. In pure ISO mode, anything other than

0025 //                                        single_threaded will cause a compiler error.

0026 //

0027 //      PLATFORM NOTES

0028 //

0029 //          Win32                       - On Win32, the WIN32 symbol must be #defined. Most mainstream

0030 //                                        compilers do this by default, but you may need to define it

0031 //                                        yourself if your build environment is less standard. This causes

0032 //                                        the Win32 thread support to be compiled in and used automatically.

0033 //

0034 //          Unix/Linux/BSD, etc.        - If you're using gcc, it is assumed that you have Posix threads

0035 //                                        available, so they are used automatically. You can override this

0036 //                                        (as under Windows) with the SIGSLOT_PURE_ISO switch. If you're using

0037 //                                        something other than gcc but still want to use Posix threads, you

0038 //                                        need to #define SIGSLOT_USE_POSIX_THREADS.

0039 //

0040 //          ISO C++                     - If none of the supported platforms are detected, or if

0041 //                                        SIGSLOT_PURE_ISO is defined, all multithreading support is turned off,

0042 //                                        along with any code that might cause a pure ISO C++ environment to

0043 //                                        complain. Before you ask, gcc -ansi -pedantic won't compile this 

0044 //                                        library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of

0045 //                                        errors that aren't really there. If you feel like investigating this,

0046 //                                        please contact the author.

0047 //

0048 //      

0049 //      THREADING MODES

0050 //

0051 //          single_threaded             - Your program is assumed to be single threaded from the point of view

0052 //                                        of signal/slot usage (i.e. all objects using signals and slots are

0053 //                                        created and destroyed from a single thread). Behaviour if objects are

0054 //                                        destroyed concurrently is undefined (i.e. you'll get the occasional

0055 //                                        segmentation fault/memory exception).

0056 //

0057 //          multi_threaded_global       - Your program is assumed to be multi threaded. Objects using signals and

0058 //                                        slots can be safely created and destroyed from any thread, even when

0059 //                                        connections exist. In multi_threaded_global mode, this is achieved by a

0060 //                                        single global mutex (actually a critical section on Windows because they

0061 //                                        are faster). This option uses less OS resources, but results in more

0062 //                                        opportunities for contention, possibly resulting in more context switches

0063 //                                        than are strictly necessary.

0064 //

0065 //          multi_threaded_local        - Behaviour in this mode is essentially the same as multi_threaded_global,

0066 //                                        except that each signal, and each object that inherits has_slots, all 

0067 //                                        have their own mutex/critical section. In practice, this means that

0068 //                                        mutex collisions (and hence context switches) only happen if they are

0069 //                                        absolutely essential. However, on some platforms, creating a lot of 

0070 //                                        mutexes can slow down the whole OS, so use this option with care.

0071 //

0072 //      USING THE LIBRARY

0073 //

0074 //          See the full documentation at http://sigslot.sourceforge.net/

0075 //

0076 //

0077 
0078 #ifndef SIGSLOT_H__
0079 #define SIGSLOT_H__
0080 
0081 #include <set>
0082 #include <list>
0083 
0084 #if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS))
0085 #   define _SIGSLOT_SINGLE_THREADED
0086 #elif defined(WIN32)
0087 #   define _SIGSLOT_HAS_WIN32_THREADS
0088 #   include <windows.h>
0089 #elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS)
0090 #   define _SIGSLOT_HAS_POSIX_THREADS
0091 #   include <pthread.h>
0092 #else
0093 #   define _SIGSLOT_SINGLE_THREADED
0094 #endif
0095 
0096 #ifndef SIGSLOT_DEFAULT_MT_POLICY
0097 #   ifdef _SIGSLOT_SINGLE_THREADED
0098 #       define SIGSLOT_DEFAULT_MT_POLICY single_threaded
0099 #   else
0100 #       define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local
0101 #   endif
0102 #endif
0103 
0104 
0105 namespace sigslot {
0106     
0107     class single_threaded
0108     {
0109     public:
0110         single_threaded()
0111         {
0112             ;
0113         }
0114         
0115         virtual ~single_threaded()
0116         {
0117             ;
0118         }
0119         
0120         void lock()
0121         {
0122             ;
0123         }
0124         
0125         void unlock()
0126         {
0127             ;
0128         }
0129     };
0130     
0131 #ifdef _SIGSLOT_HAS_WIN32_THREADS
0132     // The multi threading policies only get compiled in if they are enabled.

0133     class multi_threaded_global
0134     {
0135     public:
0136         multi_threaded_global()
0137         {
0138             static bool isinitialised = false;
0139             
0140             if(!isinitialised)
0141             {
0142                 InitializeCriticalSection(get_critsec());
0143                 isinitialised = true;
0144             }
0145         }
0146         
0147         multi_threaded_global(const multi_threaded_global&)
0148         {
0149             ;
0150         }
0151         
0152         virtual ~multi_threaded_global()
0153         {
0154             ;
0155         }
0156         
0157         void lock()
0158         {
0159             EnterCriticalSection(get_critsec());
0160         }
0161         
0162         void unlock()
0163         {
0164             LeaveCriticalSection(get_critsec());
0165         }
0166         
0167     private:
0168         CRITICAL_SECTION* get_critsec()
0169         {
0170             static CRITICAL_SECTION g_critsec;
0171             return &g_critsec;
0172         }
0173     };
0174     
0175     class multi_threaded_local
0176     {
0177     public:
0178         multi_threaded_local()
0179         {
0180             InitializeCriticalSection(&m_critsec);
0181         }
0182         
0183         multi_threaded_local(const multi_threaded_local&)
0184         {
0185             InitializeCriticalSection(&m_critsec);
0186         }
0187         
0188         virtual ~multi_threaded_local()
0189         {
0190             DeleteCriticalSection(&m_critsec);
0191         }
0192         
0193         void lock()
0194         {
0195             EnterCriticalSection(&m_critsec);
0196         }
0197         
0198         void unlock()
0199         {
0200             LeaveCriticalSection(&m_critsec);
0201         }
0202         
0203     private:
0204         CRITICAL_SECTION m_critsec;
0205     };
0206 #endif // _SIGSLOT_HAS_WIN32_THREADS

0207     
0208 #ifdef _SIGSLOT_HAS_POSIX_THREADS
0209     // The multi threading policies only get compiled in if they are enabled.

0210     class multi_threaded_global
0211     {
0212     public:
0213         multi_threaded_global()
0214         {
0215             pthread_mutex_init(get_mutex(), NULL);
0216         }
0217         
0218         multi_threaded_global(const multi_threaded_global&)
0219         {
0220             ;
0221         }
0222         
0223         virtual ~multi_threaded_global()
0224         {
0225             ;
0226         }
0227         
0228         void lock()
0229         {
0230             pthread_mutex_lock(get_mutex());
0231         }
0232         
0233         void unlock()
0234         {
0235             pthread_mutex_unlock(get_mutex());
0236         }
0237         
0238     private:
0239         pthread_mutex_t* get_mutex()
0240         {
0241             static pthread_mutex_t g_mutex;
0242             return &g_mutex;
0243         }
0244     };
0245     
0246     class multi_threaded_local
0247     {
0248     public:
0249         multi_threaded_local()
0250         {
0251             pthread_mutex_init(&m_mutex, NULL);
0252         }
0253         
0254         multi_threaded_local(const multi_threaded_local&)
0255         {
0256             pthread_mutex_init(&m_mutex, NULL);
0257         }
0258         
0259         virtual ~multi_threaded_local()
0260         {
0261             pthread_mutex_destroy(&m_mutex);
0262         }
0263         
0264         void lock()
0265         {
0266             pthread_mutex_lock(&m_mutex);
0267         }
0268         
0269         void unlock()
0270         {
0271             pthread_mutex_unlock(&m_mutex);
0272         }
0273         
0274     private:
0275         pthread_mutex_t m_mutex;
0276     };
0277 #endif // _SIGSLOT_HAS_POSIX_THREADS

0278     
0279     template<class mt_policy>
0280     class lock_block
0281     {
0282     public:
0283         mt_policy *m_mutex;
0284         
0285         lock_block(mt_policy *mtx)
0286         : m_mutex(mtx)
0287         {
0288             m_mutex->lock();
0289         }
0290         
0291         ~lock_block()
0292         {
0293             m_mutex->unlock();
0294         }
0295     };
0296     
0297     template<class mt_policy>
0298     class has_slots;
0299     
0300     template<class mt_policy>
0301     class _connection_base0
0302     {
0303     public:
0304         virtual ~_connection_base0() { }
0305         virtual has_slots<mt_policy>* getdest() const = 0;
0306         virtual void emit() = 0;
0307         virtual _connection_base0* clone() = 0;
0308         virtual _connection_base0* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0309     };
0310     
0311     template<class arg1_type, class mt_policy>
0312     class _connection_base1
0313     {
0314     public:
0315         virtual ~_connection_base1() { }
0316         virtual has_slots<mt_policy>* getdest() const = 0;
0317         virtual void emit(arg1_type) = 0;
0318         virtual _connection_base1<arg1_type, mt_policy>* clone() = 0;
0319         virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0320     };
0321     
0322     template<class arg1_type, class arg2_type, class mt_policy>
0323     class _connection_base2
0324     {
0325     public:
0326         virtual ~_connection_base2() { }
0327         virtual has_slots<mt_policy>* getdest() const = 0;
0328         virtual void emit(arg1_type, arg2_type) = 0;
0329         virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0;
0330         virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0331     };
0332     
0333     template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
0334     class _connection_base3
0335     {
0336     public:
0337         virtual ~_connection_base3() { }
0338         virtual has_slots<mt_policy>* getdest() const = 0;
0339         virtual void emit(arg1_type, arg2_type, arg3_type) = 0;
0340         virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0;
0341         virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0342     };
0343     
0344     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
0345     class _connection_base4
0346     {
0347     public:
0348         virtual ~_connection_base4() { }
0349         virtual has_slots<mt_policy>* getdest() const = 0;
0350         virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0;
0351         virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0;
0352         virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0353     };
0354     
0355     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
0356     class arg5_type, class mt_policy>
0357     class _connection_base5
0358     {
0359     public:
0360         virtual ~_connection_base5() { }
0361         virtual has_slots<mt_policy>* getdest() const = 0;
0362         virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, 
0363                           arg5_type) = 0;
0364         virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
0365         arg5_type, mt_policy>* clone() = 0;
0366         virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
0367         arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0368     };
0369     
0370     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
0371     class arg5_type, class arg6_type, class mt_policy>
0372     class _connection_base6
0373     {
0374     public:
0375         virtual ~_connection_base6() { }
0376         virtual has_slots<mt_policy>* getdest() const = 0;
0377         virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
0378                           arg6_type) = 0;
0379         virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
0380         arg5_type, arg6_type, mt_policy>* clone() = 0;
0381         virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
0382         arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0383     };
0384     
0385     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
0386     class arg5_type, class arg6_type, class arg7_type, class mt_policy>
0387     class _connection_base7
0388     {
0389     public:
0390         virtual ~_connection_base7() { }
0391         virtual has_slots<mt_policy>* getdest() const = 0;
0392         virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
0393                           arg6_type, arg7_type) = 0;
0394         virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
0395         arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0;
0396         virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
0397         arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0398     };
0399     
0400     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
0401     class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
0402     class _connection_base8
0403     {
0404     public:
0405         virtual ~_connection_base8() { }
0406         virtual has_slots<mt_policy>* getdest() const = 0;
0407         virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
0408                           arg6_type, arg7_type, arg8_type) = 0;
0409         virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
0410         arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0;
0411         virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
0412         arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
0413     };
0414     
0415     template<class mt_policy>
0416     class _signal_base : public mt_policy
0417     {
0418     public:
0419         virtual void slot_disconnect(has_slots<mt_policy>* pslot) = 0;
0420         virtual void slot_duplicate(const has_slots<mt_policy>* poldslot, has_slots<mt_policy>* pnewslot) = 0;
0421     };
0422     
0423     template<class  mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
0424     class has_slots : public mt_policy 
0425     {
0426     private:
0427         typedef typename std::set<_signal_base<mt_policy> *> sender_set;
0428         typedef typename sender_set::const_iterator const_iterator;
0429         
0430     public:
0431         has_slots()
0432         {
0433             ;
0434         }
0435         
0436         has_slots(const has_slots& hs)
0437         : mt_policy(hs)
0438         {
0439             lock_block<mt_policy> lock(this);
0440             const_iterator it = hs.m_senders.begin();
0441             const_iterator itEnd = hs.m_senders.end();
0442             
0443             while(it != itEnd)
0444             {
0445                 (*it)->slot_duplicate(&hs, this);
0446                 m_senders.insert(*it);
0447                 ++it;
0448             }
0449         } 
0450         
0451         void signal_connect(_signal_base<mt_policy>* sender)
0452         {
0453             lock_block<mt_policy> lock(this);
0454             m_senders.insert(sender);
0455         }
0456         
0457         void signal_disconnect(_signal_base<mt_policy>* sender)
0458         {
0459             lock_block<mt_policy> lock(this);
0460             m_senders.erase(sender);
0461         }
0462         
0463         virtual ~has_slots()
0464         {
0465             disconnect_all();
0466         }
0467         
0468         void disconnect_all()
0469         {
0470             lock_block<mt_policy> lock(this);
0471             const_iterator it = m_senders.begin();
0472             const_iterator itEnd = m_senders.end();
0473             
0474             while(it != itEnd)
0475             {
0476                 (*it)->slot_disconnect(this);
0477                 ++it;
0478             }
0479             
0480             m_senders.erase(m_senders.begin(), m_senders.end());
0481         }
0482         
0483     private:
0484         sender_set m_senders;
0485     };
0486     
0487     template<class mt_policy>
0488     class _signal_base0 : public _signal_base<mt_policy>
0489     {
0490     public:
0491         typedef typename std::list<_connection_base0<mt_policy> *>  connections_list;
0492         typedef typename connections_list::const_iterator const_iterator;
0493         typedef typename connections_list::iterator iterator;
0494         
0495         _signal_base0()
0496         {
0497             ;
0498         }
0499         
0500         _signal_base0(const _signal_base0& s)
0501         : _signal_base<mt_policy>(s)
0502         {
0503             lock_block<mt_policy> lock(this);
0504             const_iterator  it = s.m_connected_slots.begin();
0505             const_iterator itEnd = s.m_connected_slots.end();
0506             
0507             while(it != itEnd)
0508             {
0509                 (*it)->getdest()->signal_connect(this);
0510                 m_connected_slots.push_back((*it)->clone());
0511                 
0512                 ++it;
0513             }
0514         }
0515         
0516         ~_signal_base0()
0517         {
0518             disconnect_all();
0519         }
0520         
0521         void disconnect_all()
0522         {
0523             lock_block<mt_policy> lock(this);
0524             const_iterator it  = m_connected_slots.begin();
0525             const_iterator itEnd = m_connected_slots.end();
0526             
0527             while(it != itEnd)
0528             {
0529                 (*it)->getdest()->signal_disconnect(this);
0530                 delete *it;
0531                 
0532                 ++it;
0533             }
0534             
0535             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
0536         }
0537         
0538         void disconnect(has_slots<mt_policy>* pclass)
0539         {
0540             lock_block<mt_policy> lock(this);
0541             iterator it = m_connected_slots.begin();
0542             iterator itEnd = m_connected_slots.end();
0543             
0544             while(it != itEnd)
0545             {
0546                 if((*it)->getdest() == pclass)
0547                 {
0548                     delete *it;
0549                     m_connected_slots.erase(it);
0550                     pclass->signal_disconnect(this);
0551                     return;
0552                 }
0553                 
0554                 ++it;
0555             }
0556         }
0557         
0558         void slot_disconnect(has_slots<mt_policy>* pslot)
0559         {
0560             lock_block<mt_policy> lock(this);
0561             iterator it = m_connected_slots.begin();
0562             iterator itEnd = m_connected_slots.end();
0563             
0564             while(it != itEnd)
0565             {
0566                 iterator itNext = it;
0567                 ++itNext;
0568                 
0569                 if((*it)->getdest() == pslot)
0570                 {
0571                     delete *it;
0572                     m_connected_slots.erase(it);
0573                 }
0574                 
0575                 it = itNext;
0576             }
0577         }
0578         
0579         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
0580         {
0581             lock_block<mt_policy> lock(this);
0582             iterator it = m_connected_slots.begin();
0583             iterator itEnd = m_connected_slots.end();
0584             
0585             while(it != itEnd)
0586             {
0587                 if((*it)->getdest() == oldtarget)
0588                 {
0589                     m_connected_slots.push_back((*it)->duplicate(newtarget));
0590                 }
0591                 
0592                 ++it;
0593             }
0594         }
0595         
0596     protected:
0597         connections_list m_connected_slots;   
0598     };
0599     
0600     template<class arg1_type, class mt_policy>
0601     class _signal_base1 : public _signal_base<mt_policy>
0602     {
0603     public:
0604         typedef typename std::list<_connection_base1<arg1_type, mt_policy> *>  connections_list;
0605         typedef typename connections_list::const_iterator const_iterator;
0606         typedef typename connections_list::iterator iterator;
0607         
0608         _signal_base1()
0609         {
0610             ;
0611         }
0612         
0613         _signal_base1(const _signal_base1<arg1_type, mt_policy>& s)
0614         : _signal_base<mt_policy>(s)
0615         {
0616             lock_block<mt_policy> lock(this);
0617             const_iterator it = s.m_connected_slots.begin();
0618             const_iterator itEnd = s.m_connected_slots.end();
0619             
0620             while(it != itEnd)
0621             {
0622                 (*it)->getdest()->signal_connect(this);
0623                 m_connected_slots.push_back((*it)->clone());
0624                 
0625                 ++it;
0626             }
0627         }
0628         
0629         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
0630         {
0631             lock_block<mt_policy> lock(this);
0632             iterator it = m_connected_slots.begin();
0633             iterator itEnd = m_connected_slots.end();
0634             
0635             while(it != itEnd)
0636             {
0637                 if((*it)->getdest() == oldtarget)
0638                 {
0639                     m_connected_slots.push_back((*it)->duplicate(newtarget));
0640                 }
0641                 
0642                 ++it;
0643             }
0644         }
0645         
0646         ~_signal_base1()
0647         {
0648             disconnect_all();
0649         }
0650         
0651         void disconnect_all()
0652         {
0653             lock_block<mt_policy> lock(this);
0654             const_iterator it = m_connected_slots.begin();
0655             const_iterator itEnd = m_connected_slots.end();
0656             
0657             while(it != itEnd)
0658             {
0659                 (*it)->getdest()->signal_disconnect(this);
0660                 delete *it;
0661                 
0662                 ++it;
0663             }
0664             
0665             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
0666         }
0667         
0668         void disconnect(has_slots<mt_policy>* pclass)
0669         {
0670             lock_block<mt_policy> lock(this);
0671             iterator it = m_connected_slots.begin();
0672             iterator itEnd = m_connected_slots.end();
0673             
0674             while(it != itEnd)
0675             {
0676                 if((*it)->getdest() == pclass)
0677                 {
0678                     delete *it;
0679                     m_connected_slots.erase(it);
0680                     pclass->signal_disconnect(this);
0681                     return;
0682                 }
0683                 
0684                 ++it;
0685             }
0686         }
0687         
0688         void slot_disconnect(has_slots<mt_policy>* pslot)
0689         {
0690             lock_block<mt_policy> lock(this);
0691             iterator it = m_connected_slots.begin();
0692             iterator itEnd = m_connected_slots.end();
0693             
0694             while(it != itEnd)
0695             {
0696                 iterator itNext = it;
0697                 ++itNext;
0698                 
0699                 if((*it)->getdest() == pslot)
0700                 {
0701                     delete *it;
0702                     m_connected_slots.erase(it);
0703                 }
0704                 
0705                 it = itNext;
0706             }
0707         }
0708         
0709         
0710     protected:
0711         connections_list m_connected_slots;   
0712     };
0713     
0714     template<class arg1_type, class arg2_type, class mt_policy>
0715     class _signal_base2 : public _signal_base<mt_policy>
0716     {
0717     public:
0718         typedef typename std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *>
0719         connections_list;
0720         typedef typename connections_list::const_iterator const_iterator;
0721         typedef typename connections_list::iterator iterator;
0722         
0723         _signal_base2()
0724         {
0725             ;
0726         }
0727         
0728         _signal_base2(const _signal_base2<arg1_type, arg2_type, mt_policy>& s)
0729         : _signal_base<mt_policy>(s)
0730         {
0731             lock_block<mt_policy> lock(this);
0732             const_iterator it = s.m_connected_slots.begin();
0733             const_iterator itEnd = s.m_connected_slots.end();
0734             
0735             while(it != itEnd)
0736             {
0737                 (*it)->getdest()->signal_connect(this);
0738                 m_connected_slots.push_back((*it)->clone());
0739                 
0740                 ++it;
0741             }
0742         }
0743         
0744         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
0745         {
0746             lock_block<mt_policy> lock(this);
0747             iterator it = m_connected_slots.begin();
0748             iterator itEnd = m_connected_slots.end();
0749             
0750             while(it != itEnd)
0751             {
0752                 if((*it)->getdest() == oldtarget)
0753                 {
0754                     m_connected_slots.push_back((*it)->duplicate(newtarget));
0755                 }
0756                 
0757                 ++it;
0758             }
0759         }
0760         
0761         ~_signal_base2()
0762         {
0763             disconnect_all();
0764         }
0765         
0766         void disconnect_all()
0767         {
0768             lock_block<mt_policy> lock(this);
0769             const_iterator it = m_connected_slots.begin();
0770             const_iterator itEnd = m_connected_slots.end();
0771             
0772             while(it != itEnd)
0773             {
0774                 (*it)->getdest()->signal_disconnect(this);
0775                 delete *it;
0776                 
0777                 ++it;
0778             }
0779             
0780             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
0781         }
0782         
0783         void disconnect(has_slots<mt_policy>* pclass)
0784         {
0785             lock_block<mt_policy> lock(this);
0786             iterator it = m_connected_slots.begin();
0787             iterator itEnd = m_connected_slots.end();
0788             
0789             while(it != itEnd)
0790             {
0791                 if((*it)->getdest() == pclass)
0792                 {
0793                     delete *it;
0794                     m_connected_slots.erase(it);
0795                     pclass->signal_disconnect(this);
0796                     return;
0797                 }
0798                 
0799                 ++it;
0800             }
0801         }
0802         
0803         void slot_disconnect(has_slots<mt_policy>* pslot)
0804         {
0805             lock_block<mt_policy> lock(this);
0806             iterator it = m_connected_slots.begin();
0807             iterator itEnd = m_connected_slots.end();
0808             
0809             while(it != itEnd)
0810             {
0811                 iterator itNext = it;
0812                 ++itNext;
0813                 
0814                 if((*it)->getdest() == pslot)
0815                 {
0816                     delete *it;
0817                     m_connected_slots.erase(it);
0818                 }
0819                 
0820                 it = itNext;
0821             }
0822         }
0823         
0824     protected:
0825         connections_list m_connected_slots;   
0826     };
0827     
0828     template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
0829     class _signal_base3 : public _signal_base<mt_policy>
0830     {
0831     public:
0832         typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *>
0833         connections_list;
0834         
0835         typedef typename connections_list::const_iterator const_iterator;
0836         typedef typename connections_list::iterator iterator;
0837         _signal_base3()
0838         {
0839             ;
0840         }
0841         
0842         _signal_base3(const _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
0843         : _signal_base<mt_policy>(s)
0844         {
0845             lock_block<mt_policy> lock(this);
0846             const_iterator it = s.m_connected_slots.begin();
0847             const_iterator itEnd = s.m_connected_slots.end();
0848             
0849             while(it != itEnd)
0850             {
0851                 (*it)->getdest()->signal_connect(this);
0852                 m_connected_slots.push_back((*it)->clone());
0853                 
0854                 ++it;
0855             }
0856         }
0857         
0858         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
0859         {
0860             lock_block<mt_policy> lock(this);
0861             iterator it = m_connected_slots.begin();
0862             iterator itEnd = m_connected_slots.end();
0863             
0864             while(it != itEnd)
0865             {
0866                 if((*it)->getdest() == oldtarget)
0867                 {
0868                     m_connected_slots.push_back((*it)->duplicate(newtarget));
0869                 }
0870                 
0871                 ++it;
0872             }
0873         }
0874         
0875         ~_signal_base3()
0876         {
0877             disconnect_all();
0878         }
0879         
0880         void disconnect_all()
0881         {
0882             lock_block<mt_policy> lock(this);
0883             const_iterator it = m_connected_slots.begin();
0884             const_iterator itEnd = m_connected_slots.end();
0885             
0886             while(it != itEnd)
0887             {
0888                 (*it)->getdest()->signal_disconnect(this);
0889                 delete *it;
0890                 
0891                 ++it;
0892             }
0893             
0894             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
0895         }
0896         
0897         void disconnect(has_slots<mt_policy>* pclass)
0898         {
0899             lock_block<mt_policy> lock(this);
0900             iterator it = m_connected_slots.begin();
0901             iterator itEnd = m_connected_slots.end();
0902             
0903             while(it != itEnd)
0904             {
0905                 if((*it)->getdest() == pclass)
0906                 {
0907                     delete *it;
0908                     m_connected_slots.erase(it);
0909                     pclass->signal_disconnect(this);
0910                     return;
0911                 }
0912                 
0913                 ++it;
0914             }
0915         }
0916         
0917         void slot_disconnect(has_slots<mt_policy>* pslot)
0918         {
0919             lock_block<mt_policy> lock(this);
0920             iterator it = m_connected_slots.begin();
0921             iterator itEnd = m_connected_slots.end();
0922             
0923             while(it != itEnd)
0924             {
0925                 iterator itNext = it;
0926                 ++itNext;
0927                 
0928                 if((*it)->getdest() == pslot)
0929                 {
0930                     delete *it;
0931                     m_connected_slots.erase(it);
0932                 }
0933                 
0934                 it = itNext;
0935             }
0936         }
0937         
0938     protected:
0939         connections_list m_connected_slots;   
0940     };
0941     
0942     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
0943     class _signal_base4 : public _signal_base<mt_policy>
0944     {
0945     public:
0946         typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type,
0947         arg4_type, mt_policy> *>  connections_list;
0948         typedef typename connections_list::const_iterator const_iterator;
0949         typedef typename connections_list::iterator iterator;
0950         
0951         _signal_base4()
0952         {
0953             ;
0954         }
0955         
0956         _signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
0957         : _signal_base<mt_policy>(s)
0958         {
0959             lock_block<mt_policy> lock(this);
0960             const_iterator it = s.m_connected_slots.begin();
0961             const_iterator itEnd = s.m_connected_slots.end();
0962             
0963             while(it != itEnd)
0964             {
0965                 (*it)->getdest()->signal_connect(this);
0966                 m_connected_slots.push_back((*it)->clone());
0967                 
0968                 ++it;
0969             }
0970         }
0971         
0972         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
0973         {
0974             lock_block<mt_policy> lock(this);
0975             iterator it = m_connected_slots.begin();
0976             iterator itEnd = m_connected_slots.end();
0977             
0978             while(it != itEnd)
0979             {
0980                 if((*it)->getdest() == oldtarget)
0981                 {
0982                     m_connected_slots.push_back((*it)->duplicate(newtarget));
0983                 }
0984                 
0985                 ++it;
0986             }
0987         }
0988         
0989         ~_signal_base4()
0990         {
0991             disconnect_all();
0992         }
0993         
0994         void disconnect_all()
0995         {
0996             lock_block<mt_policy> lock(this);
0997             const_iterator it = m_connected_slots.begin();
0998             const_iterator itEnd = m_connected_slots.end();
0999             
1000             while(it != itEnd)
1001             {
1002                 (*it)->getdest()->signal_disconnect(this);
1003                 delete *it;
1004                 
1005                 ++it;
1006             }
1007             
1008             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1009         }
1010         
1011         void disconnect(has_slots<mt_policy>* pclass)
1012         {
1013             lock_block<mt_policy> lock(this);
1014             iterator it = m_connected_slots.begin();
1015             iterator itEnd = m_connected_slots.end();
1016             
1017             while(it != itEnd)
1018             {
1019                 if((*it)->getdest() == pclass)
1020                 {
1021                     delete *it;
1022                     this->m_connected_slots.erase(it);
1023                     pclass->signal_disconnect(this);
1024                     return;
1025                 }
1026                 
1027                 ++it;
1028             }
1029         }
1030         
1031         void slot_disconnect(has_slots<mt_policy>* pslot)
1032         {
1033             lock_block<mt_policy> lock(this);
1034             iterator it = m_connected_slots.begin();
1035             iterator itEnd = m_connected_slots.end();
1036             
1037             while(it != itEnd)
1038             {
1039                 iterator itNext = it;
1040                 ++itNext;
1041                 
1042                 if((*it)->getdest() == pslot)
1043                 {
1044                     delete *it;
1045                     m_connected_slots.erase(it);
1046                 }
1047                 
1048                 it = itNext;
1049             }
1050         }
1051         
1052     protected:
1053         connections_list m_connected_slots;   
1054     };
1055     
1056     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1057     class arg5_type, class mt_policy>
1058     class _signal_base5 : public _signal_base<mt_policy>
1059     {
1060     public:
1061         typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type,
1062         arg4_type, arg5_type, mt_policy> *>  connections_list;
1063         typedef typename connections_list::const_iterator const_iterator;
1064         typedef typename connections_list::iterator iterator;
1065         
1066         _signal_base5()
1067         {
1068             ;
1069         }
1070         
1071         _signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
1072                       arg5_type, mt_policy>& s)
1073         : _signal_base<mt_policy>(s)
1074         {
1075             lock_block<mt_policy> lock(this);
1076             const_iterator it = s.m_connected_slots.begin();
1077             const_iterator itEnd = s.m_connected_slots.end();
1078             
1079             while(it != itEnd)
1080             {
1081                 (*it)->getdest()->signal_connect(this);
1082                 m_connected_slots.push_back((*it)->clone());
1083                 
1084                 ++it;
1085             }
1086         }
1087         
1088         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1089         {
1090             lock_block<mt_policy> lock(this);
1091             iterator it = m_connected_slots.begin();
1092             iterator itEnd = m_connected_slots.end();
1093             
1094             while(it != itEnd)
1095             {
1096                 if((*it)->getdest() == oldtarget)
1097                 {
1098                     m_connected_slots.push_back((*it)->duplicate(newtarget));
1099                 }
1100                 
1101                 ++it;
1102             }
1103         }
1104         
1105         ~_signal_base5()
1106         {
1107             disconnect_all();
1108         }
1109         
1110         void disconnect_all()
1111         {
1112             lock_block<mt_policy> lock(this);
1113             const_iterator it = m_connected_slots.begin();
1114             const_iterator itEnd = m_connected_slots.end();
1115             
1116             while(it != itEnd)
1117             {
1118                 (*it)->getdest()->signal_disconnect(this);
1119                 delete *it;
1120                 
1121                 ++it;
1122             }
1123             
1124             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1125         }
1126         
1127         void disconnect(has_slots<mt_policy>* pclass)
1128         {
1129             lock_block<mt_policy> lock(this);
1130             iterator it = m_connected_slots.begin();
1131             iterator itEnd = m_connected_slots.end();
1132             
1133             while(it != itEnd)
1134             {
1135                 if((*it)->getdest() == pclass)
1136                 {
1137                     delete *it;
1138                     m_connected_slots.erase(it);
1139                     pclass->signal_disconnect(this);
1140                     return;
1141                 }
1142                 
1143                 ++it;
1144             }
1145         }
1146         
1147         void slot_disconnect(has_slots<mt_policy>* pslot)
1148         {
1149             lock_block<mt_policy> lock(this);
1150             iterator it = m_connected_slots.begin();
1151             iterator itEnd = m_connected_slots.end();
1152             
1153             while(it != itEnd)
1154             {
1155                 iterator itNext = it;
1156                 ++itNext;
1157                 
1158                 if((*it)->getdest() == pslot)
1159                 {
1160                     delete *it;
1161                     m_connected_slots.erase(it);
1162                 }
1163                 
1164                 it = itNext;
1165             }
1166         }
1167         
1168     protected:
1169         connections_list m_connected_slots;   
1170     };
1171     
1172     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1173     class arg5_type, class arg6_type, class mt_policy>
1174     class _signal_base6 : public _signal_base<mt_policy>
1175     {
1176     public:
1177         typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type, 
1178         arg4_type, arg5_type, arg6_type, mt_policy> *>  connections_list;
1179         typedef typename connections_list::const_iterator const_iterator;
1180         typedef typename connections_list::iterator iterator;
1181         
1182         _signal_base6()
1183         {
1184             ;
1185         }
1186         
1187         _signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
1188                       arg5_type, arg6_type, mt_policy>& s)
1189         : _signal_base<mt_policy>(s)
1190         {
1191             lock_block<mt_policy> lock(this);
1192             const_iterator it = s.m_connected_slots.begin();
1193             const_iterator itEnd = s.m_connected_slots.end();
1194             
1195             while(it != itEnd)
1196             {
1197                 (*it)->getdest()->signal_connect(this);
1198                 m_connected_slots.push_back((*it)->clone());
1199                 
1200                 ++it;
1201             }
1202         }
1203         
1204         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1205         {
1206             lock_block<mt_policy> lock(this);
1207             iterator it = m_connected_slots.begin();
1208             iterator itEnd = m_connected_slots.end();
1209             
1210             while(it != itEnd)
1211             {
1212                 if((*it)->getdest() == oldtarget)
1213                 {
1214                     m_connected_slots.push_back((*it)->duplicate(newtarget));
1215                 }
1216                 
1217                 ++it;
1218             }
1219         }
1220         
1221         ~_signal_base6()
1222         {
1223             disconnect_all();
1224         }
1225         
1226         void disconnect_all()
1227         {
1228             lock_block<mt_policy> lock(this);
1229             const_iterator it = m_connected_slots.begin();
1230             const_iterator itEnd = m_connected_slots.end();
1231             
1232             while(it != itEnd)
1233             {
1234                 (*it)->getdest()->signal_disconnect(this);
1235                 delete *it;
1236                 
1237                 ++it;
1238             }
1239             
1240             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1241         }
1242         
1243         void disconnect(has_slots<mt_policy>* pclass)
1244         {
1245             lock_block<mt_policy> lock(this);
1246             iterator it = m_connected_slots.begin();
1247             iterator itEnd = m_connected_slots.end();
1248             
1249             while(it != itEnd)
1250             {
1251                 if((*it)->getdest() == pclass)
1252                 {
1253                     delete *it;
1254                     m_connected_slots.erase(it);
1255                     pclass->signal_disconnect(this);
1256                     return;
1257                 }
1258                 
1259                 ++it;
1260             }
1261         }
1262         
1263         void slot_disconnect(has_slots<mt_policy>* pslot)
1264         {
1265             lock_block<mt_policy> lock(this);
1266             iterator it = m_connected_slots.begin();
1267             iterator itEnd = m_connected_slots.end();
1268             
1269             while(it != itEnd)
1270             {
1271                 iterator itNext = it;
1272                 ++itNext;
1273                 
1274                 if((*it)->getdest() == pslot)
1275                 {
1276                     delete *it;
1277                     m_connected_slots.erase(it);
1278                 }
1279                 
1280                 it = itNext;
1281             }
1282         }
1283         
1284     protected:
1285         connections_list m_connected_slots;   
1286     };
1287     
1288     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1289     class arg5_type, class arg6_type, class arg7_type, class mt_policy>
1290     class _signal_base7 : public _signal_base<mt_policy>
1291     {
1292     public:
1293         typedef std::list<_connection_base7<arg1_type, arg2_type, arg3_type, 
1294         arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> *>  connections_list;
1295         typedef typename connections_list::const_iterator const_iterator;
1296         typedef typename connections_list::iterator iterator;
1297         
1298         _signal_base7()
1299         {
1300             ;
1301         }
1302         
1303         _signal_base7(const _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
1304                       arg5_type, arg6_type, arg7_type, mt_policy>& s)
1305         : _signal_base<mt_policy>(s)
1306         {
1307             lock_block<mt_policy> lock(this);
1308             const_iterator it = s.m_connected_slots.begin();
1309             const_iterator itEnd = s.m_connected_slots.end();
1310             
1311             while(it != itEnd)
1312             {
1313                 (*it)->getdest()->signal_connect(this);
1314                 m_connected_slots.push_back((*it)->clone());
1315                 
1316                 ++it;
1317             }
1318         }
1319         
1320         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1321         {
1322             lock_block<mt_policy> lock(this);
1323             iterator it = m_connected_slots.begin();
1324             iterator itEnd = m_connected_slots.end();
1325             
1326             while(it != itEnd)
1327             {
1328                 if((*it)->getdest() == oldtarget)
1329                 {
1330                     m_connected_slots.push_back((*it)->duplicate(newtarget));
1331                 }
1332                 
1333                 ++it;
1334             }
1335         }
1336         
1337         ~_signal_base7()
1338         {
1339             disconnect_all();
1340         }
1341         
1342         void disconnect_all()
1343         {
1344             lock_block<mt_policy> lock(this);
1345             const_iterator it = m_connected_slots.begin();
1346             const_iterator itEnd = m_connected_slots.end();
1347             
1348             while(it != itEnd)
1349             {
1350                 (*it)->getdest()->signal_disconnect(this);
1351                 delete *it;
1352                 
1353                 ++it;
1354             }
1355             
1356             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1357         }
1358         
1359         void disconnect(has_slots<mt_policy>* pclass)
1360         {
1361             lock_block<mt_policy> lock(this);
1362             iterator it = m_connected_slots.begin();
1363             iterator itEnd = m_connected_slots.end();
1364             
1365             while(it != itEnd)
1366             {
1367                 if((*it)->getdest() == pclass)
1368                 {
1369                     delete *it;
1370                     m_connected_slots.erase(it);
1371                     pclass->signal_disconnect(this);
1372                     return;
1373                 }
1374                 
1375                 ++it;
1376             }
1377         }
1378         
1379         void slot_disconnect(has_slots<mt_policy>* pslot)
1380         {
1381             lock_block<mt_policy> lock(this);
1382             iterator it = m_connected_slots.begin();
1383             iterator itEnd = m_connected_slots.end();
1384             
1385             while(it != itEnd)
1386             {
1387                 iterator itNext = it;
1388                 ++itNext;
1389                 
1390                 if((*it)->getdest() == pslot)
1391                 {
1392                     delete *it;
1393                     m_connected_slots.erase(it);
1394                 }
1395                 
1396                 it = itNext;
1397             }
1398         }
1399         
1400     protected:
1401         connections_list m_connected_slots;   
1402     };
1403     
1404     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1405     class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
1406     class _signal_base8 : public _signal_base<mt_policy>
1407     {
1408     public:
1409         typedef std::list<_connection_base8<arg1_type, arg2_type, arg3_type, 
1410         arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> *>
1411         connections_list;
1412         typedef typename connections_list::const_iterator const_iterator;
1413         typedef typename connections_list::iterator iterator;
1414         
1415         _signal_base8()
1416         {
1417             ;
1418         }
1419         
1420         _signal_base8(const _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
1421                       arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
1422         : _signal_base<mt_policy>(s)
1423         {
1424             lock_block<mt_policy> lock(this);
1425             const_iterator it = s.m_connected_slots.begin();
1426             const_iterator itEnd = s.m_connected_slots.end();
1427             
1428             while(it != itEnd)
1429             {
1430                 (*it)->getdest()->signal_connect(this);
1431                 m_connected_slots.push_back((*it)->clone());
1432                 
1433                 ++it;
1434             }
1435         }
1436         
1437         void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1438         {
1439             lock_block<mt_policy> lock(this);
1440             iterator it = m_connected_slots.begin();
1441             iterator itEnd = m_connected_slots.end();
1442             
1443             while(it != itEnd)
1444             {
1445                 if((*it)->getdest() == oldtarget)
1446                 {
1447                     m_connected_slots.push_back((*it)->duplicate(newtarget));
1448                 }
1449                 
1450                 ++it;
1451             }
1452         }
1453         
1454         ~_signal_base8()
1455         {
1456             disconnect_all();
1457         }
1458         
1459         void disconnect_all()
1460         {
1461             lock_block<mt_policy> lock(this);
1462             const_iterator it = m_connected_slots.begin();
1463             const_iterator itEnd = m_connected_slots.end();
1464             
1465             while(it != itEnd)
1466             {
1467                 (*it)->getdest()->signal_disconnect(this);
1468                 delete *it;
1469                 
1470                 ++it;
1471             }
1472             
1473             m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1474         }
1475         
1476         void disconnect(has_slots<mt_policy>* pclass)
1477         {
1478             lock_block<mt_policy> lock(this);
1479             iterator it = m_connected_slots.begin();
1480             iterator itEnd = m_connected_slots.end();
1481             
1482             while(it != itEnd)
1483             {
1484                 if((*it)->getdest() == pclass)
1485                 {
1486                     delete *it;
1487                     m_connected_slots.erase(it);
1488                     pclass->signal_disconnect(this);
1489                     return;
1490                 }
1491                 
1492                 ++it;
1493             }
1494         }
1495         
1496         void slot_disconnect(has_slots<mt_policy>* pslot)
1497         {
1498             lock_block<mt_policy> lock(this);
1499             iterator it = m_connected_slots.begin();
1500             iterator itEnd = m_connected_slots.end();
1501             
1502             while(it != itEnd)
1503             {
1504                 iterator itNext = it;
1505                 ++itNext;
1506                 
1507                 if((*it)->getdest() == pslot)
1508                 {
1509                     delete *it;
1510                     m_connected_slots.erase(it);
1511                 }
1512                 
1513                 it = itNext;
1514             }
1515         }
1516         
1517     protected:
1518         connections_list m_connected_slots;   
1519     };
1520     
1521     
1522     template<class dest_type, class mt_policy>
1523     class _connection0 : public _connection_base0<mt_policy>
1524     {
1525     public:
1526         _connection0()
1527         {
1528             this->pobject = NULL;
1529             this->pmemfun = NULL;
1530         }
1531         
1532         _connection0(dest_type* pobject, void (dest_type::*pmemfun)())
1533         {
1534             m_pobject = pobject;
1535             m_pmemfun = pmemfun;
1536         }
1537         
1538         virtual _connection_base0<mt_policy>* clone()
1539         {
1540             return new _connection0<dest_type, mt_policy>(*this);
1541         }
1542         
1543         virtual _connection_base0<mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1544         {
1545             return new _connection0<dest_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1546         }
1547         
1548         virtual void emit()
1549         {
1550             (m_pobject->*m_pmemfun)();
1551         }
1552         
1553         virtual has_slots<mt_policy>* getdest() const
1554         {
1555             return m_pobject;
1556         }
1557         
1558     private:
1559         dest_type* m_pobject;
1560         void (dest_type::* m_pmemfun)();
1561     };
1562     
1563     template<class dest_type, class arg1_type, class mt_policy>
1564     class _connection1 : public _connection_base1<arg1_type, mt_policy>
1565     {
1566     public:
1567         _connection1()
1568         {
1569             this->pobject = NULL;
1570             this->pmemfun = NULL;
1571         }
1572         
1573         _connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type))
1574         {
1575             m_pobject = pobject;
1576             m_pmemfun = pmemfun;
1577         }
1578         
1579         virtual _connection_base1<arg1_type, mt_policy>* clone()
1580         {
1581             return new _connection1<dest_type, arg1_type, mt_policy>(*this);
1582         }
1583         
1584         virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1585         {
1586             return new _connection1<dest_type, arg1_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1587         }
1588         
1589         virtual void emit(arg1_type a1)
1590         {
1591             (m_pobject->*m_pmemfun)(a1);
1592         }
1593         
1594         virtual has_slots<mt_policy>* getdest() const
1595         {
1596             return m_pobject;
1597         }
1598         
1599     private:
1600         dest_type* m_pobject;
1601         void (dest_type::* m_pmemfun)(arg1_type);
1602     };
1603     
1604     template<class dest_type, class arg1_type, class arg2_type, class mt_policy>
1605     class _connection2 : public _connection_base2<arg1_type, arg2_type, mt_policy>
1606     {
1607     public:
1608         _connection2()
1609         {
1610             this->pobject = NULL;
1611             this->pmemfun = NULL;
1612         }
1613         
1614         _connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1615                                                                     arg2_type))
1616         {
1617             m_pobject = pobject;
1618             m_pmemfun = pmemfun;
1619         }
1620         
1621         virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone()
1622         {
1623             return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>(*this);
1624         }
1625         
1626         virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1627         {
1628             return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1629         }
1630         
1631         virtual void emit(arg1_type a1, arg2_type a2)
1632         {
1633             (m_pobject->*m_pmemfun)(a1, a2);
1634         }
1635         
1636         virtual has_slots<mt_policy>* getdest() const
1637         {
1638             return m_pobject;
1639         }
1640         
1641     private:
1642         dest_type* m_pobject;
1643         void (dest_type::* m_pmemfun)(arg1_type, arg2_type);
1644     };
1645     
1646     template<class dest_type, class arg1_type, class arg2_type, class arg3_type, class mt_policy>
1647     class _connection3 : public _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>
1648     {
1649     public:
1650         _connection3()
1651         {
1652             this->pobject = NULL;
1653             this->pmemfun = NULL;
1654         }
1655         
1656         _connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1657                                                                     arg2_type, arg3_type))
1658         {
1659             m_pobject = pobject;
1660             m_pmemfun = pmemfun;
1661         }
1662         
1663         virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone()
1664         {
1665             return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>(*this);
1666         }
1667         
1668         virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1669         {
1670             return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1671         }
1672         
1673         virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3)
1674         {
1675             (m_pobject->*m_pmemfun)(a1, a2, a3);
1676         }
1677         
1678         virtual has_slots<mt_policy>* getdest() const
1679         {
1680             return m_pobject;
1681         }
1682         
1683     private:
1684         dest_type* m_pobject;
1685         void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type);
1686     };
1687     
1688     template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1689     class arg4_type, class mt_policy>
1690     class _connection4 : public _connection_base4<arg1_type, arg2_type,
1691     arg3_type, arg4_type, mt_policy>
1692     {
1693     public:
1694         _connection4()
1695         {
1696             this->pobject = NULL;
1697             this->pmemfun = NULL;
1698         }
1699         
1700         _connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1701                                                                     arg2_type, arg3_type, arg4_type))
1702         {
1703             m_pobject = pobject;
1704             m_pmemfun = pmemfun;
1705         }
1706         
1707         virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone()
1708         {
1709             return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(*this);
1710         }
1711         
1712         virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1713         {
1714             return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1715         }
1716         
1717         virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, 
1718                           arg4_type a4)
1719         {
1720             (m_pobject->*m_pmemfun)(a1, a2, a3, a4);
1721         }
1722         
1723         virtual has_slots<mt_policy>* getdest() const
1724         {
1725             return m_pobject;
1726         }
1727         
1728     private:
1729         dest_type* m_pobject;
1730         void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type,
1731                                       arg4_type);
1732     };
1733     
1734     template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1735     class arg4_type, class arg5_type, class mt_policy>
1736     class _connection5 : public _connection_base5<arg1_type, arg2_type,
1737     arg3_type, arg4_type, arg5_type, mt_policy>
1738     {
1739     public:
1740         _connection5()
1741         {
1742             this->pobject = NULL;
1743             this->pmemfun = NULL;
1744         }
1745         
1746         _connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1747                                                                     arg2_type, arg3_type, arg4_type, arg5_type))
1748         {
1749             m_pobject = pobject;
1750             m_pmemfun = pmemfun;
1751         }
1752         
1753         virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, 
1754         arg5_type, mt_policy>* clone()
1755         {
1756             return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1757             arg5_type, mt_policy>(*this);
1758         }
1759         
1760         virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, 
1761         arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1762         {
1763             return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1764             arg5_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1765         }
1766         
1767         virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
1768                           arg5_type a5)
1769         {
1770             (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5);
1771         }
1772         
1773         virtual has_slots<mt_policy>* getdest() const
1774         {
1775             return m_pobject;
1776         }
1777         
1778     private:
1779         dest_type* m_pobject;
1780         void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
1781                                       arg5_type);
1782     };
1783     
1784     template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1785     class arg4_type, class arg5_type, class arg6_type, class mt_policy>
1786     class _connection6 : public _connection_base6<arg1_type, arg2_type,
1787     arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>
1788     {
1789     public:
1790         _connection6()
1791         {
1792             this->pobject = NULL;
1793             this->pmemfun = NULL;
1794         }
1795         
1796         _connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1797                                                                     arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
1798         {
1799             m_pobject = pobject;
1800             m_pmemfun = pmemfun;
1801         }
1802         
1803         virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, 
1804         arg5_type, arg6_type, mt_policy>* clone()
1805         {
1806             return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1807             arg5_type, arg6_type, mt_policy>(*this);
1808         }
1809         
1810         virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, 
1811         arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1812         {
1813             return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1814             arg5_type, arg6_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1815         }
1816         
1817         virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
1818                           arg5_type a5, arg6_type a6)
1819         {
1820             (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6);
1821         }
1822         
1823         virtual has_slots<mt_policy>* getdest() const
1824         {
1825             return m_pobject;
1826         }
1827         
1828     private:
1829         dest_type* m_pobject;
1830         void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
1831                                       arg5_type, arg6_type);
1832     };
1833     
1834     template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1835     class arg4_type, class arg5_type, class arg6_type, class arg7_type, class mt_policy>
1836     class _connection7 : public _connection_base7<arg1_type, arg2_type,
1837     arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
1838     {
1839     public:
1840         _connection7()
1841         {
1842             this->pobject = NULL;
1843             this->pmemfun = NULL;
1844         }
1845         
1846         _connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1847                                                                     arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type))
1848         {
1849             m_pobject = pobject;
1850             m_pmemfun = pmemfun;
1851         }
1852         
1853         virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, 
1854         arg5_type, arg6_type, arg7_type, mt_policy>* clone()
1855         {
1856             return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1857             arg5_type, arg6_type, arg7_type, mt_policy>(*this);
1858         }
1859         
1860         virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, 
1861         arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1862         {
1863             return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1864             arg5_type, arg6_type, arg7_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1865         }
1866         
1867         virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
1868                           arg5_type a5, arg6_type a6, arg7_type a7)
1869         {
1870             (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7);
1871         }
1872         
1873         virtual has_slots<mt_policy>* getdest() const
1874         {
1875             return m_pobject;
1876         }
1877         
1878     private:
1879         dest_type* m_pobject;
1880         void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
1881                                       arg5_type, arg6_type, arg7_type);
1882     };
1883     
1884     template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1885     class arg4_type, class arg5_type, class arg6_type, class arg7_type, 
1886     class arg8_type, class mt_policy>
1887     class _connection8 : public _connection_base8<arg1_type, arg2_type,
1888     arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
1889     {
1890     public:
1891         _connection8()
1892         {
1893             this->pobject = NULL;
1894             this->pmemfun = NULL;
1895         }
1896         
1897         _connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1898                                                                     arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, 
1899                                                                     arg7_type, arg8_type))
1900         {
1901             m_pobject = pobject;
1902             m_pmemfun = pmemfun;
1903         }
1904         
1905         virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, 
1906         arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone()
1907         {
1908             return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1909             arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(*this);
1910         }
1911         
1912         virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, 
1913         arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1914         {
1915             return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 
1916             arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1917         }
1918         
1919         virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
1920                           arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
1921         {
1922             (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8);
1923         }
1924         
1925         virtual has_slots<mt_policy>* getdest() const
1926         {
1927             return m_pobject;
1928         }
1929         
1930     private:
1931         dest_type* m_pobject;
1932         void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
1933                                       arg5_type, arg6_type, arg7_type, arg8_type);
1934     };
1935     
1936     template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
1937     class signal0 : public _signal_base0<mt_policy>
1938     {
1939     public:
1940         typedef typename _signal_base0<mt_policy>::connections_list::const_iterator const_iterator;
1941         signal0()
1942         {
1943             ;
1944         }
1945         
1946         signal0(const signal0<mt_policy>& s)
1947         : _signal_base0<mt_policy>(s)
1948         {
1949             ;
1950         }
1951         
1952         template<class desttype>
1953         void connect(desttype* pclass, void (desttype::*pmemfun)())
1954         {
1955             lock_block<mt_policy> lock(this);
1956             _connection0<desttype, mt_policy>* conn = 
1957             new _connection0<desttype, mt_policy>(pclass, pmemfun);
1958             this->m_connected_slots.push_back(conn);
1959             pclass->signal_connect(this);
1960         }
1961         
1962         void emit()
1963         {
1964             lock_block<mt_policy> lock(this);
1965             const_iterator itNext, it = this->m_connected_slots.begin();
1966             const_iterator itEnd = this->m_connected_slots.end();
1967             
1968             while(it != itEnd)
1969             {
1970                 itNext = it;
1971                 ++itNext;
1972                 
1973                 (*it)->emit();
1974                 
1975                 it = itNext;
1976             }
1977         }
1978         
1979         void operator()()
1980         {
1981             lock_block<mt_policy> lock(this);
1982             const_iterator itNext, it = this->m_connected_slots.begin();
1983             const_iterator itEnd = this->m_connected_slots.end();
1984             
1985             while(it != itEnd)
1986             {
1987                 itNext = it;
1988                 ++itNext;
1989                 
1990                 (*it)->emit();
1991                 
1992                 it = itNext;
1993             }
1994         }
1995     };
1996     
1997     template<class arg1_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
1998     class signal1 : public _signal_base1<arg1_type, mt_policy>
1999     {
2000     public:
2001         typedef typename _signal_base1<arg1_type, mt_policy>::connections_list::const_iterator const_iterator;
2002         signal1()
2003         {
2004             ;
2005         }
2006         
2007         signal1(const signal1<arg1_type, mt_policy>& s)
2008         : _signal_base1<arg1_type, mt_policy>(s)
2009         {
2010             ;
2011         }
2012         
2013         template<class desttype>
2014         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type))
2015         {
2016             lock_block<mt_policy> lock(this);
2017             _connection1<desttype, arg1_type, mt_policy>* conn = 
2018             new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun);
2019             this->m_connected_slots.push_back(conn);
2020             pclass->signal_connect(this);
2021         }
2022         
2023         void emit(arg1_type a1)
2024         {
2025             lock_block<mt_policy> lock(this);
2026             const_iterator itNext, it = this->m_connected_slots.begin();
2027             const_iterator itEnd = this->m_connected_slots.end();
2028             
2029             while(it != itEnd)
2030             {
2031                 itNext = it;
2032                 ++itNext;
2033                 
2034                 (*it)->emit(a1);
2035                 
2036                 it = itNext;
2037             }
2038         }
2039         
2040         void operator()(arg1_type a1)
2041         {
2042             lock_block<mt_policy> lock(this);
2043             const_iterator itNext, it = this->m_connected_slots.begin();
2044             const_iterator itEnd = this->m_connected_slots.end();
2045             
2046             while(it != itEnd)
2047             {
2048                 itNext = it;
2049                 ++itNext;
2050                 
2051                 (*it)->emit(a1);
2052                 
2053                 it = itNext;
2054             }
2055         }
2056     };
2057     
2058     template<class arg1_type, typename arg2_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2059     class signal2 : public _signal_base2<arg1_type, arg2_type, mt_policy>
2060     {
2061     public:
2062         typedef typename _signal_base2<arg1_type, arg2_type, mt_policy>::connections_list::const_iterator const_iterator;
2063         signal2()
2064         {
2065             ;
2066         }
2067         
2068         signal2(const signal2<arg1_type, arg2_type, mt_policy>& s)
2069         : _signal_base2<arg1_type, arg2_type, mt_policy>(s)
2070         {
2071             ;
2072         }
2073         
2074         template<class desttype>
2075         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2076                                                                  arg2_type))
2077         {
2078             lock_block<mt_policy> lock(this);
2079             _connection2<desttype, arg1_type, arg2_type, mt_policy>* conn = new
2080             _connection2<desttype, arg1_type, arg2_type, mt_policy>(pclass, pmemfun);
2081             this->m_connected_slots.push_back(conn);
2082             pclass->signal_connect(this);
2083         }
2084         
2085         void emit(arg1_type a1, arg2_type a2)
2086         {
2087             lock_block<mt_policy> lock(this);
2088             const_iterator itNext, it = this->m_connected_slots.begin();
2089             const_iterator itEnd = this->m_connected_slots.end();
2090             
2091             while(it != itEnd)
2092             {
2093                 itNext = it;
2094                 ++itNext;
2095                 
2096                 (*it)->emit(a1, a2);
2097                 
2098                 it = itNext;
2099             }
2100         }
2101         
2102         void operator()(arg1_type a1, arg2_type a2)
2103         {
2104             lock_block<mt_policy> lock(this);
2105             const_iterator itNext, it = this->m_connected_slots.begin();
2106             const_iterator itEnd = this->m_connected_slots.end();
2107             
2108             while(it != itEnd)
2109             {
2110                 itNext = it;
2111                 ++itNext;
2112                 
2113                 (*it)->emit(a1, a2);
2114                 
2115                 it = itNext;
2116             }
2117         }
2118     };
2119     
2120     template<class arg1_type, typename arg2_type, typename arg3_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2121     class signal3 : public _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>
2122     {
2123     public:
2124         typedef typename _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>::connections_list::const_iterator const_iterator;
2125         signal3()
2126         {
2127             ;
2128         }
2129         
2130         signal3(const signal3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
2131         : _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>(s)
2132         {
2133             ;
2134         }
2135         
2136         template<class desttype>
2137         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2138                                                                  arg2_type, arg3_type))
2139         {
2140             lock_block<mt_policy> lock(this);
2141             _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn = 
2142             new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass,
2143                                                                                    pmemfun);
2144             this->m_connected_slots.push_back(conn);
2145             pclass->signal_connect(this);
2146         }
2147         
2148         void emit(arg1_type a1, arg2_type a2, arg3_type a3)
2149         {
2150             lock_block<mt_policy> lock(this);
2151             const_iterator itNext, it = this->m_connected_slots.begin();
2152             const_iterator itEnd = this->m_connected_slots.end();
2153             
2154             while(it != itEnd)
2155             {
2156                 itNext = it;
2157                 ++itNext;
2158                 
2159                 (*it)->emit(a1, a2, a3);
2160                 
2161                 it = itNext;
2162             }
2163         }
2164         
2165         void operator()(arg1_type a1, arg2_type a2, arg3_type a3)
2166         {
2167             lock_block<mt_policy> lock(this);
2168             const_iterator itNext, it = this->m_connected_slots.begin();
2169             const_iterator itEnd = this->m_connected_slots.end();
2170             
2171             while(it != itEnd)
2172             {
2173                 itNext = it;
2174                 ++itNext;
2175                 
2176                 (*it)->emit(a1, a2, a3);
2177                 
2178                 it = itNext;
2179             }
2180         }
2181     };
2182     
2183     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2184     class signal4 : public _signal_base4<arg1_type, arg2_type, arg3_type,
2185     arg4_type, mt_policy>
2186     {
2187     public:
2188         typedef typename _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>::connections_list::const_iterator const_iterator;
2189         signal4()
2190         {
2191             ;
2192         }
2193         
2194         signal4(const signal4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
2195         : _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(s)
2196         {
2197             ;
2198         }
2199         
2200         template<class desttype>
2201         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2202                                                                  arg2_type, arg3_type, arg4_type))
2203         {
2204             lock_block<mt_policy> lock(this);
2205             _connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>*
2206             conn = new _connection4<desttype, arg1_type, arg2_type, arg3_type,
2207             arg4_type, mt_policy>(pclass, pmemfun);
2208             this->m_connected_slots.push_back(conn);
2209             pclass->signal_connect(this);
2210         }
2211         
2212         void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2213         {
2214             lock_block<mt_policy> lock(this);
2215             const_iterator itNext, it = this->m_connected_slots.begin();
2216             const_iterator itEnd = this->m_connected_slots.end();
2217             
2218             while(it != itEnd)
2219             {
2220                 itNext = it;
2221                 ++itNext;
2222                 
2223                 (*it)->emit(a1, a2, a3, a4);
2224                 
2225                 it = itNext;
2226             }
2227         }
2228         
2229         void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2230         {
2231             lock_block<mt_policy> lock(this);
2232             const_iterator itNext, it = this->m_connected_slots.begin();
2233             const_iterator itEnd = this->m_connected_slots.end();
2234             
2235             while(it != itEnd)
2236             {
2237                 itNext = it;
2238                 ++itNext;
2239                 
2240                 (*it)->emit(a1, a2, a3, a4);
2241                 
2242                 it = itNext;
2243             }
2244         }
2245     };
2246     
2247     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2248     class arg5_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2249     class signal5 : public _signal_base5<arg1_type, arg2_type, arg3_type,
2250     arg4_type, arg5_type, mt_policy>
2251     {
2252     public:
2253         typedef typename _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>::connections_list::const_iterator const_iterator;
2254         signal5()
2255         {
2256             ;
2257         }
2258         
2259         signal5(const signal5<arg1_type, arg2_type, arg3_type, arg4_type,
2260                 arg5_type, mt_policy>& s)
2261         : _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2262         arg5_type, mt_policy>(s)
2263         {
2264             ;
2265         }
2266         
2267         template<class desttype>
2268         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2269                                                                  arg2_type, arg3_type, arg4_type, arg5_type))
2270         {
2271             lock_block<mt_policy> lock(this);
2272             _connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2273             arg5_type, mt_policy>* conn = new _connection5<desttype, arg1_type, arg2_type,
2274             arg3_type, arg4_type, arg5_type, mt_policy>(pclass, pmemfun);
2275             this->m_connected_slots.push_back(conn);
2276             pclass->signal_connect(this);
2277         }
2278         
2279         void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2280                   arg5_type a5)
2281         {
2282             lock_block<mt_policy> lock(this);
2283             const_iterator itNext, it = this->m_connected_slots.begin();
2284             const_iterator itEnd = this->m_connected_slots.end();
2285             
2286             while(it != itEnd)
2287             {
2288                 itNext = it;
2289                 ++itNext;
2290                 
2291                 (*it)->emit(a1, a2, a3, a4, a5);
2292                 
2293                 it = itNext;
2294             }
2295         }
2296         
2297         void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2298                         arg5_type a5)
2299         {
2300             lock_block<mt_policy> lock(this);
2301             const_iterator itNext, it = this->m_connected_slots.begin();
2302             const_iterator itEnd = this->m_connected_slots.end();
2303             
2304             while(it != itEnd)
2305             {
2306                 itNext = it;
2307                 ++itNext;
2308                 
2309                 (*it)->emit(a1, a2, a3, a4, a5);
2310                 
2311                 it = itNext;
2312             }
2313         }
2314     };
2315     
2316     
2317     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2318     class arg5_type, class arg6_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2319     class signal6 : public _signal_base6<arg1_type, arg2_type, arg3_type,
2320     arg4_type, arg5_type, arg6_type, mt_policy>
2321     {
2322     public:
2323         typedef typename _signal_base6<arg1_type, arg2_type, arg3_type,
2324         arg4_type, arg5_type, arg6_type, mt_policy>::connections_list::const_iterator const_iterator;
2325         signal6()
2326         {
2327             ;
2328         }
2329         
2330         signal6(const signal6<arg1_type, arg2_type, arg3_type, arg4_type,
2331                 arg5_type, arg6_type, mt_policy>& s)
2332         : _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2333         arg5_type, arg6_type, mt_policy>(s)
2334         {
2335             ;
2336         }
2337         
2338         template<class desttype>
2339         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2340                                                                  arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
2341         {
2342             lock_block<mt_policy> lock(this);
2343             _connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2344             arg5_type, arg6_type, mt_policy>* conn = 
2345             new _connection6<desttype, arg1_type, arg2_type, arg3_type,
2346             arg4_type, arg5_type, arg6_type, mt_policy>(pclass, pmemfun);
2347             this->m_connected_slots.push_back(conn);
2348             pclass->signal_connect(this);
2349         }
2350         
2351         void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2352                   arg5_type a5, arg6_type a6)
2353         {
2354             lock_block<mt_policy> lock(this);
2355             const_iterator itNext, it = this->m_connected_slots.begin();
2356             const_iterator itEnd = this->m_connected_slots.end();
2357             
2358             while(it != itEnd)
2359             {
2360                 itNext = it;
2361                 ++itNext;
2362                 
2363                 (*it)->emit(a1, a2, a3, a4, a5, a6);
2364                 
2365                 it = itNext;
2366             }
2367         }
2368         
2369         void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2370                         arg5_type a5, arg6_type a6)
2371         {
2372             lock_block<mt_policy> lock(this);
2373             const_iterator itNext, it = this->m_connected_slots.begin();
2374             const_iterator itEnd = this->m_connected_slots.end();
2375             
2376             while(it != itEnd)
2377             {
2378                 itNext = it;
2379                 ++itNext;
2380                 
2381                 (*it)->emit(a1, a2, a3, a4, a5, a6);
2382                 
2383                 it = itNext;
2384             }
2385         }
2386     };
2387     
2388     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2389     class arg5_type, class arg6_type, class arg7_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2390     class signal7 : public _signal_base7<arg1_type, arg2_type, arg3_type,
2391     arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
2392     {
2393     public:
2394         typedef typename _signal_base7<arg1_type, arg2_type, arg3_type,
2395         arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>::connections_list::const_iterator const_iterator;
2396         signal7()
2397         {
2398             ;
2399         }
2400         
2401         signal7(const signal7<arg1_type, arg2_type, arg3_type, arg4_type,
2402                 arg5_type, arg6_type, arg7_type, mt_policy>& s)
2403         : _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2404         arg5_type, arg6_type, arg7_type, mt_policy>(s)
2405         {
2406             ;
2407         }
2408         
2409         template<class desttype>
2410         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2411                                                                  arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, 
2412                                                                  arg7_type))
2413         {
2414             lock_block<mt_policy> lock(this);
2415             _connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2416             arg5_type, arg6_type, arg7_type, mt_policy>* conn = 
2417             new _connection7<desttype, arg1_type, arg2_type, arg3_type,
2418             arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(pclass, pmemfun);
2419             this->m_connected_slots.push_back(conn);
2420             pclass->signal_connect(this);
2421         }
2422         
2423         void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2424                   arg5_type a5, arg6_type a6, arg7_type a7)
2425         {
2426             lock_block<mt_policy> lock(this);
2427             const_iterator itNext, it = this->m_connected_slots.begin();
2428             const_iterator itEnd = this->m_connected_slots.end();
2429             
2430             while(it != itEnd)
2431             {
2432                 itNext = it;
2433                 ++itNext;
2434                 
2435                 (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2436                 
2437                 it = itNext;
2438             }
2439         }
2440         
2441         void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2442                         arg5_type a5, arg6_type a6, arg7_type a7)
2443         {
2444             lock_block<mt_policy> lock(this);
2445             const_iterator itNext, it = this->m_connected_slots.begin();
2446             const_iterator itEnd = this->m_connected_slots.end();
2447             
2448             while(it != itEnd)
2449             {
2450                 itNext = it;
2451                 ++itNext;
2452                 
2453                 (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2454                 
2455                 it = itNext;
2456             }
2457         }
2458     };
2459     
2460     template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2461     class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2462     class signal8 : public _signal_base8<arg1_type, arg2_type, arg3_type,
2463     arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
2464     {
2465     public:
2466         typedef typename _signal_base8<arg1_type, arg2_type, arg3_type,
2467         arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>::connections_list::const_iterator const_iterator;
2468         signal8()
2469         {
2470             ;
2471         }
2472         
2473         signal8(const signal8<arg1_type, arg2_type, arg3_type, arg4_type,
2474                 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
2475         : _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2476         arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(s)
2477         {
2478             ;
2479         }
2480         
2481         template<class desttype>
2482         void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2483                                                                  arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, 
2484                                                                  arg7_type, arg8_type))
2485         {
2486             lock_block<mt_policy> lock(this);
2487             _connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2488             arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn = 
2489             new _connection8<desttype, arg1_type, arg2_type, arg3_type,
2490             arg4_type, arg5_type, arg6_type, arg7_type, 
2491             arg8_type, mt_policy>(pclass, pmemfun);
2492             this->m_connected_slots.push_back(conn);
2493             pclass->signal_connect(this);
2494         }
2495         
2496         void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2497                   arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2498         {
2499             lock_block<mt_policy> lock(this);
2500             const_iterator itNext, it = this->m_connected_slots.begin();
2501             const_iterator itEnd = this->m_connected_slots.end();
2502             
2503             while(it != itEnd)
2504             {
2505                 itNext = it;
2506                 ++itNext;
2507                 
2508                 (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2509                 
2510                 it = itNext;
2511             }
2512         }
2513         
2514         void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2515                         arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2516         {
2517             lock_block<mt_policy> lock(this);
2518             const_iterator itNext, it = this->m_connected_slots.begin();
2519             const_iterator itEnd = this->m_connected_slots.end();
2520             
2521             while(it != itEnd)
2522             {
2523                 itNext = it;
2524                 ++itNext;
2525                 
2526                 (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2527                 
2528                 it = itNext;
2529             }
2530         }
2531     };
2532     
2533 }; // namespace sigslot

2534 
2535 #endif // SIGSLOT_H__

2536