Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

sigslot.h 82.3 KB
Newer Older
schultezub's avatar
schultezub committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
 
 sigslot.h: Signal/Slot classes
 
 Written by Sarah Thompson (sarah@telergy.com) 2002.
 
 License: Public domain. You are free to use this code however you like,
          with the proviso that the author takes on no responsibility or
          liability for any use.
 
 QUICK DOCUMENTATION
 
 (see also the full documentation at http://sigslot.sourceforge.net/)
 
 1. #define switches

    SIGSLOT_PURE_ISO:
    Define this to force ISO C++ compliance. This also disables
    all of the thread safety support on platforms where it is 
    available.
 
    SIGSLOT_USE_POSIX_THREADS:
    Force use of Posix threads when using a C++ compiler other than
    gcc on a platform that supports Posix threads. (When using gcc,
    this is the default - use SIGSLOT_PURE_ISO to disable this if 
    necessary)
 
    SIGSLOT_DEFAULT_MT_POLICY:
    Where thread support is enabled, this defaults to multi_threaded_global.
    Otherwise, the default is single_threaded. #define this yourself to
    override the default. In pure ISO mode, anything other than
    single_threaded will cause a compiler error.

 2. PLATFORM NOTES
 
    Win32:
    On Win32, the WIN32 symbol must be #defined. Most mainstream
    compilers do this by default, but you may need to define it
    yourself if your build environment is less standard. This causes
    the Win32 thread support to be compiled in and used automatically.
 
    Unix/Linux/BSD, etc:
    If you're using gcc, it is assumed that you have Posix threads
    available, so they are used automatically. You can override this
    (as under Windows) with the SIGSLOT_PURE_ISO switch. If you're using
    something other than gcc but still want to use Posix threads, you
    need to #define SIGSLOT_USE_POSIX_THREADS.
 
    ISO C++:
    If none of the supported platforms are detected, or if
    SIGSLOT_PURE_ISO is defined, all multithreading support is turned off,
    along with any code that might cause a pure ISO C++ environment to
    complain. Before you ask, gcc -ansi -pedantic won't compile this 
    library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of
    errors that aren't really there. If you feel like investigating this,
    please contact the author.
      
 THREADING MODES
 
    single_threaded:
    Your program is assumed to be single threaded from the point of view
    of signal/slot usage (i.e. all objects using signals and slots are
    created and destroyed from a single thread). Behaviour if objects are
    destroyed concurrently is undefined (i.e. you'll get the occasional
    segmentation fault/memory exception).
 
    multi_threaded_global:
    Your program is assumed to be multi threaded. Objects using signals and
    slots can be safely created and destroyed from any thread, even when
    connections exist. In multi_threaded_global mode, this is achieved by a
    single global mutex (actually a critical section on Windows because they
    are faster). This option uses less OS resources, but results in more
    opportunities for contention, possibly resulting in more context switches
    than are strictly necessary.
 
    multi_threaded_local:
    Behaviour in this mode is essentially the same as multi_threaded_global,
    except that each signal, and each object that inherits has_slots, all 
    have their own mutex/critical section. In practice, this means that
    mutex collisions (and hence context switches) only happen if they are
    absolutely essential. However, on some platforms, creating a lot of 
    mutexes can slow down the whole OS, so use this option with care.
 
 USING THE LIBRARY
 
 See the full documentation at http://sigslot.sourceforge.net/
 
*/
schultezub's avatar
schultezub committed
89

schultezub's avatar
schultezub committed
90
91
#ifndef SIGSLOT_H
#define SIGSLOT_H
schultezub's avatar
schultezub committed
92
93
94

#include <set>
#include <list>
95
#include <tbb/spin_rw_mutex.h>
schultezub's avatar
schultezub committed
96
97
98
99
100
101
102
103
104
105
106

#ifndef SIGSLOT_DEFAULT_MT_POLICY
#	ifdef _SIGSLOT_SINGLE_THREADED
#		define SIGSLOT_DEFAULT_MT_POLICY single_threaded
#	else
#		define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local
#	endif
#endif

namespace sigslot {

107
    typedef tbb::spin_rw_mutex tbb_mutex;
schultezub's avatar
schultezub committed
108
109
110
111
112
113
114

    // The multi threading policies only get compiled in if they are enabled.
    class multi_threaded_global
    {
    public:
        multi_threaded_global()
        {
115
            ;
schultezub's avatar
schultezub committed
116
117
118
119
120
121
122
123
124
125
126
127
        }

        multi_threaded_global(const multi_threaded_global&)
        {
            ;
        }

        virtual ~multi_threaded_global()
        {
            ;
        }

128
        tbb_mutex& get_mutex()
schultezub's avatar
schultezub committed
129
        {
130
131
            static tbb_mutex g_mutex;
            return g_mutex;
schultezub's avatar
schultezub committed
132
133
134
135
136
137
138
139
        }
    };

    class multi_threaded_local
    {
    public:
        multi_threaded_local()
        {
140
            ;
schultezub's avatar
schultezub committed
141
142
143
144
145
146
147
        }

        multi_threaded_local(const multi_threaded_local&)
        {
            ;
        }

148
        virtual ~multi_threaded_local()
schultezub's avatar
schultezub committed
149
150
151
152
        {
            ;
        }

153
        tbb_mutex& get_mutex() { return m_mutex; }
schultezub's avatar
schultezub committed
154
155

    private:
156
        tbb_mutex m_mutex;
schultezub's avatar
schultezub committed
157
    };
158
159
160
    
    template<class mt_policy>
    class lock_block_write : tbb_mutex::scoped_lock
schultezub's avatar
schultezub committed
161
162
    {
    public:
163
        lock_block_write(mt_policy *mtx) : tbb_mutex::scoped_lock(mtx->get_mutex(), true)
schultezub's avatar
schultezub committed
164
165
        {
        }
166
167
        
        ~lock_block_write()
schultezub's avatar
schultezub committed
168
169
170
171
        {
        }
    };

172
173
    template<class mt_policy>
    class lock_block_read : tbb_mutex::scoped_lock
schultezub's avatar
schultezub committed
174
175
    {
    public:
176
        lock_block_read(mt_policy *mtx) : tbb_mutex::scoped_lock(mtx->get_mutex(), false)
schultezub's avatar
schultezub committed
177
178
179
        {
        }

180
        ~lock_block_read()
schultezub's avatar
schultezub committed
181
182
183
184
185
186
        {
        }
    };

    template<class mt_policy>
    class has_slots;
schultezub's avatar
schultezub committed
187
    
schultezub's avatar
schultezub committed
188
189
190
191
    template<class mt_policy>
    class _connection_base0
    {
    public:
schultezub's avatar
schultezub committed
192
        virtual ~_connection_base0() {}
schultezub's avatar
schultezub committed
193
194
195
196
197
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal() = 0;
        virtual _connection_base0* clone() = 0;
        virtual _connection_base0* duplicate(has_slots<mt_policy>* pnewdest) = 0;
    };
schultezub's avatar
schultezub committed
198
    
schultezub's avatar
schultezub committed
199
200
201
202
    template<class arg1_type, class mt_policy>
    class _connection_base1
    {
    public:
schultezub's avatar
schultezub committed
203
        virtual ~_connection_base1() {}
schultezub's avatar
schultezub committed
204
205
206
207
208
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type) = 0;
        virtual _connection_base1<arg1_type, mt_policy>* clone() = 0;
        virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
    };
schultezub's avatar
schultezub committed
209
    
schultezub's avatar
schultezub committed
210
211
212
213
    template<class arg1_type, class arg2_type, class mt_policy>
    class _connection_base2
    {
    public:
schultezub's avatar
schultezub committed
214
        virtual ~_connection_base2() {}
schultezub's avatar
schultezub committed
215
216
217
218
219
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type, arg2_type) = 0;
        virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0;
        virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
    };
