~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Tools/EditorFramework/sigslot.h

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// sigslot.h: Signal/Slot classes
 
2
// 
 
3
// Written by Sarah Thompson (sarah@telergy.com) 2002.
 
4
//
 
5
// License: Public domain. You are free to use this code however you like, with the proviso that
 
6
//          the author takes on no responsibility or liability for any use.
 
7
//
 
8
// QUICK DOCUMENTATION 
 
9
//              
 
10
//                              (see also the full documentation at http://sigslot.sourceforge.net/)
 
11
//
 
12
//              #define switches
 
13
//                      SIGSLOT_PURE_ISO                        - Define this to force ISO C++ compliance. This also disables
 
14
//                                                                                all of the thread safety support on platforms where it is 
 
15
//                                                                                available.
 
16
//
 
17
//                      SIGSLOT_USE_POSIX_THREADS       - Force use of Posix threads when using a C++ compiler other than
 
18
//                                                                                gcc on a platform that supports Posix threads. (When using gcc,
 
19
//                                                                                this is the default - use SIGSLOT_PURE_ISO to disable this if 
 
20
//                                                                                necessary)
 
21
//
 
22
//                      SIGSLOT_DEFAULT_MT_POLICY       - Where thread support is enabled, this defaults to multi_threaded_global.
 
23
//                                                                                Otherwise, the default is single_threaded. #define this yourself to
 
24
//                                                                                override the default. In pure ISO mode, anything other than
 
25
//                                                                                single_threaded will cause a compiler error.
 
26
//
 
27
//              PLATFORM NOTES
 
28
//
 
29
//                      Win32                                           - On Win32, the WIN32 symbol must be #defined. Most mainstream
 
30
//                                                                                compilers do this by default, but you may need to define it
 
31
//                                                                                yourself if your build environment is less standard. This causes
 
32
//                                                                                the Win32 thread support to be compiled in and used automatically.
 
33
//
 
34
//                      Unix/Linux/BSD, etc.            - If you're using gcc, it is assumed that you have Posix threads
 
35
//                                                                                available, so they are used automatically. You can override this
 
36
//                                                                                (as under Windows) with the SIGSLOT_PURE_ISO switch. If you're using
 
37
//                                                                                something other than gcc but still want to use Posix threads, you
 
38
//                                                                                need to #define SIGSLOT_USE_POSIX_THREADS.
 
39
//
 
40
//                      ISO C++                                         - If none of the supported platforms are detected, or if
 
41
//                                                                                SIGSLOT_PURE_ISO is defined, all multithreading support is turned off,
 
42
//                                                                                along with any code that might cause a pure ISO C++ environment to
 
43
//                                                                                complain. Before you ask, gcc -ansi -pedantic won't compile this 
 
44
//                                                                                library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of
 
45
//                                                                                errors that aren't really there. If you feel like investigating this,
 
46
//                                                                                please contact the author.
 
47
//
 
48
//              
 
49
//              THREADING MODES
 
50
//
 
51
//                      single_threaded                         - Your program is assumed to be single threaded from the point of view
 
52
//                                                                                of signal/slot usage (i.e. all objects using signals and slots are
 
53
//                                                                                created and destroyed from a single thread). Behaviour if objects are
 
54
//                                                                                destroyed concurrently is undefined (i.e. you'll get the occasional
 
55
//                                                                                segmentation fault/memory exception).
 
56
//
 
57
//                      multi_threaded_global           - Your program is assumed to be multi threaded. Objects using signals and
 
58
//                                                                                slots can be safely created and destroyed from any thread, even when
 
59
//                                                                                connections exist. In multi_threaded_global mode, this is achieved by a
 
60
//                                                                                single global mutex (actually a critical section on Windows because they
 
61
//                                                                                are faster). This option uses less OS resources, but results in more
 
62
//                                                                                opportunities for contention, possibly resulting in more context switches
 
63
//                                                                                than are strictly necessary.
 
64
//
 
65
//                      multi_threaded_local            - Behaviour in this mode is essentially the same as multi_threaded_global,
 
66
//                                                                                except that each signal, and each object that inherits has_slots, all 
 
67
//                                                                                have their own mutex/critical section. In practice, this means that
 
68
//                                                                                mutex collisions (and hence context switches) only happen if they are
 
69
//                                                                                absolutely essential. However, on some platforms, creating a lot of 
 
70
//                                                                                mutexes can slow down the whole OS, so use this option with care.
 
71
//
 
72
//              USING THE LIBRARY
 
73
//
 
74
//                      See the full documentation at http://sigslot.sourceforge.net/
 
75
//
 
76
//
 
77
 
 
78
#ifndef SIGSLOT_H__
 
79
#define SIGSLOT_H__
 
80
 
 
81
#include <set>
 
82
#include <list>
 
83
 
 
84
#if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS))
 
85
#       define _SIGSLOT_SINGLE_THREADED
 
86
#elif defined(WIN32)
 
87
#       define _SIGSLOT_HAS_WIN32_THREADS
 
88
#       include <windows.h>
 
89
#elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS)
 
90
#       define _SIGSLOT_HAS_POSIX_THREADS
 
91
#       include <pthread.h>
 
92
#else
 
93
#       define _SIGSLOT_SINGLE_THREADED
 
94
#endif
 
95
 
 
96
#ifndef SIGSLOT_DEFAULT_MT_POLICY
 
97
#       ifdef _SIGSLOT_SINGLE_THREADED
 
98
#               define SIGSLOT_DEFAULT_MT_POLICY single_threaded
 
99
#       else
 
100
#               define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local
 
101
#       endif
 
102
#endif
 
103
 
 
104
 
 
105
namespace sigslot
 
106
{
 
107
 
 
108
        class MYGUI_EXPORT_DLL single_threaded
 
109
        {
 
110
        public:
 
111
                single_threaded()
 
112
                {
 
113
                }
 
114
 
 
115
                virtual ~single_threaded()
 
116
                {
 
117
                }
 
118
 
 
119
                virtual void lock()
 
120
                {
 
121
                }
 
122
 
 
123
                virtual void unlock()
 
124
                {
 
125
                }
 
126
        };
 
127
 
 
128
#ifdef _SIGSLOT_HAS_WIN32_THREADS
 
129
        // The multi threading policies only get compiled in if they are enabled.
 
130
        class MYGUI_EXPORT_DLL multi_threaded_global
 
131
        {
 
132
        public:
 
133
                multi_threaded_global()
 
134
                {
 
135
                        static bool isinitialised = false;
 
136
 
 
137
                        if (!isinitialised)
 
138
                        {
 
139
                                InitializeCriticalSection(get_critsec());
 
140
                                isinitialised = true;
 
141
                        }
 
142
                }
 
143
 
 
144
                multi_threaded_global(const multi_threaded_global&)
 
145
                {
 
146
                }
 
147
 
 
148
                virtual ~multi_threaded_global()
 
149
                {
 
150
                }
 
151
 
 
152
                virtual void lock()
 
153
                {
 
154
                        EnterCriticalSection(get_critsec());
 
155
                }
 
156
 
 
157
                virtual void unlock()
 
158
                {
 
159
                        LeaveCriticalSection(get_critsec());
 
160
                }
 
161
 
 
162
        private:
 
163
                CRITICAL_SECTION* get_critsec()
 
164
                {
 
165
                        static CRITICAL_SECTION g_critsec;
 
166
                        return &g_critsec;
 
167
                }
 
168
        };
 
169
 
 
170
        class MYGUI_EXPORT_DLL multi_threaded_local
 
171
        {
 
172
        public:
 
173
                multi_threaded_local()
 
174
                {
 
175
                        InitializeCriticalSection(&m_critsec);
 
176
                }
 
177
 
 
178
                multi_threaded_local(const multi_threaded_local&)
 
179
                {
 
180
                        InitializeCriticalSection(&m_critsec);
 
181
                }
 
182
 
 
183
                virtual ~multi_threaded_local()
 
184
                {
 
185
                        DeleteCriticalSection(&m_critsec);
 
186
                }
 
187
 
 
188
                virtual void lock()
 
189
                {
 
190
                        EnterCriticalSection(&m_critsec);
 
191
                }
 
192
 
 
193
                virtual void unlock()
 
194
                {
 
195
                        LeaveCriticalSection(&m_critsec);
 
196
                }
 
197
 
 
198
        private:
 
199
                CRITICAL_SECTION m_critsec;
 
200
        };
 
201
#endif
 
202
 
 
203
#ifdef _SIGSLOT_HAS_POSIX_THREADS
 
204
        // The multi threading policies only get compiled in if they are enabled.
 
205
        class MYGUI_EXPORT_DLL multi_threaded_global
 
206
        {
 
207
        public:
 
208
                multi_threaded_global()
 
209
                {
 
210
                        pthread_mutex_init(get_mutex(), NULL);
 
211
                }
 
212
 
 
213
                multi_threaded_global(const multi_threaded_global&)
 
214
                {
 
215
                }
 
216
 
 
217
                virtual ~multi_threaded_global()
 
218
                {
 
219
                }
 
220
 
 
221
                virtual void lock()
 
222
                {
 
223
                        pthread_mutex_lock(get_mutex());
 
224
                }
 
225
 
 
226
                virtual void unlock()
 
227
                {
 
228
                        pthread_mutex_unlock(get_mutex());
 
229
                }
 
230
 
 
231
        private:
 
232
                pthread_mutex_t* get_mutex()
 
233
                {
 
234
                        static pthread_mutex_t g_mutex;
 
235
                        return &g_mutex;
 
236
                }
 
237
        };
 
238
 
 
239
        class MYGUI_EXPORT_DLL multi_threaded_local
 
240
        {
 
241
        public:
 
242
                multi_threaded_local()
 
243
                {
 
244
                        pthread_mutex_init(&m_mutex, NULL);
 
245
                }
 
246
 
 
247
                multi_threaded_local(const multi_threaded_local&)
 
248
                {
 
249
                        pthread_mutex_init(&m_mutex, NULL);
 
250
                }
 
251
 
 
252
                virtual ~multi_threaded_local()
 
253
                {
 
254
                        pthread_mutex_destroy(&m_mutex);
 
255
                }
 
256
 
 
257
                virtual void lock()
 
258
                {
 
259
                        pthread_mutex_lock(&m_mutex);
 
260
                }
 
261
 
 
262
                virtual void unlock()
 
263
                {
 
264
                        pthread_mutex_unlock(&m_mutex);
 
265
                }
 
266
 
 
267
        private:
 
268
                pthread_mutex_t m_mutex;
 
269
        };
 
270
#endif
 
271
 
 
272
        template <typename mt_policy>
 
273
        class lock_block
 
274
        {
 
275
        public:
 
276
                mt_policy *m_mutex;
 
277
 
 
278
                lock_block(mt_policy *mtx) :
 
279
                        m_mutex(mtx)
 
280
                {
 
281
                        m_mutex->lock();
 
282
                }
 
283
 
 
284
                ~lock_block()
 
285
                {
 
286
                        m_mutex->unlock();
 
287
                }
 
288
        };
 
289
 
 
290
        template <typename mt_policy>
 
291
        class has_slots;
 
292
 
 
293
        template <typename mt_policy>
 
294
        class _connection_base0
 
295
        {
 
296
        public:
 
297
                virtual ~_connection_base0() { }
 
298
                virtual has_slots<mt_policy>* getdest() const = 0;
 
299
                virtual void emit() = 0;
 
300
                virtual bool exist(_connection_base0<mt_policy>* conn) = 0;
 
301
                virtual _connection_base0* clone() = 0;
 
302
                virtual _connection_base0* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
303
        };
 
304
 
 
305
        template <typename arg1_type, typename mt_policy>
 
306
        class _connection_base1
 
307
        {
 
308
        public:
 
309
                virtual ~_connection_base1() { }
 
310
                virtual has_slots<mt_policy>* getdest() const = 0;
 
311
                virtual void emit(arg1_type) = 0;
 
312
                virtual bool exist(_connection_base1<arg1_type, mt_policy>* conn) = 0;
 
313
                virtual _connection_base1<arg1_type, mt_policy>* clone() = 0;
 
314
                virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
315
        };
 
316
 
 
317
        template <typename arg1_type, typename arg2_type, typename mt_policy>
 
318
        class _connection_base2
 
319
        {
 
320
        public:
 
321
                virtual ~_connection_base2() { }
 
322
                virtual has_slots<mt_policy>* getdest() const = 0;
 
323
                virtual void emit(arg1_type, arg2_type) = 0;
 
324
                virtual bool exist(_connection_base2<arg1_type, arg2_type, mt_policy>* conn) = 0;
 
325
                virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0;
 
326
                virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
327
        };
 
328
 
 
329
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename mt_policy>
 
330
        class _connection_base3
 
331
        {
 
332
        public:
 
333
                virtual ~_connection_base3() { }
 
334
                virtual has_slots<mt_policy>* getdest() const = 0;
 
335
                virtual void emit(arg1_type, arg2_type, arg3_type) = 0;
 
336
                virtual bool exist(_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* conn) = 0;
 
337
                virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0;
 
338
                virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
339
        };
 
340
 
 
341
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename mt_policy>
 
342
        class _connection_base4
 
343
        {
 
344
        public:
 
345
                virtual ~_connection_base4() { }
 
346
                virtual has_slots<mt_policy>* getdest() const = 0;
 
347
                virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0;
 
348
                virtual bool exist(_connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* conn) = 0;
 
349
                virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0;
 
350
                virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
351
        };
 
352
 
 
353
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename mt_policy>
 
354
        class _connection_base5
 
355
        {
 
356
        public:
 
357
                virtual ~_connection_base5() { }
 
358
                virtual has_slots<mt_policy>* getdest() const = 0;
 
359
                virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type) = 0;
 
360
                virtual bool exist(_connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>* conn) = 0;
 
361
                virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>* clone() = 0;
 
362
                virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
363
        };
 
