Line data Source code
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 : // Libjingle specific:
78 : // This file has been modified such that has_slots and signalx do not have to be
79 : // using the same threading requirements. E.g. it is possible to connect a
80 : // has_slots<single_threaded> and signal0<multi_threaded_local> or
81 : // has_slots<multi_threaded_local> and signal0<single_threaded>.
82 : // If has_slots is single threaded the user must ensure that it is not trying
83 : // to connect or disconnect to signalx concurrently or data race may occur.
84 : // If signalx is single threaded the user must ensure that disconnect, connect
85 : // or signal is not happening concurrently or data race may occur.
86 :
87 : #ifndef TALK_BASE_SIGSLOT_H__
88 : #define TALK_BASE_SIGSLOT_H__
89 :
90 : #include <list>
91 : #include <set>
92 : #include <stdlib.h>
93 :
94 : // On our copy of sigslot.h, we set single threading as default.
95 : #define SIGSLOT_DEFAULT_MT_POLICY single_threaded
96 :
97 : // For now, this avoids windows.h in bindings (PeerConnectionImpl.h) on WIN32
98 : // TODO: wrap win32 crit section and move to another file instead (Bug 932570)
99 : #define SIGSLOT_LEAVE_OUT_MULTITHREADING 1
100 :
101 : #if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS))
102 : # define _SIGSLOT_SINGLE_THREADED
103 : #elif defined(WIN32)
104 : # define _SIGSLOT_HAS_WIN32_THREADS
105 : # ifndef SIGSLOT_LEAVE_OUT_MULTITHREADING
106 : # if !defined(WIN32_LEAN_AND_MEAN)
107 : # define WIN32_LEAN_AND_MEAN
108 : # endif
109 : # include "windows.h"
110 : # endif
111 : #elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS)
112 : # define _SIGSLOT_HAS_POSIX_THREADS
113 : # include <pthread.h>
114 : #else
115 : # define _SIGSLOT_SINGLE_THREADED
116 : #endif
117 :
118 : #ifndef SIGSLOT_DEFAULT_MT_POLICY
119 : # ifdef _SIGSLOT_SINGLE_THREADED
120 : # define SIGSLOT_DEFAULT_MT_POLICY single_threaded
121 : # else
122 : # define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local
123 : # endif
124 : #endif
125 :
126 : // TODO: change this namespace to talk_base?
127 : namespace sigslot {
128 :
129 : class single_threaded
130 : {
131 : public:
132 0 : single_threaded()
133 0 : {
134 : ;
135 0 : }
136 :
137 0 : virtual ~single_threaded()
138 0 : {
139 : ;
140 0 : }
141 :
142 0 : virtual void lock()
143 : {
144 : ;
145 0 : }
146 :
147 0 : virtual void unlock()
148 : {
149 : ;
150 0 : }
151 : };
152 :
153 : #ifndef SIGSLOT_LEAVE_OUT_MULTITHREADING
154 : # ifdef _SIGSLOT_HAS_WIN32_THREADS
155 :
156 : // The multi threading policies only get compiled in if they are enabled.
157 : class multi_threaded_global
158 : {
159 : public:
160 : multi_threaded_global()
161 : {
162 : static bool isinitialised = false;
163 :
164 : if(!isinitialised)
165 : {
166 : InitializeCriticalSection(get_critsec());
167 : isinitialised = true;
168 : }
169 : }
170 :
171 : multi_threaded_global(const multi_threaded_global&)
172 : {
173 : ;
174 : }
175 :
176 : virtual ~multi_threaded_global()
177 : {
178 : ;
179 : }
180 :
181 : virtual void lock()
182 : {
183 : EnterCriticalSection(get_critsec());
184 : }
185 :
186 : virtual void unlock()
187 : {
188 : LeaveCriticalSection(get_critsec());
189 : }
190 :
191 : private:
192 : CRITICAL_SECTION* get_critsec()
193 : {
194 : static CRITICAL_SECTION g_critsec;
195 : return &g_critsec;
196 : }
197 : };
198 :
199 : class multi_threaded_local
200 : {
201 : public:
202 : multi_threaded_local()
203 : {
204 : InitializeCriticalSection(&m_critsec);
205 : }
206 :
207 : multi_threaded_local(const multi_threaded_local&)
208 : {
209 : InitializeCriticalSection(&m_critsec);
210 : }
211 :
212 : virtual ~multi_threaded_local()
213 : {
214 : DeleteCriticalSection(&m_critsec);
215 : }
216 :
217 : virtual void lock()
218 : {
219 : EnterCriticalSection(&m_critsec);
220 : }
221 :
222 : virtual void unlock()
223 : {
224 : LeaveCriticalSection(&m_critsec);
225 : }
226 :
227 : private:
228 : CRITICAL_SECTION m_critsec;
229 : };
230 : # endif // _SIGSLOT_HAS_WIN32_THREADS
231 :
232 : # ifdef _SIGSLOT_HAS_POSIX_THREADS
233 : // The multi threading policies only get compiled in if they are enabled.
234 : class multi_threaded_global
235 : {
236 : public:
237 : multi_threaded_global()
238 : {
239 : pthread_mutex_init(get_mutex(), NULL);
240 : }
241 :
242 : multi_threaded_global(const multi_threaded_global&)
243 : {
244 : ;
245 : }
246 :
247 : virtual ~multi_threaded_global()
248 : {
249 : ;
250 : }
251 :
252 : virtual void lock()
253 : {
254 : pthread_mutex_lock(get_mutex());
255 : }
256 :
257 : virtual void unlock()
258 : {
259 : pthread_mutex_unlock(get_mutex());
260 : }
261 :
262 : private:
263 : pthread_mutex_t* get_mutex()
264 : {
265 : static pthread_mutex_t g_mutex;
266 : return &g_mutex;
267 : }
268 : };
269 :
270 : class multi_threaded_local
271 : {
272 : public:
273 : multi_threaded_local()
274 : {
275 : pthread_mutex_init(&m_mutex, NULL);
276 : }
277 :
278 : multi_threaded_local(const multi_threaded_local&)
279 : {
280 : pthread_mutex_init(&m_mutex, NULL);
281 : }
282 :
283 : virtual ~multi_threaded_local()
284 : {
285 : pthread_mutex_destroy(&m_mutex);
286 : }
287 :
288 : virtual void lock()
289 : {
290 : pthread_mutex_lock(&m_mutex);
291 : }
292 :
293 : virtual void unlock()
294 : {
295 : pthread_mutex_unlock(&m_mutex);
296 : }
297 :
298 : private:
299 : pthread_mutex_t m_mutex;
300 : };
301 : # endif // _SIGSLOT_HAS_POSIX_THREADS
302 : #endif // SIGSLOT_LEAVE_OUT_MULTITHREADING
303 :
304 : template<class mt_policy>
305 : class lock_block
306 : {
307 : public:
308 : mt_policy *m_mutex;
309 :
310 0 : explicit lock_block(mt_policy *mtx)
311 0 : : m_mutex(mtx)
312 : {
313 0 : m_mutex->lock();
314 0 : }
315 :
316 0 : ~lock_block()
317 : {
318 0 : m_mutex->unlock();
319 0 : }
320 : };
321 :
322 : class has_slots_interface;
323 :
324 : template<class mt_policy>
325 : class _connection_base0
326 : {
327 : public:
328 : virtual ~_connection_base0() {}
329 : virtual has_slots_interface* getdest() const = 0;
330 : virtual void emit() = 0;
331 : virtual _connection_base0* clone() = 0;
332 : virtual _connection_base0* duplicate(has_slots_interface* pnewdest) = 0;
333 : };
334 :
335 : template<class arg1_type, class mt_policy>
336 0 : class _connection_base1
337 : {
338 : public:
339 0 : virtual ~_connection_base1() {}
340 : virtual has_slots_interface* getdest() const = 0;
341 : virtual void emit(arg1_type) = 0;
342 : virtual _connection_base1<arg1_type, mt_policy>* clone() = 0;
343 : virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
344 : };
345 :
346 : template<class arg1_type, class arg2_type, class mt_policy>
347 0 : class _connection_base2
348 : {
349 : public:
350 0 : virtual ~_connection_base2() {}
351 : virtual has_slots_interface* getdest() const = 0;
352 : virtual void emit(arg1_type, arg2_type) = 0;
353 : virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0;
354 : virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
355 : };
356 :
357 : template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
358 0 : class _connection_base3
359 : {
360 : public:
361 0 : virtual ~_connection_base3() {}
362 : virtual has_slots_interface* getdest() const = 0;
363 : virtual void emit(arg1_type, arg2_type, arg3_type) = 0;
364 : virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0;
365 : virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
366 : };
367 :
368 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
369 0 : class _connection_base4
370 : {
371 : public:
372 0 : virtual ~_connection_base4() {}
373 : virtual has_slots_interface* getdest() const = 0;
374 : virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0;
375 : virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0;
376 : virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
377 : };
378 :
379 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
380 : class arg5_type, class mt_policy>
381 0 : class _connection_base5
382 : {
383 : public:
384 0 : virtual ~_connection_base5() {}
385 : virtual has_slots_interface* getdest() const = 0;
386 : virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type,
387 : arg5_type) = 0;
388 : virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
389 : arg5_type, mt_policy>* clone() = 0;
390 : virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
391 : arg5_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
392 : };
393 :
394 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
395 : class arg5_type, class arg6_type, class mt_policy>
396 : class _connection_base6
397 : {
398 : public:
399 : virtual ~_connection_base6() {}
400 : virtual has_slots_interface* getdest() const = 0;
401 : virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
402 : arg6_type) = 0;
403 : virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
404 : arg5_type, arg6_type, mt_policy>* clone() = 0;
405 : virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
406 : arg5_type, arg6_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
407 : };
408 :
409 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
410 : class arg5_type, class arg6_type, class arg7_type, class mt_policy>
411 : class _connection_base7
412 : {
413 : public:
414 : virtual ~_connection_base7() {}
415 : virtual has_slots_interface* getdest() const = 0;
416 : virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
417 : arg6_type, arg7_type) = 0;
418 : virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
419 : arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0;
420 : virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
421 : arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
422 : };
423 :
424 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
425 : class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
426 : class _connection_base8
427 : {
428 : public:
429 : virtual ~_connection_base8() {}
430 : virtual has_slots_interface* getdest() const = 0;
431 : virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
432 : arg6_type, arg7_type, arg8_type) = 0;
433 : virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
434 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0;
435 : virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
436 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
437 : };
438 :
439 0 : class _signal_base_interface
440 : {
441 : public:
442 : virtual void slot_disconnect(has_slots_interface* pslot) = 0;
443 : virtual void slot_duplicate(const has_slots_interface* poldslot, has_slots_interface* pnewslot) = 0;
444 : };
445 :
446 : template<class mt_policy>
447 0 : class _signal_base : public _signal_base_interface, public mt_policy
448 : {
449 : };
450 :
451 : class has_slots_interface
452 : {
453 : public:
454 0 : has_slots_interface()
455 0 : {
456 : ;
457 0 : }
458 :
459 : virtual void signal_connect(_signal_base_interface* sender) = 0;
460 :
461 : virtual void signal_disconnect(_signal_base_interface* sender) = 0;
462 :
463 0 : virtual ~has_slots_interface()
464 0 : {
465 0 : }
466 :
467 : virtual void disconnect_all() = 0;
468 : };
469 :
470 : template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
471 : class has_slots : public has_slots_interface, public mt_policy
472 : {
473 : private:
474 : typedef std::set<_signal_base_interface*> sender_set;
475 : typedef sender_set::const_iterator const_iterator;
476 :
477 : public:
478 0 : has_slots()
479 0 : {
480 : ;
481 0 : }
482 :
483 : has_slots(const has_slots& hs)
484 : {
485 : lock_block<mt_policy> lock(this);
486 : const_iterator it = hs.m_senders.begin();
487 : const_iterator itEnd = hs.m_senders.end();
488 :
489 : while(it != itEnd)
490 : {
491 : (*it)->slot_duplicate(&hs, this);
492 : m_senders.insert(*it);
493 : ++it;
494 : }
495 : }
496 :
497 0 : void signal_connect(_signal_base_interface* sender)
498 : {
499 0 : lock_block<mt_policy> lock(this);
500 0 : m_senders.insert(sender);
501 0 : }
502 :
503 0 : void signal_disconnect(_signal_base_interface* sender)
504 : {
505 0 : lock_block<mt_policy> lock(this);
506 0 : m_senders.erase(sender);
507 0 : }
508 :
509 0 : virtual ~has_slots()
510 : {
511 0 : disconnect_all();
512 0 : }
513 :
514 0 : void disconnect_all()
515 : {
516 0 : lock_block<mt_policy> lock(this);
517 0 : const_iterator it = m_senders.begin();
518 0 : const_iterator itEnd = m_senders.end();
519 :
520 0 : while(it != itEnd)
521 : {
522 0 : (*it)->slot_disconnect(this);
523 0 : ++it;
524 : }
525 :
526 0 : m_senders.erase(m_senders.begin(), m_senders.end());
527 0 : }
528 :
529 : private:
530 : sender_set m_senders;
531 : };
532 :
533 : template<class mt_policy>
534 : class _signal_base0 : public _signal_base<mt_policy>
535 : {
536 : public:
537 : typedef std::list<_connection_base0<mt_policy> *> connections_list;
538 :
539 : _signal_base0()
540 : {
541 : ;
542 : }
543 :
544 : _signal_base0(const _signal_base0& s)
545 : : _signal_base<mt_policy>(s)
546 : {
547 : lock_block<mt_policy> lock(this);
548 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
549 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
550 :
551 : while(it != itEnd)
552 : {
553 : (*it)->getdest()->signal_connect(this);
554 : m_connected_slots.push_back((*it)->clone());
555 :
556 : ++it;
557 : }
558 : }
559 :
560 : ~_signal_base0()
561 : {
562 : disconnect_all();
563 : }
564 :
565 : bool is_empty()
566 : {
567 : lock_block<mt_policy> lock(this);
568 : typename connections_list::const_iterator it = m_connected_slots.begin();
569 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
570 : return it == itEnd;
571 : }
572 :
573 : void disconnect_all()
574 : {
575 : lock_block<mt_policy> lock(this);
576 : typename connections_list::const_iterator it = m_connected_slots.begin();
577 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
578 :
579 : while(it != itEnd)
580 : {
581 : (*it)->getdest()->signal_disconnect(this);
582 : delete *it;
583 :
584 : ++it;
585 : }
586 :
587 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
588 : }
589 :
590 : #ifdef _DEBUG
591 : bool connected(has_slots_interface* pclass)
592 : {
593 : lock_block<mt_policy> lock(this);
594 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
595 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
596 : while(it != itEnd)
597 : {
598 : itNext = it;
599 : ++itNext;
600 : if ((*it)->getdest() == pclass)
601 : return true;
602 : it = itNext;
603 : }
604 : return false;
605 : }
606 : #endif
607 :
608 : void disconnect(has_slots_interface* pclass)
609 : {
610 : lock_block<mt_policy> lock(this);
611 : typename connections_list::iterator it = m_connected_slots.begin();
612 : typename connections_list::iterator itEnd = m_connected_slots.end();
613 :
614 : while(it != itEnd)
615 : {
616 : if((*it)->getdest() == pclass)
617 : {
618 : delete *it;
619 : m_connected_slots.erase(it);
620 : pclass->signal_disconnect(this);
621 : return;
622 : }
623 :
624 : ++it;
625 : }
626 : }
627 :
628 : void slot_disconnect(has_slots_interface* pslot)
629 : {
630 : lock_block<mt_policy> lock(this);
631 : typename connections_list::iterator it = m_connected_slots.begin();
632 : typename connections_list::iterator itEnd = m_connected_slots.end();
633 :
634 : while(it != itEnd)
635 : {
636 : typename connections_list::iterator itNext = it;
637 : ++itNext;
638 :
639 : if((*it)->getdest() == pslot)
640 : {
641 : delete *it;
642 : m_connected_slots.erase(it);
643 : }
644 :
645 : it = itNext;
646 : }
647 : }
648 :
649 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
650 : {
651 : lock_block<mt_policy> lock(this);
652 : typename connections_list::iterator it = m_connected_slots.begin();
653 : typename connections_list::iterator itEnd = m_connected_slots.end();
654 :
655 : while(it != itEnd)
656 : {
657 : if((*it)->getdest() == oldtarget)
658 : {
659 : m_connected_slots.push_back((*it)->duplicate(newtarget));
660 : }
661 :
662 : ++it;
663 : }
664 : }
665 :
666 : protected:
667 : connections_list m_connected_slots;
668 : };
669 :
670 : template<class arg1_type, class mt_policy>
671 : class _signal_base1 : public _signal_base<mt_policy>
672 : {
673 : public:
674 : typedef std::list<_connection_base1<arg1_type, mt_policy> *> connections_list;
675 :
676 0 : _signal_base1()
677 0 : {
678 : ;
679 0 : }
680 :
681 : _signal_base1(const _signal_base1<arg1_type, mt_policy>& s)
682 : : _signal_base<mt_policy>(s)
683 : {
684 : lock_block<mt_policy> lock(this);
685 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
686 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
687 :
688 : while(it != itEnd)
689 : {
690 : (*it)->getdest()->signal_connect(this);
691 : m_connected_slots.push_back((*it)->clone());
692 :
693 : ++it;
694 : }
695 : }
696 :
697 0 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
698 : {
699 0 : lock_block<mt_policy> lock(this);
700 0 : typename connections_list::iterator it = m_connected_slots.begin();
701 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
702 :
703 0 : while(it != itEnd)
704 : {
705 0 : if((*it)->getdest() == oldtarget)
706 : {
707 0 : m_connected_slots.push_back((*it)->duplicate(newtarget));
708 : }
709 :
710 0 : ++it;
711 : }
712 0 : }
713 :
714 0 : ~_signal_base1()
715 : {
716 0 : disconnect_all();
717 0 : }
718 :
719 : bool is_empty()
720 : {
721 : lock_block<mt_policy> lock(this);
722 : typename connections_list::const_iterator it = m_connected_slots.begin();
723 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
724 : return it == itEnd;
725 : }
726 :
727 0 : void disconnect_all()
728 : {
729 0 : lock_block<mt_policy> lock(this);
730 0 : typename connections_list::const_iterator it = m_connected_slots.begin();
731 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
732 :
733 0 : while(it != itEnd)
734 : {
735 0 : (*it)->getdest()->signal_disconnect(this);
736 0 : delete *it;
737 :
738 0 : ++it;
739 : }
740 :
741 0 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
742 0 : }
743 :
744 : #ifdef _DEBUG
745 : bool connected(has_slots_interface* pclass)
746 : {
747 : lock_block<mt_policy> lock(this);
748 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
749 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
750 : while(it != itEnd)
751 : {
752 : itNext = it;
753 : ++itNext;
754 : if ((*it)->getdest() == pclass)
755 : return true;
756 : it = itNext;
757 : }
758 : return false;
759 : }
760 : #endif
761 :
762 0 : void disconnect(has_slots_interface* pclass)
763 : {
764 0 : lock_block<mt_policy> lock(this);
765 0 : typename connections_list::iterator it = m_connected_slots.begin();
766 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
767 :
768 0 : while(it != itEnd)
769 : {
770 0 : if((*it)->getdest() == pclass)
771 : {
772 0 : delete *it;
773 0 : m_connected_slots.erase(it);
774 0 : pclass->signal_disconnect(this);
775 0 : return;
776 : }
777 :
778 0 : ++it;
779 : }
780 : }
781 :
782 0 : void slot_disconnect(has_slots_interface* pslot)
783 : {
784 0 : lock_block<mt_policy> lock(this);
785 0 : typename connections_list::iterator it = m_connected_slots.begin();
786 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
787 :
788 0 : while(it != itEnd)
789 : {
790 0 : typename connections_list::iterator itNext = it;
791 0 : ++itNext;
792 :
793 0 : if((*it)->getdest() == pslot)
794 : {
795 0 : delete *it;
796 0 : m_connected_slots.erase(it);
797 : }
798 :
799 0 : it = itNext;
800 : }
801 0 : }
802 :
803 :
804 : protected:
805 : connections_list m_connected_slots;
806 : };
807 :
808 : template<class arg1_type, class arg2_type, class mt_policy>
809 : class _signal_base2 : public _signal_base<mt_policy>
810 : {
811 : public:
812 : typedef std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *>
813 : connections_list;
814 :
815 0 : _signal_base2()
816 0 : {
817 : ;
818 0 : }
819 :
820 : _signal_base2(const _signal_base2<arg1_type, arg2_type, mt_policy>& s)
821 : : _signal_base<mt_policy>(s)
822 : {
823 : lock_block<mt_policy> lock(this);
824 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
825 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
826 :
827 : while(it != itEnd)
828 : {
829 : (*it)->getdest()->signal_connect(this);
830 : m_connected_slots.push_back((*it)->clone());
831 :
832 : ++it;
833 : }
834 : }
835 :
836 0 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
837 : {
838 0 : lock_block<mt_policy> lock(this);
839 0 : typename connections_list::iterator it = m_connected_slots.begin();
840 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
841 :
842 0 : while(it != itEnd)
843 : {
844 0 : if((*it)->getdest() == oldtarget)
845 : {
846 0 : m_connected_slots.push_back((*it)->duplicate(newtarget));
847 : }
848 :
849 0 : ++it;
850 : }
851 0 : }
852 :
853 0 : ~_signal_base2()
854 : {
855 0 : disconnect_all();
856 0 : }
857 :
858 0 : bool is_empty()
859 : {
860 0 : lock_block<mt_policy> lock(this);
861 0 : typename connections_list::const_iterator it = m_connected_slots.begin();
862 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
863 0 : return it == itEnd;
864 : }
865 :
866 0 : void disconnect_all()
867 : {
868 0 : lock_block<mt_policy> lock(this);
869 0 : typename connections_list::const_iterator it = m_connected_slots.begin();
870 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
871 :
872 0 : while(it != itEnd)
873 : {
874 0 : (*it)->getdest()->signal_disconnect(this);
875 0 : delete *it;
876 :
877 0 : ++it;
878 : }
879 :
880 0 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
881 0 : }
882 :
883 : #ifdef _DEBUG
884 : bool connected(has_slots_interface* pclass)
885 : {
886 : lock_block<mt_policy> lock(this);
887 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
888 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
889 : while(it != itEnd)
890 : {
891 : itNext = it;
892 : ++itNext;
893 : if ((*it)->getdest() == pclass)
894 : return true;
895 : it = itNext;
896 : }
897 : return false;
898 : }
899 : #endif
900 :
901 0 : void disconnect(has_slots_interface* pclass)
902 : {
903 0 : lock_block<mt_policy> lock(this);
904 0 : typename connections_list::iterator it = m_connected_slots.begin();
905 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
906 :
907 0 : while(it != itEnd)
908 : {
909 0 : if((*it)->getdest() == pclass)
910 : {
911 0 : delete *it;
912 0 : m_connected_slots.erase(it);
913 0 : pclass->signal_disconnect(this);
914 0 : return;
915 : }
916 :
917 0 : ++it;
918 : }
919 : }
920 :
921 0 : void slot_disconnect(has_slots_interface* pslot)
922 : {
923 0 : lock_block<mt_policy> lock(this);
924 0 : typename connections_list::iterator it = m_connected_slots.begin();
925 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
926 :
927 0 : while(it != itEnd)
928 : {
929 0 : typename connections_list::iterator itNext = it;
930 0 : ++itNext;
931 :
932 0 : if((*it)->getdest() == pslot)
933 : {
934 0 : delete *it;
935 0 : m_connected_slots.erase(it);
936 : }
937 :
938 0 : it = itNext;
939 : }
940 0 : }
941 :
942 : protected:
943 : connections_list m_connected_slots;
944 : };
945 :
946 : template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
947 : class _signal_base3 : public _signal_base<mt_policy>
948 : {
949 : public:
950 : typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *>
951 : connections_list;
952 :
953 0 : _signal_base3()
954 0 : {
955 : ;
956 0 : }
957 :
958 : _signal_base3(const _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
959 : : _signal_base<mt_policy>(s)
960 : {
961 : lock_block<mt_policy> lock(this);
962 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
963 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
964 :
965 : while(it != itEnd)
966 : {
967 : (*it)->getdest()->signal_connect(this);
968 : m_connected_slots.push_back((*it)->clone());
969 :
970 : ++it;
971 : }
972 : }
973 :
974 0 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
975 : {
976 0 : lock_block<mt_policy> lock(this);
977 0 : typename connections_list::iterator it = m_connected_slots.begin();
978 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
979 :
980 0 : while(it != itEnd)
981 : {
982 0 : if((*it)->getdest() == oldtarget)
983 : {
984 0 : m_connected_slots.push_back((*it)->duplicate(newtarget));
985 : }
986 :
987 0 : ++it;
988 : }
989 0 : }
990 :
991 0 : ~_signal_base3()
992 : {
993 0 : disconnect_all();
994 0 : }
995 :
996 0 : bool is_empty()
997 : {
998 0 : lock_block<mt_policy> lock(this);
999 0 : typename connections_list::const_iterator it = m_connected_slots.begin();
1000 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1001 0 : return it == itEnd;
1002 : }
1003 :
1004 0 : void disconnect_all()
1005 : {
1006 0 : lock_block<mt_policy> lock(this);
1007 0 : typename connections_list::const_iterator it = m_connected_slots.begin();
1008 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1009 :
1010 0 : while(it != itEnd)
1011 : {
1012 0 : (*it)->getdest()->signal_disconnect(this);
1013 0 : delete *it;
1014 :
1015 0 : ++it;
1016 : }
1017 :
1018 0 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1019 0 : }
1020 :
1021 : #ifdef _DEBUG
1022 : bool connected(has_slots_interface* pclass)
1023 : {
1024 : lock_block<mt_policy> lock(this);
1025 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1026 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1027 : while(it != itEnd)
1028 : {
1029 : itNext = it;
1030 : ++itNext;
1031 : if ((*it)->getdest() == pclass)
1032 : return true;
1033 : it = itNext;
1034 : }
1035 : return false;
1036 : }
1037 : #endif
1038 :
1039 0 : void disconnect(has_slots_interface* pclass)
1040 : {
1041 0 : lock_block<mt_policy> lock(this);
1042 0 : typename connections_list::iterator it = m_connected_slots.begin();
1043 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
1044 :
1045 0 : while(it != itEnd)
1046 : {
1047 0 : if((*it)->getdest() == pclass)
1048 : {
1049 0 : delete *it;
1050 0 : m_connected_slots.erase(it);
1051 0 : pclass->signal_disconnect(this);
1052 0 : return;
1053 : }
1054 :
1055 0 : ++it;
1056 : }
1057 : }
1058 :
1059 0 : void slot_disconnect(has_slots_interface* pslot)
1060 : {
1061 0 : lock_block<mt_policy> lock(this);
1062 0 : typename connections_list::iterator it = m_connected_slots.begin();
1063 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
1064 :
1065 0 : while(it != itEnd)
1066 : {
1067 0 : typename connections_list::iterator itNext = it;
1068 0 : ++itNext;
1069 :
1070 0 : if((*it)->getdest() == pslot)
1071 : {
1072 0 : delete *it;
1073 0 : m_connected_slots.erase(it);
1074 : }
1075 :
1076 0 : it = itNext;
1077 : }
1078 0 : }
1079 :
1080 : protected:
1081 : connections_list m_connected_slots;
1082 : };
1083 :
1084 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
1085 : class _signal_base4 : public _signal_base<mt_policy>
1086 : {
1087 : public:
1088 : typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type,
1089 : arg4_type, mt_policy> *> connections_list;
1090 :
1091 0 : _signal_base4()
1092 0 : {
1093 : ;
1094 0 : }
1095 :
1096 : _signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
1097 : : _signal_base<mt_policy>(s)
1098 : {
1099 : lock_block<mt_policy> lock(this);
1100 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
1101 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1102 :
1103 : while(it != itEnd)
1104 : {
1105 : (*it)->getdest()->signal_connect(this);
1106 : m_connected_slots.push_back((*it)->clone());
1107 :
1108 : ++it;
1109 : }
1110 : }
1111 :
1112 0 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1113 : {
1114 0 : lock_block<mt_policy> lock(this);
1115 0 : typename connections_list::iterator it = m_connected_slots.begin();
1116 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
1117 :
1118 0 : while(it != itEnd)
1119 : {
1120 0 : if((*it)->getdest() == oldtarget)
1121 : {
1122 0 : m_connected_slots.push_back((*it)->duplicate(newtarget));
1123 : }
1124 :
1125 0 : ++it;
1126 : }
1127 0 : }
1128 :
1129 0 : ~_signal_base4()
1130 : {
1131 0 : disconnect_all();
1132 0 : }
1133 :
1134 : bool is_empty()
1135 : {
1136 : lock_block<mt_policy> lock(this);
1137 : typename connections_list::const_iterator it = m_connected_slots.begin();
1138 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1139 : return it == itEnd;
1140 : }
1141 :
1142 0 : void disconnect_all()
1143 : {
1144 0 : lock_block<mt_policy> lock(this);
1145 0 : typename connections_list::const_iterator it = m_connected_slots.begin();
1146 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1147 :
1148 0 : while(it != itEnd)
1149 : {
1150 0 : (*it)->getdest()->signal_disconnect(this);
1151 0 : delete *it;
1152 :
1153 0 : ++it;
1154 : }
1155 :
1156 0 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1157 0 : }
1158 :
1159 : #ifdef _DEBUG
1160 : bool connected(has_slots_interface* pclass)
1161 : {
1162 : lock_block<mt_policy> lock(this);
1163 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1164 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1165 : while(it != itEnd)
1166 : {
1167 : itNext = it;
1168 : ++itNext;
1169 : if ((*it)->getdest() == pclass)
1170 : return true;
1171 : it = itNext;
1172 : }
1173 : return false;
1174 : }
1175 : #endif
1176 :
1177 0 : void disconnect(has_slots_interface* pclass)
1178 : {
1179 0 : lock_block<mt_policy> lock(this);
1180 0 : typename connections_list::iterator it = m_connected_slots.begin();
1181 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
1182 :
1183 0 : while(it != itEnd)
1184 : {
1185 0 : if((*it)->getdest() == pclass)
1186 : {
1187 0 : delete *it;
1188 0 : m_connected_slots.erase(it);
1189 0 : pclass->signal_disconnect(this);
1190 0 : return;
1191 : }
1192 :
1193 0 : ++it;
1194 : }
1195 : }
1196 :
1197 0 : void slot_disconnect(has_slots_interface* pslot)
1198 : {
1199 0 : lock_block<mt_policy> lock(this);
1200 0 : typename connections_list::iterator it = m_connected_slots.begin();
1201 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
1202 :
1203 0 : while(it != itEnd)
1204 : {
1205 0 : typename connections_list::iterator itNext = it;
1206 0 : ++itNext;
1207 :
1208 0 : if((*it)->getdest() == pslot)
1209 : {
1210 0 : delete *it;
1211 0 : m_connected_slots.erase(it);
1212 : }
1213 :
1214 0 : it = itNext;
1215 : }
1216 0 : }
1217 :
1218 : protected:
1219 : connections_list m_connected_slots;
1220 : };
1221 :
1222 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1223 : class arg5_type, class mt_policy>
1224 : class _signal_base5 : public _signal_base<mt_policy>
1225 : {
1226 : public:
1227 : typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type,
1228 : arg4_type, arg5_type, mt_policy> *> connections_list;
1229 :
1230 0 : _signal_base5()
1231 0 : {
1232 : ;
1233 0 : }
1234 :
1235 : _signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
1236 : arg5_type, mt_policy>& s)
1237 : : _signal_base<mt_policy>(s)
1238 : {
1239 : lock_block<mt_policy> lock(this);
1240 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
1241 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1242 :
1243 : while(it != itEnd)
1244 : {
1245 : (*it)->getdest()->signal_connect(this);
1246 : m_connected_slots.push_back((*it)->clone());
1247 :
1248 : ++it;
1249 : }
1250 : }
1251 :
1252 0 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1253 : {
1254 0 : lock_block<mt_policy> lock(this);
1255 0 : typename connections_list::iterator it = m_connected_slots.begin();
1256 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
1257 :
1258 0 : while(it != itEnd)
1259 : {
1260 0 : if((*it)->getdest() == oldtarget)
1261 : {
1262 0 : m_connected_slots.push_back((*it)->duplicate(newtarget));
1263 : }
1264 :
1265 0 : ++it;
1266 : }
1267 0 : }
1268 :
1269 0 : ~_signal_base5()
1270 : {
1271 0 : disconnect_all();
1272 0 : }
1273 :
1274 : bool is_empty()
1275 : {
1276 : lock_block<mt_policy> lock(this);
1277 : typename connections_list::const_iterator it = m_connected_slots.begin();
1278 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1279 : return it == itEnd;
1280 : }
1281 :
1282 0 : void disconnect_all()
1283 : {
1284 0 : lock_block<mt_policy> lock(this);
1285 0 : typename connections_list::const_iterator it = m_connected_slots.begin();
1286 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1287 :
1288 0 : while(it != itEnd)
1289 : {
1290 0 : (*it)->getdest()->signal_disconnect(this);
1291 0 : delete *it;
1292 :
1293 0 : ++it;
1294 : }
1295 :
1296 0 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1297 0 : }
1298 :
1299 : #ifdef _DEBUG
1300 : bool connected(has_slots_interface* pclass)
1301 : {
1302 : lock_block<mt_policy> lock(this);
1303 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1304 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1305 : while(it != itEnd)
1306 : {
1307 : itNext = it;
1308 : ++itNext;
1309 : if ((*it)->getdest() == pclass)
1310 : return true;
1311 : it = itNext;
1312 : }
1313 : return false;
1314 : }
1315 : #endif
1316 :
1317 : void disconnect(has_slots_interface* pclass)
1318 : {
1319 : lock_block<mt_policy> lock(this);
1320 : typename connections_list::iterator it = m_connected_slots.begin();
1321 : typename connections_list::iterator itEnd = m_connected_slots.end();
1322 :
1323 : while(it != itEnd)
1324 : {
1325 : if((*it)->getdest() == pclass)
1326 : {
1327 : delete *it;
1328 : m_connected_slots.erase(it);
1329 : pclass->signal_disconnect(this);
1330 : return;
1331 : }
1332 :
1333 : ++it;
1334 : }
1335 : }
1336 :
1337 0 : void slot_disconnect(has_slots_interface* pslot)
1338 : {
1339 0 : lock_block<mt_policy> lock(this);
1340 0 : typename connections_list::iterator it = m_connected_slots.begin();
1341 0 : typename connections_list::iterator itEnd = m_connected_slots.end();
1342 :
1343 0 : while(it != itEnd)
1344 : {
1345 0 : typename connections_list::iterator itNext = it;
1346 0 : ++itNext;
1347 :
1348 0 : if((*it)->getdest() == pslot)
1349 : {
1350 0 : delete *it;
1351 0 : m_connected_slots.erase(it);
1352 : }
1353 :
1354 0 : it = itNext;
1355 : }
1356 0 : }
1357 :
1358 : protected:
1359 : connections_list m_connected_slots;
1360 : };
1361 :
1362 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1363 : class arg5_type, class arg6_type, class mt_policy>
1364 : class _signal_base6 : public _signal_base<mt_policy>
1365 : {
1366 : public:
1367 : typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type,
1368 : arg4_type, arg5_type, arg6_type, mt_policy> *> connections_list;
1369 :
1370 : _signal_base6()
1371 : {
1372 : ;
1373 : }
1374 :
1375 : _signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
1376 : arg5_type, arg6_type, mt_policy>& s)
1377 : : _signal_base<mt_policy>(s)
1378 : {
1379 : lock_block<mt_policy> lock(this);
1380 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
1381 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1382 :
1383 : while(it != itEnd)
1384 : {
1385 : (*it)->getdest()->signal_connect(this);
1386 : m_connected_slots.push_back((*it)->clone());
1387 :
1388 : ++it;
1389 : }
1390 : }
1391 :
1392 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1393 : {
1394 : lock_block<mt_policy> lock(this);
1395 : typename connections_list::iterator it = m_connected_slots.begin();
1396 : typename connections_list::iterator itEnd = m_connected_slots.end();
1397 :
1398 : while(it != itEnd)
1399 : {
1400 : if((*it)->getdest() == oldtarget)
1401 : {
1402 : m_connected_slots.push_back((*it)->duplicate(newtarget));
1403 : }
1404 :
1405 : ++it;
1406 : }
1407 : }
1408 :
1409 : ~_signal_base6()
1410 : {
1411 : disconnect_all();
1412 : }
1413 :
1414 : bool is_empty()
1415 : {
1416 : lock_block<mt_policy> lock(this);
1417 : typename connections_list::const_iterator it = m_connected_slots.begin();
1418 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1419 : return it == itEnd;
1420 : }
1421 :
1422 : void disconnect_all()
1423 : {
1424 : lock_block<mt_policy> lock(this);
1425 : typename connections_list::const_iterator it = m_connected_slots.begin();
1426 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1427 :
1428 : while(it != itEnd)
1429 : {
1430 : (*it)->getdest()->signal_disconnect(this);
1431 : delete *it;
1432 :
1433 : ++it;
1434 : }
1435 :
1436 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1437 : }
1438 :
1439 : #ifdef _DEBUG
1440 : bool connected(has_slots_interface* pclass)
1441 : {
1442 : lock_block<mt_policy> lock(this);
1443 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1444 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1445 : while(it != itEnd)
1446 : {
1447 : itNext = it;
1448 : ++itNext;
1449 : if ((*it)->getdest() == pclass)
1450 : return true;
1451 : it = itNext;
1452 : }
1453 : return false;
1454 : }
1455 : #endif
1456 :
1457 : void disconnect(has_slots_interface* pclass)
1458 : {
1459 : lock_block<mt_policy> lock(this);
1460 : typename connections_list::iterator it = m_connected_slots.begin();
1461 : typename connections_list::iterator itEnd = m_connected_slots.end();
1462 :
1463 : while(it != itEnd)
1464 : {
1465 : if((*it)->getdest() == pclass)
1466 : {
1467 : delete *it;
1468 : m_connected_slots.erase(it);
1469 : pclass->signal_disconnect(this);
1470 : return;
1471 : }
1472 :
1473 : ++it;
1474 : }
1475 : }
1476 :
1477 : void slot_disconnect(has_slots_interface* pslot)
1478 : {
1479 : lock_block<mt_policy> lock(this);
1480 : typename connections_list::iterator it = m_connected_slots.begin();
1481 : typename connections_list::iterator itEnd = m_connected_slots.end();
1482 :
1483 : while(it != itEnd)
1484 : {
1485 : typename connections_list::iterator itNext = it;
1486 : ++itNext;
1487 :
1488 : if((*it)->getdest() == pslot)
1489 : {
1490 : delete *it;
1491 : m_connected_slots.erase(it);
1492 : }
1493 :
1494 : it = itNext;
1495 : }
1496 : }
1497 :
1498 : protected:
1499 : connections_list m_connected_slots;
1500 : };
1501 :
1502 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1503 : class arg5_type, class arg6_type, class arg7_type, class mt_policy>
1504 : class _signal_base7 : public _signal_base<mt_policy>
1505 : {
1506 : public:
1507 : typedef std::list<_connection_base7<arg1_type, arg2_type, arg3_type,
1508 : arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> *> connections_list;
1509 :
1510 : _signal_base7()
1511 : {
1512 : ;
1513 : }
1514 :
1515 : _signal_base7(const _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
1516 : arg5_type, arg6_type, arg7_type, mt_policy>& s)
1517 : : _signal_base<mt_policy>(s)
1518 : {
1519 : lock_block<mt_policy> lock(this);
1520 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
1521 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1522 :
1523 : while(it != itEnd)
1524 : {
1525 : (*it)->getdest()->signal_connect(this);
1526 : m_connected_slots.push_back((*it)->clone());
1527 :
1528 : ++it;
1529 : }
1530 : }
1531 :
1532 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1533 : {
1534 : lock_block<mt_policy> lock(this);
1535 : typename connections_list::iterator it = m_connected_slots.begin();
1536 : typename connections_list::iterator itEnd = m_connected_slots.end();
1537 :
1538 : while(it != itEnd)
1539 : {
1540 : if((*it)->getdest() == oldtarget)
1541 : {
1542 : m_connected_slots.push_back((*it)->duplicate(newtarget));
1543 : }
1544 :
1545 : ++it;
1546 : }
1547 : }
1548 :
1549 : ~_signal_base7()
1550 : {
1551 : disconnect_all();
1552 : }
1553 :
1554 : bool is_empty()
1555 : {
1556 : lock_block<mt_policy> lock(this);
1557 : typename connections_list::const_iterator it = m_connected_slots.begin();
1558 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1559 : return it == itEnd;
1560 : }
1561 :
1562 : void disconnect_all()
1563 : {
1564 : lock_block<mt_policy> lock(this);
1565 : typename connections_list::const_iterator it = m_connected_slots.begin();
1566 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1567 :
1568 : while(it != itEnd)
1569 : {
1570 : (*it)->getdest()->signal_disconnect(this);
1571 : delete *it;
1572 :
1573 : ++it;
1574 : }
1575 :
1576 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1577 : }
1578 :
1579 : #ifdef _DEBUG
1580 : bool connected(has_slots_interface* pclass)
1581 : {
1582 : lock_block<mt_policy> lock(this);
1583 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1584 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1585 : while(it != itEnd)
1586 : {
1587 : itNext = it;
1588 : ++itNext;
1589 : if ((*it)->getdest() == pclass)
1590 : return true;
1591 : it = itNext;
1592 : }
1593 : return false;
1594 : }
1595 : #endif
1596 :
1597 : void disconnect(has_slots_interface* pclass)
1598 : {
1599 : lock_block<mt_policy> lock(this);
1600 : typename connections_list::iterator it = m_connected_slots.begin();
1601 : typename connections_list::iterator itEnd = m_connected_slots.end();
1602 :
1603 : while(it != itEnd)
1604 : {
1605 : if((*it)->getdest() == pclass)
1606 : {
1607 : delete *it;
1608 : m_connected_slots.erase(it);
1609 : pclass->signal_disconnect(this);
1610 : return;
1611 : }
1612 :
1613 : ++it;
1614 : }
1615 : }
1616 :
1617 : void slot_disconnect(has_slots_interface* pslot)
1618 : {
1619 : lock_block<mt_policy> lock(this);
1620 : typename connections_list::iterator it = m_connected_slots.begin();
1621 : typename connections_list::iterator itEnd = m_connected_slots.end();
1622 :
1623 : while(it != itEnd)
1624 : {
1625 : typename connections_list::iterator itNext = it;
1626 : ++itNext;
1627 :
1628 : if((*it)->getdest() == pslot)
1629 : {
1630 : delete *it;
1631 : m_connected_slots.erase(it);
1632 : }
1633 :
1634 : it = itNext;
1635 : }
1636 : }
1637 :
1638 : protected:
1639 : connections_list m_connected_slots;
1640 : };
1641 :
1642 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1643 : class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
1644 : class _signal_base8 : public _signal_base<mt_policy>
1645 : {
1646 : public:
1647 : typedef std::list<_connection_base8<arg1_type, arg2_type, arg3_type,
1648 : arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> *>
1649 : connections_list;
1650 :
1651 : _signal_base8()
1652 : {
1653 : ;
1654 : }
1655 :
1656 : _signal_base8(const _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
1657 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
1658 : : _signal_base<mt_policy>(s)
1659 : {
1660 : lock_block<mt_policy> lock(this);
1661 : typename connections_list::const_iterator it = s.m_connected_slots.begin();
1662 : typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1663 :
1664 : while(it != itEnd)
1665 : {
1666 : (*it)->getdest()->signal_connect(this);
1667 : m_connected_slots.push_back((*it)->clone());
1668 :
1669 : ++it;
1670 : }
1671 : }
1672 :
1673 : void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1674 : {
1675 : lock_block<mt_policy> lock(this);
1676 : typename connections_list::iterator it = m_connected_slots.begin();
1677 : typename connections_list::iterator itEnd = m_connected_slots.end();
1678 :
1679 : while(it != itEnd)
1680 : {
1681 : if((*it)->getdest() == oldtarget)
1682 : {
1683 : m_connected_slots.push_back((*it)->duplicate(newtarget));
1684 : }
1685 :
1686 : ++it;
1687 : }
1688 : }
1689 :
1690 : ~_signal_base8()
1691 : {
1692 : disconnect_all();
1693 : }
1694 :
1695 : bool is_empty()
1696 : {
1697 : lock_block<mt_policy> lock(this);
1698 : typename connections_list::const_iterator it = m_connected_slots.begin();
1699 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1700 : return it == itEnd;
1701 : }
1702 :
1703 : void disconnect_all()
1704 : {
1705 : lock_block<mt_policy> lock(this);
1706 : typename connections_list::const_iterator it = m_connected_slots.begin();
1707 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1708 :
1709 : while(it != itEnd)
1710 : {
1711 : (*it)->getdest()->signal_disconnect(this);
1712 : delete *it;
1713 :
1714 : ++it;
1715 : }
1716 :
1717 : m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1718 : }
1719 :
1720 : #ifdef _DEBUG
1721 : bool connected(has_slots_interface* pclass)
1722 : {
1723 : lock_block<mt_policy> lock(this);
1724 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1725 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
1726 : while(it != itEnd)
1727 : {
1728 : itNext = it;
1729 : ++itNext;
1730 : if ((*it)->getdest() == pclass)
1731 : return true;
1732 : it = itNext;
1733 : }
1734 : return false;
1735 : }
1736 : #endif
1737 :
1738 : void disconnect(has_slots_interface* pclass)
1739 : {
1740 : lock_block<mt_policy> lock(this);
1741 : typename connections_list::iterator it = m_connected_slots.begin();
1742 : typename connections_list::iterator itEnd = m_connected_slots.end();
1743 :
1744 : while(it != itEnd)
1745 : {
1746 : if((*it)->getdest() == pclass)
1747 : {
1748 : delete *it;
1749 : m_connected_slots.erase(it);
1750 : pclass->signal_disconnect(this);
1751 : return;
1752 : }
1753 :
1754 : ++it;
1755 : }
1756 : }
1757 :
1758 : void slot_disconnect(has_slots_interface* pslot)
1759 : {
1760 : lock_block<mt_policy> lock(this);
1761 : typename connections_list::iterator it = m_connected_slots.begin();
1762 : typename connections_list::iterator itEnd = m_connected_slots.end();
1763 :
1764 : while(it != itEnd)
1765 : {
1766 : typename connections_list::iterator itNext = it;
1767 : ++itNext;
1768 :
1769 : if((*it)->getdest() == pslot)
1770 : {
1771 : delete *it;
1772 : m_connected_slots.erase(it);
1773 : }
1774 :
1775 : it = itNext;
1776 : }
1777 : }
1778 :
1779 : protected:
1780 : connections_list m_connected_slots;
1781 : };
1782 :
1783 :
1784 : template<class dest_type, class mt_policy>
1785 : class _connection0 : public _connection_base0<mt_policy>
1786 : {
1787 : public:
1788 : _connection0()
1789 : {
1790 : m_pobject = NULL;
1791 : m_pmemfun = NULL;
1792 : }
1793 :
1794 : _connection0(dest_type* pobject, void (dest_type::*pmemfun)())
1795 : {
1796 : m_pobject = pobject;
1797 : m_pmemfun = pmemfun;
1798 : }
1799 :
1800 : virtual ~_connection0()
1801 : {
1802 : }
1803 :
1804 : virtual _connection_base0<mt_policy>* clone()
1805 : {
1806 : return new _connection0<dest_type, mt_policy>(*this);
1807 : }
1808 :
1809 : virtual _connection_base0<mt_policy>* duplicate(has_slots_interface* pnewdest)
1810 : {
1811 : return new _connection0<dest_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1812 : }
1813 :
1814 : virtual void emit()
1815 : {
1816 : (m_pobject->*m_pmemfun)();
1817 : }
1818 :
1819 : virtual has_slots_interface* getdest() const
1820 : {
1821 : return m_pobject;
1822 : }
1823 :
1824 : private:
1825 : dest_type* m_pobject;
1826 : void (dest_type::* m_pmemfun)();
1827 : };
1828 :
1829 : template<class dest_type, class arg1_type, class mt_policy>
1830 0 : class _connection1 : public _connection_base1<arg1_type, mt_policy>
1831 : {
1832 : public:
1833 : _connection1()
1834 : {
1835 : m_pobject = NULL;
1836 : m_pmemfun = NULL;
1837 : }
1838 :
1839 0 : _connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type))
1840 0 : {
1841 0 : m_pobject = pobject;
1842 0 : m_pmemfun = pmemfun;
1843 0 : }
1844 :
1845 0 : virtual ~_connection1()
1846 : {
1847 0 : }
1848 :
1849 0 : virtual _connection_base1<arg1_type, mt_policy>* clone()
1850 : {
1851 0 : return new _connection1<dest_type, arg1_type, mt_policy>(*this);
1852 : }
1853 :
1854 0 : virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1855 : {
1856 0 : return new _connection1<dest_type, arg1_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1857 : }
1858 :
1859 0 : virtual void emit(arg1_type a1)
1860 : {
1861 0 : (m_pobject->*m_pmemfun)(a1);
1862 0 : }
1863 :
1864 0 : virtual has_slots_interface* getdest() const
1865 : {
1866 0 : return m_pobject;
1867 : }
1868 :
1869 : private:
1870 : dest_type* m_pobject;
1871 : void (dest_type::* m_pmemfun)(arg1_type);
1872 : };
1873 :
1874 : template<class dest_type, class arg1_type, class arg2_type, class mt_policy>
1875 0 : class _connection2 : public _connection_base2<arg1_type, arg2_type, mt_policy>
1876 : {
1877 : public:
1878 : _connection2()
1879 : {
1880 : m_pobject = NULL;
1881 : m_pmemfun = NULL;
1882 : }
1883 :
1884 0 : _connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1885 : arg2_type))
1886 0 : {
1887 0 : m_pobject = pobject;
1888 0 : m_pmemfun = pmemfun;
1889 0 : }
1890 :
1891 0 : virtual ~_connection2()
1892 : {
1893 0 : }
1894 :
1895 0 : virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone()
1896 : {
1897 0 : return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>(*this);
1898 : }
1899 :
1900 0 : virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1901 : {
1902 0 : return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1903 : }
1904 :
1905 0 : virtual void emit(arg1_type a1, arg2_type a2)
1906 : {
1907 0 : (m_pobject->*m_pmemfun)(a1, a2);
1908 0 : }
1909 :
1910 0 : virtual has_slots_interface* getdest() const
1911 : {
1912 0 : return m_pobject;
1913 : }
1914 :
1915 : private:
1916 : dest_type* m_pobject;
1917 : void (dest_type::* m_pmemfun)(arg1_type, arg2_type);
1918 : };
1919 :
1920 : template<class dest_type, class arg1_type, class arg2_type, class arg3_type, class mt_policy>
1921 0 : class _connection3 : public _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>
1922 : {
1923 : public:
1924 : _connection3()
1925 : {
1926 : m_pobject = NULL;
1927 : m_pmemfun = NULL;
1928 : }
1929 :
1930 0 : _connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1931 : arg2_type, arg3_type))
1932 0 : {
1933 0 : m_pobject = pobject;
1934 0 : m_pmemfun = pmemfun;
1935 0 : }
1936 :
1937 0 : virtual ~_connection3()
1938 : {
1939 0 : }
1940 :
1941 0 : virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone()
1942 : {
1943 0 : return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>(*this);
1944 : }
1945 :
1946 0 : virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1947 : {
1948 0 : return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1949 : }
1950 :
1951 0 : virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3)
1952 : {
1953 0 : (m_pobject->*m_pmemfun)(a1, a2, a3);
1954 0 : }
1955 :
1956 0 : virtual has_slots_interface* getdest() const
1957 : {
1958 0 : return m_pobject;
1959 : }
1960 :
1961 : private:
1962 : dest_type* m_pobject;
1963 : void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type);
1964 : };
1965 :
1966 : template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1967 : class arg4_type, class mt_policy>
1968 0 : class _connection4 : public _connection_base4<arg1_type, arg2_type,
1969 : arg3_type, arg4_type, mt_policy>
1970 : {
1971 : public:
1972 : _connection4()
1973 : {
1974 : m_pobject = NULL;
1975 : m_pmemfun = NULL;
1976 : }
1977 :
1978 0 : _connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1979 : arg2_type, arg3_type, arg4_type))
1980 0 : {
1981 0 : m_pobject = pobject;
1982 0 : m_pmemfun = pmemfun;
1983 0 : }
1984 :
1985 0 : virtual ~_connection4()
1986 : {
1987 0 : }
1988 :
1989 0 : virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone()
1990 : {
1991 0 : return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(*this);
1992 : }
1993 :
1994 0 : virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1995 : {
1996 0 : return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1997 : }
1998 :
1999 0 : virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3,
2000 : arg4_type a4)
2001 : {
2002 0 : (m_pobject->*m_pmemfun)(a1, a2, a3, a4);
2003 0 : }
2004 :
2005 0 : virtual has_slots_interface* getdest() const
2006 : {
2007 0 : return m_pobject;
2008 : }
2009 :
2010 : private:
2011 : dest_type* m_pobject;
2012 : void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type,
2013 : arg4_type);
2014 : };
2015 :
2016 : template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2017 : class arg4_type, class arg5_type, class mt_policy>
2018 0 : class _connection5 : public _connection_base5<arg1_type, arg2_type,
2019 : arg3_type, arg4_type, arg5_type, mt_policy>
2020 : {
2021 : public:
2022 : _connection5()
2023 : {
2024 : m_pobject = NULL;
2025 : m_pmemfun = NULL;
2026 : }
2027 :
2028 0 : _connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2029 : arg2_type, arg3_type, arg4_type, arg5_type))
2030 0 : {
2031 0 : m_pobject = pobject;
2032 0 : m_pmemfun = pmemfun;
2033 0 : }
2034 :
2035 0 : virtual ~_connection5()
2036 : {
2037 0 : }
2038 :
2039 : virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2040 0 : arg5_type, mt_policy>* clone()
2041 : {
2042 0 : return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2043 0 : arg5_type, mt_policy>(*this);
2044 : }
2045 :
2046 : virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2047 0 : arg5_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2048 : {
2049 0 : return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2050 0 : arg5_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2051 : }
2052 :
2053 0 : virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2054 : arg5_type a5)
2055 : {
2056 0 : (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5);
2057 0 : }
2058 :
2059 0 : virtual has_slots_interface* getdest() const
2060 : {
2061 0 : return m_pobject;
2062 : }
2063 :
2064 : private:
2065 : dest_type* m_pobject;
2066 : void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2067 : arg5_type);
2068 : };
2069 :
2070 : template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2071 : class arg4_type, class arg5_type, class arg6_type, class mt_policy>
2072 : class _connection6 : public _connection_base6<arg1_type, arg2_type,
2073 : arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>
2074 : {
2075 : public:
2076 : _connection6()
2077 : {
2078 : m_pobject = NULL;
2079 : m_pmemfun = NULL;
2080 : }
2081 :
2082 : _connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2083 : arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
2084 : {
2085 : m_pobject = pobject;
2086 : m_pmemfun = pmemfun;
2087 : }
2088 :
2089 : virtual ~_connection6()
2090 : {
2091 : }
2092 :
2093 : virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2094 : arg5_type, arg6_type, mt_policy>* clone()
2095 : {
2096 : return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2097 : arg5_type, arg6_type, mt_policy>(*this);
2098 : }
2099 :
2100 : virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2101 : arg5_type, arg6_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2102 : {
2103 : return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2104 : arg5_type, arg6_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2105 : }
2106 :
2107 : virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2108 : arg5_type a5, arg6_type a6)
2109 : {
2110 : (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6);
2111 : }
2112 :
2113 : virtual has_slots_interface* getdest() const
2114 : {
2115 : return m_pobject;
2116 : }
2117 :
2118 : private:
2119 : dest_type* m_pobject;
2120 : void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2121 : arg5_type, arg6_type);
2122 : };
2123 :
2124 : template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2125 : class arg4_type, class arg5_type, class arg6_type, class arg7_type, class mt_policy>
2126 : class _connection7 : public _connection_base7<arg1_type, arg2_type,
2127 : arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
2128 : {
2129 : public:
2130 : _connection7()
2131 : {
2132 : m_pobject = NULL;
2133 : m_pmemfun = NULL;
2134 : }
2135 :
2136 : _connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2137 : arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type))
2138 : {
2139 : m_pobject = pobject;
2140 : m_pmemfun = pmemfun;
2141 : }
2142 :
2143 : virtual ~_connection7()
2144 : {
2145 : }
2146 :
2147 : virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2148 : arg5_type, arg6_type, arg7_type, mt_policy>* clone()
2149 : {
2150 : return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2151 : arg5_type, arg6_type, arg7_type, mt_policy>(*this);
2152 : }
2153 :
2154 : virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2155 : arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2156 : {
2157 : return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2158 : arg5_type, arg6_type, arg7_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2159 : }
2160 :
2161 : virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2162 : arg5_type a5, arg6_type a6, arg7_type a7)
2163 : {
2164 : (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7);
2165 : }
2166 :
2167 : virtual has_slots_interface* getdest() const
2168 : {
2169 : return m_pobject;
2170 : }
2171 :
2172 : private:
2173 : dest_type* m_pobject;
2174 : void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2175 : arg5_type, arg6_type, arg7_type);
2176 : };
2177 :
2178 : template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2179 : class arg4_type, class arg5_type, class arg6_type, class arg7_type,
2180 : class arg8_type, class mt_policy>
2181 : class _connection8 : public _connection_base8<arg1_type, arg2_type,
2182 : arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
2183 : {
2184 : public:
2185 : _connection8()
2186 : {
2187 : m_pobject = NULL;
2188 : m_pmemfun = NULL;
2189 : }
2190 :
2191 : _connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2192 : arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2193 : arg7_type, arg8_type))
2194 : {
2195 : m_pobject = pobject;
2196 : m_pmemfun = pmemfun;
2197 : }
2198 :
2199 : virtual ~_connection8()
2200 : {
2201 : }
2202 :
2203 : virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2204 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone()
2205 : {
2206 : return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2207 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(*this);
2208 : }
2209 :
2210 : virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2211 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2212 : {
2213 : return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2214 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2215 : }
2216 :
2217 : virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2218 : arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2219 : {
2220 : (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8);
2221 : }
2222 :
2223 : virtual has_slots_interface* getdest() const
2224 : {
2225 : return m_pobject;
2226 : }
2227 :
2228 : private:
2229 : dest_type* m_pobject;
2230 : void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2231 : arg5_type, arg6_type, arg7_type, arg8_type);
2232 : };
2233 :
2234 : template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2235 : class signal0 : public _signal_base0<mt_policy>
2236 : {
2237 : public:
2238 : typedef _signal_base0<mt_policy> base;
2239 : typedef typename base::connections_list connections_list;
2240 : using base::m_connected_slots;
2241 :
2242 : signal0()
2243 : {
2244 : ;
2245 : }
2246 :
2247 : signal0(const signal0<mt_policy>& s)
2248 : : _signal_base0<mt_policy>(s)
2249 : {
2250 : ;
2251 : }
2252 :
2253 : template<class desttype>
2254 : void connect(desttype* pclass, void (desttype::*pmemfun)())
2255 : {
2256 : lock_block<mt_policy> lock(this);
2257 : _connection0<desttype, mt_policy>* conn =
2258 : new _connection0<desttype, mt_policy>(pclass, pmemfun);
2259 : m_connected_slots.push_back(conn);
2260 : pclass->signal_connect(this);
2261 : }
2262 :
2263 : void emit()
2264 : {
2265 : lock_block<mt_policy> lock(this);
2266 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2267 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2268 :
2269 : while(it != itEnd)
2270 : {
2271 : itNext = it;
2272 : ++itNext;
2273 :
2274 : (*it)->emit();
2275 :
2276 : it = itNext;
2277 : }
2278 : }
2279 :
2280 : void operator()()
2281 : {
2282 : lock_block<mt_policy> lock(this);
2283 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2284 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2285 :
2286 : while(it != itEnd)
2287 : {
2288 : itNext = it;
2289 : ++itNext;
2290 :
2291 : (*it)->emit();
2292 :
2293 : it = itNext;
2294 : }
2295 : }
2296 : };
2297 :
2298 : template<class arg1_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2299 0 : class signal1 : public _signal_base1<arg1_type, mt_policy>
2300 : {
2301 : public:
2302 : typedef _signal_base1<arg1_type, mt_policy> base;
2303 : typedef typename base::connections_list connections_list;
2304 : using base::m_connected_slots;
2305 :
2306 0 : signal1()
2307 0 : {
2308 : ;
2309 0 : }
2310 :
2311 : signal1(const signal1<arg1_type, mt_policy>& s)
2312 : : _signal_base1<arg1_type, mt_policy>(s)
2313 : {
2314 : ;
2315 : }
2316 :
2317 : template<class desttype>
2318 0 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type))
2319 : {
2320 0 : lock_block<mt_policy> lock(this);
2321 : _connection1<desttype, arg1_type, mt_policy>* conn =
2322 0 : new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun);
2323 0 : m_connected_slots.push_back(conn);
2324 0 : pclass->signal_connect(this);
2325 0 : }
2326 :
2327 : void emit(arg1_type a1)
2328 : {
2329 : lock_block<mt_policy> lock(this);
2330 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2331 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2332 :
2333 : while(it != itEnd)
2334 : {
2335 : itNext = it;
2336 : ++itNext;
2337 :
2338 : (*it)->emit(a1);
2339 :
2340 : it = itNext;
2341 : }
2342 : }
2343 :
2344 0 : void operator()(arg1_type a1)
2345 : {
2346 0 : lock_block<mt_policy> lock(this);
2347 0 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2348 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2349 :
2350 0 : while(it != itEnd)
2351 : {
2352 0 : itNext = it;
2353 0 : ++itNext;
2354 :
2355 0 : (*it)->emit(a1);
2356 :
2357 0 : it = itNext;
2358 : }
2359 0 : }
2360 : };
2361 :
2362 : template<class arg1_type, class arg2_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2363 0 : class signal2 : public _signal_base2<arg1_type, arg2_type, mt_policy>
2364 : {
2365 : public:
2366 : typedef _signal_base2<arg1_type, arg2_type, mt_policy> base;
2367 : typedef typename base::connections_list connections_list;
2368 : using base::m_connected_slots;
2369 :
2370 0 : signal2()
2371 0 : {
2372 : ;
2373 0 : }
2374 :
2375 : signal2(const signal2<arg1_type, arg2_type, mt_policy>& s)
2376 : : _signal_base2<arg1_type, arg2_type, mt_policy>(s)
2377 : {
2378 : ;
2379 : }
2380 :
2381 : template<class desttype>
2382 0 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2383 : arg2_type))
2384 : {
2385 0 : lock_block<mt_policy> lock(this);
2386 0 : _connection2<desttype, arg1_type, arg2_type, mt_policy>* conn = new
2387 0 : _connection2<desttype, arg1_type, arg2_type, mt_policy>(pclass, pmemfun);
2388 0 : m_connected_slots.push_back(conn);
2389 0 : pclass->signal_connect(this);
2390 0 : }
2391 :
2392 : void emit(arg1_type a1, arg2_type a2)
2393 : {
2394 : lock_block<mt_policy> lock(this);
2395 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2396 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2397 :
2398 : while(it != itEnd)
2399 : {
2400 : itNext = it;
2401 : ++itNext;
2402 :
2403 : (*it)->emit(a1, a2);
2404 :
2405 : it = itNext;
2406 : }
2407 : }
2408 :
2409 0 : void operator()(arg1_type a1, arg2_type a2)
2410 : {
2411 0 : lock_block<mt_policy> lock(this);
2412 0 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2413 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2414 :
2415 0 : while(it != itEnd)
2416 : {
2417 0 : itNext = it;
2418 0 : ++itNext;
2419 :
2420 0 : (*it)->emit(a1, a2);
2421 :
2422 0 : it = itNext;
2423 : }
2424 0 : }
2425 : };
2426 :
2427 : template<class arg1_type, class arg2_type, class arg3_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2428 0 : class signal3 : public _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>
2429 : {
2430 : public:
2431 : typedef _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> base;
2432 : typedef typename base::connections_list connections_list;
2433 : using base::m_connected_slots;
2434 :
2435 0 : signal3()
2436 0 : {
2437 : ;
2438 0 : }
2439 :
2440 : signal3(const signal3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
2441 : : _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>(s)
2442 : {
2443 : ;
2444 : }
2445 :
2446 : template<class desttype>
2447 0 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2448 : arg2_type, arg3_type))
2449 : {
2450 0 : lock_block<mt_policy> lock(this);
2451 : _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn =
2452 0 : new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass,
2453 0 : pmemfun);
2454 0 : m_connected_slots.push_back(conn);
2455 0 : pclass->signal_connect(this);
2456 0 : }
2457 :
2458 : void emit(arg1_type a1, arg2_type a2, arg3_type a3)
2459 : {
2460 : lock_block<mt_policy> lock(this);
2461 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2462 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2463 :
2464 : while(it != itEnd)
2465 : {
2466 : itNext = it;
2467 : ++itNext;
2468 :
2469 : (*it)->emit(a1, a2, a3);
2470 :
2471 : it = itNext;
2472 : }
2473 : }
2474 :
2475 0 : void operator()(arg1_type a1, arg2_type a2, arg3_type a3)
2476 : {
2477 0 : lock_block<mt_policy> lock(this);
2478 0 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2479 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2480 :
2481 0 : while(it != itEnd)
2482 : {
2483 0 : itNext = it;
2484 0 : ++itNext;
2485 :
2486 0 : (*it)->emit(a1, a2, a3);
2487 :
2488 0 : it = itNext;
2489 : }
2490 0 : }
2491 : };
2492 :
2493 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2494 0 : class signal4 : public _signal_base4<arg1_type, arg2_type, arg3_type,
2495 : arg4_type, mt_policy>
2496 : {
2497 : public:
2498 : typedef _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> base;
2499 : typedef typename base::connections_list connections_list;
2500 : using base::m_connected_slots;
2501 :
2502 0 : signal4()
2503 0 : {
2504 : ;
2505 0 : }
2506 :
2507 : signal4(const signal4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
2508 : : _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(s)
2509 : {
2510 : ;
2511 : }
2512 :
2513 : template<class desttype>
2514 0 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2515 : arg2_type, arg3_type, arg4_type))
2516 : {
2517 0 : lock_block<mt_policy> lock(this);
2518 : _connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>*
2519 0 : conn = new _connection4<desttype, arg1_type, arg2_type, arg3_type,
2520 0 : arg4_type, mt_policy>(pclass, pmemfun);
2521 0 : m_connected_slots.push_back(conn);
2522 0 : pclass->signal_connect(this);
2523 0 : }
2524 :
2525 : void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2526 : {
2527 : lock_block<mt_policy> lock(this);
2528 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2529 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2530 :
2531 : while(it != itEnd)
2532 : {
2533 : itNext = it;
2534 : ++itNext;
2535 :
2536 : (*it)->emit(a1, a2, a3, a4);
2537 :
2538 : it = itNext;
2539 : }
2540 : }
2541 :
2542 0 : void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2543 : {
2544 0 : lock_block<mt_policy> lock(this);
2545 0 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2546 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2547 :
2548 0 : while(it != itEnd)
2549 : {
2550 0 : itNext = it;
2551 0 : ++itNext;
2552 :
2553 0 : (*it)->emit(a1, a2, a3, a4);
2554 :
2555 0 : it = itNext;
2556 : }
2557 0 : }
2558 : };
2559 :
2560 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2561 : class arg5_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2562 0 : class signal5 : public _signal_base5<arg1_type, arg2_type, arg3_type,
2563 : arg4_type, arg5_type, mt_policy>
2564 : {
2565 : public:
2566 : typedef _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> base;
2567 : typedef typename base::connections_list connections_list;
2568 : using base::m_connected_slots;
2569 :
2570 0 : signal5()
2571 0 : {
2572 : ;
2573 0 : }
2574 :
2575 : signal5(const signal5<arg1_type, arg2_type, arg3_type, arg4_type,
2576 : arg5_type, mt_policy>& s)
2577 : : _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2578 : arg5_type, mt_policy>(s)
2579 : {
2580 : ;
2581 : }
2582 :
2583 : template<class desttype>
2584 0 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2585 : arg2_type, arg3_type, arg4_type, arg5_type))
2586 : {
2587 0 : lock_block<mt_policy> lock(this);
2588 : _connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2589 0 : arg5_type, mt_policy>* conn = new _connection5<desttype, arg1_type, arg2_type,
2590 0 : arg3_type, arg4_type, arg5_type, mt_policy>(pclass, pmemfun);
2591 0 : m_connected_slots.push_back(conn);
2592 0 : pclass->signal_connect(this);
2593 0 : }
2594 :
2595 : void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2596 : arg5_type a5)
2597 : {
2598 : lock_block<mt_policy> lock(this);
2599 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2600 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2601 :
2602 : while(it != itEnd)
2603 : {
2604 : itNext = it;
2605 : ++itNext;
2606 :
2607 : (*it)->emit(a1, a2, a3, a4, a5);
2608 :
2609 : it = itNext;
2610 : }
2611 : }
2612 :
2613 0 : void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2614 : arg5_type a5)
2615 : {
2616 0 : lock_block<mt_policy> lock(this);
2617 0 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2618 0 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2619 :
2620 0 : while(it != itEnd)
2621 : {
2622 0 : itNext = it;
2623 0 : ++itNext;
2624 :
2625 0 : (*it)->emit(a1, a2, a3, a4, a5);
2626 :
2627 0 : it = itNext;
2628 : }
2629 0 : }
2630 : };
2631 :
2632 :
2633 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2634 : class arg5_type, class arg6_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2635 : class signal6 : public _signal_base6<arg1_type, arg2_type, arg3_type,
2636 : arg4_type, arg5_type, arg6_type, mt_policy>
2637 : {
2638 : public:
2639 : typedef _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> base;
2640 : typedef typename base::connections_list connections_list;
2641 : using base::m_connected_slots;
2642 :
2643 : signal6()
2644 : {
2645 : ;
2646 : }
2647 :
2648 : signal6(const signal6<arg1_type, arg2_type, arg3_type, arg4_type,
2649 : arg5_type, arg6_type, mt_policy>& s)
2650 : : _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2651 : arg5_type, arg6_type, mt_policy>(s)
2652 : {
2653 : ;
2654 : }
2655 :
2656 : template<class desttype>
2657 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2658 : arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
2659 : {
2660 : lock_block<mt_policy> lock(this);
2661 : _connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2662 : arg5_type, arg6_type, mt_policy>* conn =
2663 : new _connection6<desttype, arg1_type, arg2_type, arg3_type,
2664 : arg4_type, arg5_type, arg6_type, mt_policy>(pclass, pmemfun);
2665 : m_connected_slots.push_back(conn);
2666 : pclass->signal_connect(this);
2667 : }
2668 :
2669 : void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2670 : arg5_type a5, arg6_type a6)
2671 : {
2672 : lock_block<mt_policy> lock(this);
2673 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2674 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2675 :
2676 : while(it != itEnd)
2677 : {
2678 : itNext = it;
2679 : ++itNext;
2680 :
2681 : (*it)->emit(a1, a2, a3, a4, a5, a6);
2682 :
2683 : it = itNext;
2684 : }
2685 : }
2686 :
2687 : void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2688 : arg5_type a5, arg6_type a6)
2689 : {
2690 : lock_block<mt_policy> lock(this);
2691 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2692 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2693 :
2694 : while(it != itEnd)
2695 : {
2696 : itNext = it;
2697 : ++itNext;
2698 :
2699 : (*it)->emit(a1, a2, a3, a4, a5, a6);
2700 :
2701 : it = itNext;
2702 : }
2703 : }
2704 : };
2705 :
2706 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2707 : class arg5_type, class arg6_type, class arg7_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2708 : class signal7 : public _signal_base7<arg1_type, arg2_type, arg3_type,
2709 : arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
2710 : {
2711 : public:
2712 : typedef _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2713 : arg5_type, arg6_type, arg7_type, mt_policy> base;
2714 : typedef typename base::connections_list connections_list;
2715 : using base::m_connected_slots;
2716 :
2717 : signal7()
2718 : {
2719 : ;
2720 : }
2721 :
2722 : signal7(const signal7<arg1_type, arg2_type, arg3_type, arg4_type,
2723 : arg5_type, arg6_type, arg7_type, mt_policy>& s)
2724 : : _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2725 : arg5_type, arg6_type, arg7_type, mt_policy>(s)
2726 : {
2727 : ;
2728 : }
2729 :
2730 : template<class desttype>
2731 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2732 : arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2733 : arg7_type))
2734 : {
2735 : lock_block<mt_policy> lock(this);
2736 : _connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2737 : arg5_type, arg6_type, arg7_type, mt_policy>* conn =
2738 : new _connection7<desttype, arg1_type, arg2_type, arg3_type,
2739 : arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(pclass, pmemfun);
2740 : m_connected_slots.push_back(conn);
2741 : pclass->signal_connect(this);
2742 : }
2743 :
2744 : void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2745 : arg5_type a5, arg6_type a6, arg7_type a7)
2746 : {
2747 : lock_block<mt_policy> lock(this);
2748 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2749 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2750 :
2751 : while(it != itEnd)
2752 : {
2753 : itNext = it;
2754 : ++itNext;
2755 :
2756 : (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2757 :
2758 : it = itNext;
2759 : }
2760 : }
2761 :
2762 : void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2763 : arg5_type a5, arg6_type a6, arg7_type a7)
2764 : {
2765 : lock_block<mt_policy> lock(this);
2766 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2767 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2768 :
2769 : while(it != itEnd)
2770 : {
2771 : itNext = it;
2772 : ++itNext;
2773 :
2774 : (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2775 :
2776 : it = itNext;
2777 : }
2778 : }
2779 : };
2780 :
2781 : template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2782 : class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2783 : class signal8 : public _signal_base8<arg1_type, arg2_type, arg3_type,
2784 : arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
2785 : {
2786 : public:
2787 : typedef _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2788 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> base;
2789 : typedef typename base::connections_list connections_list;
2790 : using base::m_connected_slots;
2791 :
2792 : signal8()
2793 : {
2794 : ;
2795 : }
2796 :
2797 : signal8(const signal8<arg1_type, arg2_type, arg3_type, arg4_type,
2798 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
2799 : : _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2800 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(s)
2801 : {
2802 : ;
2803 : }
2804 :
2805 : template<class desttype>
2806 : void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2807 : arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2808 : arg7_type, arg8_type))
2809 : {
2810 : lock_block<mt_policy> lock(this);
2811 : _connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2812 : arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn =
2813 : new _connection8<desttype, arg1_type, arg2_type, arg3_type,
2814 : arg4_type, arg5_type, arg6_type, arg7_type,
2815 : arg8_type, mt_policy>(pclass, pmemfun);
2816 : m_connected_slots.push_back(conn);
2817 : pclass->signal_connect(this);
2818 : }
2819 :
2820 : void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2821 : arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2822 : {
2823 : lock_block<mt_policy> lock(this);
2824 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2825 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2826 :
2827 : while(it != itEnd)
2828 : {
2829 : itNext = it;
2830 : ++itNext;
2831 :
2832 : (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2833 :
2834 : it = itNext;
2835 : }
2836 : }
2837 :
2838 : void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2839 : arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2840 : {
2841 : lock_block<mt_policy> lock(this);
2842 : typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2843 : typename connections_list::const_iterator itEnd = m_connected_slots.end();
2844 :
2845 : while(it != itEnd)
2846 : {
2847 : itNext = it;
2848 : ++itNext;
2849 :
2850 : (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2851 :
2852 : it = itNext;
2853 : }
2854 : }
2855 : };
2856 :
2857 : } // namespace sigslot
2858 :
2859 : #endif // TALK_BASE_SIGSLOT_H__
|