schultezub's avatar
schultezub committed
220
    
schultezub's avatar
schultezub committed
221
222
223
224
    template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
    class _connection_base3
    {
    public:
schultezub's avatar
schultezub committed
225
        virtual ~_connection_base3() {}
schultezub's avatar
schultezub committed
226
227
228
229
230
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type, arg2_type, arg3_type) = 0;
        virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0;
        virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
    };
schultezub's avatar
schultezub committed
231
    
schultezub's avatar
schultezub committed
232
233
234
235
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
    class _connection_base4
    {
    public:
schultezub's avatar
schultezub committed
236
        virtual ~_connection_base4() {}
schultezub's avatar
schultezub committed
237
238
239
240
241
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type, arg2_type, arg3_type, arg4_type) = 0;
        virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0;
        virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
    };
schultezub's avatar
schultezub committed
242
    
schultezub's avatar
schultezub committed
243
244
245
246
247
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
    class arg5_type, class mt_policy>
    class _connection_base5
    {
    public:
schultezub's avatar
schultezub committed
248
        virtual ~_connection_base5() {}
schultezub's avatar
schultezub committed
249
250
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type, arg2_type, arg3_type, arg4_type, 
schultezub's avatar
schultezub committed
251
                          arg5_type) = 0;
schultezub's avatar
schultezub committed
252
        virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
253
        arg5_type, mt_policy>* clone() = 0;
schultezub's avatar
schultezub committed
254
        virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
255
        arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