364
 
 
365
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename mt_policy>
 
366
        class _connection_base6
 
367
        {
 
368
        public:
 
369
                virtual ~_connection_base6() { }
 
370
                virtual has_slots<mt_policy>* getdest() const = 0;
 
371
                virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type) = 0;
 
372
                virtual bool exist(_connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>* conn) = 0;
 
373
                virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>* clone() = 0;
 
374
                virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
375
        };
 
376
 
 
377
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename mt_policy>
 
378
        class _connection_base7
 
379
        {
 
380
        public:
 
381
                virtual ~_connection_base7() { }
 
382
                virtual has_slots<mt_policy>* getdest() const = 0;
 
383
                virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type) = 0;
 
384
                virtual bool exist(_connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>* conn) = 0;
 
385
                virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0;
 
386
                virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
387
        };
 
388
 
 
389
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename arg8_type, typename mt_policy>
 
390
        class _connection_base8
 
391
        {
 
392
        public:
 
393
                virtual ~_connection_base8() { }
 
394
                virtual has_slots<mt_policy>* getdest() const = 0;
 
395
                virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type) = 0;
 
396
                virtual bool exist(_connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn) = 0;
 
397
                virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0;
 
398
                virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
 
399
        };
 
400
 
 
401
        template <typename mt_policy>
 
402
        class _signal_base :
 
403
                public mt_policy
 
404
        {
 
405
        public:
 
406
                virtual void slot_disconnect(has_slots<mt_policy>* pslot) = 0;
 
407
                virtual void slot_duplicate(const has_slots<mt_policy>* poldslot, has_slots<mt_policy>* pnewslot) = 0;
 
408
        };
 
409
 
 
410
        template <typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
411
        class MYGUI_EXPORT_DLL has_slots :
 
412
                public mt_policy 
 
413
        {
 
414
        private:
 
415
                typedef std::set<_signal_base<mt_policy> *> sender_set;
 
416
                typedef typename sender_set::const_iterator const_iterator;
 
417
 
 
418
        public:
 
419
                has_slots()
 
420
                {
 
421
                }
 
422
 
 
423
                has_slots(const has_slots& hs)
 
424
                        : mt_policy(hs)
 
425
                {
 
426
                        lock_block<mt_policy> lockblock(this);
 
427
                        const_iterator it = hs.m_senders.begin();
 
428
                        const_iterator itEnd = hs.m_senders.end();
 
429
 
 
430
                        while (it != itEnd)
 
431
                        {
 
432
                                (*it)->slot_duplicate(&hs, this);
 
433
                                m_senders.insert(*it);
 
434
                                ++it;
 
435
                        }
 
436
                } 
 
437
 
 
438
                void signal_connect(_signal_base<mt_policy>* sender)
 
439
                {
 
440
                        lock_block<mt_policy> lockblock(this);
 
441
                        m_senders.insert(sender);
 
442
                }
 
443
 
 
444
                void signal_disconnect(_signal_base<mt_policy>* sender)
 
445
                {
 
446
                        lock_block<mt_policy> lockblock(this);
 
447
                        m_senders.erase(sender);
 
448
                }
 
449
 
 
450
                virtual ~has_slots()
 
451
                {
 
452
                        disconnect_all();
 
453
                }
 
454
 
 
455
                void disconnect_all()
 
456
                {
 
457
                        lock_block<mt_policy> lockblock(this);
 
458
                        const_iterator it = m_senders.begin();
 
459
                        const_iterator itEnd = m_senders.end();
 
460
 
 
461
                        while (it != itEnd)
 
462
                        {
 
463
                                (*it)->slot_disconnect(this);
 
464
                                ++it;
 
465
                        }
 
466
 
 
467
                        m_senders.erase(m_senders.begin(), m_senders.end());
 
468
                }
 
469
 
 
470
        private:
 
471
                sender_set m_senders;
 
472
        };
 
473
 
 
474
        template <typename mt_policy>
 
475
        class _signal_base0 :
 
476
                public _signal_base<mt_policy>
 
477
        {
 
478
        public:
 
479
                typedef std::list<_connection_base0<mt_policy> *>  connections_list;
 
480
 
 
481
                _signal_base0()
 
482
                {
 
483
                }
 
484
 
 
485
                _signal_base0(const _signal_base0& s)
 
486
                        : _signal_base<mt_policy>(s)
 
487
                {
 
488
                        lock_block<mt_policy> lockblock(this);
 
489
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
490
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
491
 
 
492
                        while (it != itEnd)
 
493
                        {
 
494
                                (*it)->getdest()->signal_connect(this);
 
495
                                m_connected_slots.push_back((*it)->clone());
 
496
 
 
497
                                ++it;
 
498
                        }
 
499
                }
 
500
 
 
501
                ~_signal_base0()
 
502
                {
 
503
                        disconnect_all();
 
504
                }
 
505
 
 
506
                void disconnect_all()
 
507
                {
 
508
                        lock_block<mt_policy> lockblock(this);
 
509
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
510
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
511
 
 
512
                        while (it != itEnd)
 
513
                        {
 
514
                                (*it)->getdest()->signal_disconnect(this);
 
515
                                delete *it;
 
516
 
 
517
                                ++it;
 
518
                        }
 
519
 
 
520
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
521
                }
 
522
 
 
523
                void disconnect(has_slots<mt_policy>* pclass)
 
524
                {
 
525
                        lock_block<mt_policy> lockblock(this);
 
526
                        typename connections_list::iterator it = m_connected_slots.begin();
 
527
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
528
 
 
529
                        while (it != itEnd)
 
530
                        {
 
531
                                if ((*it)->getdest() == pclass)
 
532
                                {
 
533
                                        delete *it;
 
534
                                        m_connected_slots.erase(it);
 
535
                                        pclass->signal_disconnect(this);
 
536
                                        return;
 
537
                                }
 
538
 
 
539
                                ++it;
 
540
                        }
 
541
                }
 
542
 
 
543
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
544
                {
 
545
                        lock_block<mt_policy> lockblock(this);
 
546
                        typename connections_list::iterator it = m_connected_slots.begin();
 
547
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
548
 
 
549
                        while (it != itEnd)
 
550
                        {
 
551
                                typename connections_list::iterator itNext = it;
 
552
                                ++itNext;
 
553
 
 
554
                                if ((*it)->getdest() == pslot)
 
555
                                {
 
556
                                        m_connected_slots.erase(it);
 
557
                                        // delete *it;
 
558
                                }
 
559
 
 
560
                                it = itNext;
 
561
                        }
 
562
                }
 
563
 
 
564
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
565
                {
 
566
                        lock_block<mt_policy> lockblock(this);
 
567
                        typename connections_list::iterator it = m_connected_slots.begin();
 
568
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
569
 
 
570
                        while (it != itEnd)
 
571
                        {
 
572
                                if ((*it)->getdest() == oldtarget)
 
573
                                {
 
574
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
575
                                }
 
576
 
 
577
                                ++it;
 
578
                        }
 
579
                }
 
580
 
 
581
        protected:
 
582
                connections_list m_connected_slots;   
 
583
        };
 