schultezub's avatar
schultezub committed
256
    };
schultezub's avatar
schultezub committed
257
    
schultezub's avatar
schultezub committed
258
259
260
261
262
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
    class arg5_type, class arg6_type, class mt_policy>
    class _connection_base6
    {
    public:
schultezub's avatar
schultezub committed
263
        virtual ~_connection_base6() {}
schultezub's avatar
schultezub committed
264
265
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
schultezub's avatar
schultezub committed
266
                          arg6_type) = 0;
schultezub's avatar
schultezub committed
267
        virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
268
        arg5_type, arg6_type, mt_policy>* clone() = 0;
schultezub's avatar
schultezub committed
269
        virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
270
        arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
schultezub's avatar
schultezub committed
271
    };
schultezub's avatar
schultezub committed
272
    
schultezub's avatar
schultezub committed
273
274
275
276
277
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
    class arg5_type, class arg6_type, class arg7_type, class mt_policy>
    class _connection_base7
    {
    public:
schultezub's avatar
schultezub committed
278
        virtual ~_connection_base7() {}
schultezub's avatar
schultezub committed
279
280
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
schultezub's avatar
schultezub committed
281
                          arg6_type, arg7_type) = 0;
schultezub's avatar
schultezub committed
282
        virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
283
        arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0;
schultezub's avatar
schultezub committed
284
        virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
285
        arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
schultezub's avatar
schultezub committed
286
    };
schultezub's avatar
schultezub committed
287
    
schultezub's avatar
schultezub committed
288
289
290
291
292
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
    class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
    class _connection_base8
    {
    public:
schultezub's avatar
schultezub committed
293
        virtual ~_connection_base8() {}
schultezub's avatar
schultezub committed
294
295
        virtual has_slots<mt_policy>* getdest() const = 0;
        virtual void emitSignal(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
schultezub's avatar
schultezub committed
296
                          arg6_type, arg7_type, arg8_type) = 0;
schultezub's avatar
schultezub committed
297
        virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
298
        arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0;
schultezub's avatar
schultezub committed
299
        virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
300
        arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
schultezub's avatar
schultezub committed
301
    };
schultezub's avatar
schultezub committed
302
    
schultezub's avatar
schultezub committed
303
304
305
306
307
    template<class mt_policy>
    class _signal_base : public mt_policy
    {
    public:
        virtual void slot_disconnect(has_slots<mt_policy>* pslot) = 0;
schultezub's avatar
schultezub committed
308
        virtual void slot_duplicate(has_slots<mt_policy> const* poldslot, has_slots<mt_policy>* pnewslot) = 0;
schultezub's avatar
schultezub committed
309
    };
schultezub's avatar
schultezub committed
310
    
schultezub's avatar
schultezub committed
311
312
313
314
    template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
    class has_slots : public mt_policy 
    {
    private:
schultezub's avatar
schultezub committed
315
        typedef typename std::set<_signal_base<mt_policy> *> sender_set;
schultezub's avatar
schultezub committed
316
        typedef typename sender_set::const_iterator const_iterator;
schultezub's avatar
schultezub committed
317
        
schultezub's avatar
schultezub committed
318
    public:
schultezub's avatar
schultezub committed
319
320
321
        has_slots() {}
        
        has_slots(has_slots const& hs) : mt_policy(hs)
schultezub's avatar
schultezub committed
322
        {
323
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
324
325
            const_iterator it = hs.m_senders.begin();
            const_iterator itEnd = hs.m_senders.end();
schultezub's avatar
schultezub committed
326
327
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
328
329
330
331
332
                (*it)->slot_duplicate(&hs, this);
                m_senders.insert(*it);
                ++it;
            }
        } 
schultezub's avatar
schultezub committed
333
        
schultezub's avatar
schultezub committed
334
335
        void signal_connect(_signal_base<mt_policy>* sender)
        {
336
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
337
338
            m_senders.insert(sender);
        }
schultezub's avatar
schultezub committed
339
        
schultezub's avatar
schultezub committed
340
341
        void signal_disconnect(_signal_base<mt_policy>* sender)
        {
342
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
343
344
            m_senders.erase(sender);
        }
schultezub's avatar
schultezub committed
345
        
schultezub's avatar
schultezub committed
346
347
348
349
        virtual ~has_slots()
        {
            disconnect_all();
        }
schultezub's avatar
schultezub committed
350
        
schultezub's avatar
schultezub committed
351
352
        void disconnect_all()
        {
353
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
354
355
            const_iterator it = m_senders.begin();
            const_iterator itEnd = m_senders.end();
schultezub's avatar
schultezub committed
356
357
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
358
359
360
                (*it)->slot_disconnect(this);
                ++it;
            }
schultezub's avatar
schultezub committed
361
            
schultezub's avatar
schultezub committed
362
363
            m_senders.erase(m_senders.begin(), m_senders.end());
        }
schultezub's avatar
schultezub committed
364
        
schultezub's avatar
schultezub committed
365
366
367
    private:
        sender_set m_senders;
    };
schultezub's avatar
schultezub committed
368
    
schultezub's avatar
schultezub committed
369
370
371
372
373
    template<class mt_policy>
    class _signal_base0 : public _signal_base<mt_policy>
    {
    public:
        typedef std::list<_connection_base0<mt_policy> *>  connections_list;
schultezub's avatar
schultezub committed
374
375
376
377
        
        _signal_base0() {}
        
        _signal_base0(_signal_base0 const& s) : _signal_base<mt_policy>(s)
schultezub's avatar
schultezub committed
378
        {
379
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
380
381
382
383
            typename connections_list::const_iterator it = s.m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
384
385
386
387
388
                (*it)->getdest()->signal_connect(this);
                m_connected_slots.push_back((*it)->clone());
                ++it;
            }
        }
schultezub's avatar
schultezub committed
389
        
schultezub's avatar
schultezub committed
390
391
392
393
        ~_signal_base0()
        {
            disconnect_all();
        }
schultezub's avatar
schultezub committed
394
        
schultezub's avatar
schultezub committed
395
396
        void disconnect_all()
        {
397
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
398
399
400
401
            typename connections_list::const_iterator it = m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
402
403
404
405
                (*it)->getdest()->signal_disconnect(this);
                delete *it;
                ++it;
            }
schultezub's avatar
schultezub committed
406
            
schultezub's avatar
schultezub committed
407
408
            m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
        }
schultezub's avatar
schultezub committed
409
        
schultezub's avatar
schultezub committed
410
411
        void disconnect(has_slots<mt_policy>* pclass)
        {
412
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
413
414
415
416
417
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == pclass) {
schultezub's avatar
schultezub committed
418
419
420
421
422
                    delete *it;
                    m_connected_slots.erase(it);
                    pclass->signal_disconnect(this);
                    return;
                }
schultezub's avatar
schultezub committed
423
                
schultezub's avatar
schultezub committed
424
425
426
                ++it;
            }
        }
schultezub's avatar
schultezub committed
427
        
schultezub's avatar
schultezub committed
428
429
        void slot_disconnect(has_slots<mt_policy>* pslot)
        {
430
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
431
432
433
434
435
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                typename connections_list::iterator itNext = it;
schultezub's avatar
schultezub committed
436
                ++itNext;
schultezub's avatar
schultezub committed
437
438
                
                if ((*it)->getdest() == pslot) {
schultezub's avatar
schultezub committed
439
                    m_connected_slots.erase(it);
schultezub's avatar
schultezub committed
440
                    //          delete *it;
schultezub's avatar
schultezub committed
441
                }
schultezub's avatar
schultezub committed
442
                
schultezub's avatar
schultezub committed
443
444
445
                it = itNext;
            }
        }
schultezub's avatar
schultezub committed
446
447
        
        void slot_duplicate(has_slots<mt_policy> const* oldtarget, has_slots<mt_policy>* newtarget)
schultezub's avatar
schultezub committed
448
        {
449
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
450
451
452
453
454
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == oldtarget) {
schultezub's avatar
schultezub committed
455
456
                    m_connected_slots.push_back((*it)->duplicate(newtarget));
                }
schultezub's avatar
schultezub committed
457
                
schultezub's avatar
schultezub committed
458
459
460
                ++it;
            }
        }
461
462
463
464
465

        bool has_connections() const
        {
            return !m_connected_slots.empty();
        }
schultezub's avatar
schultezub committed
466
        
schultezub's avatar
schultezub committed
467
468
469
    protected:
        connections_list m_connected_slots;   
    };
schultezub's avatar
schultezub committed
470
    
schultezub's avatar
schultezub committed
471
472
473
474
475
    template<class arg1_type, class mt_policy>
    class _signal_base1 : public _signal_base<mt_policy>
    {
    public:
        typedef std::list<_connection_base1<arg1_type, mt_policy> *>  connections_list;
schultezub's avatar
schultezub committed
476
477
478
479
        
        _signal_base1() {}
        
        _signal_base1(_signal_base1<arg1_type, mt_policy> const& s) : _signal_base<mt_policy>(s)
schultezub's avatar
schultezub committed
480
        {
481
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
482
483
484
485
            typename connections_list::const_iterator it = s.m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
486
487
488
489
490
                (*it)->getdest()->signal_connect(this);
                m_connected_slots.push_back((*it)->clone());
                ++it;
            }
        }