584
 
 
585
        template <typename arg1_type, typename mt_policy>
 
586
        class _signal_base1 :
 
587
                public _signal_base<mt_policy>
 
588
        {
 
589
        public:
 
590
                typedef std::list<_connection_base1<arg1_type, mt_policy> *>  connections_list;
 
591
 
 
592
                _signal_base1()
 
593
                {
 
594
                }
 
595
 
 
596
                _signal_base1(const _signal_base1<arg1_type, mt_policy>& s)
 
597
                        : _signal_base<mt_policy>(s)
 
598
                {
 
599
                        lock_block<mt_policy> lockblock(this);
 
600
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
601
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
602
 
 
603
                        while (it != itEnd)
 
604
                        {
 
605
                                (*it)->getdest()->signal_connect(this);
 
606
                                m_connected_slots.push_back((*it)->clone());
 
607
 
 
608
                                ++it;
 
609
                        }
 
610
                }
 
611
 
 
612
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
613
                {
 
614
                        lock_block<mt_policy> lockblock(this);
 
615
                        typename connections_list::iterator it = m_connected_slots.begin();
 
616
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
617
 
 
618
                        while (it != itEnd)
 
619
                        {
 
620
                                if ((*it)->getdest() == oldtarget)
 
621
                                {
 
622
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
623
                                }
 
624
 
 
625
                                ++it;
 
626
                        }
 
627
                }
 
628
 
 
629
                ~_signal_base1()
 
630
                {
 
631
                        disconnect_all();
 
632
                }
 
633
 
 
634
                void disconnect_all()
 
635
                {
 
636
                        lock_block<mt_policy> lockblock(this);
 
637
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
638
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
639
 
 
640
                        while (it != itEnd)
 
641
                        {
 
642
                                (*it)->getdest()->signal_disconnect(this);
 
643
                                delete *it;
 
644
 
 
645
                                ++it;
 
646
                        }
 
647
 
 
648
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
649
                }
 
650
 
 
651
                void disconnect(has_slots<mt_policy>* pclass)
 
652
                {
 
653
                        lock_block<mt_policy> lockblock(this);
 
654
                        typename connections_list::iterator it = m_connected_slots.begin();
 
655
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
656
 
 
657
                        while (it != itEnd)
 
658
                        {
 
659
                                if ((*it)->getdest() == pclass)
 
660
                                {
 
661
                                        delete *it;
 
662
                                        m_connected_slots.erase(it);
 
663
                                        pclass->signal_disconnect(this);
 
664
                                        return;
 
665
                                }
 
666
 
 
667
                                ++it;
 
668
                        }
 
669
                }
 
670
 
 
671
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
672
                {
 
673
                        lock_block<mt_policy> lockblock(this);
 
674
                        typename connections_list::iterator it = m_connected_slots.begin();
 
675
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
676
 
 
677
                        while (it != itEnd)
 
678
                        {
 
679
                                typename connections_list::iterator itNext = it;
 
680
                                ++itNext;
 
681
 
 
682
                                if ((*it)->getdest() == pslot)
 
683
                                {
 
684
                                        m_connected_slots.erase(it);
 
685
                                        // delete *it;
 
686
                                }
 
687
 
 
688
                                it = itNext;
 
689
                        }
 
690
                }
 
691
 
 
692
 
 
693
        protected:
 
694
                connections_list m_connected_slots;   
 
695
        };
 
696
 
 
697
        template <typename arg1_type, typename arg2_type, typename mt_policy>
 
698
        class _signal_base2 :
 
699
                public _signal_base<mt_policy>
 
700
        {
 
701
        public:
 
702
                typedef std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *> connections_list;
 
703
 
 
704
                _signal_base2()
 
705
                {
 
706
                }
 
707
 
 
708
                _signal_base2(const _signal_base2<arg1_type, arg2_type, mt_policy>& s)
 
709
                        : _signal_base<mt_policy>(s)
 
710
                {
 
711
                        lock_block<mt_policy> lockblock(this);
 
712
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
713
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
714
 
 
715
                        while (it != itEnd)
 
716
                        {
 
717
                                (*it)->getdest()->signal_connect(this);
 
718
                                m_connected_slots.push_back((*it)->clone());
 
719
 
 
720
                                ++it;
 
721
                        }
 
722
                }
 
723
 
 
724
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
725
                {
 
726
                        lock_block<mt_policy> lockblock(this);
 
727
                        typename connections_list::iterator it = m_connected_slots.begin();
 
728
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
729
 
 
730
                        while (it != itEnd)
 
731
                        {
 
732
                                if ((*it)->getdest() == oldtarget)
 
733
                                {
 
734
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
735
                                }
 
736
 
 
737
                                ++it;
 
738
                        }
 
739
                }
 
740
 
 
741
                ~_signal_base2()
 
742
                {
 
743
                        disconnect_all();
 
744
                }
 
745
 
 
746
                void disconnect_all()
 
747
                {
 
748
                        lock_block<mt_policy> lockblock(this);
 
749
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
750
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
751
 
 
752
                        while (it != itEnd)
 
753
                        {
 
754
                                (*it)->getdest()->signal_disconnect(this);
 
755
                                delete *it;
 
756
 
 
757
                                ++it;
 
758
                        }
 
759
 
 
760
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
761
                }
 
762
 
 
763
                void disconnect(has_slots<mt_policy>* pclass)
 
764
                {
 
765
                        lock_block<mt_policy> lockblock(this);
 
766
                        typename connections_list::iterator it = m_connected_slots.begin();
 
767
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
768
 
 
769
                        while (it != itEnd)
 
770
                        {
 
771
                                if ((*it)->getdest() == pclass)
 
772
                                {
 
773
                                        delete *it;
 
774
                                        m_connected_slots.erase(it);
 
775
                                        pclass->signal_disconnect(this);
 
776
                                        return;
 
777
                                }
 
778
 
 
779
                                ++it;
 
780
                        }
 
781
                }
 
782
 
 
783
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
784
                {
 
785
                        lock_block<mt_policy> lockblock(this);
 
786
                        typename connections_list::iterator it = m_connected_slots.begin();
 
787
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
788
 
 
789
                        while (it != itEnd)
 
790
                        {
 
791
                                typename connections_list::iterator itNext = it;
 
792
                                ++itNext;
 
793
 
 
794
                                if ((*it)->getdest() == pslot)
 
795
                                {
 
796
                                        m_connected_slots.erase(it);
 
797
                                        // delete *it;
 
798
                                }
 
799
 
 
800
                                it = itNext;
 
801
                        }
 
802
                }
 
803
 
 
804
        protected:
 
805
                connections_list m_connected_slots;   
 
806
        };
 
807
 
 
808
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename mt_policy>
 
809
        class _signal_base3 :
 
810
                public _signal_base<mt_policy>
 