schultezub's avatar
schultezub committed
491
492
        
        void slot_duplicate(has_slots<mt_policy> const* oldtarget, has_slots<mt_policy>* newtarget)
schultezub's avatar
schultezub committed
493
        {
494
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
495
496
497
498
499
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == oldtarget) {
schultezub's avatar
schultezub committed
500
501
                    m_connected_slots.push_back((*it)->duplicate(newtarget));
                }
schultezub's avatar
schultezub committed
502
                
schultezub's avatar
schultezub committed
503
504
505
                ++it;
            }
        }
schultezub's avatar
schultezub committed
506
        
schultezub's avatar
schultezub committed
507
508
509
510
        ~_signal_base1()
        {
            disconnect_all();
        }
schultezub's avatar
schultezub committed
511
        
schultezub's avatar
schultezub committed
512
513
        void disconnect_all()
        {
514
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
515
516
517
518
            typename connections_list::const_iterator it = m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
519
520
521
522
                (*it)->getdest()->signal_disconnect(this);
                delete *it;
                ++it;
            }
schultezub's avatar
schultezub committed
523
            
schultezub's avatar
schultezub committed
524
525
            m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
        }
schultezub's avatar
schultezub committed
526
        
schultezub's avatar
schultezub committed
527
528
        void disconnect(has_slots<mt_policy>* pclass)
        {
529
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
530
531
532
533
534
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == pclass) {
schultezub's avatar
schultezub committed
535
536
537
538
539
                    delete *it;
                    m_connected_slots.erase(it);
                    pclass->signal_disconnect(this);
                    return;
                }
schultezub's avatar
schultezub committed
540
                
schultezub's avatar
schultezub committed
541
542
543
                ++it;
            }
        }
schultezub's avatar
schultezub committed
544
        
schultezub's avatar
schultezub committed
545
546
        void slot_disconnect(has_slots<mt_policy>* pslot)
        {
547
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
548
549
550
551
552
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                typename connections_list::iterator itNext = it;
schultezub's avatar
schultezub committed
553
                ++itNext;
schultezub's avatar
schultezub committed
554
555
                
                if ((*it)->getdest() == pslot) {
schultezub's avatar
schultezub committed
556
                    m_connected_slots.erase(it);
schultezub's avatar
schultezub committed
557
                    //          delete *it;
schultezub's avatar
schultezub committed
558
                }
schultezub's avatar
schultezub committed
559
                
schultezub's avatar
schultezub committed
560
561
562
                it = itNext;
            }
        }
563
564
565
566
567

        bool has_connections() const
        {
            return !m_connected_slots.empty();
        }
schultezub's avatar
schultezub committed
568
569
        
        
schultezub's avatar
schultezub committed
570
571
572
    protected:
        connections_list m_connected_slots;   
    };
schultezub's avatar
schultezub committed
573
    
schultezub's avatar
schultezub committed
574
575
576
577
578
    template<class arg1_type, class arg2_type, class mt_policy>
    class _signal_base2 : public _signal_base<mt_policy>
    {
    public:
        typedef std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *>
schultezub's avatar
schultezub committed
579
580
581
582
583
        connections_list;
        
        _signal_base2() {}
        
        _signal_base2(_signal_base2<arg1_type, arg2_type, mt_policy> const& s) : _signal_base<mt_policy>(s)
schultezub's avatar
schultezub committed
584
        {
585
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
586
587
588
589
            typename connections_list::const_iterator it = s.m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
590
591
592
593
594
                (*it)->getdest()->signal_connect(this);
                m_connected_slots.push_back((*it)->clone());
                ++it;
            }
        }
schultezub's avatar
schultezub committed
595
596
        
        void slot_duplicate(has_slots<mt_policy> const* oldtarget, has_slots<mt_policy>* newtarget)
schultezub's avatar
schultezub committed
597
        {
598
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
599
600
601
602
603
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == oldtarget) {
schultezub's avatar
schultezub committed
604
605
                    m_connected_slots.push_back((*it)->duplicate(newtarget));
                }
schultezub's avatar
schultezub committed
606
                
schultezub's avatar
schultezub committed
607
608
609
                ++it;
            }
        }
schultezub's avatar
schultezub committed
610
        
schultezub's avatar
schultezub committed
611
612
613
614
        ~_signal_base2()
        {
            disconnect_all();
        }
schultezub's avatar
schultezub committed
615
        
schultezub's avatar
schultezub committed
616
617
        void disconnect_all()
        {
618
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
619
620
621
622
            typename connections_list::const_iterator it = m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
623
624
625
626
                (*it)->getdest()->signal_disconnect(this);
                delete *it;
                ++it;
            }
schultezub's avatar
schultezub committed
627
            
schultezub's avatar
schultezub committed
628
629
            m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
        }
schultezub's avatar
schultezub committed
630
        
schultezub's avatar
schultezub committed
631
632
        void disconnect(has_slots<mt_policy>* pclass)
        {
633
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
634
635
636
637
638
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == pclass) {
schultezub's avatar
schultezub committed
639
640
641
642
643
                    delete *it;
                    m_connected_slots.erase(it);
                    pclass->signal_disconnect(this);
                    return;
                }
schultezub's avatar
schultezub committed
644
                
schultezub's avatar
schultezub committed
645
646
647
                ++it;
            }
        }
schultezub's avatar
schultezub committed
648
        
schultezub's avatar
schultezub committed
649
650
        void slot_disconnect(has_slots<mt_policy>* pslot)
        {
651
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
652
653
654
655
656
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                typename connections_list::iterator itNext = it;
schultezub's avatar
schultezub committed
657
                ++itNext;
schultezub's avatar
schultezub committed
658
659
                
                if ((*it)->getdest() == pslot) {
schultezub's avatar
schultezub committed
660
                    m_connected_slots.erase(it);
schultezub's avatar
schultezub committed
661
                    //          delete *it;
schultezub's avatar
schultezub committed
662
                }
schultezub's avatar
schultezub committed
663
                
schultezub's avatar
schultezub committed
664
665
666
                it = itNext;
            }
        }
667
668
669
670
671

        bool has_connections() const
        {
            return !m_connected_slots.empty();
        }
schultezub's avatar
schultezub committed
672
        
schultezub's avatar
schultezub committed
673
674
675
    protected:
        connections_list m_connected_slots;   
    };
schultezub's avatar
schultezub committed
676
    
schultezub's avatar
schultezub committed
677
678
679
680
681
    template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
    class _signal_base3 : public _signal_base<mt_policy>
    {
    public:
        typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *>
schultezub's avatar
schultezub committed
682
683
684
685
686
687
688
        connections_list;
        
        _signal_base3() {}
        
        _signal_base3(_signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> const& s)
        : _signal_base<mt_policy>(s)
        {
689
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
690
691
692
693
            typename connections_list::const_iterator it = s.m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
694
695
696
697
698
                (*it)->getdest()->signal_connect(this);
                m_connected_slots.push_back((*it)->clone());
                ++it;
            }
        }
schultezub's avatar
schultezub committed
699
700
        
        void slot_duplicate(has_slots<mt_policy> const* oldtarget, has_slots<mt_policy>* newtarget)
schultezub's avatar
schultezub committed
701
        {
702
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
703
704
705
706
707
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == oldtarget) {
schultezub's avatar
schultezub committed
708
709
                    m_connected_slots.push_back((*it)->duplicate(newtarget));
                }
schultezub's avatar
schultezub committed
710
                
schultezub's avatar
schultezub committed
711
712
713
                ++it;
            }
        }
schultezub's avatar
schultezub committed
714
        
schultezub's avatar
schultezub committed
715
716
717
718
        ~_signal_base3()
        {
            disconnect_all();
        }
schultezub's avatar
schultezub committed
719
        
schultezub's avatar
schultezub committed
720
721
        void disconnect_all()
        {
722
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
723
724
725
726
            typename connections_list::const_iterator it = m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
727
728
729
730
                (*it)->getdest()->signal_disconnect(this);
                delete *it;
                ++it;
            }
schultezub's avatar
schultezub committed
731
            
schultezub's avatar
schultezub committed
732
733
            m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
        }
schultezub's avatar
schultezub committed
734
        
schultezub's avatar
schultezub committed
735
736
        void disconnect(has_slots<mt_policy>* pclass)
        {
737
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
738
739
740
741
742
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == pclass) {
schultezub's avatar
schultezub committed
743
744
745
746
747
                    delete *it;
                    m_connected_slots.erase(it);
                    pclass->signal_disconnect(this);
                    return;
                }
schultezub's avatar
schultezub committed
748
                
schultezub's avatar
schultezub committed
749
750
751
                ++it;
            }
        }
schultezub's avatar
schultezub committed
752
        
schultezub's avatar
schultezub committed
753
754
        void slot_disconnect(has_slots<mt_policy>* pslot)
        {
755
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
756
757
758
759
760
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                typename connections_list::iterator itNext = it;
schultezub's avatar
schultezub committed
761
                ++itNext;
schultezub's avatar
schultezub committed
762
763
                
                if ((*it)->getdest() == pslot) {
schultezub's avatar
schultezub committed
764
                    m_connected_slots.erase(it);
schultezub's avatar
schultezub committed
765
                    //          delete *it;
schultezub's avatar
schultezub committed
766
                }
schultezub's avatar
schultezub committed
767
                
schultezub's avatar
schultezub committed
768
769
770
                it = itNext;
            }
        }