811
        {
 
812
        public:
 
813
                typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *> connections_list;
 
814
 
 
815
                _signal_base3()
 
816
                {
 
817
                }
 
818
 
 
819
                _signal_base3(const _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
 
820
                        : _signal_base<mt_policy>(s)
 
821
                {
 
822
                        lock_block<mt_policy> lockblock(this);
 
823
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
824
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
825
 
 
826
                        while (it != itEnd)
 
827
                        {
 
828
                                (*it)->getdest()->signal_connect(this);
 
829
                                m_connected_slots.push_back((*it)->clone());
 
830
 
 
831
                                ++it;
 
832
                        }
 
833
                }
 
834
 
 
835
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
836
                {
 
837
                        lock_block<mt_policy> lockblock(this);
 
838
                        typename connections_list::iterator it = m_connected_slots.begin();
 
839
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
840
 
 
841
                        while (it != itEnd)
 
842
                        {
 
843
                                if ((*it)->getdest() == oldtarget)
 
844
                                {
 
845
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
846
                                }
 
847
 
 
848
                                ++it;
 
849
                        }
 
850
                }
 
851
 
 
852
                ~_signal_base3()
 
853
                {
 
854
                        disconnect_all();
 
855
                }
 
856
 
 
857
                void disconnect_all()
 
858
                {
 
859
                        lock_block<mt_policy> lockblock(this);
 
860
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
861
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
862
 
 
863
                        while (it != itEnd)
 
864
                        {
 
865
                                (*it)->getdest()->signal_disconnect(this);
 
866
                                delete *it;
 
867
 
 
868
                                ++it;
 
869
                        }
 
870
 
 
871
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
872
                }
 
873
 
 
874
                void disconnect(has_slots<mt_policy>* pclass)
 
875
                {
 
876
                        lock_block<mt_policy> lockblock(this);
 
877
                        typename connections_list::iterator it = m_connected_slots.begin();
 
878
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
879
 
 
880
                        while (it != itEnd)
 
881
                        {
 
882
                                if ((*it)->getdest() == pclass)
 
883
                                {
 
884
                                        delete *it;
 
885
                                        m_connected_slots.erase(it);
 
886
                                        pclass->signal_disconnect(this);
 
887
                                        return;
 
888
                                }
 
889
 
 
890
                                ++it;
 
891
                        }
 
892
                }
 
893
 
 
894
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
895
                {
 
896
                        lock_block<mt_policy> lockblock(this);
 
897
                        typename connections_list::iterator it = m_connected_slots.begin();
 
898
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
899
 
 
900
                        while (it != itEnd)
 
901
                        {
 
902
                                typename connections_list::iterator itNext = it;
 
903
                                ++itNext;
 
904
 
 
905
                                if ((*it)->getdest() == pslot)
 
906
                                {
 
907
                                        m_connected_slots.erase(it);
 
908
                                        // delete *it;
 
909
                                }
 
910
 
 
911
                                it = itNext;
 
912
                        }
 
913
                }
 
914
 
 
915
        protected:
 
916
                connections_list m_connected_slots;   
 
917
        };
 
918
 
 
919
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename mt_policy>
 
920
        class _signal_base4 :
 
921
                public _signal_base<mt_policy>
 
922
        {
 
923
        public:
 
924
                typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> *>  connections_list;
 
925
 
 
926
                _signal_base4()
 
927
                {
 
928
                }
 
929
 
 
930
                _signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s) :
 
931
                        _signal_base<mt_policy>(s)
 
932
                {
 
933
                        lock_block<mt_policy> lockblock(this);
 
934
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
935
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
936
 
 
937
                        while (it != itEnd)
 
938
                        {
 
939
                                (*it)->getdest()->signal_connect(this);
 
940
                                m_connected_slots.push_back((*it)->clone());
 
941
 
 
942
                                ++it;
 
943
                        }
 
944
                }
 
945
 
 
946
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
947
                {
 
948
                        lock_block<mt_policy> lockblock(this);
 
949
                        typename connections_list::iterator it = m_connected_slots.begin();
 
950
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
951
 
 
952
                        while (it != itEnd)
 
953
                        {
 
954
                                if ((*it)->getdest() == oldtarget)
 
955
                                {
 
956
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
957
                                }
 
958
 
 
959
                                ++it;
 
960
                        }
 
961
                }
 
962
 
 
963
                ~_signal_base4()
 
964
                {
 
965
                        disconnect_all();
 
966
                }
 
967
 
 
968
                void disconnect_all()
 
969
                {
 
970
                        lock_block<mt_policy> lockblock(this);
 
971
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
972
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
973
 
 
974
                        while (it != itEnd)
 
975
                        {
 
976
                                (*it)->getdest()->signal_disconnect(this);
 
977
                                delete *it;
 
978
 
 
979
                                ++it;
 
980
                        }
 
981
 
 
982
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
983
                }
 
984
 
 
985
                void disconnect(has_slots<mt_policy>* pclass)
 
986
                {
 
987
                        lock_block<mt_policy> lockblock(this);
 
988
                        typename connections_list::iterator it = m_connected_slots.begin();
 
989
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
990
 
 
991
                        while (it != itEnd)
 
992
                        {
 
993
                                if ((*it)->getdest() == pclass)
 
994
                                {
 
995
                                        delete *it;
 
996
                                        m_connected_slots.erase(it);
 
997
                                        pclass->signal_disconnect(this);
 
998
                                        return;
 
999
                                }
 
1000
 
 
1001
                                ++it;
 
1002
                        }
 
1003
                }
 
1004
 
 
1005
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
1006
                {
 
1007
                        lock_block<mt_policy> lockblock(this);
 
1008
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1009
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1010
 
 
1011
                        while (it != itEnd)
 
1012
                        {
 
1013
                                typename connections_list::iterator itNext = it;
 
1014
                                ++itNext;
 
1015
 
 
1016
                                if ((*it)->getdest() == pslot)
 
1017
                                {
 
1018
                                        m_connected_slots.erase(it);
 
1019
                                        // delete *it;
 
1020
                                }
 
1021
 
 
1022
                                it = itNext;
 
1023
                        }
 
1024
                }
 
1025
 
 
1026
        protected:
 
1027
                connections_list m_connected_slots;   
 
1028
        };
 
1029
 
 
1030
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename mt_policy>
 
1031
        class _signal_base5 :
 
1032
                public _signal_base<mt_policy>
 
1033
        {
 
1034
        public:
 
1035
                typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> *>  connections_list;
 
1036
 
 
1037
                _signal_base5()
 
1038
                {
 
1039
                }
 
1040
 
 
1041
                _signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>& s) :
 
1042
                        _signal_base<mt_policy>(s)
 
1043
                {
 
1044
                        lock_block<mt_policy> lockblock(this);
 
1045
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
1046
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
1047
 
 
1048
                        while (it != itEnd)
 
1049
                        {
 
1050
                                (*it)->getdest()->signal_connect(this);
 
1051
                                m_connected_slots.push_back((*it)->clone());
 
1052
 
 
1053
                                ++it;
 
1054
                        }
 
1055
                }
 
1056
 
 
1057
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
1058
                {
 
1059
                        lock_block<mt_policy> lockblock(this);
 
1060
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1061
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1062
 
 
1063
                        while (it != itEnd)
 
1064
                        {
 
1065
                                if ((*it)->getdest() == oldtarget)
 
1066
                                {
 
1067
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
1068
                                }
 
1069
 
 
1070
                                ++it;
 
1071
                        }
 
1072
                }
 
1073
 
 
1074
                ~_signal_base5()
 
1075
                {
 
1076
                        disconnect_all();
 
1077
                }
 
1078
 
 
1079
                void disconnect_all()
 
1080
                {
 
1081
                        lock_block<mt_policy> lockblock(this);
 
1082
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
1083
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
1084
 
 
1085
                        while (it != itEnd)
 
1086
                        {
 
1087
                                (*it)->getdest()->signal_disconnect(this);
 
1088
                                delete *it;
 
1089
 
 
1090
                                ++it;
 
1091
                        }
 
1092
 
 
1093
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
1094
                }
 
1095
 
 
1096
                void disconnect(has_slots<mt_policy>* pclass)
 
1097
                {
 
1098
                        lock_block<mt_policy> lockblock(this);
 
1099
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1100
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1101
 
 
1102
                        while (it != itEnd)
 
1103
                        {
 
1104
                                if ((*it)->getdest() == pclass)
 
1105
                                {
 
1106
                                        delete *it;
 
1107
                                        m_connected_slots.erase(it);
 
1108
                                        pclass->signal_disconnect(this);
 
1109
                                        return;
 
1110
                                }
 
1111
 
 
1112
                                ++it;
 
1113
                        }
 
1114
                }
 
1115
 
 
1116
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
1117
                {
 
1118
                        lock_block<mt_policy> lockblock(this);
 
1119
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1120
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1121
 
 
1122
                        while (it != itEnd)
 
1123
                        {
 
1124
                                typename connections_list::iterator itNext = it;
 
1125
                                ++itNext;
 
1126
 
 
1127
                                if ((*it)->getdest() == pslot)
 
1128
                                {
 
1129
                                        m_connected_slots.erase(it);
 
1130
                                        // delete *it;
 
1131
                                }
 
1132
 
 
1133
                                it = itNext;
 
1134
                        }
 
1135
                }
 
1136
 
 
1137
        protected:
 
1138
                connections_list m_connected_slots;   
 
1139
        };
 
1140
 
 
1141
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename mt_policy>
 
1142
        class _signal_base6 :
 
1143
                public _signal_base<mt_policy>
 
1144
        {
 
1145
        public:
 
1146
                typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> *>  connections_list;
 
1147
 
 
1148
                _signal_base6()
 
1149
                {
 
1150
                }
 
1151
 
 
1152
                _signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>& s) :
 
1153
                        _signal_base<mt_policy>(s)
 
1154
                {
 
1155
                        lock_block<mt_policy> lockblock(this);
 
1156
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
1157
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
1158
 
 
1159
                        while (it != itEnd)
 
1160
                        {
 
1161
                                (*it)->getdest()->signal_connect(this);
 
1162
                                m_connected_slots.push_back((*it)->clone());
 
1163
 
 
1164
                                ++it;
 
1165
                        }
 
1166
                }
 
1167
 
 
1168
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
1169
                {
 
1170
                        lock_block<mt_policy> lockblock(this);
 
1171
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1172
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1173
 
 
1174
                        while (it != itEnd)
 
1175
                        {
 
1176
                                if ((*it)->getdest() == oldtarget)
 
1177
                                {
 
1178
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
1179
                                }
 
1180
 
 
1181
                                ++it;
 
1182
                        }
 
1183
                }
 
1184
 
 
1185
                ~_signal_base6()
 
1186
                {
 
1187
                        disconnect_all();
 
1188
                }
 
1189
 
 
1190
                void disconnect_all()
 
1191
                {
 
1192
                        lock_block<mt_policy> lockblock(this);
 
1193
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
1194
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
1195
 
 
1196
                        while (it != itEnd)
 
1197
                        {
 
1198
                                (*it)->getdest()->signal_disconnect(this);
 
1199
                                delete *it;
 
1200
 
 
1201
                                ++it;
 
1202
                        }
 
1203
 
 
1204
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
1205
                }
 
1206
 
 
1207
                void disconnect(has_slots<mt_policy>* pclass)
 
1208
                {
 
1209
                        lock_block<mt_policy> lockblock(this);
 
1210
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1211
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1212
 
 
1213
                        while (it != itEnd)
 
1214
                        {
 
1215
                                if ((*it)->getdest() == pclass)
 
1216
                                {
 
1217
                                        delete *it;
 
1218
                                        m_connected_slots.erase(it);
 
1219
                                        pclass->signal_disconnect(this);
 
1220
                                        return;
 
1221
                                }
 
1222
 
 
1223
                                ++it;
 
1224
                        }
 
1225
                }
 