771
772
773
774
775

        bool has_connections() const
        {
            return !m_connected_slots.empty();
        }
schultezub's avatar
schultezub committed
776
        
schultezub's avatar
schultezub committed
777
778
779
    protected:
        connections_list m_connected_slots;   
    };
schultezub's avatar
schultezub committed
780
    
schultezub's avatar
schultezub committed
781
782
783
784
785
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
    class _signal_base4 : public _signal_base<mt_policy>
    {
    public:
        typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type,
schultezub's avatar
schultezub committed
786
787
788
789
        arg4_type, mt_policy> *>  connections_list;
        
        _signal_base4() {}
        
schultezub's avatar
schultezub committed
790
        _signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
schultezub's avatar
schultezub committed
791
        : _signal_base<mt_policy>(s)
schultezub's avatar
schultezub committed
792
        {
793
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
794
795
796
797
            typename connections_list::const_iterator it = s.m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
798
799
                (*it)->getdest()->signal_connect(this);
                m_connected_slots.push_back((*it)->clone());
schultezub's avatar
schultezub committed
800
                
schultezub's avatar
schultezub committed
801
802
803
                ++it;
            }
        }
schultezub's avatar
schultezub committed
804
        
schultezub's avatar
schultezub committed
805
806
        void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
        {
807
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
808
809
810
811
812
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == oldtarget) {
schultezub's avatar
schultezub committed
813
814
                    m_connected_slots.push_back((*it)->duplicate(newtarget));
                }
schultezub's avatar
schultezub committed
815
                
schultezub's avatar
schultezub committed
816
817
818
                ++it;
            }
        }
schultezub's avatar
schultezub committed
819
        
schultezub's avatar
schultezub committed
820
821
822
823
        ~_signal_base4()
        {
            disconnect_all();
        }
schultezub's avatar
schultezub committed
824
        
schultezub's avatar
schultezub committed
825
826
        void disconnect_all()
        {
827
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
828
829
830
831
            typename connections_list::const_iterator it = m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
832
833
                (*it)->getdest()->signal_disconnect(this);
                delete *it;
schultezub's avatar
schultezub committed
834
                
schultezub's avatar
schultezub committed
835
836
                ++it;
            }
schultezub's avatar
schultezub committed
837
            
schultezub's avatar
schultezub committed
838
839
            m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
        }
schultezub's avatar
schultezub committed
840
        
schultezub's avatar
schultezub committed
841
842
        void disconnect(has_slots<mt_policy>* pclass)
        {
843
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
844
845
846
847
848
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == pclass) {
schultezub's avatar
schultezub committed
849
850
851
852
853
                    delete *it;
                    m_connected_slots.erase(it);
                    pclass->signal_disconnect(this);
                    return;
                }
schultezub's avatar
schultezub committed
854
                
schultezub's avatar
schultezub committed
855
856
857
                ++it;
            }
        }
schultezub's avatar
schultezub committed
858
        
schultezub's avatar
schultezub committed
859
860
        void slot_disconnect(has_slots<mt_policy>* pslot)
        {
861
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
862
863
864
865
866
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                typename connections_list::iterator itNext = it;
schultezub's avatar
schultezub committed
867
                ++itNext;
schultezub's avatar
schultezub committed
868
869
                
                if ((*it)->getdest() == pslot) {
schultezub's avatar
schultezub committed
870
                    m_connected_slots.erase(it);
schultezub's avatar
schultezub committed
871
                    //          delete *it;
schultezub's avatar
schultezub committed
872
                }
schultezub's avatar
schultezub committed
873
                
schultezub's avatar
schultezub committed
874
875
876
                it = itNext;
            }
        }
877
878
879
880
881

        bool has_connections() const
        {
            return !m_connected_slots.empty();
        }
schultezub's avatar
schultezub committed
882
        
schultezub's avatar
schultezub committed
883
884
885
    protected:
        connections_list m_connected_slots;   
    };
schultezub's avatar
schultezub committed
886
    
schultezub's avatar
schultezub committed
887
888
889
890
891
892
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
    class arg5_type, class mt_policy>
    class _signal_base5 : public _signal_base<mt_policy>
    {
    public:
        typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type,
schultezub's avatar
schultezub committed
893
894
895
896
        arg4_type, arg5_type, mt_policy> *>  connections_list;
        
        _signal_base5() {}
        
schultezub's avatar
schultezub committed
897
        _signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
898
899
                      arg5_type, mt_policy>& s)
        : _signal_base<mt_policy>(s)