1226
 
 
1227
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
1228
                {
 
1229
                        lock_block<mt_policy> lockblock(this);
 
1230
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1231
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1232
 
 
1233
                        while (it != itEnd)
 
1234
                        {
 
1235
                                typename connections_list::iterator itNext = it;
 
1236
                                ++itNext;
 
1237
 
 
1238
                                if ((*it)->getdest() == pslot)
 
1239
                                {
 
1240
                                        m_connected_slots.erase(it);
 
1241
                                        // delete *it;
 
1242
                                }
 
1243
 
 
1244
                                it = itNext;
 
1245
                        }
 
1246
                }
 
1247
 
 
1248
        protected:
 
1249
                connections_list m_connected_slots;   
 
1250
        };
 
1251
 
 
1252
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename mt_policy>
 
1253
        class _signal_base7 :
 
1254
                public _signal_base<mt_policy>
 
1255
        {
 
1256
        public:
 
1257
                typedef std::list<_connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> *>  connections_list;
 
1258
 
 
1259
                _signal_base7()
 
1260
                {
 
1261
                }
 
1262
 
 
1263
                _signal_base7(const _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>& s) :
 
1264
                        _signal_base<mt_policy>(s)
 
1265
                {
 
1266
                        lock_block<mt_policy> lockblock(this);
 
1267
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
1268
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
1269
 
 
1270
                        while (it != itEnd)
 
1271
                        {
 
1272
                                (*it)->getdest()->signal_connect(this);
 
1273
                                m_connected_slots.push_back((*it)->clone());
 
1274
 
 
1275
                                ++it;
 
1276
                        }
 
1277
                }
 
1278
 
 
1279
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
1280
                {
 
1281
                        lock_block<mt_policy> lockblock(this);
 
1282
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1283
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1284
 
 
1285
                        while (it != itEnd)
 
1286
                        {
 
1287
                                if ((*it)->getdest() == oldtarget)
 
1288
                                {
 
1289
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
1290
                                }
 
1291
 
 
1292
                                ++it;
 
1293
                        }
 
1294
                }
 
1295
 
 
1296
                ~_signal_base7()
 
1297
                {
 
1298
                        disconnect_all();
 
1299
                }
 
1300
 
 
1301
                void disconnect_all()
 
1302
                {
 
1303
                        lock_block<mt_policy> lockblock(this);
 
1304
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
1305
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
1306
 
 
1307
                        while (it != itEnd)
 
1308
                        {
 
1309
                                (*it)->getdest()->signal_disconnect(this);
 
1310
                                delete *it;
 
1311
 
 
1312
                                ++it;
 
1313
                        }
 
1314
 
 
1315
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
1316
                }
 
1317
 
 
1318
                void disconnect(has_slots<mt_policy>* pclass)
 
1319
                {
 
1320
                        lock_block<mt_policy> lockblock(this);
 
1321
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1322
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1323
 
 
1324
                        while (it != itEnd)
 
1325
                        {
 
1326
                                if ((*it)->getdest() == pclass)
 
1327
                                {
 
1328
                                        delete *it;
 
1329
                                        m_connected_slots.erase(it);
 
1330
                                        pclass->signal_disconnect(this);
 
1331
                                        return;
 
1332
                                }
 
1333
 
 
1334
                                ++it;
 
1335
                        }
 
1336
                }
 
1337
 
 
1338
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
1339
                {
 
1340
                        lock_block<mt_policy> lockblock(this);
 
1341
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1342
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1343
 
 
1344
                        while (it != itEnd)
 
1345
                        {
 
1346
                                typename connections_list::iterator itNext = it;
 
1347
                                ++itNext;
 
1348
 
 
1349
                                if ((*it)->getdest() == pslot)
 
1350
                                {
 
1351
                                        m_connected_slots.erase(it);
 
1352
                                        // delete *it;
 
1353
                                }
 
1354
 
 
1355
                                it = itNext;
 
1356
                        }
 
1357
                }
 
1358
 
 
1359
        protected:
 
1360
                connections_list m_connected_slots;   
 
1361
        };
 
1362
 
 
1363
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename arg8_type, typename mt_policy>
 
1364
        class _signal_base8 :
 
1365
                public _signal_base<mt_policy>
 
1366
        {
 
1367
        public:
 
1368
                typedef std::list<_connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> *> connections_list;
 
1369
 
 
1370
                _signal_base8()
 
1371
                {
 
1372
                }
 
1373
 
 
1374
                _signal_base8(const _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s) :
 
1375
                        _signal_base<mt_policy>(s)
 
1376
                {
 
1377
                        lock_block<mt_policy> lockblock(this);
 
1378
                        typename connections_list::const_iterator it = s.m_connected_slots.begin();
 
1379
                        typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
 
1380
 
 
1381
                        while (it != itEnd)
 
1382
                        {
 
1383
                                (*it)->getdest()->signal_connect(this);
 
1384
                                m_connected_slots.push_back((*it)->clone());
 
1385
 
 
1386
                                ++it;
 
1387
                        }
 
1388
                }
 
1389
 
 
1390
                void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
 
1391
                {
 
1392
                        lock_block<mt_policy> lockblock(this);
 
1393
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1394
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1395
 
 
1396
                        while (it != itEnd)
 
1397
                        {
 
1398
                                if ((*it)->getdest() == oldtarget)
 
1399
                                {
 
1400
                                        m_connected_slots.push_back((*it)->duplicate(newtarget));
 
1401
                                }
 
1402
 
 
1403
                                ++it;
 
1404
                        }
 
1405
                }
 
1406
 
 
1407
                ~_signal_base8()
 
1408
                {
 
1409
                        disconnect_all();
 
1410
                }
 
1411
 
 
1412
                void disconnect_all()
 
1413
                {
 
1414
                        lock_block<mt_policy> lockblock(this);
 
1415
                        typename connections_list::const_iterator it = m_connected_slots.begin();
 
1416
                        typename connections_list::const_iterator itEnd = m_connected_slots.end();
 
1417
 
 
1418
                        while (it != itEnd)
 
1419
                        {
 
1420
                                (*it)->getdest()->signal_disconnect(this);
 
1421
                                delete *it;
 
1422
 
 
1423
                                ++it;
 
1424
                        }
 
1425
 
 
1426
                        m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
 
1427
                }
 
1428
 
 
1429
                void disconnect(has_slots<mt_policy>* pclass)
 
1430
                {
 
1431
                        lock_block<mt_policy> lockblock(this);
 
1432
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1433
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1434
 
 
1435
                        while (it != itEnd)
 
1436
                        {
 
1437
                                if ((*it)->getdest() == pclass)
 
1438
                                {
 
1439
                                        delete *it;
 
1440
                                        m_connected_slots.erase(it);
 
1441
                                        pclass->signal_disconnect(this);
 
1442
                                        return;
 
1443
                                }
 
1444
 
 
1445
                                ++it;
 
1446
                        }
 
1447
                }
 
1448
 
 
1449
                void slot_disconnect(has_slots<mt_policy>* pslot)
 
1450
                {
 
1451
                        lock_block<mt_policy> lockblock(this);
 
1452
                        typename connections_list::iterator it = m_connected_slots.begin();
 
1453
                        typename connections_list::iterator itEnd = m_connected_slots.end();
 
1454
 
 
1455
                        while (it != itEnd)
 
1456
                        {
 
1457
                                typename connections_list::iterator itNext = it;
 
1458
                                ++itNext;
 
1459
 
 
1460
                                if ((*it)->getdest() == pslot)
 
1461
                                {
 
1462
                                        m_connected_slots.erase(it);
 
1463
                                        // delete *it;
 
1464
                                }
 
1465
 
 
1466
                                it = itNext;
 
1467
                        }
 
1468
                }
 
1469
 
 
1470
        protected:
 
1471
                connections_list m_connected_slots;   
 
1472
        };
 
1473
 
 
1474
 
 
1475
        template <typename dest_type, typename mt_policy>
 
1476
        class _connection0 :
 
1477
                public _connection_base0<mt_policy>
 
1478
        {
 
1479
        public:
 
1480
                typedef _connection_base0<mt_policy> base_type;
 
1481
                typedef _connection0<dest_type, mt_policy> this_type;
 
1482
 
 
1483
                _connection0()
 
1484
                {
 
1485
                        m_pobject = NULL;
 
1486
                        m_pmemfun = NULL;
 
1487
                }
 
1488
 
 
1489
                _connection0(dest_type* pobject, void (dest_type::*pmemfun)())
 
1490
                {
 
1491
                        m_pobject = pobject;
 
1492
                        m_pmemfun = pmemfun;
 
1493
                }
 
1494
 
 
1495
                virtual base_type* clone()
 
1496
                {
 
1497
                        return new this_type(*this);
 
1498
                }
 
1499
 
 
1500
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1501
                {
 
1502
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1503
                }
 
1504
 
 
1505
                virtual void emit()
 
1506
                {
 
1507
                        (m_pobject->*m_pmemfun)();
 
1508
                }
 
1509
 
 
1510
                virtual bool exist(base_type* conn)
 
1511
                {
 
1512
                        this_type* pconn = static_cast<this_type*>(conn);
 
1513
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1514
                }
 
1515
 
 
1516
                virtual has_slots<mt_policy>* getdest() const
 
1517
                {
 
1518
                        return m_pobject;
 
1519
                }
 
1520
 
 
1521
        private:
 
1522
                dest_type* m_pobject;
 
1523
                void (dest_type::* m_pmemfun)();
 
1524
        };
 
1525
 
 
1526
        template <typename dest_type, typename arg1_type, typename mt_policy>
 
1527
        class _connection1 :
 
1528
                public _connection_base1<arg1_type, mt_policy>
 
1529
        {
 
1530
        public:
 
1531
                typedef _connection_base1<arg1_type, mt_policy> base_type;
 
1532
                typedef _connection1<dest_type, arg1_type, mt_policy> this_type;
 
1533
 
 
1534
                _connection1()
 
1535
                {
 
1536
                        m_pobject = NULL;
 
1537
                        m_pmemfun = NULL;
 
1538
                }
 
1539
 
 
1540
                _connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type))
 
1541
                {
 
1542
                        m_pobject = pobject;
 
1543
                        m_pmemfun = pmemfun;
 
1544
                }
 
1545
 
 
1546
                virtual base_type* clone()
 
1547
                {
 
1548
                        return new this_type(*this);
 
1549
                }
 
1550
 
 
1551
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1552
                {
 
1553
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1554
                }
 
1555
 
 
1556
                virtual void emit(arg1_type a1)
 
1557
                {
 
1558
                        (m_pobject->*m_pmemfun)(a1);
 
1559
                }
 
1560
 
 
1561
                virtual bool exist(base_type* conn)
 
1562
                {
 
1563
                        this_type* pconn = static_cast<this_type*>(conn);
 
1564
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1565
                }
 
1566
 
 
1567
                virtual has_slots<mt_policy>* getdest() const
 
1568
                {
 
1569
                        return m_pobject;
 
1570
                }
 
1571
 
 
1572
        private:
 
1573
                dest_type* m_pobject;
 
1574
                void (dest_type::* m_pmemfun)(arg1_type);
 
1575
        };
 
1576
 
 
1577
        template <typename dest_type, typename arg1_type, typename arg2_type, typename mt_policy>
 
1578
        class _connection2 :
 
1579
                public _connection_base2<arg1_type, arg2_type, mt_policy>
 
1580
        {
 
1581
        public:
 
1582
                typedef _connection_base2<arg1_type, arg2_type, mt_policy> base_type;
 
1583
                typedef _connection2<dest_type, arg1_type, arg2_type, mt_policy> this_type;
 
1584
 
 
1585
                _connection2()
 
1586
                {
 
1587
                        m_pobject = NULL;
 
1588
                        m_pmemfun = NULL;
 
1589
                }
 
1590
 
 
1591
                _connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
 
1592
                        arg2_type))
 
1593
                {
 
1594
                        m_pobject = pobject;
 
1595
                        m_pmemfun = pmemfun;
 
1596
                }
 
1597
 
 
1598
                virtual base_type* clone()
 
1599
                {
 
1600
                        return new this_type(*this);
 
1601
                }
 
1602
 
 
1603
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1604
                {
 
1605
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1606
                }
 
1607
 
 
1608
                virtual void emit(arg1_type a1, arg2_type a2)
 
1609
                {
 
1610
                        (m_pobject->*m_pmemfun)(a1, a2);
 
1611
                }
 
1612
 
 
1613
                virtual bool exist(base_type* conn)
 
1614
                {
 
1615
                        this_type* pconn = static_cast<this_type*>(conn);
 
1616
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1617
                }
 
1618
 
 
1619
                virtual has_slots<mt_policy>* getdest() const
 
1620
                {
 
1621
                        return m_pobject;
 
1622
                }
 
1623
 
 
1624
        private:
 
1625
                dest_type* m_pobject;
 
1626
                void (dest_type::* m_pmemfun)(arg1_type, arg2_type);
 
1627
        };
 
1628
 
 
1629
        template <typename dest_type, typename arg1_type, typename arg2_type, typename arg3_type, typename mt_policy>
 
1630
        class _connection3 :
 
1631
                public _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>
 
1632
        {
 
1633
        public:
 
1634
                typedef _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> base_type;
 
1635
                typedef _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy> this_type;
 
1636
 
 
1637
                _connection3()
 
1638
                {
 
1639
                        m_pobject = NULL;
 
1640
                        m_pmemfun = NULL;
 
1641
                }
 
1642
 
 
1643
                _connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, arg2_type, arg3_type))
 
1644
                {
 
1645
                        m_pobject = pobject;
 
1646
                        m_pmemfun = pmemfun;
 
1647
                }
 
1648
 
 
1649
                virtual base_type* clone()
 
1650
                {
 
1651
                        return new this_type(*this);
 
1652
                }
 
1653
 
 
1654
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1655
                {
 
1656
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1657
                }
 
1658
 
 
1659
                virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3)
 
1660
                {
 
1661
                        (m_pobject->*m_pmemfun)(a1, a2, a3);
 
1662
                }
 
1663
 
 
1664
                virtual bool exist(base_type* conn)
 
1665
                {
 
1666
                        this_type* pconn = static_cast<this_type*>(conn);
 
1667
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1668
                }
 
1669
 
 
1670
                virtual has_slots<mt_policy>* getdest() const
 
1671
                {
 
1672
                        return m_pobject;
 
1673
                }
 
1674
 
 
1675
        private:
 
1676
                dest_type* m_pobject;
 
1677
                void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type);
 
1678
        };
 
1679
 
 
1680
        template <typename dest_type, typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename mt_policy>
 
1681
        class _connection4 :
 
1682
                public _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>
 
1683
        {
 
1684
        public:
 
1685
                typedef _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> base_type;
 
1686
                typedef _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> this_type;
 
1687
 
 
1688
                _connection4()
 
1689
                {
 
1690
                        m_pobject = NULL;
 
1691
                        m_pmemfun = NULL;
 
1692
                }
 
1693
 
 
1694
                _connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type))
 
1695
                {
 
1696
                        m_pobject = pobject;
 
1697
                        m_pmemfun = pmemfun;
 
1698
                }
 
1699
 
 
1700
                virtual base_type* clone()
 
1701
                {
 
1702
                        return new this_type(*this);
 
1703
                }
 
1704
 
 
1705
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1706
                {
 
1707
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1708
                }
 
1709
 
 
1710
                virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
 
1711
                {
 
1712
                        (m_pobject->*m_pmemfun)(a1, a2, a3, a4);
 
1713
                }
 
1714
 
 
1715
                virtual bool exist(base_type* conn)
 
1716
                {
 
1717
                        this_type* pconn = static_cast<this_type*>(conn);
 
1718
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1719
                }
 
1720
 
 
1721
                virtual has_slots<mt_policy>* getdest() const
 
1722
                {
 
1723
                        return m_pobject;
 
1724
                }
 
1725
 
 
1726
        private:
 
1727
                dest_type* m_pobject;
 
1728
                void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type,
 
1729
                        arg4_type);
 
1730
        };
 
1731
 
 
1732
        template <typename dest_type, typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename mt_policy>
 
1733
        class _connection5 :
 
1734
                public _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>
 
1735
        {
 
1736
        public:
 
1737
                typedef _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> base_type;
 
1738
                typedef _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> this_type;
 
1739
 
 
1740
                _connection5()
 
1741
                {
 
1742
                        m_pobject = NULL;
 
1743
                        m_pmemfun = NULL;
 
1744
                }
 
1745
 
 
1746
                _connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type))
 
1747
                {
 
1748
                        m_pobject = pobject;
 
1749
                        m_pmemfun = pmemfun;
 
1750
                }
 
1751
 
 
1752
                virtual base_type* clone()
 
1753
                {
 
1754
                        return new this_type(*this);
 
1755
                }
 
1756
 
 
1757
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1758
                {
 
1759
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1760
                }
 
1761
 
 
1762
                virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5)
 
1763
                {
 
1764
                        (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5);
 
1765
                }
 
1766
 
 
1767
                virtual bool exist(base_type* conn)
 
1768
                {
 
1769
                        this_type* pconn = static_cast<this_type*>(conn);
 
1770
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
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, arg5_type);
 
1781
        };
 
1782
 
 
1783
        template <typename dest_type, typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename mt_policy>
 
1784
        class _connection6 :
 
1785
                public _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>
 
1786
        {
 
1787
        public:
 
1788
                typedef _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> base_type;
 
1789
                typedef _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> this_type;
 
1790
 
 
1791
                _connection6()
 
1792
                {
 
1793
                        m_pobject = NULL;
 
1794
                        m_pmemfun = NULL;
 
1795
                }
 
1796
 
 
1797
                _connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
 
1798
                {
 
1799
                        m_pobject = pobject;
 
1800
                        m_pmemfun = pmemfun;
 
1801
                }
 
1802
 
 
1803
                virtual base_type* clone()
 
1804
                {
 
1805
                        return new this_type(*this);
 
1806
                }
 
1807
 
 
1808
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1809
                {
 
1810
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1811
                }
 
1812
 
 
1813
                virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6)
 
1814
                {
 
1815
                        (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6);
 
1816
                }
 
1817
 
 
1818
                virtual bool exist(base_type* conn)
 
1819
                {
 
1820
                        this_type* pconn = static_cast<this_type*>(conn);
 
1821
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1822
                }
 
1823
 
 
1824
                virtual has_slots<mt_policy>* getdest() const
 
1825
                {
 
1826
                        return m_pobject;
 
1827
                }
 
1828
 
 
1829
        private:
 
1830
                dest_type* m_pobject;
 
1831
                void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type);
 
1832
        };
 
1833
 
 
1834
        template <typename dest_type, typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename mt_policy>
 
1835
        class _connection7 :
 
1836
                public _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
 
1837
        {
 
1838
        public:
 
1839
                typedef _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> base_type;
 
1840
                typedef _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> this_type;
 
1841
 
 
1842
                _connection7()
 
1843
                {
 
1844
                        m_pobject = NULL;
 
1845
                        m_pmemfun = NULL;
 
1846
                }
 
1847
 
 
1848
                _connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type))
 
1849
                {
 
1850
                        m_pobject = pobject;
 
1851
                        m_pmemfun = pmemfun;
 
1852
                }
 
1853
 
 
1854
                virtual base_type* clone()
 
1855
                {
 
1856
                        return new this_type(*this);
 
1857
                }
 
1858
 
 
1859
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1860
                {
 
1861
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1862
                }
 
1863
 
 
1864
                virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6, arg7_type a7)
 
1865
                {
 
1866
                        (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7);
 
1867
                }
 
1868
 
 
1869
                virtual bool exist(base_type* conn)
 
1870
                {
 
1871
                        this_type* pconn = static_cast<this_type*>(conn);
 
1872
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1873
                }
 