schultezub's avatar
schultezub committed
900
        {
901
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
902
903
904
905
            typename connections_list::const_iterator it = s.m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
906
907
                (*it)->getdest()->signal_connect(this);
                m_connected_slots.push_back((*it)->clone());
schultezub's avatar
schultezub committed
908
                
schultezub's avatar
schultezub committed
909
910
911
                ++it;
            }
        }
schultezub's avatar
schultezub committed
912
        
schultezub's avatar
schultezub committed
913
914
        void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
        {
915
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
916
917
918
919
920
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == oldtarget) {
schultezub's avatar
schultezub committed
921
922
                    m_connected_slots.push_back((*it)->duplicate(newtarget));
                }
schultezub's avatar
schultezub committed
923
                
schultezub's avatar
schultezub committed
924
925
926
                ++it;
            }
        }
schultezub's avatar
schultezub committed
927
        
schultezub's avatar
schultezub committed
928
929
930
931
        ~_signal_base5()
        {
            disconnect_all();
        }
schultezub's avatar
schultezub committed
932
        
schultezub's avatar
schultezub committed
933
934
        void disconnect_all()
        {
935
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
936
937
938
939
            typename connections_list::const_iterator it = m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
940
941
                (*it)->getdest()->signal_disconnect(this);
                delete *it;
schultezub's avatar
schultezub committed
942
                
schultezub's avatar
schultezub committed
943
944
                ++it;
            }
schultezub's avatar
schultezub committed
945
            
schultezub's avatar
schultezub committed
946
947
            m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
        }
schultezub's avatar
schultezub committed
948
        
schultezub's avatar
schultezub committed
949
950
        void disconnect(has_slots<mt_policy>* pclass)
        {
951
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
952
953
954
955
956
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                if ((*it)->getdest() == pclass) {
schultezub's avatar
schultezub committed
957
958
959
960
961
                    delete *it;
                    m_connected_slots.erase(it);
                    pclass->signal_disconnect(this);
                    return;
                }
schultezub's avatar
schultezub committed
962
                
schultezub's avatar
schultezub committed
963
964
965
                ++it;
            }
        }
schultezub's avatar
schultezub committed
966
        
schultezub's avatar
schultezub committed
967
968
        void slot_disconnect(has_slots<mt_policy>* pslot)
        {
969
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
970
971
972
973
974
            typename connections_list::iterator it = m_connected_slots.begin();
            typename connections_list::iterator itEnd = m_connected_slots.end();
            
            while (it != itEnd) {
                typename connections_list::iterator itNext = it;
schultezub's avatar
schultezub committed
975
                ++itNext;
schultezub's avatar
schultezub committed
976
977
                
                if ((*it)->getdest() == pslot) {
schultezub's avatar
schultezub committed
978
                    m_connected_slots.erase(it);
schultezub's avatar
schultezub committed
979
                    //          delete *it;
schultezub's avatar
schultezub committed
980
                }
schultezub's avatar
schultezub committed
981
                
schultezub's avatar
schultezub committed
982
983
984
                it = itNext;
            }
        }
985
986
987
988
989

        bool has_connections() const
        {
            return !m_connected_slots.empty();
        }
schultezub's avatar
schultezub committed
990
        
schultezub's avatar
schultezub committed
991
992
993
    protected:
        connections_list m_connected_slots;   
    };
schultezub's avatar
schultezub committed
994
    
schultezub's avatar
schultezub committed
995
996
997
998
999
1000
    template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
    class arg5_type, class arg6_type, class mt_policy>
    class _signal_base6 : public _signal_base<mt_policy>
    {
    public:
        typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type, 
schultezub's avatar
schultezub committed
1001
1002
1003
1004
        arg4_type, arg5_type, arg6_type, mt_policy> *>  connections_list;
        
        _signal_base6() {}
        
schultezub's avatar
schultezub committed
1005
        _signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
schultezub's avatar
schultezub committed
1006
1007
                      arg5_type, arg6_type, mt_policy>& s)
        : _signal_base<mt_policy>(s)
schultezub's avatar
schultezub committed
1008
        {
1009
            lock_block_write<mt_policy> lock(this);
schultezub's avatar
schultezub committed
1010
1011
1012
1013
            typename connections_list::const_iterator it = s.m_connected_slots.begin();
            typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
            
            while (it != itEnd) {
schultezub's avatar
schultezub committed
1014
1015
                (*it)->getdest()->signal_connect(this);
                m_connected_slots.push_back((*it)->clone());
schultezub's avatar
schultezub committed
1016
                
schultezub's avatar
schultezub committed
1017
1018
1019
                ++it;
            }
        }
schultezub's avatar
schultezub committed
1020
        
schultezub's avatar
schultezub committed
1021
1022
        void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
        {