1874
 
 
1875
                virtual has_slots<mt_policy>* getdest() const
 
1876
                {
 
1877
                        return m_pobject;
 
1878
                }
 
1879
 
 
1880
        private:
 
1881
                dest_type* m_pobject;
 
1882
                void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type);
 
1883
        };
 
1884
 
 
1885
        template <typename dest_type, typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename arg8_type, typename mt_policy>
 
1886
        class _connection8 :
 
1887
                public _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
 
1888
        {
 
1889
        public:
 
1890
                typedef _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> base_type;
 
1891
                typedef _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> this_type;
 
1892
 
 
1893
                _connection8()
 
1894
                {
 
1895
                        m_pobject = NULL;
 
1896
                        m_pmemfun = NULL;
 
1897
                }
 
1898
 
 
1899
                _connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type))
 
1900
                {
 
1901
                        m_pobject = pobject;
 
1902
                        m_pmemfun = pmemfun;
 
1903
                }
 
1904
 
 
1905
                virtual base_type* clone()
 
1906
                {
 
1907
                        return new this_type(*this);
 
1908
                }
 
1909
 
 
1910
                virtual base_type* duplicate(has_slots<mt_policy>* pnewdest)
 
1911
                {
 
1912
                        return new this_type((dest_type *)pnewdest, m_pmemfun);
 
1913
                }
 
1914
 
 
1915
                virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
 
1916
                {
 
1917
                        (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8);
 
1918
                }
 
1919
 
 
1920
                virtual bool exist(base_type* conn)
 
1921
                {
 
1922
                        this_type* pconn = static_cast<this_type*>(conn);
 
1923
                        return pconn->m_pobject == m_pobject && pconn->m_pmemfun == m_pmemfun;
 
1924
                }
 
1925
 
 
1926
                virtual has_slots<mt_policy>* getdest() const
 
1927
                {
 
1928
                        return m_pobject;
 
1929
                }
 
1930
 
 
1931
        private:
 
1932
                dest_type* m_pobject;
 
1933
                void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type);
 
1934
        };
 
1935
 
 
1936
        template <typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
1937
        class signal0 :
 
1938
                public _signal_base0<mt_policy>
 
1939
        {
 
1940
        public:
 
1941
                typedef _signal_base0<mt_policy> base_type;
 
1942
 
 
1943
                signal0()
 
1944
                {
 
1945
                }
 
1946
 
 
1947
                signal0(const signal0<mt_policy>& s) :
 
1948
                        _signal_base0<mt_policy>(s)
 
1949
                {
 
1950
                }
 
1951
 
 
1952
                template <typename desttype>
 
1953
                void connect(desttype* pclass, void (desttype::*pmemfun)())
 
1954
                {
 
1955
                        lock_block<mt_policy> lockblock(this);
 
1956
                        _connection0<desttype, mt_policy>* conn = new _connection0<desttype, mt_policy>(pclass, pmemfun);
 
1957
                        base_type::m_connected_slots.push_back(conn);
 
1958
                        pclass->signal_connect(this);
 
1959
                }
 
1960
 
 
1961
                void emit()
 
1962
                {
 
1963
                        lock_block<mt_policy> lockblock(this);
 
1964
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
1965
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
1966
 
 
1967
                        while (it != itEnd)
 
1968
                        {
 
1969
                                itNext = it;
 
1970
                                ++itNext;
 
1971
 
 
1972
                                (*it)->emit();
 
1973
 
 
1974
                                it = itNext;
 
1975
                        }
 
1976
                }
 
1977
 
 
1978
                void operator()()
 
1979
                {
 
1980
                        lock_block<mt_policy> lockblock(this);
 
1981
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
1982
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
1983
 
 
1984
                        while (it != itEnd)
 
1985
                        {
 
1986
                                itNext = it;
 
1987
                                ++itNext;
 
1988
 
 
1989
                                (*it)->emit();
 
1990
 
 
1991
                                it = itNext;
 
1992
                        }
 
1993
                }
 
1994
        };
 
1995
 
 
1996
        template <typename arg1_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
1997
        class signal1 :
 
1998
                public _signal_base1<arg1_type, mt_policy>
 
1999
        {
 
2000
        public:
 
2001
                typedef _signal_base1<arg1_type, mt_policy> base_type;
 
2002
 
 
2003
                signal1()
 
2004
                {
 
2005
                }
 
2006
 
 
2007
                signal1(const signal1<arg1_type, mt_policy>& s) :
 
2008
                        _signal_base1<arg1_type, mt_policy>(s)
 
2009
                {
 
2010
                }
 
2011
 
 
2012
                template <typename desttype>
 
2013
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type))
 
2014
                {
 
2015
                        lock_block<mt_policy> lockblock(this);
 
2016
                        _connection1<desttype, arg1_type, mt_policy>* conn = new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun);
 
2017
                        base_type::m_connected_slots.push_back(conn);
 
2018
                        pclass->signal_connect(this);
 
2019
                }
 
2020
 
 
2021
                template <typename desttype>
 
2022
                bool exist(desttype* pclass, void (desttype::*pmemfun)(arg1_type))
 
2023
                {
 
2024
                        lock_block<mt_policy> lockblock(this);
 
2025
                        _connection1<desttype, arg1_type, mt_policy>* conn = new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun);
 
2026
                        typename base_type::connections_list::const_iterator it = base_type::m_connected_slots.begin();
 
2027
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2028
 
 
2029
                        bool result = false;
 
2030
 
 
2031
                        while (it != itEnd)
 
2032
                        {
 
2033
                                if ((*it)->exist(conn))
 
2034
                                {
 
2035
                                        result = true;
 
2036
                                        break;
 
2037
                                }
 
2038
 
 
2039
                                ++it;
 
2040
                        }
 
2041
 
 
2042
                        delete conn;
 
2043
                        return result;
 
2044
                }
 
2045
 
 
2046
                void emit(arg1_type a1)
 
2047
                {
 
2048
                        lock_block<mt_policy> lockblock(this);
 
2049
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2050
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2051
 
 
2052
                        while (it != itEnd)
 
2053
                        {
 
2054
                                itNext = it;
 
2055
                                ++itNext;
 
2056
 
 
2057
                                (*it)->emit(a1);
 
2058
 
 
2059
                                it = itNext;
 
2060
                        }
 
2061
                }
 
2062
 
 
2063
                void operator()(arg1_type a1)
 
2064
                {
 
2065
                        lock_block<mt_policy> lockblock(this);
 
2066
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2067
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2068
 
 
2069
                        while (it != itEnd)
 
2070
                        {
 
2071
                                itNext = it;
 
2072
                                ++itNext;
 
2073
 
 
2074
                                (*it)->emit(a1);
 
2075
 
 
2076
                                it = itNext;
 
2077
                        }
 
2078
                }
 
2079
        };
 
2080
 
 
2081
        template <typename arg1_type, typename arg2_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
2082
        class signal2 :
 
2083
                public _signal_base2<arg1_type, arg2_type, mt_policy>
 
2084
        {
 
2085
        public:
 
2086
                typedef _signal_base2<arg1_type, arg2_type, mt_policy> base_type;
 
2087
 
 
2088
                signal2()
 
2089
                {
 
2090
                }
 
2091
 
 
2092
                signal2(const signal2<arg1_type, arg2_type, mt_policy>& s)
 
2093
                        : _signal_base2<arg1_type, arg2_type, mt_policy>(s)
 
2094
                {
 
2095
                }
 
2096
 
 
2097
                template <typename desttype>
 
2098
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, arg2_type))
 
2099
                {
 
2100
                        lock_block<mt_policy> lockblock(this);
 
2101
                        _connection2<desttype, arg1_type, arg2_type, mt_policy>* conn = new _connection2<desttype, arg1_type, arg2_type, mt_policy>(pclass, pmemfun);
 
2102
                        base_type::m_connected_slots.push_back(conn);
 
2103
                        pclass->signal_connect(this);
 
2104
                }
 
2105
 
 
2106
                void emit(arg1_type a1, arg2_type a2)
 
2107
                {
 
2108
                        lock_block<mt_policy> lockblock(this);
 
2109
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2110
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2111
 
 
2112
                        while (it != itEnd)
 
2113
                        {
 
2114
                                itNext = it;
 
2115
                                ++itNext;
 
2116
 
 
2117
                                (*it)->emit(a1, a2);
 
2118
 
 
2119
                                it = itNext;
 
2120
                        }
 
2121
                }
 
2122
 
 
2123
                void operator()(arg1_type a1, arg2_type a2)
 
2124
                {
 
2125
                        lock_block<mt_policy> lockblock(this);
 
2126
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2127
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2128
 
 
2129
                        while (it != itEnd)
 
2130
                        {
 
2131
                                itNext = it;
 
2132
                                ++itNext;
 
2133
 
 
2134
                                (*it)->emit(a1, a2);
 
2135
 
 
2136
                                it = itNext;
 
2137
                        }
 
2138
                }
 
2139
        };
 
2140
 
 
2141
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
2142
        class signal3 :
 
2143
                public _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>
 
2144
        {
 
2145
        public:
 
2146
                typedef _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> base_type;
 
2147
 
 
2148
                signal3()
 
2149
                {
 
2150
                }
 
2151
 
 
2152
                signal3(const signal3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
 
2153
                        : _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>(s)
 
2154
                {
 
2155
                }
 
2156
 
 
2157
                template <typename desttype>
 
2158
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, arg2_type, arg3_type))
 
2159
                {
 
2160
                        lock_block<mt_policy> lockblock(this);
 
2161
                        _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn = new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass, pmemfun);
 
2162
                        base_type::m_connected_slots.push_back(conn);
 
2163
                        pclass->signal_connect(this);
 
2164
                }
 
2165
 
 
2166
                void emit(arg1_type a1, arg2_type a2, arg3_type a3)
 
2167
                {
 
2168
                        lock_block<mt_policy> lockblock(this);
 
2169
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2170
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2171
 
 
2172
                        while (it != itEnd)
 
2173
                        {
 
2174
                                itNext = it;
 
2175
                                ++itNext;
 
2176
 
 
2177
                                (*it)->emit(a1, a2, a3);
 
2178
 
 
2179
                                it = itNext;
 
2180
                        }
 
2181
                }
 
2182
 
 
2183
                void operator()(arg1_type a1, arg2_type a2, arg3_type a3)
 
2184
                {
 
2185
                        lock_block<mt_policy> lockblock(this);
 
2186
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2187
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2188
 
 
2189
                        while (it != itEnd)
 
2190
                        {
 
2191
                                itNext = it;
 
2192
                                ++itNext;
 
2193
 
 
2194
                                (*it)->emit(a1, a2, a3);
 
2195
 
 
2196
                                it = itNext;
 
2197
                        }
 
2198
                }
 
2199
        };
 
2200
 
 
2201
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
2202
        class signal4 :
 
2203
                public _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>
 
2204
        {
 
2205
        public:
 
2206
                typedef _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> base_type;
 
2207
 
 
2208
                signal4()
 
2209
                {
 
2210
                }
 
2211
 
 
2212
                signal4(const signal4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s) :
 
2213
                        _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(s)
 
2214
                {
 
2215
                }
 
2216
 
 
2217
                template <typename desttype>
 
2218
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type))
 
2219
                {
 
2220
                        lock_block<mt_policy> lockblock(this);
 
2221
                        _connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* conn = new _connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(pclass, pmemfun);
 
2222
                        base_type::m_connected_slots.push_back(conn);
 
2223
                        pclass->signal_connect(this);
 
2224
                }
 
2225
 
 
2226
                void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
 
2227
                {
 
2228
                        lock_block<mt_policy> lockblock(this);
 
2229
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2230
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2231
 
 
2232
                        while (it != itEnd)
 
2233
                        {
 
2234
                                itNext = it;
 
2235
                                ++itNext;
 
2236
 
 
2237
                                (*it)->emit(a1, a2, a3, a4);
 
2238
 
 
2239
                                it = itNext;
 
2240
                        }
 
2241
                }
 
2242
 
 
2243
                void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
 
2244
                {
 
2245
                        lock_block<mt_policy> lockblock(this);
 
2246
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2247
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2248
 
 
2249
                        while (it != itEnd)
 
2250
                        {
 
2251
                                itNext = it;
 
2252
                                ++itNext;
 
2253
 
 
2254
                                (*it)->emit(a1, a2, a3, a4);
 
2255
 
 
2256
                                it = itNext;
 
2257
                        }
 
2258
                }
 
2259
        };
 
2260
 
 
2261
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
2262
        class signal5 :
 
2263
                public _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>
 
2264
        {
 
2265
        public:
 
2266
                typedef _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> base_type;
 
2267
 
 
2268
                signal5()
 
2269
                {
 
2270
                }
 
2271
 
 
2272
                signal5(const signal5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>& s) :
 
2273
                        _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>(s)
 
2274
                {
 
2275
                }
 
2276
 
 
2277
                template <typename desttype>
 
2278
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type))
 
2279
                {
 
2280
                        lock_block<mt_policy> lockblock(this);
 
2281
                        _connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>* conn = new _connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>(pclass, pmemfun);
 
2282
                        base_type::m_connected_slots.push_back(conn);
 
2283
                        pclass->signal_connect(this);
 
2284
                }
 
2285
 
 
2286
                void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
 
2287
                        arg5_type a5)
 
2288
                {
 
2289
                        lock_block<mt_policy> lockblock(this);
 
2290
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2291
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2292
 
 
2293
                        while (it != itEnd)
 
2294
                        {
 
2295
                                itNext = it;
 
2296
                                ++itNext;
 
2297
 
 
2298
                                (*it)->emit(a1, a2, a3, a4, a5);
 
2299
 
 
2300
                                it = itNext;
 
2301
                        }
 
2302
                }
 
2303
 
 
2304
                void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
 
2305
                        arg5_type a5)
 
2306
                {
 
2307
                        lock_block<mt_policy> lockblock(this);
 
2308
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2309
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2310
 
 
2311
                        while (it != itEnd)
 
2312
                        {
 
2313
                                itNext = it;
 
2314
                                ++itNext;
 
2315
 
 
2316
                                (*it)->emit(a1, a2, a3, a4, a5);
 
2317
 
 
2318
                                it = itNext;
 
2319
                        }
 
2320
                }
 
2321
        };
 
2322
 
 
2323
 
 
2324
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
2325
        class signal6 :
 
2326
                public _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>
 
2327
        {
 
2328
        public:
 
2329
                typedef _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> base_type;
 
2330
 
 
2331
                signal6()
 
2332
                {
 
2333
                }
 
2334
 
 
2335
                signal6(const signal6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>& s) :
 
2336
                        _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>(s)
 
2337
                {
 
2338
                }
 
2339
 
 
2340
                template <typename desttype>
 
2341
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
 
2342
                {
 
2343
                        lock_block<mt_policy> lockblock(this);
 
2344
                        _connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>* conn = new _connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>(pclass, pmemfun);
 
2345
                        base_type::m_connected_slots.push_back(conn);
 
2346
                        pclass->signal_connect(this);
 
2347
                }
 
2348
 
 
2349
                void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6)
 
2350
                {
 
2351
                        lock_block<mt_policy> lockblock(this);
 
2352
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2353
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2354
 
 
2355
                        while (it != itEnd)
 
2356
                        {
 
2357
                                itNext = it;
 
2358
                                ++itNext;
 
2359
 
 
2360
                                (*it)->emit(a1, a2, a3, a4, a5, a6);
 
2361
 
 
2362
                                it = itNext;
 
2363
                        }
 
2364
                }
 
2365
 
 
2366
                void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6)
 
2367
                {
 
2368
                        lock_block<mt_policy> lockblock(this);
 
2369
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2370
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2371
 
 
2372
                        while (it != itEnd)
 
2373
                        {
 
2374
                                itNext = it;
 
2375
                                ++itNext;
 
2376
 
 
2377
                                (*it)->emit(a1, a2, a3, a4, a5, a6);
 
2378
 
 
2379
                                it = itNext;
 
2380
                        }
 
2381
                }
 
2382
        };
 
2383
 
 
2384
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
2385
        class signal7 :
 
2386
                public _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
 
2387
        {
 
2388
        public:
 
2389
                typedef _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> base_type;
 
2390
 
 
2391
                signal7()
 
2392
                {
 
2393
                }
 
2394
 
 
2395
                signal7(const signal7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>& s) :
 
2396
                        _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(s)
 
2397
                {
 
2398
                }
 
2399
 
 
2400
                template <typename desttype>
 
2401
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type))
 
2402
                {
 
2403
                        lock_block<mt_policy> lockblock(this);
 
2404
                        _connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>* conn = new _connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(pclass, pmemfun);
 
2405
                        base_type::m_connected_slots.push_back(conn);
 
2406
                        pclass->signal_connect(this);
 
2407
                }
 
2408
 
 
2409
                void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6, arg7_type a7)
 
2410
                {
 
2411
                        lock_block<mt_policy> lockblock(this);
 
2412
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2413
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2414
 
 
2415
                        while (it != itEnd)
 
2416
                        {
 
2417
                                itNext = it;
 
2418
                                ++itNext;
 
2419
 
 
2420
                                (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
 
2421
 
 
2422
                                it = itNext;
 
2423
                        }
 
2424
                }
 
2425
 
 
2426
                void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6, arg7_type a7)
 
2427
                {
 
2428
                        lock_block<mt_policy> lockblock(this);
 
2429
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2430
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2431
 
 
2432
                        while (it != itEnd)
 
2433
                        {
 
2434
                                itNext = it;
 
2435
                                ++itNext;
 
2436
 
 
2437
                                (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
 
2438
 
 
2439
                                it = itNext;
 
2440
                        }
 
2441
                }
 
2442
        };
 
2443
 
 
2444
        template <typename arg1_type, typename arg2_type, typename arg3_type, typename arg4_type, typename arg5_type, typename arg6_type, typename arg7_type, typename arg8_type, typename mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
 
2445
        class signal8 :
 
2446
                public _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
 
2447
        {
 
2448
        public:
 
2449
                typedef _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> base_type;
 
2450
 
 
2451
                signal8()
 
2452
                {
 
2453
                }
 
2454
 
 
2455
                signal8(const signal8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s) :
 
2456
                        _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(s)
 
2457
                {
 
2458
                }
 
2459
 
 
2460
                template <typename desttype>
 
2461
                void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type))
 
2462
                {
 
2463
                        lock_block<mt_policy> lockblock(this);
 
2464
                        _connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn = new _connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(pclass, pmemfun);
 
2465
                        base_type::m_connected_slots.push_back(conn);
 
2466
                        pclass->signal_connect(this);
 
2467
                }
 
2468
 
 
2469
                void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
 
2470
                {
 
2471
                        lock_block<mt_policy> lockblock(this);
 
2472
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2473
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2474
 
 
2475
                        while (it != itEnd)
 
2476
                        {
 
2477
                                itNext = it;
 
2478
                                ++itNext;
 
2479
 
 
2480
                                (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
 
2481
 
 
2482
                                it = itNext;
 
2483
                        }
 
2484
                }
 
2485
 
 
2486
                void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
 
2487
                {
 
2488
                        lock_block<mt_policy> lockblock(this);
 
2489
                        typename base_type::connections_list::const_iterator itNext, it = base_type::m_connected_slots.begin();
 
2490
                        typename base_type::connections_list::const_iterator itEnd = base_type::m_connected_slots.end();
 
2491
 
 
2492
                        while (it != itEnd)
 
2493
                        {
 
2494
                                itNext = it;
 
2495
                                ++itNext;
 
2496
 
 
2497
                                (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
 
2498
 
 
2499
                                it = itNext;
 
2500
                        }
 
2501
                }
 
2502
        };
 
2503
 
 
2504
}
 
2505
 
 
2506
#endif